Ad Inserter – WordPress Ads Management with AdSense Header Integration - Version 2.2.14

Version Description

  • Added code generator for placeholders
  • Added option to disable caching (works with WP Super Cache, W3 Total Cache and WP Rocket)
  • Added options to configure classes for wrapping div
  • Added support for external tracking via Google Analytics and Piwik (Pro only)
  • Added support for MaxMind geolocation databases (Pro only)
  • Added option for close button on sticky ads (Pro only)
  • Fix for no paragraph counting inside nested elements
  • Few minor bug fixes, cosmetic changes and code improvements
Download this release

Release Info

Developer spacetime
Plugin Icon 128x128 Ad Inserter – WordPress Ads Management with AdSense Header Integration
Version 2.2.14
Comparing to
See all releases

Code changes from version 2.2.13 to 2.2.14

ad-inserter.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Ad Inserter
4
- Version: 2.2.13
5
  Description: Ad management plugin with advanced advertising options to automatically insert ad codes on your website
6
  Author: Igor Funa
7
  Author URI: http://igorfuna.com/
@@ -12,6 +12,17 @@ Plugin URI: http://adinserter.pro/documentation
12
 
13
  Change Log
14
 
 
 
 
 
 
 
 
 
 
 
 
15
  Ad Inserter 2.2.13 - 2017-12-25
16
  - Added option to disable inline alignment styles for code blocks (using alignment classes)
17
  - Fix for custom CSS codes with single quotation marks
@@ -539,9 +550,6 @@ if (version_compare ($wp_version, "4.0", "<")) {
539
  require_once AD_INSERTER_PLUGIN_DIR.'class.php';
540
  require_once AD_INSERTER_PLUGIN_DIR.'constants.php';
541
  require_once AD_INSERTER_PLUGIN_DIR.'settings.php';
542
- require_once AD_INSERTER_PLUGIN_DIR.'editor.php';
543
- require_once AD_INSERTER_PLUGIN_DIR.'preview.php';
544
- require_once AD_INSERTER_PLUGIN_DIR.'preview-adb.php';
545
 
546
  $version_array = explode (".", AD_INSERTER_VERSION);
547
  $version_string = "";
@@ -551,30 +559,27 @@ foreach ($version_array as $number) {
551
 
552
  $ai_wp_data [AI_WP_URL] = remove_debug_parameters_from_url ();
553
 
554
- //$ai_wp_data [AI_WP_DEBUGGING] = 0;
555
-
556
- //if (!is_admin()) {
557
- // if (!isset ($_GET [AI_URL_DEBUG]))
558
- // if (isset ($_GET [AI_URL_DEBUG_PROCESSING]) || (isset ($_COOKIE ['AI_WP_DEBUGGING']) && ($_COOKIE ['AI_WP_DEBUGGING'] & AI_DEBUG_PROCESSING) != 0)) {
559
- // if (!isset ($_GET [AI_URL_DEBUG_PROCESSING]) || $_GET [AI_URL_DEBUG_PROCESSING] == 1) {
560
- // $ai_wp_data [AI_WP_DEBUGGING] |= AI_DEBUG_PROCESSING;
561
-
562
- // $ai_total_plugin_time = 0;
563
- // $start_time = microtime (true);
564
- // $ai_total_php_time = 0;
565
- // $ai_last_time = microtime (true);
566
- // $ai_processing_log = array ();
567
- // ai_log ("INITIALIZATION START");
568
- // }
569
- // }
570
- //}
571
-
572
  $ad_inserter_globals = array ();
573
  $block_object = array ();
574
  $block_insertion_log = array ();
575
 
 
 
 
 
 
 
 
 
 
 
 
 
 
576
  ai_load_settings ();
577
- $ai_wp_data [AI_JS_DEBUGGING] = get_javascript_debugging ();
 
 
578
 
579
  if (isset ($_GET [AI_URL_DEBUG_PHP]) && $_GET [AI_URL_DEBUG_PHP] != '') {
580
  if (get_remote_debugging ()) {
@@ -630,25 +635,6 @@ if (get_dynamic_blocks ()) {
630
  }
631
 
632
 
633
- $ai_wp_data [AI_WP_PAGE_TYPE] = AI_PT_NONE;
634
- $ai_wp_data [AI_WP_AMP_PAGE] = false;
635
- $ai_wp_data [AI_WP_USER_SET] = false;
636
- $ai_wp_data [AI_WP_USER] = AI_USER_NOT_LOGGED_IN;
637
- $ai_wp_data [AI_CONTEXT] = AI_CONTEXT_NONE;
638
- $ai_wp_data [AI_SERVER_SIDE_DETECTION] = false;
639
- $ai_wp_data [AI_CLIENT_SIDE_DETECTION] = false;
640
- $ai_wp_data [AI_TRACKING] = false;
641
- $ai_wp_data [AI_STICKY_WIDGETS] = false;
642
-
643
- for ($counter = 1; $counter <= AD_INSERTER_BLOCKS; $counter ++) {
644
- $obj = $block_object [$counter];
645
-
646
- if ($obj->get_detection_server_side()) $ai_wp_data [AI_SERVER_SIDE_DETECTION] = true;
647
- if ($obj->get_detection_client_side ()) $ai_wp_data [AI_CLIENT_SIDE_DETECTION] = true;
648
-
649
- if ($obj->get_tracking ()) $ai_wp_data [AI_TRACKING] = true;
650
- }
651
-
652
  $adH = $block_object [AI_HEADER_OPTION_NAME];
653
  $adF = $block_object [AI_FOOTER_OPTION_NAME];
654
  if ($adH->get_detection_server_side()) $ai_wp_data [AI_SERVER_SIDE_DETECTION] = true;
@@ -676,13 +662,11 @@ if (isset ($_POST [AI_FORM_SAVE]))
676
 
677
 
678
  add_action ('wp_loaded', 'ai_wp_loaded_hook');
679
-
680
  add_action ('admin_menu', 'ai_admin_menu_hook');
681
-
682
  add_action ('init', 'ai_init_hook');
683
  add_action ('admin_notices', 'ai_admin_notice_hook');
684
-
685
  add_action ('wp', 'ai_wp_hook');
 
686
 
687
  if (function_exists ('ai_system_output_check')) $ai_system_output = ai_system_output_check (); else $ai_system_output = false;
688
 
@@ -711,6 +695,7 @@ if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0) {
711
 
712
 
713
 
 
714
  function ai_wp_default_editor () {
715
  return 'tinymce';
716
  }
@@ -719,6 +704,22 @@ function ai_wp_default_editor_html () {
719
  return 'html';
720
  }
721
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
722
  function ai_toolbar ($wp_admin_bar) {
723
  global $block_object, $ai_wp_data;
724
 
@@ -815,6 +816,8 @@ function ai_toolbar ($wp_admin_bar) {
815
  }
816
  }
817
 
 
 
818
  foreach ($paragraph_blocks as $index => $paragraph_block) {
819
  $block_class = $debug_positions === '' && in_array ($ai_wp_data [AI_WP_DEBUG_BLOCK], $paragraph_block ['blocks']) ? ' on' : '';
820
  $wp_admin_bar->add_node (array (
@@ -825,7 +828,7 @@ function ai_toolbar ($wp_admin_bar) {
825
  ($paragraph_block ['direction'] == 'b' ? ' <span class="dashicons dashicons-arrow-up-alt up-icon"></span>' : '').
826
  ($paragraph_block ['min'] != 0 ? ' min '.$paragraph_block ['min']. ' ' : '').
827
  ($paragraph_block ['max'] != 0 ? ' max '.$paragraph_block ['max']. ' ' : '').
828
- ($paragraph_block ['blockquote'] ? ' [blockquote] ' : '').
829
  ($paragraph_block ['text'] != '' ? ($paragraph_block ['text_type'] == AD_DO_NOT_CONTAIN ? ' NC ' : ' C ').' ['.htmlentities ($paragraph_block ['text']).']' : ''),
830
  'href' => set_url_parameter (AI_URL_DEBUG_POSITIONS, $paragraph_block ['blocks'][0]),
831
  ));
@@ -1360,13 +1363,6 @@ function ai_wp_hook () {
1360
  $ai_total_plugin_time += microtime (true) - $start_time;
1361
  ai_log ("WP HOOK END\n");
1362
  }
1363
-
1364
-
1365
-
1366
- // wp_dequeue_script ('jquery');
1367
- // wp_deregister_script ('jquery');
1368
-
1369
-
1370
  };
1371
 
1372
  function ai_init_hook() {
@@ -1464,6 +1460,9 @@ function ai_admin_enqueue_scripts ($hook_suffix) {
1464
  wp_enqueue_script ('ai-admin-js-gen', plugins_url ('includes/js/ai-admin.js', __FILE__ ), array (), AD_INSERTER_VERSION, true);
1465
  }
1466
 
 
 
 
1467
  function ai_clean_url ( $url, $original_url){
1468
  if (strpos ($url, 'async=') !== false && strpos ($url, '/plugins/ad-inserter') !== false) {
1469
  // $url = $original_url;
@@ -1491,9 +1490,23 @@ function add_head_inline_styles_and_scripts () {
1491
  echo ".ai-ip-data, .ai-ip-data-block {visibility: hidden; position: absolute; width: 100%; height: 100%; z-index: -9999;}\n";
1492
  }
1493
 
 
 
 
 
 
 
 
 
 
1494
  // if (defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES)
1495
  echo get_alignment_css ();
1496
 
 
 
 
 
 
1497
  if ($ai_wp_data [AI_WP_DEBUGGING] != 0) generate_debug_css ();
1498
 
1499
  if (get_admin_toolbar_debugging () && (get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) != 0))
@@ -1552,7 +1565,7 @@ function add_head_inline_styles_and_scripts () {
1552
  function ai_get_js ($js_name, $replace_js_data = true) {
1553
  global $ai_wp_data;
1554
 
1555
- if ($ai_wp_data [AI_JS_DEBUGGING]) {
1556
  $script = file_get_contents (AD_INSERTER_PLUGIN_DIR."includes/js/$js_name.js");
1557
  } else $script = file_get_contents (AD_INSERTER_PLUGIN_DIR."includes/js/$js_name.min.js");
1558
  if (!$replace_js_data) return $script;
@@ -1669,7 +1682,8 @@ function ai_replace_js_data ($js) {
1669
  $js = str_replace ('AI_VIEWPORTS', '[' . implode (',', $ai_wp_data [AI_VIEWPORTS]) . ']', $js);
1670
  $js = str_replace ('AI_VIEWPORT_NAMES', base64_encode ('["' . implode ('","', $ai_wp_data [AI_VIEWPORT_NAMES]) . '"]'), $js);
1671
  }
1672
- $js = str_replace ('AI_BLOCK_CLASS_NAME', get_block_class_name () != '' ? get_block_class_name () : DEFAULT_BLOCK_CLASS_NAME, $js);
 
1673
 
1674
  if (function_exists ('ai_replace_js_data_2')) ai_replace_js_data_2 ($js);
1675
 
@@ -1717,6 +1731,10 @@ function add_footer_inline_scripts () {
1717
  echo ai_get_js ('ai-sticky');
1718
  }
1719
 
 
 
 
 
1720
  if (defined ('AI_ADBLOCKING_DETECTION') && AI_ADBLOCKING_DETECTION) {
1721
  if ($ai_wp_data [AI_ADB_DETECTION]) {
1722
  if (!function_exists ('add_footer_inline_scripts_2')) echo ai_replace_js_data (ai_adb_code ());
@@ -2247,7 +2265,14 @@ function ai_amp_css_hook () {
2247
 
2248
  if (defined ('AI_AMP_HEADER_STYLES') && AI_AMP_HEADER_STYLES || $ai_wp_data [AI_WP_DEBUGGING] != 0) {
2249
 
2250
- if (defined ('AI_AMP_HEADER_STYLES') && AI_AMP_HEADER_STYLES) echo get_alignment_css ();
 
 
 
 
 
 
 
2251
 
2252
  if ($ai_wp_data [AI_WP_DEBUGGING] != 0) generate_debug_css ();
2253
  }
@@ -2270,6 +2295,8 @@ function ai_wp_footer_hook () {
2270
  }
2271
  }
2272
 
 
 
2273
  $ai_wp_data [AI_CONTEXT] = AI_CONTEXT_FOOTER;
2274
 
2275
  $footer = $block_object [AI_FOOTER_OPTION_NAME];
@@ -2514,6 +2541,7 @@ function ai_write_debug_info ($write_processing_log = false) {
2514
  }
2515
  }
2516
  echo 'BLOCK CLASS NAME: ', get_block_class_name (), "\n";
 
2517
  echo 'DYNAMIC BLOCKS: ';
2518
  switch (get_dynamic_blocks()) {
2519
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE:
@@ -2537,20 +2565,21 @@ function ai_write_debug_info ($write_processing_log = false) {
2537
  break;
2538
  }
2539
  echo "\n";
2540
- echo 'OUTPUT BUFFERING: ';
2541
- switch (get_output_buffering()) {
2542
- case AI_OUTPUT_BUFFERING_DISABLED:
2543
- echo AI_TEXT_DISABLED;
2544
- break;
2545
- case AI_OUTPUT_BUFFERING_ENABLED:
2546
- echo AI_TEXT_ENABLED;
2547
- break;
 
 
 
2548
  }
2549
- echo "\n";
2550
  echo 'PLUGIN PRIORITY: ', get_plugin_priority (), "\n";
2551
  echo 'HEADER CODE: ', $block_object [AI_HEADER_OPTION_NAME]->get_enable_manual () ? 'ENABLED' : 'DISABLED', "\n";
2552
  echo 'FOOTER CODE: ', $block_object [AI_FOOTER_OPTION_NAME]->get_enable_manual () ? 'ENABLED' : 'DISABLED', "\n";
2553
-
2554
  if (defined ('AI_ADBLOCKING_DETECTION') && AI_ADBLOCKING_DETECTION) {
2555
  echo 'AD BLOCKING DETECTION: ', $ai_wp_data [AI_ADB_DETECTION] ? 'ENABLED' : 'DISABLED', "\n";
2556
  if ($ai_wp_data [AI_ADB_DETECTION]) {
@@ -2852,6 +2881,10 @@ function ai_check_multisite_options (&$multisite_options) {
2852
  if (!isset ($multisite_options ['MULTISITE_PHP_PROCESSING'])) $multisite_options ['MULTISITE_PHP_PROCESSING'] = DEFAULT_MULTISITE_PHP_PROCESSING;
2853
  if (!isset ($multisite_options ['MULTISITE_EXCEPTIONS'])) $multisite_options ['MULTISITE_EXCEPTIONS'] = DEFAULT_MULTISITE_EXCEPTIONS;
2854
  if (!isset ($multisite_options ['MULTISITE_MAIN_FOR_ALL_BLOGS'])) $multisite_options ['MULTISITE_MAIN_FOR_ALL_BLOGS'] = DEFAULT_MULTISITE_MAIN_FOR_ALL_BLOGS;
 
 
 
 
2855
  }
2856
 
2857
  function ai_check_plugin_options ($plugin_options = array ()) {
@@ -2862,7 +2895,8 @@ function ai_check_plugin_options ($plugin_options = array ()) {
2862
  if (!isset ($plugin_options ['SYNTAX_HIGHLIGHTER_THEME'])) $plugin_options ['SYNTAX_HIGHLIGHTER_THEME'] = DEFAULT_SYNTAX_HIGHLIGHTER_THEME;
2863
 
2864
  if (!isset ($plugin_options ['BLOCK_CLASS_NAME'])) $plugin_options ['BLOCK_CLASS_NAME'] = DEFAULT_BLOCK_CLASS_NAME;
2865
-
 
2866
  if (!isset ($plugin_options ['INLINE_STYLES'])) $plugin_options ['INLINE_STYLES'] = DEFAULT_INLINE_STYLES;
2867
 
2868
  if (!isset ($plugin_options ['MINIMUM_USER_ROLE'])) $plugin_options ['MINIMUM_USER_ROLE'] = DEFAULT_MINIMUM_USER_ROLE;
@@ -2914,7 +2948,8 @@ function ai_check_plugin_options ($plugin_options = array ()) {
2914
  if (!isset ($plugin_options ['ADB_UNDISMISSIBLE_MESSAGE'])) $plugin_options ['ADB_UNDISMISSIBLE_MESSAGE'] = AI_DEFAULT_ADB_UNDISMISSIBLE_MESSAGE;
2915
  if (!isset ($plugin_options ['ADMIN_TOOLBAR_DEBUGGING'])) $plugin_options ['ADMIN_TOOLBAR_DEBUGGING'] = DEFAULT_ADMIN_TOOLBAR_DEBUGGING;
2916
  if (!isset ($plugin_options ['REMOTE_DEBUGGING'])) $plugin_options ['REMOTE_DEBUGGING'] = DEFAULT_REMOTE_DEBUGGING;
2917
- if (!isset ($plugin_options ['JAVASCRIPT_DEBUGGING'])) $plugin_options ['JAVASCRIPT_DEBUGGING'] = DEFAULT_JAVASCRIPT_DEBUGGING;
 
2918
 
2919
  for ($viewport = 1; $viewport <= AD_INSERTER_VIEWPORTS; $viewport ++) {
2920
  $viewport_name_option_name = 'VIEWPORT_NAME_' . $viewport;
@@ -3041,14 +3076,32 @@ function get_syntax_highlighter_theme () {
3041
  return ($ai_db_options [AI_OPTION_GLOBAL]['SYNTAX_HIGHLIGHTER_THEME']);
3042
  }
3043
 
3044
- function get_block_class_name () {
3045
  global $ai_db_options;
3046
 
3047
  if (!isset ($ai_db_options [AI_OPTION_GLOBAL]['BLOCK_CLASS_NAME'])) $ai_db_options [AI_OPTION_GLOBAL]['BLOCK_CLASS_NAME'] = DEFAULT_BLOCK_CLASS_NAME;
3048
 
 
 
3049
  return ($ai_db_options [AI_OPTION_GLOBAL]['BLOCK_CLASS_NAME']);
3050
  }
3051
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3052
  function get_inline_styles () {
3053
  global $ai_db_options;
3054
 
@@ -3137,12 +3190,20 @@ function get_remote_debugging () {
3137
  return ($ai_db_options [AI_OPTION_GLOBAL]['REMOTE_DEBUGGING']);
3138
  }
3139
 
3140
- function get_javascript_debugging () {
 
 
 
 
 
 
 
 
3141
  global $ai_db_options;
3142
 
3143
- if (!isset ($ai_db_options [AI_OPTION_GLOBAL]['JAVASCRIPT_DEBUGGING'])) $ai_db_options [AI_OPTION_GLOBAL]['JAVASCRIPT_DEBUGGING'] = DEFAULT_JAVASCRIPT_DEBUGGING;
3144
 
3145
- return ($ai_db_options [AI_OPTION_GLOBAL]['JAVASCRIPT_DEBUGGING']);
3146
  }
3147
 
3148
  function get_viewport_name ($viewport_number) {
@@ -3502,6 +3563,7 @@ function ai_ajax_backend () {
3502
  if (isset ($_POST ["preview"])) {
3503
  $block = urldecode ($_POST ["preview"]);
3504
  if (is_numeric ($block) && $block >= 1 && $block <= AD_INSERTER_BLOCKS) {
 
3505
  generate_code_preview (
3506
  $block,
3507
  // wp_unslash (urldecode ($_POST ["name"])),
@@ -3520,12 +3582,14 @@ function ai_ajax_backend () {
3520
  );
3521
  }
3522
  elseif ($block == 'adb') {
 
3523
  // generate_code_preview_adb (wp_unslash (urldecode (base64_decode ($_POST ["code"]))), urldecode ($_POST ["php"]) == 1);
3524
  generate_code_preview_adb (base64_decode ($_POST ["code"]), $_POST ["php"] == 1);
3525
  }
3526
  elseif ($block == 'adsense') {
3527
 
3528
  if (defined ('AI_ADSENSE_API')) {
 
3529
  require_once AD_INSERTER_PLUGIN_DIR.'includes/adsense-api.php';
3530
 
3531
  if (defined ('AI_ADSENSE_AUTHORIZATION_CODE')) {
@@ -3553,11 +3617,21 @@ function ai_ajax_backend () {
3553
 
3554
  elseif (isset ($_POST ["edit"])) {
3555
  if (is_numeric ($_POST ["edit"]) && $_POST ["edit"] >= 1 && $_POST ["edit"] <= AD_INSERTER_BLOCKS) {
 
3556
  // generate_code_editor ($_POST ["edit"], wp_unslash (urldecode (base64_decode ($_POST ["code"]))), urldecode ($_POST ["php"]) == 1);
3557
  generate_code_editor ($_POST ["edit"], base64_decode ($_POST ["code"]), $_POST ["php"] == 1);
3558
  }
3559
  }
3560
 
 
 
 
 
 
 
 
 
 
3561
  elseif (isset ($_POST ["generate-code"])) {
3562
  $code_generator = new ai_code_generator ();
3563
 
@@ -3649,6 +3723,15 @@ function ai_ajax_backend () {
3649
  generate_settings_form ();
3650
  }
3651
 
 
 
 
 
 
 
 
 
 
3652
  elseif (function_exists ('ai_ajax_backend_2')) {
3653
  ai_ajax_backend_2 ();
3654
  }
@@ -3859,6 +3942,12 @@ function ai_load_settings () {
3859
  $obj = new ai_Block ($block);
3860
  $obj->load_options ($block);
3861
  $block_object [$block] = $obj;
 
 
 
 
 
 
3862
  }
3863
 
3864
  $adH = new ai_AdH();
@@ -3940,8 +4029,7 @@ function get_main_alignment_css ($alt_styles_text) {
3940
  function generate_alignment_css () {
3941
  global $ai_db_options_extract, $block_object;
3942
 
3943
- $block_class_name = get_block_class_name ();
3944
- if ($block_class_name == '') $block_class_name = DEFAULT_BLOCK_CLASS_NAME . '-'; else $block_class_name .= '-';
3945
 
3946
  $styles = array ();
3947
 
@@ -4033,9 +4121,8 @@ a.ai-debug-right {float: right; font-size: 10px; text-decoration: none; color: #
4033
 
4034
  .ai-debug-bar {padding: 1px 0 1px 5px; color: white; font-size: 12px; line-height: 20px; text-align: center;}
4035
  .ai-debug-bar-left {text-align: left;}
4036
- .ai-debug-bar a {color: white;}
4037
 
4038
- .ai-debug-bar a, .ai-debug-bar a:link, .ai-debug-bar a {text-decoration: none; color: white;}
4039
  .ai-debug-bar a.ai-debug-text-left {float: left;}
4040
  .ai-debug-bar a.ai-debug-text-right, .ai-debug-bar kbd.ai-debug-text-right {float: right; padding-right: 3px;}
4041
 
@@ -4077,91 +4164,117 @@ function ai_settings () {
4077
  // Try to import individual settings
4078
  $ai_options = array ();
4079
 
 
4080
  for ($block = 1; $block <= AD_INSERTER_BLOCKS; $block ++) {
4081
- $ad = new ai_Block ($block);
 
4082
 
4083
  if (isset ($ai_db_options [$block])) $saved_settings = wp_slash ($ai_db_options [$block]); else
4084
- $saved_settings = wp_slash ($ad->wp_options);
 
 
4085
 
4086
  if ($block < $start || $block > $end) {
 
4087
  $ai_options [$block] = $saved_settings;
4088
  continue;
4089
  }
4090
 
4091
- // $block_settings = 0;
4092
  $import_switch_name = AI_OPTION_IMPORT . WP_FORM_FIELD_POSTFIX . $block;
4093
  $import_name_switch_name = AI_OPTION_IMPORT_NAME . WP_FORM_FIELD_POSTFIX . $block;
4094
  if (isset ($_POST [$import_switch_name]) && $_POST [$import_switch_name] == "1") {
4095
 
 
4096
  $exported_settings = @unserialize (base64_decode (str_replace (array ("\\\""), array ("\""), $_POST ["export_settings_" . $block])));
4097
 
4098
  if ($exported_settings !== false) {
4099
  $exported_settings = wp_slash ($exported_settings);
4100
- foreach (array_keys ($ad->wp_options) as $key){
4101
  if ($key == AI_OPTION_BLOCK_NAME && isset ($_POST [$import_name_switch_name]) && $_POST [$import_name_switch_name] != "1") {
4102
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . $block;
4103
  if (isset ($_POST [$form_field_name])){
4104
- $ad->wp_options [$key] = filter_option ($key, $_POST [$form_field_name]);
 
 
 
 
4105
  }
4106
  } else {
4107
  if (isset ($exported_settings [$key])) {
4108
- $ad->wp_options [$key] = filter_option ($key, $exported_settings [$key], false);
4109
- // $block_settings ++;
 
 
4110
  }
4111
  }
4112
  }
4113
  } else {
4114
- $ad->wp_options = $saved_settings;
 
4115
  $invalid_blocks []= $block;
4116
  }
4117
  } else {
4118
- foreach (array_keys ($ad->wp_options) as $key){
 
4119
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . $block;
4120
  if (isset ($_POST [$form_field_name])){
4121
 
4122
- // if ($key == AI_OPTION_CODE)
4123
- // $ad->wp_options [$key] = filter_option ($key, base64_decode ($_POST [$form_field_name])); else
4124
-
4125
- $ad->wp_options [$key] = filter_option ($key, $_POST [$form_field_name]);
4126
 
4127
- // $block_settings ++;
 
4128
  }
4129
  }
4130
  }
4131
 
4132
- $ai_options [$block] = $ad->wp_options;
 
 
4133
  delete_option (str_replace ("#", $block, AD_ADx_OPTIONS));
4134
  }
4135
 
4136
- $adH = new ai_AdH();
4137
- $adF = new ai_AdF();
4138
-
4139
- foreach(array_keys ($adH->wp_options) as $key){
4140
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . AI_HEADER_OPTION_NAME;
4141
  if(isset ($_POST [$form_field_name])){
4142
- $adH->wp_options [$key] = filter_option_hf ($key, $_POST [$form_field_name]);
 
 
4143
  }
4144
  }
 
 
 
4145
 
4146
- foreach(array_keys($adF->wp_options) as $key){
 
 
4147
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . AI_FOOTER_OPTION_NAME;
4148
  if(isset ($_POST [$form_field_name])){
4149
- $adF->wp_options [$key] = filter_option_hf ($key, $_POST [$form_field_name]);
 
 
4150
  }
4151
  }
4152
-
4153
- $ai_options [AI_HEADER_OPTION_NAME] = $adH->wp_options;
4154
- $ai_options [AI_FOOTER_OPTION_NAME] = $adF->wp_options;
4155
 
4156
  if (defined ('AI_ADBLOCKING_DETECTION') && AI_ADBLOCKING_DETECTION) {
4157
- $adA = new ai_AdA();
4158
- foreach(array_keys($adA->wp_options) as $key){
 
4159
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . AI_ADB_MESSAGE_OPTION_NAME;
4160
  if(isset ($_POST [$form_field_name])){
4161
- $adA->wp_options [$key] = filter_option_hf ($key, $_POST [$form_field_name]);
 
 
4162
  }
4163
  }
4164
- $ai_options [AI_ADB_MESSAGE_OPTION_NAME] = $adA->wp_options;
 
 
4165
  }
4166
 
4167
  $options = array ();
@@ -4170,6 +4283,8 @@ function ai_settings () {
4170
 
4171
  if (isset ($_POST ['syntax-highlighter-theme'])) $options ['SYNTAX_HIGHLIGHTER_THEME'] = filter_string ($_POST ['syntax-highlighter-theme']);
4172
  if (isset ($_POST ['block-class-name'])) $options ['BLOCK_CLASS_NAME'] = filter_html_class ($_POST ['block-class-name']);
 
 
4173
  if (isset ($_POST ['inline-styles'])) $options ['INLINE_STYLES'] = filter_option ('INLINE_STYLES', $_POST ['inline-styles']);
4174
  if (isset ($_POST ['minimum-user-role'])) $options ['MINIMUM_USER_ROLE'] = filter_string ($_POST ['minimum-user-role']);
4175
  if (isset ($_POST ['sticky-widget-mode'])) $options ['STICKY_WIDGET_MODE'] = filter_option ('STICKY_WIDGET_MODE', $_POST ['sticky-widget-mode']);
@@ -4190,7 +4305,8 @@ function ai_settings () {
4190
  if (isset ($_POST [AI_OPTION_ADB_UNDISMISSIBLE_MESSAGE])) $options ['ADB_UNDISMISSIBLE_MESSAGE'] = filter_option ('ADB_UNDISMISSIBLE_MESSAGE', $_POST [AI_OPTION_ADB_UNDISMISSIBLE_MESSAGE]);
4191
  if (isset ($_POST ['admin_toolbar_debugging'])) $options ['ADMIN_TOOLBAR_DEBUGGING'] = filter_option ('ADMIN_TOOLBAR_DEBUGGING', $_POST ['admin_toolbar_debugging']);
4192
  if (isset ($_POST ['remote_debugging'])) $options ['REMOTE_DEBUGGING'] = filter_option ('REMOTE_DEBUGGING', $_POST ['remote_debugging']);
4193
- if (isset ($_POST ['javascript_debugging'])) $options ['JAVASCRIPT_DEBUGGING'] = filter_option ('JAVASCRIPT_DEBUGGING', $_POST ['javascript_debugging']);
 
4194
 
4195
  for ($viewport = 1; $viewport <= AD_INSERTER_VIEWPORTS; $viewport ++) {
4196
  if (isset ($_POST ['viewport-name-'.$viewport])) $options ['VIEWPORT_NAME_'.$viewport] = filter_string ($_POST ['viewport-name-'.$viewport]);
@@ -4254,7 +4370,6 @@ function ai_settings () {
4254
  delete_option (AD_OPTIONS);
4255
 
4256
  echo "<div class='notice notice-success is-dismissible' style='margin: 5px 15px 2px 0px;'><p><strong>Settings saved.</strong></p></div>";
4257
-
4258
  } elseif (isset ($_POST [AI_FORM_CLEAR])) {
4259
 
4260
  check_admin_referer ('save_adinserter_settings');
@@ -4738,205 +4853,6 @@ function ai_excerpt_hook ($content = '') {
4738
  return $content;
4739
  }
4740
 
4741
- // Deprecated
4742
- // Process Before / After Post postion
4743
- /*
4744
- function ai_before_after_post ($query, $automatic_insertion) {
4745
- global $block_object, $ad_inserter_globals, $ai_db_options_extract, $ai_wp_data, $ai_last_check;
4746
-
4747
- $debug_processing = ($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0;
4748
-
4749
- if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_ADMIN) return;
4750
-
4751
- // Not used on AMP pages (yet)
4752
- if (!$ai_wp_data [AI_WP_AMP_PAGE]) {
4753
- if (!method_exists ($query, 'is_main_query')) return;
4754
- if (!$query->is_main_query()) return;
4755
- }
4756
-
4757
- $globals_name = $automatic_insertion == AI_AUTOMATIC_INSERTION_BEFORE_POST ? AI_LOOP_BEFORE_COUNTER_NAME : AI_LOOP_AFTER_COUNTER_NAME;
4758
-
4759
- if (!isset ($ad_inserter_globals [$globals_name])) {
4760
- $ad_inserter_globals [$globals_name] = 1;
4761
- } else $ad_inserter_globals [$globals_name] ++;
4762
-
4763
- $ai_wp_data [AI_CONTEXT] = $automatic_insertion == AI_AUTOMATIC_INSERTION_BEFORE_POST ? AI_CONTEXT_BEFORE_POST : AI_CONTEXT_AFTER_POST;
4764
-
4765
- if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_POSITIONS) != 0) {
4766
-
4767
- $counter = $ad_inserter_globals [$globals_name];
4768
- if ($counter == 1) $counter = '';
4769
-
4770
- $class = AI_DEBUG_POSITIONS_CLASS;
4771
-
4772
- if ($ai_wp_data [AI_WP_AMP_PAGE] && $automatic_insertion == AI_AUTOMATIC_INSERTION_BEFORE_POST) echo get_page_type_debug_info ('AMP ');
4773
- echo "<section class='$class'>".($automatic_insertion == AI_AUTOMATIC_INSERTION_BEFORE_POST ? "BEFORE" : "AFTER")." POST ".$counter."</section>";
4774
- if ($ai_wp_data [AI_WP_AMP_PAGE] && $automatic_insertion == AI_AUTOMATIC_INSERTION_AFTER_POST) echo get_page_type_debug_info ('AMP ');
4775
- }
4776
-
4777
- if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_POST || $ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_STATIC) {
4778
- $meta_value = get_post_meta (get_the_ID (), '_adinserter_block_exceptions', true);
4779
- $selected_blocks = explode (",", $meta_value);
4780
- } else $selected_blocks = array ();
4781
-
4782
- $ad_code = "";
4783
-
4784
- $ai_last_check = AI_CHECK_NONE;
4785
- $current_block = 0;
4786
-
4787
-
4788
- $extract_index = $automatic_insertion == AI_AUTOMATIC_INSERTION_BEFORE_POST ? LOOP_START_HOOK_BLOCKS : LOOP_END_HOOK_BLOCKS;
4789
- if (isset ($ai_db_options_extract [$extract_index][$ai_wp_data [AI_WP_PAGE_TYPE]]))
4790
- foreach ($ai_db_options_extract [$extract_index][$ai_wp_data [AI_WP_PAGE_TYPE]] as $block) {
4791
- if ($debug_processing && $ai_last_check != AI_CHECK_NONE) ai_log (ai_log_block_status ($current_block, $ai_last_check));
4792
-
4793
- if (!isset ($block_object [$block])) continue;
4794
-
4795
- $current_block = $block;
4796
-
4797
- $obj = $block_object [$block];
4798
- $obj->clear_code_cache ();
4799
-
4800
- if (!$obj->check_server_side_detection ()) continue;
4801
- if (!$obj->check_page_types_lists_users ()) continue;
4802
- if (!$obj->check_post_page_exceptions ($selected_blocks)) continue;
4803
- if (!$obj->check_filter ($ad_inserter_globals [$globals_name])) continue;
4804
- if (!$obj->check_number_of_words ()) continue;
4805
-
4806
- // Last check before counter check before insertion
4807
- $ai_last_check = AI_CHECK_CODE;
4808
- if ($obj->ai_getCode () == '') continue;
4809
-
4810
- // Last check before insertion
4811
- if (!$obj->check_and_increment_block_counter ()) continue;
4812
-
4813
- $ai_last_check = AI_CHECK_DEBUG_NO_INSERTION;
4814
- if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_NO_INSERTION) == 0) {
4815
- $ad_code .= $obj->get_code_for_insertion ();
4816
- $ai_last_check = AI_CHECK_INSERTED;
4817
- }
4818
- }
4819
- if ($debug_processing && $ai_last_check != AI_CHECK_NONE) ai_log (ai_log_block_status ($current_block, $ai_last_check));
4820
-
4821
- echo $ad_code;
4822
- }
4823
-
4824
- // Deprecated
4825
- // Process Before Post postion
4826
- function ai_loop_start_hook ($query) {
4827
- global $ai_wp_data, $ai_total_plugin_time;
4828
- $debug_processing = ($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0;
4829
- if ($debug_processing) {
4830
- ai_log ("LOOP START HOOK START");
4831
- $start_time = microtime (true);
4832
- }
4833
- ai_before_after_post ($query, AI_AUTOMATIC_INSERTION_BEFORE_POST);
4834
- if ($debug_processing) {
4835
- $ai_total_plugin_time += microtime (true) - $start_time;
4836
- ai_log ("LOOP START HOOK END\n");
4837
- }
4838
- }
4839
-
4840
-
4841
- // Deprecated
4842
- // Process After Post postion
4843
- function ai_loop_end_hook ($query){
4844
- global $ai_wp_data, $ai_total_plugin_time;
4845
- $debug_processing = ($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0;
4846
- if ($debug_processing) {
4847
- ai_log ("LOOP END HOOK START");
4848
- $start_time = microtime (true);
4849
- }
4850
- ai_before_after_post ($query, AI_AUTOMATIC_INSERTION_AFTER_POST);
4851
- if ($debug_processing) {
4852
- $ai_total_plugin_time += microtime (true) - $start_time;
4853
- ai_log ("LOOP END HOOK END\n");
4854
- }
4855
- }
4856
-
4857
-
4858
- // Deprecated
4859
- // Process Between Posts postion
4860
- function ai_post_hook ($post) {
4861
- global $block_object, $ad_inserter_globals, $ai_db_options_extract, $ai_wp_data, $ai_last_check, $ai_total_plugin_time;
4862
-
4863
- if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_ADMIN) return;
4864
-
4865
- if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_POST) return;
4866
- if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_STATIC) return;
4867
-
4868
- // Not used on AMP pages (yet)
4869
- if (!$ai_wp_data [AI_WP_AMP_PAGE]) {
4870
- if (!in_the_loop()) return;
4871
- }
4872
-
4873
- if (!isset ($ad_inserter_globals [AI_POST_COUNTER_NAME])) {
4874
- $ad_inserter_globals [AI_POST_COUNTER_NAME] = 0;
4875
- } else $ad_inserter_globals [AI_POST_COUNTER_NAME] ++;
4876
-
4877
- if ($ad_inserter_globals [AI_POST_COUNTER_NAME] == 0) return;
4878
-
4879
- $debug_processing = ($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0;
4880
- if ($debug_processing) {
4881
- ai_log ('POST HOOK START [' . $ad_inserter_globals [AI_POST_COUNTER_NAME] . ']');
4882
- $start_time = microtime (true);
4883
- }
4884
-
4885
- $ai_wp_data [AI_CONTEXT] = AI_CONTEXT_BETWEEN_POSTS;
4886
-
4887
- if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_POSITIONS) != 0) {
4888
-
4889
- $class = AI_DEBUG_POSITIONS_CLASS;
4890
-
4891
- echo "<section class='$class'>BETWEEN POSTS ".$ad_inserter_globals [AI_POST_COUNTER_NAME]."</section>";
4892
- }
4893
-
4894
- $ad_code = "";
4895
-
4896
- $ai_last_check = AI_CHECK_NONE;
4897
- $current_block = 0;
4898
-
4899
- if (isset ($ai_db_options_extract [POST_HOOK_BLOCKS][$ai_wp_data [AI_WP_PAGE_TYPE]]))
4900
- foreach ($ai_db_options_extract [POST_HOOK_BLOCKS][$ai_wp_data [AI_WP_PAGE_TYPE]] as $block) {
4901
- if ($debug_processing && $ai_last_check != AI_CHECK_NONE) ai_log (ai_log_block_status ($current_block, $ai_last_check));
4902
-
4903
- if (!isset ($block_object [$block])) continue;
4904
-
4905
- $current_block = $block;
4906
-
4907
- $obj = $block_object [$block];
4908
- $obj->clear_code_cache ();
4909
-
4910
- if (!$obj->check_server_side_detection ()) continue;
4911
- if (!$obj->check_page_types_lists_users ()) continue;
4912
- if (!$obj->check_filter ($ad_inserter_globals [AI_POST_COUNTER_NAME])) continue;
4913
-
4914
- // Last check before counter check before insertion
4915
- $ai_last_check = AI_CHECK_CODE;
4916
- if ($obj->ai_getCode () == '') continue;
4917
-
4918
- // Last check before insertion
4919
- if (!$obj->check_and_increment_block_counter ()) continue;
4920
-
4921
- $ai_last_check = AI_CHECK_DEBUG_NO_INSERTION;
4922
- if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_NO_INSERTION) == 0) {
4923
- $ad_code .= $obj->get_code_for_insertion ();
4924
- $ai_last_check = AI_CHECK_INSERTED;
4925
- }
4926
- }
4927
- if ($debug_processing && $ai_last_check != AI_CHECK_NONE) ai_log (ai_log_block_status ($current_block, $ai_last_check));
4928
-
4929
- echo $ad_code;
4930
-
4931
- if ($debug_processing) {
4932
- $ai_total_plugin_time += microtime (true) - $start_time;
4933
- ai_log ("POST HOOK END\n");
4934
- }
4935
-
4936
- return $post;
4937
- }
4938
- */
4939
-
4940
  function ai_comments_array ($comments , $post_id ){
4941
  global $ai_wp_data;
4942
 
@@ -5307,6 +5223,7 @@ function ai_process_shortcode (&$block, $atts) {
5307
 
5308
  $parameters = shortcode_atts (array (
5309
  "block" => "",
 
5310
  "name" => "",
5311
  "ignore" => "",
5312
  "check" => "",
@@ -5351,6 +5268,13 @@ function ai_process_shortcode (&$block, $atts) {
5351
  }
5352
 
5353
  $block = - 1;
 
 
 
 
 
 
 
5354
  if (is_numeric ($parameters ['block'])) {
5355
  $block = intval ($parameters ['block']);
5356
  } elseif ($parameters ['name'] != '') {
@@ -5368,14 +5292,16 @@ function ai_process_shortcode (&$block, $atts) {
5368
  }
5369
 
5370
  if ($block == - 1) {
 
 
 
 
 
5371
  if ($parameters ['rotate'] != '' || in_array ('ROTATE', $atts) || in_array ('rotate', $atts)) {
5372
  if (!isset ($ai_wp_data [AI_SHORTCODES]['rotate'])) $ai_wp_data [AI_SHORTCODES]['rotate'] = array ();
5373
  $ai_wp_data [AI_SHORTCODES]['rotate'] []= $parameters;
5374
  return AD_ROTATE_SEPARATOR;
5375
  }
5376
- if ($parameters ['count'] != '' || in_array ('COUNT', $atts) || in_array ('count', $atts)) {
5377
- return AD_COUNT_SEPARATOR;
5378
- }
5379
  if ($parameters ['amp'] != '' || in_array ('AMP', $atts) || in_array ('amp', $atts)) {
5380
  return AD_AMP_SEPARATOR;
5381
  }
@@ -5457,7 +5383,7 @@ function ai_process_shortcode (&$block, $atts) {
5457
  $ai_last_check = AI_CHECK_DEBUG_NO_INSERTION;
5458
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_NO_INSERTION) == 0) {
5459
  $ai_last_check = AI_CHECK_INSERTED;
5460
- return $obj->get_code_for_insertion ();
5461
  }
5462
  }
5463
 
1
  <?php
2
  /*
3
  Plugin Name: Ad Inserter
4
+ Version: 2.2.14
5
  Description: Ad management plugin with advanced advertising options to automatically insert ad codes on your website
6
  Author: Igor Funa
7
  Author URI: http://igorfuna.com/
12
 
13
  Change Log
14
 
15
+ Ad Inserter 2.2.14 - 2018-01-04
16
+ - Added code generator for placeholders
17
+ - Added option to disable caching (works with WP Super Cache, W3 Total Cache and WP Rocket)
18
+ - Added shortcut option to generate only block code (no wrapping div)
19
+ - Added options to configure classes for wrapping div
20
+ - Added support for external tracking via Google Analytics and Piwik (Pro only)
21
+ - Added support for MaxMind geolocation databases (Pro only)
22
+ - Added option for close button on sticky ads (Pro only)
23
+ - Fix for no paragraph counting inside nested elements
24
+ - Few minor bug fixes, cosmetic changes and code improvements
25
+
26
  Ad Inserter 2.2.13 - 2017-12-25
27
  - Added option to disable inline alignment styles for code blocks (using alignment classes)
28
  - Fix for custom CSS codes with single quotation marks
550
  require_once AD_INSERTER_PLUGIN_DIR.'class.php';
551
  require_once AD_INSERTER_PLUGIN_DIR.'constants.php';
552
  require_once AD_INSERTER_PLUGIN_DIR.'settings.php';
 
 
 
553
 
554
  $version_array = explode (".", AD_INSERTER_VERSION);
555
  $version_string = "";
559
 
560
  $ai_wp_data [AI_WP_URL] = remove_debug_parameters_from_url ();
561
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  $ad_inserter_globals = array ();
563
  $block_object = array ();
564
  $block_insertion_log = array ();
565
 
566
+ $ai_wp_data [AI_WP_PAGE_TYPE] = AI_PT_NONE;
567
+ $ai_wp_data [AI_WP_AMP_PAGE] = false;
568
+ $ai_wp_data [AI_WP_USER_SET] = false;
569
+ $ai_wp_data [AI_WP_USER] = AI_USER_NOT_LOGGED_IN;
570
+ $ai_wp_data [AI_CONTEXT] = AI_CONTEXT_NONE;
571
+
572
+ $ai_wp_data [AI_SERVER_SIDE_DETECTION] = false;
573
+ $ai_wp_data [AI_CLIENT_SIDE_DETECTION] = false;
574
+ $ai_wp_data [AI_TRACKING] = false;
575
+ $ai_wp_data [AI_STICKY_WIDGETS] = false;
576
+ $ai_wp_data [AI_CLOSE_BUTTONS] = false;
577
+ $ai_wp_data [AI_DISABLE_CACHING] = false;
578
+
579
  ai_load_settings ();
580
+
581
+ $ai_wp_data [AI_BACKEND_JS_DEBUGGING] = get_backend_javascript_debugging ();
582
+ $ai_wp_data [AI_FRONTEND_JS_DEBUGGING] = get_frontend_javascript_debugging ();
583
 
584
  if (isset ($_GET [AI_URL_DEBUG_PHP]) && $_GET [AI_URL_DEBUG_PHP] != '') {
585
  if (get_remote_debugging ()) {
635
  }
636
 
637
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
638
  $adH = $block_object [AI_HEADER_OPTION_NAME];
639
  $adF = $block_object [AI_FOOTER_OPTION_NAME];
640
  if ($adH->get_detection_server_side()) $ai_wp_data [AI_SERVER_SIDE_DETECTION] = true;
662
 
663
 
664
  add_action ('wp_loaded', 'ai_wp_loaded_hook');
 
665
  add_action ('admin_menu', 'ai_admin_menu_hook');
 
666
  add_action ('init', 'ai_init_hook');
667
  add_action ('admin_notices', 'ai_admin_notice_hook');
 
668
  add_action ('wp', 'ai_wp_hook');
669
+ //add_action( 'wp_enqueue_scripts', 'ai_wp_enqueue_scripts_hook' );
670
 
671
  if (function_exists ('ai_system_output_check')) $ai_system_output = ai_system_output_check (); else $ai_system_output = false;
672
 
695
 
696
 
697
 
698
+
699
  function ai_wp_default_editor () {
700
  return 'tinymce';
701
  }
704
  return 'html';
705
  }
706
 
707
+ function ai_disable_caching () {
708
+ // WP Super Cache, W3 Total Cache, WP Rocket
709
+ if (!defined('DONOTCACHEPAGE'))
710
+ define('DONOTCACHEPAGE', true);
711
+
712
+ if (!defined('DONOTCACHEOBJECT'))
713
+ define('DONOTCACHEOBJECT', true);
714
+
715
+ if (!defined('DONOTCACHEDB'))
716
+ define('DONOTCACHEDB', true);
717
+
718
+ if (!headers_sent () && !is_user_logged_in ()) {
719
+ header('Cache-Control: private, proxy-revalidate, s-maxage=0');
720
+ }
721
+ }
722
+
723
  function ai_toolbar ($wp_admin_bar) {
724
  global $block_object, $ai_wp_data;
725
 
816
  }
817
  }
818
 
819
+ $no_paragraph_counting_inside = get_no_paragraph_counting_inside ();
820
+
821
  foreach ($paragraph_blocks as $index => $paragraph_block) {
822
  $block_class = $debug_positions === '' && in_array ($ai_wp_data [AI_WP_DEBUG_BLOCK], $paragraph_block ['blocks']) ? ' on' : '';
823
  $wp_admin_bar->add_node (array (
828
  ($paragraph_block ['direction'] == 'b' ? ' <span class="dashicons dashicons-arrow-up-alt up-icon"></span>' : '').
829
  ($paragraph_block ['min'] != 0 ? ' min '.$paragraph_block ['min']. ' ' : '').
830
  ($paragraph_block ['max'] != 0 ? ' max '.$paragraph_block ['max']. ' ' : '').
831
+ ($paragraph_block ['blockquote'] ? ' +[' . $no_paragraph_counting_inside . '] ' : '').
832
  ($paragraph_block ['text'] != '' ? ($paragraph_block ['text_type'] == AD_DO_NOT_CONTAIN ? ' NC ' : ' C ').' ['.htmlentities ($paragraph_block ['text']).']' : ''),
833
  'href' => set_url_parameter (AI_URL_DEBUG_POSITIONS, $paragraph_block ['blocks'][0]),
834
  ));
1363
  $ai_total_plugin_time += microtime (true) - $start_time;
1364
  ai_log ("WP HOOK END\n");
1365
  }
 
 
 
 
 
 
 
1366
  };
1367
 
1368
  function ai_init_hook() {
1460
  wp_enqueue_script ('ai-admin-js-gen', plugins_url ('includes/js/ai-admin.js', __FILE__ ), array (), AD_INSERTER_VERSION, true);
1461
  }
1462
 
1463
+ //function ai_wp_enqueue_scripts_hook () {
1464
+ //}
1465
+
1466
  function ai_clean_url ( $url, $original_url){
1467
  if (strpos ($url, 'async=') !== false && strpos ($url, '/plugins/ad-inserter') !== false) {
1468
  // $url = $original_url;
1490
  echo ".ai-ip-data, .ai-ip-data-block {visibility: hidden; position: absolute; width: 100%; height: 100%; z-index: -9999;}\n";
1491
  }
1492
 
1493
+ if ($ai_wp_data [AI_CLOSE_BUTTONS]) {
1494
+ echo ".ai-close {position: relative;}\n";
1495
+ echo ".ai-close-width {width: auto !important;}\n";
1496
+ echo ".ai-close-button {position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; background: url(".plugins_url ('css/images/close-button.png', AD_INSERTER_FILE).") no-repeat center center; cursor: pointer; z-index: 9; display: none;}\n";
1497
+ echo ".ai-close-show {display: block;}\n";
1498
+ echo ".ai-close-left {right: unset; left: -10px;}\n";
1499
+ echo ".ai-close-bottom {top: unset; bottom: -7px;}\n";
1500
+ }
1501
+
1502
  // if (defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES)
1503
  echo get_alignment_css ();
1504
 
1505
+ // After alignment CSS to override width
1506
+ if ($ai_wp_data [AI_CLOSE_BUTTONS]) {
1507
+ echo ".ai-close-fit {width: fit-content;}\n";
1508
+ }
1509
+
1510
  if ($ai_wp_data [AI_WP_DEBUGGING] != 0) generate_debug_css ();
1511
 
1512
  if (get_admin_toolbar_debugging () && (get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) != 0))
1565
  function ai_get_js ($js_name, $replace_js_data = true) {
1566
  global $ai_wp_data;
1567
 
1568
+ if ($ai_wp_data [AI_FRONTEND_JS_DEBUGGING]) {
1569
  $script = file_get_contents (AD_INSERTER_PLUGIN_DIR."includes/js/$js_name.js");
1570
  } else $script = file_get_contents (AD_INSERTER_PLUGIN_DIR."includes/js/$js_name.min.js");
1571
  if (!$replace_js_data) return $script;
1682
  $js = str_replace ('AI_VIEWPORTS', '[' . implode (',', $ai_wp_data [AI_VIEWPORTS]) . ']', $js);
1683
  $js = str_replace ('AI_VIEWPORT_NAMES', base64_encode ('["' . implode ('","', $ai_wp_data [AI_VIEWPORT_NAMES]) . '"]'), $js);
1684
  }
1685
+ // Deprecated
1686
+ $js = str_replace ('AI_BLOCK_CLASS_NAME', get_block_class_name (true), $js);
1687
 
1688
  if (function_exists ('ai_replace_js_data_2')) ai_replace_js_data_2 ($js);
1689
 
1731
  echo ai_get_js ('ai-sticky');
1732
  }
1733
 
1734
+ if ($ai_wp_data [AI_CLOSE_BUTTONS]) {
1735
+ echo ai_get_js ('ai-close');
1736
+ }
1737
+
1738
  if (defined ('AI_ADBLOCKING_DETECTION') && AI_ADBLOCKING_DETECTION) {
1739
  if ($ai_wp_data [AI_ADB_DETECTION]) {
1740
  if (!function_exists ('add_footer_inline_scripts_2')) echo ai_replace_js_data (ai_adb_code ());
2265
 
2266
  if (defined ('AI_AMP_HEADER_STYLES') && AI_AMP_HEADER_STYLES || $ai_wp_data [AI_WP_DEBUGGING] != 0) {
2267
 
2268
+ if (defined ('AI_AMP_HEADER_STYLES') && AI_AMP_HEADER_STYLES) {
2269
+ echo get_alignment_css ();
2270
+
2271
+ // Temp fix for alignment on AMP pages
2272
+ echo ".ai-amp-left {" . AI_ALIGNMENT_CSS_AMP_LEFT . "}\n";
2273
+ echo ".ai-amp-right {" . AI_ALIGNMENT_CSS_AMP_RIGHT . "}\n";
2274
+ echo ".ai-amp-center {" . AI_ALIGNMENT_CSS_AMP_CENTER . "}\n";
2275
+ }
2276
 
2277
  if ($ai_wp_data [AI_WP_DEBUGGING] != 0) generate_debug_css ();
2278
  }
2295
  }
2296
  }
2297
 
2298
+ if ($ai_wp_data [AI_DISABLE_CACHING]) ai_disable_caching ();
2299
+
2300
  $ai_wp_data [AI_CONTEXT] = AI_CONTEXT_FOOTER;
2301
 
2302
  $footer = $block_object [AI_FOOTER_OPTION_NAME];
2541
  }
2542
  }
2543
  echo 'BLOCK CLASS NAME: ', get_block_class_name (), "\n";
2544
+ echo 'INLINE STYLES: ', get_inline_styles () ? 'ENABLED' : 'DISABLED', "\n";
2545
  echo 'DYNAMIC BLOCKS: ';
2546
  switch (get_dynamic_blocks()) {
2547
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE:
2565
  break;
2566
  }
2567
  echo "\n";
2568
+ if (defined ('AI_BUFFERING')) {
2569
+ echo 'OUTPUT BUFFERING: ';
2570
+ switch (get_output_buffering()) {
2571
+ case AI_OUTPUT_BUFFERING_DISABLED:
2572
+ echo AI_TEXT_DISABLED;
2573
+ break;
2574
+ case AI_OUTPUT_BUFFERING_ENABLED:
2575
+ echo AI_TEXT_ENABLED;
2576
+ break;
2577
+ }
2578
+ echo "\n";
2579
  }
 
2580
  echo 'PLUGIN PRIORITY: ', get_plugin_priority (), "\n";
2581
  echo 'HEADER CODE: ', $block_object [AI_HEADER_OPTION_NAME]->get_enable_manual () ? 'ENABLED' : 'DISABLED', "\n";
2582
  echo 'FOOTER CODE: ', $block_object [AI_FOOTER_OPTION_NAME]->get_enable_manual () ? 'ENABLED' : 'DISABLED', "\n";
 
2583
  if (defined ('AI_ADBLOCKING_DETECTION') && AI_ADBLOCKING_DETECTION) {
2584
  echo 'AD BLOCKING DETECTION: ', $ai_wp_data [AI_ADB_DETECTION] ? 'ENABLED' : 'DISABLED', "\n";
2585
  if ($ai_wp_data [AI_ADB_DETECTION]) {
2881
  if (!isset ($multisite_options ['MULTISITE_PHP_PROCESSING'])) $multisite_options ['MULTISITE_PHP_PROCESSING'] = DEFAULT_MULTISITE_PHP_PROCESSING;
2882
  if (!isset ($multisite_options ['MULTISITE_EXCEPTIONS'])) $multisite_options ['MULTISITE_EXCEPTIONS'] = DEFAULT_MULTISITE_EXCEPTIONS;
2883
  if (!isset ($multisite_options ['MULTISITE_MAIN_FOR_ALL_BLOGS'])) $multisite_options ['MULTISITE_MAIN_FOR_ALL_BLOGS'] = DEFAULT_MULTISITE_MAIN_FOR_ALL_BLOGS;
2884
+
2885
+ $multisite_options ['MULTISITE_GEO_DB'] = get_geo_db (true);
2886
+ $multisite_options ['MULTISITE_GEO_DB_UPDATES'] = get_geo_db_updates (true);
2887
+ $multisite_options ['MULTISITE_GEO_DB_LOCATION'] = get_geo_db_location (true, true);
2888
  }
2889
 
2890
  function ai_check_plugin_options ($plugin_options = array ()) {
2895
  if (!isset ($plugin_options ['SYNTAX_HIGHLIGHTER_THEME'])) $plugin_options ['SYNTAX_HIGHLIGHTER_THEME'] = DEFAULT_SYNTAX_HIGHLIGHTER_THEME;
2896
 
2897
  if (!isset ($plugin_options ['BLOCK_CLASS_NAME'])) $plugin_options ['BLOCK_CLASS_NAME'] = DEFAULT_BLOCK_CLASS_NAME;
2898
+ if (!isset ($plugin_options ['BLOCK_CLASS'])) $plugin_options ['BLOCK_CLASS'] = DEFAULT_BLOCK_CLASS;
2899
+ if (!isset ($plugin_options ['BLOCK_NUMBER_CLASS'])) $plugin_options ['BLOCK_NUMBER_CLASS'] = DEFAULT_BLOCK_NUMBER_CLASS;
2900
  if (!isset ($plugin_options ['INLINE_STYLES'])) $plugin_options ['INLINE_STYLES'] = DEFAULT_INLINE_STYLES;
2901
 
2902
  if (!isset ($plugin_options ['MINIMUM_USER_ROLE'])) $plugin_options ['MINIMUM_USER_ROLE'] = DEFAULT_MINIMUM_USER_ROLE;
2948
  if (!isset ($plugin_options ['ADB_UNDISMISSIBLE_MESSAGE'])) $plugin_options ['ADB_UNDISMISSIBLE_MESSAGE'] = AI_DEFAULT_ADB_UNDISMISSIBLE_MESSAGE;
2949
  if (!isset ($plugin_options ['ADMIN_TOOLBAR_DEBUGGING'])) $plugin_options ['ADMIN_TOOLBAR_DEBUGGING'] = DEFAULT_ADMIN_TOOLBAR_DEBUGGING;
2950
  if (!isset ($plugin_options ['REMOTE_DEBUGGING'])) $plugin_options ['REMOTE_DEBUGGING'] = DEFAULT_REMOTE_DEBUGGING;
2951
+ if (!isset ($plugin_options ['BACKEND_JS_DEBUGGING'])) $plugin_options ['BACKEND_JS_DEBUGGING'] = DEFAULT_BACKEND_JS_DEBUGGING;
2952
+ if (!isset ($plugin_options ['FRONTEND_JS_DEBUGGING'])) $plugin_options ['FRONTEND_JS_DEBUGGING'] = DEFAULT_FRONTEND_JS_DEBUGGING;
2953
 
2954
  for ($viewport = 1; $viewport <= AD_INSERTER_VIEWPORTS; $viewport ++) {
2955
  $viewport_name_option_name = 'VIEWPORT_NAME_' . $viewport;
3076
  return ($ai_db_options [AI_OPTION_GLOBAL]['SYNTAX_HIGHLIGHTER_THEME']);
3077
  }
3078
 
3079
+ function get_block_class_name ($default_if_empty = false) {
3080
  global $ai_db_options;
3081
 
3082
  if (!isset ($ai_db_options [AI_OPTION_GLOBAL]['BLOCK_CLASS_NAME'])) $ai_db_options [AI_OPTION_GLOBAL]['BLOCK_CLASS_NAME'] = DEFAULT_BLOCK_CLASS_NAME;
3083
 
3084
+ if ($default_if_empty && $ai_db_options [AI_OPTION_GLOBAL]['BLOCK_CLASS_NAME'] == '') return (DEFAULT_BLOCK_CLASS_NAME);
3085
+
3086
  return ($ai_db_options [AI_OPTION_GLOBAL]['BLOCK_CLASS_NAME']);
3087
  }
3088
 
3089
+ function get_block_class () {
3090
+ global $ai_db_options;
3091
+
3092
+ if (!isset ($ai_db_options [AI_OPTION_GLOBAL]['BLOCK_CLASS'])) $ai_db_options [AI_OPTION_GLOBAL]['BLOCK_CLASS'] = DEFAULT_BLOCK_CLASS;
3093
+
3094
+ return ($ai_db_options [AI_OPTION_GLOBAL]['BLOCK_CLASS']);
3095
+ }
3096
+
3097
+ function get_block_number_class () {
3098
+ global $ai_db_options;
3099
+
3100
+ if (!isset ($ai_db_options [AI_OPTION_GLOBAL]['BLOCK_NUMBER_CLASS'])) $ai_db_options [AI_OPTION_GLOBAL]['BLOCK_NUMBER_CLASS'] = DEFAULT_BLOCK_NUMBER_CLASS;
3101
+
3102
+ return ($ai_db_options [AI_OPTION_GLOBAL]['BLOCK_NUMBER_CLASS']);
3103
+ }
3104
+
3105
  function get_inline_styles () {
3106
  global $ai_db_options;
3107
 
3190
  return ($ai_db_options [AI_OPTION_GLOBAL]['REMOTE_DEBUGGING']);
3191
  }
3192
 
3193
+ function get_backend_javascript_debugging () {
3194
+ global $ai_db_options;
3195
+
3196
+ if (!isset ($ai_db_options [AI_OPTION_GLOBAL]['BACKEND_JS_DEBUGGING'])) $ai_db_options [AI_OPTION_GLOBAL]['BACKEND_JS_DEBUGGING'] = DEFAULT_BACKEND_JS_DEBUGGING;
3197
+
3198
+ return ($ai_db_options [AI_OPTION_GLOBAL]['BACKEND_JS_DEBUGGING']);
3199
+ }
3200
+
3201
+ function get_frontend_javascript_debugging () {
3202
  global $ai_db_options;
3203
 
3204
+ if (!isset ($ai_db_options [AI_OPTION_GLOBAL]['FRONTEND_JS_DEBUGGING'])) $ai_db_options [AI_OPTION_GLOBAL]['FRONTEND_JS_DEBUGGING'] = DEFAULT_FRONTEND_JS_DEBUGGING;
3205
 
3206
+ return ($ai_db_options [AI_OPTION_GLOBAL]['FRONTEND_JS_DEBUGGING']);
3207
  }
3208
 
3209
  function get_viewport_name ($viewport_number) {
3563
  if (isset ($_POST ["preview"])) {
3564
  $block = urldecode ($_POST ["preview"]);
3565
  if (is_numeric ($block) && $block >= 1 && $block <= AD_INSERTER_BLOCKS) {
3566
+ require_once AD_INSERTER_PLUGIN_DIR.'includes/preview.php';
3567
  generate_code_preview (
3568
  $block,
3569
  // wp_unslash (urldecode ($_POST ["name"])),
3582
  );
3583
  }
3584
  elseif ($block == 'adb') {
3585
+ require_once AD_INSERTER_PLUGIN_DIR.'includes/preview-adb.php';
3586
  // generate_code_preview_adb (wp_unslash (urldecode (base64_decode ($_POST ["code"]))), urldecode ($_POST ["php"]) == 1);
3587
  generate_code_preview_adb (base64_decode ($_POST ["code"]), $_POST ["php"] == 1);
3588
  }
3589
  elseif ($block == 'adsense') {
3590
 
3591
  if (defined ('AI_ADSENSE_API')) {
3592
+ require_once AD_INSERTER_PLUGIN_DIR.'preview.php';
3593
  require_once AD_INSERTER_PLUGIN_DIR.'includes/adsense-api.php';
3594
 
3595
  if (defined ('AI_ADSENSE_AUTHORIZATION_CODE')) {
3617
 
3618
  elseif (isset ($_POST ["edit"])) {
3619
  if (is_numeric ($_POST ["edit"]) && $_POST ["edit"] >= 1 && $_POST ["edit"] <= AD_INSERTER_BLOCKS) {
3620
+ require_once AD_INSERTER_PLUGIN_DIR.'includes/editor.php';
3621
  // generate_code_editor ($_POST ["edit"], wp_unslash (urldecode (base64_decode ($_POST ["code"]))), urldecode ($_POST ["php"]) == 1);
3622
  generate_code_editor ($_POST ["edit"], base64_decode ($_POST ["code"]), $_POST ["php"] == 1);
3623
  }
3624
  }
3625
 
3626
+ if (isset ($_POST ["placeholder"])) {
3627
+ $block = urldecode ($_POST ["block"]);
3628
+ if (is_numeric ($block) && $block >= 1 && $block <= AD_INSERTER_BLOCKS) {
3629
+ require_once AD_INSERTER_PLUGIN_DIR.'includes/placeholders.php';
3630
+
3631
+ generate_placeholder_editor (str_replace (array ('"', "\\'"), array ('&quot', '&#039'), urldecode ($_POST ["placeholder"])), $block);
3632
+ }
3633
+ }
3634
+
3635
  elseif (isset ($_POST ["generate-code"])) {
3636
  $code_generator = new ai_code_generator ();
3637
 
3723
  generate_settings_form ();
3724
  }
3725
 
3726
+ elseif (isset ($_GET ["update"])) {
3727
+ if ($_GET ["update"] == 'block-code-demo') {
3728
+ ai_block_code_demo (urldecode ($_GET ["block_class_name"]), $_GET ["block_class"], $_GET ["block_number_class"], $_GET ["inline_styles"]);
3729
+ }
3730
+ elseif (function_exists ('ai_ajax_backend_2')) {
3731
+ ai_ajax_backend_2 ();
3732
+ }
3733
+ }
3734
+
3735
  elseif (function_exists ('ai_ajax_backend_2')) {
3736
  ai_ajax_backend_2 ();
3737
  }
3942
  $obj = new ai_Block ($block);
3943
  $obj->load_options ($block);
3944
  $block_object [$block] = $obj;
3945
+
3946
+ if ($obj->get_detection_server_side()) $ai_wp_data [AI_SERVER_SIDE_DETECTION] = true;
3947
+ if ($obj->get_detection_client_side ()) $ai_wp_data [AI_CLIENT_SIDE_DETECTION] = true;
3948
+
3949
+ if ($obj->get_tracking ()) $ai_wp_data [AI_TRACKING] = true;
3950
+ if ($obj->get_close_button ()) $ai_wp_data [AI_CLOSE_BUTTONS] = true;
3951
  }
3952
 
3953
  $adH = new ai_AdH();
4029
  function generate_alignment_css () {
4030
  global $ai_db_options_extract, $block_object;
4031
 
4032
+ $block_class_name = get_block_class_name (true) . '-';
 
4033
 
4034
  $styles = array ();
4035
 
4121
 
4122
  .ai-debug-bar {padding: 1px 0 1px 5px; color: white; font-size: 12px; line-height: 20px; text-align: center;}
4123
  .ai-debug-bar-left {text-align: left;}
 
4124
 
4125
+ .ai-debug-bar a, .ai-debug-bar a:hover, .ai-debug-bar a:link, .ai-debug-bar a:visited {text-decoration: none; color: white; box-shadow: none; transition: unset;}
4126
  .ai-debug-bar a.ai-debug-text-left {float: left;}
4127
  .ai-debug-bar a.ai-debug-text-right, .ai-debug-bar kbd.ai-debug-text-right {float: right; padding-right: 3px;}
4128
 
4164
  // Try to import individual settings
4165
  $ai_options = array ();
4166
 
4167
+ $default_block = new ai_Block (1);
4168
  for ($block = 1; $block <= AD_INSERTER_BLOCKS; $block ++) {
4169
+ // ###
4170
+ // $default_block = new ai_Block ($block);
4171
 
4172
  if (isset ($ai_db_options [$block])) $saved_settings = wp_slash ($ai_db_options [$block]); else
4173
+ // ###
4174
+ // $saved_settings = wp_slash ($default_block->wp_options);
4175
+ $saved_settings = array ();
4176
 
4177
  if ($block < $start || $block > $end) {
4178
+ // Block not on the settings page
4179
  $ai_options [$block] = $saved_settings;
4180
  continue;
4181
  }
4182
 
 
4183
  $import_switch_name = AI_OPTION_IMPORT . WP_FORM_FIELD_POSTFIX . $block;
4184
  $import_name_switch_name = AI_OPTION_IMPORT_NAME . WP_FORM_FIELD_POSTFIX . $block;
4185
  if (isset ($_POST [$import_switch_name]) && $_POST [$import_switch_name] == "1") {
4186
 
4187
+ // Try to import block settings
4188
  $exported_settings = @unserialize (base64_decode (str_replace (array ("\\\""), array ("\""), $_POST ["export_settings_" . $block])));
4189
 
4190
  if ($exported_settings !== false) {
4191
  $exported_settings = wp_slash ($exported_settings);
4192
+ foreach (array_keys ($default_block->wp_options) as $key){
4193
  if ($key == AI_OPTION_BLOCK_NAME && isset ($_POST [$import_name_switch_name]) && $_POST [$import_name_switch_name] != "1") {
4194
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . $block;
4195
  if (isset ($_POST [$form_field_name])){
4196
+ // ###
4197
+ // $default_block->wp_options [$key] = filter_option ($key, $_POST [$form_field_name]);
4198
+
4199
+ // Save only non-default settings
4200
+ $ai_options [$block][$key] = filter_option ($key, $_POST [$form_field_name]);
4201
  }
4202
  } else {
4203
  if (isset ($exported_settings [$key])) {
4204
+ // ###
4205
+ // $default_block->wp_options [$key] = filter_option ($key, $exported_settings [$key], false);
4206
+
4207
+ $ai_options [$block][$key] = filter_option ($key, $exported_settings [$key], false);
4208
  }
4209
  }
4210
  }
4211
  } else {
4212
+ // Block import failed - use existing settings
4213
+ $default_block->wp_options = $saved_settings;
4214
  $invalid_blocks []= $block;
4215
  }
4216
  } else {
4217
+ // Process block settings
4218
+ foreach (array_keys ($default_block->wp_options) as $key){
4219
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . $block;
4220
  if (isset ($_POST [$form_field_name])){
4221
 
4222
+ // ### Store non-default settings
4223
+ // $default_block->wp_options [$key] = filter_option ($key, $_POST [$form_field_name]);
 
 
4224
 
4225
+ // Save only non-default settings
4226
+ $ai_options [$block][$key] = filter_option ($key, $_POST [$form_field_name]);
4227
  }
4228
  }
4229
  }
4230
 
4231
+ // ### Copy complete block settings
4232
+ // $ai_options [$block] = $default_block->wp_options;
4233
+
4234
  delete_option (str_replace ("#", $block, AD_ADx_OPTIONS));
4235
  }
4236
 
4237
+ $default_block_H = new ai_AdH();
4238
+ $wp_options = array ();
4239
+ foreach(array_keys ($default_block_H->wp_options) as $key){
 
4240
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . AI_HEADER_OPTION_NAME;
4241
  if(isset ($_POST [$form_field_name])){
4242
+ // ###
4243
+ // $default_block_H->wp_options [$key] = filter_option_hf ($key, $_POST [$form_field_name]);
4244
+ $wp_options [$key] = filter_option_hf ($key, $_POST [$form_field_name]);
4245
  }
4246
  }
4247
+ // ###
4248
+ // $ai_options [AI_HEADER_OPTION_NAME] = $default_block_H->wp_options;
4249
+ $ai_options [AI_HEADER_OPTION_NAME] = $wp_options;
4250
 
4251
+ $default_block_F = new ai_AdF();
4252
+ $wp_options = array ();
4253
+ foreach(array_keys($default_block_F->wp_options) as $key){
4254
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . AI_FOOTER_OPTION_NAME;
4255
  if(isset ($_POST [$form_field_name])){
4256
+ // ###
4257
+ // $default_block_F->wp_options [$key] = filter_option_hf ($key, $_POST [$form_field_name]);
4258
+ $wp_options [$key] = filter_option_hf ($key, $_POST [$form_field_name]);
4259
  }
4260
  }
4261
+ // $ai_options [AI_FOOTER_OPTION_NAME] = $default_block_F->wp_options;
4262
+ $ai_options [AI_FOOTER_OPTION_NAME] = $wp_options;
 
4263
 
4264
  if (defined ('AI_ADBLOCKING_DETECTION') && AI_ADBLOCKING_DETECTION) {
4265
+ $default_block_A = new ai_AdA();
4266
+ $wp_options = array ();
4267
+ foreach(array_keys($default_block_A->wp_options) as $key){
4268
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . AI_ADB_MESSAGE_OPTION_NAME;
4269
  if(isset ($_POST [$form_field_name])){
4270
+ // ###
4271
+ // $default_block_A->wp_options [$key] = filter_option_hf ($key, $_POST [$form_field_name]);
4272
+ $wp_options [$key] = filter_option_hf ($key, $_POST [$form_field_name]);
4273
  }
4274
  }
4275
+ // ###
4276
+ // $ai_options [AI_ADB_MESSAGE_OPTION_NAME] = $default_block_A->wp_options;
4277
+ $ai_options [AI_ADB_MESSAGE_OPTION_NAME] = $wp_options;
4278
  }
4279
 
4280
  $options = array ();
4283
 
4284
  if (isset ($_POST ['syntax-highlighter-theme'])) $options ['SYNTAX_HIGHLIGHTER_THEME'] = filter_string ($_POST ['syntax-highlighter-theme']);
4285
  if (isset ($_POST ['block-class-name'])) $options ['BLOCK_CLASS_NAME'] = filter_html_class ($_POST ['block-class-name']);
4286
+ if (isset ($_POST ['block-class'])) $options ['BLOCK_CLASS'] = filter_option ('BLOCK_CLASS', $_POST ['block-class']);
4287
+ if (isset ($_POST ['block-number-class'])) $options ['BLOCK_NUMBER_CLASS'] = filter_option ('BLOCK_NUMBER_CLASS', $_POST ['block-number-class']);
4288
  if (isset ($_POST ['inline-styles'])) $options ['INLINE_STYLES'] = filter_option ('INLINE_STYLES', $_POST ['inline-styles']);
4289
  if (isset ($_POST ['minimum-user-role'])) $options ['MINIMUM_USER_ROLE'] = filter_string ($_POST ['minimum-user-role']);
4290
  if (isset ($_POST ['sticky-widget-mode'])) $options ['STICKY_WIDGET_MODE'] = filter_option ('STICKY_WIDGET_MODE', $_POST ['sticky-widget-mode']);
4305
  if (isset ($_POST [AI_OPTION_ADB_UNDISMISSIBLE_MESSAGE])) $options ['ADB_UNDISMISSIBLE_MESSAGE'] = filter_option ('ADB_UNDISMISSIBLE_MESSAGE', $_POST [AI_OPTION_ADB_UNDISMISSIBLE_MESSAGE]);
4306
  if (isset ($_POST ['admin_toolbar_debugging'])) $options ['ADMIN_TOOLBAR_DEBUGGING'] = filter_option ('ADMIN_TOOLBAR_DEBUGGING', $_POST ['admin_toolbar_debugging']);
4307
  if (isset ($_POST ['remote_debugging'])) $options ['REMOTE_DEBUGGING'] = filter_option ('REMOTE_DEBUGGING', $_POST ['remote_debugging']);
4308
+ if (isset ($_POST ['backend_js_debugging'])) $options ['BACKEND_JS_DEBUGGING'] = filter_option ('BACKEND_JS_DEBUGGING', $_POST ['backend_js_debugging']);
4309
+ if (isset ($_POST ['frontend_js_debugging'])) $options ['FRONTEND_JS_DEBUGGING'] = filter_option ('FRONTEND_JS_DEBUGGING', $_POST ['frontend_js_debugging']);
4310
 
4311
  for ($viewport = 1; $viewport <= AD_INSERTER_VIEWPORTS; $viewport ++) {
4312
  if (isset ($_POST ['viewport-name-'.$viewport])) $options ['VIEWPORT_NAME_'.$viewport] = filter_string ($_POST ['viewport-name-'.$viewport]);
4370
  delete_option (AD_OPTIONS);
4371
 
4372
  echo "<div class='notice notice-success is-dismissible' style='margin: 5px 15px 2px 0px;'><p><strong>Settings saved.</strong></p></div>";
 
4373
  } elseif (isset ($_POST [AI_FORM_CLEAR])) {
4374
 
4375
  check_admin_referer ('save_adinserter_settings');
4853
  return $content;
4854
  }
4855
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4856
  function ai_comments_array ($comments , $post_id ){
4857
  global $ai_wp_data;
4858
 
5223
 
5224
  $parameters = shortcode_atts (array (
5225
  "block" => "",
5226
+ "code" => "",
5227
  "name" => "",
5228
  "ignore" => "",
5229
  "check" => "",
5268
  }
5269
 
5270
  $block = - 1;
5271
+ $code_only = false;
5272
+
5273
+ if ($parameters ['block'] == '' && $parameters ['code'] != '') {
5274
+ $parameters ['block'] = $parameters ['code'];
5275
+ $code_only = true;
5276
+ }
5277
+
5278
  if (is_numeric ($parameters ['block'])) {
5279
  $block = intval ($parameters ['block']);
5280
  } elseif ($parameters ['name'] != '') {
5292
  }
5293
 
5294
  if ($block == - 1) {
5295
+ if ($parameters ['count'] != '' || in_array ('COUNT', $atts) || in_array ('count', $atts)) {
5296
+ if (!isset ($ai_wp_data [AI_SHORTCODES]['count'])) $ai_wp_data [AI_SHORTCODES]['count'] = array ();
5297
+ $ai_wp_data [AI_SHORTCODES]['count'] []= $parameters;
5298
+ return AD_COUNT_SEPARATOR;
5299
+ }
5300
  if ($parameters ['rotate'] != '' || in_array ('ROTATE', $atts) || in_array ('rotate', $atts)) {
5301
  if (!isset ($ai_wp_data [AI_SHORTCODES]['rotate'])) $ai_wp_data [AI_SHORTCODES]['rotate'] = array ();
5302
  $ai_wp_data [AI_SHORTCODES]['rotate'] []= $parameters;
5303
  return AD_ROTATE_SEPARATOR;
5304
  }
 
 
 
5305
  if ($parameters ['amp'] != '' || in_array ('AMP', $atts) || in_array ('amp', $atts)) {
5306
  return AD_AMP_SEPARATOR;
5307
  }
5383
  $ai_last_check = AI_CHECK_DEBUG_NO_INSERTION;
5384
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_NO_INSERTION) == 0) {
5385
  $ai_last_check = AI_CHECK_INSERTED;
5386
+ return $obj->get_code_for_insertion (true, false, $code_only);
5387
  }
5388
  }
5389
 
class.php CHANGED
@@ -456,6 +456,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
456
  $this->wp_options [AI_OPTION_DISPLAY_ON_SEARCH_PAGES] = AI_DISABLED;
457
  $this->wp_options [AI_OPTION_DISPLAY_ON_ARCHIVE_PAGES] = AI_DISABLED;
458
  $this->wp_options [AI_OPTION_ENABLE_AJAX] = AI_ENABLED;
 
459
  $this->wp_options [AI_OPTION_ENABLE_FEED] = AI_DISABLED;
460
  $this->wp_options [AI_OPTION_ENABLED_ON_WHICH_PAGES] = AI_NO_INDIVIDUAL_EXCEPTIONS;
461
  $this->wp_options [AI_OPTION_ENABLED_ON_WHICH_POSTS] = AI_NO_INDIVIDUAL_EXCEPTIONS;
@@ -466,6 +467,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
466
  $this->wp_options [AI_OPTION_CUSTOM_CSS] = AD_EMPTY_DATA;
467
  $this->wp_options [AI_OPTION_DISPLAY_FOR_USERS] = AD_DISPLAY_ALL_USERS;
468
  $this->wp_options [AI_OPTION_DETECT_CLIENT_SIDE] = AI_DISABLED;
 
469
  for ($viewport = 1; $viewport <= AD_INSERTER_VIEWPORTS; $viewport ++) {
470
  $this->wp_options [AI_OPTION_DETECT_VIEWPORT . '_' . $viewport] = AI_DISABLED;
471
  }
@@ -949,6 +951,11 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
949
  return $enable_ajax;
950
  }
951
 
 
 
 
 
 
952
  // Used for shortcodes
953
  public function get_enable_manual (){
954
  $option = isset ($this->wp_options [AI_OPTION_ENABLE_MANUAL]) ? $this->wp_options [AI_OPTION_ENABLE_MANUAL] : AI_DISABLED;
@@ -1123,17 +1130,55 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1123
 
1124
  $code = $this->ai_getCode ($client_code, $process_php);
1125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1126
  unset ($ai_wp_data [AI_SHORTCODES]['rotate']);
 
1127
 
1128
  $processed_code = $this->replace_ai_tags (do_shortcode ($code));
1129
 
1130
- if (strpos ($code, AD_COUNT_SEPARATOR) !== false) {
1131
- $ads = explode (AD_COUNT_SEPARATOR, $code);
1132
 
1133
  if (isset ($ad_inserter_globals [AI_BLOCK_COUNTER_NAME . $this->number])) {
1134
  $counter_for_filter = $ad_inserter_globals [AI_BLOCK_COUNTER_NAME . $this->number];
1135
 
1136
  if ($counter_for_filter != 0 && $counter_for_filter <= count ($ads)) {
 
 
 
 
 
 
 
 
 
 
 
1137
  $processed_code = $ads [$counter_for_filter - 1];
1138
  } else $processed_code = '';
1139
  } else $processed_code = $ads [rand (0, count ($ads) - 1)];
@@ -1142,9 +1187,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1142
  $dynamic_blocks = get_dynamic_blocks ();
1143
  if ($force_server_side_code || ($dynamic_blocks == AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC && defined ('AI_NO_W3TC'))) $dynamic_blocks = AI_DYNAMIC_BLOCKS_SERVER_SIDE;
1144
 
1145
-
1146
  if (strpos ($processed_code, AD_ROTATE_SEPARATOR) !== false) {
1147
-
1148
  $ads = explode (AD_ROTATE_SEPARATOR, $processed_code);
1149
 
1150
  if (!isset ($ai_wp_data [AI_SHORTCODES]['rotate'])) {
@@ -1171,16 +1214,16 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1171
  switch ($amp_dynamic_blocks) {
1172
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE:
1173
  $this->code_version = mt_rand (1, count ($ads));
1174
- $processed_code = trim ($ads [$this->code_version - 1]);
1175
  $this->version_name = $version_names [$this->code_version - 1];
1176
  break;
1177
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE:
1178
  $this->code_version = '""';
1179
 
1180
  if (defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !get_inline_styles ()) {
1181
- $processed_code = "\n<div class='ai-rotate'>\n";
1182
  } else
1183
- $processed_code = "\n<div class='ai-rotate' style='position: relative;'>\n";
1184
 
1185
  foreach ($ads as $index => $ad) {
1186
 
@@ -1210,13 +1253,13 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1210
  $processed_code .= "</div>\n";
1211
  break;
1212
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC:
1213
- $this->w3tc_code = '$ai_code = unserialize (base64_decode (\''.base64_encode (serialize ($ads)).'\')); $ai_index = mt_rand (1, count ($ai_code)); $ai_code = $ai_code [$ai_index - 1]; $ai_enabled = true;';
1214
  $processed_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
1215
  $processed_code .= $this->w3tc_code.' echo $ai_code;';
1216
  $processed_code .= '<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
1217
  break;
1218
  }
1219
- }
1220
 
1221
 
1222
  $this->color_class = 'ai-debug-default';
@@ -1273,15 +1316,17 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1273
  if ($countries != '') $country_attributes = "countries='$countries' country-list='$country_list_type'"; else $country_attributes = '';
1274
  if ($ip_addresses != '') $ip_address_attributes = "ip-addresses='$ip_addresses' ip-address-list='$ip_address_list_type'"; else $ip_address_attributes = '';
1275
 
1276
- $block_class_name = get_block_class_name ();
1277
- if ($block_class_name == '') $block_class_name = DEFAULT_BLOCK_CLASS_NAME;
1278
- $block_class_name = $block_class_name.'-'.$this->number;
1279
  $this->client_side_ip_address_detection = true;
1280
- $this->needs_class = true;
1281
 
 
 
 
1282
  if (defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !get_inline_styles ()) {
1283
- $processed_code = "\n<div class='ai-ip-data' $ip_address_attributes $country_attributes class-name='$block_class_name'>$processed_code</div>\n";
1284
- } else $processed_code = "\n<div class='ai-ip-data' $ip_address_attributes $country_attributes class-name='$block_class_name' style='visibility: hidden; position: absolute; width: 100%; height: 100%; z-index: -9999;'>$processed_code</div>\n";
1285
  }
1286
  break;
1287
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC:
@@ -1339,13 +1384,30 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1339
  return $processed_code;
1340
  }
1341
 
1342
- public function get_code_for_insertion ($include_viewport_classes = true, $hidden_widgets = false) {
1343
  global $ai_wp_data, $block_object;
1344
 
1345
- if ($this->get_alignment_type() == AI_ALIGNMENT_NO_WRAPPING) return $this->ai_getProcessedCode ();
 
 
1346
 
1347
  $alignment_class = $this->get_alignment_class ();
1348
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1349
  $hidden_viewports = '';
1350
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_BLOCKS) != 0 && $this->get_detection_client_side()) {
1351
 
@@ -1380,37 +1442,56 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1380
  // Prevent empty wrapping div on AMP pages
1381
  if ($ai_wp_data [AI_WP_AMP_PAGE] && $code == '') return '';
1382
 
1383
- $block_class_name = get_block_class_name ();
1384
- if ($block_class_name == '' && $this->needs_class) $block_class_name = DEFAULT_BLOCK_CLASS_NAME;
1385
- $viewport_classes = $include_viewport_classes ? $this->get_viewport_classes () : "";
1386
- if ($block_class_name != '' || $viewport_classes != '' || $alignment_class != '') {
1387
- if ($block_class_name != '') {
1388
- // $class = " class='" . $block_class_name . ' ' . $alignment_class . ' ' . $block_class_name . "-" . $this->number . $viewport_classes ."'";
1389
- $classes = array ($block_class_name, $alignment_class, $block_class_name . "-" . $this->number, trim ($viewport_classes));
1390
- } else {
1391
- // $class = " class='" . $alignment_class . $viewport_classes ."'";
1392
- $classes = array ($alignment_class, $viewport_classes);
1393
- }
1394
- // } else $class = '';
 
 
 
 
 
 
 
 
 
 
1395
  } else $classes = array ();
1396
- // $class = str_replace (' ', ' ', $class);
1397
 
1398
  if ($hidden_widgets) return $hidden_viewports; else {
1399
  if ($this->client_side_ip_address_detection && !$ai_wp_data [AI_WP_AMP_PAGE]) {
1400
  $additional_block_style = 'visibility: hidden; position: absolute; width: 100%; height: 100%; z-index: -9999; ';
1401
- if (defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !get_inline_styles ()) {
1402
- $classes [] = 'ai-ip-data-block';
1403
- }
 
 
1404
  } else {
1405
  $additional_block_style = '';
1406
  }
1407
 
 
 
 
 
 
 
 
 
 
1408
  foreach ($classes as $index => $class_name) {
1409
  if (trim ($class_name) == '') unset ($classes [$index]);
1410
  }
1411
- // $class = " class='" . str_replace (' ', ' ', implode (' ', $classes)) . "'";
1412
  if (count ($classes) != 0) {
1413
- $class = " class='" . implode (' ', $classes) . "'";
1414
  } else $class = "";
1415
 
1416
  $tracking_code_pre = '';
@@ -1471,9 +1552,14 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1471
  }
1472
  }
1473
 
1474
- public function get_ad_general_tag(){
1475
- $option = isset ($this->wp_options [AI_OPTION_GENERAL_TAG]) ? $this->wp_options [AI_OPTION_GENERAL_TAG] : "";
1476
- if ($option == '') $option = AD_GENERAL_TAG;
 
 
 
 
 
1477
  return $option;
1478
  }
1479
 
@@ -1721,34 +1807,38 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1721
  return ($viewport_classes);
1722
  }
1723
 
1724
- public function get_alignment_class (){
1725
  global $ai_wp_data;
1726
 
1727
- // if (defined ('AI_AMP_HEADER_STYLES') && AI_AMP_HEADER_STYLES && $ai_wp_data [AI_WP_AMP_PAGE]) {
1728
-
1729
  if (defined ('AI_AMP_HEADER_STYLES') && AI_AMP_HEADER_STYLES && $ai_wp_data [AI_WP_AMP_PAGE] ||
1730
  defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !$ai_wp_data [AI_WP_AMP_PAGE] && !get_inline_styles ()) {
 
 
1731
 
1732
- $block_class_name = get_block_class_name ();
1733
- if ($block_class_name == '') $block_class_name = DEFAULT_BLOCK_CLASS_NAME . '-'; else $block_class_name .= '-';
1734
 
1735
- switch ($this->get_alignment_type ()) {
1736
- case AI_ALIGNMENT_DEFAULT:
1737
- case AI_ALIGNMENT_LEFT:
1738
- case AI_ALIGNMENT_RIGHT:
1739
- case AI_ALIGNMENT_CENTER:
1740
- case AI_ALIGNMENT_FLOAT_LEFT:
1741
- case AI_ALIGNMENT_FLOAT_RIGHT:
1742
- case AI_ALIGNMENT_STICKY_LEFT:
1743
- case AI_ALIGNMENT_STICKY_RIGHT:
1744
- case AI_ALIGNMENT_STICKY_TOP:
1745
- case AI_ALIGNMENT_STICKY_BOTTOM:
1746
- return $block_class_name . str_replace (' ', '-', strtolower ($this->get_alignment_type_text ()));
1747
- break;
1748
- case AI_ALIGNMENT_CUSTOM_CSS:
1749
- return $block_class_name . str_replace (' ', '-', strtolower (md5 ($this->get_custom_css ())));
1750
- break;
1751
- }
 
 
 
 
1752
  }
1753
 
1754
  return '';
@@ -1812,15 +1902,40 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1812
  foreach ($special_element_tags as $special_element_tag) {
1813
  preg_match_all ("/<\/?$special_element_tag/i", $content, $special_elements, PREG_OFFSET_CAPTURE);
1814
 
 
1815
  $special_elements = $special_elements [0];
1816
  foreach ($special_elements as $index => $special_element) {
1817
- if (strtolower ($special_element [0]) == "<$special_element_tag" && isset ($special_elements [$index + 1][0]) && strtolower ($special_elements [$index + 1][0]) == "</$special_element_tag") {
 
 
1818
 
1819
- if ($multibyte) {
1820
- $special_element_offsets []= array (mb_strlen (substr ($content, 0, $special_element [1])) + 1, mb_strlen (substr ($content, 0, $special_elements [$index + 1][1])));
1821
- } else {
1822
- $special_element_offsets []= array ($special_element [1] + 1, $special_elements [$index + 1][1]);
1823
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1824
  }
1825
  }
1826
  }
@@ -2382,16 +2497,40 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
2382
  foreach ($special_element_tags as $special_element_tag) {
2383
  preg_match_all ("/<\/?$special_element_tag/i", $content, $special_elements, PREG_OFFSET_CAPTURE);
2384
 
 
2385
  $special_elements = $special_elements [0];
2386
  foreach ($special_elements as $index => $special_element) {
2387
- if (strtolower ($special_element [0]) == "<$special_element_tag" && isset ($special_elements [$index + 1][0]) && strtolower ($special_elements [$index + 1][0]) == "</$special_element_tag") {
 
 
2388
 
2389
- if ($multibyte) {
2390
- $special_element_offsets []= array (mb_strlen (substr ($content, 0, $special_element [1])), mb_strlen (substr ($content, 0, $special_elements [$index + 1][1])));
2391
- } else {
2392
- $special_element_offsets []= array ($special_element [1], $special_elements [$index + 1][1]);
2393
- }
 
 
 
 
 
 
 
 
 
 
 
2394
 
 
 
 
 
 
 
 
 
 
 
2395
  }
2396
  }
2397
  }
456
  $this->wp_options [AI_OPTION_DISPLAY_ON_SEARCH_PAGES] = AI_DISABLED;
457
  $this->wp_options [AI_OPTION_DISPLAY_ON_ARCHIVE_PAGES] = AI_DISABLED;
458
  $this->wp_options [AI_OPTION_ENABLE_AJAX] = AI_ENABLED;
459
+ $this->wp_options [AI_OPTION_DISABLE_CACHING] = AI_DISABLED;
460
  $this->wp_options [AI_OPTION_ENABLE_FEED] = AI_DISABLED;
461
  $this->wp_options [AI_OPTION_ENABLED_ON_WHICH_PAGES] = AI_NO_INDIVIDUAL_EXCEPTIONS;
462
  $this->wp_options [AI_OPTION_ENABLED_ON_WHICH_POSTS] = AI_NO_INDIVIDUAL_EXCEPTIONS;
467
  $this->wp_options [AI_OPTION_CUSTOM_CSS] = AD_EMPTY_DATA;
468
  $this->wp_options [AI_OPTION_DISPLAY_FOR_USERS] = AD_DISPLAY_ALL_USERS;
469
  $this->wp_options [AI_OPTION_DETECT_CLIENT_SIDE] = AI_DISABLED;
470
+ $this->wp_options [AI_OPTION_CLOSE_BUTTON] = DEFAULT_CLOSE_BUTTON;
471
  for ($viewport = 1; $viewport <= AD_INSERTER_VIEWPORTS; $viewport ++) {
472
  $this->wp_options [AI_OPTION_DETECT_VIEWPORT . '_' . $viewport] = AI_DISABLED;
473
  }
951
  return $enable_ajax;
952
  }
953
 
954
+ public function get_disable_caching (){
955
+ $option = isset ($this->wp_options [AI_OPTION_DISABLE_CACHING]) ? $this->wp_options [AI_OPTION_DISABLE_CACHING] : AI_DISABLED;
956
+ return $option;
957
+ }
958
+
959
  // Used for shortcodes
960
  public function get_enable_manual (){
961
  $option = isset ($this->wp_options [AI_OPTION_ENABLE_MANUAL]) ? $this->wp_options [AI_OPTION_ENABLE_MANUAL] : AI_DISABLED;
1130
 
1131
  $code = $this->ai_getCode ($client_code, $process_php);
1132
 
1133
+ $close_button_code = '';
1134
+ $alignment_type = $this->get_alignment_type ();
1135
+ if ($this->get_close_button () && !$ai_wp_data [AI_WP_AMP_PAGE] && $alignment_type != AI_ALIGNMENT_NO_WRAPPING) {
1136
+ $button_class = '';
1137
+ switch ($alignment_type) {
1138
+ case AI_ALIGNMENT_STICKY_RIGHT:
1139
+ $button_class = ' ai-close-left';
1140
+ break;
1141
+ case AI_ALIGNMENT_STICKY_TOP:
1142
+ $button_class = ' ai-close-bottom';
1143
+ break;
1144
+ case AI_ALIGNMENT_CUSTOM_CSS:
1145
+ $custom_css = str_replace (' ', '', $this->get_alignment_style());
1146
+ if (strpos ($custom_css, 'position:fixed') !== false ) {
1147
+ if (strpos ($custom_css, 'right:') !== false) {
1148
+ $button_class = ' ai-close-left';
1149
+ }
1150
+ elseif (strpos ($custom_css, 'top:') !== false) {
1151
+ $button_class = ' ai-close-bottom';
1152
+ }
1153
+ }
1154
+ break;
1155
+ }
1156
+ $close_button_code = "<span class='ai-close-button$button_class'></span>\n";
1157
+ }
1158
+
1159
  unset ($ai_wp_data [AI_SHORTCODES]['rotate']);
1160
+ unset ($ai_wp_data [AI_SHORTCODES]['count']);
1161
 
1162
  $processed_code = $this->replace_ai_tags (do_shortcode ($code));
1163
 
1164
+ if (strpos ($processed_code, AD_COUNT_SEPARATOR) !== false) {
1165
+ $ads = explode (AD_COUNT_SEPARATOR, $processed_code);
1166
 
1167
  if (isset ($ad_inserter_globals [AI_BLOCK_COUNTER_NAME . $this->number])) {
1168
  $counter_for_filter = $ad_inserter_globals [AI_BLOCK_COUNTER_NAME . $this->number];
1169
 
1170
  if ($counter_for_filter != 0 && $counter_for_filter <= count ($ads)) {
1171
+ if (isset ($ai_wp_data [AI_SHORTCODES]['count'][$counter_for_filter - 1]['count'])) {
1172
+ if (strtolower ($ai_wp_data [AI_SHORTCODES]['count'][$counter_for_filter - 1]['count']) == 'shuffle') {
1173
+ $ai_wp_data [AI_COUNT] = $ads;
1174
+ shuffle ($ai_wp_data [AI_COUNT]);
1175
+ }
1176
+ }
1177
+
1178
+ if (isset ($ai_wp_data [AI_COUNT])) {
1179
+ $ads = $ai_wp_data [AI_COUNT];
1180
+ }
1181
+
1182
  $processed_code = $ads [$counter_for_filter - 1];
1183
  } else $processed_code = '';
1184
  } else $processed_code = $ads [rand (0, count ($ads) - 1)];
1187
  $dynamic_blocks = get_dynamic_blocks ();
1188
  if ($force_server_side_code || ($dynamic_blocks == AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC && defined ('AI_NO_W3TC'))) $dynamic_blocks = AI_DYNAMIC_BLOCKS_SERVER_SIDE;
1189
 
 
1190
  if (strpos ($processed_code, AD_ROTATE_SEPARATOR) !== false) {
 
1191
  $ads = explode (AD_ROTATE_SEPARATOR, $processed_code);
1192
 
1193
  if (!isset ($ai_wp_data [AI_SHORTCODES]['rotate'])) {
1214
  switch ($amp_dynamic_blocks) {
1215
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE:
1216
  $this->code_version = mt_rand (1, count ($ads));
1217
+ $processed_code = $close_button_code . trim ($ads [$this->code_version - 1]);
1218
  $this->version_name = $version_names [$this->code_version - 1];
1219
  break;
1220
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE:
1221
  $this->code_version = '""';
1222
 
1223
  if (defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !get_inline_styles ()) {
1224
+ $processed_code = "\n<div class='ai-rotate'>\n" . $close_button_code;
1225
  } else
1226
+ $processed_code = "\n<div class='ai-rotate' style='position: relative;'>\n" . $close_button_code;
1227
 
1228
  foreach ($ads as $index => $ad) {
1229
 
1253
  $processed_code .= "</div>\n";
1254
  break;
1255
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC:
1256
+ $this->w3tc_code = '$ai_code = unserialize (base64_decode (\''.base64_encode (serialize ($ads)).'\')); $ai_index = mt_rand (1, count ($ai_code)); $ai_code = base64_decode (\''.base64_encode ($close_button_code).'\') . $ai_code [$ai_index - 1]; $ai_enabled = true;';
1257
  $processed_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
1258
  $processed_code .= $this->w3tc_code.' echo $ai_code;';
1259
  $processed_code .= '<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
1260
  break;
1261
  }
1262
+ } else $processed_code = $close_button_code . $processed_code;
1263
 
1264
 
1265
  $this->color_class = 'ai-debug-default';
1316
  if ($countries != '') $country_attributes = "countries='$countries' country-list='$country_list_type'"; else $country_attributes = '';
1317
  if ($ip_addresses != '') $ip_address_attributes = "ip-addresses='$ip_addresses' ip-address-list='$ip_address_list_type'"; else $ip_address_attributes = '';
1318
 
1319
+ // $block_class_name = get_block_class_name (true);
1320
+ // $block_class_name = $block_class_name.'-'.$this->number;
 
1321
  $this->client_side_ip_address_detection = true;
1322
+ // $this->needs_class = true;
1323
 
1324
+ // if (defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !get_inline_styles ()) {
1325
+ // $processed_code = "\n<div class='ai-ip-data' $ip_address_attributes $country_attributes class-name='$block_class_name'>$processed_code</div>\n";
1326
+ // } else $processed_code = "\n<div class='ai-ip-data' $ip_address_attributes $country_attributes class-name='$block_class_name' style='visibility: hidden; position: absolute; width: 100%; height: 100%; z-index: -9999;'>$processed_code</div>\n";
1327
  if (defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !get_inline_styles ()) {
1328
+ $processed_code = "\n<div class='ai-ip-data' $ip_address_attributes $country_attributes>$processed_code</div>\n";
1329
+ } else $processed_code = "\n<div class='ai-ip-data' $ip_address_attributes $country_attributes style='visibility: hidden; position: absolute; width: 100%; height: 100%; z-index: -9999;'>$processed_code</div>\n";
1330
  }
1331
  break;
1332
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC:
1384
  return $processed_code;
1385
  }
1386
 
1387
+ public function get_code_for_insertion ($include_viewport_classes = true, $hidden_widgets = false, $code_only = false) {
1388
  global $ai_wp_data, $block_object;
1389
 
1390
+ if ($this->get_disable_caching ()) $ai_wp_data [AI_DISABLE_CACHING] = true;
1391
+
1392
+ if ($this->get_alignment_type() == AI_ALIGNMENT_NO_WRAPPING || $code_only) return $this->ai_getProcessedCode ();
1393
 
1394
  $alignment_class = $this->get_alignment_class ();
1395
 
1396
+ // Temp fix for alignment on AMP pages
1397
+ if ($ai_wp_data [AI_WP_AMP_PAGE] && $alignment_class != '' && defined ('AI_AMP_HEADER_STYLES') && AI_AMP_HEADER_STYLES) {
1398
+ switch ($this->get_alignment_type()) {
1399
+ case AI_ALIGNMENT_LEFT:
1400
+ $alignment_class .= ' ai-amp-left';
1401
+ break;
1402
+ case AI_ALIGNMENT_RIGHT:
1403
+ $alignment_class .= ' ai-amp-right';
1404
+ break;
1405
+ case AI_ALIGNMENT_CENTER:
1406
+ $alignment_class .= ' ai-amp-center';
1407
+ break;
1408
+ }
1409
+ }
1410
+
1411
  $hidden_viewports = '';
1412
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_BLOCKS) != 0 && $this->get_detection_client_side()) {
1413
 
1442
  // Prevent empty wrapping div on AMP pages
1443
  if ($ai_wp_data [AI_WP_AMP_PAGE] && $code == '') return '';
1444
 
1445
+ // if ($this->fallback != 0 && $block_object [$this->fallback]->get_tracking () || $this->get_tracking ())
1446
+ // $this->needs_class = true;
1447
+
1448
+ $block_class_name = get_block_class_name ($this->needs_class);
1449
+ // if ($block_class_name == '' && $this->needs_class) $block_class_name = DEFAULT_BLOCK_CLASS_NAME;
1450
+
1451
+ $block_class = get_block_class ();
1452
+ $block_number_class = get_block_number_class ();
1453
+
1454
+ $viewport_classes = $include_viewport_classes ? trim ($this->get_viewport_classes ()) : "";
1455
+
1456
+ if ($block_class_name != '' && ($block_class || $block_number_class) || $alignment_class != '' || $viewport_classes != '') {
1457
+ // if ($block_class_name != '') {
1458
+ // $classes = array ($block_class_name, $alignment_class, $block_class_name . "-" . $this->number, trim ($viewport_classes));
1459
+ // } else {
1460
+ // $classes = array ($alignment_class, $viewport_classes);
1461
+ // }
1462
+ $classes = array ();
1463
+ if ($block_class_name != '' && ($block_class || $this->needs_class)) $classes []= $block_class_name;
1464
+ if ($alignment_class) $classes []= $alignment_class;
1465
+ if ($block_class_name != '' && ($block_number_class || $this->needs_class)) $classes []= $block_class_name . "-" . $this->number;
1466
+ if ($viewport_classes) $classes []= $viewport_classes;
1467
  } else $classes = array ();
 
1468
 
1469
  if ($hidden_widgets) return $hidden_viewports; else {
1470
  if ($this->client_side_ip_address_detection && !$ai_wp_data [AI_WP_AMP_PAGE]) {
1471
  $additional_block_style = 'visibility: hidden; position: absolute; width: 100%; height: 100%; z-index: -9999; ';
1472
+ // if (defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !get_inline_styles ()) {
1473
+ // $classes [] = 'ai-ip-data-block';
1474
+ // }
1475
+ // Needed to locate wrapping div
1476
+ $classes [] = 'ai-ip-data-block';
1477
  } else {
1478
  $additional_block_style = '';
1479
  }
1480
 
1481
+ if ($this->get_close_button () && !$ai_wp_data [AI_WP_AMP_PAGE]) {
1482
+ $classes [] = 'ai-close';
1483
+
1484
+ if ($this->get_alignment_type () == AI_ALIGNMENT_RIGHT) {
1485
+ // To cancel 'width: fit-content;'
1486
+ $classes [] = 'ai-close-width';
1487
+ }
1488
+ }
1489
+
1490
  foreach ($classes as $index => $class_name) {
1491
  if (trim ($class_name) == '') unset ($classes [$index]);
1492
  }
 
1493
  if (count ($classes) != 0) {
1494
+ $class = " class='" . trim (implode (' ', $classes)) . "'";
1495
  } else $class = "";
1496
 
1497
  $tracking_code_pre = '';
1552
  }
1553
  }
1554
 
1555
+ public function get_ad_general_tag(){
1556
+ $option = isset ($this->wp_options [AI_OPTION_GENERAL_TAG]) ? $this->wp_options [AI_OPTION_GENERAL_TAG] : "";
1557
+ if ($option == '') $option = AD_GENERAL_TAG;
1558
+ return $option;
1559
+ }
1560
+
1561
+ public function get_close_button (){
1562
+ $option = isset ($this->wp_options [AI_OPTION_CLOSE_BUTTON]) ? $this->wp_options [AI_OPTION_CLOSE_BUTTON] : DEFAULT_CLOSE_BUTTON;
1563
  return $option;
1564
  }
1565
 
1807
  return ($viewport_classes);
1808
  }
1809
 
1810
+ public function get_alignment_class ($block_class_name = null){
1811
  global $ai_wp_data;
1812
 
 
 
1813
  if (defined ('AI_AMP_HEADER_STYLES') && AI_AMP_HEADER_STYLES && $ai_wp_data [AI_WP_AMP_PAGE] ||
1814
  defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !$ai_wp_data [AI_WP_AMP_PAGE] && !get_inline_styles ()) {
1815
+ return $this->generate_alignment_class ($block_class_name);
1816
+ }
1817
 
1818
+ return '';
1819
+ }
1820
 
1821
+ public function generate_alignment_class ($block_class_name = null){
1822
+
1823
+ if ($block_class_name == null) $block_class_name = get_block_class_name (true);
1824
+ $block_class_name .= '-';
1825
+
1826
+ switch ($this->get_alignment_type ()) {
1827
+ case AI_ALIGNMENT_DEFAULT:
1828
+ case AI_ALIGNMENT_LEFT:
1829
+ case AI_ALIGNMENT_RIGHT:
1830
+ case AI_ALIGNMENT_CENTER:
1831
+ case AI_ALIGNMENT_FLOAT_LEFT:
1832
+ case AI_ALIGNMENT_FLOAT_RIGHT:
1833
+ case AI_ALIGNMENT_STICKY_LEFT:
1834
+ case AI_ALIGNMENT_STICKY_RIGHT:
1835
+ case AI_ALIGNMENT_STICKY_TOP:
1836
+ case AI_ALIGNMENT_STICKY_BOTTOM:
1837
+ return $block_class_name . str_replace (' ', '-', strtolower ($this->get_alignment_type_text ()));
1838
+ break;
1839
+ case AI_ALIGNMENT_CUSTOM_CSS:
1840
+ return $block_class_name . str_replace (' ', '-', strtolower (md5 ($this->get_custom_css ())));
1841
+ break;
1842
  }
1843
 
1844
  return '';
1902
  foreach ($special_element_tags as $special_element_tag) {
1903
  preg_match_all ("/<\/?$special_element_tag/i", $content, $special_elements, PREG_OFFSET_CAPTURE);
1904
 
1905
+ $nesting = array ();
1906
  $special_elements = $special_elements [0];
1907
  foreach ($special_elements as $index => $special_element) {
1908
+ if (isset ($special_elements [$index + 1][0])) {
1909
+ $tag1 = strtolower ($special_element [0]);
1910
+ $tag2 = strtolower ($special_elements [$index + 1][0]);
1911
 
1912
+ $start_offset = $special_element [1];
1913
+ $nesting_ended = false;
1914
+
1915
+ $tag1_start = $tag1 == "<$special_element_tag";
1916
+ $tag2_start = $tag2 == "<$special_element_tag";
1917
+ $tag1_end = $tag1 == "</$special_element_tag";
1918
+ $tag2_end = $tag2 == "</$special_element_tag";
1919
+
1920
+ if ($tag1_start && $tag2_start) {
1921
+ array_push ($nesting, $start_offset);
1922
+ continue;
1923
+ }
1924
+ elseif ($tag1_end && $tag2_end) {
1925
+ $start_offset = array_pop ($nesting);
1926
+ if (count ($nesting) == 0) $nesting_ended = true;
1927
+ }
1928
+
1929
+ if (count ($nesting) != 0) continue;
1930
+
1931
+ if (($nesting_ended || $tag1_start) && $tag2_end) {
1932
+
1933
+ if ($multibyte) {
1934
+ $special_element_offsets []= array (mb_strlen (substr ($content, 0, $start_offset)) + 1, mb_strlen (substr ($content, 0, $special_elements [$index + 1][1])));
1935
+ } else {
1936
+ $special_element_offsets []= array ($start_offset + 1, $special_elements [$index + 1][1]);
1937
+ }
1938
+ }
1939
  }
1940
  }
1941
  }
2497
  foreach ($special_element_tags as $special_element_tag) {
2498
  preg_match_all ("/<\/?$special_element_tag/i", $content, $special_elements, PREG_OFFSET_CAPTURE);
2499
 
2500
+ $nesting = array ();
2501
  $special_elements = $special_elements [0];
2502
  foreach ($special_elements as $index => $special_element) {
2503
+ if (isset ($special_elements [$index + 1][0])) {
2504
+ $tag1 = strtolower ($special_element [0]);
2505
+ $tag2 = strtolower ($special_elements [$index + 1][0]);
2506
 
2507
+ $start_offset = $special_element [1];
2508
+ $nesting_ended = false;
2509
+
2510
+ $tag1_start = $tag1 == "<$special_element_tag";
2511
+ $tag2_start = $tag2 == "<$special_element_tag";
2512
+ $tag1_end = $tag1 == "</$special_element_tag";
2513
+ $tag2_end = $tag2 == "</$special_element_tag";
2514
+
2515
+ if ($tag1_start && $tag2_start) {
2516
+ array_push ($nesting, $start_offset);
2517
+ continue;
2518
+ }
2519
+ elseif ($tag1_end && $tag2_end) {
2520
+ $start_offset = array_pop ($nesting);
2521
+ if (count ($nesting) == 0) $nesting_ended = true;
2522
+ }
2523
 
2524
+ if (count ($nesting) != 0) continue;
2525
+
2526
+ if (($nesting_ended || $tag1_start) && $tag2_end) {
2527
+
2528
+ if ($multibyte) {
2529
+ $special_element_offsets []= array (mb_strlen (substr ($content, 0, $start_offset)), mb_strlen (substr ($content, 0, $special_elements [$index + 1][1])));
2530
+ } else {
2531
+ $special_element_offsets []= array ($start_offset, $special_elements [$index + 1][1]);
2532
+ }
2533
+ }
2534
  }
2535
  }
2536
  }
constants.php CHANGED
@@ -12,15 +12,18 @@ define ('AI_ADSENSE_AUTH_CODE', 'ai-adsense-auth-code');
12
  if (!defined ('AD_INSERTER_PLUGIN_DIR'))
13
  define ('AD_INSERTER_PLUGIN_DIR', plugin_dir_path (__FILE__));
14
 
15
- if (file_exists (AD_INSERTER_PLUGIN_DIR.'functions.php')) {
16
- include_once AD_INSERTER_PLUGIN_DIR.'functions.php';
 
 
 
17
  }
18
 
19
  if (!defined( 'AD_INSERTER_NAME'))
20
  define ('AD_INSERTER_NAME', 'Ad Inserter');
21
 
22
  if (!defined( 'AD_INSERTER_VERSION'))
23
- define ('AD_INSERTER_VERSION', '2.2.13');
24
 
25
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
26
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
@@ -60,6 +63,7 @@ define ('AI_OPTION_TRACKING', 'tracking');
60
  define ('AI_OPTION_ENABLE_AJAX', 'enable_ajax');
61
  define ('AI_OPTION_ENABLE_FEED', 'enable_feed');
62
  define ('AI_OPTION_ENABLE_404', 'enable_404');
 
63
  define ('AI_OPTION_BLOCK_NAME', 'name');
64
  define ('AI_OPTION_AUTOMATIC_INSERTION', 'display_type');
65
  define ('AI_OPTION_PARAGRAPH_NUMBER', 'paragraph_number');
@@ -127,6 +131,7 @@ define ('AI_OPTION_DETECT_CLIENT_SIDE', 'detect_client_side');
127
  define ('AI_OPTION_DETECT_VIEWPORT', 'detect_viewport');
128
  define ('AI_OPTION_ADB_BLOCK_ACTION', 'adb-block-action');
129
  define ('AI_OPTION_ADB_BLOCK_REPLACEMENT', 'adb-block-replacement');
 
130
 
131
  define ('AI_OPTION_DISABLED', 'disabled');
132
 
@@ -288,8 +293,12 @@ define('AI_ALIGNMENT_CSS_FLOAT_LEFT', 'margin: 8px 8px 8px 0; float: left;')
288
  define('AI_ALIGNMENT_CSS_FLOAT_RIGHT', 'margin: 8px 0 8px 8px; float: right;');
289
  define('AI_ALIGNMENT_CSS_STICKY_LEFT', 'position: fixed; left: 0px; top: 100px; z-index: 9999;');
290
  define('AI_ALIGNMENT_CSS_STICKY_RIGHT', 'position: fixed; right: 0px; top: 100px; z-index: 9999;');
291
- define('AI_ALIGNMENT_CSS_STICKY_TOP', 'position: fixed; top: 0; left: 0; width: 100%; text-align: center; z-index: 9999;||position: fixed; top: 0; left: 0; width: 100%; text-align: center; display: flex; justify-content: center; z-index: 9999;');
292
- define('AI_ALIGNMENT_CSS_STICKY_BOTTOM', 'position: fixed; bottom: 0; left: 0; width: 100%; text-align: center; z-index: 9999;||position: fixed; bottom: 0; left: 0; width: 100%; text-align: center; display: flex; justify-content: center; z-index: 9999;');
 
 
 
 
293
 
294
  //List Type
295
  define('AD_BLACK_LIST','Black List');
@@ -432,6 +441,12 @@ define ('AI_STICKY_WIDGET_MODE_JS', 1);
432
  define ('AI_TEXT_CSS', 'CSS');
433
  define ('AI_TEXT_JS', 'JavaScript ');
434
 
 
 
 
 
 
 
435
  //Settings
436
  define ('AI_ENABLED', '1');
437
  define ('AI_DISABLED', '0');
@@ -459,6 +474,8 @@ define ('AI_TRANSIENT_ADB_FILES_VERSION', 'ai-adb-version');
459
  define ('AI_SYNTAX_HIGHLIGHTER_THEME', 'ad_inserter');
460
  define ('DEFAULT_SYNTAX_HIGHLIGHTER_THEME', AI_SYNTAX_HIGHLIGHTER_THEME);
461
  define ('DEFAULT_BLOCK_CLASS_NAME', 'code-block');
 
 
462
  define ('DEFAULT_INLINE_STYLES', AI_ENABLED);
463
  define ('DEFAULT_MINIMUM_USER_ROLE', 'administrator');
464
  define ('DEFAULT_STICKY_WIDGET_MODE', AI_STICKY_WIDGET_MODE_CSS);
@@ -470,7 +487,8 @@ define ('DEFAULT_NO_PARAGRAPH_COUNTING_INSIDE', 'blockquote, figure, li');
470
  define ('DEFAULT_PARAGRAPH_TAGS', 'p');
471
  define ('DEFAULT_ADMIN_TOOLBAR_DEBUGGING', AI_ENABLED);
472
  define ('DEFAULT_REMOTE_DEBUGGING', AI_DISABLED);
473
- define ('DEFAULT_JAVASCRIPT_DEBUGGING', AI_DISABLED);
 
474
  define ('DEFAULT_MULTISITE_SETTINGS_PAGE', AI_ENABLED);
475
  define ('DEFAULT_MULTISITE_WIDGETS', AI_ENABLED);
476
  define ('DEFAULT_MULTISITE_PHP_PROCESSING', AI_ENABLED);
@@ -486,6 +504,9 @@ define ('DEFAULT_ADB_BLOCK_ACTION', AI_ADB_BLOCK_ACTION_DO_NOTHING);
486
  define ('DEFAULT_ADB_DETECTION', AI_ADB_DETECTION_ADVANCED);
487
  define ('DEFAULT_CUSTOM_HOOK_PRIORITY', 10);
488
  define ('DEFAULT_OUTPUT_BUFFERING', AI_OUTPUT_BUFFERING_DISABLED);
 
 
 
489
 
490
  define ('AI_ADBLOCKING_DETECTION', true);
491
  define ('AI_NORMAL_HEADER_STYLES', true);
@@ -628,16 +649,20 @@ define ('AI_NUMBER_OF_COMMENTS', 11);
628
  define ('AI_COMMENTS_SAVED_CALLBACK', 12);
629
  define ('AI_COMMENTS_SAVED_END_CALLBACK',13);
630
  define ('AI_ADB_DETECTION', 14);
631
- define ('AI_JS_DEBUGGING', 15);
632
- define ('AI_WP_AMP_PAGE', 16);
633
- define ('AI_INSTALL_TIME_DIFFERENCE', 17);
634
- define ('AI_DAYS_SINCE_INSTAL', 18);
635
- define ('AI_TAGS', 19);
636
- define ('AI_VIEWPORTS', 20);
637
- define ('AI_WORD_COUNT', 21);
638
- define ('AI_ADB_SHORTCODE_ACTION', 22);
639
- define ('AI_SHORTCODES', 23);
640
- define ('AI_VIEWPORT_NAMES', 24);
 
 
 
 
641
 
642
  define ('AI_CONTEXT_NONE', 0);
643
  define ('AI_CONTEXT_CONTENT', 1);
12
  if (!defined ('AD_INSERTER_PLUGIN_DIR'))
13
  define ('AD_INSERTER_PLUGIN_DIR', plugin_dir_path (__FILE__));
14
 
15
+ if (!defined ('AD_INSERTER_FILE'))
16
+ define ('AD_INSERTER_FILE', AD_INSERTER_PLUGIN_DIR.'ad-inserter.php');
17
+
18
+ if (file_exists (AD_INSERTER_PLUGIN_DIR.'includes/functions.php')) {
19
+ include_once AD_INSERTER_PLUGIN_DIR.'includes/functions.php';
20
  }
21
 
22
  if (!defined( 'AD_INSERTER_NAME'))
23
  define ('AD_INSERTER_NAME', 'Ad Inserter');
24
 
25
  if (!defined( 'AD_INSERTER_VERSION'))
26
+ define ('AD_INSERTER_VERSION', '2.2.14');
27
 
28
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
29
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
63
  define ('AI_OPTION_ENABLE_AJAX', 'enable_ajax');
64
  define ('AI_OPTION_ENABLE_FEED', 'enable_feed');
65
  define ('AI_OPTION_ENABLE_404', 'enable_404');
66
+ define ('AI_OPTION_DISABLE_CACHING', 'disable_caching');
67
  define ('AI_OPTION_BLOCK_NAME', 'name');
68
  define ('AI_OPTION_AUTOMATIC_INSERTION', 'display_type');
69
  define ('AI_OPTION_PARAGRAPH_NUMBER', 'paragraph_number');
131
  define ('AI_OPTION_DETECT_VIEWPORT', 'detect_viewport');
132
  define ('AI_OPTION_ADB_BLOCK_ACTION', 'adb-block-action');
133
  define ('AI_OPTION_ADB_BLOCK_REPLACEMENT', 'adb-block-replacement');
134
+ define ('AI_OPTION_CLOSE_BUTTON', 'close-button');
135
 
136
  define ('AI_OPTION_DISABLED', 'disabled');
137
 
293
  define('AI_ALIGNMENT_CSS_FLOAT_RIGHT', 'margin: 8px 0 8px 8px; float: right;');
294
  define('AI_ALIGNMENT_CSS_STICKY_LEFT', 'position: fixed; left: 0px; top: 100px; z-index: 9999;');
295
  define('AI_ALIGNMENT_CSS_STICKY_RIGHT', 'position: fixed; right: 0px; top: 100px; z-index: 9999;');
296
+ define('AI_ALIGNMENT_CSS_STICKY_TOP', 'position: fixed; top: 0; text-align: center; left: 50%; transform: translate(-50%); width: 100%; z-index: 9999;||position: fixed; top: 0; left: 0; width: 100%; text-align: center; z-index: 9999;||position: fixed; top: 0; left: 0; width: 100%; text-align: center; display: flex; justify-content: center; z-index: 9999;');
297
+ define('AI_ALIGNMENT_CSS_STICKY_BOTTOM', 'position: fixed; bottom: 0; text-align: center; left: 50%; transform: translate(-50%); width: 100%; z-index: 9999;||position: fixed; bottom: 0; left: 0; width: 100%; text-align: center; z-index: 9999;||position: fixed; bottom: 0; left: 0; width: 100%; text-align: center; display: flex; justify-content: center; z-index: 9999;');
298
+
299
+ define('AI_ALIGNMENT_CSS_AMP_LEFT', 'display: flex; justify-content: flex-start;');
300
+ define('AI_ALIGNMENT_CSS_AMP_RIGHT', 'display: flex; justify-content: flex-end;');
301
+ define('AI_ALIGNMENT_CSS_AMP_CENTER', 'display: flex; justify-content: center;');
302
 
303
  //List Type
304
  define('AD_BLACK_LIST','Black List');
441
  define ('AI_TEXT_CSS', 'CSS');
442
  define ('AI_TEXT_JS', 'JavaScript ');
443
 
444
+ define ('AI_GEO_DB_WEBNET77', 0);
445
+ define ('AI_GEO_DB_MAXMIND', 1);
446
+
447
+ define ('AI_TEXT_WEBNET77', 'Webnet77');
448
+ define ('AI_TEXT_MAXMIND', 'MaxMind');
449
+
450
  //Settings
451
  define ('AI_ENABLED', '1');
452
  define ('AI_DISABLED', '0');
474
  define ('AI_SYNTAX_HIGHLIGHTER_THEME', 'ad_inserter');
475
  define ('DEFAULT_SYNTAX_HIGHLIGHTER_THEME', AI_SYNTAX_HIGHLIGHTER_THEME);
476
  define ('DEFAULT_BLOCK_CLASS_NAME', 'code-block');
477
+ define ('DEFAULT_BLOCK_CLASS', AI_ENABLED);
478
+ define ('DEFAULT_BLOCK_NUMBER_CLASS', AI_ENABLED);
479
  define ('DEFAULT_INLINE_STYLES', AI_ENABLED);
480
  define ('DEFAULT_MINIMUM_USER_ROLE', 'administrator');
481
  define ('DEFAULT_STICKY_WIDGET_MODE', AI_STICKY_WIDGET_MODE_CSS);
487
  define ('DEFAULT_PARAGRAPH_TAGS', 'p');
488
  define ('DEFAULT_ADMIN_TOOLBAR_DEBUGGING', AI_ENABLED);
489
  define ('DEFAULT_REMOTE_DEBUGGING', AI_DISABLED);
490
+ define ('DEFAULT_BACKEND_JS_DEBUGGING', AI_DISABLED);
491
+ define ('DEFAULT_FRONTEND_JS_DEBUGGING', AI_DISABLED);
492
  define ('DEFAULT_MULTISITE_SETTINGS_PAGE', AI_ENABLED);
493
  define ('DEFAULT_MULTISITE_WIDGETS', AI_ENABLED);
494
  define ('DEFAULT_MULTISITE_PHP_PROCESSING', AI_ENABLED);
504
  define ('DEFAULT_ADB_DETECTION', AI_ADB_DETECTION_ADVANCED);
505
  define ('DEFAULT_CUSTOM_HOOK_PRIORITY', 10);
506
  define ('DEFAULT_OUTPUT_BUFFERING', AI_OUTPUT_BUFFERING_DISABLED);
507
+ define ('DEFAULT_GEO_DB', AI_GEO_DB_WEBNET77);
508
+ define ('DEFAULT_GEO_DB_UPDATES', AI_DISABLED);
509
+ define ('DEFAULT_CLOSE_BUTTON', AI_DISABLED);
510
 
511
  define ('AI_ADBLOCKING_DETECTION', true);
512
  define ('AI_NORMAL_HEADER_STYLES', true);
649
  define ('AI_COMMENTS_SAVED_CALLBACK', 12);
650
  define ('AI_COMMENTS_SAVED_END_CALLBACK',13);
651
  define ('AI_ADB_DETECTION', 14);
652
+ define ('AI_BACKEND_JS_DEBUGGING', 15);
653
+ define ('AI_FRONTEND_JS_DEBUGGING', 16);
654
+ define ('AI_WP_AMP_PAGE', 17);
655
+ define ('AI_INSTALL_TIME_DIFFERENCE', 18);
656
+ define ('AI_DAYS_SINCE_INSTAL', 19);
657
+ define ('AI_TAGS', 20);
658
+ define ('AI_VIEWPORTS', 21);
659
+ define ('AI_WORD_COUNT', 22);
660
+ define ('AI_ADB_SHORTCODE_ACTION', 23);
661
+ define ('AI_SHORTCODES', 24);
662
+ define ('AI_VIEWPORT_NAMES', 25);
663
+ define ('AI_CLOSE_BUTTONS', 26);
664
+ define ('AI_DISABLE_CACHING', 27);
665
+ define ('AI_COUNT', 28);
666
 
667
  define ('AI_CONTEXT_NONE', 0);
668
  define ('AI_CONTEXT_CONTENT', 1);
css/ad-inserter.css CHANGED
@@ -1,5 +1,5 @@
1
  #ai-data {
2
- font-family: "2.2.13"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
@@ -97,6 +97,14 @@ a.clear-link, a.clear-link:hover, a.clear-link:focus {
97
  border-radius: 5px;
98
  }
99
 
 
 
 
 
 
 
 
 
100
  /*#editor-1 {*/
101
  /* font-family: Courier, 'Courier New', monospace, tahoma;*/
102
  /* font-family: tahoma;*/
1
  #ai-data {
2
+ font-family: "2.2.14"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
97
  border-radius: 5px;
98
  }
99
 
100
+ .ai-settings-table.ai-values td:first-child {
101
+ width: 35%;
102
+ }
103
+
104
+ .ai-settings-table.fixed {
105
+ table-layout: fixed;
106
+ }
107
+
108
  /*#editor-1 {*/
109
  /* font-family: Courier, 'Courier New', monospace, tahoma;*/
110
  /* font-family: tahoma;*/
includes/Mobile_Detect.php CHANGED
@@ -22,7 +22,7 @@
22
  * README: https://github.com/serbanghita/Mobile-Detect/blob/master/README.md
23
  * HOWTO: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples
24
  *
25
- * @version 2.8.26
26
  */
27
 
28
  class ai_Mobile_Detect
@@ -66,7 +66,7 @@ class ai_Mobile_Detect
66
  /**
67
  * Stores the version number of the current release.
68
  */
69
- const VERSION = '2.8.26';
70
 
71
  /**
72
  * A type for the version() method indicating a string return value.
@@ -169,12 +169,12 @@ class ai_Mobile_Detect
169
  protected static $phoneDevices = array(
170
  'iPhone' => '\biPhone\b|\biPod\b', // |\biTunes
171
  'BlackBerry' => 'BlackBerry|\bBB10\b|rim[0-9]+',
172
- 'HTC' => 'HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m',
173
  'Nexus' => 'Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6',
174
  // @todo: Is 'Dell Streak' a tablet or a phone? ;)
175
- 'Dell' => 'Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b',
176
- 'Motorola' => 'Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\bMoto E\b',
177
- 'Samsung' => '\bSamsung\b|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C',
178
  'LG' => '\bLG\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)',
179
  'Sony' => 'SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533',
180
  'Asus' => 'Asus.*Galaxy|PadFone.*Mobile',
@@ -220,7 +220,7 @@ class ai_Mobile_Detect
220
  // Removed |^.*Android.*Nexus(?!(?:Mobile).)*$
221
  // @see #442
222
  'NexusTablet' => 'Android.*Nexus[\s]+(7|9|10)',
223
- 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y', // SCH-P709|SCH-P729|SM-T2558|GT-I9205 - Samsung Mega - treat them like a regular phone.
224
  // http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html
225
  'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\b|Android.*Silk/[0-9.]+ like Chrome/[0-9.]+ (?!Mobile)',
226
  // Only the Surface tablets with Windows RT are considered mobile.
@@ -252,7 +252,7 @@ class ai_Mobile_Detect
252
  // Prestigio Tablets http://www.prestigio.com/support
253
  'PrestigioTablet' => 'PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002',
254
  // http://support.lenovo.com/en_GB/downloads/default.page?#
255
- 'LenovoTablet' => 'Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)',
256
  // http://www.dell.com/support/home/us/en/04/Products/tab_mob/tablets
257
  'DellTablet' => 'Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7',
258
  // http://www.yarvik.com/en/matrix/tablets/
@@ -302,10 +302,10 @@ class ai_Mobile_Detect
302
  // http://www.fly-phone.com/devices/tablets/ ; http://www.fly-phone.com/service/
303
  'FlyTablet' => 'IQ310|Fly Vision',
304
  // http://www.bqreaders.com/gb/tablets-prices-sale.html
305
- 'bqTablet' => 'Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris [E|M]10)|Maxwell.*Lite|Maxwell.*Plus',
306
  // http://www.huaweidevice.com/worldwide/productFamily.do?method=index&directoryId=5011&treeId=3290
307
  // http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&directoryId=3372&treeId=0&tb=1&type=software (including legacy tablets)
308
- 'HuaweiTablet' => 'MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim',
309
  // Nec or Medias Tab
310
  'NecTablet' => '\bN-06D|\bN-08D',
311
  // Pantech Tablets: http://www.pantechusa.com/phones/
@@ -361,7 +361,7 @@ class ai_Mobile_Detect
361
  'PointOfViewTablet' => 'TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10',
362
  // http://www.overmax.pl/pl/katalog-produktow,p8/tablety,c14/
363
  // @todo: add more tests.
364
- 'OvermaxTablet' => 'OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)',
365
  // http://hclmetablet.com/India/index.php
366
  'HCLTablet' => 'HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync',
367
  // http://www.edigital.hu/Tablet_es_e-book_olvaso/Tablet-c18385.html
@@ -417,6 +417,8 @@ class ai_Mobile_Detect
417
  'XoroTablet' => 'KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151',
418
  // http://www1.viewsonic.com/products/computing/tablets/
419
  'ViewsonicTablet' => 'ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a',
 
 
420
  // http://www.odys.de/web/internet-tablet_en.html
421
  'OdysTablet' => 'LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\bXELIO\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10',
422
  // http://www.captiva-power.de/products.html#tablets-en
@@ -489,7 +491,7 @@ class ai_Mobile_Detect
489
  // http://msdn.microsoft.com/library/ms537503.aspx
490
  // https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx
491
  'WindowsPhoneOS' => 'Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;',
492
- 'iOS' => '\biPhone.*Mobile|\biPod|\biPad',
493
  // http://en.wikipedia.org/wiki/MeeGo
494
  // @todo: research MeeGo in UAs
495
  'MeeGoOS' => 'MeeGo',
@@ -628,7 +630,7 @@ class ai_Mobile_Detect
628
  'Opera' => array( ' OPR/[VER]', 'Opera Mini/[VER]', 'Version/[VER]' ),
629
  'Opera Mini' => 'Opera Mini/[VER]',
630
  'Opera Mobi' => 'Version/[VER]',
631
- 'UC Browser' => 'UC Browser[VER]',
632
  'MQQBrowser' => 'MQQBrowser/[VER]',
633
  'MicroMessenger' => 'MicroMessenger/[VER]',
634
  'baiduboxapp' => 'baiduboxapp/[VER]',
@@ -821,6 +823,16 @@ class ai_Mobile_Detect
821
  return $this->cloudfrontHeaders;
822
  }
823
 
 
 
 
 
 
 
 
 
 
 
824
  /**
825
  * Set the User-Agent to be used.
826
  *
@@ -834,7 +846,7 @@ class ai_Mobile_Detect
834
  $this->cache = array();
835
 
836
  if (false === empty($userAgent)) {
837
- return $this->userAgent = $userAgent;
838
  } else {
839
  $this->userAgent = null;
840
  foreach ($this->getUaHttpHeaders() as $altHeader) {
@@ -844,7 +856,7 @@ class ai_Mobile_Detect
844
  }
845
 
846
  if (!empty($this->userAgent)) {
847
- return $this->userAgent = trim($this->userAgent);
848
  }
849
  }
850
 
22
  * README: https://github.com/serbanghita/Mobile-Detect/blob/master/README.md
23
  * HOWTO: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples
24
  *
25
+ * @version 2.8.30
26
  */
27
 
28
  class ai_Mobile_Detect
66
  /**
67
  * Stores the version number of the current release.
68
  */
69
+ const VERSION = '2.8.30';
70
 
71
  /**
72
  * A type for the version() method indicating a string return value.
169
  protected static $phoneDevices = array(
170
  'iPhone' => '\biPhone\b|\biPod\b', // |\biTunes
171
  'BlackBerry' => 'BlackBerry|\bBB10\b|rim[0-9]+',
172
+ 'HTC' => 'HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel',
173
  'Nexus' => 'Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6',
174
  // @todo: Is 'Dell Streak' a tablet or a phone? ;)
175
+ 'Dell' => 'Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b',
176
+ 'Motorola' => 'Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\bMoto E\b|XT1068|XT1092',
177
+ 'Samsung' => '\bSamsung\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F',
178
  'LG' => '\bLG\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)',
179
  'Sony' => 'SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533',
180
  'Asus' => 'Asus.*Galaxy|PadFone.*Mobile',
220
  // Removed |^.*Android.*Nexus(?!(?:Mobile).)*$
221
  // @see #442
222
  'NexusTablet' => 'Android.*Nexus[\s]+(7|9|10)',
223
+ 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y?|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y', // SCH-P709|SCH-P729|SM-T2558|GT-I9205 - Samsung Mega - treat them like a regular phone.
224
  // http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html
225
  'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\b|Android.*Silk/[0-9.]+ like Chrome/[0-9.]+ (?!Mobile)',
226
  // Only the Surface tablets with Windows RT are considered mobile.
252
  // Prestigio Tablets http://www.prestigio.com/support
253
  'PrestigioTablet' => 'PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002',
254
  // http://support.lenovo.com/en_GB/downloads/default.page?#
255
+ 'LenovoTablet' => 'Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)|TB-X103F|TB-X304F|TB-8703F',
256
  // http://www.dell.com/support/home/us/en/04/Products/tab_mob/tablets
257
  'DellTablet' => 'Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7',
258
  // http://www.yarvik.com/en/matrix/tablets/
302
  // http://www.fly-phone.com/devices/tablets/ ; http://www.fly-phone.com/service/
303
  'FlyTablet' => 'IQ310|Fly Vision',
304
  // http://www.bqreaders.com/gb/tablets-prices-sale.html
305
+ 'bqTablet' => 'Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris ([E|M]10|M8))|Maxwell.*Lite|Maxwell.*Plus',
306
  // http://www.huaweidevice.com/worldwide/productFamily.do?method=index&directoryId=5011&treeId=3290
307
  // http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&directoryId=3372&treeId=0&tb=1&type=software (including legacy tablets)
308
+ 'HuaweiTablet' => 'MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim|M2-A01L',
309
  // Nec or Medias Tab
310
  'NecTablet' => '\bN-06D|\bN-08D',
311
  // Pantech Tablets: http://www.pantechusa.com/phones/
361
  'PointOfViewTablet' => 'TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10',
362
  // http://www.overmax.pl/pl/katalog-produktow,p8/tablety,c14/
363
  // @todo: add more tests.
364
+ 'OvermaxTablet' => 'OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)|Qualcore 1027',
365
  // http://hclmetablet.com/India/index.php
366
  'HCLTablet' => 'HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync',
367
  // http://www.edigital.hu/Tablet_es_e-book_olvaso/Tablet-c18385.html
417
  'XoroTablet' => 'KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151',
418
  // http://www1.viewsonic.com/products/computing/tablets/
419
  'ViewsonicTablet' => 'ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a',
420
+ // https://www.verizonwireless.com/tablets/verizon/
421
+ 'VerizonTablet' => 'QTAQZ3|QTAIR7|QTAQTZ3|QTASUN1|QTASUN2|QTAXIA1',
422
  // http://www.odys.de/web/internet-tablet_en.html
423
  'OdysTablet' => 'LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\bXELIO\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10',
424
  // http://www.captiva-power.de/products.html#tablets-en
491
  // http://msdn.microsoft.com/library/ms537503.aspx
492
  // https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx
493
  'WindowsPhoneOS' => 'Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;',
494
+ 'iOS' => '\biPhone.*Mobile|\biPod|\biPad|AppleCoreMedia',
495
  // http://en.wikipedia.org/wiki/MeeGo
496
  // @todo: research MeeGo in UAs
497
  'MeeGoOS' => 'MeeGo',
630
  'Opera' => array( ' OPR/[VER]', 'Opera Mini/[VER]', 'Version/[VER]' ),
631
  'Opera Mini' => 'Opera Mini/[VER]',
632
  'Opera Mobi' => 'Version/[VER]',
633
+ 'UCBrowser' => array( 'UCWEB[VER]', 'UC.*Browser/[VER]' ),
634
  'MQQBrowser' => 'MQQBrowser/[VER]',
635
  'MicroMessenger' => 'MicroMessenger/[VER]',
636
  'baiduboxapp' => 'baiduboxapp/[VER]',
823
  return $this->cloudfrontHeaders;
824
  }
825
 
826
+ /**
827
+ * @param string $userAgent
828
+ * @return string
829
+ */
830
+ private function prepareUserAgent($userAgent) {
831
+ $userAgent = trim($userAgent);
832
+ $userAgent = substr($userAgent, 0, 500);
833
+ return $userAgent;
834
+ }
835
+
836
  /**
837
  * Set the User-Agent to be used.
838
  *
846
  $this->cache = array();
847
 
848
  if (false === empty($userAgent)) {
849
+ return $this->userAgent = $this->prepareUserAgent($userAgent);
850
  } else {
851
  $this->userAgent = null;
852
  foreach ($this->getUaHttpHeaders() as $altHeader) {
856
  }
857
 
858
  if (!empty($this->userAgent)) {
859
+ return $this->userAgent = $this->prepareUserAgent($this->userAgent);
860
  }
861
  }
862
 
includes/colorpicker/css/bootstrap-colorpicker.css ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Bootstrap Colorpicker - Simple and customizable colorpicker component for Twitter Bootstrap.
3
+ * @package bootstrap-colorpicker
4
+ * @version v3.0.0-wip
5
+ * @license MIT
6
+ * @link https://farbelous.github.io/bootstrap-colorpicker/
7
+ * @link https://github.com/farbelous/bootstrap-colorpicker.git
8
+ */
9
+ .colorpicker-saturation {
10
+ width: 100px;
11
+ height: 100px;
12
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAQAAADa613fAAAP9klEQVR4XnRWC47rNgwcKjlA0bv2VL1Qi/YELRav7203iS1ppqZoiXCAhu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TzIgeJU7AAAAAElFTkSuQmCC");
13
+ cursor: crosshair;
14
+ float: left; }
15
+ .colorpicker-saturation .colorpicker-guide {
16
+ display: block;
17
+ height: 5px;
18
+ width: 5px;
19
+ border: 1px solid #000;
20
+ border-radius: 5px;
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ margin: -4px 0 0 -4px; }
25
+ .colorpicker-saturation .colorpicker-guide i {
26
+ display: block;
27
+ height: 5px;
28
+ width: 5px;
29
+ border: 1px solid #fff;
30
+ border-radius: 5px; }
31
+
32
+ .colorpicker-hue,
33
+ .colorpicker-alpha {
34
+ width: 15px;
35
+ height: 100px;
36
+ float: left;
37
+ cursor: row-resize;
38
+ margin-left: 4px;
39
+ margin-bottom: 4px; }
40
+
41
+ .colorpicker-hue .colorpicker-guide,
42
+ .colorpicker-alpha .colorpicker-guide {
43
+ display: block;
44
+ height: 1px;
45
+ background: #000;
46
+ border-top: 1px solid #fff;
47
+ position: absolute;
48
+ top: 0;
49
+ left: 0;
50
+ width: 100%;
51
+ margin-top: -1px; }
52
+
53
+ .colorpicker-hue {
54
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABkCAMAAABw8qpSAAABLFBMVEXqFBb/ABH/ACL/ADH/AEH/AFD/AGD/AG7/AH7/AI3/AJ3/AKz/ALz/AMr/ANv/AOr/APr2AP/mAP/XAP/HAP+4AP+oAP+aAP+JAP97AP9rAP9cAP9MAP8+AP8tAP8fAP8PAP8BAv8AEP8AH/8AL/8APv8ATv8AXP8Abf8Ae/8Ai/8Amv8Aqv8AuP8Ayf8A1/8A5/8A9/8A//gA/+kA/9kA/8oA/7oA/6wA/5sA/40A/30A/24A/14A/1AA/z8A/zEA/yEA/xEB/wMN/wAd/wAs/wA8/wBK/wBb/wBp/wB5/wCI/wCY/wCm/wC3/wDF/wDV/wDk/wD1/wD/+gD/7AD/3AD/zAD/vgD/rQD/nwD/jgD/gAD/cAD/YgD/UQD/QwD/MgD/JAD/FAD4Eg42qAedAAAAh0lEQVR4XgXAg3EDAAAAwI9to7Zt27a1/w49BASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTS1tHXo1KVbj159+g0YNGTYiFFjxk2YNGXajFlz5i1YtGTZilVr1m3YtGXbjl179h04dOTYiVNnzl24dOXajVt37j149OTZi1dv3n349OXbj19//wOxE1dQ8reGAAAAAElFTkSuQmCC"); }
55
+
56
+ .colorpicker-alpha {
57
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAABkCAQAAAAVxWkcAAABr0lEQVR4Xo2VwU0DQQxF7dmRuNIFlzlSAR3QAaXQQdIBJVABFXDcOVAAd67cjJLR07dkhcSrkZKfb/t7bG88rFo3B5gZPMNycItu2xloGV7MWHzM9zuzFWCkmA0nK6AszCUJDW6+mG6R03ncw5v8EMTEvZ2O3AliYjpslblc0RF9LmZYWxURU6aKytWZYsoWCAe+xwOZp1GsEukGiIkYxcQCHck99+gRgB7JncyIB5SGEhP3Yh5P6JwX+u6AnYot104d8DJT7uH7M9JH6OZbimj0vfMVaYnJIZFJDBW9kHlerL2C6JV4mSt7uuo2N57RxnZ+usQjn0R1jwBJBrNO3evJpVYUWsJ/E3UiXRlv24/7YZ04xmEdWlzcKS+B/eapeyMvFd2k0+hRk/T0AmTW8h69s2sjYMsdPntECiILhAeIMZAeH4QvUwfn6ijC0tTV+fT9ky8jM9nK2g7Ly1VjSpKYq6IvsAm7MtNu1orEqa/K3KNvgMFdhfquPfJmp2dbh0/8Gzb6Y22ViaNr6n5410zXdngVhbu6XqdOtWOuin5hjABGp4a2uotZ71MVCfwDBt2/v37yo6AAAAAASUVORK5CYII=");
58
+ display: none; }
59
+
60
+ .colorpicker-saturation,
61
+ .colorpicker-hue,
62
+ .colorpicker-alpha {
63
+ background-size: contain; }
64
+
65
+ .colorpicker {
66
+ position: absolute;
67
+ top: 100%;
68
+ left: 0;
69
+ display: none;
70
+ float: left;
71
+ font-size: inherit;
72
+ color: inherit;
73
+ text-align: left;
74
+ list-style: none;
75
+ background-color: #ffffff;
76
+ background-clip: padding-box;
77
+ border: 1px solid rgba(0, 0, 0, 0.15);
78
+ -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
79
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
80
+ padding: 4px;
81
+ min-width: 130px;
82
+ margin-top: 1px;
83
+ border-radius: 4px;
84
+ z-index: 1055; }
85
+
86
+ .colorpicker:before,
87
+ .colorpicker:after {
88
+ display: table;
89
+ content: "";
90
+ line-height: 0; }
91
+
92
+ .colorpicker:after {
93
+ clear: both; }
94
+
95
+ .colorpicker:before {
96
+ content: '';
97
+ display: inline-block;
98
+ border-left: 7px solid transparent;
99
+ border-right: 7px solid transparent;
100
+ border-bottom: 7px solid #ccc;
101
+ border-bottom-color: rgba(0, 0, 0, 0.2);
102
+ position: absolute;
103
+ top: -7px;
104
+ left: 6px; }
105
+
106
+ .colorpicker:after {
107
+ content: '';
108
+ display: inline-block;
109
+ border-left: 6px solid transparent;
110
+ border-right: 6px solid transparent;
111
+ border-bottom: 6px solid #ffffff;
112
+ position: absolute;
113
+ top: -6px;
114
+ left: 7px; }
115
+
116
+ .colorpicker div {
117
+ position: relative; }
118
+
119
+ .colorpicker.colorpicker-with-alpha {
120
+ min-width: 140px; }
121
+
122
+ .colorpicker.colorpicker-with-alpha .colorpicker-alpha {
123
+ display: block; }
124
+
125
+ .colorpicker-bar {
126
+ height: 15px;
127
+ margin: 5px 0 0 0;
128
+ clear: both;
129
+ text-align: center;
130
+ font-size: 10px;
131
+ line-height: normal; }
132
+
133
+ .colorpicker-bar-horizontal {
134
+ height: 15px;
135
+ margin: 0 0 4px 0;
136
+ float: left;
137
+ width: 100px; }
138
+
139
+ .colorpicker-element .input-group-addon i,
140
+ .colorpicker-element .add-on i {
141
+ display: inline-block;
142
+ cursor: pointer;
143
+ height: 16px;
144
+ vertical-align: text-top;
145
+ width: 16px; }
146
+
147
+ .colorpicker.colorpicker-inline {
148
+ position: relative;
149
+ display: inline-block;
150
+ float: none;
151
+ z-index: auto;
152
+ vertical-align: text-bottom; }
153
+
154
+ .colorpicker.colorpicker-horizontal {
155
+ width: 110px;
156
+ min-width: 110px;
157
+ height: auto; }
158
+
159
+ .colorpicker.colorpicker-horizontal .colorpicker-saturation {
160
+ margin-bottom: 4px; }
161
+
162
+ .colorpicker.colorpicker-horizontal .colorpicker-bar {
163
+ width: 100px; }
164
+
165
+ .colorpicker.colorpicker-horizontal .colorpicker-hue,
166
+ .colorpicker.colorpicker-horizontal .colorpicker-alpha {
167
+ width: 100px;
168
+ height: 15px;
169
+ float: left;
170
+ cursor: col-resize;
171
+ margin-left: 0px;
172
+ margin-bottom: 4px; }
173
+
174
+ .colorpicker.colorpicker-horizontal .colorpicker-hue .colorpicker-guide,
175
+ .colorpicker.colorpicker-horizontal .colorpicker-alpha .colorpicker-guide {
176
+ display: block;
177
+ height: 15px;
178
+ background: #ffffff;
179
+ position: absolute;
180
+ top: 0;
181
+ left: 0;
182
+ width: 1px;
183
+ border: none;
184
+ margin-top: 0; }
185
+
186
+ .colorpicker.colorpicker-horizontal .colorpicker-hue {
187
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAABCAMAAAAfBfuPAAABLFBMVEXqFBb/ABH/ACL/ADH/AEH/AFD/AGD/AG7/AH7/AI3/AJ3/AKz/ALz/AMr/ANv/AOr/APr2AP/mAP/XAP/HAP+4AP+oAP+aAP+JAP97AP9rAP9cAP9MAP8+AP8tAP8fAP8PAP8BAv8AEP8AH/8AL/8APv8ATv8AXP8Abf8Ae/8Ai/8Amv8Aqv8AuP8Ayf8A1/8A5/8A9/8A//gA/+kA/9kA/8oA/7oA/6wA/5sA/40A/30A/24A/14A/1AA/z8A/zEA/yEA/xEB/wMN/wAd/wAs/wA8/wBK/wBb/wBp/wB5/wCI/wCY/wCm/wC3/wDF/wDV/wDk/wD1/wD/+gD/7AD/3AD/zAD/vgD/rQD/nwD/jgD/gAD/cAD/YgD/UQD/QwD/MgD/JAD/FAD4Eg42qAedAAAAbUlEQVR4XgXAghEDsbxtlrZt27ax/w49ACAYQTGcICmaYTleECVZUTXdMC1Wm93hdLk9Xp8/EAyFI9FYPJFMpTPZXL5QLJUr1Vq90Wy1O91efzAcjSfT2XyxXK03293+cDydL9fb/fF8vT/f3x+LfRNXARMbCAAAAABJRU5ErkJggg=="); }
188
+
189
+ .colorpicker.colorpicker-horizontal .colorpicker-alpha {
190
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAKCAQAAADoFTP1AAAB9ElEQVR4XoWTQW4VMRBEu9qWEimL7DhEMp8NF+ASnJJLcAQgE1bcgBUSkYKUuHCrZ9pjeqSU5Yn9LPu7umJQBIIv+k7vIOrtK66L4lmr3pVOrOv3otp619KZ0/KjdNI79L52Uo09FBQWrU0vfe5trezU+hLsoUKd3Repovte+0vbq/7Lj5XbaHECKasR9G4MPlbp+gzZxd6koPEJCkAYC5SjcOTAIIOK90Dja1IfIZ8Z+zAY9jm3b5Ia+MT5sFcqRJrR2AYYA8Kua5BzYRrFPNmD4PQMegGJMOffJJUsWiI3nCHZZjInNdffLWOufzbc3JaboCAVxwmnRHbhLSPwRJ4wU0BRSc6HkECYYVw95nMKgJOcylxrJttE5Ibzf9Xq9GPvP+WX3MiV/MGHfRu/SentRQrfG1GzsIrytdNXucSRKxQNIGHM9YhGFQJcdjNcBZvfJayuYe4Sia1CzwW+19mWOhe37HsxJWKwbu/jluEU15QzAQjAqCEbhMJc78GYV2E0kooHDubUImWkTOhGpgv8PoT8DJG/bzxna4BZ0eOFSOaLADGeSpFsg5AzeaDZIDQQXjZ4y/8ryfzUXBwdELRjTjCNvOeT0rNlrJz90vwy6N9pXXQEluX0inElpPWokSdiLCfiNJJjMKQ8Qsh8GEKQKMo/eiHrNbI9UksAAAAASUVORK5CYII="); }
191
+
192
+ .colorpicker-right:before {
193
+ left: auto;
194
+ right: 6px; }
195
+
196
+ .colorpicker-right:after {
197
+ left: auto;
198
+ right: 7px; }
199
+
200
+ .colorpicker-no-arrow:before {
201
+ border-right: 0;
202
+ border-left: 0; }
203
+
204
+ .colorpicker-no-arrow:after {
205
+ border-right: 0;
206
+ border-left: 0; }
207
+
208
+ .colorpicker.colorpicker-visible,
209
+ .colorpicker-alpha.colorpicker-visible,
210
+ .colorpicker-saturation.colorpicker-visible,
211
+ .colorpicker-hue.colorpicker-visible,
212
+ .colorpicker-bar.colorpicker-visible {
213
+ display: block; }
214
+
215
+ .colorpicker.colorpicker-hidden,
216
+ .colorpicker-alpha.colorpicker-hidden,
217
+ .colorpicker-saturation.colorpicker-hidden,
218
+ .colorpicker-hue.colorpicker-hidden,
219
+ .colorpicker-bar.colorpicker-hidden {
220
+ display: none; }
221
+
222
+ .colorpicker-inline.colorpicker-visible {
223
+ display: inline-block; }
224
+
225
+ /** EXTENSIONS **/
226
+ .colorpicker-preview {
227
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAABkCAQAAAAVxWkcAAABr0lEQVR4Xo2VwU0DQQxF7dmRuNIFlzlSAR3QAaXQQdIBJVABFXDcOVAAd67cjJLR07dkhcSrkZKfb/t7bG88rFo3B5gZPMNycItu2xloGV7MWHzM9zuzFWCkmA0nK6AszCUJDW6+mG6R03ncw5v8EMTEvZ2O3AliYjpslblc0RF9LmZYWxURU6aKytWZYsoWCAe+xwOZp1GsEukGiIkYxcQCHck99+gRgB7JncyIB5SGEhP3Yh5P6JwX+u6AnYot104d8DJT7uH7M9JH6OZbimj0vfMVaYnJIZFJDBW9kHlerL2C6JV4mSt7uuo2N57RxnZ+usQjn0R1jwBJBrNO3evJpVYUWsJ/E3UiXRlv24/7YZ04xmEdWlzcKS+B/eapeyMvFd2k0+hRk/T0AmTW8h69s2sjYMsdPntECiILhAeIMZAeH4QvUwfn6ijC0tTV+fT9ky8jM9nK2g7Ly1VjSpKYq6IvsAm7MtNu1orEqa/K3KNvgMFdhfquPfJmp2dbh0/8Gzb6Y22ViaNr6n5410zXdngVhbu6XqdOtWOuin5hjABGp4a2uotZ71MVCfwDBt2/v37yo6AAAAAASUVORK5CYII=");
228
+ background-position: 0 100%; }
229
+
230
+ .colorpicker-preview div {
231
+ position: relative;
232
+ width: 100%;
233
+ height: 100%; }
234
+
235
+ .colorpicker-swatch {
236
+ cursor: pointer;
237
+ float: left;
238
+ height: 12px;
239
+ width: 12px; }
240
+
241
+ .colorpicker-swatch + .colorpicker-swatch {
242
+ margin-left: 2px; }
243
+
244
+ /*# sourceMappingURL=bootstrap-colorpicker.css.map */
includes/colorpicker/css/bootstrap-colorpicker.css.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["colorpicker.scss"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH;EACA,aAAA;EACA,cAAA;EAXA,o8KAAA;EAaA,kBAAA;EACA,YAAA,EAmBA;EAxBA;IAOA,eAAA;IACA,YAAA;IACA,WAAA;IACA,uBAAA;IAbA,mBAcA;IACA,mBAAA;IACA,OAAA;IACA,QAAA;IACA,sBAAA,EAQA;IAvBA;MAiBA,eAAA;MACA,YAAA;MACA,WAAA;MACA,uBAAA;MAvBA,mBAwBA,EACA;;AAIA;;EAEA,YAAA;EACA,cAAA;EACA,YAAA;EACA,mBAAA;EACA,iBAAA;EACA,mBAAA,EACA;;AAEA;;EAEA,eAAA;EACA,YAAA;EACA,iBAAA;EACA,2BAAA;EACA,mBAAA;EACA,OAAA;EACA,QAAA;EACA,YAAA;EACA,iBAAA,EACA;;AAEA;EA1DA,gtBAAA,EA4DA;;AAEA;EA9DA,4rBAAA;EAgEA,cAAA,EACA;;AAEA;;;EAGA,yBAAA,EACA;;AAEA;EACA,mBAAA;EACA,UAAA;EACA,QAAA;EACA,cAAA;EACA,YAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,iBAAA;EACA,0BAAA;EACA,6BAAA;EACA,sCAAA;EACA,oDAAA;UAAA,4CAAA;EACA,aAAA;EACA,i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ACA;;AAGA;EACA,sBAAA,EACA;;AAEA,kBAAA;AAEA;EA1QA,4rBAAA;EA4QA,4BAAA,EACA;;AAEA;EACA,mBAAA;EACA,YAAA;EACA,aAAA,EACA;;AAEA;EACA,gBAAA;EACA,YAAA;EACA,aAAA;EACA,YAAA,EACA;;AAEA;EACA,iBAAA,EACA","file":"bootstrap-colorpicker.css","sourcesContent":["@mixin bgImg($imgBase64) {\n background-image: url(\"#{$imgBase64}\");\n}\n\n@mixin borderRadius($size) {\n -webkit-border-radius: $size;\n -moz-border-radius: $size;\n border-radius: $size;\n}\n\n.colorpicker-saturation {\n width: 100px;\n height: 100px;\n @include bgImg('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAQAAADa613fAAAP9klEQVR4XnRWC47rNgwcKjlA0bv2VL1Qi/YELRav7203iS1ppqZoiXCAhuBHVLI74xFtG3/Hz2joIOjRGuR5eMYuRn9YA1fds859KX8ZvczLr9/pImiR3Rqky9/wlajRIdVE/1Rufeu/0No3/ASgBZAJUkwgi0iCaEatekJJoEqiTQncd67/gyOfRCZshTed0Nl8LbLj8D6qxtoq9/7kJz/aH/3Xfu8VwI5+AUH8DxE7gUyiIpZ5LwiGzUqE3CScJsCDQHAsvBnxWpkbC0QMHmBp6latWS0bnvrCN/x1+xPfce+Ij0GAyeAGGz15sOiax2UylPhKrFaMPnVWClwepKh07hdhkVDsK2uoyEIySergjdbY2VBtV8VLr8Mf9mF/4wMb7kR8FOhzFWZZe7HIZD9JRIbee28eJKBweTB6TwjYkAgWaUmtDveGw1Wx3zZ76YlPPfQd/+gTTUFkiGiJ+NQAszU1EPT/QJEgufolAMPkNU4CVOyUIBLg4xglEZHGQnTFOFV0VaulYddBhA986ge/7N/yQi/3flFgwfQq2ibLnTDBRl9TmUHyJASPV/eoN0UISIr+ICQKIFV4EpljSjV1uFVUq9hRtet5e9gXvuyHPW0zMhQxWaoBBa9Tg8vsCEhww23Smd0CKjIkmPIoxWrUBDgJqFCyESF43ct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kMRqSNkTBDx0OkAUegFcMazciBXNpm798R6klXap/WZz49TQwBHqEcj4oCToUPjUuP9lfxcbyKMAwT6bTf1qqIIQDl3i5oCERNmVm0wgW4A8BGRxMX3hWh8bEV5Rvfp4DS5F3djWH2ztDNWKW7OBjgjIwsDWaKRknJjqMsh9QCa1p608lLovFkBE969DYtYelSzwSRcg535vAsFeNU9SzRCYZb4LDmxmFQKkwYGM+5y/G7b1uxMIylLdyE5yxIyYsoXWhQIpzQhYPi3JkJoKkB9+BxD0OMuyOEBe36DgyPSrxscmATldgKj8PxrkA/kA5PYMgkrocwIQ6GSRGmF0VaNqBKQZ5FYDEZSDzFTzq9mBQjAayE1A+ryDTzcQZe0Ibbxj7EwpAmTrJwEimZR9CCPtODhzxuNtY19Zd2Lf/fjCTnEiDAOg62j1utb/dv9mZ/aHCj4AyOHbsW3/As0BTzIgeJU7AAAAAElFTkSuQmCC');\n cursor: crosshair;\n float: left;\n .colorpicker-guide {\n display: block;\n height: 5px;\n width: 5px;\n border: 1px solid #000;\n @include borderRadius(5px);\n position: absolute;\n top: 0;\n left: 0;\n margin: -4px 0 0 -4px;\n i {\n display: block;\n height: 5px;\n width: 5px;\n border: 1px solid #fff;\n @include borderRadius(5px);\n }\n }\n}\n\n.colorpicker-hue,\n.colorpicker-alpha {\n width: 15px;\n height: 100px;\n float: left;\n cursor: row-resize;\n margin-left: 4px;\n margin-bottom: 4px;\n}\n\n.colorpicker-hue .colorpicker-guide,\n.colorpicker-alpha .colorpicker-guide {\n display: block;\n height: 1px;\n background: #000;\n border-top: 1px solid #fff;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n margin-top: -1px;\n}\n\n.colorpicker-hue {\n @include bgImg('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABkCAMAAABw8qpSAAABLFBMVEXqFBb/ABH/ACL/ADH/AEH/AFD/AGD/AG7/AH7/AI3/AJ3/AKz/ALz/AMr/ANv/AOr/APr2AP/mAP/XAP/HAP+4AP+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1VjSpKYq6IvsAm7MtNu1orEqa/K3KNvgMFdhfquPfJmp2dbh0/8Gzb6Y22ViaNr6n5410zXdngVhbu6XqdOtWOuin5hjABGp4a2uotZ71MVCfwDBt2/v37yo6AAAAAASUVORK5CYII=');\n display: none;\n}\n\n.colorpicker-saturation,\n.colorpicker-hue,\n.colorpicker-alpha {\n background-size: contain;\n}\n\n.colorpicker {\n position: absolute;\n top: 100%;\n left: 0;\n display: none;\n float: left;\n font-size: inherit;\n color: inherit;\n text-align: left;\n list-style: none;\n background-color: #ffffff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n padding: 4px;\n min-width: 130px;\n margin-top: 1px;\n @include borderRadius(4px);\n z-index: 1055;\n}\n\n.colorpicker:before,\n.colorpicker:after {\n display: table;\n content: \"\";\n line-height: 0;\n}\n\n.colorpicker:after {\n clear: both;\n}\n\n.colorpicker:before {\n content: '';\n display: inline-block;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-bottom: 7px solid #ccc;\n border-bottom-color: rgba(0, 0, 0, 0.2);\n position: absolute;\n top: -7px;\n left: 6px;\n}\n\n.colorpicker:after {\n content: '';\n display: inline-block;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #ffffff;\n position: absolute;\n top: -6px;\n left: 7px;\n}\n\n.colorpicker {\n div {\n position: relative;\n }\n}\n\n.colorpicker.colorpicker-with-alpha {\n min-width: 140px;\n}\n\n.colorpicker.colorpicker-with-alpha .colorpicker-alpha {\n display: block;\n}\n\n.colorpicker-bar {\n height: 15px;\n margin: 5px 0 0 0;\n clear: both;\n text-align: center;\n font-size: 10px;\n line-height: normal;\n}\n\n.colorpicker-bar-horizontal {\n height: 15px;\n margin: 0 0 4px 0;\n float: left;\n width: 100px;\n}\n\n.colorpicker-element .input-group-addon i,\n.colorpicker-element .add-on i {\n display: inline-block;\n cursor: pointer;\n height: 16px;\n vertical-align: text-top;\n width: 16px;\n}\n\n.colorpicker.colorpicker-inline {\n position: relative;\n display: inline-block;\n float: none;\n z-index: auto;\n vertical-align: text-bottom;\n}\n\n.colorpicker.colorpicker-horizontal {\n width: 110px;\n min-width: 110px;\n height: auto;\n}\n\n.colorpicker.colorpicker-horizontal .colorpicker-saturation {\n margin-bottom: 4px;\n}\n\n.colorpicker.colorpicker-horizontal .colorpicker-bar {\n width: 100px;\n}\n\n.colorpicker.colorpicker-horizontal .colorpicker-hue,\n.colorpicker.colorpicker-horizontal .colorpicker-alpha {\n width: 100px;\n height: 15px;\n float: left;\n cursor: col-resize;\n margin-left: 0px;\n margin-bottom: 4px;\n}\n\n.colorpicker.colorpicker-horizontal .colorpicker-hue .colorpicker-guide,\n.colorpicker.colorpicker-horizontal .colorpicker-alpha .colorpicker-guide {\n display: block;\n height: 15px;\n background: #ffffff;\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n border: none;\n margin-top: 0;\n}\n\n.colorpicker.colorpicker-horizontal .colorpicker-hue {\n @include bgImg('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAABCAMAAAAfBfuPAAABLFBMVEXqFBb/ABH/ACL/ADH/AEH/AFD/AGD/AG7/AH7/AI3/AJ3/AKz/ALz/AMr/ANv/AOr/APr2AP/mAP/XAP/HAP+4AP+oAP+aAP+JAP97AP9rAP9cAP9MAP8+AP8tAP8fAP8PAP8BAv8AEP8AH/8AL/8APv8ATv8AXP8Abf8Ae/8Ai/8Amv8Aqv8AuP8Ayf8A1/8A5/8A9/8A//gA/+kA/9kA/8oA/7oA/6wA/5sA/40A/30A/24A/14A/1AA/z8A/zEA/yEA/xEB/wMN/wAd/wAs/wA8/wBK/wBb/wBp/wB5/wCI/wCY/wCm/wC3/wDF/wDV/wDk/wD1/wD/+gD/7AD/3AD/zAD/vgD/rQD/nwD/jgD/gAD/cAD/YgD/UQD/QwD/MgD/JAD/FAD4Eg42qAedAAAAbUlEQVR4XgXAghEDsbxtlrZt27ax/w49ACAYQTGcICmaYTleECVZUTXdMC1Wm93hdLk9Xp8/EAyFI9FYPJFMpTPZXL5QLJUr1Vq90Wy1O91efzAcjSfT2XyxXK03293+cDydL9fb/fF8vT/f3x+LfRNXARMbCAAAAABJRU5ErkJggg==');\n}\n\n.colorpicker.colorpicker-horizontal .colorpicker-alpha {\n @include bgImg('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAKCAQAAADoFTP1AAAB9ElEQVR4XoWTQW4VMRBEu9qWEimL7DhEMp8NF+ASnJJLcAQgE1bcgBUSkYKUuHCrZ9pjeqSU5Yn9LPu7umJQBIIv+k7vIOrtK66L4lmr3pVOrOv3otp619KZ0/KjdNI79L52Uo09FBQWrU0vfe5trezU+hLsoUKd3Repovte+0vbq/7Lj5XbaHECKasR9G4MPlbp+gzZxd6koPEJCkAYC5SjcOTAIIOK90Dja1IfIZ8Z+zAY9jm3b5Ia+MT5sFcqRJrR2AYYA8Kua5BzYRrFPNmD4PQMegGJMOffJJUsWiI3nCHZZjInNdffLWOufzbc3JaboCAVxwmnRHbhLSPwRJ4wU0BRSc6HkECYYVw95nMKgJOcylxrJttE5Ibzf9Xq9GPvP+WX3MiV/MGHfRu/SentRQrfG1GzsIrytdNXucSRKxQNIGHM9YhGFQJcdjNcBZvfJayuYe4Sia1CzwW+19mWOhe37HsxJWKwbu/jluEU15QzAQjAqCEbhMJc78GYV2E0kooHDubUImWkTOhGpgv8PoT8DJG/bzxna4BZ0eOFSOaLADGeSpFsg5AzeaDZIDQQXjZ4y/8ryfzUXBwdELRjTjCNvOeT0rNlrJz90vwy6N9pXXQEluX0inElpPWokSdiLCfiNJJjMKQ8Qsh8GEKQKMo/eiHrNbI9UksAAAAASUVORK5CYII=');\n}\n\n.colorpicker-right:before {\n left: auto;\n right: 6px;\n}\n\n.colorpicker-right:after {\n left: auto;\n right: 7px;\n}\n\n.colorpicker-no-arrow:before {\n border-right: 0;\n border-left: 0;\n}\n\n.colorpicker-no-arrow:after {\n border-right: 0;\n border-left: 0;\n}\n\n.colorpicker,\n.colorpicker-alpha,\n.colorpicker-saturation,\n.colorpicker-hue,\n.colorpicker-bar {\n &.colorpicker-visible {\n display: block;\n }\n}\n\n.colorpicker,\n.colorpicker-alpha,\n.colorpicker-saturation,\n.colorpicker-hue,\n.colorpicker-bar {\n &.colorpicker-hidden {\n display: none;\n }\n}\n\n.colorpicker-inline.colorpicker-visible {\n display: inline-block;\n}\n\n/** EXTENSIONS **/\n\n.colorpicker-preview {\n @include bgImg('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAABkCAQAAAAVxWkcAAABr0lEQVR4Xo2VwU0DQQxF7dmRuNIFlzlSAR3QAaXQQdIBJVABFXDcOVAAd67cjJLR07dkhcSrkZKfb/t7bG88rFo3B5gZPMNycItu2xloGV7MWHzM9zuzFWCkmA0nK6AszCUJDW6+mG6R03ncw5v8EMTEvZ2O3AliYjpslblc0RF9LmZYWxURU6aKytWZYsoWCAe+xwOZp1GsEukGiIkYxcQCHck99+gRgB7JncyIB5SGEhP3Yh5P6JwX+u6AnYot104d8DJT7uH7M9JH6OZbimj0vfMVaYnJIZFJDBW9kHlerL2C6JV4mSt7uuo2N57RxnZ+usQjn0R1jwBJBrNO3evJpVYUWsJ/E3UiXRlv24/7YZ04xmEdWlzcKS+B/eapeyMvFd2k0+hRk/T0AmTW8h69s2sjYMsdPntECiILhAeIMZAeH4QvUwfn6ijC0tTV+fT9ky8jM9nK2g7Ly1VjSpKYq6IvsAm7MtNu1orEqa/K3KNvgMFdhfquPfJmp2dbh0/8Gzb6Y22ViaNr6n5410zXdngVhbu6XqdOtWOuin5hjABGp4a2uotZ71MVCfwDBt2/v37yo6AAAAAASUVORK5CYII=');\n background-position: 0 100%;\n}\n\n.colorpicker-preview div {\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.colorpicker-swatch {\n cursor: pointer;\n float: left;\n height: 12px;\n width: 12px;\n}\n\n.colorpicker-swatch + .colorpicker-swatch {\n margin-left: 2px;\n}\n"]}
includes/colorpicker/css/bootstrap-colorpicker.min.css ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Bootstrap Colorpicker - Simple and customizable colorpicker component for Twitter Bootstrap.
3
+ * @package bootstrap-colorpicker
4
+ * @version v3.0.0-wip
5
+ * @license MIT
6
+ * @link https://farbelous.github.io/bootstrap-colorpicker/
7
+ * @link https://github.com/farbelous/bootstrap-colorpicker.git
8
+ */.colorpicker-saturation{width:100px;height:100px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAQAAADa613fAAAP9klEQVR4XnRWC47rNgwcKjlA0bv2VL1Qi/YELRav7203iS1ppqZoiXCAhuBHVLI74xFtG3/Hz2joIOjRGuR5eMYuRn9YA1fds859KX8ZvczLr9/pImiR3Rqky9/wlajRIdVE/1Rufeu/0No3/ASgBZAJUkwgi0iCaEatekJJoEqiTQncd67/gyOfRCZshTed0Nl8LbLj8D6qxtoq9/7kJz/aH/3Xfu8VwI5+AUH8DxE7gUyiIpZ5LwiGzUqE3CScJsCDQHAsvBnxWpkbC0QMHmBp6latWS0bnvrCN/x1+xPfce+Ij0GAyeAGGz15sOiax2UylPhKrFaMPnVWClwepKh07hdhkVDsK2uoyEIySergjdbY2VBtV8VLr8Mf9mF/4wMb7kR8FOhzFWZZe7HIZD9JRIbee28eJKBweTB6TwjYkAgWaUmtDveGw1Wx3zZ76YlPPfQd/+gTTUFkiGiJ+NQAszU1EPT/QJEgufolAMPkNU4CVOyUIBLg4xglEZHGQnTFOFV0VaulYddBhA986ge/7N/yQi/3flFgwfQq2ibLnTDBRl9TmUHyJASPV/eoN0UISIr+ICQKIFV4EpljSjV1uFVUq9hRtet5e9gXvuyHPW0zMhQxWaoBBa9Tg8vsCEhww23Smd0CKjIkmPIoxWrUBDgJqFCyESF43ctQxLUoHN7Q1KyVhqrNNm3cy2vMyQNPVKjc29Rh5SSU+giWdRJHkLnQG71FQE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lfxcbyKMAwT6bTf1qqIIQDl3i5oCERNmVm0wgW4A8BGRxMX3hWh8bEV5Rvfp4DS5F3djWH2ztDNWKW7OBjgjIwsDWaKRknJjqMsh9QCa1p608lLovFkBE969DYtYelSzwSRcg535vAsFeNU9SzRCYZb4LDmxmFQKkwYGM+5y/G7b1uxMIylLdyE5yxIyYsoXWhQIpzQhYPi3JkJoKkB9+BxD0OMuyOEBe36DgyPSrxscmATldgKj8PxrkA/kA5PYMgkrocwIQ6GSRGmF0VaNqBKQZ5FYDEZSDzFTzq9mBQjAayE1A+ryDTzcQZe0Ibbxj7EwpAmTrJwEimZR9CCPtODhzxuNtY19Zd2Lf/fjCTnEiDAOg62j1utb/dv9mZ/aHCj4AyOHbsW3/As0BTzIgeJU7AAAAAElFTkSuQmCC);cursor:crosshair;float:left}.colorpicker-saturation .colorpicker-guide{display:block;height:5px;width:5px;border:1px solid #000;border-radius:5px;position:absolute;top:0;left:0;margin:-4px 0 0 -4px}.colorpicker-saturation .colorpicker-guide i{display:block;height:5px;width:5px;border:1px solid #fff;border-radius:5px}.colorpicker-alpha,.colorpicker-hue{width:15px;height:100px;float:left;cursor:row-resize;margin-left:4px;margin-bottom:4px}.colorpicker-alpha .colorpicker-guide,.colorpicker-hue .colorpicker-guide{display:block;height:1px;background:#000;border-top:1px solid #fff;position:absolute;top:0;left:0;width:100%;margin-top:-1px}.colorpicker-hue{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABkCAMAAABw8qpSAAABLFBMVEXqFBb/ABH/ACL/ADH/AEH/AFD/AGD/AG7/AH7/AI3/AJ3/AKz/ALz/AMr/ANv/AOr/APr2AP/mAP/XAP/HAP+4AP+oAP+aAP+JAP97AP9rAP9cAP9MAP8+AP8tAP8fAP8PAP8BAv8AEP8AH/8AL/8APv8ATv8AXP8Abf8Ae/8Ai/8Amv8Aqv8AuP8Ayf8A1/8A5/8A9/8A//gA/+kA/9kA/8oA/7oA/6wA/5sA/40A/30A/24A/14A/1AA/z8A/zEA/yEA/xEB/wMN/wAd/wAs/wA8/wBK/wBb/wBp/wB5/wCI/wCY/wCm/wC3/wDF/wDV/wDk/wD1/wD/+gD/7AD/3AD/zAD/vgD/rQD/nwD/jgD/gAD/cAD/YgD/UQD/QwD/MgD/JAD/FAD4Eg42qAedAAAAh0lEQVR4XgXAg3EDAAAAwI9to7Zt27a1/w49BASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTS1tHXo1KVbj159+g0YNGTYiFFjxk2YNGXajFlz5i1YtGTZilVr1m3YtGXbjl179h04dOTYiVNnzl24dOXajVt37j149OTZi1dv3n349OXbj19//wOxE1dQ8reGAAAAAElFTkSuQmCC)}.colorpicker-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAABkCAQAAAAVxWkcAAABr0lEQVR4Xo2VwU0DQQxF7dmRuNIFlzlSAR3QAaXQQdIBJVABFXDcOVAAd67cjJLR07dkhcSrkZKfb/t7bG88rFo3B5gZPMNycItu2xloGV7MWHzM9zuzFWCkmA0nK6AszCUJDW6+mG6R03ncw5v8EMTEvZ2O3AliYjpslblc0RF9LmZYWxURU6aKytWZYsoWCAe+xwOZp1GsEukGiIkYxcQCHck99+gRgB7JncyIB5SGEhP3Yh5P6JwX+u6AnYot104d8DJT7uH7M9JH6OZbimj0vfMVaYnJIZFJDBW9kHlerL2C6JV4mSt7uuo2N57RxnZ+usQjn0R1jwBJBrNO3evJpVYUWsJ/E3UiXRlv24/7YZ04xmEdWlzcKS+B/eapeyMvFd2k0+hRk/T0AmTW8h69s2sjYMsdPntECiILhAeIMZAeH4QvUwfn6ijC0tTV+fT9ky8jM9nK2g7Ly1VjSpKYq6IvsAm7MtNu1orEqa/K3KNvgMFdhfquPfJmp2dbh0/8Gzb6Y22ViaNr6n5410zXdngVhbu6XqdOtWOuin5hjABGp4a2uotZ71MVCfwDBt2/v37yo6AAAAAASUVORK5CYII=);display:none}.colorpicker-alpha,.colorpicker-hue,.colorpicker-saturation{background-size:contain}.colorpicker{position:absolute;top:100%;left:0;display:none;float:left;font-size:inherit;color:inherit;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);padding:4px;min-width:130px;margin-top:1px;border-radius:4px;z-index:1055}.colorpicker:after,.colorpicker:before{display:table;content:"";line-height:0}.colorpicker:after{clear:both}.colorpicker:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);position:absolute;top:-7px;left:6px}.colorpicker:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:7px}.colorpicker div{position:relative}.colorpicker.colorpicker-with-alpha{min-width:140px}.colorpicker.colorpicker-with-alpha .colorpicker-alpha{display:block}.colorpicker-bar{height:15px;margin:5px 0 0 0;clear:both;text-align:center;font-size:10px;line-height:normal}.colorpicker-bar-horizontal{height:15px;margin:0 0 4px 0;float:left;width:100px}.colorpicker-element .add-on i,.colorpicker-element .input-group-addon i{display:inline-block;cursor:pointer;height:16px;vertical-align:text-top;width:16px}.colorpicker.colorpicker-inline{position:relative;display:inline-block;float:none;z-index:auto;vertical-align:text-bottom}.colorpicker.colorpicker-horizontal{width:110px;min-width:110px;height:auto}.colorpicker.colorpicker-horizontal .colorpicker-saturation{margin-bottom:4px}.colorpicker.colorpicker-horizontal .colorpicker-bar{width:100px}.colorpicker.colorpicker-horizontal .colorpicker-alpha,.colorpicker.colorpicker-horizontal .colorpicker-hue{width:100px;height:15px;float:left;cursor:col-resize;margin-left:0;margin-bottom:4px}.colorpicker.colorpicker-horizontal .colorpicker-alpha .colorpicker-guide,.colorpicker.colorpicker-horizontal .colorpicker-hue .colorpicker-guide{display:block;height:15px;background:#fff;position:absolute;top:0;left:0;width:1px;border:none;margin-top:0}.colorpicker.colorpicker-horizontal .colorpicker-hue{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAABCAMAAAAfBfuPAAABLFBMVEXqFBb/ABH/ACL/ADH/AEH/AFD/AGD/AG7/AH7/AI3/AJ3/AKz/ALz/AMr/ANv/AOr/APr2AP/mAP/XAP/HAP+4AP+oAP+aAP+JAP97AP9rAP9cAP9MAP8+AP8tAP8fAP8PAP8BAv8AEP8AH/8AL/8APv8ATv8AXP8Abf8Ae/8Ai/8Amv8Aqv8AuP8Ayf8A1/8A5/8A9/8A//gA/+kA/9kA/8oA/7oA/6wA/5sA/40A/30A/24A/14A/1AA/z8A/zEA/yEA/xEB/wMN/wAd/wAs/wA8/wBK/wBb/wBp/wB5/wCI/wCY/wCm/wC3/wDF/wDV/wDk/wD1/wD/+gD/7AD/3AD/zAD/vgD/rQD/nwD/jgD/gAD/cAD/YgD/UQD/QwD/MgD/JAD/FAD4Eg42qAedAAAAbUlEQVR4XgXAghEDsbxtlrZt27ax/w49ACAYQTGcICmaYTleECVZUTXdMC1Wm93hdLk9Xp8/EAyFI9FYPJFMpTPZXL5QLJUr1Vq90Wy1O91efzAcjSfT2XyxXK03293+cDydL9fb/fF8vT/f3x+LfRNXARMbCAAAAABJRU5ErkJggg==)}.colorpicker.colorpicker-horizontal .colorpicker-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAKCAQAAADoFTP1AAAB9ElEQVR4XoWTQW4VMRBEu9qWEimL7DhEMp8NF+ASnJJLcAQgE1bcgBUSkYKUuHCrZ9pjeqSU5Yn9LPu7umJQBIIv+k7vIOrtK66L4lmr3pVOrOv3otp619KZ0/KjdNI79L52Uo09FBQWrU0vfe5trezU+hLsoUKd3Repovte+0vbq/7Lj5XbaHECKasR9G4MPlbp+gzZxd6koPEJCkAYC5SjcOTAIIOK90Dja1IfIZ8Z+zAY9jm3b5Ia+MT5sFcqRJrR2AYYA8Kua5BzYRrFPNmD4PQMegGJMOffJJUsWiI3nCHZZjInNdffLWOufzbc3JaboCAVxwmnRHbhLSPwRJ4wU0BRSc6HkECYYVw95nMKgJOcylxrJttE5Ibzf9Xq9GPvP+WX3MiV/MGHfRu/SentRQrfG1GzsIrytdNXucSRKxQNIGHM9YhGFQJcdjNcBZvfJayuYe4Sia1CzwW+19mWOhe37HsxJWKwbu/jluEU15QzAQjAqCEbhMJc78GYV2E0kooHDubUImWkTOhGpgv8PoT8DJG/bzxna4BZ0eOFSOaLADGeSpFsg5AzeaDZIDQQXjZ4y/8ryfzUXBwdELRjTjCNvOeT0rNlrJz90vwy6N9pXXQEluX0inElpPWokSdiLCfiNJJjMKQ8Qsh8GEKQKMo/eiHrNbI9UksAAAAASUVORK5CYII=)}.colorpicker-right:before{left:auto;right:6px}.colorpicker-right:after{left:auto;right:7px}.colorpicker-no-arrow:before{border-right:0;border-left:0}.colorpicker-no-arrow:after{border-right:0;border-left:0}.colorpicker-alpha.colorpicker-visible,.colorpicker-bar.colorpicker-visible,.colorpicker-hue.colorpicker-visible,.colorpicker-saturation.colorpicker-visible,.colorpicker.colorpicker-visible{display:block}.colorpicker-alpha.colorpicker-hidden,.colorpicker-bar.colorpicker-hidden,.colorpicker-hue.colorpicker-hidden,.colorpicker-saturation.colorpicker-hidden,.colorpicker.colorpicker-hidden{display:none}.colorpicker-inline.colorpicker-visible{display:inline-block}.colorpicker-preview{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAABkCAQAAAAVxWkcAAABr0lEQVR4Xo2VwU0DQQxF7dmRuNIFlzlSAR3QAaXQQdIBJVABFXDcOVAAd67cjJLR07dkhcSrkZKfb/t7bG88rFo3B5gZPMNycItu2xloGV7MWHzM9zuzFWCkmA0nK6AszCUJDW6+mG6R03ncw5v8EMTEvZ2O3AliYjpslblc0RF9LmZYWxURU6aKytWZYsoWCAe+xwOZp1GsEukGiIkYxcQCHck99+gRgB7JncyIB5SGEhP3Yh5P6JwX+u6AnYot104d8DJT7uH7M9JH6OZbimj0vfMVaYnJIZFJDBW9kHlerL2C6JV4mSt7uuo2N57RxnZ+usQjn0R1jwBJBrNO3evJpVYUWsJ/E3UiXRlv24/7YZ04xmEdWlzcKS+B/eapeyMvFd2k0+hRk/T0AmTW8h69s2sjYMsdPntECiILhAeIMZAeH4QvUwfn6ijC0tTV+fT9ky8jM9nK2g7Ly1VjSpKYq6IvsAm7MtNu1orEqa/K3KNvgMFdhfquPfJmp2dbh0/8Gzb6Y22ViaNr6n5410zXdngVhbu6XqdOtWOuin5hjABGp4a2uotZ71MVCfwDBt2/v37yo6AAAAAASUVORK5CYII=);background-position:0 100%}.colorpicker-preview div{position:relative;width:100%;height:100%}.colorpicker-swatch{cursor:pointer;float:left;height:12px;width:12px}.colorpicker-swatch+.colorpicker-swatch{margin-left:2px}
9
+ /*# sourceMappingURL=bootstrap-colorpicker.min.css.map */
includes/colorpicker/css/bootstrap-colorpicker.min.css.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["bootstrap-colorpicker.css","bootstrap-colorpicker.css"],"names":[],"mappings":"AAAA;;;;;;;AAUA,wBACA,MAAA,MACA,OAAA,MAXA,iBAAA,g7KAaA,OAAA,UACA,MAAA,KALA,2CAOA,QAAA,MACA,OAAA,IACA,MAAA,IACA,OAAA,IAAA,MAAA,KAbA,cAAA,IAeA,SAAA,SACA,IAAA,EACA,KAAA,EACA,OAAA,KAAA,EAAA,EAAA,KAfA,6CAiBA,QAAA,MACA,OAAA,IACA,MAAA,IACA,OAAA,IAAA,MAAA,KAvBA,cAAA,ICyBA,mBDIA,iBAEA,MAAA,KACA,OAAA,MACA,MAAA,KACA,OAAA,WACA,YAAA,IACA,cAAA,ICFA,sCDKA,oCAEA,QAAA,MACA,OAAA,IACA,WAAA,KACA,WAAA,IAAA,MAAA,KACA,SAAA,SACA,IAAA,EACA,KAAA,EACA,MAAA,KACA,WAAA,KAGA,iBA1DA,iBAAA,4rBA8DA,mBA9DA,iBAAA,wqBAgEA,QAAA,KCJ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ACA,MAAA,IACA,OAAA,KACA,WAAA,EAGA,qDApNA,iBAAA,4pBAwNA,uDAxNA,iBAAA,owBA4NA,0BACA,KAAA,KACA,MAAA,IAGA,yBACA,KAAA,KACA,MAAA,IAGA,6BACA,aAAA,EACA,YAAA,EAGA,4BACA,aAAA,EACA,YAAA,EC9BA,uCAGA,qCADA,qCADA,4CDgCA,iCAMA,QAAA,MChCA,sCAGA,oCADA,oCADA,2CDmCA,gCAMA,QAAA,KAIA,wCACA,QAAA,aAKA,qBA1QA,iBAAA,wqBA4QA,oBAAA,EAAA,KAGA,yBACA,SAAA,SACA,MAAA,KACA,OAAA,KAGA,oBACA,OAAA,QACA,MAAA,KACA,OAAA,KACA,MAAA,KAGA,wCACA,YAAA","file":"bootstrap-colorpicker.min.css","sourcesContent":["/*!\n * Bootstrap Colorpicker - Simple and customizable colorpicker component for Twitter Bootstrap.\n * @package bootstrap-colorpicker\n * @version v3.0.0-wip\n * @license MIT\n * @link https://farbelous.github.io/bootstrap-colorpicker/\n * @link https://github.com/farbelous/bootstrap-colorpicker.git\n */\n.colorpicker-saturation {\n width: 100px;\n height: 100px;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAQAAADa613fAAAP9klEQVR4XnRWC47rNgwcKjlA0bv2VL1Qi/YELRav7203iS1ppqZoiXCAhuBHVLI74xFtG3/Hz2joIOjRGuR5eMYuRn9YA1fds859KX8ZvczLr9/pImiR3Rqky9/wlajRIdVE/1Rufeu/0No3/ASgBZAJUkwgi0iCaEatekJJoEqiTQncd67/gyOfRCZshTed0Nl8LbLj8D6qxtoq9/7kJz/aH/3Xfu8VwI5+AUH8DxE7gUyiIpZ5LwiGzUqE3CScJsCDQHAsvBnxWpkbC0QMHmBp6latWS0bnvrCN/x1+xPfce+Ij0GAyeAGGz15sOiax2UylPhKrFaMPnVWClwepKh07hdhkVDsK2uoyEIySergjdbY2VBtV8VLr8Mf9mF/4wMb7kR8FOhzFWZZe7HIZD9J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+ZscxAuSnvwqQsECTIGSV6FEoJFTygVuzB5xAsKqBvAQE3+nkVoJDI1BJIaPBWik7ZSu5NIp5A3mRQaTFvLgkO9fVgEgMqqeVfb+p55tijWH+Kea71ubq4v8Sl8089sZKbKEZNq+VUfISJJF7j79WrbYgS994ZEf+nIz0pNFRWqapSmK6P45i3OQuItIiPDyg6RnxZ4D0g+CFPxAzluoRsWsaA6I6JOqVWCisDvJ0BgHTzMSRgMi0vmi8R+sR6tg/XUh7kCc7kMRqSNkTBDx0OkAUegFcMazciBXNpm798R6klXap/WZz49TQwBHqEcj4oCToUPjUuP9lfxcbyKMAwT6bTf1qqIIQDl3i5oCERNmVm0wgW4A8BGRxMX3hWh8bEV5Rvfp4DS5F3djWH2ztDNWKW7OBjgjIwsDWaKRknJjqMsh9QCa1p608lLovFkBE969DYtYelSzwSRcg535vAsFeNU9SzRCYZb4LDmxmFQKkwYGM+5y/G7b1uxMIylLdyE5yxIyYsoXWhQIpzQhYPi3JkJoKkB9+BxD0OMuyOEBe36DgyPSrxscmATldgKj8PxrkA/kA5PYMgkrocwIQ6GSRGmF0VaNqBKQZ5FYDEZSDzFTzq9mBQjAayE1A+ryDTzcQZe0Ibbxj7EwpAmTrJwEimZR9CCPtODhzxuNtY19Zd2Lf/fjCTnEiDAOg62j1utb/dv9mZ/aHCj4AyOHbsW3/As0BTzIgeJU7AAAAAElFTkSuQmCC\");\n cursor: crosshair;\n float: left; }\n .colorpicker-saturation .colorpicker-guide {\n display: block;\n height: 5px;\n width: 5px;\n border: 1px solid #000;\n border-radius: 5px;\n position: absolute;\n top: 0;\n left: 0;\n margin: -4px 0 0 -4px; }\n .colorpicker-saturation .colorpicker-guide i {\n display: block;\n height: 5px;\n width: 5px;\n border: 1px solid #fff;\n border-radius: 5px; }\n\n.colorpicker-hue,\n.colorpicker-alpha {\n width: 15px;\n height: 100px;\n float: left;\n cursor: row-resize;\n margin-left: 4px;\n margin-bottom: 4px; }\n\n.colorpicker-hue .colorpicker-guide,\n.colorpicker-alpha .colorpicker-guide {\n display: block;\n height: 1px;\n background: #000;\n border-top: 1px solid #fff;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n margin-top: -1px; }\n\n.colorpicker-hue {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABkCAMAAABw8qpSAAABLFBMVEXqFBb/ABH/ACL/ADH/AEH/AFD/AGD/AG7/AH7/AI3/AJ3/AKz/ALz/AMr/ANv/AOr/APr2AP/mAP/XAP/HAP+4AP+oAP+aAP+JAP97AP9rAP9cAP9MAP8+AP8tAP8fAP8PAP8BAv8AEP8AH/8AL/8APv8ATv8AXP8Abf8Ae/8Ai/8Amv8Aqv8AuP8Ayf8A1/8A5/8A9/8A//gA/+kA/9kA/8oA/7oA/6wA/5sA/40A/30A/24A/14A/1AA/z8A/zEA/yEA/xEB/wMN/wAd/wAs/wA8/wBK/wBb/wBp/wB5/wCI/wCY/wCm/wC3/wDF/wDV/wDk/wD1/wD/+gD/7AD/3AD/zAD/vgD/rQD/nwD/jgD/gAD/cAD/YgD/UQD/QwD/MgD/JAD/FAD4Eg42qAedAAAAh0lEQVR4XgXAg3EDAAAAwI9to7Zt27a1/w49BASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTS1tHXo1KVbj159+g0YNGTYiFFjxk2YNGXajFlz5i1YtGTZilVr1m3YtGXbjl179h04dOTYiVNnzl24dOXajVt37j149OTZi1dv3n349OXbj19//wOxE1dQ8reGAAAAAElFTkSuQmCC\"); }\n\n.colorpicker-alpha {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAABkCAQAAAAVxWkcAAABr0lEQVR4Xo2VwU0DQQxF7dmRuNIFlzlSAR3QAaXQQdIBJVABFXDcOVAAd67cjJLR07dkhcSrkZKfb/t7bG88rFo3B5gZPMNycItu2xloGV7MWHzM9zuzFWCkmA0nK6AszCUJDW6+mG6R03ncw5v8EMTEvZ2O3AliYjpslblc0RF9LmZYWxURU6aKytWZYsoWCAe+xwOZp1GsEukGiIkYxcQCHck99+gRgB7JncyIB5SGEhP3Yh5P6JwX+u6AnYot104d8DJT7uH7M9JH6OZbimj0vfMVaYnJIZFJDBW9kHlerL2C6JV4mSt7uuo2N57RxnZ+usQjn0R1jwBJBrNO3evJpVYUWsJ/E3UiXRlv24/7YZ04xmEdWlzcKS+B/eapeyMvFd2k0+hRk/T0AmTW8h69s2sjYMsdPntECiILhAeIMZAeH4QvUwfn6ijC0tTV+fT9ky8jM9nK2g7Ly1VjSpKYq6IvsAm7MtNu1orEqa/K3KNvgMFdhfquPfJmp2dbh0/8Gzb6Y22ViaNr6n5410zXdngVhbu6XqdOtWOuin5hjABGp4a2uotZ71MVCfwDBt2/v37yo6AAAAAASUVORK5CYII=\");\n display: none; }\n\n.colorpicker-saturation,\n.colorpicker-hue,\n.colorpicker-alpha {\n background-size: contain; }\n\n.colorpicker {\n position: absolute;\n top: 100%;\n left: 0;\n display: none;\n float: left;\n font-size: inherit;\n color: inherit;\n text-align: left;\n list-style: none;\n background-color: #ffffff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n padding: 4px;\n min-width: 130px;\n margin-top: 1px;\n border-radius: 4px;\n z-index: 1055; }\n\n.colorpicker:before,\n.colorpicker:after {\n display: table;\n content: \"\";\n line-height: 0; }\n\n.colorpicker:after {\n clear: both; }\n\n.colorpicker:before {\n content: '';\n display: inline-block;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-bottom: 7px solid #ccc;\n border-bottom-color: rgba(0, 0, 0, 0.2);\n position: absolute;\n top: -7px;\n left: 6px; }\n\n.colorpicker:after {\n content: '';\n display: inline-block;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #ffffff;\n position: absolute;\n top: -6px;\n left: 7px; }\n\n.colorpicker div {\n position: relative; }\n\n.colorpicker.colorpicker-with-alpha {\n min-width: 140px; }\n\n.colorpicker.colorpicker-with-alpha .colorpicker-alpha {\n display: block; }\n\n.colorpicker-bar {\n height: 15px;\n margin: 5px 0 0 0;\n clear: both;\n text-align: center;\n font-size: 10px;\n line-height: normal; }\n\n.colorpicker-bar-horizontal {\n height: 15px;\n margin: 0 0 4px 0;\n float: left;\n width: 100px; }\n\n.colorpicker-element .input-group-addon i,\n.colorpicker-element .add-on i {\n display: inline-block;\n cursor: pointer;\n height: 16px;\n vertical-align: text-top;\n width: 16px; }\n\n.colorpicker.colorpicker-inline {\n position: relative;\n display: inline-block;\n float: none;\n z-index: auto;\n vertical-align: text-bottom; }\n\n.colorpicker.colorpicker-horizontal {\n width: 110px;\n min-width: 110px;\n height: auto; }\n\n.colorpicker.colorpicker-horizontal .colorpicker-saturation {\n margin-bottom: 4px; }\n\n.colorpicker.colorpicker-horizontal .colorpicker-bar {\n width: 100px; }\n\n.colorpicker.colorpicker-horizontal .colorpicker-hue,\n.colorpicker.colorpicker-horizontal .colorpicker-alpha {\n width: 100px;\n height: 15px;\n float: left;\n cursor: col-resize;\n margin-left: 0px;\n margin-bottom: 4px; }\n\n.colorpicker.colorpicker-horizontal .colorpicker-hue .colorpicker-guide,\n.colorpicker.colorpicker-horizontal .colorpicker-alpha .colorpicker-guide {\n display: block;\n height: 15px;\n background: #ffffff;\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n border: none;\n margin-top: 0; }\n\n.colorpicker.colorpicker-horizontal .colorpicker-hue {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAABCAMAAAAfBfuPAAABLFBMVEXqFBb/ABH/ACL/ADH/AEH/AFD/AGD/AG7/AH7/AI3/AJ3/AKz/ALz/AMr/ANv/AOr/APr2AP/mAP/XAP/HAP+4AP+oAP+aAP+JAP97AP9rAP9cAP9MAP8+AP8tAP8fAP8PAP8BAv8AEP8AH/8AL/8APv8ATv8AXP8Abf8Ae/8Ai/8Amv8Aqv8AuP8Ayf8A1/8A5/8A9/8A//gA/+kA/9kA/8oA/7oA/6wA/5sA/40A/30A/24A/14A/1AA/z8A/zEA/yEA/xEB/wMN/wAd/wAs/wA8/wBK/wBb/wBp/wB5/wCI/wCY/wCm/wC3/wDF/wDV/wDk/wD1/wD/+gD/7AD/3AD/zAD/vgD/rQD/nwD/jgD/gAD/cAD/YgD/UQD/QwD/MgD/JAD/FAD4Eg42qAedAAAAbUlEQVR4XgXAghEDsbxtlrZt27ax/w49ACAYQTGcICmaYTleECVZUTXdMC1Wm93hdLk9Xp8/EAyFI9FYPJFMpTPZXL5QLJUr1Vq90Wy1O91efzAcjSfT2XyxXK03293+cDydL9fb/fF8vT/f3x+LfRNXARMbCAAAAABJRU5ErkJggg==\"); }\n\n.colorpicker.colorpicker-horizontal .colorpicker-alpha {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAKCAQAAADoFTP1AAAB9ElEQVR4XoWTQW4VMRBEu9qWEimL7DhEMp8NF+ASnJJLcAQgE1bcgBUSkYKUuHCrZ9pjeqSU5Yn9LPu7umJQBIIv+k7vIOrtK66L4lmr3pVOrOv3otp619KZ0/KjdNI79L52Uo09FBQWrU0vfe5trezU+hLsoUKd3Repovte+0vbq/7Lj5XbaHECKasR9G4MPlbp+gzZxd6koPEJCkAYC5SjcOTAIIOK90Dja1IfIZ8Z+zAY9jm3b5Ia+MT5sFcqRJrR2AYYA8Kua5BzYRrFPNmD4PQMegGJMOffJJUsWiI3nCHZZjInNdffLWOufzbc3JaboCAVxwmnRHbhLSPwRJ4wU0BRSc6HkECYYVw95nMKgJOcylxrJttE5Ibzf9Xq9GPvP+WX3MiV/MGHfRu/SentRQrfG1GzsIrytdNXucSRKxQNIGHM9YhGFQJcdjNcBZvfJayuYe4Sia1CzwW+19mWOhe37HsxJWKwbu/jluEU15QzAQjAqCEbhMJc78GYV2E0kooHDubUImWkTOhGpgv8PoT8DJG/bzxna4BZ0eOFSOaLADGeSpFsg5AzeaDZIDQQXjZ4y/8ryfzUXBwdELRjTjCNvOeT0rNlrJz90vwy6N9pXXQEluX0inElpPWokSdiLCfiNJJjMKQ8Qsh8GEKQKMo/eiHrNbI9UksAAAAASUVORK5CYII=\"); }\n\n.colorpicker-right:before {\n left: auto;\n right: 6px; }\n\n.colorpicker-right:after {\n left: auto;\n right: 7px; }\n\n.colorpicker-no-arrow:before {\n border-right: 0;\n border-left: 0; }\n\n.colorpicker-no-arrow:after {\n border-right: 0;\n border-left: 0; }\n\n.colorpicker.colorpicker-visible,\n.colorpicker-alpha.colorpicker-visible,\n.colorpicker-saturation.colorpicker-visible,\n.colorpicker-hue.colorpicker-visible,\n.colorpicker-bar.colorpicker-visible {\n display: block; }\n\n.colorpicker.colorpicker-hidden,\n.colorpicker-alpha.colorpicker-hidden,\n.colorpicker-saturation.colorpicker-hidden,\n.colorpicker-hue.colorpicker-hidden,\n.colorpicker-bar.colorpicker-hidden {\n display: none; }\n\n.colorpicker-inline.colorpicker-visible {\n display: inline-block; }\n\n/** EXTENSIONS **/\n.colorpicker-preview {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAABkCAQAAAAVxWkcAAABr0lEQVR4Xo2VwU0DQQxF7dmRuNIFlzlSAR3QAaXQQdIBJVABFXDcOVAAd67cjJLR07dkhcSrkZKfb/t7bG88rFo3B5gZPMNycItu2xloGV7MWHzM9zuzFWCkmA0nK6AszCUJDW6+mG6R03ncw5v8EMTEvZ2O3AliYjpslblc0RF9LmZYWxURU6aKytWZYsoWCAe+xwOZp1GsEukGiIkYxcQCHck99+gRgB7JncyIB5SGEhP3Yh5P6JwX+u6AnYot104d8DJT7uH7M9JH6OZbimj0vfMVaYnJIZFJDBW9kHlerL2C6JV4mSt7uuo2N57RxnZ+usQjn0R1jwBJBrNO3evJpVYUWsJ/E3UiXRlv24/7YZ04xmEdWlzcKS+B/eapeyMvFd2k0+hRk/T0AmTW8h69s2sjYMsdPntECiILhAeIMZAeH4QvUwfn6ijC0tTV+fT9ky8jM9nK2g7Ly1VjSpKYq6IvsAm7MtNu1orEqa/K3KNvgMFdhfquPfJmp2dbh0/8Gzb6Y22ViaNr6n5410zXdngVhbu6XqdOtWOuin5hjABGp4a2uotZ71MVCfwDBt2/v37yo6AAAAAASUVORK5CYII=\");\n background-position: 0 100%; }\n\n.colorpicker-preview div {\n position: relative;\n width: 100%;\n height: 100%; }\n\n.colorpicker-swatch {\n cursor: pointer;\n float: left;\n height: 12px;\n width: 12px; }\n\n.colorpicker-swatch + .colorpicker-swatch {\n margin-left: 2px; }\n\n/*# sourceMappingURL=bootstrap-colorpicker.css.map */\n","/*!\n * Bootstrap Colorpicker - Simple and customizable colorpicker component for Twitter Bootstrap.\n * @package bootstrap-colorpicker\n * @version v3.0.0-wip\n * @license MIT\n * @link https://farbelous.github.io/bootstrap-colorpicker/\n * @link https://github.com/farbelous/bootstrap-colorpicker.git\n */\n.colorpicker-saturation {\n width: 100px;\n height: 100px;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAQAAADa613fAAAP9klEQVR4XnRWC47rNgwcKjlA0bv2VL1Qi/YELRav7203iS1ppqZoiXCAhuBHVLI74xFtG3/Hz2joIOjRGuR5eMYuRn9YA1fds859KX8ZvczLr9/pImiR3Rqky9/wlajRIdVE/1Rufeu/0No3/ASgBZAJUkwgi0iCaEatekJJoEqiTQncd67/gyOfRCZshTed0Nl8LbLj8D6qxtoq9/7kJz/aH/3Xfu8VwI5+AUH8DxE7gUyiIpZ5LwiGzUqE3CScJsCDQHAsvBnxWpkbC0QMHmBp6latWS0bnvrCN/x1+xPfce+Ij0GAyeAGGz15sOiax2UylPhKrFaMPnVWClwepKh07hdhkVDsK2uoyEIySergjdbY2VBtV8VLr8Mf9mF/4wMb7kR8FOhzFWZZe7HIZD9JRIbee28eJKBweTB6TwjYkAgWaUmtDveGw1Wx3zZ76YlPPfQd/+gTTUFki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JIaPBWik7ZSu5NIp5A3mRQaTFvLgkO9fVgEgMqqeVfb+p55tijWH+Kea71ubq4v8Sl8089sZKbKEZNq+VUfISJJF7j79WrbYgS994ZEf+nIz0pNFRWqapSmK6P45i3OQuItIiPDyg6RnxZ4D0g+CFPxAzluoRsWsaA6I6JOqVWCisDvJ0BgHTzMSRgMi0vmi8R+sR6tg/XUh7kCc7kMRqSNkTBDx0OkAUegFcMazciBXNpm798R6klXap/WZz49TQwBHqEcj4oCToUPjUuP9lfxcbyKMAwT6bTf1qqIIQDl3i5oCERNmVm0wgW4A8BGRxMX3hWh8bEV5Rvfp4DS5F3djWH2ztDNWKW7OBjgjIwsDWaKRknJjqMsh9QCa1p608lLovFkBE969DYtYelSzwSRcg535vAsFeNU9SzRCYZb4LDmxmFQKkwYGM+5y/G7b1uxMIylLdyE5yxIyYsoXWhQIpzQhYPi3JkJoKkB9+BxD0OMuyOEBe36DgyPSrxscmATldgKj8PxrkA/kA5PYMgkrocwIQ6GSRGmF0VaNqBKQZ5FYDEZSDzFTzq9mBQjAayE1A+ryDTzcQZe0Ibbxj7EwpAmTrJwEimZR9CCPtODhzxuNtY19Zd2Lf/fjCTnEiDAOg62j1utb/dv9mZ/aHCj4AyOHbsW3/As0BTzIgeJU7AAAAAElFTkSuQmCC\");\n cursor: crosshair;\n float: left; }\n .colorpicker-saturation .colorpicker-guide {\n display: block;\n height: 5px;\n width: 5px;\n border: 1px solid #000;\n border-radius: 5px;\n position: absolute;\n top: 0;\n left: 0;\n margin: -4px 0 0 -4px; }\n .colorpicker-saturation .colorpicker-guide i {\n display: block;\n height: 5px;\n width: 5px;\n border: 1px solid #fff;\n border-radius: 5px; }\n\n.colorpicker-hue,\n.colorpicker-alpha {\n width: 15px;\n height: 100px;\n float: left;\n cursor: row-resize;\n margin-left: 4px;\n margin-bottom: 4px; }\n\n.colorpicker-hue .colorpicker-guide,\n.colorpicker-alpha .colorpicker-guide {\n display: block;\n height: 1px;\n background: #000;\n border-top: 1px solid #fff;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n margin-top: -1px; }\n\n.colorpicker-hue {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABkCAMAAABw8qpSAAABLFBMVEXqFBb/ABH/ACL/ADH/AEH/AFD/AGD/AG7/AH7/AI3/AJ3/AKz/ALz/AMr/ANv/AOr/APr2AP/mAP/XAP/HAP+4AP+oAP+aAP+JAP97AP9rAP9cAP9MAP8+AP8tAP8fAP8PAP8BAv8AEP8AH/8AL/8APv8ATv8AXP8Abf8Ae/8Ai/8Amv8Aqv8AuP8Ayf8A1/8A5/8A9/8A//gA/+kA/9kA/8oA/7oA/6wA/5sA/40A/30A/24A/14A/1AA/z8A/zEA/yEA/xEB/wMN/wAd/wAs/wA8/wBK/wBb/wBp/wB5/wCI/wCY/wCm/wC3/wDF/wDV/wDk/wD1/wD/+gD/7AD/3AD/zAD/vgD/rQD/nwD/jgD/gAD/cAD/YgD/UQD/QwD/MgD/JAD/FAD4Eg42qAedAAAAh0lEQVR4XgXAg3EDAAAAwI9to7Zt27a1/w49BASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTS1tHXo1KVbj159+g0YNGTYiFFjxk2YNGXajFlz5i1YtGTZilVr1m3YtGXbjl179h04dOTYiVNnzl24dOXajVt37j149OTZi1dv3n349OXbj19//wOxE1dQ8reGAAAAAElFTkSuQmCC\"); }\n\n.colorpicker-alpha {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAABkCAQAAAAVxWkcAAABr0lEQVR4Xo2VwU0DQQxF7dmRuNIFlzlSAR3QAaXQQdIBJVABFXDcOVAAd67cjJLR07dkhcSrkZKfb/t7bG88rFo3B5gZPMNycItu2xloGV7MWHzM9zuzFWCkmA0nK6AszCUJDW6+mG6R03ncw5v8EMTEvZ2O3AliYjpslblc0RF9LmZYWxURU6aKytWZYsoWCAe+xwOZp1GsEukGiIkYxcQCHck99+gRgB7JncyIB5SGEhP3Yh5P6JwX+u6AnYot104d8DJT7uH7M9JH6OZbimj0vfMVaYnJIZFJDBW9kHlerL2C6JV4mSt7uuo2N57RxnZ+usQjn0R1jwBJBrNO3evJpVYUWsJ/E3UiXRlv24/7YZ04xmEdWlzcKS+B/eapeyMvFd2k0+hRk/T0AmTW8h69s2sjYMsdPntECiILhAeIMZAeH4QvUwfn6ijC0tTV+fT9ky8jM9nK2g7Ly1VjSpKYq6IvsAm7MtNu1orEqa/K3KNvgMFdhfquPfJmp2dbh0/8Gzb6Y22ViaNr6n5410zXdngVhbu6XqdOtWOuin5hjABGp4a2uotZ71MVCfwDBt2/v37yo6AAAAAASUVORK5CYII=\");\n display: none; }\n\n.colorpicker-saturation,\n.colorpicker-hue,\n.colorpicker-alpha {\n background-size: contain; }\n\n.colorpicker {\n position: absolute;\n top: 100%;\n left: 0;\n display: none;\n float: left;\n font-size: inherit;\n color: inherit;\n text-align: left;\n list-style: none;\n background-color: #ffffff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n padding: 4px;\n min-width: 130px;\n margin-top: 1px;\n border-radius: 4px;\n z-index: 1055; }\n\n.colorpicker:before,\n.colorpicker:after {\n display: table;\n content: \"\";\n line-height: 0; }\n\n.colorpicker:after {\n clear: both; }\n\n.colorpicker:before {\n content: '';\n display: inline-block;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-bottom: 7px solid #ccc;\n border-bottom-color: rgba(0, 0, 0, 0.2);\n position: absolute;\n top: -7px;\n left: 6px; }\n\n.colorpicker:after {\n content: '';\n display: inline-block;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #ffffff;\n position: absolute;\n top: -6px;\n left: 7px; }\n\n.colorpicker div {\n position: relative; }\n\n.colorpicker.colorpicker-with-alpha {\n min-width: 140px; }\n\n.colorpicker.colorpicker-with-alpha .colorpicker-alpha {\n display: block; }\n\n.colorpicker-bar {\n height: 15px;\n margin: 5px 0 0 0;\n clear: both;\n text-align: center;\n font-size: 10px;\n line-height: normal; }\n\n.colorpicker-bar-horizontal {\n height: 15px;\n margin: 0 0 4px 0;\n float: left;\n width: 100px; }\n\n.colorpicker-element .input-group-addon i,\n.colorpicker-element .add-on i {\n display: inline-block;\n cursor: pointer;\n height: 16px;\n vertical-align: text-top;\n width: 16px; }\n\n.colorpicker.colorpicker-inline {\n position: relative;\n display: inline-block;\n float: none;\n z-index: auto;\n vertical-align: text-bottom; }\n\n.colorpicker.colorpicker-horizontal {\n width: 110px;\n min-width: 110px;\n height: auto; }\n\n.colorpicker.colorpicker-horizontal .colorpicker-saturation {\n margin-bottom: 4px; }\n\n.colorpicker.colorpicker-horizontal .colorpicker-bar {\n width: 100px; }\n\n.colorpicker.colorpicker-horizontal .colorpicker-hue,\n.colorpicker.colorpicker-horizontal .colorpicker-alpha {\n width: 100px;\n height: 15px;\n float: left;\n cursor: col-resize;\n margin-left: 0px;\n margin-bottom: 4px; }\n\n.colorpicker.colorpicker-horizontal .colorpicker-hue .colorpicker-guide,\n.colorpicker.colorpicker-horizontal .colorpicker-alpha .colorpicker-guide {\n display: block;\n height: 15px;\n background: #ffffff;\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n border: none;\n margin-top: 0; }\n\n.colorpicker.colorpicker-horizontal .colorpicker-hue {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAABCAMAAAAfBfuPAAABLFBMVEXqFBb/ABH/ACL/ADH/AEH/AFD/AGD/AG7/AH7/AI3/AJ3/AKz/ALz/AMr/ANv/AOr/APr2AP/mAP/XAP/HAP+4AP+oAP+aAP+JAP97AP9rAP9cAP9MAP8+AP8tAP8fAP8PAP8BAv8AEP8AH/8AL/8APv8ATv8AXP8Abf8Ae/8Ai/8Amv8Aqv8AuP8Ayf8A1/8A5/8A9/8A//gA/+kA/9kA/8oA/7oA/6wA/5sA/40A/30A/24A/14A/1AA/z8A/zEA/yEA/xEB/wMN/wAd/wAs/wA8/wBK/wBb/wBp/wB5/wCI/wCY/wCm/wC3/wDF/wDV/wDk/wD1/wD/+gD/7AD/3AD/zAD/vgD/rQD/nwD/jgD/gAD/cAD/YgD/UQD/QwD/MgD/JAD/FAD4Eg42qAedAAAAbUlEQVR4XgXAghEDsbxtlrZt27ax/w49ACAYQTGcICmaYTleECVZUTXdMC1Wm93hdLk9Xp8/EAyFI9FYPJFMpTPZXL5QLJUr1Vq90Wy1O91efzAcjSfT2XyxXK03293+cDydL9fb/fF8vT/f3x+LfRNXARMbCAAAAABJRU5ErkJggg==\"); }\n\n.colorpicker.colorpicker-horizontal .colorpicker-alpha {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAKCAQAAADoFTP1AAAB9ElEQVR4XoWTQW4VMRBEu9qWEimL7DhEMp8NF+ASnJJLcAQgE1bcgBUSkYKUuHCrZ9pjeqSU5Yn9LPu7umJQBIIv+k7vIOrtK66L4lmr3pVOrOv3otp619KZ0/KjdNI79L52Uo09FBQWrU0vfe5trezU+hLsoUKd3Repovte+0vbq/7Lj5XbaHECKasR9G4MPlbp+gzZxd6koPEJCkAYC5SjcOTAIIOK90Dja1IfIZ8Z+zAY9jm3b5Ia+MT5sFcqRJrR2AYYA8Kua5BzYRrFPNmD4PQMegGJMOffJJUsWiI3nCHZZjInNdffLWOufzbc3JaboCAVxwmnRHbhLSPwRJ4wU0BRSc6HkECYYVw95nMKgJOcylxrJttE5Ibzf9Xq9GPvP+WX3MiV/MGHfRu/SentRQrfG1GzsIrytdNXucSRKxQNIGHM9YhGFQJcdjNcBZvfJayuYe4Sia1CzwW+19mWOhe37HsxJWKwbu/jluEU15QzAQjAqCEbhMJc78GYV2E0kooHDubUImWkTOhGpgv8PoT8DJG/bzxna4BZ0eOFSOaLADGeSpFsg5AzeaDZIDQQXjZ4y/8ryfzUXBwdELRjTjCNvOeT0rNlrJz90vwy6N9pXXQEluX0inElpPWokSdiLCfiNJJjMKQ8Qsh8GEKQKMo/eiHrNbI9UksAAAAASUVORK5CYII=\"); }\n\n.colorpicker-right:before {\n left: auto;\n right: 6px; }\n\n.colorpicker-right:after {\n left: auto;\n right: 7px; }\n\n.colorpicker-no-arrow:before {\n border-right: 0;\n border-left: 0; }\n\n.colorpicker-no-arrow:after {\n border-right: 0;\n border-left: 0; }\n\n.colorpicker.colorpicker-visible,\n.colorpicker-alpha.colorpicker-visible,\n.colorpicker-saturation.colorpicker-visible,\n.colorpicker-hue.colorpicker-visible,\n.colorpicker-bar.colorpicker-visible {\n display: block; }\n\n.colorpicker.colorpicker-hidden,\n.colorpicker-alpha.colorpicker-hidden,\n.colorpicker-saturation.colorpicker-hidden,\n.colorpicker-hue.colorpicker-hidden,\n.colorpicker-bar.colorpicker-hidden {\n display: none; }\n\n.colorpicker-inline.colorpicker-visible {\n display: inline-block; }\n\n/** EXTENSIONS **/\n.colorpicker-preview {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAABkCAQAAAAVxWkcAAABr0lEQVR4Xo2VwU0DQQxF7dmRuNIFlzlSAR3QAaXQQdIBJVABFXDcOVAAd67cjJLR07dkhcSrkZKfb/t7bG88rFo3B5gZPMNycItu2xloGV7MWHzM9zuzFWCkmA0nK6AszCUJDW6+mG6R03ncw5v8EMTEvZ2O3AliYjpslblc0RF9LmZYWxURU6aKytWZYsoWCAe+xwOZp1GsEukGiIkYxcQCHck99+gRgB7JncyIB5SGEhP3Yh5P6JwX+u6AnYot104d8DJT7uH7M9JH6OZbimj0vfMVaYnJIZFJDBW9kHlerL2C6JV4mSt7uuo2N57RxnZ+usQjn0R1jwBJBrNO3evJpVYUWsJ/E3UiXRlv24/7YZ04xmEdWlzcKS+B/eapeyMvFd2k0+hRk/T0AmTW8h69s2sjYMsdPntECiILhAeIMZAeH4QvUwfn6ijC0tTV+fT9ky8jM9nK2g7Ly1VjSpKYq6IvsAm7MtNu1orEqa/K3KNvgMFdhfquPfJmp2dbh0/8Gzb6Y22ViaNr6n5410zXdngVhbu6XqdOtWOuin5hjABGp4a2uotZ71MVCfwDBt2/v37yo6AAAAAASUVORK5CYII=\");\n background-position: 0 100%; }\n\n.colorpicker-preview div {\n position: relative;\n width: 100%;\n height: 100%; }\n\n.colorpicker-swatch {\n cursor: pointer;\n float: left;\n height: 12px;\n width: 12px; }\n\n.colorpicker-swatch + .colorpicker-swatch {\n margin-left: 2px; }\n\n/*# sourceMappingURL=bootstrap-colorpicker.css.map */\n"]}
includes/colorpicker/js/bootstrap-colorpicker.js ADDED
@@ -0,0 +1,3932 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Bootstrap Colorpicker - Simple and customizable colorpicker component for Twitter Bootstrap.
3
+ * @package bootstrap-colorpicker
4
+ * @version v3.0.0-wip
5
+ * @license MIT
6
+ * @link https://farbelous.github.io/bootstrap-colorpicker/
7
+ * @link https://github.com/farbelous/bootstrap-colorpicker.git
8
+ */
9
+ (function webpackUniversalModuleDefinition(root, factory) {
10
+ if(typeof exports === 'object' && typeof module === 'object')
11
+ module.exports = factory(require("jQuery"));
12
+ else if(typeof define === 'function' && define.amd)
13
+ define("bootstrap-colorpicker", ["jQuery"], factory);
14
+ else if(typeof exports === 'object')
15
+ exports["bootstrap-colorpicker"] = factory(require("jQuery"));
16
+ else
17
+ root["bootstrap-colorpicker"] = factory(root["jQuery"]);
18
+ })(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {
19
+ return /******/ (function(modules) { // webpackBootstrap
20
+ /******/ // The module cache
21
+ /******/ var installedModules = {};
22
+ /******/
23
+ /******/ // The require function
24
+ /******/ function __webpack_require__(moduleId) {
25
+ /******/
26
+ /******/ // Check if module is in cache
27
+ /******/ if(installedModules[moduleId]) {
28
+ /******/ return installedModules[moduleId].exports;
29
+ /******/ }
30
+ /******/ // Create a new module (and put it into the cache)
31
+ /******/ var module = installedModules[moduleId] = {
32
+ /******/ i: moduleId,
33
+ /******/ l: false,
34
+ /******/ exports: {}
35
+ /******/ };
36
+ /******/
37
+ /******/ // Execute the module function
38
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
39
+ /******/
40
+ /******/ // Flag the module as loaded
41
+ /******/ module.l = true;
42
+ /******/
43
+ /******/ // Return the exports of the module
44
+ /******/ return module.exports;
45
+ /******/ }
46
+ /******/
47
+ /******/
48
+ /******/ // expose the modules object (__webpack_modules__)
49
+ /******/ __webpack_require__.m = modules;
50
+ /******/
51
+ /******/ // expose the module cache
52
+ /******/ __webpack_require__.c = installedModules;
53
+ /******/
54
+ /******/ // define getter function for harmony exports
55
+ /******/ __webpack_require__.d = function(exports, name, getter) {
56
+ /******/ if(!__webpack_require__.o(exports, name)) {
57
+ /******/ Object.defineProperty(exports, name, {
58
+ /******/ configurable: false,
59
+ /******/ enumerable: true,
60
+ /******/ get: getter
61
+ /******/ });
62
+ /******/ }
63
+ /******/ };
64
+ /******/
65
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
66
+ /******/ __webpack_require__.n = function(module) {
67
+ /******/ var getter = module && module.__esModule ?
68
+ /******/ function getDefault() { return module['default']; } :
69
+ /******/ function getModuleExports() { return module; };
70
+ /******/ __webpack_require__.d(getter, 'a', getter);
71
+ /******/ return getter;
72
+ /******/ };
73
+ /******/
74
+ /******/ // Object.prototype.hasOwnProperty.call
75
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
76
+ /******/
77
+ /******/ // __webpack_public_path__
78
+ /******/ __webpack_require__.p = "";
79
+ /******/
80
+ /******/ // Load entry module and return exports
81
+ /******/ return __webpack_require__(__webpack_require__.s = 3);
82
+ /******/ })
83
+ /************************************************************************/
84
+ /******/ ([
85
+ /* 0 */
86
+ /***/ (function(module, exports) {
87
+
88
+ module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
89
+
90
+ /***/ }),
91
+ /* 1 */
92
+ /***/ (function(module, exports, __webpack_require__) {
93
+
94
+ "use strict";
95
+
96
+
97
+ Object.defineProperty(exports, "__esModule", {
98
+ value: true
99
+ });
100
+
101
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
102
+
103
+ var _jquery = __webpack_require__(0);
104
+
105
+ var _jquery2 = _interopRequireDefault(_jquery);
106
+
107
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
108
+
109
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
110
+
111
+ /**
112
+ * Colorpicker extension class.
113
+ */
114
+ var Extension = function () {
115
+ /**
116
+ * @param {Colorpicker} colorpicker
117
+ * @param {Object} options
118
+ */
119
+ function Extension(colorpicker) {
120
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
121
+
122
+ _classCallCheck(this, Extension);
123
+
124
+ /**
125
+ * @type {Colorpicker}
126
+ */
127
+ this.colorpicker = colorpicker;
128
+ /**
129
+ * @type {Object}
130
+ */
131
+ this.options = options;
132
+
133
+ if (!(this.colorpicker.element && this.colorpicker.element.length)) {
134
+ throw new Error('Extension: this.colorpicker.element is not valid');
135
+ }
136
+
137
+ this.colorpicker.element.on('colorpickerCreate.colorpicker-ext', _jquery2.default.proxy(this.onCreate, this));
138
+ this.colorpicker.element.on('colorpickerDestroy.colorpicker-ext', _jquery2.default.proxy(this.onDestroy, this));
139
+ this.colorpicker.element.on('colorpickerUpdate.colorpicker-ext', _jquery2.default.proxy(this.onUpdate, this));
140
+ this.colorpicker.element.on('colorpickerChange.colorpicker-ext', _jquery2.default.proxy(this.onChange, this));
141
+ this.colorpicker.element.on('colorpickerInvalid.colorpicker-ext', _jquery2.default.proxy(this.onInvalid, this));
142
+ this.colorpicker.element.on('colorpickerShow.colorpicker-ext', _jquery2.default.proxy(this.onShow, this));
143
+ this.colorpicker.element.on('colorpickerHide.colorpicker-ext', _jquery2.default.proxy(this.onHide, this));
144
+ this.colorpicker.element.on('colorpickerEnable.colorpicker-ext', _jquery2.default.proxy(this.onEnable, this));
145
+ this.colorpicker.element.on('colorpickerDisable.colorpicker-ext', _jquery2.default.proxy(this.onDisable, this));
146
+ }
147
+
148
+ /**
149
+ * Function called every time a new color needs to be created.
150
+ * Return false to skip this resolver and continue with other extensions' ones
151
+ * or return anything else to consider the color resolved.
152
+ *
153
+ * @param {Color|String|*} color
154
+ * @return {Color|String|*}
155
+ */
156
+
157
+
158
+ _createClass(Extension, [{
159
+ key: 'resolveColor',
160
+ value: function resolveColor(color) {
161
+ return false;
162
+ }
163
+
164
+ /**
165
+ * @listens colorpickerCreate
166
+ * @param {Event} event
167
+ */
168
+
169
+ }, {
170
+ key: 'onCreate',
171
+ value: function onCreate(event) {}
172
+ // to be extended
173
+
174
+
175
+ /**
176
+ * @listens colorpickerDestroy
177
+ * @param {Event} event
178
+ */
179
+
180
+ }, {
181
+ key: 'onDestroy',
182
+ value: function onDestroy(event) {
183
+ this.colorpicker.element.off('.colorpicker-ext');
184
+ }
185
+
186
+ /**
187
+ * @listens colorpickerUpdate
188
+ * @param {Event} event
189
+ */
190
+
191
+ }, {
192
+ key: 'onUpdate',
193
+ value: function onUpdate(event) {}
194
+ // to be extended
195
+
196
+
197
+ /**
198
+ * @listens colorpickerChange
199
+ * @param {Event} event
200
+ */
201
+
202
+ }, {
203
+ key: 'onChange',
204
+ value: function onChange(event) {}
205
+ // to be extended
206
+
207
+
208
+ /**
209
+ * @listens colorpickerInvalid
210
+ * @param {Event} event
211
+ */
212
+
213
+ }, {
214
+ key: 'onInvalid',
215
+ value: function onInvalid(event) {}
216
+ // to be extended
217
+
218
+
219
+ /**
220
+ * @listens colorpickerHide
221
+ * @param {Event} event
222
+ */
223
+
224
+ }, {
225
+ key: 'onHide',
226
+ value: function onHide(event) {}
227
+ // to be extended
228
+
229
+
230
+ /**
231
+ * @listens colorpickerShow
232
+ * @param {Event} event
233
+ */
234
+
235
+ }, {
236
+ key: 'onShow',
237
+ value: function onShow(event) {}
238
+ // to be extended
239
+
240
+
241
+ /**
242
+ * @listens colorpickerDisable
243
+ * @param {Event} event
244
+ */
245
+
246
+ }, {
247
+ key: 'onDisable',
248
+ value: function onDisable(event) {}
249
+ // to be extended
250
+
251
+
252
+ /**
253
+ * @listens colorpickerEnable
254
+ * @param {Event} event
255
+ */
256
+
257
+ }, {
258
+ key: 'onEnable',
259
+ value: function onEnable(event) {
260
+ // to be extended
261
+ }
262
+ }]);
263
+
264
+ return Extension;
265
+ }();
266
+
267
+ exports.default = Extension;
268
+
269
+ /***/ }),
270
+ /* 2 */
271
+ /***/ (function(module, exports, __webpack_require__) {
272
+
273
+ "use strict";
274
+
275
+
276
+ Object.defineProperty(exports, "__esModule", {
277
+ value: true
278
+ });
279
+
280
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
281
+
282
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
283
+
284
+ var _Extension2 = __webpack_require__(1);
285
+
286
+ var _Extension3 = _interopRequireDefault(_Extension2);
287
+
288
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
289
+
290
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
291
+
292
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
293
+
294
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
295
+
296
+ var defaults = {
297
+ /**
298
+ * Key-value pairs defining a color alias and its CSS color representation.
299
+ *
300
+ * They can also be just an array of values. In that case, no special names are used, only the real colors.
301
+ *
302
+ * @type {Object|Array}
303
+ * @default null
304
+ * @example
305
+ * {
306
+ * 'black': '#000000',
307
+ * 'white': '#ffffff',
308
+ * 'red': '#FF0000',
309
+ * 'default': '#777777',
310
+ * 'primary': '#337ab7',
311
+ * 'success': '#5cb85c',
312
+ * 'info': '#5bc0de',
313
+ * 'warning': '#f0ad4e',
314
+ * 'danger': '#d9534f'
315
+ * }
316
+ *
317
+ * @example ['#f0ad4e', '#337ab7', '#5cb85c']
318
+ */
319
+ colors: null,
320
+ /**
321
+ * If true, the when a color swatch is selected the name (alias) will be used as input value,
322
+ * otherwise the swatch real color value will be used.
323
+ *
324
+ * @type {boolean}
325
+ * @default true
326
+ */
327
+ namesAsValues: true
328
+ };
329
+
330
+ var Palette = function (_Extension) {
331
+ _inherits(Palette, _Extension);
332
+
333
+ _createClass(Palette, [{
334
+ key: 'colors',
335
+
336
+
337
+ /**
338
+ * @returns {Object|Array}
339
+ */
340
+ get: function get() {
341
+ return this.options.colors;
342
+ }
343
+ }]);
344
+
345
+ function Palette(colorpicker) {
346
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
347
+
348
+ _classCallCheck(this, Palette);
349
+
350
+ var _this = _possibleConstructorReturn(this, (Palette.__proto__ || Object.getPrototypeOf(Palette)).call(this, colorpicker, Object.assign({}, defaults, options)));
351
+
352
+ if (!Array.isArray(_this.options.colors) && _typeof(_this.options.colors) !== 'object') {
353
+ _this.options.colors = null;
354
+ }
355
+ return _this;
356
+ }
357
+
358
+ /**
359
+ * @returns {int}
360
+ */
361
+
362
+
363
+ _createClass(Palette, [{
364
+ key: 'getLength',
365
+ value: function getLength() {
366
+ if (!this.options.colors) {
367
+ return 0;
368
+ }
369
+
370
+ if (Array.isArray(this.options.colors)) {
371
+ return this.options.colors.length;
372
+ }
373
+
374
+ if (_typeof(this.options.colors) === 'object') {
375
+ return Object.keys(this.options.colors).length;
376
+ }
377
+
378
+ return 0;
379
+ }
380
+ }, {
381
+ key: 'resolveColor',
382
+ value: function resolveColor(color) {
383
+ if (this.getLength() <= 0) {
384
+ return false;
385
+ }
386
+
387
+ if (Array.isArray(this.options.colors)) {
388
+ if (this.options.colors.indexOf(color) >= 0) {
389
+ return color;
390
+ }
391
+ if (this.options.colors.indexOf(color.toUpperCase()) >= 0) {
392
+ return color.toUpperCase();
393
+ }
394
+ if (this.options.colors.indexOf(color.toLowerCase()) >= 0) {
395
+ return color.toLowerCase();
396
+ }
397
+ return false;
398
+ }
399
+
400
+ if (_typeof(this.options.colors) !== 'object') {
401
+ return false;
402
+ }
403
+
404
+ if (!this.options.namesAsValues) {
405
+ return this.getValue(color, false);
406
+ }
407
+ return this.getName(color, this.getName('#' + color, this.getValue(color, false)));
408
+ }
409
+
410
+ /**
411
+ * Given a color value, returns the corresponding color name or defaultValue.
412
+ *
413
+ * @param {String} value
414
+ * @param {*} defaultValue
415
+ * @returns {*}
416
+ */
417
+
418
+ }, {
419
+ key: 'getName',
420
+ value: function getName(value) {
421
+ var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
422
+
423
+ if (!(typeof value === 'string') || !this.options.colors) {
424
+ return defaultValue;
425
+ }
426
+ for (var name in this.options.colors) {
427
+ if (!this.options.colors.hasOwnProperty(name)) {
428
+ continue;
429
+ }
430
+ if (this.options.colors[name].toLowerCase() === value.toLowerCase()) {
431
+ return name;
432
+ }
433
+ }
434
+ return defaultValue;
435
+ }
436
+
437
+ /**
438
+ * Given a color name, returns the corresponding color value or defaultValue.
439
+ *
440
+ * @param {String} name
441
+ * @param {*} defaultValue
442
+ * @returns {*}
443
+ */
444
+
445
+ }, {
446
+ key: 'getValue',
447
+ value: function getValue(name) {
448
+ var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
449
+
450
+ if (!(typeof name === 'string') || !this.options.colors) {
451
+ return defaultValue;
452
+ }
453
+ if (this.options.colors.hasOwnProperty(name)) {
454
+ return this.options.colors[name];
455
+ }
456
+ return defaultValue;
457
+ }
458
+ }]);
459
+
460
+ return Palette;
461
+ }(_Extension3.default);
462
+
463
+ exports.default = Palette;
464
+
465
+ /***/ }),
466
+ /* 3 */
467
+ /***/ (function(module, exports, __webpack_require__) {
468
+
469
+ "use strict";
470
+
471
+
472
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
473
+
474
+ var _Colorpicker = __webpack_require__(4);
475
+
476
+ var _Colorpicker2 = _interopRequireDefault(_Colorpicker);
477
+
478
+ var _jquery = __webpack_require__(0);
479
+
480
+ var _jquery2 = _interopRequireDefault(_jquery);
481
+
482
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
483
+
484
+ var plugin = 'colorpicker';
485
+
486
+ _jquery2.default[plugin] = _Colorpicker2.default;
487
+
488
+ _jquery2.default.fn[plugin] = function (option) {
489
+ var apiArgs = Array.prototype.slice.call(arguments, 1),
490
+ isSingleElement = this.length === 1,
491
+ returnValue = null;
492
+
493
+ var $jq = this.each(function () {
494
+ var $this = (0, _jquery2.default)(this),
495
+ inst = $this.data(plugin),
496
+ options = (typeof option === 'undefined' ? 'undefined' : _typeof(option)) === 'object' ? option : {};
497
+
498
+ if (!inst) {
499
+ inst = new _Colorpicker2.default(this, options);
500
+ $this.data(plugin, inst);
501
+ }
502
+
503
+ if (typeof option === 'string') {
504
+ if (option === 'colorpicker') {
505
+ returnValue = inst;
506
+ } else if (_jquery2.default.isFunction(inst[option])) {
507
+ returnValue = inst[option].apply(inst, apiArgs);
508
+ } else {
509
+ // its a property ?
510
+ if (apiArgs.length) {
511
+ // set property
512
+ inst[option] = apiArgs[0];
513
+ }
514
+ returnValue = inst[option];
515
+ }
516
+ } else {
517
+ returnValue = $this;
518
+ }
519
+ });
520
+
521
+ return isSingleElement ? returnValue : $jq;
522
+ };
523
+
524
+ _jquery2.default.fn[plugin].constructor = _Colorpicker2.default;
525
+
526
+ /***/ }),
527
+ /* 4 */
528
+ /***/ (function(module, exports, __webpack_require__) {
529
+
530
+ "use strict";
531
+
532
+
533
+ Object.defineProperty(exports, "__esModule", {
534
+ value: true
535
+ });
536
+
537
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
538
+
539
+ var _Color = __webpack_require__(5);
540
+
541
+ var _Color2 = _interopRequireDefault(_Color);
542
+
543
+ var _Extension = __webpack_require__(1);
544
+
545
+ var _Extension2 = _interopRequireDefault(_Extension);
546
+
547
+ var _options = __webpack_require__(7);
548
+
549
+ var _options2 = _interopRequireDefault(_options);
550
+
551
+ var _extensions = __webpack_require__(8);
552
+
553
+ var _extensions2 = _interopRequireDefault(_extensions);
554
+
555
+ var _jquery = __webpack_require__(0);
556
+
557
+ var _jquery2 = _interopRequireDefault(_jquery);
558
+
559
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
560
+
561
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
562
+
563
+ var colorPickerIdCounter = 0;
564
+
565
+ /**
566
+ * Colorpicker widget class
567
+ */
568
+
569
+ var Colorpicker = function () {
570
+ _createClass(Colorpicker, [{
571
+ key: 'color',
572
+
573
+
574
+ /**
575
+ * color getter
576
+ *
577
+ * @type {Color|null}
578
+ */
579
+ get: function get() {
580
+ return this.element.data('color');
581
+ }
582
+
583
+ /**
584
+ * color setter
585
+ *
586
+ * @ignore
587
+ * @param {Color|null} value
588
+ */
589
+ ,
590
+ set: function set(value) {
591
+ this.element.data('color', value);
592
+ }
593
+
594
+ /**
595
+ * @fires colorpickerCreate
596
+ * @param {Object|String} element
597
+ * @param {Object} options
598
+ * @constructor
599
+ */
600
+
601
+ }], [{
602
+ key: 'Color',
603
+
604
+ /**
605
+ * Color class
606
+ *
607
+ * @static
608
+ * @type {Color}
609
+ */
610
+ get: function get() {
611
+ return _Color2.default;
612
+ }
613
+
614
+ /**
615
+ * Extension class
616
+ *
617
+ * @static
618
+ * @type {Extension}
619
+ */
620
+
621
+ }, {
622
+ key: 'Extension',
623
+ get: function get() {
624
+ return _Extension2.default;
625
+ }
626
+
627
+ /**
628
+ * Colorpicker bundled extension classes
629
+ *
630
+ * @static
631
+ * @type {{Extension}}
632
+ */
633
+
634
+ }, {
635
+ key: 'Extensions',
636
+ get: function get() {
637
+ return _extensions2.default;
638
+ }
639
+ }]);
640
+
641
+ function Colorpicker(element, options) {
642
+ var _this = this;
643
+
644
+ _classCallCheck(this, Colorpicker);
645
+
646
+ colorPickerIdCounter += 1;
647
+ /**
648
+ * The colorpicker instance number
649
+ * @type {number}
650
+ */
651
+ this.id = colorPickerIdCounter;
652
+
653
+ /**
654
+ * @type {*|jQuery}
655
+ */
656
+ this.element = (0, _jquery2.default)(element).addClass('colorpicker-element');
657
+ this.element.attr('data-colorpicker-id', this.id);
658
+
659
+ /**
660
+ * @type {defaults}
661
+ */
662
+ this.options = Object.assign({}, _options2.default, options, this.element.data());
663
+
664
+ /**
665
+ * @type {Extension[]}
666
+ */
667
+ this.extensions = [];
668
+
669
+ if (!Array.isArray(this.options.extensions)) {
670
+ this.options.extensions = [];
671
+ }
672
+
673
+ /**
674
+ * @type {*|jQuery}
675
+ */
676
+ this.component = this.options.component;
677
+ this.component = this.component !== false ? this.element.find(this.component) : false;
678
+ if (this.component && this.component.length === 0) {
679
+ this.component = false;
680
+ }
681
+
682
+ /**
683
+ * @type {*|jQuery}
684
+ */
685
+ this.container = this.options.container === true ? this.element : this.options.container;
686
+ this.container = this.container !== false ? (0, _jquery2.default)(this.container) : false;
687
+
688
+ /**
689
+ * @type {*|String}
690
+ * @private
691
+ */
692
+ this.currentSlider = null;
693
+
694
+ /**
695
+ * @type {{left: number, top: number}}
696
+ * @private
697
+ */
698
+ this.mousePointer = {
699
+ left: 0,
700
+ top: 0
701
+ };
702
+
703
+ /**
704
+ * Latest external event
705
+ *
706
+ * @type {{name: String, e: *}}
707
+ * @private
708
+ */
709
+ this.lastEvent = {
710
+ name: null,
711
+ e: null
712
+ };
713
+
714
+ // Is the element an input? Should we search inside for any input?
715
+ /**
716
+ * @type {*|jQuery}
717
+ */
718
+ this.input = this.element.is('input') ? this.element : this.options.input ? this.element.find(this.options.input) : false;
719
+
720
+ if (this.input && this.input.length === 0) {
721
+ this.input = false;
722
+ }
723
+
724
+ if (this.options.debug) {
725
+ this.options.extensions.push({ name: 'Debugger' });
726
+ }
727
+
728
+ // Register extensions
729
+ this.options.extensions.forEach(function (ext) {
730
+ _this.addExtension(ext.name, _extensions2.default[ext.name.toLowerCase()], ext);
731
+ });
732
+
733
+ var colorValue = this.options.color !== false ? this.options.color : this.getValue();
734
+
735
+ this.color = colorValue ? this.createColor(colorValue) : false;
736
+
737
+ if (this.options.format === false) {
738
+ // If format is false, use the first parsed one from now on
739
+ this.options.format = this.color.format;
740
+ }
741
+
742
+ /**
743
+ * @type {boolean}
744
+ * @private
745
+ */
746
+ this.disabled = false;
747
+
748
+ // Setup picker
749
+ var $picker = this.picker = (0, _jquery2.default)(this.options.template);
750
+
751
+ if (this.options.customClass) {
752
+ $picker.addClass(this.options.customClass);
753
+ }
754
+ if (this.options.inline) {
755
+ $picker.addClass('colorpicker-inline colorpicker-visible');
756
+ } else {
757
+ $picker.addClass('colorpicker-hidden');
758
+ }
759
+ if (this.options.horizontal) {
760
+ $picker.addClass('colorpicker-horizontal');
761
+ }
762
+
763
+ if ((this.options.useAlpha || this.hasColor() && this.color.hasTransparency()) && this.options.useAlpha !== false) {
764
+ this.options.useAlpha = true;
765
+ $picker.addClass('colorpicker-with-alpha');
766
+ }
767
+
768
+ if (this.options.align === 'right') {
769
+ $picker.addClass('colorpicker-right');
770
+ }
771
+ if (this.options.inline === true) {
772
+ $picker.addClass('colorpicker-no-arrow');
773
+ }
774
+
775
+ // Prevent closing the colorpicker when clicking on itself
776
+ $picker.on('mousedown.colorpicker touchstart.colorpicker', _jquery2.default.proxy(function (e) {
777
+ if (e.target === e.currentTarget) {
778
+ e.preventDefault();
779
+ }
780
+ }, this));
781
+
782
+ // Bind click/tap events on the sliders
783
+ $picker.find('.colorpicker-saturation, .colorpicker-hue, .colorpicker-alpha').on('mousedown.colorpicker touchstart.colorpicker', _jquery2.default.proxy(this._mousedown, this));
784
+
785
+ $picker.appendTo(this.container ? this.container : (0, _jquery2.default)('body'));
786
+
787
+ // Bind other events
788
+ if (this.hasInput()) {
789
+ this.input.on({
790
+ 'keyup.colorpicker': _jquery2.default.proxy(this._keyup, this)
791
+ });
792
+ this.input.on({
793
+ 'change.colorpicker': _jquery2.default.proxy(this._change, this)
794
+ });
795
+ if (this.component === false) {
796
+ this.element.on({
797
+ 'focus.colorpicker': _jquery2.default.proxy(this.show, this)
798
+ });
799
+ }
800
+ if (this.options.inline === false) {
801
+ this.element.on({
802
+ 'focusout.colorpicker': _jquery2.default.proxy(this.hide, this)
803
+ });
804
+ }
805
+ }
806
+
807
+ if (this.component !== false) {
808
+ this.component.on({
809
+ 'click.colorpicker': _jquery2.default.proxy(this.show, this)
810
+ });
811
+ }
812
+
813
+ if (this.hasInput() === false && this.component === false && !this.element.has('.colorpicker')) {
814
+ this.element.on({
815
+ 'click.colorpicker': _jquery2.default.proxy(this.show, this)
816
+ });
817
+ }
818
+
819
+ // for HTML5 input[type='color']
820
+ if (this.hasInput() && this.component !== false && this.input.attr('type') === 'color') {
821
+ this.input.on({
822
+ 'click.colorpicker': _jquery2.default.proxy(this.show, this),
823
+ 'focus.colorpicker': _jquery2.default.proxy(this.show, this)
824
+ });
825
+ }
826
+
827
+ // Update if there is a color option
828
+ this.update(this.options.color !== false);
829
+
830
+ (0, _jquery2.default)(_jquery2.default.proxy(function () {
831
+ /**
832
+ * (Colorpicker) When the Colorpicker instance has been created and the DOM is ready.
833
+ *
834
+ * @event colorpickerCreate
835
+ */
836
+ this.element.trigger({
837
+ type: 'colorpickerCreate',
838
+ colorpicker: this,
839
+ color: this.color
840
+ });
841
+ }, this));
842
+ }
843
+
844
+ /**
845
+ * Creates and registers the given extension
846
+ *
847
+ * @param {String|Extension} extensionName
848
+ * @param {Extension} ExtensionClass
849
+ * @param {Object} [config]
850
+ * @returns {Extension}
851
+ */
852
+
853
+
854
+ _createClass(Colorpicker, [{
855
+ key: 'addExtension',
856
+ value: function addExtension(extensionName, ExtensionClass) {
857
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
858
+
859
+ var ext = extensionName instanceof _Extension2.default ? extensionName : new ExtensionClass(this, config);
860
+
861
+ this.extensions.push(ext);
862
+ return ext;
863
+ }
864
+
865
+ /**
866
+ * Destroys the current instance
867
+ *
868
+ * @fires colorpickerDestroy
869
+ */
870
+
871
+ }, {
872
+ key: 'destroy',
873
+ value: function destroy() {
874
+ this.picker.remove();
875
+ this.element.removeData('colorpicker', 'color').off('.colorpicker');
876
+ if (this.hasInput()) {
877
+ this.input.off('.colorpicker');
878
+ }
879
+ if (this.component !== false) {
880
+ this.component.off('.colorpicker');
881
+ }
882
+ this.element.removeClass('colorpicker-element');
883
+
884
+ /**
885
+ * (Colorpicker) When the instance is destroyed with all events unbound.
886
+ *
887
+ * @event colorpickerDestroy
888
+ */
889
+ this.element.trigger({
890
+ type: 'colorpickerDestroy',
891
+ colorpicker: this,
892
+ color: this.color
893
+ });
894
+ }
895
+
896
+ /**
897
+ * Returns true if the current color object is an instance of Color, false otherwise.
898
+ * @returns {boolean}
899
+ */
900
+
901
+ }, {
902
+ key: 'hasColor',
903
+ value: function hasColor() {
904
+ return this.color instanceof _Color2.default;
905
+ }
906
+
907
+ /**
908
+ * @returns {*|String|Color}
909
+ */
910
+
911
+ }, {
912
+ key: 'toInputColorString',
913
+
914
+
915
+ /**
916
+ * Formatted color string, with the formatting options applied
917
+ * (e.g. useHashPrefix)
918
+ * @returns {String}
919
+ */
920
+ value: function toInputColorString() {
921
+ var str = this.toCssColorString();
922
+
923
+ if (!str) {
924
+ return str;
925
+ }
926
+
927
+ if (this.options.useHashPrefix === false) {
928
+ str = str.replace(/^#/g, '');
929
+ }
930
+
931
+ return this._resolveColor(str);
932
+ }
933
+
934
+ /**
935
+ * Formatted color string, suitable for CSS
936
+ * @returns {String}
937
+ */
938
+
939
+ }, {
940
+ key: 'toCssColorString',
941
+ value: function toCssColorString() {
942
+ if (!this.hasColor()) {
943
+ return '';
944
+ }
945
+ return this.color.toString(this.format);
946
+ }
947
+
948
+ /**
949
+ * If the widget is not inside a container or inline, rearranges its position relative to its element offset.
950
+ *
951
+ * @param {Event} [e]
952
+ * @private
953
+ * @returns {boolean} Returns false if the widget is inside a container or inline, true otherwise
954
+ */
955
+
956
+ }, {
957
+ key: '_reposition',
958
+ value: function _reposition(e) {
959
+ this.lastEvent.name = 'reposition';
960
+ this.lastEvent.e = e;
961
+
962
+ if (this.options.inline !== false || this.options.container) {
963
+ return false;
964
+ }
965
+ var type = this.container && this.container[0] !== window.document.body ? 'position' : 'offset';
966
+ var element = this.component || this.element;
967
+ var offset = element[type]();
968
+
969
+ if (this.options.align === 'right') {
970
+ offset.left -= this.picker.outerWidth() - element.outerWidth();
971
+ }
972
+ this.picker.css({
973
+ top: offset.top + element.outerHeight(),
974
+ left: offset.left
975
+ });
976
+ return true;
977
+ }
978
+
979
+ /**
980
+ * Shows the colorpicker widget if hidden.
981
+ * If the input is disabled this call will be ignored.
982
+ *
983
+ * @fires colorpickerShow
984
+ * @param {Event} [e]
985
+ * @returns {boolean} True if was hidden and afterwards visible, false if nothing happened.
986
+ */
987
+
988
+ }, {
989
+ key: 'show',
990
+ value: function show(e) {
991
+ this.lastEvent.name = 'show';
992
+ this.lastEvent.e = e;
993
+
994
+ if (this.isVisible() || this.isDisabled()) {
995
+ // Don't show the widget if it's already visible or it is disabled
996
+ return false;
997
+ }
998
+ this.picker.addClass('colorpicker-visible').removeClass('colorpicker-hidden');
999
+
1000
+ this._reposition(e);
1001
+ (0, _jquery2.default)(window).on('resize.colorpicker', _jquery2.default.proxy(this._reposition, this));
1002
+
1003
+ if (e && (!this.hasInput() || this.input.attr('type') === 'color')) {
1004
+ if (e.stopPropagation && e.preventDefault) {
1005
+ e.stopPropagation();
1006
+ e.preventDefault();
1007
+ }
1008
+ }
1009
+ if ((this.component || !this.input) && this.options.inline === false) {
1010
+ (0, _jquery2.default)(window.document).on({
1011
+ 'mousedown.colorpicker': _jquery2.default.proxy(this.hide, this)
1012
+ });
1013
+ }
1014
+
1015
+ /**
1016
+ * (Colorpicker) When show() is called and the widget can be shown.
1017
+ *
1018
+ * @event colorpickerShow
1019
+ */
1020
+ this.element.trigger({
1021
+ type: 'colorpickerShow',
1022
+ colorpicker: this,
1023
+ color: this.color
1024
+ });
1025
+
1026
+ return true;
1027
+ }
1028
+
1029
+ /**
1030
+ * Hides the colorpicker widget.
1031
+ * Hide is prevented when it is triggered by an event whose target element has been clicked/touched.
1032
+ *
1033
+ * @fires colorpickerHide
1034
+ * @param {Event} [e]
1035
+ * @returns {boolean} True if was visible and afterwards hidden, false if nothing happened.
1036
+ */
1037
+
1038
+ }, {
1039
+ key: 'hide',
1040
+ value: function hide(e) {
1041
+ this.lastEvent.name = 'hide';
1042
+ this.lastEvent.e = e;
1043
+
1044
+ if (this.isHidden()) {
1045
+ // Do not trigger if already hidden
1046
+ return false;
1047
+ }
1048
+ if (typeof e !== 'undefined' && e.target) {
1049
+ // Prevent hide if triggered by an event and an element inside the colorpicker has been clicked/touched
1050
+ if ((0, _jquery2.default)(e.currentTarget).parents('.colorpicker').length > 0 || (0, _jquery2.default)(e.target).parents('.colorpicker').length > 0) {
1051
+ return false;
1052
+ }
1053
+ }
1054
+ this.picker.addClass('colorpicker-hidden').removeClass('colorpicker-visible');
1055
+ (0, _jquery2.default)(window).off('resize.colorpicker', this._reposition);
1056
+ (0, _jquery2.default)(window.document).off({
1057
+ 'mousedown.colorpicker': this.hide
1058
+ });
1059
+
1060
+ /**
1061
+ * (Colorpicker) When hide() is called and the widget can be hidden.
1062
+ *
1063
+ * @event colorpickerHide
1064
+ */
1065
+ this.element.trigger({
1066
+ type: 'colorpickerHide',
1067
+ colorpicker: this,
1068
+ color: this.color
1069
+ });
1070
+ return true;
1071
+ }
1072
+
1073
+ /**
1074
+ * Returns true if the colorpicker element has the colorpicker-visible class and not the colorpicker-hidden one.
1075
+ * False otherwise.
1076
+ *
1077
+ * @returns {boolean}
1078
+ */
1079
+
1080
+ }, {
1081
+ key: 'isVisible',
1082
+ value: function isVisible() {
1083
+ return this.picker.hasClass('colorpicker-visible') && !this.picker.hasClass('colorpicker-hidden');
1084
+ }
1085
+
1086
+ /**
1087
+ * Returns true if the colorpicker element has the colorpicker-hidden class and not the colorpicker-visible one.
1088
+ * False otherwise.
1089
+ *
1090
+ * @returns {boolean}
1091
+ */
1092
+
1093
+ }, {
1094
+ key: 'isHidden',
1095
+ value: function isHidden() {
1096
+ return this.picker.hasClass('colorpicker-hidden') && !this.picker.hasClass('colorpicker-visible');
1097
+ }
1098
+
1099
+ /**
1100
+ * If the input element is present, it updates the value with the current color object color string.
1101
+ * If value is set, this method fires a "change" event on the input element.
1102
+ *
1103
+ * @fires change
1104
+ * @private
1105
+ */
1106
+
1107
+ }, {
1108
+ key: '_updateInput',
1109
+ value: function _updateInput() {
1110
+ if (this.hasInput()) {
1111
+ var val = this.toInputColorString();
1112
+
1113
+ if (val === this.input.prop('value')) {
1114
+ // No need to set value or trigger any event if nothing changed
1115
+ return;
1116
+ }
1117
+
1118
+ this.input.prop('value', val ? val : '');
1119
+
1120
+ /**
1121
+ * (Input) Triggered on the input element when a new color is selected.
1122
+ *
1123
+ * @event change
1124
+ */
1125
+ this.input.trigger({
1126
+ type: 'change',
1127
+ colorpicker: this,
1128
+ color: this.color,
1129
+ value: val
1130
+ });
1131
+ }
1132
+ }
1133
+
1134
+ /**
1135
+ * Changes the color adjustment bars using the current color object information.
1136
+ * @private
1137
+ */
1138
+
1139
+ }, {
1140
+ key: '_updatePicker',
1141
+ value: function _updatePicker() {
1142
+ if (!this.hasColor()) {
1143
+ return;
1144
+ }
1145
+
1146
+ var vertical = this.options.horizontal === false,
1147
+ sl = vertical ? this.options.sliders : this.options.slidersHorz;
1148
+
1149
+ var saturationGuide = this.picker.find('.colorpicker-saturation .colorpicker-guide'),
1150
+ hueGuide = this.picker.find('.colorpicker-hue .colorpicker-guide'),
1151
+ alphaGuide = this.picker.find('.colorpicker-alpha .colorpicker-guide');
1152
+
1153
+ var hsva = this.color.hsvaRatio;
1154
+
1155
+ if (hueGuide.length) {
1156
+ hueGuide.css(vertical ? 'top' : 'left', (vertical ? sl.hue.maxTop : sl.hue.maxLeft) * (1 - hsva.h));
1157
+ }
1158
+
1159
+ if (alphaGuide.length) {
1160
+ alphaGuide.css(vertical ? 'top' : 'left', (vertical ? sl.alpha.maxTop : sl.alpha.maxLeft) * (1 - hsva.a));
1161
+ }
1162
+
1163
+ if (saturationGuide.length) {
1164
+ saturationGuide.css({
1165
+ 'top': sl.saturation.maxTop - hsva.v * sl.saturation.maxTop,
1166
+ 'left': hsva.s * sl.saturation.maxLeft
1167
+ });
1168
+ }
1169
+
1170
+ this.picker.find('.colorpicker-saturation').css('backgroundColor', this.color.getHueOnlyCopy().toHexString()); // we only need hue
1171
+
1172
+ this.picker.find('.colorpicker-alpha').css('backgroundColor', this.color.toString('hex6')); // we don't need alpha
1173
+ }
1174
+
1175
+ /**
1176
+ * If the component element is present, its background color is updated
1177
+ * @private
1178
+ */
1179
+
1180
+ }, {
1181
+ key: '_updateComponent',
1182
+ value: function _updateComponent() {
1183
+ if (!this.hasColor()) {
1184
+ return;
1185
+ }
1186
+
1187
+ if (this.component !== false) {
1188
+ var icn = this.component.find('i').eq(0);
1189
+
1190
+ if (icn.length > 0) {
1191
+ icn.css({
1192
+ 'backgroundColor': this.toCssColorString()
1193
+ });
1194
+ } else {
1195
+ this.component.css({
1196
+ 'backgroundColor': this.toCssColorString()
1197
+ });
1198
+ }
1199
+ }
1200
+ }
1201
+
1202
+ /**
1203
+ * @private
1204
+ * @returns {boolean}
1205
+ */
1206
+
1207
+ }, {
1208
+ key: '_shouldUpdate',
1209
+ value: function _shouldUpdate() {
1210
+ return this.hasColor() && this.getValue(false) !== false;
1211
+ }
1212
+
1213
+ /**
1214
+ * Updated the component color, the input value and the widget if a color is present.
1215
+ *
1216
+ * If force is true, it is updated anyway.
1217
+ *
1218
+ * @fires colorpickerUpdate
1219
+ * @param {boolean} [force]
1220
+ */
1221
+
1222
+ }, {
1223
+ key: 'update',
1224
+ value: function update() {
1225
+ var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1226
+
1227
+ if (this._shouldUpdate() || force === true) {
1228
+ // Update only if the current value (from input or data) is not empty
1229
+ this._updateComponent();
1230
+
1231
+ // Do not update input when autoInputFallback is disabled and last event is keyup.
1232
+ var preventInputUpdate = this.options.autoInputFallback !== true &&
1233
+ // this.isInvalidColor() || // prevent also on invalid color (on create, leaves invalid colors)
1234
+ this.lastEvent.name === 'keyup';
1235
+
1236
+ if (!preventInputUpdate) {
1237
+ this._updateInput();
1238
+ }
1239
+
1240
+ this._updatePicker();
1241
+
1242
+ /**
1243
+ * (Colorpicker) Fired when the widget is updated.
1244
+ *
1245
+ * @event colorpickerUpdate
1246
+ */
1247
+ this.element.trigger({
1248
+ type: 'colorpickerUpdate',
1249
+ colorpicker: this,
1250
+ color: this.color
1251
+ });
1252
+ }
1253
+ }
1254
+
1255
+ /**
1256
+ * Returns the color string from the input value or the 'data-color' attribute of the input or element.
1257
+ * If empty, it returns the defaultValue parameter.
1258
+ *
1259
+ * @param {String|*} [defaultValue]
1260
+ * @returns {String|*}
1261
+ */
1262
+
1263
+ }, {
1264
+ key: 'getValue',
1265
+ value: function getValue() {
1266
+ var defaultValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1267
+
1268
+ defaultValue = typeof defaultValue === 'undefined' ? this.fallbackColor : defaultValue;
1269
+ var candidates = [],
1270
+ val = false;
1271
+
1272
+ if (this.hasInput()) {
1273
+ candidates.push(this.input.val());
1274
+ candidates.push(this.input.data('color'));
1275
+ }
1276
+ candidates.push(this.element.data('color'));
1277
+
1278
+ candidates.map(function (item) {
1279
+ if (item && val === false) {
1280
+ val = item;
1281
+ }
1282
+ });
1283
+
1284
+ val = val === false ? defaultValue : val;
1285
+
1286
+ if (val instanceof _Color2.default) {
1287
+ return val.toString(this.format);
1288
+ }
1289
+
1290
+ return val;
1291
+ }
1292
+
1293
+ /**
1294
+ * Sets the color manually
1295
+ *
1296
+ * @fires colorpickerChange
1297
+ * @param {String|Color} val
1298
+ */
1299
+
1300
+ }, {
1301
+ key: 'setValue',
1302
+ value: function setValue(val) {
1303
+ if (this.hasColor() && this.color.equals(val)) {
1304
+ // equal color object
1305
+ return;
1306
+ }
1307
+
1308
+ var color = val ? this.createColor(val) : false;
1309
+
1310
+ if (!this.hasColor() && !color) {
1311
+ // color was empty and the new one too
1312
+ return;
1313
+ }
1314
+
1315
+ // force update if color is changed to empty
1316
+ var shouldForceUpdate = this.hasColor() && !color;
1317
+
1318
+ this.color = color;
1319
+
1320
+ /**
1321
+ * (Colorpicker) When the color is set programmatically with setValue().
1322
+ *
1323
+ * @event colorpickerChange
1324
+ */
1325
+ this.element.trigger({
1326
+ type: 'colorpickerChange',
1327
+ colorpicker: this,
1328
+ color: this.color,
1329
+ value: val
1330
+ });
1331
+
1332
+ // force update if color has changed to empty
1333
+ this.update(shouldForceUpdate);
1334
+ }
1335
+
1336
+ /**
1337
+ * Creates a new color using the widget instance options (fallbackColor, format).
1338
+ *
1339
+ * @fires colorpickerInvalid
1340
+ * @param {*} val
1341
+ * @param {boolean} useFallback
1342
+ * @returns {Color}
1343
+ */
1344
+
1345
+ }, {
1346
+ key: 'createColor',
1347
+ value: function createColor(val) {
1348
+ var useFallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1349
+
1350
+ var color = new _Color2.default(this._resolveColor(val), { format: this.format });
1351
+
1352
+ if (!color.isValid()) {
1353
+ var invalidColor = color,
1354
+ fallback = void 0;
1355
+
1356
+ if (useFallback) {
1357
+ fallback = this.fallbackColor instanceof _Color2.default && this.fallbackColor.isValid() ? this.fallbackColor : this._resolveColor(this.fallbackColor);
1358
+
1359
+ color = new _Color2.default(fallback, { format: this.format });
1360
+
1361
+ if (!color.isValid() && useFallback) {
1362
+ throw new Error('The fallback color is invalid.');
1363
+ }
1364
+ }
1365
+
1366
+ color.previous = invalidColor;
1367
+
1368
+ /**
1369
+ * (Colorpicker) Fired when the color is invalid and the fallback color is going to be used.
1370
+ *
1371
+ * @event colorpickerInvalid
1372
+ */
1373
+ this.element.trigger({
1374
+ type: 'colorpickerInvalid',
1375
+ colorpicker: this,
1376
+ color: color,
1377
+ value: val
1378
+ });
1379
+ }
1380
+
1381
+ if (!this.isAlphaEnabled() && color.hasTransparency()) {
1382
+ // Alpha is disabled
1383
+ color.setAlpha(1);
1384
+ }
1385
+
1386
+ if (!this.hasColor()) {
1387
+ // No previous color, so no need to compare
1388
+ return color;
1389
+ }
1390
+
1391
+ var hsva = color.hsvaRatio;
1392
+ var prevHsva = this.color.hsvaRatio;
1393
+
1394
+ if (hsva.s === 0 && hsva.h === 0 && prevHsva.h !== 0) {
1395
+ // Hue was set to 0 because saturation was 0, use previous hue, since it was not meant to change...
1396
+ color.setHueRatio(prevHsva.h);
1397
+ }
1398
+
1399
+ if (!this.isAlphaEnabled() && color.hasTransparency()) {
1400
+ // Alpha is disabled
1401
+ color.setAlpha(1);
1402
+ }
1403
+
1404
+ return color;
1405
+ }
1406
+
1407
+ /**
1408
+ * Checks if there is a color object, that it is valid and it is not a fallback
1409
+ * @returns {boolean}
1410
+ */
1411
+
1412
+ }, {
1413
+ key: 'isInvalidColor',
1414
+ value: function isInvalidColor() {
1415
+ return !this.hasColor() || !this.color.isValid() || !!this.color.previous;
1416
+ }
1417
+
1418
+ /**
1419
+ * Returns true if the useAlpha option is exactly true, false otherwise
1420
+ * @returns {boolean}
1421
+ */
1422
+
1423
+ }, {
1424
+ key: 'isAlphaEnabled',
1425
+ value: function isAlphaEnabled() {
1426
+ return this.options.useAlpha === true;
1427
+ }
1428
+
1429
+ /**
1430
+ * Resolves a color, in case is not in a standard format (e.g. a custom color alias)
1431
+ *
1432
+ * @private
1433
+ * @param {String|*} color
1434
+ * @returns {String|*|null}
1435
+ */
1436
+
1437
+ }, {
1438
+ key: '_resolveColor',
1439
+ value: function _resolveColor(color) {
1440
+ var extResolvedColor = false;
1441
+
1442
+ _jquery2.default.each(this.extensions, function (name, ext) {
1443
+ if (extResolvedColor !== false) {
1444
+ // skip if resolved
1445
+ return;
1446
+ }
1447
+ extResolvedColor = ext.resolveColor(color);
1448
+ });
1449
+
1450
+ if (extResolvedColor !== false) {
1451
+ color = extResolvedColor;
1452
+ }
1453
+
1454
+ return color;
1455
+ }
1456
+
1457
+ /**
1458
+ * Returns true if the widget has an associated input element, false otherwise
1459
+ * @returns {boolean}
1460
+ */
1461
+
1462
+ }, {
1463
+ key: 'hasInput',
1464
+ value: function hasInput() {
1465
+ return this.input !== false;
1466
+ }
1467
+
1468
+ /**
1469
+ * Returns true if this instance is disabled
1470
+ * @returns {boolean}
1471
+ */
1472
+
1473
+ }, {
1474
+ key: 'isDisabled',
1475
+ value: function isDisabled() {
1476
+ return this.disabled === true;
1477
+ }
1478
+
1479
+ /**
1480
+ * Disables the widget and the input if any
1481
+ *
1482
+ * @fires colorpickerDisable
1483
+ * @returns {boolean}
1484
+ */
1485
+
1486
+ }, {
1487
+ key: 'disable',
1488
+ value: function disable() {
1489
+ if (this.hasInput()) {
1490
+ this.input.prop('disabled', true);
1491
+ }
1492
+ this.disabled = true;
1493
+
1494
+ /**
1495
+ * (Colorpicker) When the widget has been disabled.
1496
+ *
1497
+ * @event colorpickerDisable
1498
+ */
1499
+ this.element.trigger({
1500
+ type: 'colorpickerDisable',
1501
+ colorpicker: this,
1502
+ color: this.color
1503
+ });
1504
+ return true;
1505
+ }
1506
+
1507
+ /**
1508
+ * Enables the widget and the input if any
1509
+ *
1510
+ * @fires colorpickerEnable
1511
+ * @returns {boolean}
1512
+ */
1513
+
1514
+ }, {
1515
+ key: 'enable',
1516
+ value: function enable() {
1517
+ if (this.hasInput()) {
1518
+ this.input.prop('disabled', false);
1519
+ }
1520
+ this.disabled = false;
1521
+
1522
+ /**
1523
+ * (Colorpicker) When the widget has been enabled.
1524
+ *
1525
+ * @event colorpickerEnable
1526
+ */
1527
+ this.element.trigger({
1528
+ type: 'colorpickerEnable',
1529
+ colorpicker: this,
1530
+ color: this.color
1531
+ });
1532
+ return true;
1533
+ }
1534
+
1535
+ /**
1536
+ * Function triggered when clicking in one of the color adjustment bars
1537
+ *
1538
+ * @private
1539
+ * @fires mousemove
1540
+ * @param {Event} e
1541
+ * @returns {boolean}
1542
+ */
1543
+
1544
+ }, {
1545
+ key: '_mousedown',
1546
+ value: function _mousedown(e) {
1547
+ this.lastEvent.name = 'mousedown';
1548
+ this.lastEvent.e = e;
1549
+
1550
+ if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {
1551
+ e.pageX = e.originalEvent.touches[0].pageX;
1552
+ e.pageY = e.originalEvent.touches[0].pageY;
1553
+ }
1554
+ e.stopPropagation();
1555
+ e.preventDefault();
1556
+
1557
+ var target = (0, _jquery2.default)(e.target);
1558
+
1559
+ // detect the slider and set the limits and callbacks
1560
+ var zone = target.closest('div');
1561
+ var sl = this.options.horizontal ? this.options.slidersHorz : this.options.sliders;
1562
+
1563
+ if (!zone.is('.colorpicker')) {
1564
+ if (zone.is('.colorpicker-saturation')) {
1565
+ this.currentSlider = _jquery2.default.extend({}, sl.saturation);
1566
+ } else if (zone.is('.colorpicker-hue')) {
1567
+ this.currentSlider = _jquery2.default.extend({}, sl.hue);
1568
+ } else if (zone.is('.colorpicker-alpha')) {
1569
+ this.currentSlider = _jquery2.default.extend({}, sl.alpha);
1570
+ } else {
1571
+ return false;
1572
+ }
1573
+ var offset = zone.offset();
1574
+ // reference to guide's style
1575
+
1576
+ this.currentSlider.guide = zone.find('.colorpicker-guide')[0].style;
1577
+ this.currentSlider.left = e.pageX - offset.left;
1578
+ this.currentSlider.top = e.pageY - offset.top;
1579
+ this.mousePointer = {
1580
+ left: e.pageX,
1581
+ top: e.pageY
1582
+ };
1583
+
1584
+ /**
1585
+ * (window.document) Triggered on mousedown for the document object,
1586
+ * so the color adjustment guide is moved to the clicked position.
1587
+ *
1588
+ * @event mousemove
1589
+ */
1590
+ (0, _jquery2.default)(window.document).on({
1591
+ 'mousemove.colorpicker': _jquery2.default.proxy(this._mousemove, this),
1592
+ 'touchmove.colorpicker': _jquery2.default.proxy(this._mousemove, this),
1593
+ 'mouseup.colorpicker': _jquery2.default.proxy(this._mouseup, this),
1594
+ 'touchend.colorpicker': _jquery2.default.proxy(this._mouseup, this)
1595
+ }).trigger('mousemove');
1596
+ }
1597
+ return false;
1598
+ }
1599
+
1600
+ /**
1601
+ * Function triggered when dragging a guide inside one of the color adjustment bars.
1602
+ *
1603
+ * @private
1604
+ * @param {Event} e
1605
+ * @returns {boolean}
1606
+ */
1607
+
1608
+ }, {
1609
+ key: '_mousemove',
1610
+ value: function _mousemove(e) {
1611
+ this.lastEvent.name = 'mousemove';
1612
+ this.lastEvent.e = e;
1613
+
1614
+ var color = !this.hasColor() ? this.createColor(this.fallbackColor) : this.color.getCopy();
1615
+
1616
+ if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {
1617
+ e.pageX = e.originalEvent.touches[0].pageX;
1618
+ e.pageY = e.originalEvent.touches[0].pageY;
1619
+ }
1620
+ e.stopPropagation();
1621
+ e.preventDefault();
1622
+ var left = Math.max(0, Math.min(this.currentSlider.maxLeft, this.currentSlider.left + ((e.pageX || this.mousePointer.left) - this.mousePointer.left)));
1623
+ var top = Math.max(0, Math.min(this.currentSlider.maxTop, this.currentSlider.top + ((e.pageY || this.mousePointer.top) - this.mousePointer.top)));
1624
+
1625
+ this.currentSlider.guide.left = left + 'px';
1626
+ this.currentSlider.guide.top = top + 'px';
1627
+ if (this.currentSlider.callLeft) {
1628
+ color[this.currentSlider.callLeft].call(color, left / this.currentSlider.maxLeft);
1629
+ }
1630
+ if (this.currentSlider.callTop) {
1631
+ color[this.currentSlider.callTop].call(color, top / this.currentSlider.maxTop);
1632
+ }
1633
+
1634
+ this.setValue(color);
1635
+ return false;
1636
+ }
1637
+
1638
+ /**
1639
+ * Function triggered when releasing the click in one of the color adjustment bars.
1640
+ *
1641
+ * @private
1642
+ * @param {Event} e
1643
+ * @returns {boolean}
1644
+ */
1645
+
1646
+ }, {
1647
+ key: '_mouseup',
1648
+ value: function _mouseup(e) {
1649
+ this.lastEvent.name = 'mouseup';
1650
+ this.lastEvent.e = e;
1651
+
1652
+ e.stopPropagation();
1653
+ e.preventDefault();
1654
+ (0, _jquery2.default)(window.document).off({
1655
+ 'mousemove.colorpicker': this._mousemove,
1656
+ 'touchmove.colorpicker': this._mousemove,
1657
+ 'mouseup.colorpicker': this._mouseup,
1658
+ 'touchend.colorpicker': this._mouseup
1659
+ });
1660
+ return false;
1661
+ }
1662
+
1663
+ /**
1664
+ * Function triggered when the input has changed, so the colorpicker gets updated.
1665
+ *
1666
+ * @private
1667
+ * @param {Event} e
1668
+ * @returns {boolean}
1669
+ */
1670
+
1671
+ }, {
1672
+ key: '_change',
1673
+ value: function _change(e) {
1674
+ this.lastEvent.name = 'change';
1675
+ this.lastEvent.e = e;
1676
+
1677
+ var val = this.input.val();
1678
+
1679
+ if (val !== this.toInputColorString()) {
1680
+ this.setValue(val);
1681
+ }
1682
+ }
1683
+
1684
+ /**
1685
+ * Function triggered after a keyboard key has been released.
1686
+ *
1687
+ * @private
1688
+ * @param {Event} e
1689
+ * @returns {boolean}
1690
+ */
1691
+
1692
+ }, {
1693
+ key: '_keyup',
1694
+ value: function _keyup(e) {
1695
+ this.lastEvent.name = 'keyup';
1696
+ this.lastEvent.e = e;
1697
+
1698
+ var val = this.input.val();
1699
+
1700
+ if (val !== this.toInputColorString()) {
1701
+ this.setValue(val);
1702
+ }
1703
+ }
1704
+ }, {
1705
+ key: 'fallbackColor',
1706
+ get: function get() {
1707
+ return this.options.fallbackColor ? this.options.fallbackColor : this.hasColor() ? this.color : '#000';
1708
+ }
1709
+ }, {
1710
+ key: 'format',
1711
+ get: function get() {
1712
+ if (this.options.format) {
1713
+ return this.options.format;
1714
+ }
1715
+
1716
+ if (this.hasColor() && this.color.hasTransparency() && this.color.format.match(/^hex/)) {
1717
+ return this.options.enableHex8 ? 'hex8' : this.isAlphaEnabled() ? 'rgba' : 'hex';
1718
+ }
1719
+
1720
+ if (this.hasColor()) {
1721
+ return this.color.format;
1722
+ }
1723
+
1724
+ return null;
1725
+ }
1726
+ }]);
1727
+
1728
+ return Colorpicker;
1729
+ }();
1730
+
1731
+ exports.default = Colorpicker;
1732
+
1733
+ /***/ }),
1734
+ /* 5 */
1735
+ /***/ (function(module, exports, __webpack_require__) {
1736
+
1737
+ "use strict";
1738
+
1739
+
1740
+ Object.defineProperty(exports, "__esModule", {
1741
+ value: true
1742
+ });
1743
+
1744
+ var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
1745
+
1746
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1747
+
1748
+ var _tinycolor2 = __webpack_require__(6);
1749
+
1750
+ var _tinycolor3 = _interopRequireDefault(_tinycolor2);
1751
+
1752
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1753
+
1754
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1755
+
1756
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1757
+
1758
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
1759
+
1760
+ function unwrapColor(color) {
1761
+ if (color instanceof _tinycolor3.default) {
1762
+ return {
1763
+ r: color._r,
1764
+ g: color._g,
1765
+ b: color._b,
1766
+ a: color._a
1767
+ };
1768
+ }
1769
+ return color;
1770
+ }
1771
+
1772
+ /**
1773
+ * Sanitizes a format string, so it is compatible with tinycolor,
1774
+ * or returns the same value if it is not a string.
1775
+ *
1776
+ * @param {String} format
1777
+ * @returns {String|*}
1778
+ * @private
1779
+ */
1780
+ function getCompatibleFormat(format) {
1781
+ if (format instanceof String || typeof format === 'string') {
1782
+ return format.replace(/a$/gi, '');
1783
+ }
1784
+
1785
+ return format;
1786
+ }
1787
+
1788
+ /**
1789
+ * Color manipulation class that extends the tinycolor library class.
1790
+ */
1791
+
1792
+ var Color = function (_tinycolor) {
1793
+ _inherits(Color, _tinycolor);
1794
+
1795
+ _createClass(Color, [{
1796
+ key: 'id',
1797
+
1798
+ /**
1799
+ * Identifier of the color instance.
1800
+ *
1801
+ * @type {int}
1802
+ * @readonly
1803
+ */
1804
+ get: function get() {
1805
+ return this._tc_id;
1806
+ }
1807
+
1808
+ /**
1809
+ * Format of the parsed color.
1810
+ *
1811
+ * @type {String}
1812
+ * @readonly
1813
+ */
1814
+
1815
+ }, {
1816
+ key: 'format',
1817
+ get: function get() {
1818
+ return this._format;
1819
+ }
1820
+
1821
+ /**
1822
+ * All options of the current instance.
1823
+ *
1824
+ * @type {{format: String, gradientType: String}}
1825
+ * @readonly
1826
+ */
1827
+
1828
+ }, {
1829
+ key: 'options',
1830
+ get: function get() {
1831
+ return {
1832
+ format: this._format,
1833
+ gradientType: this._gradientType
1834
+ };
1835
+ }
1836
+
1837
+ /**
1838
+ * @returns {{h, s, v, a}}
1839
+ */
1840
+
1841
+ }, {
1842
+ key: 'hsva',
1843
+ get: function get() {
1844
+ return this.toHsv();
1845
+ }
1846
+
1847
+ /**
1848
+ * @returns {{h, s, v, a}}
1849
+ */
1850
+
1851
+ }, {
1852
+ key: 'hsvaRatio',
1853
+ get: function get() {
1854
+ var hsv = this.hsva;
1855
+
1856
+ return {
1857
+ h: hsv.h / 360,
1858
+ s: hsv.s,
1859
+ v: hsv.v,
1860
+ a: hsv.a
1861
+ };
1862
+ }
1863
+
1864
+ /**
1865
+ * foo bar
1866
+ * @param {Color|*} color
1867
+ * @param {{format}} [options]
1868
+ * @constructor
1869
+ */
1870
+
1871
+ }]);
1872
+
1873
+ function Color(color) {
1874
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { format: null };
1875
+
1876
+ _classCallCheck(this, Color);
1877
+
1878
+ if (options.format) {
1879
+ options.format = getCompatibleFormat(options.format);
1880
+ }
1881
+
1882
+ /**
1883
+ * @type {Color|*}
1884
+ */
1885
+ var _this = _possibleConstructorReturn(this, (Color.__proto__ || Object.getPrototypeOf(Color)).call(this, unwrapColor(color), options));
1886
+
1887
+ _this._originalInput = color; // keep real original color
1888
+ /**
1889
+ * Hue backup to not lose the information when saturation is 0.
1890
+ * @type {number}
1891
+ */
1892
+ _this._hbak = _this.hsva.h;
1893
+ /**
1894
+ * If set, it contains a reference to a previous color that caused the creation of this one.
1895
+ * @type {Color}
1896
+ */
1897
+ _this.previous = null;
1898
+ return _this;
1899
+ }
1900
+
1901
+ /**
1902
+ * Compares a color object with this one and returns true if it is equal or false if not.
1903
+ *
1904
+ * @param {Color} color
1905
+ * @returns {boolean}
1906
+ */
1907
+
1908
+
1909
+ _createClass(Color, [{
1910
+ key: 'equals',
1911
+ value: function equals(color) {
1912
+ if (!(color instanceof _tinycolor3.default)) {
1913
+ return false;
1914
+ }
1915
+ return this._r === color._r && this._g === color._g && this._b === color._b && this._a === color._a && this._roundA === color._roundA && this._format === color._format && this._gradientType === color._gradientType && this._ok === color._ok;
1916
+ }
1917
+
1918
+ /**
1919
+ * Imports all variables of the given color to this instance, excepting `_tc_id`.
1920
+ * @param {Color} color
1921
+ */
1922
+
1923
+ }, {
1924
+ key: 'importColor',
1925
+ value: function importColor(color) {
1926
+ if (!(color instanceof _tinycolor3.default)) {
1927
+ throw new Error('Color.importColor: The color argument is not an instance of tinycolor.');
1928
+ }
1929
+ this._originalInput = color._originalInput;
1930
+ this._r = color._r;
1931
+ this._g = color._g;
1932
+ this._b = color._b;
1933
+ this._a = color._a;
1934
+ this._roundA = color._roundA;
1935
+ this._format = getCompatibleFormat(color._format);
1936
+ this._gradientType = color._gradientType;
1937
+ this._ok = color._ok;
1938
+ // omit .previous and ._tc_id import
1939
+ }
1940
+
1941
+ /**
1942
+ * Imports the _r, _g, _b, _a, _hbak and _ok variables of the given color to this instance.
1943
+ * @param {Color} color
1944
+ */
1945
+
1946
+ }, {
1947
+ key: 'importRgb',
1948
+ value: function importRgb(color) {
1949
+ if (!color instanceof Color) {
1950
+ throw new Error('Color.importColor: The color argument is not an instance of tinycolor.');
1951
+ }
1952
+ this._r = color._r;
1953
+ this._g = color._g;
1954
+ this._b = color._b;
1955
+ this._a = color._a;
1956
+ this._ok = color._ok;
1957
+ this._hbak = color._hbak;
1958
+ }
1959
+
1960
+ /**
1961
+ * @param {{h,s,v,a}} hsv
1962
+ */
1963
+
1964
+ }, {
1965
+ key: 'importHsv',
1966
+ value: function importHsv(hsv) {
1967
+ this._hbak = hsv.h;
1968
+ this.importRgb(new Color(hsv, this.options));
1969
+ }
1970
+
1971
+ /**
1972
+ * @returns {Color}
1973
+ */
1974
+
1975
+ }, {
1976
+ key: 'getCopy',
1977
+ value: function getCopy() {
1978
+ return new Color(this.hsva, this.options);
1979
+ }
1980
+
1981
+ /**
1982
+ * @returns {Color}
1983
+ */
1984
+
1985
+ }, {
1986
+ key: 'getHueOnlyCopy',
1987
+ value: function getHueOnlyCopy() {
1988
+ return new Color({ h: this._hbak ? this._hbak : this.hsva.h, s: 100, v: 100 }, this.options);
1989
+ }
1990
+
1991
+ /**
1992
+ * @returns {Color}
1993
+ */
1994
+
1995
+ }, {
1996
+ key: 'getOpaqueCopy',
1997
+ value: function getOpaqueCopy() {
1998
+ return new Color(Object.assign({}, this.hsva, { a: 1 }), this.options);
1999
+ }
2000
+
2001
+ /**
2002
+ * @param {number} h Degrees from 0 to 360
2003
+ */
2004
+
2005
+ }, {
2006
+ key: 'setHue',
2007
+ value: function setHue(h) {
2008
+ this.importHsv(Object.assign({}, this.hsva, { h: h }));
2009
+ }
2010
+
2011
+ /**
2012
+ * @param {number} s Percent from 0 o 100
2013
+ */
2014
+
2015
+ }, {
2016
+ key: 'setSaturation',
2017
+ value: function setSaturation(s) {
2018
+ this.importHsv(Object.assign({}, this.hsva, { s: s }));
2019
+ }
2020
+
2021
+ /**
2022
+ * @param {number} v Percent from 0 o 100
2023
+ */
2024
+
2025
+ }, {
2026
+ key: 'setBrightness',
2027
+ value: function setBrightness(v) {
2028
+ this.importHsv(Object.assign({}, this.hsva, { v: v }));
2029
+ }
2030
+
2031
+ /**
2032
+ * @param {number} h Ratio from 0.0 to 1.0
2033
+ */
2034
+
2035
+ }, {
2036
+ key: 'setHueRatio',
2037
+ value: function setHueRatio(h) {
2038
+ if (h === 0) {
2039
+ return;
2040
+ }
2041
+ this.setHue((1 - h) * 360);
2042
+ }
2043
+
2044
+ /**
2045
+ * @param {number} s Ratio from 0.0 to 1.0
2046
+ */
2047
+
2048
+ }, {
2049
+ key: 'setSaturationRatio',
2050
+ value: function setSaturationRatio(s) {
2051
+ this.setSaturation(s);
2052
+ }
2053
+
2054
+ /**
2055
+ * @param {number} v Ratio from 0.0 to 1.0
2056
+ */
2057
+
2058
+ }, {
2059
+ key: 'setBrightnessRatio',
2060
+ value: function setBrightnessRatio(v) {
2061
+ this.setBrightness(1 - v);
2062
+ }
2063
+
2064
+ /**
2065
+ * @param {number} a Ratio from 0.0 to 1.0
2066
+ */
2067
+
2068
+ }, {
2069
+ key: 'setAlphaRatio',
2070
+ value: function setAlphaRatio(a) {
2071
+ this.setAlpha(1 - a);
2072
+ }
2073
+
2074
+ /**
2075
+ * @returns {boolean}
2076
+ */
2077
+
2078
+ }, {
2079
+ key: 'isTransparent',
2080
+ value: function isTransparent() {
2081
+ return this._a === 0;
2082
+ }
2083
+
2084
+ /**
2085
+ * @returns {boolean}
2086
+ */
2087
+
2088
+ }, {
2089
+ key: 'hasTransparency',
2090
+ value: function hasTransparency() {
2091
+ return this._a !== 1;
2092
+ }
2093
+
2094
+ /**
2095
+ * @param {string|null} [format] One of "rgb", "prgb", "hex"/"hex6", "hex3", "hex8", "hsl", "hsv"/"hsb", "name"
2096
+ * @returns {String}
2097
+ */
2098
+
2099
+ }, {
2100
+ key: 'toString',
2101
+ value: function toString() {
2102
+ var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
2103
+
2104
+ format = format ? getCompatibleFormat(format) : this.format;
2105
+
2106
+ var colorStr = _get(Color.prototype.__proto__ || Object.getPrototypeOf(Color.prototype), 'toString', this).call(this, format);
2107
+
2108
+ if (colorStr && colorStr.match(/^#[0-9a-f]{3,8}$/i)) {
2109
+ // Support transparent for hex formats
2110
+ if (this.isTransparent() && this._r === 0 && this._g === 0 && this._b === 0) {
2111
+ return 'transparent';
2112
+ }
2113
+ }
2114
+
2115
+ return colorStr;
2116
+ }
2117
+ }]);
2118
+
2119
+ return Color;
2120
+ }(_tinycolor3.default);
2121
+
2122
+ exports.default = Color;
2123
+
2124
+ /***/ }),
2125
+ /* 6 */
2126
+ /***/ (function(module, exports, __webpack_require__) {
2127
+
2128
+ var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.1
2129
+ // https://github.com/bgrins/TinyColor
2130
+ // Brian Grinstead, MIT License
2131
+
2132
+ (function(Math) {
2133
+
2134
+ var trimLeft = /^\s+/,
2135
+ trimRight = /\s+$/,
2136
+ tinyCounter = 0,
2137
+ mathRound = Math.round,
2138
+ mathMin = Math.min,
2139
+ mathMax = Math.max,
2140
+ mathRandom = Math.random;
2141
+
2142
+ function tinycolor (color, opts) {
2143
+
2144
+ color = (color) ? color : '';
2145
+ opts = opts || { };
2146
+
2147
+ // If input is already a tinycolor, return itself
2148
+ if (color instanceof tinycolor) {
2149
+ return color;
2150
+ }
2151
+ // If we are called as a function, call using new instead
2152
+ if (!(this instanceof tinycolor)) {
2153
+ return new tinycolor(color, opts);
2154
+ }
2155
+
2156
+ var rgb = inputToRGB(color);
2157
+ this._originalInput = color,
2158
+ this._r = rgb.r,
2159
+ this._g = rgb.g,
2160
+ this._b = rgb.b,
2161
+ this._a = rgb.a,
2162
+ this._roundA = mathRound(100*this._a) / 100,
2163
+ this._format = opts.format || rgb.format;
2164
+ this._gradientType = opts.gradientType;
2165
+
2166
+ // Don't let the range of [0,255] come back in [0,1].
2167
+ // Potentially lose a little bit of precision here, but will fix issues where
2168
+ // .5 gets interpreted as half of the total, instead of half of 1
2169
+ // If it was supposed to be 128, this was already taken care of by `inputToRgb`
2170
+ if (this._r < 1) { this._r = mathRound(this._r); }
2171
+ if (this._g < 1) { this._g = mathRound(this._g); }
2172
+ if (this._b < 1) { this._b = mathRound(this._b); }
2173
+
2174
+ this._ok = rgb.ok;
2175
+ this._tc_id = tinyCounter++;
2176
+ }
2177
+
2178
+ tinycolor.prototype = {
2179
+ isDark: function() {
2180
+ return this.getBrightness() < 128;
2181
+ },
2182
+ isLight: function() {
2183
+ return !this.isDark();
2184
+ },
2185
+ isValid: function() {
2186
+ return this._ok;
2187
+ },
2188
+ getOriginalInput: function() {
2189
+ return this._originalInput;
2190
+ },
2191
+ getFormat: function() {
2192
+ return this._format;
2193
+ },
2194
+ getAlpha: function() {
2195
+ return this._a;
2196
+ },
2197
+ getBrightness: function() {
2198
+ //http://www.w3.org/TR/AERT#color-contrast
2199
+ var rgb = this.toRgb();
2200
+ return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
2201
+ },
2202
+ getLuminance: function() {
2203
+ //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
2204
+ var rgb = this.toRgb();
2205
+ var RsRGB, GsRGB, BsRGB, R, G, B;
2206
+ RsRGB = rgb.r/255;
2207
+ GsRGB = rgb.g/255;
2208
+ BsRGB = rgb.b/255;
2209
+
2210
+ if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
2211
+ if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
2212
+ if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
2213
+ return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
2214
+ },
2215
+ setAlpha: function(value) {
2216
+ this._a = boundAlpha(value);
2217
+ this._roundA = mathRound(100*this._a) / 100;
2218
+ return this;
2219
+ },
2220
+ toHsv: function() {
2221
+ var hsv = rgbToHsv(this._r, this._g, this._b);
2222
+ return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
2223
+ },
2224
+ toHsvString: function() {
2225
+ var hsv = rgbToHsv(this._r, this._g, this._b);
2226
+ var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
2227
+ return (this._a == 1) ?
2228
+ "hsv(" + h + ", " + s + "%, " + v + "%)" :
2229
+ "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
2230
+ },
2231
+ toHsl: function() {
2232
+ var hsl = rgbToHsl(this._r, this._g, this._b);
2233
+ return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
2234
+ },
2235
+ toHslString: function() {
2236
+ var hsl = rgbToHsl(this._r, this._g, this._b);
2237
+ var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
2238
+ return (this._a == 1) ?
2239
+ "hsl(" + h + ", " + s + "%, " + l + "%)" :
2240
+ "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
2241
+ },
2242
+ toHex: function(allow3Char) {
2243
+ return rgbToHex(this._r, this._g, this._b, allow3Char);
2244
+ },
2245
+ toHexString: function(allow3Char) {
2246
+ return '#' + this.toHex(allow3Char);
2247
+ },
2248
+ toHex8: function(allow4Char) {
2249
+ return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
2250
+ },
2251
+ toHex8String: function(allow4Char) {
2252
+ return '#' + this.toHex8(allow4Char);
2253
+ },
2254
+ toRgb: function() {
2255
+ return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
2256
+ },
2257
+ toRgbString: function() {
2258
+ return (this._a == 1) ?
2259
+ "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
2260
+ "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
2261
+ },
2262
+ toPercentageRgb: function() {
2263
+ return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
2264
+ },
2265
+ toPercentageRgbString: function() {
2266
+ return (this._a == 1) ?
2267
+ "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
2268
+ "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
2269
+ },
2270
+ toName: function() {
2271
+ if (this._a === 0) {
2272
+ return "transparent";
2273
+ }
2274
+
2275
+ if (this._a < 1) {
2276
+ return false;
2277
+ }
2278
+
2279
+ return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
2280
+ },
2281
+ toFilter: function(secondColor) {
2282
+ var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
2283
+ var secondHex8String = hex8String;
2284
+ var gradientType = this._gradientType ? "GradientType = 1, " : "";
2285
+
2286
+ if (secondColor) {
2287
+ var s = tinycolor(secondColor);
2288
+ secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
2289
+ }
2290
+
2291
+ return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
2292
+ },
2293
+ toString: function(format) {
2294
+ var formatSet = !!format;
2295
+ format = format || this._format;
2296
+
2297
+ var formattedString = false;
2298
+ var hasAlpha = this._a < 1 && this._a >= 0;
2299
+ var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
2300
+
2301
+ if (needsAlphaFormat) {
2302
+ // Special case for "transparent", all other non-alpha formats
2303
+ // will return rgba when there is transparency.
2304
+ if (format === "name" && this._a === 0) {
2305
+ return this.toName();
2306
+ }
2307
+ return this.toRgbString();
2308
+ }
2309
+ if (format === "rgb") {
2310
+ formattedString = this.toRgbString();
2311
+ }
2312
+ if (format === "prgb") {
2313
+ formattedString = this.toPercentageRgbString();
2314
+ }
2315
+ if (format === "hex" || format === "hex6") {
2316
+ formattedString = this.toHexString();
2317
+ }
2318
+ if (format === "hex3") {
2319
+ formattedString = this.toHexString(true);
2320
+ }
2321
+ if (format === "hex4") {
2322
+ formattedString = this.toHex8String(true);
2323
+ }
2324
+ if (format === "hex8") {
2325
+ formattedString = this.toHex8String();
2326
+ }
2327
+ if (format === "name") {
2328
+ formattedString = this.toName();
2329
+ }
2330
+ if (format === "hsl") {
2331
+ formattedString = this.toHslString();
2332
+ }
2333
+ if (format === "hsv") {
2334
+ formattedString = this.toHsvString();
2335
+ }
2336
+
2337
+ return formattedString || this.toHexString();
2338
+ },
2339
+ clone: function() {
2340
+ return tinycolor(this.toString());
2341
+ },
2342
+
2343
+ _applyModification: function(fn, args) {
2344
+ var color = fn.apply(null, [this].concat([].slice.call(args)));
2345
+ this._r = color._r;
2346
+ this._g = color._g;
2347
+ this._b = color._b;
2348
+ this.setAlpha(color._a);
2349
+ return this;
2350
+ },
2351
+ lighten: function() {
2352
+ return this._applyModification(lighten, arguments);
2353
+ },
2354
+ brighten: function() {
2355
+ return this._applyModification(brighten, arguments);
2356
+ },
2357
+ darken: function() {
2358
+ return this._applyModification(darken, arguments);
2359
+ },
2360
+ desaturate: function() {
2361
+ return this._applyModification(desaturate, arguments);
2362
+ },
2363
+ saturate: function() {
2364
+ return this._applyModification(saturate, arguments);
2365
+ },
2366
+ greyscale: function() {
2367
+ return this._applyModification(greyscale, arguments);
2368
+ },
2369
+ spin: function() {
2370
+ return this._applyModification(spin, arguments);
2371
+ },
2372
+
2373
+ _applyCombination: function(fn, args) {
2374
+ return fn.apply(null, [this].concat([].slice.call(args)));
2375
+ },
2376
+ analogous: function() {
2377
+ return this._applyCombination(analogous, arguments);
2378
+ },
2379
+ complement: function() {
2380
+ return this._applyCombination(complement, arguments);
2381
+ },
2382
+ monochromatic: function() {
2383
+ return this._applyCombination(monochromatic, arguments);
2384
+ },
2385
+ splitcomplement: function() {
2386
+ return this._applyCombination(splitcomplement, arguments);
2387
+ },
2388
+ triad: function() {
2389
+ return this._applyCombination(triad, arguments);
2390
+ },
2391
+ tetrad: function() {
2392
+ return this._applyCombination(tetrad, arguments);
2393
+ }
2394
+ };
2395
+
2396
+ // If input is an object, force 1 into "1.0" to handle ratios properly
2397
+ // String input requires "1.0" as input, so 1 will be treated as 1
2398
+ tinycolor.fromRatio = function(color, opts) {
2399
+ if (typeof color == "object") {
2400
+ var newColor = {};
2401
+ for (var i in color) {
2402
+ if (color.hasOwnProperty(i)) {
2403
+ if (i === "a") {
2404
+ newColor[i] = color[i];
2405
+ }
2406
+ else {
2407
+ newColor[i] = convertToPercentage(color[i]);
2408
+ }
2409
+ }
2410
+ }
2411
+ color = newColor;
2412
+ }
2413
+
2414
+ return tinycolor(color, opts);
2415
+ };
2416
+
2417
+ // Given a string or object, convert that input to RGB
2418
+ // Possible string inputs:
2419
+ //
2420
+ // "red"
2421
+ // "#f00" or "f00"
2422
+ // "#ff0000" or "ff0000"
2423
+ // "#ff000000" or "ff000000"
2424
+ // "rgb 255 0 0" or "rgb (255, 0, 0)"
2425
+ // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
2426
+ // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
2427
+ // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
2428
+ // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
2429
+ // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
2430
+ // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
2431
+ //
2432
+ function inputToRGB(color) {
2433
+
2434
+ var rgb = { r: 0, g: 0, b: 0 };
2435
+ var a = 1;
2436
+ var s = null;
2437
+ var v = null;
2438
+ var l = null;
2439
+ var ok = false;
2440
+ var format = false;
2441
+
2442
+ if (typeof color == "string") {
2443
+ color = stringInputToObject(color);
2444
+ }
2445
+
2446
+ if (typeof color == "object") {
2447
+ if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
2448
+ rgb = rgbToRgb(color.r, color.g, color.b);
2449
+ ok = true;
2450
+ format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
2451
+ }
2452
+ else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
2453
+ s = convertToPercentage(color.s);
2454
+ v = convertToPercentage(color.v);
2455
+ rgb = hsvToRgb(color.h, s, v);
2456
+ ok = true;
2457
+ format = "hsv";
2458
+ }
2459
+ else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
2460
+ s = convertToPercentage(color.s);
2461
+ l = convertToPercentage(color.l);
2462
+ rgb = hslToRgb(color.h, s, l);
2463
+ ok = true;
2464
+ format = "hsl";
2465
+ }
2466
+
2467
+ if (color.hasOwnProperty("a")) {
2468
+ a = color.a;
2469
+ }
2470
+ }
2471
+
2472
+ a = boundAlpha(a);
2473
+
2474
+ return {
2475
+ ok: ok,
2476
+ format: color.format || format,
2477
+ r: mathMin(255, mathMax(rgb.r, 0)),
2478
+ g: mathMin(255, mathMax(rgb.g, 0)),
2479
+ b: mathMin(255, mathMax(rgb.b, 0)),
2480
+ a: a
2481
+ };
2482
+ }
2483
+
2484
+
2485
+ // Conversion Functions
2486
+ // --------------------
2487
+
2488
+ // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
2489
+ // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
2490
+
2491
+ // `rgbToRgb`
2492
+ // Handle bounds / percentage checking to conform to CSS color spec
2493
+ // <http://www.w3.org/TR/css3-color/>
2494
+ // *Assumes:* r, g, b in [0, 255] or [0, 1]
2495
+ // *Returns:* { r, g, b } in [0, 255]
2496
+ function rgbToRgb(r, g, b){
2497
+ return {
2498
+ r: bound01(r, 255) * 255,
2499
+ g: bound01(g, 255) * 255,
2500
+ b: bound01(b, 255) * 255
2501
+ };
2502
+ }
2503
+
2504
+ // `rgbToHsl`
2505
+ // Converts an RGB color value to HSL.
2506
+ // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
2507
+ // *Returns:* { h, s, l } in [0,1]
2508
+ function rgbToHsl(r, g, b) {
2509
+
2510
+ r = bound01(r, 255);
2511
+ g = bound01(g, 255);
2512
+ b = bound01(b, 255);
2513
+
2514
+ var max = mathMax(r, g, b), min = mathMin(r, g, b);
2515
+ var h, s, l = (max + min) / 2;
2516
+
2517
+ if(max == min) {
2518
+ h = s = 0; // achromatic
2519
+ }
2520
+ else {
2521
+ var d = max - min;
2522
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
2523
+ switch(max) {
2524
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
2525
+ case g: h = (b - r) / d + 2; break;
2526
+ case b: h = (r - g) / d + 4; break;
2527
+ }
2528
+
2529
+ h /= 6;
2530
+ }
2531
+
2532
+ return { h: h, s: s, l: l };
2533
+ }
2534
+
2535
+ // `hslToRgb`
2536
+ // Converts an HSL color value to RGB.
2537
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
2538
+ // *Returns:* { r, g, b } in the set [0, 255]
2539
+ function hslToRgb(h, s, l) {
2540
+ var r, g, b;
2541
+
2542
+ h = bound01(h, 360);
2543
+ s = bound01(s, 100);
2544
+ l = bound01(l, 100);
2545
+
2546
+ function hue2rgb(p, q, t) {
2547
+ if(t < 0) t += 1;
2548
+ if(t > 1) t -= 1;
2549
+ if(t < 1/6) return p + (q - p) * 6 * t;
2550
+ if(t < 1/2) return q;
2551
+ if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
2552
+ return p;
2553
+ }
2554
+
2555
+ if(s === 0) {
2556
+ r = g = b = l; // achromatic
2557
+ }
2558
+ else {
2559
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
2560
+ var p = 2 * l - q;
2561
+ r = hue2rgb(p, q, h + 1/3);
2562
+ g = hue2rgb(p, q, h);
2563
+ b = hue2rgb(p, q, h - 1/3);
2564
+ }
2565
+
2566
+ return { r: r * 255, g: g * 255, b: b * 255 };
2567
+ }
2568
+
2569
+ // `rgbToHsv`
2570
+ // Converts an RGB color value to HSV
2571
+ // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
2572
+ // *Returns:* { h, s, v } in [0,1]
2573
+ function rgbToHsv(r, g, b) {
2574
+
2575
+ r = bound01(r, 255);
2576
+ g = bound01(g, 255);
2577
+ b = bound01(b, 255);
2578
+
2579
+ var max = mathMax(r, g, b), min = mathMin(r, g, b);
2580
+ var h, s, v = max;
2581
+
2582
+ var d = max - min;
2583
+ s = max === 0 ? 0 : d / max;
2584
+
2585
+ if(max == min) {
2586
+ h = 0; // achromatic
2587
+ }
2588
+ else {
2589
+ switch(max) {
2590
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
2591
+ case g: h = (b - r) / d + 2; break;
2592
+ case b: h = (r - g) / d + 4; break;
2593
+ }
2594
+ h /= 6;
2595
+ }
2596
+ return { h: h, s: s, v: v };
2597
+ }
2598
+
2599
+ // `hsvToRgb`
2600
+ // Converts an HSV color value to RGB.
2601
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
2602
+ // *Returns:* { r, g, b } in the set [0, 255]
2603
+ function hsvToRgb(h, s, v) {
2604
+
2605
+ h = bound01(h, 360) * 6;
2606
+ s = bound01(s, 100);
2607
+ v = bound01(v, 100);
2608
+
2609
+ var i = Math.floor(h),
2610
+ f = h - i,
2611
+ p = v * (1 - s),
2612
+ q = v * (1 - f * s),
2613
+ t = v * (1 - (1 - f) * s),
2614
+ mod = i % 6,
2615
+ r = [v, q, p, p, t, v][mod],
2616
+ g = [t, v, v, q, p, p][mod],
2617
+ b = [p, p, t, v, v, q][mod];
2618
+
2619
+ return { r: r * 255, g: g * 255, b: b * 255 };
2620
+ }
2621
+
2622
+ // `rgbToHex`
2623
+ // Converts an RGB color to hex
2624
+ // Assumes r, g, and b are contained in the set [0, 255]
2625
+ // Returns a 3 or 6 character hex
2626
+ function rgbToHex(r, g, b, allow3Char) {
2627
+
2628
+ var hex = [
2629
+ pad2(mathRound(r).toString(16)),
2630
+ pad2(mathRound(g).toString(16)),
2631
+ pad2(mathRound(b).toString(16))
2632
+ ];
2633
+
2634
+ // Return a 3 character hex if possible
2635
+ if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
2636
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
2637
+ }
2638
+
2639
+ return hex.join("");
2640
+ }
2641
+
2642
+ // `rgbaToHex`
2643
+ // Converts an RGBA color plus alpha transparency to hex
2644
+ // Assumes r, g, b are contained in the set [0, 255] and
2645
+ // a in [0, 1]. Returns a 4 or 8 character rgba hex
2646
+ function rgbaToHex(r, g, b, a, allow4Char) {
2647
+
2648
+ var hex = [
2649
+ pad2(mathRound(r).toString(16)),
2650
+ pad2(mathRound(g).toString(16)),
2651
+ pad2(mathRound(b).toString(16)),
2652
+ pad2(convertDecimalToHex(a))
2653
+ ];
2654
+
2655
+ // Return a 4 character hex if possible
2656
+ if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
2657
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
2658
+ }
2659
+
2660
+ return hex.join("");
2661
+ }
2662
+
2663
+ // `rgbaToArgbHex`
2664
+ // Converts an RGBA color to an ARGB Hex8 string
2665
+ // Rarely used, but required for "toFilter()"
2666
+ function rgbaToArgbHex(r, g, b, a) {
2667
+
2668
+ var hex = [
2669
+ pad2(convertDecimalToHex(a)),
2670
+ pad2(mathRound(r).toString(16)),
2671
+ pad2(mathRound(g).toString(16)),
2672
+ pad2(mathRound(b).toString(16))
2673
+ ];
2674
+
2675
+ return hex.join("");
2676
+ }
2677
+
2678
+ // `equals`
2679
+ // Can be called with any tinycolor input
2680
+ tinycolor.equals = function (color1, color2) {
2681
+ if (!color1 || !color2) { return false; }
2682
+ return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
2683
+ };
2684
+
2685
+ tinycolor.random = function() {
2686
+ return tinycolor.fromRatio({
2687
+ r: mathRandom(),
2688
+ g: mathRandom(),
2689
+ b: mathRandom()
2690
+ });
2691
+ };
2692
+
2693
+
2694
+ // Modification Functions
2695
+ // ----------------------
2696
+ // Thanks to less.js for some of the basics here
2697
+ // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
2698
+
2699
+ function desaturate(color, amount) {
2700
+ amount = (amount === 0) ? 0 : (amount || 10);
2701
+ var hsl = tinycolor(color).toHsl();
2702
+ hsl.s -= amount / 100;
2703
+ hsl.s = clamp01(hsl.s);
2704
+ return tinycolor(hsl);
2705
+ }
2706
+
2707
+ function saturate(color, amount) {
2708
+ amount = (amount === 0) ? 0 : (amount || 10);
2709
+ var hsl = tinycolor(color).toHsl();
2710
+ hsl.s += amount / 100;
2711
+ hsl.s = clamp01(hsl.s);
2712
+ return tinycolor(hsl);
2713
+ }
2714
+
2715
+ function greyscale(color) {
2716
+ return tinycolor(color).desaturate(100);
2717
+ }
2718
+
2719
+ function lighten (color, amount) {
2720
+ amount = (amount === 0) ? 0 : (amount || 10);
2721
+ var hsl = tinycolor(color).toHsl();
2722
+ hsl.l += amount / 100;
2723
+ hsl.l = clamp01(hsl.l);
2724
+ return tinycolor(hsl);
2725
+ }
2726
+
2727
+ function brighten(color, amount) {
2728
+ amount = (amount === 0) ? 0 : (amount || 10);
2729
+ var rgb = tinycolor(color).toRgb();
2730
+ rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
2731
+ rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
2732
+ rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
2733
+ return tinycolor(rgb);
2734
+ }
2735
+
2736
+ function darken (color, amount) {
2737
+ amount = (amount === 0) ? 0 : (amount || 10);
2738
+ var hsl = tinycolor(color).toHsl();
2739
+ hsl.l -= amount / 100;
2740
+ hsl.l = clamp01(hsl.l);
2741
+ return tinycolor(hsl);
2742
+ }
2743
+
2744
+ // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
2745
+ // Values outside of this range will be wrapped into this range.
2746
+ function spin(color, amount) {
2747
+ var hsl = tinycolor(color).toHsl();
2748
+ var hue = (hsl.h + amount) % 360;
2749
+ hsl.h = hue < 0 ? 360 + hue : hue;
2750
+ return tinycolor(hsl);
2751
+ }
2752
+
2753
+ // Combination Functions
2754
+ // ---------------------
2755
+ // Thanks to jQuery xColor for some of the ideas behind these
2756
+ // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
2757
+
2758
+ function complement(color) {
2759
+ var hsl = tinycolor(color).toHsl();
2760
+ hsl.h = (hsl.h + 180) % 360;
2761
+ return tinycolor(hsl);
2762
+ }
2763
+
2764
+ function triad(color) {
2765
+ var hsl = tinycolor(color).toHsl();
2766
+ var h = hsl.h;
2767
+ return [
2768
+ tinycolor(color),
2769
+ tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
2770
+ tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
2771
+ ];
2772
+ }
2773
+
2774
+ function tetrad(color) {
2775
+ var hsl = tinycolor(color).toHsl();
2776
+ var h = hsl.h;
2777
+ return [
2778
+ tinycolor(color),
2779
+ tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
2780
+ tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
2781
+ tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
2782
+ ];
2783
+ }
2784
+
2785
+ function splitcomplement(color) {
2786
+ var hsl = tinycolor(color).toHsl();
2787
+ var h = hsl.h;
2788
+ return [
2789
+ tinycolor(color),
2790
+ tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
2791
+ tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
2792
+ ];
2793
+ }
2794
+
2795
+ function analogous(color, results, slices) {
2796
+ results = results || 6;
2797
+ slices = slices || 30;
2798
+
2799
+ var hsl = tinycolor(color).toHsl();
2800
+ var part = 360 / slices;
2801
+ var ret = [tinycolor(color)];
2802
+
2803
+ for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
2804
+ hsl.h = (hsl.h + part) % 360;
2805
+ ret.push(tinycolor(hsl));
2806
+ }
2807
+ return ret;
2808
+ }
2809
+
2810
+ function monochromatic(color, results) {
2811
+ results = results || 6;
2812
+ var hsv = tinycolor(color).toHsv();
2813
+ var h = hsv.h, s = hsv.s, v = hsv.v;
2814
+ var ret = [];
2815
+ var modification = 1 / results;
2816
+
2817
+ while (results--) {
2818
+ ret.push(tinycolor({ h: h, s: s, v: v}));
2819
+ v = (v + modification) % 1;
2820
+ }
2821
+
2822
+ return ret;
2823
+ }
2824
+
2825
+ // Utility Functions
2826
+ // ---------------------
2827
+
2828
+ tinycolor.mix = function(color1, color2, amount) {
2829
+ amount = (amount === 0) ? 0 : (amount || 50);
2830
+
2831
+ var rgb1 = tinycolor(color1).toRgb();
2832
+ var rgb2 = tinycolor(color2).toRgb();
2833
+
2834
+ var p = amount / 100;
2835
+
2836
+ var rgba = {
2837
+ r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
2838
+ g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
2839
+ b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
2840
+ a: ((rgb2.a - rgb1.a) * p) + rgb1.a
2841
+ };
2842
+
2843
+ return tinycolor(rgba);
2844
+ };
2845
+
2846
+
2847
+ // Readability Functions
2848
+ // ---------------------
2849
+ // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
2850
+
2851
+ // `contrast`
2852
+ // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
2853
+ tinycolor.readability = function(color1, color2) {
2854
+ var c1 = tinycolor(color1);
2855
+ var c2 = tinycolor(color2);
2856
+ return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
2857
+ };
2858
+
2859
+ // `isReadable`
2860
+ // Ensure that foreground and background color combinations meet WCAG2 guidelines.
2861
+ // The third argument is an optional Object.
2862
+ // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
2863
+ // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
2864
+ // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
2865
+
2866
+ // *Example*
2867
+ // tinycolor.isReadable("#000", "#111") => false
2868
+ // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
2869
+ tinycolor.isReadable = function(color1, color2, wcag2) {
2870
+ var readability = tinycolor.readability(color1, color2);
2871
+ var wcag2Parms, out;
2872
+
2873
+ out = false;
2874
+
2875
+ wcag2Parms = validateWCAG2Parms(wcag2);
2876
+ switch (wcag2Parms.level + wcag2Parms.size) {
2877
+ case "AAsmall":
2878
+ case "AAAlarge":
2879
+ out = readability >= 4.5;
2880
+ break;
2881
+ case "AAlarge":
2882
+ out = readability >= 3;
2883
+ break;
2884
+ case "AAAsmall":
2885
+ out = readability >= 7;
2886
+ break;
2887
+ }
2888
+ return out;
2889
+
2890
+ };
2891
+
2892
+ // `mostReadable`
2893
+ // Given a base color and a list of possible foreground or background
2894
+ // colors for that base, returns the most readable color.
2895
+ // Optionally returns Black or White if the most readable color is unreadable.
2896
+ // *Example*
2897
+ // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
2898
+ // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
2899
+ // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
2900
+ // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
2901
+ tinycolor.mostReadable = function(baseColor, colorList, args) {
2902
+ var bestColor = null;
2903
+ var bestScore = 0;
2904
+ var readability;
2905
+ var includeFallbackColors, level, size ;
2906
+ args = args || {};
2907
+ includeFallbackColors = args.includeFallbackColors ;
2908
+ level = args.level;
2909
+ size = args.size;
2910
+
2911
+ for (var i= 0; i < colorList.length ; i++) {
2912
+ readability = tinycolor.readability(baseColor, colorList[i]);
2913
+ if (readability > bestScore) {
2914
+ bestScore = readability;
2915
+ bestColor = tinycolor(colorList[i]);
2916
+ }
2917
+ }
2918
+
2919
+ if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) {
2920
+ return bestColor;
2921
+ }
2922
+ else {
2923
+ args.includeFallbackColors=false;
2924
+ return tinycolor.mostReadable(baseColor,["#fff", "#000"],args);
2925
+ }
2926
+ };
2927
+
2928
+
2929
+ // Big List of Colors
2930
+ // ------------------
2931
+ // <http://www.w3.org/TR/css3-color/#svg-color>
2932
+ var names = tinycolor.names = {
2933
+ aliceblue: "f0f8ff",
2934
+ antiquewhite: "faebd7",
2935
+ aqua: "0ff",
2936
+ aquamarine: "7fffd4",
2937
+ azure: "f0ffff",
2938
+ beige: "f5f5dc",
2939
+ bisque: "ffe4c4",
2940
+ black: "000",
2941
+ blanchedalmond: "ffebcd",
2942
+ blue: "00f",
2943
+ blueviolet: "8a2be2",
2944
+ brown: "a52a2a",
2945
+ burlywood: "deb887",
2946
+ burntsienna: "ea7e5d",
2947
+ cadetblue: "5f9ea0",
2948
+ chartreuse: "7fff00",
2949
+ chocolate: "d2691e",
2950
+ coral: "ff7f50",
2951
+ cornflowerblue: "6495ed",
2952
+ cornsilk: "fff8dc",
2953
+ crimson: "dc143c",
2954
+ cyan: "0ff",
2955
+ darkblue: "00008b",
2956
+ darkcyan: "008b8b",
2957
+ darkgoldenrod: "b8860b",
2958
+ darkgray: "a9a9a9",
2959
+ darkgreen: "006400",
2960
+ darkgrey: "a9a9a9",
2961
+ darkkhaki: "bdb76b",
2962
+ darkmagenta: "8b008b",
2963
+ darkolivegreen: "556b2f",
2964
+ darkorange: "ff8c00",
2965
+ darkorchid: "9932cc",
2966
+ darkred: "8b0000",
2967
+ darksalmon: "e9967a",
2968
+ darkseagreen: "8fbc8f",
2969
+ darkslateblue: "483d8b",
2970
+ darkslategray: "2f4f4f",
2971
+ darkslategrey: "2f4f4f",
2972
+ darkturquoise: "00ced1",
2973
+ darkviolet: "9400d3",
2974
+ deeppink: "ff1493",
2975
+ deepskyblue: "00bfff",
2976
+ dimgray: "696969",
2977
+ dimgrey: "696969",
2978
+ dodgerblue: "1e90ff",
2979
+ firebrick: "b22222",
2980
+ floralwhite: "fffaf0",
2981
+ forestgreen: "228b22",
2982
+ fuchsia: "f0f",
2983
+ gainsboro: "dcdcdc",
2984
+ ghostwhite: "f8f8ff",
2985
+ gold: "ffd700",
2986
+ goldenrod: "daa520",
2987
+ gray: "808080",
2988
+ green: "008000",
2989
+ greenyellow: "adff2f",
2990
+ grey: "808080",
2991
+ honeydew: "f0fff0",
2992
+ hotpink: "ff69b4",
2993
+ indianred: "cd5c5c",
2994
+ indigo: "4b0082",
2995
+ ivory: "fffff0",
2996
+ khaki: "f0e68c",
2997
+ lavender: "e6e6fa",
2998
+ lavenderblush: "fff0f5",
2999
+ lawngreen: "7cfc00",
3000
+ lemonchiffon: "fffacd",
3001
+ lightblue: "add8e6",
3002
+ lightcoral: "f08080",
3003
+ lightcyan: "e0ffff",
3004
+ lightgoldenrodyellow: "fafad2",
3005
+ lightgray: "d3d3d3",
3006
+ lightgreen: "90ee90",
3007
+ lightgrey: "d3d3d3",
3008
+ lightpink: "ffb6c1",
3009
+ lightsalmon: "ffa07a",
3010
+ lightseagreen: "20b2aa",
3011
+ lightskyblue: "87cefa",
3012
+ lightslategray: "789",
3013
+ lightslategrey: "789",
3014
+ lightsteelblue: "b0c4de",
3015
+ lightyellow: "ffffe0",
3016
+ lime: "0f0",
3017
+ limegreen: "32cd32",
3018
+ linen: "faf0e6",
3019
+ magenta: "f0f",
3020
+ maroon: "800000",
3021
+ mediumaquamarine: "66cdaa",
3022
+ mediumblue: "0000cd",
3023
+ mediumorchid: "ba55d3",
3024
+ mediumpurple: "9370db",
3025
+ mediumseagreen: "3cb371",
3026
+ mediumslateblue: "7b68ee",
3027
+ mediumspringgreen: "00fa9a",
3028
+ mediumturquoise: "48d1cc",
3029
+ mediumvioletred: "c71585",
3030
+ midnightblue: "191970",
3031
+ mintcream: "f5fffa",
3032
+ mistyrose: "ffe4e1",
3033
+ moccasin: "ffe4b5",
3034
+ navajowhite: "ffdead",
3035
+ navy: "000080",
3036
+ oldlace: "fdf5e6",
3037
+ olive: "808000",
3038
+ olivedrab: "6b8e23",
3039
+ orange: "ffa500",
3040
+ orangered: "ff4500",
3041
+ orchid: "da70d6",
3042
+ palegoldenrod: "eee8aa",
3043
+ palegreen: "98fb98",
3044
+ paleturquoise: "afeeee",
3045
+ palevioletred: "db7093",
3046
+ papayawhip: "ffefd5",
3047
+ peachpuff: "ffdab9",
3048
+ peru: "cd853f",
3049
+ pink: "ffc0cb",
3050
+ plum: "dda0dd",
3051
+ powderblue: "b0e0e6",
3052
+ purple: "800080",
3053
+ rebeccapurple: "663399",
3054
+ red: "f00",
3055
+ rosybrown: "bc8f8f",
3056
+ royalblue: "4169e1",
3057
+ saddlebrown: "8b4513",
3058
+ salmon: "fa8072",
3059
+ sandybrown: "f4a460",
3060
+ seagreen: "2e8b57",
3061
+ seashell: "fff5ee",
3062
+ sienna: "a0522d",
3063
+ silver: "c0c0c0",
3064
+ skyblue: "87ceeb",
3065
+ slateblue: "6a5acd",
3066
+ slategray: "708090",
3067
+ slategrey: "708090",
3068
+ snow: "fffafa",
3069
+ springgreen: "00ff7f",
3070
+ steelblue: "4682b4",
3071
+ tan: "d2b48c",
3072
+ teal: "008080",
3073
+ thistle: "d8bfd8",
3074
+ tomato: "ff6347",
3075
+ turquoise: "40e0d0",
3076
+ violet: "ee82ee",
3077
+ wheat: "f5deb3",
3078
+ white: "fff",
3079
+ whitesmoke: "f5f5f5",
3080
+ yellow: "ff0",
3081
+ yellowgreen: "9acd32"
3082
+ };
3083
+
3084
+ // Make it easy to access colors via `hexNames[hex]`
3085
+ var hexNames = tinycolor.hexNames = flip(names);
3086
+
3087
+
3088
+ // Utilities
3089
+ // ---------
3090
+
3091
+ // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
3092
+ function flip(o) {
3093
+ var flipped = { };
3094
+ for (var i in o) {
3095
+ if (o.hasOwnProperty(i)) {
3096
+ flipped[o[i]] = i;
3097
+ }
3098
+ }
3099
+ return flipped;
3100
+ }
3101
+
3102
+ // Return a valid alpha value [0,1] with all invalid values being set to 1
3103
+ function boundAlpha(a) {
3104
+ a = parseFloat(a);
3105
+
3106
+ if (isNaN(a) || a < 0 || a > 1) {
3107
+ a = 1;
3108
+ }
3109
+
3110
+ return a;
3111
+ }
3112
+
3113
+ // Take input from [0, n] and return it as [0, 1]
3114
+ function bound01(n, max) {
3115
+ if (isOnePointZero(n)) { n = "100%"; }
3116
+
3117
+ var processPercent = isPercentage(n);
3118
+ n = mathMin(max, mathMax(0, parseFloat(n)));
3119
+
3120
+ // Automatically convert percentage into number
3121
+ if (processPercent) {
3122
+ n = parseInt(n * max, 10) / 100;
3123
+ }
3124
+
3125
+ // Handle floating point rounding errors
3126
+ if ((Math.abs(n - max) < 0.000001)) {
3127
+ return 1;
3128
+ }
3129
+
3130
+ // Convert into [0, 1] range if it isn't already
3131
+ return (n % max) / parseFloat(max);
3132
+ }
3133
+
3134
+ // Force a number between 0 and 1
3135
+ function clamp01(val) {
3136
+ return mathMin(1, mathMax(0, val));
3137
+ }
3138
+
3139
+ // Parse a base-16 hex value into a base-10 integer
3140
+ function parseIntFromHex(val) {
3141
+ return parseInt(val, 16);
3142
+ }
3143
+
3144
+ // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
3145
+ // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
3146
+ function isOnePointZero(n) {
3147
+ return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
3148
+ }
3149
+
3150
+ // Check to see if string passed in is a percentage
3151
+ function isPercentage(n) {
3152
+ return typeof n === "string" && n.indexOf('%') != -1;
3153
+ }
3154
+
3155
+ // Force a hex value to have 2 characters
3156
+ function pad2(c) {
3157
+ return c.length == 1 ? '0' + c : '' + c;
3158
+ }
3159
+
3160
+ // Replace a decimal with it's percentage value
3161
+ function convertToPercentage(n) {
3162
+ if (n <= 1) {
3163
+ n = (n * 100) + "%";
3164
+ }
3165
+
3166
+ return n;
3167
+ }
3168
+
3169
+ // Converts a decimal to a hex value
3170
+ function convertDecimalToHex(d) {
3171
+ return Math.round(parseFloat(d) * 255).toString(16);
3172
+ }
3173
+ // Converts a hex value to a decimal
3174
+ function convertHexToDecimal(h) {
3175
+ return (parseIntFromHex(h) / 255);
3176
+ }
3177
+
3178
+ var matchers = (function() {
3179
+
3180
+ // <http://www.w3.org/TR/css3-values/#integers>
3181
+ var CSS_INTEGER = "[-\\+]?\\d+%?";
3182
+
3183
+ // <http://www.w3.org/TR/css3-values/#number-value>
3184
+ var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
3185
+
3186
+ // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
3187
+ var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
3188
+
3189
+ // Actual matching.
3190
+ // Parentheses and commas are optional, but not required.
3191
+ // Whitespace can take the place of commas or opening paren
3192
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
3193
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
3194
+
3195
+ return {
3196
+ CSS_UNIT: new RegExp(CSS_UNIT),
3197
+ rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
3198
+ rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
3199
+ hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
3200
+ hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
3201
+ hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
3202
+ hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
3203
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
3204
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
3205
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
3206
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
3207
+ };
3208
+ })();
3209
+
3210
+ // `isValidCSSUnit`
3211
+ // Take in a single string / number and check to see if it looks like a CSS unit
3212
+ // (see `matchers` above for definition).
3213
+ function isValidCSSUnit(color) {
3214
+ return !!matchers.CSS_UNIT.exec(color);
3215
+ }
3216
+
3217
+ // `stringInputToObject`
3218
+ // Permissive string parsing. Take in a number of formats, and output an object
3219
+ // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
3220
+ function stringInputToObject(color) {
3221
+
3222
+ color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
3223
+ var named = false;
3224
+ if (names[color]) {
3225
+ color = names[color];
3226
+ named = true;
3227
+ }
3228
+ else if (color == 'transparent') {
3229
+ return { r: 0, g: 0, b: 0, a: 0, format: "name" };
3230
+ }
3231
+
3232
+ // Try to match string input using regular expressions.
3233
+ // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
3234
+ // Just return an object and let the conversion functions handle that.
3235
+ // This way the result will be the same whether the tinycolor is initialized with string or object.
3236
+ var match;
3237
+ if ((match = matchers.rgb.exec(color))) {
3238
+ return { r: match[1], g: match[2], b: match[3] };
3239
+ }
3240
+ if ((match = matchers.rgba.exec(color))) {
3241
+ return { r: match[1], g: match[2], b: match[3], a: match[4] };
3242
+ }
3243
+ if ((match = matchers.hsl.exec(color))) {
3244
+ return { h: match[1], s: match[2], l: match[3] };
3245
+ }
3246
+ if ((match = matchers.hsla.exec(color))) {
3247
+ return { h: match[1], s: match[2], l: match[3], a: match[4] };
3248
+ }
3249
+ if ((match = matchers.hsv.exec(color))) {
3250
+ return { h: match[1], s: match[2], v: match[3] };
3251
+ }
3252
+ if ((match = matchers.hsva.exec(color))) {
3253
+ return { h: match[1], s: match[2], v: match[3], a: match[4] };
3254
+ }
3255
+ if ((match = matchers.hex8.exec(color))) {
3256
+ return {
3257
+ r: parseIntFromHex(match[1]),
3258
+ g: parseIntFromHex(match[2]),
3259
+ b: parseIntFromHex(match[3]),
3260
+ a: convertHexToDecimal(match[4]),
3261
+ format: named ? "name" : "hex8"
3262
+ };
3263
+ }
3264
+ if ((match = matchers.hex6.exec(color))) {
3265
+ return {
3266
+ r: parseIntFromHex(match[1]),
3267
+ g: parseIntFromHex(match[2]),
3268
+ b: parseIntFromHex(match[3]),
3269
+ format: named ? "name" : "hex"
3270
+ };
3271
+ }
3272
+ if ((match = matchers.hex4.exec(color))) {
3273
+ return {
3274
+ r: parseIntFromHex(match[1] + '' + match[1]),
3275
+ g: parseIntFromHex(match[2] + '' + match[2]),
3276
+ b: parseIntFromHex(match[3] + '' + match[3]),
3277
+ a: convertHexToDecimal(match[4] + '' + match[4]),
3278
+ format: named ? "name" : "hex8"
3279
+ };
3280
+ }
3281
+ if ((match = matchers.hex3.exec(color))) {
3282
+ return {
3283
+ r: parseIntFromHex(match[1] + '' + match[1]),
3284
+ g: parseIntFromHex(match[2] + '' + match[2]),
3285
+ b: parseIntFromHex(match[3] + '' + match[3]),
3286
+ format: named ? "name" : "hex"
3287
+ };
3288
+ }
3289
+
3290
+ return false;
3291
+ }
3292
+
3293
+ function validateWCAG2Parms(parms) {
3294
+ // return valid WCAG2 parms for isReadable.
3295
+ // If input parms are invalid, return {"level":"AA", "size":"small"}
3296
+ var level, size;
3297
+ parms = parms || {"level":"AA", "size":"small"};
3298
+ level = (parms.level || "AA").toUpperCase();
3299
+ size = (parms.size || "small").toLowerCase();
3300
+ if (level !== "AA" && level !== "AAA") {
3301
+ level = "AA";
3302
+ }
3303
+ if (size !== "small" && size !== "large") {
3304
+ size = "small";
3305
+ }
3306
+ return {"level":level, "size":size};
3307
+ }
3308
+
3309
+ // Node: Export function
3310
+ if (typeof module !== "undefined" && module.exports) {
3311
+ module.exports = tinycolor;
3312
+ }
3313
+ // AMD/requirejs: Define the module
3314
+ else if (true) {
3315
+ !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {return tinycolor;}.call(exports, __webpack_require__, exports, module),
3316
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
3317
+ }
3318
+ // Browser: Expose to window
3319
+ else {
3320
+ window.tinycolor = tinycolor;
3321
+ }
3322
+
3323
+ })(Math);
3324
+
3325
+
3326
+ /***/ }),
3327
+ /* 7 */
3328
+ /***/ (function(module, exports, __webpack_require__) {
3329
+
3330
+ "use strict";
3331
+
3332
+ /**
3333
+ * @module
3334
+ */
3335
+
3336
+ /**
3337
+ * Colorpicker default options
3338
+ */
3339
+
3340
+ Object.defineProperty(exports, "__esModule", {
3341
+ value: true
3342
+ });
3343
+ exports.default = {
3344
+ /**
3345
+ * If true, loads the Debugger extension automatically into the current instance
3346
+ * @type {boolean}
3347
+ * @default false
3348
+ */
3349
+ debug: false,
3350
+ /**
3351
+ * Forces a color, ignoring the one from the elements value or data-color attribute.
3352
+ *
3353
+ * @type {(String|Color|boolean)}
3354
+ * @default false
3355
+ */
3356
+ color: false,
3357
+ /**
3358
+ * Forces an specific color format. If false, it will be automatically detected the first time,
3359
+ * but if null it will be always recalculated.
3360
+ *
3361
+ * Note that the ending 'a' of the format meaning "alpha" has currently no effect, meaning that rgb is the same as
3362
+ * rgba excepting if the alpha channel is disabled (see useAlpha).
3363
+ *
3364
+ * @type {('rgb'|'rgba'|'prgb'|'prgba'|'hex'|'hex3'|'hex6'|'hex8'|'hsl'|'hsla'|'hsv'|'hsva'|'name'|boolean)}
3365
+ * @default false
3366
+ */
3367
+ format: false,
3368
+ /**
3369
+ * Horizontal mode layout.
3370
+ *
3371
+ * If true, the hue and alpha channel bars will be rendered horizontally, above the saturation selector.
3372
+ *
3373
+ * @type {boolean}
3374
+ * @default false
3375
+ */
3376
+ horizontal: false,
3377
+ /**
3378
+ * Forces to show the colorpicker as an inline element
3379
+ *
3380
+ * @type {boolean}
3381
+ * @default false
3382
+ */
3383
+ inline: false,
3384
+ /**
3385
+ * Children input CSS selector
3386
+ *
3387
+ * @type {String}
3388
+ * @default 'input'
3389
+ */
3390
+ input: 'input',
3391
+ /**
3392
+ * Colorpicker container CSS selector. If given, the colorpicker will be placed inside this container.
3393
+ * If true, the colorpicker element itself will be used as the container.
3394
+ *
3395
+ * @type {String|boolean}
3396
+ * @default false
3397
+ */
3398
+ container: false, // container selector
3399
+ /**
3400
+ * Children color component CSS selector.
3401
+ * If it exists, the child <i> element background will be changed on color change.
3402
+ *
3403
+ * @type {String|boolean}
3404
+ * @default '.add-on, .input-group-addon'
3405
+ */
3406
+ component: '.add-on, .input-group-addon',
3407
+ /**
3408
+ * Fallback color to use when the given color is invalid.
3409
+ * If false, the latest valid color will be used as a fallback.
3410
+ *
3411
+ * @type {String|Color|boolean}
3412
+ * @default false
3413
+ */
3414
+ fallbackColor: false,
3415
+ /**
3416
+ * If enabled, the input content will be replaced always with a valid color,
3417
+ * if not enabled the invalid color will be left in the input, but valid in the internal color object.
3418
+ *
3419
+ * @type {boolean}
3420
+ * @default false
3421
+ */
3422
+ autoInputFallback: false,
3423
+ /**
3424
+ * If true a hash will be prepended to hexadecimal colors.
3425
+ * If false, the hash will be removed.
3426
+ * This only affects the input values.
3427
+ *
3428
+ * @type {boolean}
3429
+ * @default false
3430
+ */
3431
+ useHashPrefix: true,
3432
+ /**
3433
+ * If true or false the alpha adjustment bar will be displayed no matter what.
3434
+ * If false it will be always hidden and alpha channel won't be allowed programmatically for this instance,
3435
+ * so the selected or typed color will be always opaque.
3436
+ *
3437
+ * @type {boolean}
3438
+ * @default true
3439
+ */
3440
+ useAlpha: true,
3441
+ /**
3442
+ * This only applies when the color format is hexadecimal.
3443
+ * If true, the alpha channel will be allowed for hexadecimal formatted colors, making them having 4 or 8 chars
3444
+ * (RGBA or RRGGBBAA). This format is not yet supported in all modern browsers, so it is disabled by default.
3445
+ * If false, rgba will be used whenever there is an alpha change different than 1 and the color format is
3446
+ * automatic.
3447
+ *
3448
+ * @type {boolean}
3449
+ * @default true
3450
+ */
3451
+ enableHex8: false,
3452
+ /**
3453
+ * Vertical sliders configuration
3454
+ * @type {Object}
3455
+ */
3456
+ sliders: {
3457
+ saturation: {
3458
+ maxLeft: 100,
3459
+ maxTop: 100,
3460
+ callLeft: 'setSaturationRatio',
3461
+ callTop: 'setBrightnessRatio'
3462
+ },
3463
+ hue: {
3464
+ maxLeft: 0,
3465
+ maxTop: 100,
3466
+ callLeft: false,
3467
+ callTop: 'setHueRatio'
3468
+ },
3469
+ alpha: {
3470
+ maxLeft: 0,
3471
+ maxTop: 100,
3472
+ callLeft: false,
3473
+ callTop: 'setAlphaRatio'
3474
+ }
3475
+ },
3476
+ /**
3477
+ * Horizontal sliders configuration
3478
+ * @type {Object}
3479
+ */
3480
+ slidersHorz: {
3481
+ saturation: {
3482
+ maxLeft: 100,
3483
+ maxTop: 100,
3484
+ callLeft: 'setSaturationRatio',
3485
+ callTop: 'setBrightnessRatio'
3486
+ },
3487
+ hue: {
3488
+ maxLeft: 100,
3489
+ maxTop: 0,
3490
+ callLeft: 'setHueRatio',
3491
+ callTop: false
3492
+ },
3493
+ alpha: {
3494
+ maxLeft: 100,
3495
+ maxTop: 0,
3496
+ callLeft: 'setAlphaRatio',
3497
+ callTop: false
3498
+ }
3499
+ },
3500
+ /**
3501
+ * Colorpicker popup alignment.
3502
+ * For now only right is supported.
3503
+ *
3504
+ * @type {('right')}
3505
+ * @default 'right'
3506
+ */ // TODO: add 'left' and 'auto' support.
3507
+ align: 'right',
3508
+ /**
3509
+ * Custom class to be added to the colorpicker element
3510
+ *
3511
+ * @type {String}
3512
+ */
3513
+ customClass: null,
3514
+ /**
3515
+ * Colorpicker widget template
3516
+ * @type {String}
3517
+ * @example
3518
+ * <!-- This is the default template: -->
3519
+ * <div class="colorpicker">
3520
+ * <div class="colorpicker-saturation"><i class="colorpicker-guide"><i></i></i></div>
3521
+ * <div class="colorpicker-hue"><i class="colorpicker-guide"></i></div>
3522
+ * <div class="colorpicker-alpha"><i class="colorpicker-guide"></i></div>
3523
+ * <div class="colorpicker-color"><div /></div>
3524
+ * </div>
3525
+ */
3526
+ template: '<div class="colorpicker">\n <div class="colorpicker-saturation"><i class="colorpicker-guide"><i /></div>\n <div class="colorpicker-hue"><i class="colorpicker-guide"></i></div>\n <div class="colorpicker-alpha"><i class="colorpicker-guide"></i></div></div>',
3527
+ /**
3528
+ *
3529
+ * Associative object with the extension class name and its config.
3530
+ * Colorpicker comes with many bundled extensions: debugger, palette, preview and swatches (a superset of Palette).
3531
+ *
3532
+ * @type {Object}
3533
+ * @example
3534
+ * extensions: [
3535
+ * {
3536
+ * name: 'swatches'
3537
+ * colors: {
3538
+ * 'primary': '#337ab7',
3539
+ * 'success': '#5cb85c',
3540
+ * 'info': '#5bc0de',
3541
+ * 'warning': '#f0ad4e',
3542
+ * 'danger': '#d9534f'
3543
+ * },
3544
+ * namesAsValues: true
3545
+ * }
3546
+ * ]
3547
+ */
3548
+ extensions: [{
3549
+ name: 'preview',
3550
+ showText: false
3551
+ }]
3552
+ };
3553
+
3554
+ /***/ }),
3555
+ /* 8 */
3556
+ /***/ (function(module, exports, __webpack_require__) {
3557
+
3558
+ "use strict";
3559
+
3560
+
3561
+ Object.defineProperty(exports, "__esModule", {
3562
+ value: true
3563
+ });
3564
+ exports.Palette = exports.Swatches = exports.Preview = exports.Debugger = undefined;
3565
+
3566
+ var _Debugger = __webpack_require__(9);
3567
+
3568
+ var _Debugger2 = _interopRequireDefault(_Debugger);
3569
+
3570
+ var _Preview = __webpack_require__(10);
3571
+
3572
+ var _Preview2 = _interopRequireDefault(_Preview);
3573
+
3574
+ var _Swatches = __webpack_require__(11);
3575
+
3576
+ var _Swatches2 = _interopRequireDefault(_Swatches);
3577
+
3578
+ var _Palette = __webpack_require__(2);
3579
+
3580
+ var _Palette2 = _interopRequireDefault(_Palette);
3581
+
3582
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3583
+
3584
+ exports.Debugger = _Debugger2.default;
3585
+ exports.Preview = _Preview2.default;
3586
+ exports.Swatches = _Swatches2.default;
3587
+ exports.Palette = _Palette2.default;
3588
+ exports.default = {
3589
+ 'debugger': _Debugger2.default,
3590
+ 'preview': _Preview2.default,
3591
+ 'swatches': _Swatches2.default,
3592
+ 'palette': _Palette2.default
3593
+ };
3594
+
3595
+ /***/ }),
3596
+ /* 9 */
3597
+ /***/ (function(module, exports, __webpack_require__) {
3598
+
3599
+ "use strict";
3600
+
3601
+
3602
+ Object.defineProperty(exports, "__esModule", {
3603
+ value: true
3604
+ });
3605
+
3606
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
3607
+
3608
+ var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
3609
+
3610
+ var _Extension2 = __webpack_require__(1);
3611
+
3612
+ var _Extension3 = _interopRequireDefault(_Extension2);
3613
+
3614
+ var _jquery = __webpack_require__(0);
3615
+
3616
+ var _jquery2 = _interopRequireDefault(_jquery);
3617
+
3618
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3619
+
3620
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3621
+
3622
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
3623
+
3624
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
3625
+
3626
+ var Debugger = function (_Extension) {
3627
+ _inherits(Debugger, _Extension);
3628
+
3629
+ function Debugger(colorpicker) {
3630
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3631
+
3632
+ _classCallCheck(this, Debugger);
3633
+
3634
+ /**
3635
+ * @type {number}
3636
+ */
3637
+ var _this = _possibleConstructorReturn(this, (Debugger.__proto__ || Object.getPrototypeOf(Debugger)).call(this, colorpicker, options));
3638
+
3639
+ _this.eventCounter = 0;
3640
+ if (_this.colorpicker.hasInput()) {
3641
+ _this.colorpicker.input.on('change.colorpicker-ext', _jquery2.default.proxy(_this.onChangeInput, _this));
3642
+ }
3643
+ return _this;
3644
+ }
3645
+
3646
+ /**
3647
+ * @fires colorpickerDebug
3648
+ * @param {string} eventName
3649
+ * @param {*} args
3650
+ */
3651
+
3652
+
3653
+ _createClass(Debugger, [{
3654
+ key: 'log',
3655
+ value: function log(eventName) {
3656
+ var _console;
3657
+
3658
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3659
+ args[_key - 1] = arguments[_key];
3660
+ }
3661
+
3662
+ this.eventCounter += 1;
3663
+
3664
+ var logMessage = '#' + this.eventCounter + ': Colorpicker#' + this.colorpicker.id + ' [' + eventName + ']';
3665
+
3666
+ (_console = console).debug.apply(_console, [logMessage].concat(args));
3667
+
3668
+ /**
3669
+ * (Colorpicker) Fired by the ConsoleDebug extension whenever it logs something
3670
+ *
3671
+ * @event colorpickerDebug
3672
+ */
3673
+ this.colorpicker.element.trigger({
3674
+ type: 'colorpickerDebug',
3675
+ colorpicker: this.colorpicker,
3676
+ color: this.color,
3677
+ debug: {
3678
+ debugger: this,
3679
+ eventName: eventName,
3680
+ logArgs: args,
3681
+ logMessage: logMessage
3682
+ }
3683
+ });
3684
+ }
3685
+ }, {
3686
+ key: 'resolveColor',
3687
+ value: function resolveColor(color) {
3688
+ this.log('resolveColor()', color);
3689
+ return false;
3690
+ }
3691
+ }, {
3692
+ key: 'onCreate',
3693
+ value: function onCreate(event) {
3694
+ this.log('colorpickerCreate');
3695
+ return _get(Debugger.prototype.__proto__ || Object.getPrototypeOf(Debugger.prototype), 'onCreate', this).call(this, event);
3696
+ }
3697
+ }, {
3698
+ key: 'onDestroy',
3699
+ value: function onDestroy(event) {
3700
+ this.log('colorpickerDestroy');
3701
+ this.eventCounter = 0;
3702
+
3703
+ if (this.colorpicker.hasInput()) {
3704
+ this.colorpicker.input.off('.colorpicker-ext');
3705
+ }
3706
+
3707
+ return _get(Debugger.prototype.__proto__ || Object.getPrototypeOf(Debugger.prototype), 'onDestroy', this).call(this, event);
3708
+ }
3709
+ }, {
3710
+ key: 'onUpdate',
3711
+ value: function onUpdate(event) {
3712
+ this.log('colorpickerUpdate');
3713
+ }
3714
+
3715
+ /**
3716
+ * @listens _change
3717
+ * @param {Event} event
3718
+ */
3719
+
3720
+ }, {
3721
+ key: 'onChangeInput',
3722
+ value: function onChangeInput(event) {
3723
+ this.log('input:change.colorpicker', event.value, event.color);
3724
+ }
3725
+ }, {
3726
+ key: 'onChange',
3727
+ value: function onChange(event) {
3728
+ this.log('colorpickerChange', event.value, event.color);
3729
+ }
3730
+ }, {
3731
+ key: 'onInvalid',
3732
+ value: function onInvalid(event) {
3733
+ this.log('colorpickerInvalid', event.value, event.color);
3734
+ }
3735
+ }, {
3736
+ key: 'onHide',
3737
+ value: function onHide(event) {
3738
+ this.log('colorpickerHide');
3739
+ this.eventCounter = 0;
3740
+ }
3741
+ }, {
3742
+ key: 'onShow',
3743
+ value: function onShow(event) {
3744
+ this.log('colorpickerShow');
3745
+ }
3746
+ }, {
3747
+ key: 'onDisable',
3748
+ value: function onDisable(event) {
3749
+ this.log('colorpickerDisable');
3750
+ }
3751
+ }, {
3752
+ key: 'onEnable',
3753
+ value: function onEnable(event) {
3754
+ this.log('colorpickerEnable');
3755
+ }
3756
+ }]);
3757
+
3758
+ return Debugger;
3759
+ }(_Extension3.default);
3760
+
3761
+ exports.default = Debugger;
3762
+
3763
+ /***/ }),
3764
+ /* 10 */
3765
+ /***/ (function(module, exports, __webpack_require__) {
3766
+
3767
+ "use strict";
3768
+
3769
+
3770
+ Object.defineProperty(exports, "__esModule", {
3771
+ value: true
3772
+ });
3773
+
3774
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
3775
+
3776
+ var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
3777
+
3778
+ var _Extension2 = __webpack_require__(1);
3779
+
3780
+ var _Extension3 = _interopRequireDefault(_Extension2);
3781
+
3782
+ var _jquery = __webpack_require__(0);
3783
+
3784
+ var _jquery2 = _interopRequireDefault(_jquery);
3785
+
3786
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3787
+
3788
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3789
+
3790
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
3791
+
3792
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
3793
+
3794
+ var Preview = function (_Extension) {
3795
+ _inherits(Preview, _Extension);
3796
+
3797
+ function Preview(colorpicker) {
3798
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3799
+
3800
+ _classCallCheck(this, Preview);
3801
+
3802
+ var _this = _possibleConstructorReturn(this, (Preview.__proto__ || Object.getPrototypeOf(Preview)).call(this, colorpicker, Object.assign({}, {
3803
+ template: '<div class="colorpicker-bar colorpicker-preview"><div /></div>',
3804
+ showText: true,
3805
+ format: colorpicker.format
3806
+ }, options)));
3807
+
3808
+ _this.element = (0, _jquery2.default)(_this.options.template);
3809
+ _this.elementInner = _this.element.find('div');
3810
+ return _this;
3811
+ }
3812
+
3813
+ _createClass(Preview, [{
3814
+ key: 'onCreate',
3815
+ value: function onCreate(event) {
3816
+ _get(Preview.prototype.__proto__ || Object.getPrototypeOf(Preview.prototype), 'onCreate', this).call(this, event);
3817
+ this.colorpicker.picker.append(this.element);
3818
+ }
3819
+ }, {
3820
+ key: 'onUpdate',
3821
+ value: function onUpdate(event) {
3822
+ _get(Preview.prototype.__proto__ || Object.getPrototypeOf(Preview.prototype), 'onUpdate', this).call(this, event);
3823
+
3824
+ this.elementInner.css('backgroundColor', event.color.toRgbString());
3825
+
3826
+ if (this.options.showText) {
3827
+ this.elementInner.html(event.color.toString(this.options.format || this.colorpicker.format));
3828
+
3829
+ if (event.color.isDark()) {
3830
+ this.elementInner.css('color', 'white');
3831
+ } else {
3832
+ this.elementInner.css('color', 'black');
3833
+ }
3834
+ }
3835
+ }
3836
+ }]);
3837
+
3838
+ return Preview;
3839
+ }(_Extension3.default);
3840
+
3841
+ exports.default = Preview;
3842
+
3843
+ /***/ }),
3844
+ /* 11 */
3845
+ /***/ (function(module, exports, __webpack_require__) {
3846
+
3847
+ "use strict";
3848
+
3849
+
3850
+ Object.defineProperty(exports, "__esModule", {
3851
+ value: true
3852
+ });
3853
+
3854
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
3855
+
3856
+ var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
3857
+
3858
+ var _Palette2 = __webpack_require__(2);
3859
+
3860
+ var _Palette3 = _interopRequireDefault(_Palette2);
3861
+
3862
+ var _jquery = __webpack_require__(0);
3863
+
3864
+ var _jquery2 = _interopRequireDefault(_jquery);
3865
+
3866
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3867
+
3868
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3869
+
3870
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
3871
+
3872
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
3873
+
3874
+ var defaults = {
3875
+ barTemplate: '<div class="colorpicker-bar colorpicker-swatches"></div>',
3876
+ swatchTemplate: '<i class="colorpicker-swatch"></i>'
3877
+ };
3878
+
3879
+ var Swatches = function (_Palette) {
3880
+ _inherits(Swatches, _Palette);
3881
+
3882
+ function Swatches(colorpicker) {
3883
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3884
+
3885
+ _classCallCheck(this, Swatches);
3886
+
3887
+ return _possibleConstructorReturn(this, (Swatches.__proto__ || Object.getPrototypeOf(Swatches)).call(this, colorpicker, Object.assign({}, defaults, options)));
3888
+ }
3889
+
3890
+ _createClass(Swatches, [{
3891
+ key: 'isEnabled',
3892
+ value: function isEnabled() {
3893
+ return this.getLength() > 0;
3894
+ }
3895
+ }, {
3896
+ key: 'onCreate',
3897
+ value: function onCreate(event) {
3898
+ var _this2 = this;
3899
+
3900
+ _get(Swatches.prototype.__proto__ || Object.getPrototypeOf(Swatches.prototype), 'onCreate', this).call(this, event);
3901
+
3902
+ if (!this.isEnabled()) {
3903
+ return;
3904
+ }
3905
+
3906
+ var colorpicker = this.colorpicker,
3907
+ swatchContainer = (0, _jquery2.default)(this.options.barTemplate),
3908
+ isAliased = this.options.namesAsValues === true && !Array.isArray(this.colors);
3909
+
3910
+ _jquery2.default.each(this.colors, function (name, value) {
3911
+ var $swatch = (0, _jquery2.default)(_this2.options.swatchTemplate).css('background-color', value).attr('data-name', name).attr('data-value', value).attr('title', name + ': ' + value);
3912
+
3913
+ $swatch.on('mousedown.colorpicker touchstart.colorpicker', function (e) {
3914
+ e.preventDefault();
3915
+ colorpicker.setValue(isAliased ? (0, _jquery2.default)(this).data('name') : (0, _jquery2.default)(this).data('value'));
3916
+ });
3917
+ swatchContainer.append($swatch);
3918
+ });
3919
+
3920
+ colorpicker.picker.append(swatchContainer);
3921
+ }
3922
+ }]);
3923
+
3924
+ return Swatches;
3925
+ }(_Palette3.default);
3926
+
3927
+ exports.default = Swatches;
3928
+
3929
+ /***/ })
3930
+ /******/ ]);
3931
+ });
3932
+ //# sourceMappingURL=bootstrap-colorpicker.js.map
includes/colorpicker/js/bootstrap-colorpicker.js.map ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Bootstrap Colorpicker - Simple and customizable colorpicker component for Twitter Bootstrap.
3
+ * @package bootstrap-colorpicker
4
+ * @version v3.0.0-wip
5
+ * @license MIT
6
+ * @link https://farbelous.github.io/bootstrap-colorpicker/
7
+ * @link https://github.com/farbelous/bootstrap-colorpicker.git
8
+ */
9
+ {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 32081b809d19519bb29c","webpack:///external \"jQuery\"","webpack:///./src/js/Extension.js","webpack:///./src/js/extensions/Palette.js","webpack:///./src/js/jquery-plugin.js","webpack:///./src/js/Colorpicker.js","webpack:///./src/js/Color.js","webpack:///./node_modules/tinycolor2/tinycolor.js","webpack:///./src/js/options.js","webpack:///./src/js/extensions/index.js","webpack:///./src/js/extensions/Debugger.js","webpack:///./src/js/extensions/Preview.js","webpack:///./src/js/extensions/Swatches.js"],"names":["Extension","colorpicker","options","element","length","Error","on","proxy","onCreate","onDestroy","onUpdate","onChange","onInvalid","onShow","onHide","onEnable","onDisable","color","event","off","defaults","colors","namesAsValues","Palette","Object","assign","Array","isArray","keys","getLength","indexOf","toUpperCase","toLowerCase","getValue","getName","value","defaultValue","name","hasOwnProperty","plugin","fn","option","apiArgs","prototype","slice","call","arguments","isSingleElement","returnValue","$jq","each","$this","inst","data","isFunction","apply","constructor","colorPickerIdCounter","Colorpicker","id","addClass","attr","extensions","component","find","container","currentSlider","mousePointer","left","top","lastEvent","e","input","is","debug","push","forEach","ext","addExtension","colorValue","createColor","format","disabled","$picker","picker","template","customClass","inline","horizontal","useAlpha","hasColor","hasTransparency","align","target","currentTarget","preventDefault","_mousedown","appendTo","hasInput","_keyup","_change","show","hide","has","update","trigger","type","extensionName","ExtensionClass","config","remove","removeData","removeClass","str","toCssColorString","useHashPrefix","replace","_resolveColor","toString","window","document","body","offset","outerWidth","css","outerHeight","isVisible","isDisabled","_reposition","stopPropagation","isHidden","parents","hasClass","val","toInputColorString","prop","vertical","sl","sliders","slidersHorz","saturationGuide","hueGuide","alphaGuide","hsva","hsvaRatio","hue","maxTop","maxLeft","h","alpha","a","saturation","v","s","getHueOnlyCopy","toHexString","icn","eq","force","_shouldUpdate","_updateComponent","preventInputUpdate","autoInputFallback","_updateInput","_updatePicker","fallbackColor","candidates","map","item","equals","shouldForceUpdate","useFallback","isValid","invalidColor","fallback","previous","isAlphaEnabled","setAlpha","prevHsva","setHueRatio","extResolvedColor","resolveColor","pageX","pageY","originalEvent","touches","zone","closest","extend","guide","style","_mousemove","_mouseup","getCopy","Math","max","min","callLeft","callTop","setValue","match","enableHex8","unwrapColor","r","_r","g","_g","b","_b","_a","getCompatibleFormat","String","Color","_tc_id","_format","gradientType","_gradientType","toHsv","hsv","_originalInput","_hbak","_roundA","_ok","importRgb","importHsv","setHue","setSaturation","setBrightness","colorStr","isTransparent","showText","Debugger","Preview","Swatches","eventCounter","onChangeInput","eventName","args","logMessage","debugger","logArgs","log","elementInner","append","toRgbString","html","isDark","barTemplate","swatchTemplate","isEnabled","swatchContainer","isAliased","$swatch"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AC7DA,+C;;;;;;;ACAA;;;;;;;;AAEA;;;;;;;;AAEA;;;IAGMA,S;AACJ;;;;AAIA,qBAAYC,WAAZ,EAAuC;AAAA,QAAdC,OAAc,uEAAJ,EAAI;;AAAA;;AACrC;;;AAGA,SAAKD,WAAL,GAAmBA,WAAnB;AACA;;;AAGA,SAAKC,OAAL,GAAeA,OAAf;;AAEA,QAAI,EAAE,KAAKD,WAAL,CAAiBE,OAAjB,IAA4B,KAAKF,WAAL,CAAiBE,OAAjB,CAAyBC,MAAvD,CAAJ,EAAoE;AAClE,YAA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BjI,MAApB,CAAT,GAAuC,KAAKA,MAArD;;AAEA,UAAImJ,kHAA0BnJ,MAA1B,CAAJ;;AAEA,UAAImJ,YAAYA,SAAS5B,KAAT,CAAe,mBAAf,CAAhB,EAAqD;AACnD;AACA,YAAI,KAAK6B,aAAL,MAAyB,KAAKzB,EAAL,KAAY,CAArC,IAA4C,KAAKE,EAAL,KAAY,CAAxD,IAA+D,KAAKE,EAAL,KAAY,CAA/E,EAAmF;AACjF,iBAAO,aAAP;AACD;AACF;;AAED,aAAOoB,QAAP;AACD;;;;;;kBAGYhB,K;;;;;;ACjSf;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,oBAAoB;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,8BAA8B;AACpD,sBAAsB,8BAA8B;AACpD,sBAAsB,8BAA8B;;AAEpD;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+BAA+B,mBAAmB,OAAO;AACzD,+BAA+B,mBAAmB,OAAO;AACzD,+BAA+B,mBAAmB,OAAO;AACzD;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,gBAAgB;AAChB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,gBAAgB;AAChB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,gBAAgB;AAChB,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,gBAAgB;AAChB,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,UAAU;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD,wCAAwC;AACxC,wCAAwC;AACxC;;AAEA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA;AACA,eAAe,UAAU;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AACA,sDAAsD;AACtD,wCAAwC;AACxC,wCAAwC;AACxC;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA,eAAe,UAAU;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,yCAAyC;AAC5D,mBAAmB,yCAAyC;AAC5D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wCAAwC;AAC3D,mBAAmB,yCAAyC;AAC5D,mBAAmB,yCAAyC;AAC5D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uCAAuC;AAC1D,mBAAmB,wCAAwC;AAC3D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+DAA+D,WAAW;AAC1E;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2DAA2D,wBAAwB;;AAEnF;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,8EAA8E,4BAA4B,gBAAgB;AAC1H,8EAA8E,2BAA2B,gBAAgB;AACzH,qDAAqD,oDAAoD,gBAAgB;AACzH,qDAAqD,oDAAoD,gBAAgB;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA,oDAAoD,0BAA0B;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;;AAEA,KAAK,kBAAkB,YAAY,kBAAkB;AACrD;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4BAA4B,YAAY;;AAExC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,EAAE,cAAc,EAAE,cAAc,EAAE;AACjE,+BAA+B,EAAE,cAAc,EAAE,cAAc,EAAE;AACjE,+BAA+B,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE;AACjF,+BAA+B,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE;AACjF;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC,UAAU,OAAO,UAAU,OAAO,SAAS;AACnF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,2CAA2C;AAC3C;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAwB,kBAAkB;AAAA;AAC1C;AACA;AACA;AACA;AACA;;AAEA,CAAC;;;;;;;;AC1qCD;AACA;;;;AAIA;;;;;;;kBAGe;AACb;;;;;AAKA1I,SAAO,KANM;AAOb;;;;;;AAMAzD,SAAO,KAbM;AAcb;;;;;;;;;;AAUAgE,UAAQ,KAxBK;AAyBb;;;;;;;;AAQAO,cAAY,KAjCC;AAkCb;;;;;;AAMAD,UAAQ,KAxCK;AAyCb;;;;;;AAMAf,S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,CAAC,KAAKuO,SAAL,EAAL,EAAuB;AACrB;AACD;;AAED,UAAIxP,cAAc,KAAKA,WAAvB;AAAA,UACEyP,kBAAkB,sBAAE,KAAKxP,OAAL,CAAaqP,WAAf,CADpB;AAAA,UAEEI,YAAa,KAAKzP,OAAL,CAAaoB,aAAb,KAA+B,IAAhC,IAAyC,CAACI,MAAMC,OAAN,CAAc,KAAKN,MAAnB,CAFxD;;AAIA,uBAAE6B,IAAF,CAAO,KAAK7B,MAAZ,EAAoB,UAACgB,IAAD,EAAOF,KAAP,EAAiB;AACnC,YAAIyN,UAAU,sBAAE,OAAK1P,OAAL,CAAasP,cAAf,EACX5H,GADW,CACP,kBADO,EACazF,KADb,EAEX0B,IAFW,CAEN,WAFM,EAEOxB,IAFP,EAGXwB,IAHW,CAGN,YAHM,EAGQ1B,KAHR,EAIX0B,IAJW,CAIN,OAJM,EAIMxB,IAJN,UAIeF,KAJf,CAAd;;AAMAyN,gBAAQtP,EAAR,CAAW,8CAAX,EACE,UAAUiE,CAAV,EAAa;AACXA,YAAEwB,cAAF;AACA9F,sBAAYsM,QAAZ,CAAqBoD,YAAY,sBAAE,IAAF,EAAQtM,IAAR,CAAa,MAAb,CAAZ,GAAmC,sBAAE,IAAF,EAAQA,IAAR,CAAa,OAAb,CAAxD;AACD,SAJH;AAMAqM,wBAAgBP,MAAhB,CAAuBS,OAAvB;AACD,OAdD;;AAgBA3P,kBAAYmF,MAAZ,CAAmB+J,MAAnB,CAA0BO,eAA1B;AACD;;;;;;kBAGYjB,Q","file":"bootstrap-colorpicker.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jQuery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"bootstrap-colorpicker\", [\"jQuery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"bootstrap-colorpicker\"] = factory(require(\"jQuery\"));\n\telse\n\t\troot[\"bootstrap-colorpicker\"] = factory(root[\"jQuery\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 32081b809d19519bb29c","module.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 0\n// module chunks = 0 1","'use strict';\n\nimport $ from 'jquery';\n\n/**\n * Colorpicker extension class.\n */\nclass Extension {\n /**\n * @param {Colorpicker} colorpicker\n * @param {Object} options\n */\n constructor(colorpicker, options = {}) {\n /**\n * @type {Colorpicker}\n */\n this.colorpicker = colorpicker;\n /**\n * @type {Object}\n */\n this.options = options;\n\n if (!(this.colorpicker.element && this.colorpicker.element.length)) {\n throw new Error('Extension: this.colorpicker.element is not valid');\n }\n\n this.colorpicker.element.on('colorpickerCreate.colorpicker-ext', $.proxy(this.onCreate, this));\n this.colorpicker.element.on('colorpickerDestroy.colorpicker-ext', $.proxy(this.onDestroy, this));\n this.colorpicker.element.on('colorpickerUpdate.colorpicker-ext', $.proxy(this.onUpdate, this));\n this.colorpicker.element.on('colorpickerChange.colorpicker-ext', $.proxy(this.onChange, this));\n this.colorpicker.element.on('colorpickerInvalid.colorpicker-ext', $.proxy(this.onInvalid, this));\n this.colorpicker.element.on('colorpickerShow.colorpicker-ext', $.proxy(this.onShow, this));\n this.colorpicker.element.on('colorpickerHide.colorpicker-ext', $.proxy(this.onHide, this));\n this.colorpicker.element.on('colorpickerEnable.colorpicker-ext', $.proxy(this.onEnable, this));\n this.colorpicker.element.on('colorpickerDisable.colorpicker-ext', $.proxy(this.onDisable, this));\n }\n\n /**\n * Function called every time a new color needs to be created.\n * Return false to skip this resolver and continue with other extensions' ones\n * or return anything else to consider the color resolved.\n *\n * @param {Color|String|*} color\n * @return {Color|String|*}\n */\n resolveColor(color) {\n return false;\n }\n\n /**\n * @listens colorpickerCreate\n * @param {Event} event\n */\n onCreate(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerDestroy\n * @param {Event} event\n */\n onDestroy(event) {\n this.colorpicker.element.off('.colorpicker-ext');\n }\n\n /**\n * @listens colorpickerUpdate\n * @param {Event} event\n */\n onUpdate(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerChange\n * @param {Event} event\n */\n onChange(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerInvalid\n * @param {Event} event\n */\n onInvalid(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerHide\n * @param {Event} event\n */\n onHide(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerShow\n * @param {Event} event\n */\n onShow(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerDisable\n * @param {Event} event\n */\n onDisable(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerEnable\n * @param {Event} event\n */\n onEnable(event) {\n // to be extended\n }\n}\n\nexport default Extension;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/Extension.js","'use strict';\n\nimport Extension from 'Extension';\n\nlet defaults = {\n /**\n * Key-value pairs defining a color alias and its CSS color representation.\n *\n * They can also be just an array of values. In that case, no special names are used, only the real colors.\n *\n * @type {Object|Array}\n * @default null\n * @example\n * {\n * 'black': '#000000',\n * 'white': '#ffffff',\n * 'red': '#FF0000',\n * 'default': '#777777',\n * 'primary': '#337ab7',\n * 'success': '#5cb85c',\n * 'info': '#5bc0de',\n * 'warning': '#f0ad4e',\n * 'danger': '#d9534f'\n * }\n *\n * @example ['#f0ad4e', '#337ab7', '#5cb85c']\n */\n colors: null,\n /**\n * If true, the when a color swatch is selected the name (alias) will be used as input value,\n * otherwise the swatch real color value will be used.\n *\n * @type {boolean}\n * @default true\n */\n namesAsValues: true\n};\n\nclass Palette extends Extension {\n\n /**\n * @returns {Object|Array}\n */\n get colors() {\n return this.options.colors;\n }\n\n constructor(colorpicker, options = {}) {\n super(colorpicker, Object.assign({}, defaults, options));\n\n if ((!Array.isArray(this.options.colors)) && (typeof this.options.colors !== 'object')) {\n this.options.colors = null;\n }\n }\n\n /**\n * @returns {int}\n */\n getLength() {\n if (!this.options.colors) {\n return 0;\n }\n\n if (Array.isArray(this.options.colors)) {\n return this.options.colors.length;\n }\n\n if (typeof this.options.colors === 'object') {\n return Object.keys(this.options.colors).length;\n }\n\n return 0;\n }\n\n resolveColor(color) {\n if (this.getLength() <= 0) {\n return false;\n }\n\n if (Array.isArray(this.options.colors)) {\n if (this.options.colors.indexOf(color) >= 0) {\n return color;\n }\n if (this.options.colors.indexOf(color.toUpperCase()) >= 0) {\n return color.toUpperCase();\n }\n if (this.options.colors.indexOf(color.toLowerCase()) >= 0) {\n return color.toLowerCase();\n }\n return false;\n }\n\n if (typeof this.options.colors !== 'object') {\n return false;\n }\n\n if (!this.options.namesAsValues) {\n return this.getValue(color, false);\n }\n return this.getName(color, this.getName('#' + color, this.getValue(color, false)));\n }\n\n /**\n * Given a color value, returns the corresponding color name or defaultValue.\n *\n * @param {String} value\n * @param {*} defaultValue\n * @returns {*}\n */\n getName(value, defaultValue = false) {\n if (!(typeof value === 'string') || !this.options.colors) {\n return defaultValue;\n }\n for (let name in this.options.colors) {\n if (!this.options.colors.hasOwnProperty(name)) {\n continue;\n }\n if (this.options.colors[name].toLowerCase() === value.toLowerCase()) {\n return name;\n }\n }\n return defaultValue;\n }\n\n /**\n * Given a color name, returns the corresponding color value or defaultValue.\n *\n * @param {String} name\n * @param {*} defaultValue\n * @returns {*}\n */\n getValue(name, defaultValue = false) {\n if (!(typeof name === 'string') || !this.options.colors) {\n return defaultValue;\n }\n if (this.options.colors.hasOwnProperty(name)) {\n return this.options.colors[name];\n }\n return defaultValue;\n }\n}\n\nexport default Palette;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/extensions/Palette.js","'use strict';\n\nimport Colorpicker from './Colorpicker';\nimport $ from 'jquery';\n\nlet plugin = 'colorpicker';\n\n$[plugin] = Colorpicker;\n\n$.fn[plugin] = function (option) {\n let apiArgs = Array.prototype.slice.call(arguments, 1),\n isSingleElement = (this.length === 1),\n returnValue = null;\n\n let $jq = this.each(function () {\n let $this = $(this),\n inst = $this.data(plugin),\n options = ((typeof option === 'object') ? option : {});\n\n if (!inst) {\n inst = new Colorpicker(this, options);\n $this.data(plugin, inst);\n }\n\n if (typeof option === 'string') {\n if (option === 'colorpicker') {\n returnValue = inst;\n } else if ($.isFunction(inst[option])) {\n returnValue = inst[option].apply(inst, apiArgs);\n } else { // its a property ?\n if (apiArgs.length) {\n // set property\n inst[option] = apiArgs[0];\n }\n returnValue = inst[option];\n }\n } else {\n returnValue = $this;\n }\n });\n\n return isSingleElement ? returnValue : $jq;\n};\n\n$.fn[plugin].constructor = Colorpicker;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/jquery-plugin.js","'use strict';\n\nimport Color from './Color';\nimport Extension from './Extension';\nimport defaults from './options';\nimport bundledExtensions from 'extensions';\nimport $ from 'jquery';\n\nlet colorPickerIdCounter = 0;\n\n/**\n * Colorpicker widget class\n */\nclass Colorpicker {\n /**\n * Color class\n *\n * @static\n * @type {Color}\n */\n static get Color() {\n return Color;\n }\n\n /**\n * Extension class\n *\n * @static\n * @type {Extension}\n */\n static get Extension() {\n return Extension;\n }\n\n /**\n * Colorpicker bundled extension classes\n *\n * @static\n * @type {{Extension}}\n */\n static get Extensions() {\n return bundledExtensions;\n }\n\n /**\n * color getter\n *\n * @type {Color|null}\n */\n get color() {\n return this.element.data('color');\n }\n\n /**\n * color setter\n *\n * @ignore\n * @param {Color|null} value\n */\n set color(value) {\n this.element.data('color', value);\n }\n\n /**\n * @fires colorpickerCreate\n * @param {Object|String} element\n * @param {Object} options\n * @constructor\n */\n constructor(element, options) {\n colorPickerIdCounter += 1;\n /**\n * The colorpicker instance number\n * @type {number}\n */\n this.id = colorPickerIdCounter;\n\n /**\n * @type {*|jQuery}\n */\n this.element = $(element).addClass('colorpicker-element');\n this.element.attr('data-colorpicker-id', this.id);\n\n /**\n * @type {defaults}\n */\n this.options = Object.assign({}, defaults, options, this.element.data());\n\n /**\n * @type {Extension[]}\n */\n this.extensions = [];\n\n if (!Array.isArray(this.options.extensions)) {\n this.options.extensions = [];\n }\n\n /**\n * @type {*|jQuery}\n */\n this.component = this.options.component;\n this.component = (this.component !== false) ? this.element.find(this.component) : false;\n if (this.component && (this.component.length === 0)) {\n this.component = false;\n }\n\n /**\n * @type {*|jQuery}\n */\n this.container = (this.options.container === true) ? this.element : this.options.container;\n this.container = (this.container !== false) ? $(this.container) : false;\n\n /**\n * @type {*|String}\n * @private\n */\n this.currentSlider = null;\n\n /**\n * @type {{left: number, top: number}}\n * @private\n */\n this.mousePointer = {\n left: 0,\n top: 0\n };\n\n /**\n * Latest external event\n *\n * @type {{name: String, e: *}}\n * @private\n */\n this.lastEvent = {\n name: null,\n e: null\n };\n\n // Is the element an input? Should we search inside for any input?\n /**\n * @type {*|jQuery}\n */\n this.input = this.element.is('input') ? this.element : (this.options.input ?\n this.element.find(this.options.input) : false);\n\n if (this.input && (this.input.length === 0)) {\n this.input = false;\n }\n\n if (this.options.debug) {\n this.options.extensions.push({name: 'Debugger'});\n }\n\n // Register extensions\n this.options.extensions.forEach((ext) => {\n this.addExtension(ext.name, bundledExtensions[ext.name.toLowerCase()], ext);\n });\n\n let colorValue = this.options.color !== false ? this.options.color : this.getValue();\n\n this.color = colorValue ? this.createColor(colorValue) : false;\n\n if (this.options.format === false) {\n // If format is false, use the first parsed one from now on\n this.options.format = this.color.format;\n }\n\n /**\n * @type {boolean}\n * @private\n */\n this.disabled = false;\n\n // Setup picker\n let $picker = this.picker = $(this.options.template);\n\n if (this.options.customClass) {\n $picker.addClass(this.options.customClass);\n }\n if (this.options.inline) {\n $picker.addClass('colorpicker-inline colorpicker-visible');\n } else {\n $picker.addClass('colorpicker-hidden');\n }\n if (this.options.horizontal) {\n $picker.addClass('colorpicker-horizontal');\n }\n\n if (\n (this.options.useAlpha || (this.hasColor() && this.color.hasTransparency())) &&\n (this.options.useAlpha !== false)\n ) {\n this.options.useAlpha = true;\n $picker.addClass('colorpicker-with-alpha');\n }\n\n if (this.options.align === 'right') {\n $picker.addClass('colorpicker-right');\n }\n if (this.options.inline === true) {\n $picker.addClass('colorpicker-no-arrow');\n }\n\n // Prevent closing the colorpicker when clicking on itself\n $picker.on('mousedown.colorpicker touchstart.colorpicker', $.proxy(function (e) {\n if (e.target === e.currentTarget) {\n e.preventDefault();\n }\n }, this));\n\n // Bind click/tap events on the sliders\n $picker.find('.colorpicker-saturation, .colorpicker-hue, .colorpicker-alpha')\n .on('mousedown.colorpicker touchstart.colorpicker', $.proxy(this._mousedown, this));\n\n $picker.appendTo(this.container ? this.container : $('body'));\n\n // Bind other events\n if (this.hasInput()) {\n this.input.on({\n 'keyup.colorpicker': $.proxy(this._keyup, this)\n });\n this.input.on({\n 'change.colorpicker': $.proxy(this._change, this)\n });\n if (this.component === false) {\n this.element.on({\n 'focus.colorpicker': $.proxy(this.show, this)\n });\n }\n if (this.options.inline === false) {\n this.element.on({\n 'focusout.colorpicker': $.proxy(this.hide, this)\n });\n }\n }\n\n if (this.component !== false) {\n this.component.on({\n 'click.colorpicker': $.proxy(this.show, this)\n });\n }\n\n if ((this.hasInput() === false) && (this.component === false) && !this.element.has('.colorpicker')) {\n this.element.on({\n 'click.colorpicker': $.proxy(this.show, this)\n });\n }\n\n // for HTML5 input[type='color']\n if (this.hasInput() && (this.component !== false) && (this.input.attr('type') === 'color')) {\n this.input.on({\n 'click.colorpicker': $.proxy(this.show, this),\n 'focus.colorpicker': $.proxy(this.show, this)\n });\n }\n\n // Update if there is a color option\n this.update(this.options.color !== false);\n\n $($.proxy(function () {\n /**\n * (Colorpicker) When the Colorpicker instance has been created and the DOM is ready.\n *\n * @event colorpickerCreate\n */\n this.element.trigger({\n type: 'colorpickerCreate',\n colorpicker: this,\n color: this.color\n });\n }, this));\n }\n\n /**\n * Creates and registers the given extension\n *\n * @param {String|Extension} extensionName\n * @param {Extension} ExtensionClass\n * @param {Object} [config]\n * @returns {Extension}\n */\n addExtension(extensionName, ExtensionClass, config = {}) {\n let ext = (extensionName instanceof Extension) ? extensionName : new ExtensionClass(this, config);\n\n this.extensions.push(ext);\n return ext;\n }\n\n /**\n * Destroys the current instance\n *\n * @fires colorpickerDestroy\n */\n destroy() {\n this.picker.remove();\n this.element.removeData('colorpicker', 'color').off('.colorpicker');\n if (this.hasInput()) {\n this.input.off('.colorpicker');\n }\n if (this.component !== false) {\n this.component.off('.colorpicker');\n }\n this.element.removeClass('colorpicker-element');\n\n /**\n * (Colorpicker) When the instance is destroyed with all events unbound.\n *\n * @event colorpickerDestroy\n */\n this.element.trigger({\n type: 'colorpickerDestroy',\n colorpicker: this,\n color: this.color\n });\n }\n\n /**\n * Returns true if the current color object is an instance of Color, false otherwise.\n * @returns {boolean}\n */\n hasColor() {\n return this.color instanceof Color;\n }\n\n /**\n * @returns {*|String|Color}\n */\n get fallbackColor() {\n return this.options.fallbackColor ? this.options.fallbackColor : (this.hasColor() ? this.color : '#000');\n }\n\n get format() {\n if (this.options.format) {\n return this.options.format;\n }\n\n if (this.hasColor() && this.color.hasTransparency() && this.color.format.match(/^hex/)) {\n return this.options.enableHex8 ? 'hex8' : (this.isAlphaEnabled() ? 'rgba' : 'hex');\n }\n\n if (this.hasColor()) {\n return this.color.format;\n }\n\n return null;\n }\n\n /**\n * Formatted color string, with the formatting options applied\n * (e.g. useHashPrefix)\n * @returns {String}\n */\n toInputColorString() {\n let str = this.toCssColorString();\n\n if (!str) {\n return str;\n }\n\n if (this.options.useHashPrefix === false) {\n str = str.replace(/^#/g, '');\n }\n\n return this._resolveColor(str);\n }\n\n /**\n * Formatted color string, suitable for CSS\n * @returns {String}\n */\n toCssColorString() {\n if (!this.hasColor()) {\n return '';\n }\n return this.color.toString(this.format);\n }\n\n /**\n * If the widget is not inside a container or inline, rearranges its position relative to its element offset.\n *\n * @param {Event} [e]\n * @private\n * @returns {boolean} Returns false if the widget is inside a container or inline, true otherwise\n */\n _reposition(e) {\n this.lastEvent.name = 'reposition';\n this.lastEvent.e = e;\n\n if (this.options.inline !== false || this.options.container) {\n return false;\n }\n let type = this.container && this.container[0] !== window.document.body ? 'position' : 'offset';\n let element = this.component || this.element;\n let offset = element[type]();\n\n if (this.options.align === 'right') {\n offset.left -= this.picker.outerWidth() - element.outerWidth();\n }\n this.picker.css({\n top: offset.top + element.outerHeight(),\n left: offset.left\n });\n return true;\n }\n\n /**\n * Shows the colorpicker widget if hidden.\n * If the input is disabled this call will be ignored.\n *\n * @fires colorpickerShow\n * @param {Event} [e]\n * @returns {boolean} True if was hidden and afterwards visible, false if nothing happened.\n */\n show(e) {\n this.lastEvent.name = 'show';\n this.lastEvent.e = e;\n\n if (this.isVisible() || this.isDisabled()) {\n // Don't show the widget if it's already visible or it is disabled\n return false;\n }\n this.picker.addClass('colorpicker-visible').removeClass('colorpicker-hidden');\n\n this._reposition(e);\n $(window).on('resize.colorpicker', $.proxy(this._reposition, this));\n\n if (e && (!this.hasInput() || this.input.attr('type') === 'color')) {\n if (e.stopPropagation && e.preventDefault) {\n e.stopPropagation();\n e.preventDefault();\n }\n }\n if ((this.component || !this.input) && (this.options.inline === false)) {\n $(window.document).on({\n 'mousedown.colorpicker': $.proxy(this.hide, this)\n });\n }\n\n /**\n * (Colorpicker) When show() is called and the widget can be shown.\n *\n * @event colorpickerShow\n */\n this.element.trigger({\n type: 'colorpickerShow',\n colorpicker: this,\n color: this.color\n });\n\n return true;\n }\n\n /**\n * Hides the colorpicker widget.\n * Hide is prevented when it is triggered by an event whose target element has been clicked/touched.\n *\n * @fires colorpickerHide\n * @param {Event} [e]\n * @returns {boolean} True if was visible and afterwards hidden, false if nothing happened.\n */\n hide(e) {\n this.lastEvent.name = 'hide';\n this.lastEvent.e = e;\n\n if (this.isHidden()) {\n // Do not trigger if already hidden\n return false;\n }\n if ((typeof e !== 'undefined') && e.target) {\n // Prevent hide if triggered by an event and an element inside the colorpicker has been clicked/touched\n if (\n $(e.currentTarget).parents('.colorpicker').length > 0 ||\n $(e.target).parents('.colorpicker').length > 0\n ) {\n return false;\n }\n }\n this.picker.addClass('colorpicker-hidden').removeClass('colorpicker-visible');\n $(window).off('resize.colorpicker', this._reposition);\n $(window.document).off({\n 'mousedown.colorpicker': this.hide\n });\n\n /**\n * (Colorpicker) When hide() is called and the widget can be hidden.\n *\n * @event colorpickerHide\n */\n this.element.trigger({\n type: 'colorpickerHide',\n colorpicker: this,\n color: this.color\n });\n return true;\n }\n\n /**\n * Returns true if the colorpicker element has the colorpicker-visible class and not the colorpicker-hidden one.\n * False otherwise.\n *\n * @returns {boolean}\n */\n isVisible() {\n return this.picker.hasClass('colorpicker-visible') && !this.picker.hasClass('colorpicker-hidden');\n }\n\n /**\n * Returns true if the colorpicker element has the colorpicker-hidden class and not the colorpicker-visible one.\n * False otherwise.\n *\n * @returns {boolean}\n */\n isHidden() {\n return this.picker.hasClass('colorpicker-hidden') && !this.picker.hasClass('colorpicker-visible');\n }\n\n /**\n * If the input element is present, it updates the value with the current color object color string.\n * If value is set, this method fires a \"change\" event on the input element.\n *\n * @fires change\n * @private\n */\n _updateInput() {\n if (this.hasInput()) {\n let val = this.toInputColorString();\n\n if (val === this.input.prop('value')) {\n // No need to set value or trigger any event if nothing changed\n return;\n }\n\n this.input.prop('value', val ? val : '');\n\n /**\n * (Input) Triggered on the input element when a new color is selected.\n *\n * @event change\n */\n this.input.trigger({\n type: 'change',\n colorpicker: this,\n color: this.color,\n value: val\n });\n }\n }\n\n /**\n * Changes the color adjustment bars using the current color object information.\n * @private\n */\n _updatePicker() {\n if (!this.hasColor()) {\n return;\n }\n\n let vertical = (this.options.horizontal === false),\n sl = vertical ? this.options.sliders : this.options.slidersHorz;\n\n let saturationGuide = this.picker.find('.colorpicker-saturation .colorpicker-guide'),\n hueGuide = this.picker.find('.colorpicker-hue .colorpicker-guide'),\n alphaGuide = this.picker.find('.colorpicker-alpha .colorpicker-guide');\n\n let hsva = this.color.hsvaRatio;\n\n if (hueGuide.length) {\n hueGuide.css(vertical ? 'top' : 'left', (vertical ? sl.hue.maxTop : sl.hue.maxLeft) * (1 - hsva.h));\n }\n\n if (alphaGuide.length) {\n alphaGuide.css(vertical ? 'top' : 'left', (vertical ? sl.alpha.maxTop : sl.alpha.maxLeft) * (1 - hsva.a));\n }\n\n if (saturationGuide.length) {\n saturationGuide.css({\n 'top': sl.saturation.maxTop - hsva.v * sl.saturation.maxTop,\n 'left': hsva.s * sl.saturation.maxLeft\n });\n }\n\n this.picker.find('.colorpicker-saturation')\n .css('backgroundColor', this.color.getHueOnlyCopy().toHexString()); // we only need hue\n\n this.picker.find('.colorpicker-alpha')\n .css('backgroundColor', this.color.toString('hex6')); // we don't need alpha\n }\n\n /**\n * If the component element is present, its background color is updated\n * @private\n */\n _updateComponent() {\n if (!this.hasColor()) {\n return;\n }\n\n if (this.component !== false) {\n let icn = this.component.find('i').eq(0);\n\n if (icn.length > 0) {\n icn.css({\n 'backgroundColor': this.toCssColorString()\n });\n } else {\n this.component.css({\n 'backgroundColor': this.toCssColorString()\n });\n }\n }\n }\n\n /**\n * @private\n * @returns {boolean}\n */\n _shouldUpdate() {\n return (this.hasColor() && ((this.getValue(false) !== false)));\n }\n\n /**\n * Updated the component color, the input value and the widget if a color is present.\n *\n * If force is true, it is updated anyway.\n *\n * @fires colorpickerUpdate\n * @param {boolean} [force]\n */\n update(force = false) {\n if (this._shouldUpdate() || (force === true)) {\n // Update only if the current value (from input or data) is not empty\n this._updateComponent();\n\n // Do not update input when autoInputFallback is disabled and last event is keyup.\n let preventInputUpdate = (\n (this.options.autoInputFallback !== true) &&\n (\n // this.isInvalidColor() || // prevent also on invalid color (on create, leaves invalid colors)\n (this.lastEvent.name === 'keyup')\n )\n );\n\n if (!preventInputUpdate) {\n this._updateInput();\n }\n\n this._updatePicker();\n\n /**\n * (Colorpicker) Fired when the widget is updated.\n *\n * @event colorpickerUpdate\n */\n this.element.trigger({\n type: 'colorpickerUpdate',\n colorpicker: this,\n color: this.color\n });\n }\n }\n\n /**\n * Returns the color string from the input value or the 'data-color' attribute of the input or element.\n * If empty, it returns the defaultValue parameter.\n *\n * @param {String|*} [defaultValue]\n * @returns {String|*}\n */\n getValue(defaultValue = null) {\n defaultValue = (typeof defaultValue === 'undefined') ? this.fallbackColor : defaultValue;\n let candidates = [], val = false;\n\n if (this.hasInput()) {\n candidates.push(this.input.val());\n candidates.push(this.input.data('color'));\n }\n candidates.push(this.element.data('color'));\n\n candidates.map((item) => {\n if (item && (val === false)) {\n val = item;\n }\n });\n\n val = ((val === false) ? defaultValue : val);\n\n if (val instanceof Color) {\n return val.toString(this.format);\n }\n\n return val;\n }\n\n /**\n * Sets the color manually\n *\n * @fires colorpickerChange\n * @param {String|Color} val\n */\n setValue(val) {\n if (this.hasColor() && this.color.equals(val)) {\n // equal color object\n return;\n }\n\n let color = val ? this.createColor(val) : false;\n\n if (!this.hasColor() && !color) {\n // color was empty and the new one too\n return;\n }\n\n // force update if color is changed to empty\n let shouldForceUpdate = this.hasColor() && !color;\n\n this.color = color;\n\n /**\n * (Colorpicker) When the color is set programmatically with setValue().\n *\n * @event colorpickerChange\n */\n this.element.trigger({\n type: 'colorpickerChange',\n colorpicker: this,\n color: this.color,\n value: val\n });\n\n // force update if color has changed to empty\n this.update(shouldForceUpdate);\n }\n\n /**\n * Creates a new color using the widget instance options (fallbackColor, format).\n *\n * @fires colorpickerInvalid\n * @param {*} val\n * @param {boolean} useFallback\n * @returns {Color}\n */\n createColor(val, useFallback = true) {\n let color = new Color(this._resolveColor(val), {format: this.format});\n\n if (!color.isValid()) {\n let invalidColor = color, fallback;\n\n if (useFallback) {\n fallback = ((this.fallbackColor instanceof Color) && this.fallbackColor.isValid()) ?\n this.fallbackColor : this._resolveColor(this.fallbackColor);\n\n color = new Color(fallback, {format: this.format});\n\n if (!color.isValid() && useFallback) {\n throw new Error('The fallback color is invalid.');\n }\n }\n\n color.previous = invalidColor;\n\n /**\n * (Colorpicker) Fired when the color is invalid and the fallback color is going to be used.\n *\n * @event colorpickerInvalid\n */\n this.element.trigger({\n type: 'colorpickerInvalid',\n colorpicker: this,\n color: color,\n value: val\n });\n }\n\n if (!this.isAlphaEnabled() && color.hasTransparency()) {\n // Alpha is disabled\n color.setAlpha(1);\n }\n\n if (!this.hasColor()) {\n // No previous color, so no need to compare\n return color;\n }\n\n let hsva = color.hsvaRatio;\n let prevHsva = this.color.hsvaRatio;\n\n if (\n hsva.s === 0 &&\n hsva.h === 0 &&\n prevHsva.h !== 0\n ) {\n // Hue was set to 0 because saturation was 0, use previous hue, since it was not meant to change...\n color.setHueRatio(prevHsva.h);\n }\n\n if (!this.isAlphaEnabled() && color.hasTransparency()) {\n // Alpha is disabled\n color.setAlpha(1);\n }\n\n return color;\n }\n\n /**\n * Checks if there is a color object, that it is valid and it is not a fallback\n * @returns {boolean}\n */\n isInvalidColor() {\n return !this.hasColor() || !this.color.isValid() || !!this.color.previous;\n }\n\n /**\n * Returns true if the useAlpha option is exactly true, false otherwise\n * @returns {boolean}\n */\n isAlphaEnabled() {\n return this.options.useAlpha === true;\n }\n\n /**\n * Resolves a color, in case is not in a standard format (e.g. a custom color alias)\n *\n * @private\n * @param {String|*} color\n * @returns {String|*|null}\n */\n _resolveColor(color) {\n let extResolvedColor = false;\n\n $.each(this.extensions, function (name, ext) {\n if (extResolvedColor !== false) {\n // skip if resolved\n return;\n }\n extResolvedColor = ext.resolveColor(color);\n });\n\n if (extResolvedColor !== false) {\n color = extResolvedColor;\n }\n\n return color;\n }\n\n /**\n * Returns true if the widget has an associated input element, false otherwise\n * @returns {boolean}\n */\n hasInput() {\n return (this.input !== false);\n }\n\n /**\n * Returns true if this instance is disabled\n * @returns {boolean}\n */\n isDisabled() {\n return this.disabled === true;\n }\n\n /**\n * Disables the widget and the input if any\n *\n * @fires colorpickerDisable\n * @returns {boolean}\n */\n disable() {\n if (this.hasInput()) {\n this.input.prop('disabled', true);\n }\n this.disabled = true;\n\n /**\n * (Colorpicker) When the widget has been disabled.\n *\n * @event colorpickerDisable\n */\n this.element.trigger({\n type: 'colorpickerDisable',\n colorpicker: this,\n color: this.color\n });\n return true;\n }\n\n /**\n * Enables the widget and the input if any\n *\n * @fires colorpickerEnable\n * @returns {boolean}\n */\n enable() {\n if (this.hasInput()) {\n this.input.prop('disabled', false);\n }\n this.disabled = false;\n\n /**\n * (Colorpicker) When the widget has been enabled.\n *\n * @event colorpickerEnable\n */\n this.element.trigger({\n type: 'colorpickerEnable',\n colorpicker: this,\n color: this.color\n });\n return true;\n }\n\n /**\n * Function triggered when clicking in one of the color adjustment bars\n *\n * @private\n * @fires mousemove\n * @param {Event} e\n * @returns {boolean}\n */\n _mousedown(e) {\n this.lastEvent.name = 'mousedown';\n this.lastEvent.e = e;\n\n if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {\n e.pageX = e.originalEvent.touches[0].pageX;\n e.pageY = e.originalEvent.touches[0].pageY;\n }\n e.stopPropagation();\n e.preventDefault();\n\n let target = $(e.target);\n\n // detect the slider and set the limits and callbacks\n let zone = target.closest('div');\n let sl = this.options.horizontal ? this.options.slidersHorz : this.options.sliders;\n\n if (!zone.is('.colorpicker')) {\n if (zone.is('.colorpicker-saturation')) {\n this.currentSlider = $.extend({}, sl.saturation);\n } else if (zone.is('.colorpicker-hue')) {\n this.currentSlider = $.extend({}, sl.hue);\n } else if (zone.is('.colorpicker-alpha')) {\n this.currentSlider = $.extend({}, sl.alpha);\n } else {\n return false;\n }\n let offset = zone.offset();\n // reference to guide's style\n\n this.currentSlider.guide = zone.find('.colorpicker-guide')[0].style;\n this.currentSlider.left = e.pageX - offset.left;\n this.currentSlider.top = e.pageY - offset.top;\n this.mousePointer = {\n left: e.pageX,\n top: e.pageY\n };\n\n /**\n * (window.document) Triggered on mousedown for the document object,\n * so the color adjustment guide is moved to the clicked position.\n *\n * @event mousemove\n */\n $(window.document).on({\n 'mousemove.colorpicker': $.proxy(this._mousemove, this),\n 'touchmove.colorpicker': $.proxy(this._mousemove, this),\n 'mouseup.colorpicker': $.proxy(this._mouseup, this),\n 'touchend.colorpicker': $.proxy(this._mouseup, this)\n }).trigger('mousemove');\n }\n return false;\n }\n\n /**\n * Function triggered when dragging a guide inside one of the color adjustment bars.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n _mousemove(e) {\n this.lastEvent.name = 'mousemove';\n this.lastEvent.e = e;\n\n let color = !this.hasColor() ? this.createColor(this.fallbackColor) : this.color.getCopy();\n\n if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {\n e.pageX = e.originalEvent.touches[0].pageX;\n e.pageY = e.originalEvent.touches[0].pageY;\n }\n e.stopPropagation();\n e.preventDefault();\n let left = Math.max(\n 0,\n Math.min(\n this.currentSlider.maxLeft,\n this.currentSlider.left + ((e.pageX || this.mousePointer.left) - this.mousePointer.left)\n )\n );\n let top = Math.max(\n 0,\n Math.min(\n this.currentSlider.maxTop,\n this.currentSlider.top + ((e.pageY || this.mousePointer.top) - this.mousePointer.top)\n )\n );\n\n this.currentSlider.guide.left = left + 'px';\n this.currentSlider.guide.top = top + 'px';\n if (this.currentSlider.callLeft) {\n color[this.currentSlider.callLeft].call(color, left / this.currentSlider.maxLeft);\n }\n if (this.currentSlider.callTop) {\n color[this.currentSlider.callTop].call(color, top / this.currentSlider.maxTop);\n }\n\n this.setValue(color);\n return false;\n }\n\n /**\n * Function triggered when releasing the click in one of the color adjustment bars.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n _mouseup(e) {\n this.lastEvent.name = 'mouseup';\n this.lastEvent.e = e;\n\n e.stopPropagation();\n e.preventDefault();\n $(window.document).off({\n 'mousemove.colorpicker': this._mousemove,\n 'touchmove.colorpicker': this._mousemove,\n 'mouseup.colorpicker': this._mouseup,\n 'touchend.colorpicker': this._mouseup\n });\n return false;\n }\n\n /**\n * Function triggered when the input has changed, so the colorpicker gets updated.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n _change(e) {\n this.lastEvent.name = 'change';\n this.lastEvent.e = e;\n\n let val = this.input.val();\n\n if (val !== this.toInputColorString()) {\n this.setValue(val);\n }\n }\n\n /**\n * Function triggered after a keyboard key has been released.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n _keyup(e) {\n this.lastEvent.name = 'keyup';\n this.lastEvent.e = e;\n\n let val = this.input.val();\n\n if (val !== this.toInputColorString()) {\n this.setValue(val);\n }\n }\n}\n\nexport default Colorpicker;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/Colorpicker.js","'use strict';\n\nimport tinycolor from 'tinycolor2';\n\nfunction unwrapColor(color) {\n if (color instanceof tinycolor) {\n return {\n r: color._r,\n g: color._g,\n b: color._b,\n a: color._a\n };\n }\n return color;\n}\n\n/**\n * Sanitizes a format string, so it is compatible with tinycolor,\n * or returns the same value if it is not a string.\n *\n * @param {String} format\n * @returns {String|*}\n * @private\n */\nfunction getCompatibleFormat(format) {\n if (format instanceof String || typeof format === 'string') {\n return format.replace(/a$/gi, '');\n }\n\n return format;\n}\n\n/**\n * Color manipulation class that extends the tinycolor library class.\n */\nclass Color extends tinycolor {\n /**\n * Identifier of the color instance.\n *\n * @type {int}\n * @readonly\n */\n get id() {\n return this._tc_id;\n }\n\n /**\n * Format of the parsed color.\n *\n * @type {String}\n * @readonly\n */\n get format() {\n return this._format;\n }\n\n /**\n * All options of the current instance.\n *\n * @type {{format: String, gradientType: String}}\n * @readonly\n */\n get options() {\n return {\n format: this._format,\n gradientType: this._gradientType\n };\n }\n\n /**\n * @returns {{h, s, v, a}}\n */\n get hsva() {\n return this.toHsv();\n }\n\n /**\n * @returns {{h, s, v, a}}\n */\n get hsvaRatio() {\n let hsv = this.hsva;\n\n return {\n h: hsv.h / 360,\n s: hsv.s,\n v: hsv.v,\n a: hsv.a\n };\n }\n\n /**\n * foo bar\n * @param {Color|*} color\n * @param {{format}} [options]\n * @constructor\n */\n constructor(color, options = {format: null}) {\n if (options.format) {\n options.format = getCompatibleFormat(options.format);\n }\n super(unwrapColor(color), options);\n\n /**\n * @type {Color|*}\n */\n this._originalInput = color; // keep real original color\n /**\n * Hue backup to not lose the information when saturation is 0.\n * @type {number}\n */\n this._hbak = this.hsva.h;\n /**\n * If set, it contains a reference to a previous color that caused the creation of this one.\n * @type {Color}\n */\n this.previous = null;\n }\n\n /**\n * Compares a color object with this one and returns true if it is equal or false if not.\n *\n * @param {Color} color\n * @returns {boolean}\n */\n equals(color) {\n if (!(color instanceof tinycolor)) {\n return false;\n }\n return this._r === color._r &&\n this._g === color._g &&\n this._b === color._b &&\n this._a === color._a &&\n this._roundA === color._roundA &&\n this._format === color._format &&\n this._gradientType === color._gradientType &&\n this._ok === color._ok;\n }\n\n /**\n * Imports all variables of the given color to this instance, excepting `_tc_id`.\n * @param {Color} color\n */\n importColor(color) {\n if (!(color instanceof tinycolor)) {\n throw new Error('Color.importColor: The color argument is not an instance of tinycolor.');\n }\n this._originalInput = color._originalInput;\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this._a = color._a;\n this._roundA = color._roundA;\n this._format = getCompatibleFormat(color._format);\n this._gradientType = color._gradientType;\n this._ok = color._ok;\n // omit .previous and ._tc_id import\n }\n\n /**\n * Imports the _r, _g, _b, _a, _hbak and _ok variables of the given color to this instance.\n * @param {Color} color\n */\n importRgb(color) {\n if (!color instanceof Color) {\n throw new Error('Color.importColor: The color argument is not an instance of tinycolor.');\n }\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this._a = color._a;\n this._ok = color._ok;\n this._hbak = color._hbak;\n }\n\n /**\n * @param {{h,s,v,a}} hsv\n */\n importHsv(hsv) {\n this._hbak = hsv.h;\n this.importRgb(new Color(hsv, this.options));\n }\n\n /**\n * @returns {Color}\n */\n getCopy() {\n return new Color(this.hsva, this.options);\n }\n\n /**\n * @returns {Color}\n */\n getHueOnlyCopy() {\n return new Color({h: this._hbak ? this._hbak : this.hsva.h, s: 100, v: 100}, this.options);\n }\n\n /**\n * @returns {Color}\n */\n getOpaqueCopy() {\n return new Color(Object.assign({}, this.hsva, {a: 1}), this.options);\n }\n\n /**\n * @param {number} h Degrees from 0 to 360\n */\n setHue(h) {\n this.importHsv(Object.assign({}, this.hsva, {h: h}));\n }\n\n /**\n * @param {number} s Percent from 0 o 100\n */\n setSaturation(s) {\n this.importHsv(Object.assign({}, this.hsva, {s: s}));\n }\n\n /**\n * @param {number} v Percent from 0 o 100\n */\n setBrightness(v) {\n this.importHsv(Object.assign({}, this.hsva, {v: v}));\n }\n\n /**\n * @param {number} h Ratio from 0.0 to 1.0\n */\n setHueRatio(h) {\n if (h === 0) {\n return;\n }\n this.setHue((1 - h) * 360);\n }\n\n /**\n * @param {number} s Ratio from 0.0 to 1.0\n */\n setSaturationRatio(s) {\n this.setSaturation(s);\n }\n\n /**\n * @param {number} v Ratio from 0.0 to 1.0\n */\n setBrightnessRatio(v) {\n this.setBrightness(1 - v);\n }\n\n /**\n * @param {number} a Ratio from 0.0 to 1.0\n */\n setAlphaRatio(a) {\n this.setAlpha(1 - a);\n }\n\n /**\n * @returns {boolean}\n */\n isTransparent() {\n return this._a === 0;\n }\n\n /**\n * @returns {boolean}\n */\n hasTransparency() {\n return this._a !== 1;\n }\n\n /**\n * @param {string|null} [format] One of \"rgb\", \"prgb\", \"hex\"/\"hex6\", \"hex3\", \"hex8\", \"hsl\", \"hsv\"/\"hsb\", \"name\"\n * @returns {String}\n */\n toString(format = null) {\n format = format ? getCompatibleFormat(format) : this.format;\n\n let colorStr = super.toString(format);\n\n if (colorStr && colorStr.match(/^#[0-9a-f]{3,8}$/i)) {\n // Support transparent for hex formats\n if (this.isTransparent() && (this._r === 0) && (this._g === 0) && (this._b === 0)) {\n return 'transparent';\n }\n }\n\n return colorStr;\n }\n}\n\nexport default Color;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/Color.js","// TinyColor v1.4.1\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\n(function(Math) {\n\nvar trimLeft = /^\\s+/,\n trimRight = /\\s+$/,\n tinyCounter = 0,\n mathRound = Math.round,\n mathMin = Math.min,\n mathMax = Math.max,\n mathRandom = Math.random;\n\nfunction tinycolor (color, opts) {\n\n color = (color) ? color : '';\n opts = opts || { };\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n\n var rgb = inputToRGB(color);\n this._originalInput = color,\n this._r = rgb.r,\n this._g = rgb.g,\n this._b = rgb.b,\n this._a = rgb.a,\n this._roundA = mathRound(100*this._a) / 100,\n this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) { this._r = mathRound(this._r); }\n if (this._g < 1) { this._g = mathRound(this._g); }\n if (this._b < 1) { this._b = mathRound(this._b); }\n\n this._ok = rgb.ok;\n this._tc_id = tinyCounter++;\n}\n\ntinycolor.prototype = {\n isDark: function() {\n return this.getBrightness() < 128;\n },\n isLight: function() {\n return !this.isDark();\n },\n isValid: function() {\n return this._ok;\n },\n getOriginalInput: function() {\n return this._originalInput;\n },\n getFormat: function() {\n return this._format;\n },\n getAlpha: function() {\n return this._a;\n },\n getBrightness: function() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r/255;\n GsRGB = rgb.g/255;\n BsRGB = rgb.b/255;\n\n if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}\n if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}\n if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}\n return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);\n },\n setAlpha: function(value) {\n this._a = boundAlpha(value);\n this._roundA = mathRound(100*this._a) / 100;\n return this;\n },\n toHsv: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };\n },\n toHsvString: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);\n return (this._a == 1) ?\n \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" :\n \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \"+ this._roundA + \")\";\n },\n toHsl: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };\n },\n toHslString: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);\n return (this._a == 1) ?\n \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" :\n \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \"+ this._roundA + \")\";\n },\n toHex: function(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function(allow3Char) {\n return '#' + this.toHex(allow3Char);\n },\n toHex8: function(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function(allow4Char) {\n return '#' + this.toHex8(allow4Char);\n },\n toRgb: function() {\n return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };\n },\n toRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \")\" :\n \"rgba(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function() {\n return { r: mathRound(bound01(this._r, 255) * 100) + \"%\", g: mathRound(bound01(this._g, 255) * 100) + \"%\", b: mathRound(bound01(this._b, 255) * 100) + \"%\", a: this._a };\n },\n toPercentageRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%)\" :\n \"rgba(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function() {\n if (this._a === 0) {\n return \"transparent\";\n }\n\n if (this._a < 1) {\n return false;\n }\n\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function(secondColor) {\n var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n\n return \"progid:DXImageTransform.Microsoft.gradient(\"+gradientType+\"startColorstr=\"+hex8String+\",endColorstr=\"+secondHex8String+\")\";\n },\n toString: function(format) {\n var formatSet = !!format;\n format = format || this._format;\n\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n\n return formattedString || this.toHexString();\n },\n clone: function() {\n return tinycolor(this.toString());\n },\n\n _applyModification: function(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function() {\n return this._applyModification(lighten, arguments);\n },\n brighten: function() {\n return this._applyModification(brighten, arguments);\n },\n darken: function() {\n return this._applyModification(darken, arguments);\n },\n desaturate: function() {\n return this._applyModification(desaturate, arguments);\n },\n saturate: function() {\n return this._applyModification(saturate, arguments);\n },\n greyscale: function() {\n return this._applyModification(greyscale, arguments);\n },\n spin: function() {\n return this._applyModification(spin, arguments);\n },\n\n _applyCombination: function(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function() {\n return this._applyCombination(analogous, arguments);\n },\n complement: function() {\n return this._applyCombination(complement, arguments);\n },\n monochromatic: function() {\n return this._applyCombination(monochromatic, arguments);\n },\n splitcomplement: function() {\n return this._applyCombination(splitcomplement, arguments);\n },\n triad: function() {\n return this._applyCombination(triad, arguments);\n },\n tetrad: function() {\n return this._applyCombination(tetrad, arguments);\n }\n};\n\n// If input is an object, force 1 into \"1.0\" to handle ratios properly\n// String input requires \"1.0\" as input, so 1 will be treated as 1\ntinycolor.fromRatio = function(color, opts) {\n if (typeof color == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n }\n else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n\n return tinycolor(color, opts);\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n// \"red\"\n// \"#f00\" or \"f00\"\n// \"#ff0000\" or \"ff0000\"\n// \"#ff000000\" or \"ff000000\"\n// \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n// \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n// \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n// \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n// \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n// \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n// \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n\n if (typeof color == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n\n a = boundAlpha(a);\n\n return {\n ok: ok,\n format: color.format || format,\n r: mathMin(255, mathMax(rgb.r, 0)),\n g: mathMin(255, mathMax(rgb.g, 0)),\n b: mathMin(255, mathMax(rgb.b, 0)),\n a: a\n };\n}\n\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>\n\n// `rgbToRgb`\n// Handle bounds / percentage checking to conform to CSS color spec\n// <http://www.w3.org/TR/css3-color/>\n// *Assumes:* r, g, b in [0, 255] or [0, 1]\n// *Returns:* { r, g, b } in [0, 255]\nfunction rgbToRgb(r, g, b){\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n}\n\n// `rgbToHsl`\n// Converts an RGB color value to HSL.\n// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n// *Returns:* { h, s, l } in [0,1]\nfunction rgbToHsl(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, l = (max + min) / 2;\n\n if(max == min) {\n h = s = 0; // achromatic\n }\n else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n\n h /= 6;\n }\n\n return { h: h, s: s, l: l };\n}\n\n// `hslToRgb`\n// Converts an HSL color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hslToRgb(h, s, l) {\n var r, g, b;\n\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n\n function hue2rgb(p, q, t) {\n if(t < 0) t += 1;\n if(t > 1) t -= 1;\n if(t < 1/6) return p + (q - p) * 6 * t;\n if(t < 1/2) return q;\n if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n }\n\n if(s === 0) {\n r = g = b = l; // achromatic\n }\n else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHsv`\n// Converts an RGB color value to HSV\n// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n// *Returns:* { h, s, v } in [0,1]\nfunction rgbToHsv(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, v = max;\n\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n\n if(max == min) {\n h = 0; // achromatic\n }\n else {\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n\n// `hsvToRgb`\n// Converts an HSV color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHex`\n// Converts an RGB color to hex\n// Assumes r, g, and b are contained in the set [0, 255]\n// Returns a 3 or 6 character hex\nfunction rgbToHex(r, g, b, allow3Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToHex`\n// Converts an RGBA color plus alpha transparency to hex\n// Assumes r, g, b are contained in the set [0, 255] and\n// a in [0, 1]. Returns a 4 or 8 character rgba hex\nfunction rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToArgbHex`\n// Converts an RGBA color to an ARGB Hex8 string\n// Rarely used, but required for \"toFilter()\"\nfunction rgbaToArgbHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n}\n\n// `equals`\n// Can be called with any tinycolor input\ntinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) { return false; }\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n};\n\ntinycolor.random = function() {\n return tinycolor.fromRatio({\n r: mathRandom(),\n g: mathRandom(),\n b: mathRandom()\n });\n};\n\n\n// Modification Functions\n// ----------------------\n// Thanks to less.js for some of the basics here\n// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>\n\nfunction desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction saturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction greyscale(color) {\n return tinycolor(color).desaturate(100);\n}\n\nfunction lighten (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\nfunction brighten(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var rgb = tinycolor(color).toRgb();\n rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));\n rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));\n rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));\n return tinycolor(rgb);\n}\n\nfunction darken (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\n// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n// Values outside of this range will be wrapped into this range.\nfunction spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n}\n\n// Combination Functions\n// ---------------------\n// Thanks to jQuery xColor for some of the ideas behind these\n// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>\n\nfunction complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n}\n\nfunction triad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction tetrad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),\n tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})\n ];\n}\n\nfunction analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n\n for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n}\n\nfunction monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h, s = hsv.s, v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n\n while (results--) {\n ret.push(tinycolor({ h: h, s: s, v: v}));\n v = (v + modification) % 1;\n }\n\n return ret;\n}\n\n// Utility Functions\n// ---------------------\n\ntinycolor.mix = function(color1, color2, amount) {\n amount = (amount === 0) ? 0 : (amount || 50);\n\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n\n var p = amount / 100;\n\n var rgba = {\n r: ((rgb2.r - rgb1.r) * p) + rgb1.r,\n g: ((rgb2.g - rgb1.g) * p) + rgb1.g,\n b: ((rgb2.b - rgb1.b) * p) + rgb1.b,\n a: ((rgb2.a - rgb1.a) * p) + rgb1.a\n };\n\n return tinycolor(rgba);\n};\n\n\n// Readability Functions\n// ---------------------\n// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)\n\n// `contrast`\n// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)\ntinycolor.readability = function(color1, color2) {\n var c1 = tinycolor(color1);\n var c2 = tinycolor(color2);\n return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);\n};\n\n// `isReadable`\n// Ensure that foreground and background color combinations meet WCAG2 guidelines.\n// The third argument is an optional Object.\n// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';\n// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.\n// If the entire object is absent, isReadable defaults to {level:\"AA\",size:\"small\"}.\n\n// *Example*\n// tinycolor.isReadable(\"#000\", \"#111\") => false\n// tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\ntinycolor.isReadable = function(color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n\n out = false;\n\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n\n};\n\n// `mostReadable`\n// Given a base color and a list of possible foreground or background\n// colors for that base, returns the most readable color.\n// Optionally returns Black or White if the most readable color is unreadable.\n// *Example*\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\ntinycolor.mostReadable = function(baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size ;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors ;\n level = args.level;\n size = args.size;\n\n for (var i= 0; i < colorList.length ; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n\n if (tinycolor.isReadable(baseColor, bestColor, {\"level\":level,\"size\":size}) || !includeFallbackColors) {\n return bestColor;\n }\n else {\n args.includeFallbackColors=false;\n return tinycolor.mostReadable(baseColor,[\"#fff\", \"#000\"],args);\n }\n};\n\n\n// Big List of Colors\n// ------------------\n// <http://www.w3.org/TR/css3-color/#svg-color>\nvar names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n};\n\n// Make it easy to access colors via `hexNames[hex]`\nvar hexNames = tinycolor.hexNames = flip(names);\n\n\n// Utilities\n// ---------\n\n// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\nfunction flip(o) {\n var flipped = { };\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n}\n\n// Return a valid alpha value [0,1] with all invalid values being set to 1\nfunction boundAlpha(a) {\n a = parseFloat(a);\n\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n\n return a;\n}\n\n// Take input from [0, n] and return it as [0, 1]\nfunction bound01(n, max) {\n if (isOnePointZero(n)) { n = \"100%\"; }\n\n var processPercent = isPercentage(n);\n n = mathMin(max, mathMax(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if ((Math.abs(n - max) < 0.000001)) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return (n % max) / parseFloat(max);\n}\n\n// Force a number between 0 and 1\nfunction clamp01(val) {\n return mathMin(1, mathMax(0, val));\n}\n\n// Parse a base-16 hex value into a base-10 integer\nfunction parseIntFromHex(val) {\n return parseInt(val, 16);\n}\n\n// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>\nfunction isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n}\n\n// Check to see if string passed in is a percentage\nfunction isPercentage(n) {\n return typeof n === \"string\" && n.indexOf('%') != -1;\n}\n\n// Force a hex value to have 2 characters\nfunction pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}\n\n// Replace a decimal with it's percentage value\nfunction convertToPercentage(n) {\n if (n <= 1) {\n n = (n * 100) + \"%\";\n }\n\n return n;\n}\n\n// Converts a decimal to a hex value\nfunction convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n// Converts a hex value to a decimal\nfunction convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}\n\nvar matchers = (function() {\n\n // <http://www.w3.org/TR/css3-values/#integers>\n var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n // <http://www.w3.org/TR/css3-values/#number-value>\n var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n\n return {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n})();\n\n// `isValidCSSUnit`\n// Take in a single string / number and check to see if it looks like a CSS unit\n// (see `matchers` above for definition).\nfunction isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}\n\n// `stringInputToObject`\n// Permissive string parsing. Take in a number of formats, and output an object\n// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\nfunction stringInputToObject(color) {\n\n color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color == 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: \"name\" };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if ((match = matchers.rgb.exec(color))) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n if ((match = matchers.rgba.exec(color))) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n if ((match = matchers.hsl.exec(color))) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n if ((match = matchers.hsla.exec(color))) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n if ((match = matchers.hsv.exec(color))) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n if ((match = matchers.hsva.exec(color))) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n if ((match = matchers.hex8.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex6.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n if ((match = matchers.hex4.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n a: convertHexToDecimal(match[4] + '' + match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex3.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n\n return false;\n}\n\nfunction validateWCAG2Parms(parms) {\n // return valid WCAG2 parms for isReadable.\n // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n var level, size;\n parms = parms || {\"level\":\"AA\", \"size\":\"small\"};\n level = (parms.level || \"AA\").toUpperCase();\n size = (parms.size || \"small\").toLowerCase();\n if (level !== \"AA\" && level !== \"AAA\") {\n level = \"AA\";\n }\n if (size !== \"small\" && size !== \"large\") {\n size = \"small\";\n }\n return {\"level\":level, \"size\":size};\n}\n\n// Node: Export function\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports = tinycolor;\n}\n// AMD/requirejs: Define the module\nelse if (typeof define === 'function' && define.amd) {\n define(function () {return tinycolor;});\n}\n// Browser: Expose to window\nelse {\n window.tinycolor = tinycolor;\n}\n\n})(Math);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/tinycolor2/tinycolor.js\n// module id = 6\n// module chunks = 0 1","'use strict';\n/**\n * @module\n */\n\n/**\n * Colorpicker default options\n */\nexport default {\n /**\n * If true, loads the Debugger extension automatically into the current instance\n * @type {boolean}\n * @default false\n */\n debug: false,\n /**\n * Forces a color, ignoring the one from the elements value or data-color attribute.\n *\n * @type {(String|Color|boolean)}\n * @default false\n */\n color: false,\n /**\n * Forces an specific color format. If false, it will be automatically detected the first time,\n * but if null it will be always recalculated.\n *\n * Note that the ending 'a' of the format meaning \"alpha\" has currently no effect, meaning that rgb is the same as\n * rgba excepting if the alpha channel is disabled (see useAlpha).\n *\n * @type {('rgb'|'rgba'|'prgb'|'prgba'|'hex'|'hex3'|'hex6'|'hex8'|'hsl'|'hsla'|'hsv'|'hsva'|'name'|boolean)}\n * @default false\n */\n format: false,\n /**\n * Horizontal mode layout.\n *\n * If true, the hue and alpha channel bars will be rendered horizontally, above the saturation selector.\n *\n * @type {boolean}\n * @default false\n */\n horizontal: false,\n /**\n * Forces to show the colorpicker as an inline element\n *\n * @type {boolean}\n * @default false\n */\n inline: false,\n /**\n * Children input CSS selector\n *\n * @type {String}\n * @default 'input'\n */\n input: 'input',\n /**\n * Colorpicker container CSS selector. If given, the colorpicker will be placed inside this container.\n * If true, the colorpicker element itself will be used as the container.\n *\n * @type {String|boolean}\n * @default false\n */\n container: false, // container selector\n /**\n * Children color component CSS selector.\n * If it exists, the child <i> element background will be changed on color change.\n *\n * @type {String|boolean}\n * @default '.add-on, .input-group-addon'\n */\n component: '.add-on, .input-group-addon',\n /**\n * Fallback color to use when the given color is invalid.\n * If false, the latest valid color will be used as a fallback.\n *\n * @type {String|Color|boolean}\n * @default false\n */\n fallbackColor: false,\n /**\n * If enabled, the input content will be replaced always with a valid color,\n * if not enabled the invalid color will be left in the input, but valid in the internal color object.\n *\n * @type {boolean}\n * @default false\n */\n autoInputFallback: false,\n /**\n * If true a hash will be prepended to hexadecimal colors.\n * If false, the hash will be removed.\n * This only affects the input values.\n *\n * @type {boolean}\n * @default false\n */\n useHashPrefix: true,\n /**\n * If true or false the alpha adjustment bar will be displayed no matter what.\n * If false it will be always hidden and alpha channel won't be allowed programmatically for this instance,\n * so the selected or typed color will be always opaque.\n *\n * @type {boolean}\n * @default true\n */\n useAlpha: true,\n /**\n * This only applies when the color format is hexadecimal.\n * If true, the alpha channel will be allowed for hexadecimal formatted colors, making them having 4 or 8 chars\n * (RGBA or RRGGBBAA). This format is not yet supported in all modern browsers, so it is disabled by default.\n * If false, rgba will be used whenever there is an alpha change different than 1 and the color format is\n * automatic.\n *\n * @type {boolean}\n * @default true\n */\n enableHex8: false,\n /**\n * Vertical sliders configuration\n * @type {Object}\n */\n sliders: {\n saturation: {\n maxLeft: 100,\n maxTop: 100,\n callLeft: 'setSaturationRatio',\n callTop: 'setBrightnessRatio'\n },\n hue: {\n maxLeft: 0,\n maxTop: 100,\n callLeft: false,\n callTop: 'setHueRatio'\n },\n alpha: {\n maxLeft: 0,\n maxTop: 100,\n callLeft: false,\n callTop: 'setAlphaRatio'\n }\n },\n /**\n * Horizontal sliders configuration\n * @type {Object}\n */\n slidersHorz: {\n saturation: {\n maxLeft: 100,\n maxTop: 100,\n callLeft: 'setSaturationRatio',\n callTop: 'setBrightnessRatio'\n },\n hue: {\n maxLeft: 100,\n maxTop: 0,\n callLeft: 'setHueRatio',\n callTop: false\n },\n alpha: {\n maxLeft: 100,\n maxTop: 0,\n callLeft: 'setAlphaRatio',\n callTop: false\n }\n },\n /**\n * Colorpicker popup alignment.\n * For now only right is supported.\n *\n * @type {('right')}\n * @default 'right'\n */ // TODO: add 'left' and 'auto' support.\n align: 'right',\n /**\n * Custom class to be added to the colorpicker element\n *\n * @type {String}\n */\n customClass: null,\n /**\n * Colorpicker widget template\n * @type {String}\n * @example\n * <!-- This is the default template: -->\n * <div class=\"colorpicker\">\n * <div class=\"colorpicker-saturation\"><i class=\"colorpicker-guide\"><i></i></i></div>\n * <div class=\"colorpicker-hue\"><i class=\"colorpicker-guide\"></i></div>\n * <div class=\"colorpicker-alpha\"><i class=\"colorpicker-guide\"></i></div>\n * <div class=\"colorpicker-color\"><div /></div>\n * </div>\n */\n template: `<div class=\"colorpicker\">\n <div class=\"colorpicker-saturation\"><i class=\"colorpicker-guide\"><i /></div>\n <div class=\"colorpicker-hue\"><i class=\"colorpicker-guide\"></i></div>\n <div class=\"colorpicker-alpha\"><i class=\"colorpicker-guide\"></i></div></div>`,\n /**\n *\n * Associative object with the extension class name and its config.\n * Colorpicker comes with many bundled extensions: debugger, palette, preview and swatches (a superset of Palette).\n *\n * @type {Object}\n * @example\n * extensions: [\n * {\n * name: 'swatches'\n * colors: {\n * 'primary': '#337ab7',\n * 'success': '#5cb85c',\n * 'info': '#5bc0de',\n * 'warning': '#f0ad4e',\n * 'danger': '#d9534f'\n * },\n * namesAsValues: true\n * }\n * ]\n */\n extensions: [\n {\n name: 'preview',\n showText: false\n }\n ]\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/options.js","import Debugger from './Debugger';\nimport Preview from './Preview';\nimport Swatches from './Swatches';\nimport Palette from './Palette';\n\nexport {\n Debugger, Preview, Swatches, Palette\n};\n\nexport default {\n 'debugger': Debugger,\n 'preview': Preview,\n 'swatches': Swatches,\n 'palette': Palette\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/extensions/index.js","'use strict';\n\nimport Extension from 'Extension';\nimport $ from 'jquery';\n\nclass Debugger extends Extension {\n constructor(colorpicker, options = {}) {\n super(colorpicker, options);\n\n /**\n * @type {number}\n */\n this.eventCounter = 0;\n if (this.colorpicker.hasInput()) {\n this.colorpicker.input.on('change.colorpicker-ext', $.proxy(this.onChangeInput, this));\n }\n }\n\n /**\n * @fires colorpickerDebug\n * @param {string} eventName\n * @param {*} args\n */\n log(eventName, ...args) {\n this.eventCounter += 1;\n\n let logMessage = `#${this.eventCounter}: Colorpicker#${this.colorpicker.id} [${eventName}]`;\n\n console.debug(logMessage, ...args);\n\n /**\n * (Colorpicker) Fired by the ConsoleDebug extension whenever it logs something\n *\n * @event colorpickerDebug\n */\n this.colorpicker.element.trigger({\n type: 'colorpickerDebug',\n colorpicker: this.colorpicker,\n color: this.color,\n debug: {\n debugger: this,\n eventName: eventName,\n logArgs: args,\n logMessage: logMessage\n }\n });\n }\n\n resolveColor(color) {\n this.log('resolveColor()', color);\n return false;\n }\n\n onCreate(event) {\n this.log('colorpickerCreate');\n return super.onCreate(event);\n }\n\n onDestroy(event) {\n this.log('colorpickerDestroy');\n this.eventCounter = 0;\n\n if (this.colorpicker.hasInput()) {\n this.colorpicker.input.off('.colorpicker-ext');\n }\n\n return super.onDestroy(event);\n }\n\n onUpdate(event) {\n this.log('colorpickerUpdate');\n }\n\n /**\n * @listens _change\n * @param {Event} event\n */\n onChangeInput(event) {\n this.log('input:change.colorpicker', event.value, event.color);\n }\n\n onChange(event) {\n this.log('colorpickerChange', event.value, event.color);\n }\n\n onInvalid(event) {\n this.log('colorpickerInvalid', event.value, event.color);\n }\n\n onHide(event) {\n this.log('colorpickerHide');\n this.eventCounter = 0;\n }\n\n onShow(event) {\n this.log('colorpickerShow');\n }\n\n onDisable(event) {\n this.log('colorpickerDisable');\n }\n\n onEnable(event) {\n this.log('colorpickerEnable');\n }\n}\n\nexport default Debugger;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/extensions/Debugger.js","'use strict';\n\nimport Extension from 'Extension';\nimport $ from 'jquery';\n\nclass Preview extends Extension {\n constructor(colorpicker, options = {}) {\n super(colorpicker, Object.assign({},\n {\n template: '<div class=\"colorpicker-bar colorpicker-preview\"><div /></div>',\n showText: true,\n format: colorpicker.format\n },\n options\n ));\n\n this.element = $(this.options.template);\n this.elementInner = this.element.find('div');\n }\n\n onCreate(event) {\n super.onCreate(event);\n this.colorpicker.picker.append(this.element);\n }\n\n onUpdate(event) {\n super.onUpdate(event);\n\n this.elementInner\n .css('backgroundColor', event.color.toRgbString());\n\n if (this.options.showText) {\n this.elementInner\n .html(event.color.toString(this.options.format || this.colorpicker.format));\n\n if (event.color.isDark()) {\n this.elementInner.css('color', 'white');\n } else {\n this.elementInner.css('color', 'black');\n }\n }\n }\n}\n\nexport default Preview;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/extensions/Preview.js","'use strict';\n\nimport Palette from './Palette';\nimport $ from 'jquery';\n\nlet defaults = {\n barTemplate: '<div class=\"colorpicker-bar colorpicker-swatches\"></div>',\n swatchTemplate: '<i class=\"colorpicker-swatch\"></i>'\n};\n\nclass Swatches extends Palette {\n constructor(colorpicker, options = {}) {\n super(colorpicker, Object.assign({}, defaults, options));\n }\n\n isEnabled() {\n return this.getLength() > 0;\n }\n\n onCreate(event) {\n super.onCreate(event);\n\n if (!this.isEnabled()) {\n return;\n }\n\n let colorpicker = this.colorpicker,\n swatchContainer = $(this.options.barTemplate),\n isAliased = (this.options.namesAsValues === true) && !Array.isArray(this.colors);\n\n $.each(this.colors, (name, value) => {\n let $swatch = $(this.options.swatchTemplate)\n .css('background-color', value)\n .attr('data-name', name)\n .attr('data-value', value)\n .attr('title', `${name}: ${value}`);\n\n $swatch.on('mousedown.colorpicker touchstart.colorpicker',\n function (e) {\n e.preventDefault();\n colorpicker.setValue(isAliased ? $(this).data('name') : $(this).data('value'));\n }\n );\n swatchContainer.append($swatch);\n });\n\n colorpicker.picker.append(swatchContainer);\n }\n}\n\nexport default Swatches;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/extensions/Swatches.js"],"sourceRoot":""}
includes/colorpicker/js/bootstrap-colorpicker.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Bootstrap Colorpicker - Simple and customizable colorpicker component for Twitter Bootstrap.
3
+ * @package bootstrap-colorpicker
4
+ * @version v3.0.0-wip
5
+ * @license MIT
6
+ * @link https://farbelous.github.io/bootstrap-colorpicker/
7
+ * @link https://github.com/farbelous/bootstrap-colorpicker.git
8
+ */
9
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("jQuery")):"function"==typeof define&&define.amd?define("bootstrap-colorpicker",["jQuery"],e):"object"==typeof exports?exports["bootstrap-colorpicker"]=e(require("jQuery")):t["bootstrap-colorpicker"]=e(t.jQuery)}(this,function(t){return function(t){function e(r){if(o[r])return o[r].exports;var i=o[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var o={};return e.m=t,e.c=o,e.d=function(t,o,r){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(e,o){e.exports=t},function(t,e,o){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),e}}(),n=o(0),s=function(t){return t&&t.__esModule?t:{default:t}}(n),a=function(){function t(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r(this,t),this.colorpicker=e,this.options=o,!this.colorpicker.element||!this.colorpicker.element.length)throw new Error("Extension: this.colorpicker.element is not valid");this.colorpicker.element.on("colorpickerCreate.colorpicker-ext",s.default.proxy(this.onCreate,this)),this.colorpicker.element.on("colorpickerDestroy.colorpicker-ext",s.default.proxy(this.onDestroy,this)),this.colorpicker.element.on("colorpickerUpdate.colorpicker-ext",s.default.proxy(this.onUpdate,this)),this.colorpicker.element.on("colorpickerChange.colorpicker-ext",s.default.proxy(this.onChange,this)),this.colorpicker.element.on("colorpickerInvalid.colorpicker-ext",s.default.proxy(this.onInvalid,this)),this.colorpicker.element.on("colorpickerShow.colorpicker-ext",s.default.proxy(this.onShow,this)),this.colorpicker.element.on("colorpickerHide.colorpicker-ext",s.default.proxy(this.onHide,this)),this.colorpicker.element.on("colorpickerEnable.colorpicker-ext",s.default.proxy(this.onEnable,this)),this.colorpicker.element.on("colorpickerDisable.colorpicker-ext",s.default.proxy(this.onDisable,this))}return i(t,[{key:"resolveColor",value:function(t){return!1}},{key:"onCreate",value:function(t){}},{key:"onDestroy",value:function(t){this.colorpicker.element.off(".colorpicker-ext")}},{key:"onUpdate",value:function(t){}},{key:"onChange",value:function(t){}},{key:"onInvalid",value:function(t){}},{key:"onHide",value:function(t){}},{key:"onShow",value:function(t){}},{key:"onDisable",value:function(t){}},{key:"onEnable",value:function(t){}}]),t}();e.default=a},function(t,e,o){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),e}}(),l=o(1),c=function(t){return t&&t.__esModule?t:{default:t}}(l),u={colors:null,namesAsValues:!0},h=function(t){function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,Object.assign({},u,o)));return Array.isArray(n.options.colors)||"object"===s(n.options.colors)||(n.options.colors=null),n}return n(e,t),a(e,[{key:"colors",get:function(){return this.options.colors}}]),a(e,[{key:"getLength",value:function(){return this.options.colors?Array.isArray(this.options.colors)?this.options.colors.length:"object"===s(this.options.colors)?Object.keys(this.options.colors).length:0:0}},{key:"resolveColor",value:function(t){return!(this.getLength()<=0)&&(Array.isArray(this.options.colors)?this.options.colors.indexOf(t)>=0?t:this.options.colors.indexOf(t.toUpperCase())>=0?t.toUpperCase():this.options.colors.indexOf(t.toLowerCase())>=0&&t.toLowerCase():"object"===s(this.options.colors)&&(this.options.namesAsValues?this.getName(t,this.getName("#"+t,this.getValue(t,!1))):this.getValue(t,!1)))}},{key:"getName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof t||!this.options.colors)return e;for(var o in this.options.colors)if(this.options.colors.hasOwnProperty(o)&&this.options.colors[o].toLowerCase()===t.toLowerCase())return o;return e}},{key:"getValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"string"==typeof t&&this.options.colors&&this.options.colors.hasOwnProperty(t)?this.options.colors[t]:e}}]),e}(c.default);e.default=h},function(t,e,o){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=o(4),s=r(n),a=o(0),l=r(a),c="colorpicker";l.default[c]=s.default,l.default.fn[c]=function(t){var e=Array.prototype.slice.call(arguments,1),o=1===this.length,r=null,n=this.each(function(){var o=(0,l.default)(this),n=o.data(c),a="object"===(void 0===t?"undefined":i(t))?t:{};n||(n=new s.default(this,a),o.data(c,n)),"string"==typeof t?"colorpicker"===t?r=n:l.default.isFunction(n[t])?r=n[t].apply(n,e):(e.length&&(n[t]=e[0]),r=n[t]):r=o});return o?r:n},l.default.fn[c].constructor=s.default},function(t,e,o){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),e}}(),s=o(5),a=r(s),l=o(1),c=r(l),u=o(7),h=r(u),f=o(8),p=r(f),d=o(0),g=r(d),v=0,b=function(){function t(e,o){var r=this;i(this,t),v+=1,this.id=v,this.element=(0,g.default)(e).addClass("colorpicker-element"),this.element.attr("data-colorpicker-id",this.id),this.options=Object.assign({},h.default,o,this.element.data()),this.extensions=[],Array.isArray(this.options.extensions)||(this.options.extensions=[]),this.component=this.options.component,this.component=!1!==this.component&&this.element.find(this.component),this.component&&0===this.component.length&&(this.component=!1),this.container=!0===this.options.container?this.element:this.options.container,this.container=!1!==this.container&&(0,g.default)(this.container),this.currentSlider=null,this.mousePointer={left:0,top:0},this.lastEvent={name:null,e:null},this.input=this.element.is("input")?this.element:!!this.options.input&&this.element.find(this.options.input),this.input&&0===this.input.length&&(this.input=!1),this.options.debug&&this.options.extensions.push({name:"Debugger"}),this.options.extensions.forEach(function(t){r.addExtension(t.name,p.default[t.name.toLowerCase()],t)});var n=!1!==this.options.color?this.options.color:this.getValue();this.color=!!n&&this.createColor(n),!1===this.options.format&&(this.options.format=this.color.format),this.disabled=!1;var s=this.picker=(0,g.default)(this.options.template);this.options.customClass&&s.addClass(this.options.customClass),this.options.inline?s.addClass("colorpicker-inline colorpicker-visible"):s.addClass("colorpicker-hidden"),this.options.horizontal&&s.addClass("colorpicker-horizontal"),(this.options.useAlpha||this.hasColor()&&this.color.hasTransparency())&&!1!==this.options.useAlpha&&(this.options.useAlpha=!0,s.addClass("colorpicker-with-alpha")),"right"===this.options.align&&s.addClass("colorpicker-right"),!0===this.options.inline&&s.addClass("colorpicker-no-arrow"),s.on("mousedown.colorpicker touchstart.colorpicker",g.default.proxy(function(t){t.target===t.currentTarget&&t.preventDefault()},this)),s.find(".colorpicker-saturation, .colorpicker-hue, .colorpicker-alpha").on("mousedown.colorpicker touchstart.colorpicker",g.default.proxy(this._mousedown,this)),s.appendTo(this.container?this.container:(0,g.default)("body")),this.hasInput()&&(this.input.on({"keyup.colorpicker":g.default.proxy(this._keyup,this)}),this.input.on({"change.colorpicker":g.default.proxy(this._change,this)}),!1===this.component&&this.element.on({"focus.colorpicker":g.default.proxy(this.show,this)}),!1===this.options.inline&&this.element.on({"focusout.colorpicker":g.default.proxy(this.hide,this)})),!1!==this.component&&this.component.on({"click.colorpicker":g.default.proxy(this.show,this)}),!1!==this.hasInput()||!1!==this.component||this.element.has(".colorpicker")||this.element.on({"click.colorpicker":g.default.proxy(this.show,this)}),this.hasInput()&&!1!==this.component&&"color"===this.input.attr("type")&&this.input.on({"click.colorpicker":g.default.proxy(this.show,this),"focus.colorpicker":g.default.proxy(this.show,this)}),this.update(!1!==this.options.color),(0,g.default)(g.default.proxy(function(){this.element.trigger({type:"colorpickerCreate",colorpicker:this,color:this.color})},this))}return n(t,[{key:"color",get:function(){return this.element.data("color")},set:function(t){this.element.data("color",t)}}],[{key:"Color",get:function(){return a.default}},{key:"Extension",get:function(){return c.default}},{key:"Extensions",get:function(){return p.default}}]),n(t,[{key:"addExtension",value:function(t,e){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t instanceof c.default?t:new e(this,o);return this.extensions.push(r),r}},{key:"destroy",value:function(){this.picker.remove(),this.element.removeData("colorpicker","color").off(".colorpicker"),this.hasInput()&&this.input.off(".colorpicker"),!1!==this.component&&this.component.off(".colorpicker"),this.element.removeClass("colorpicker-element"),this.element.trigger({type:"colorpickerDestroy",colorpicker:this,color:this.color})}},{key:"hasColor",value:function(){return this.color instanceof a.default}},{key:"toInputColorString",value:function(){var t=this.toCssColorString();return t?(!1===this.options.useHashPrefix&&(t=t.replace(/^#/g,"")),this._resolveColor(t)):t}},{key:"toCssColorString",value:function(){return this.hasColor()?this.color.toString(this.format):""}},{key:"_reposition",value:function(t){if(this.lastEvent.name="reposition",this.lastEvent.e=t,!1!==this.options.inline||this.options.container)return!1;var e=this.container&&this.container[0]!==window.document.body?"position":"offset",o=this.component||this.element,r=o[e]();return"right"===this.options.align&&(r.left-=this.picker.outerWidth()-o.outerWidth()),this.picker.css({top:r.top+o.outerHeight(),left:r.left}),!0}},{key:"show",value:function(t){return this.lastEvent.name="show",this.lastEvent.e=t,!this.isVisible()&&!this.isDisabled()&&(this.picker.addClass("colorpicker-visible").removeClass("colorpicker-hidden"),this._reposition(t),(0,g.default)(window).on("resize.colorpicker",g.default.proxy(this._reposition,this)),!t||this.hasInput()&&"color"!==this.input.attr("type")||t.stopPropagation&&t.preventDefault&&(t.stopPropagation(),t.preventDefault()),!this.component&&this.input||!1!==this.options.inline||(0,g.default)(window.document).on({"mousedown.colorpicker":g.default.proxy(this.hide,this)}),this.element.trigger({type:"colorpickerShow",colorpicker:this,color:this.color}),!0)}},{key:"hide",value:function(t){return this.lastEvent.name="hide",this.lastEvent.e=t,!this.isHidden()&&((void 0===t||!t.target||!((0,g.default)(t.currentTarget).parents(".colorpicker").length>0||(0,g.default)(t.target).parents(".colorpicker").length>0))&&(this.picker.addClass("colorpicker-hidden").removeClass("colorpicker-visible"),(0,g.default)(window).off("resize.colorpicker",this._reposition),(0,g.default)(window.document).off({"mousedown.colorpicker":this.hide}),this.element.trigger({type:"colorpickerHide",colorpicker:this,color:this.color}),!0))}},{key:"isVisible",value:function(){return this.picker.hasClass("colorpicker-visible")&&!this.picker.hasClass("colorpicker-hidden")}},{key:"isHidden",value:function(){return this.picker.hasClass("colorpicker-hidden")&&!this.picker.hasClass("colorpicker-visible")}},{key:"_updateInput",value:function(){if(this.hasInput()){var t=this.toInputColorString();if(t===this.input.prop("value"))return;this.input.prop("value",t||""),this.input.trigger({type:"change",colorpicker:this,color:this.color,value:t})}}},{key:"_updatePicker",value:function(){if(this.hasColor()){var t=!1===this.options.horizontal,e=t?this.options.sliders:this.options.slidersHorz,o=this.picker.find(".colorpicker-saturation .colorpicker-guide"),r=this.picker.find(".colorpicker-hue .colorpicker-guide"),i=this.picker.find(".colorpicker-alpha .colorpicker-guide"),n=this.color.hsvaRatio;r.length&&r.css(t?"top":"left",(t?e.hue.maxTop:e.hue.maxLeft)*(1-n.h)),i.length&&i.css(t?"top":"left",(t?e.alpha.maxTop:e.alpha.maxLeft)*(1-n.a)),o.length&&o.css({top:e.saturation.maxTop-n.v*e.saturation.maxTop,left:n.s*e.saturation.maxLeft}),this.picker.find(".colorpicker-saturation").css("backgroundColor",this.color.getHueOnlyCopy().toHexString()),this.picker.find(".colorpicker-alpha").css("backgroundColor",this.color.toString("hex6"))}}},{key:"_updateComponent",value:function(){if(this.hasColor()&&!1!==this.component){var t=this.component.find("i").eq(0);t.length>0?t.css({backgroundColor:this.toCssColorString()}):this.component.css({backgroundColor:this.toCssColorString()})}}},{key:"_shouldUpdate",value:function(){return this.hasColor()&&!1!==this.getValue(!1)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._shouldUpdate()||!0===t){this._updateComponent();!0!==this.options.autoInputFallback&&"keyup"===this.lastEvent.name||this._updateInput(),this._updatePicker(),this.element.trigger({type:"colorpickerUpdate",colorpicker:this,color:this.color})}}},{key:"getValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t=void 0===t?this.fallbackColor:t;var e=[],o=!1;return this.hasInput()&&(e.push(this.input.val()),e.push(this.input.data("color"))),e.push(this.element.data("color")),e.map(function(t){t&&!1===o&&(o=t)}),o=!1===o?t:o,o instanceof a.default?o.toString(this.format):o}},{key:"setValue",value:function(t){if(!this.hasColor()||!this.color.equals(t)){var e=!!t&&this.createColor(t);if(this.hasColor()||e){var o=this.hasColor()&&!e;this.color=e,this.element.trigger({type:"colorpickerChange",colorpicker:this,color:this.color,value:t}),this.update(o)}}}},{key:"createColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=new a.default(this._resolveColor(t),{format:this.format});if(!o.isValid()){var r=o,i=void 0;if(e&&(i=this.fallbackColor instanceof a.default&&this.fallbackColor.isValid()?this.fallbackColor:this._resolveColor(this.fallbackColor),o=new a.default(i,{format:this.format}),!o.isValid()&&e))throw new Error("The fallback color is invalid.");o.previous=r,this.element.trigger({type:"colorpickerInvalid",colorpicker:this,color:o,value:t})}if(!this.isAlphaEnabled()&&o.hasTransparency()&&o.setAlpha(1),!this.hasColor())return o;var n=o.hsvaRatio,s=this.color.hsvaRatio;return 0===n.s&&0===n.h&&0!==s.h&&o.setHueRatio(s.h),!this.isAlphaEnabled()&&o.hasTransparency()&&o.setAlpha(1),o}},{key:"isInvalidColor",value:function(){return!this.hasColor()||!this.color.isValid()||!!this.color.previous}},{key:"isAlphaEnabled",value:function(){return!0===this.options.useAlpha}},{key:"_resolveColor",value:function(t){var e=!1;return g.default.each(this.extensions,function(o,r){!1===e&&(e=r.resolveColor(t))}),!1!==e&&(t=e),t}},{key:"hasInput",value:function(){return!1!==this.input}},{key:"isDisabled",value:function(){return!0===this.disabled}},{key:"disable",value:function(){return this.hasInput()&&this.input.prop("disabled",!0),this.disabled=!0,this.element.trigger({type:"colorpickerDisable",colorpicker:this,color:this.color}),!0}},{key:"enable",value:function(){return this.hasInput()&&this.input.prop("disabled",!1),this.disabled=!1,this.element.trigger({type:"colorpickerEnable",colorpicker:this,color:this.color}),!0}},{key:"_mousedown",value:function(t){this.lastEvent.name="mousedown",this.lastEvent.e=t,!t.pageX&&!t.pageY&&t.originalEvent&&t.originalEvent.touches&&(t.pageX=t.originalEvent.touches[0].pageX,t.pageY=t.originalEvent.touches[0].pageY),t.stopPropagation(),t.preventDefault();var e=(0,g.default)(t.target),o=e.closest("div"),r=this.options.horizontal?this.options.slidersHorz:this.options.sliders;if(!o.is(".colorpicker")){if(o.is(".colorpicker-saturation"))this.currentSlider=g.default.extend({},r.saturation);else if(o.is(".colorpicker-hue"))this.currentSlider=g.default.extend({},r.hue);else{if(!o.is(".colorpicker-alpha"))return!1;this.currentSlider=g.default.extend({},r.alpha)}var i=o.offset();this.currentSlider.guide=o.find(".colorpicker-guide")[0].style,this.currentSlider.left=t.pageX-i.left,this.currentSlider.top=t.pageY-i.top,this.mousePointer={left:t.pageX,top:t.pageY},(0,g.default)(window.document).on({"mousemove.colorpicker":g.default.proxy(this._mousemove,this),"touchmove.colorpicker":g.default.proxy(this._mousemove,this),"mouseup.colorpicker":g.default.proxy(this._mouseup,this),"touchend.colorpicker":g.default.proxy(this._mouseup,this)}).trigger("mousemove")}return!1}},{key:"_mousemove",value:function(t){this.lastEvent.name="mousemove",this.lastEvent.e=t;var e=this.hasColor()?this.color.getCopy():this.createColor(this.fallbackColor);!t.pageX&&!t.pageY&&t.originalEvent&&t.originalEvent.touches&&(t.pageX=t.originalEvent.touches[0].pageX,t.pageY=t.originalEvent.touches[0].pageY),t.stopPropagation(),t.preventDefault();var o=Math.max(0,Math.min(this.currentSlider.maxLeft,this.currentSlider.left+((t.pageX||this.mousePointer.left)-this.mousePointer.left))),r=Math.max(0,Math.min(this.currentSlider.maxTop,this.currentSlider.top+((t.pageY||this.mousePointer.top)-this.mousePointer.top)));return this.currentSlider.guide.left=o+"px",this.currentSlider.guide.top=r+"px",this.currentSlider.callLeft&&e[this.currentSlider.callLeft].call(e,o/this.currentSlider.maxLeft),this.currentSlider.callTop&&e[this.currentSlider.callTop].call(e,r/this.currentSlider.maxTop),this.setValue(e),!1}},{key:"_mouseup",value:function(t){return this.lastEvent.name="mouseup",this.lastEvent.e=t,t.stopPropagation(),t.preventDefault(),(0,g.default)(window.document).off({"mousemove.colorpicker":this._mousemove,"touchmove.colorpicker":this._mousemove,"mouseup.colorpicker":this._mouseup,"touchend.colorpicker":this._mouseup}),!1}},{key:"_change",value:function(t){this.lastEvent.name="change",this.lastEvent.e=t;var e=this.input.val();e!==this.toInputColorString()&&this.setValue(e)}},{key:"_keyup",value:function(t){this.lastEvent.name="keyup",this.lastEvent.e=t;var e=this.input.val();e!==this.toInputColorString()&&this.setValue(e)}},{key:"fallbackColor",get:function(){return this.options.fallbackColor?this.options.fallbackColor:this.hasColor()?this.color:"#000"}},{key:"format",get:function(){return this.options.format?this.options.format:this.hasColor()&&this.color.hasTransparency()&&this.color.format.match(/^hex/)?this.options.enableHex8?"hex8":this.isAlphaEnabled()?"rgba":"hex":this.hasColor()?this.color.format:null}}]),t}();e.default=b},function(t,e,o){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t){return t instanceof h.default?{r:t._r,g:t._g,b:t._b,a:t._a}:t}function a(t){return t instanceof String||"string"==typeof t?t.replace(/a$/gi,""):t}Object.defineProperty(e,"__esModule",{value:!0});var l=function t(e,o,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,o);if(void 0===i){var n=Object.getPrototypeOf(e);return null===n?void 0:t(n,o,r)}if("value"in i)return i.value;var s=i.get;if(void 0!==s)return s.call(r)},c=function(){function t(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),e}}(),u=o(6),h=function(t){return t&&t.__esModule?t:{default:t}}(u),f=function(t){function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null};r(this,e),o.format&&(o.format=a(o.format));var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s(t),o));return n._originalInput=t,n._hbak=n.hsva.h,n.previous=null,n}return n(e,t),c(e,[{key:"id",get:function(){return this._tc_id}},{key:"format",get:function(){return this._format}},{key:"options",get:function(){return{format:this._format,gradientType:this._gradientType}}},{key:"hsva",get:function(){return this.toHsv()}},{key:"hsvaRatio",get:function(){var t=this.hsva;return{h:t.h/360,s:t.s,v:t.v,a:t.a}}}]),c(e,[{key:"equals",value:function(t){return t instanceof h.default&&(this._r===t._r&&this._g===t._g&&this._b===t._b&&this._a===t._a&&this._roundA===t._roundA&&this._format===t._format&&this._gradientType===t._gradientType&&this._ok===t._ok)}},{key:"importColor",value:function(t){if(!(t instanceof h.default))throw new Error("Color.importColor: The color argument is not an instance of tinycolor.");this._originalInput=t._originalInput,this._r=t._r,this._g=t._g,this._b=t._b,this._a=t._a,this._roundA=t._roundA,this._format=a(t._format),this._gradientType=t._gradientType,this._ok=t._ok}},{key:"importRgb",value:function(t){if(!t instanceof e)throw new Error("Color.importColor: The color argument is not an instance of tinycolor.");this._r=t._r,this._g=t._g,this._b=t._b,this._a=t._a,this._ok=t._ok,this._hbak=t._hbak}},{key:"importHsv",value:function(t){this._hbak=t.h,this.importRgb(new e(t,this.options))}},{key:"getCopy",value:function(){return new e(this.hsva,this.options)}},{key:"getHueOnlyCopy",value:function(){return new e({h:this._hbak?this._hbak:this.hsva.h,s:100,v:100},this.options)}},{key:"getOpaqueCopy",value:function(){return new e(Object.assign({},this.hsva,{a:1}),this.options)}},{key:"setHue",value:function(t){this.importHsv(Object.assign({},this.hsva,{h:t}))}},{key:"setSaturation",value:function(t){this.importHsv(Object.assign({},this.hsva,{s:t}))}},{key:"setBrightness",value:function(t){this.importHsv(Object.assign({},this.hsva,{v:t}))}},{key:"setHueRatio",value:function(t){0!==t&&this.setHue(360*(1-t))}},{key:"setSaturationRatio",value:function(t){this.setSaturation(t)}},{key:"setBrightnessRatio",value:function(t){this.setBrightness(1-t)}},{key:"setAlphaRatio",value:function(t){this.setAlpha(1-t)}},{key:"isTransparent",value:function(){return 0===this._a}},{key:"hasTransparency",value:function(){return 1!==this._a}},{key:"toString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t=t?a(t):this.format;var o=l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"toString",this).call(this,t);return o&&o.match(/^#[0-9a-f]{3,8}$/i)&&this.isTransparent()&&0===this._r&&0===this._g&&0===this._b?"transparent":o}}]),e}(h.default);e.default=f},function(t,e,o){var r;!function(i){function n(t,e){if(t=t||"",e=e||{},t instanceof n)return t;if(!(this instanceof n))return new n(t,e);var o=s(t);this._originalInput=t,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=X(100*this._a)/100,this._format=e.format||o.format,this._gradientType=e.gradientType,this._r<1&&(this._r=X(this._r)),this._g<1&&(this._g=X(this._g)),this._b<1&&(this._b=X(this._b)),this._ok=o.ok,this._tc_id=N++}function s(t){var e={r:0,g:0,b:0},o=1,r=null,i=null,n=null,s=!1,l=!1;return"string"==typeof t&&(t=V(t)),"object"==typeof t&&(F(t.r)&&F(t.g)&&F(t.b)?(e=a(t.r,t.g,t.b),s=!0,l="%"===String(t.r).substr(-1)?"prgb":"rgb"):F(t.h)&&F(t.s)&&F(t.v)?(r=D(t.s),i=D(t.v),e=h(t.h,r,i),s=!0,l="hsv"):F(t.h)&&F(t.s)&&F(t.l)&&(r=D(t.s),n=D(t.l),e=c(t.h,r,n),s=!0,l="hsl"),t.hasOwnProperty("a")&&(o=t.a)),o=j(o),{ok:s,format:t.format||l,r:Y(255,B(e.r,0)),g:Y(255,B(e.g,0)),b:Y(255,B(e.b,0)),a:o}}function a(t,e,o){return{r:255*P(t,255),g:255*P(e,255),b:255*P(o,255)}}function l(t,e,o){t=P(t,255),e=P(e,255),o=P(o,255);var r,i,n=B(t,e,o),s=Y(t,e,o),a=(n+s)/2;if(n==s)r=i=0;else{var l=n-s;switch(i=a>.5?l/(2-n-s):l/(n+s),n){case t:r=(e-o)/l+(e<o?6:0);break;case e:r=(o-t)/l+2;break;case o:r=(t-e)/l+4}r/=6}return{h:r,s:i,l:a}}function c(t,e,o){function r(t,e,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+6*(e-t)*o:o<.5?e:o<2/3?t+(e-t)*(2/3-o)*6:t}var i,n,s;if(t=P(t,360),e=P(e,100),o=P(o,100),0===e)i=n=s=o;else{var a=o<.5?o*(1+e):o+e-o*e,l=2*o-a;i=r(l,a,t+1/3),n=r(l,a,t),s=r(l,a,t-1/3)}return{r:255*i,g:255*n,b:255*s}}function u(t,e,o){t=P(t,255),e=P(e,255),o=P(o,255);var r,i,n=B(t,e,o),s=Y(t,e,o),a=n,l=n-s;if(i=0===n?0:l/n,n==s)r=0;else{switch(n){case t:r=(e-o)/l+(e<o?6:0);break;case e:r=(o-t)/l+2;break;case o:r=(t-e)/l+4}r/=6}return{h:r,s:i,v:a}}function h(t,e,o){t=6*P(t,360),e=P(e,100),o=P(o,100);var r=i.floor(t),n=t-r,s=o*(1-e),a=o*(1-n*e),l=o*(1-(1-n)*e),c=r%6;return{r:255*[o,a,s,s,l,o][c],g:255*[l,o,o,a,s,s][c],b:255*[s,s,l,o,o,a][c]}}function f(t,e,o,r){var i=[I(X(t).toString(16)),I(X(e).toString(16)),I(X(o).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function p(t,e,o,r,i){var n=[I(X(t).toString(16)),I(X(e).toString(16)),I(X(o).toString(16)),I(L(r))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)&&n[3].charAt(0)==n[3].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0)+n[3].charAt(0):n.join("")}function d(t,e,o,r){return[I(L(r)),I(X(t).toString(16)),I(X(e).toString(16)),I(X(o).toString(16))].join("")}function g(t,e){e=0===e?0:e||10;var o=n(t).toHsl();return o.s-=e/100,o.s=E(o.s),n(o)}function v(t,e){e=0===e?0:e||10;var o=n(t).toHsl();return o.s+=e/100,o.s=E(o.s),n(o)}function b(t){return n(t).desaturate(100)}function y(t,e){e=0===e?0:e||10;var o=n(t).toHsl();return o.l+=e/100,o.l=E(o.l),n(o)}function m(t,e){e=0===e?0:e||10;var o=n(t).toRgb();return o.r=B(0,Y(255,o.r-X(-e/100*255))),o.g=B(0,Y(255,o.g-X(-e/100*255))),o.b=B(0,Y(255,o.b-X(-e/100*255))),n(o)}function k(t,e){e=0===e?0:e||10;var o=n(t).toHsl();return o.l-=e/100,o.l=E(o.l),n(o)}function _(t,e){var o=n(t).toHsl(),r=(o.h+e)%360;return o.h=r<0?360+r:r,n(o)}function x(t){var e=n(t).toHsl();return e.h=(e.h+180)%360,n(e)}function w(t){var e=n(t).toHsl(),o=e.h;return[n(t),n({h:(o+120)%360,s:e.s,l:e.l}),n({h:(o+240)%360,s:e.s,l:e.l})]}function C(t){var e=n(t).toHsl(),o=e.h;return[n(t),n({h:(o+90)%360,s:e.s,l:e.l}),n({h:(o+180)%360,s:e.s,l:e.l}),n({h:(o+270)%360,s:e.s,l:e.l})]}function O(t){var e=n(t).toHsl(),o=e.h;return[n(t),n({h:(o+72)%360,s:e.s,l:e.l}),n({h:(o+216)%360,s:e.s,l:e.l})]}function A(t,e,o){e=e||6,o=o||30;var r=n(t).toHsl(),i=360/o,s=[n(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,s.push(n(r));return s}function S(t,e){e=e||6;for(var o=n(t).toHsv(),r=o.h,i=o.s,s=o.v,a=[],l=1/e;e--;)a.push(n({h:r,s:i,v:s})),s=(s+l)%1;return a}function j(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function P(t,e){H(t)&&(t="100%");var o=R(t);return t=Y(e,B(0,parseFloat(t))),o&&(t=parseInt(t*e,10)/100),i.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function E(t){return Y(1,B(0,t))}function T(t){return parseInt(t,16)}function H(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function R(t){return"string"==typeof t&&-1!=t.indexOf("%")}function I(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function L(t){return i.round(255*parseFloat(t)).toString(16)}function M(t){return T(t)/255}function F(t){return!!G.CSS_UNIT.exec(t)}function V(t){t=t.replace(q,"").replace(U,"").toLowerCase();var e=!1;if(Q[t])t=Q[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var o;return(o=G.rgb.exec(t))?{r:o[1],g:o[2],b:o[3]}:(o=G.rgba.exec(t))?{r:o[1],g:o[2],b:o[3],a:o[4]}:(o=G.hsl.exec(t))?{h:o[1],s:o[2],l:o[3]}:(o=G.hsla.exec(t))?{h:o[1],s:o[2],l:o[3],a:o[4]}:(o=G.hsv.exec(t))?{h:o[1],s:o[2],v:o[3]}:(o=G.hsva.exec(t))?{h:o[1],s:o[2],v:o[3],a:o[4]}:(o=G.hex8.exec(t))?{r:T(o[1]),g:T(o[2]),b:T(o[3]),a:M(o[4]),format:e?"name":"hex8"}:(o=G.hex6.exec(t))?{r:T(o[1]),g:T(o[2]),b:T(o[3]),format:e?"name":"hex"}:(o=G.hex4.exec(t))?{r:T(o[1]+""+o[1]),g:T(o[2]+""+o[2]),b:T(o[3]+""+o[3]),a:M(o[4]+""+o[4]),format:e?"name":"hex8"}:!!(o=G.hex3.exec(t))&&{r:T(o[1]+""+o[1]),g:T(o[2]+""+o[2]),b:T(o[3]+""+o[3]),format:e?"name":"hex"}}function z(t){var e,o;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),o=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==o&&"large"!==o&&(o="small"),{level:e,size:o}}var q=/^\s+/,U=/\s+$/,N=0,X=i.round,Y=i.min,B=i.max,$=i.random;n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,o,r,n,s,a=this.toRgb();return t=a.r/255,e=a.g/255,o=a.b/255,r=t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4),n=e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4),s=o<=.03928?o/12.92:i.pow((o+.055)/1.055,2.4),.2126*r+.7152*n+.0722*s},setAlpha:function(t){return this._a=j(t),this._roundA=X(100*this._a)/100,this},toHsv:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=u(this._r,this._g,this._b),e=X(360*t.h),o=X(100*t.s),r=X(100*t.v);return 1==this._a?"hsv("+e+", "+o+"%, "+r+"%)":"hsva("+e+", "+o+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=l(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=l(this._r,this._g,this._b),e=X(360*t.h),o=X(100*t.s),r=X(100*t.l);return 1==this._a?"hsl("+e+", "+o+"%, "+r+"%)":"hsla("+e+", "+o+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return p(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:X(this._r),g:X(this._g),b:X(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+X(this._r)+", "+X(this._g)+", "+X(this._b)+")":"rgba("+X(this._r)+", "+X(this._g)+", "+X(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:X(100*P(this._r,255))+"%",g:X(100*P(this._g,255))+"%",b:X(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+X(100*P(this._r,255))+"%, "+X(100*P(this._g,255))+"%, "+X(100*P(this._b,255))+"%)":"rgba("+X(100*P(this._r,255))+"%, "+X(100*P(this._g,255))+"%, "+X(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(W[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),o=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=n(t);o="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+o+")"},toString:function(t){var e=!!t;t=t||this._format;var o=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(o=this.toRgbString()),"prgb"===t&&(o=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(o=this.toHexString()),"hex3"===t&&(o=this.toHexString(!0)),"hex4"===t&&(o=this.toHex8String(!0)),"hex8"===t&&(o=this.toHex8String()),"name"===t&&(o=this.toName()),"hsl"===t&&(o=this.toHslString()),"hsv"===t&&(o=this.toHsvString()),o||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return n(this.toString())},_applyModification:function(t,e){var o=t.apply(null,[this].concat([].slice.call(e)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(k,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(x,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(O,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(C,arguments)}},n.fromRatio=function(t,e){if("object"==typeof t){var o={};for(var r in t)t.hasOwnProperty(r)&&(o[r]="a"===r?t[r]:D(t[r]));t=o}return n(t,e)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:$(),g:$(),b:$()})},n.mix=function(t,e,o){o=0===o?0:o||50;var r=n(t).toRgb(),i=n(e).toRgb(),s=o/100;return n({r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(i.a-r.a)*s+r.a})},n.readability=function(t,e){var o=n(t),r=n(e);return(i.max(o.getLuminance(),r.getLuminance())+.05)/(i.min(o.getLuminance(),r.getLuminance())+.05)},n.isReadable=function(t,e,o){var r,i,s=n.readability(t,e);switch(i=!1,r=z(o),r.level+r.size){case"AAsmall":case"AAAlarge":i=s>=4.5;break;case"AAlarge":i=s>=3;break;case"AAAsmall":i=s>=7}return i},n.mostReadable=function(t,e,o){var r,i,s,a,l=null,c=0;o=o||{},i=o.includeFallbackColors,s=o.level,a=o.size;for(var u=0;u<e.length;u++)(r=n.readability(t,e[u]))>c&&(c=r,l=n(e[u]));return n.isReadable(t,l,{level:s,size:a})||!i?l:(o.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],o))};var Q=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},W=n.hexNames=function(t){var e={};for(var o in t)t.hasOwnProperty(o)&&(e[t[o]]=o);return e}(Q),G=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",o="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();void 0!==t&&t.exports?t.exports=n:void 0!==(r=function(){return n}.call(e,o,e,t))&&(t.exports=r)}(Math)},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={debug:!1,color:!1,format:!1,horizontal:!1,inline:!1,input:"input",container:!1,component:".add-on, .input-group-addon",fallbackColor:!1,autoInputFallback:!1,useHashPrefix:!0,useAlpha:!0,enableHex8:!1,sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturationRatio",callTop:"setBrightnessRatio"},hue:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setHueRatio"},alpha:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setAlphaRatio"}},slidersHorz:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturationRatio",callTop:"setBrightnessRatio"},hue:{maxLeft:100,maxTop:0,callLeft:"setHueRatio",callTop:!1},alpha:{maxLeft:100,maxTop:0,callLeft:"setAlphaRatio",callTop:!1}},align:"right",customClass:null,template:'<div class="colorpicker">\n <div class="colorpicker-saturation"><i class="colorpicker-guide"><i /></div>\n <div class="colorpicker-hue"><i class="colorpicker-guide"></i></div>\n <div class="colorpicker-alpha"><i class="colorpicker-guide"></i></div></div>',extensions:[{name:"preview",showText:!1}]}},function(t,e,o){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Palette=e.Swatches=e.Preview=e.Debugger=void 0;var i=o(9),n=r(i),s=o(10),a=r(s),l=o(11),c=r(l),u=o(2),h=r(u);e.Debugger=n.default,e.Preview=a.default,e.Swatches=c.default,e.Palette=h.default,e.default={debugger:n.default,preview:a.default,swatches:c.default,palette:h.default}},function(t,e,o){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),e}}(),l=function t(e,o,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,o);if(void 0===i){var n=Object.getPrototypeOf(e);return null===n?void 0:t(n,o,r)}if("value"in i)return i.value;var s=i.get;if(void 0!==s)return s.call(r)},c=o(1),u=r(c),h=o(0),f=r(h),p=function(t){function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,e);var r=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,o));return r.eventCounter=0,r.colorpicker.hasInput()&&r.colorpicker.input.on("change.colorpicker-ext",f.default.proxy(r.onChangeInput,r)),r}return s(e,t),a(e,[{key:"log",value:function(t){for(var e,o=arguments.length,r=Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];this.eventCounter+=1;var n="#"+this.eventCounter+": Colorpicker#"+this.colorpicker.id+" ["+t+"]";(e=console).debug.apply(e,[n].concat(r)),this.colorpicker.element.trigger({type:"colorpickerDebug",colorpicker:this.colorpicker,color:this.color,debug:{debugger:this,eventName:t,logArgs:r,logMessage:n}})}},{key:"resolveColor",value:function(t){return this.log("resolveColor()",t),!1}},{key:"onCreate",value:function(t){return this.log("colorpickerCreate"),l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onCreate",this).call(this,t)}},{key:"onDestroy",value:function(t){return this.log("colorpickerDestroy"),this.eventCounter=0,this.colorpicker.hasInput()&&this.colorpicker.input.off(".colorpicker-ext"),l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onDestroy",this).call(this,t)}},{key:"onUpdate",value:function(t){this.log("colorpickerUpdate")}},{key:"onChangeInput",value:function(t){this.log("input:change.colorpicker",t.value,t.color)}},{key:"onChange",value:function(t){this.log("colorpickerChange",t.value,t.color)}},{key:"onInvalid",value:function(t){this.log("colorpickerInvalid",t.value,t.color)}},{key:"onHide",value:function(t){this.log("colorpickerHide"),this.eventCounter=0}},{key:"onShow",value:function(t){this.log("colorpickerShow")}},{key:"onDisable",value:function(t){this.log("colorpickerDisable")}},{key:"onEnable",value:function(t){this.log("colorpickerEnable")}}]),e}(u.default);e.default=p},function(t,e,o){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),e}}(),l=function t(e,o,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,o);if(void 0===i){var n=Object.getPrototypeOf(e);return null===n?void 0:t(n,o,r)}if("value"in i)return i.value;var s=i.get;if(void 0!==s)return s.call(r)},c=o(1),u=r(c),h=o(0),f=r(h),p=function(t){function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,e);var r=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,Object.assign({},{template:'<div class="colorpicker-bar colorpicker-preview"><div /></div>',showText:!0,format:t.format},o)));return r.element=(0,f.default)(r.options.template),r.elementInner=r.element.find("div"),r}return s(e,t),a(e,[{key:"onCreate",value:function(t){l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onCreate",this).call(this,t),this.colorpicker.picker.append(this.element)}},{key:"onUpdate",value:function(t){l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onUpdate",this).call(this,t),this.elementInner.css("backgroundColor",t.color.toRgbString()),this.options.showText&&(this.elementInner.html(t.color.toString(this.options.format||this.colorpicker.format)),t.color.isDark()?this.elementInner.css("color","white"):this.elementInner.css("color","black"))}}]),e}(u.default);e.default=p},function(t,e,o){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),e}}(),l=function t(e,o,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,o);if(void 0===i){var n=Object.getPrototypeOf(e);return null===n?void 0:t(n,o,r)}if("value"in i)return i.value;var s=i.get;if(void 0!==s)return s.call(r)},c=o(2),u=r(c),h=o(0),f=r(h),p={barTemplate:'<div class="colorpicker-bar colorpicker-swatches"></div>',swatchTemplate:'<i class="colorpicker-swatch"></i>'},d=function(t){function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(this,e),n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,Object.assign({},p,o)))}return s(e,t),a(e,[{key:"isEnabled",value:function(){return this.getLength()>0}},{key:"onCreate",value:function(t){var o=this;if(l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onCreate",this).call(this,t),this.isEnabled()){var r=this.colorpicker,i=(0,f.default)(this.options.barTemplate),n=!0===this.options.namesAsValues&&!Array.isArray(this.colors);f.default.each(this.colors,function(t,e){var s=(0,f.default)(o.options.swatchTemplate).css("background-color",e).attr("data-name",t).attr("data-value",e).attr("title",t+": "+e);s.on("mousedown.colorpicker touchstart.colorpicker",function(t){t.preventDefault(),r.setValue(n?(0,f.default)(this).data("name"):(0,f.default)(this).data("value"))}),i.append(s)}),r.picker.append(i)}}}]),e}(u.default);e.default=d}])});
10
+ //# sourceMappingURL=bootstrap-colorpicker.min.js.map
includes/colorpicker/js/bootstrap-colorpicker.min.js.map ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Bootstrap Colorpicker - Simple and customizable colorpicker component for Twitter Bootstrap.
3
+ * @package bootstrap-colorpicker
4
+ * @version v3.0.0-wip
5
+ * @license MIT
6
+ * @link https://farbelous.github.io/bootstrap-colorpicker/
7
+ * @link https://github.com/farbelous/bootstrap-colorpicker.git
8
+ */
9
+ {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///bootstrap-colorpicker.min.js","webpack:///webpack/bootstrap 32081b809d19519bb29c","webpack:///external \"jQuery\"","webpack:///./src/js/Extension.js","webpack:///./src/js/extensions/Palette.js","webpack:///./src/js/jquery-plugin.js","webpack:///./src/js/Colorpicker.js","webpack:///./src/js/Color.js","webpack:///./node_modules/tinycolor2/tinycolor.js","webpack:///./src/js/options.js","webpack:///./src/js/extensions/index.js","webpack:///./src/js/extensions/Debugger.js","webpack:///./src/js/extensions/Preview.js","webpack:///./src/js/extensions/Swatches.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_0__","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","_classCallCheck","instance","Constructor","TypeError","value","_createClass","defineProperties","target","props","length","descriptor","writable","key","protoProps","staticProps","_jquery","_jquery2","obj","default","Extension","colorpicker","options","arguments","undefined","element","Error","on","proxy","onCreate","onDestroy","onUpdate","onChange","onInvalid","onShow","onHide","onEnable","onDisable","color","event","off","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","setPrototypeOf","__proto__","_typeof","Symbol","iterator","_Extension2","_Extension3","defaults","colors","namesAsValues","Palette","_Extension","_this","getPrototypeOf","assign","Array","isArray","keys","getLength","indexOf","toUpperCase","toLowerCase","getName","getValue","defaultValue","_interopRequireDefault","_Colorpicker","_Colorpicker2","plugin","fn","option","apiArgs","slice","isSingleElement","returnValue","$jq","each","$this","inst","data","isFunction","apply","_Color","_Color2","_options","_options2","_extensions","_extensions2","colorPickerIdCounter","Colorpicker","id","addClass","attr","extensions","component","find","container","currentSlider","mousePointer","left","top","lastEvent","e","input","is","debug","push","forEach","ext","addExtension","colorValue","createColor","format","disabled","$picker","picker","template","customClass","inline","horizontal","useAlpha","hasColor","hasTransparency","align","currentTarget","preventDefault","_mousedown","appendTo","hasInput","keyup.colorpicker","_keyup","change.colorpicker","_change","focus.colorpicker","show","focusout.colorpicker","hide","click.colorpicker","has","update","trigger","type","set","extensionName","ExtensionClass","config","remove","removeData","removeClass","str","toCssColorString","useHashPrefix","replace","_resolveColor","toString","window","document","body","offset","outerWidth","css","outerHeight","isVisible","isDisabled","_reposition","stopPropagation","mousedown.colorpicker","isHidden","parents","hasClass","val","toInputColorString","prop","vertical","sl","sliders","slidersHorz","saturationGuide","hueGuide","alphaGuide","hsva","hsvaRatio","hue","maxTop","maxLeft","h","alpha","a","saturation","v","getHueOnlyCopy","toHexString","icn","eq","backgroundColor","force","_shouldUpdate","_updateComponent","autoInputFallback","_updateInput","_updatePicker","fallbackColor","candidates","map","item","equals","shouldForceUpdate","useFallback","isValid","invalidColor","fallback","previous","isAlphaEnabled","setAlpha","prevHsva","setHueRatio","extResolvedColor","resolveColor","pageX","pageY","originalEvent","touches","zone","closest","extend","guide","style","mousemove.colorpicker","_mousemove","touchmove.colorpicker","mouseup.colorpicker","_mouseup","touchend.colorpicker","getCopy","Math","max","min","callLeft","callTop","setValue","match","enableHex8","unwrapColor","r","_r","g","_g","b","_b","_a","getCompatibleFormat","String","_get","receiver","Function","desc","getOwnPropertyDescriptor","parent","_tinycolor2","_tinycolor3","Color","_tinycolor","_originalInput","_hbak","_tc_id","_format","gradientType","_gradientType","toHsv","hsv","_roundA","_ok","importRgb","importHsv","setHue","setSaturation","setBrightness","colorStr","isTransparent","__WEBPACK_AMD_DEFINE_RESULT__","tinycolor","opts","rgb","inputToRGB","mathRound","ok","tinyCounter","stringInputToObject","isValidCSSUnit","rgbToRgb","substr","convertToPercentage","hsvToRgb","hslToRgb","boundAlpha","mathMin","mathMax","bound01","rgbToHsl","hue2rgb","q","t","rgbToHsv","floor","f","mod","rgbToHex","allow3Char","hex","pad2","charAt","join","rgbaToHex","allow4Char","convertDecimalToHex","rgbaToArgbHex","desaturate","amount","hsl","toHsl","clamp01","saturate","greyscale","lighten","brighten","toRgb","darken","spin","complement","triad","tetrad","splitcomplement","analogous","results","slices","part","ret","monochromatic","modification","parseFloat","isNaN","isOnePointZero","processPercent","isPercentage","parseInt","abs","parseIntFromHex","round","convertHexToDecimal","matchers","CSS_UNIT","exec","trimLeft","trimRight","named","names","rgba","hsla","hex8","hex6","hex4","hex3","validateWCAG2Parms","parms","level","size","mathRandom","random","isDark","getBrightness","isLight","getOriginalInput","getFormat","getAlpha","getLuminance","RsRGB","GsRGB","BsRGB","R","G","B","pow","toHsvString","toHslString","toHex","toHex8","toHex8String","toRgbString","toPercentageRgb","toPercentageRgbString","toName","hexNames","toFilter","secondColor","hex8String","secondHex8String","formatSet","formattedString","hasAlpha","clone","_applyModification","args","concat","_applyCombination","fromRatio","newColor","color1","color2","mix","rgb1","rgb2","readability","c1","c2","isReadable","wcag2","wcag2Parms","out","mostReadable","baseColor","colorList","includeFallbackColors","bestColor","bestScore","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","burntsienna","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","flipped","PERMISSIVE_MATCH3","PERMISSIVE_MATCH4","RegExp","showText","Swatches","Preview","Debugger","_Debugger","_Debugger2","_Preview","_Preview2","_Swatches","_Swatches2","_Palette","_Palette2","debugger","preview","swatches","palette","eventCounter","onChangeInput","eventName","_console","_len","_key","logMessage","console","logArgs","log","elementInner","append","html","_Palette3","barTemplate","swatchTemplate","_this2","isEnabled","swatchContainer","isAliased","$swatch"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,WACA,kBAAAC,gBAAAC,IACAD,OAAA,mCAAAJ,GACA,gBAAAC,SACAA,QAAA,yBAAAD,EAAAG,QAAA,WAEAJ,EAAA,yBAAAC,EAAAD,EAAA,SACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAE,EAAAF,EACAG,G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liB,EAAApE,MAAAsmB,EAAAzhB,WAAA9D,OAAA0E,eAAA6gB,IAAA9lB,KAAAR,KAC/BgD,EAAajC,OAAO2E,UAAWP,EAAUlC,Kb+zHjD,MA5CAsB,GAAU+hB,EAAUS,GAUpB9kB,EAAaqkB,IACX9jB,IAAK,YACLR,MAAO,Wa3xHP,MAAOhC,MAAK8F,YAAc,Kb+xH1BtD,IAAK,WACLR,MAAO,Sa7xHAkC,GAAO,GAAAmkB,GAAAroB,IAGd,IAFAgS,EAAAsU,EAAA9kB,UAAAqD,WAAA9D,OAAA0E,eAAA6gB,EAAA9kB,WAAA,WAAAxB,MAAAQ,KAAAR,KAAekE,GAEVlE,KAAKsoB,YAAV,CAIA,GAAItlB,GAAchD,KAAKgD,YACrBulB,GAAkB,EAAA3lB,EAAAE,SAAE9C,KAAKiD,QAAQklB,aACjCK,GAA4C,IAA/BxoB,KAAKiD,QAAQoC,gBAA4BM,MAAMC,QAAQ5F,KAAKoF,OAE3ExC,GAAAE,QAAEkE,KAAKhH,KAAKoF,OAAQ,SAACxE,EAAMoB,GACzB,GAAIymB,IAAU,EAAA7lB,EAAAE,SAAEulB,EAAKplB,QAAQmlB,gBAC1Bhc,IAAI,mBAAoBpK,GACxBgG,KAAK,YAAapH,GAClBoH,KAAK,aAAchG,GACnBgG,KAAK,QAAYpH,EAJN,KAIeoB,EAE7BymB,GAAQnlB,GAAG,+CACT,SAAUoF,GACRA,EAAEuB,iBACFjH,EAAYmO,SAASqX,GAAY,EAAA5lB,EAAAE,SAAE9C,MAAMmH,KAAK,SAAU,EAAAvE,EAAAE,SAAE9C,MAAMmH,KAAK,YAGzEohB,EAAgBP,OAAOS,KAGzBzlB,EAAYuG,OAAOye,OAAOO,Qb6xHrBjC,GACP4B,EAAUplB,QAEZnD,GAAQmD,Qa5xHOwjB","file":"bootstrap-colorpicker.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jQuery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"bootstrap-colorpicker\", [\"jQuery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"bootstrap-colorpicker\"] = factory(require(\"jQuery\"));\n\telse\n\t\troot[\"bootstrap-colorpicker\"] = factory(root[\"jQuery\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jQuery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"bootstrap-colorpicker\", [\"jQuery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"bootstrap-colorpicker\"] = factory(require(\"jQuery\"));\n\telse\n\t\troot[\"bootstrap-colorpicker\"] = factory(root[\"jQuery\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Colorpicker extension class.\n */\nvar Extension = function () {\n /**\n * @param {Colorpicker} colorpicker\n * @param {Object} options\n */\n function Extension(colorpicker) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Extension);\n\n /**\n * @type {Colorpicker}\n */\n this.colorpicker = colorpicker;\n /**\n * @type {Object}\n */\n this.options = options;\n\n if (!(this.colorpicker.element && this.colorpicker.element.length)) {\n throw new Error('Extension: this.colorpicker.element is not valid');\n }\n\n this.colorpicker.element.on('colorpickerCreate.colorpicker-ext', _jquery2.default.proxy(this.onCreate, this));\n this.colorpicker.element.on('colorpickerDestroy.colorpicker-ext', _jquery2.default.proxy(this.onDestroy, this));\n this.colorpicker.element.on('colorpickerUpdate.colorpicker-ext', _jquery2.default.proxy(this.onUpdate, this));\n this.colorpicker.element.on('colorpickerChange.colorpicker-ext', _jquery2.default.proxy(this.onChange, this));\n this.colorpicker.element.on('colorpickerInvalid.colorpicker-ext', _jquery2.default.proxy(this.onInvalid, this));\n this.colorpicker.element.on('colorpickerShow.colorpicker-ext', _jquery2.default.proxy(this.onShow, this));\n this.colorpicker.element.on('colorpickerHide.colorpicker-ext', _jquery2.default.proxy(this.onHide, this));\n this.colorpicker.element.on('colorpickerEnable.colorpicker-ext', _jquery2.default.proxy(this.onEnable, this));\n this.colorpicker.element.on('colorpickerDisable.colorpicker-ext', _jquery2.default.proxy(this.onDisable, this));\n }\n\n /**\n * Function called every time a new color needs to be created.\n * Return false to skip this resolver and continue with other extensions' ones\n * or return anything else to consider the color resolved.\n *\n * @param {Color|String|*} color\n * @return {Color|String|*}\n */\n\n\n _createClass(Extension, [{\n key: 'resolveColor',\n value: function resolveColor(color) {\n return false;\n }\n\n /**\n * @listens colorpickerCreate\n * @param {Event} event\n */\n\n }, {\n key: 'onCreate',\n value: function onCreate(event) {}\n // to be extended\n\n\n /**\n * @listens colorpickerDestroy\n * @param {Event} event\n */\n\n }, {\n key: 'onDestroy',\n value: function onDestroy(event) {\n this.colorpicker.element.off('.colorpicker-ext');\n }\n\n /**\n * @listens colorpickerUpdate\n * @param {Event} event\n */\n\n }, {\n key: 'onUpdate',\n value: function onUpdate(event) {}\n // to be extended\n\n\n /**\n * @listens colorpickerChange\n * @param {Event} event\n */\n\n }, {\n key: 'onChange',\n value: function onChange(event) {}\n // to be extended\n\n\n /**\n * @listens colorpickerInvalid\n * @param {Event} event\n */\n\n }, {\n key: 'onInvalid',\n value: function onInvalid(event) {}\n // to be extended\n\n\n /**\n * @listens colorpickerHide\n * @param {Event} event\n */\n\n }, {\n key: 'onHide',\n value: function onHide(event) {}\n // to be extended\n\n\n /**\n * @listens colorpickerShow\n * @param {Event} event\n */\n\n }, {\n key: 'onShow',\n value: function onShow(event) {}\n // to be extended\n\n\n /**\n * @listens colorpickerDisable\n * @param {Event} event\n */\n\n }, {\n key: 'onDisable',\n value: function onDisable(event) {}\n // to be extended\n\n\n /**\n * @listens colorpickerEnable\n * @param {Event} event\n */\n\n }, {\n key: 'onEnable',\n value: function onEnable(event) {\n // to be extended\n }\n }]);\n\n return Extension;\n}();\n\nexports.default = Extension;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Extension2 = __webpack_require__(1);\n\nvar _Extension3 = _interopRequireDefault(_Extension2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar defaults = {\n /**\n * Key-value pairs defining a color alias and its CSS color representation.\n *\n * They can also be just an array of values. In that case, no special names are used, only the real colors.\n *\n * @type {Object|Array}\n * @default null\n * @example\n * {\n * 'black': '#000000',\n * 'white': '#ffffff',\n * 'red': '#FF0000',\n * 'default': '#777777',\n * 'primary': '#337ab7',\n * 'success': '#5cb85c',\n * 'info': '#5bc0de',\n * 'warning': '#f0ad4e',\n * 'danger': '#d9534f'\n * }\n *\n * @example ['#f0ad4e', '#337ab7', '#5cb85c']\n */\n colors: null,\n /**\n * If true, the when a color swatch is selected the name (alias) will be used as input value,\n * otherwise the swatch real color value will be used.\n *\n * @type {boolean}\n * @default true\n */\n namesAsValues: true\n};\n\nvar Palette = function (_Extension) {\n _inherits(Palette, _Extension);\n\n _createClass(Palette, [{\n key: 'colors',\n\n\n /**\n * @returns {Object|Array}\n */\n get: function get() {\n return this.options.colors;\n }\n }]);\n\n function Palette(colorpicker) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Palette);\n\n var _this = _possibleConstructorReturn(this, (Palette.__proto__ || Object.getPrototypeOf(Palette)).call(this, colorpicker, Object.assign({}, defaults, options)));\n\n if (!Array.isArray(_this.options.colors) && _typeof(_this.options.colors) !== 'object') {\n _this.options.colors = null;\n }\n return _this;\n }\n\n /**\n * @returns {int}\n */\n\n\n _createClass(Palette, [{\n key: 'getLength',\n value: function getLength() {\n if (!this.options.colors) {\n return 0;\n }\n\n if (Array.isArray(this.options.colors)) {\n return this.options.colors.length;\n }\n\n if (_typeof(this.options.colors) === 'object') {\n return Object.keys(this.options.colors).length;\n }\n\n return 0;\n }\n }, {\n key: 'resolveColor',\n value: function resolveColor(color) {\n if (this.getLength() <= 0) {\n return false;\n }\n\n if (Array.isArray(this.options.colors)) {\n if (this.options.colors.indexOf(color) >= 0) {\n return color;\n }\n if (this.options.colors.indexOf(color.toUpperCase()) >= 0) {\n return color.toUpperCase();\n }\n if (this.options.colors.indexOf(color.toLowerCase()) >= 0) {\n return color.toLowerCase();\n }\n return false;\n }\n\n if (_typeof(this.options.colors) !== 'object') {\n return false;\n }\n\n if (!this.options.namesAsValues) {\n return this.getValue(color, false);\n }\n return this.getName(color, this.getName('#' + color, this.getValue(color, false)));\n }\n\n /**\n * Given a color value, returns the corresponding color name or defaultValue.\n *\n * @param {String} value\n * @param {*} defaultValue\n * @returns {*}\n */\n\n }, {\n key: 'getName',\n value: function getName(value) {\n var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!(typeof value === 'string') || !this.options.colors) {\n return defaultValue;\n }\n for (var name in this.options.colors) {\n if (!this.options.colors.hasOwnProperty(name)) {\n continue;\n }\n if (this.options.colors[name].toLowerCase() === value.toLowerCase()) {\n return name;\n }\n }\n return defaultValue;\n }\n\n /**\n * Given a color name, returns the corresponding color value or defaultValue.\n *\n * @param {String} name\n * @param {*} defaultValue\n * @returns {*}\n */\n\n }, {\n key: 'getValue',\n value: function getValue(name) {\n var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!(typeof name === 'string') || !this.options.colors) {\n return defaultValue;\n }\n if (this.options.colors.hasOwnProperty(name)) {\n return this.options.colors[name];\n }\n return defaultValue;\n }\n }]);\n\n return Palette;\n}(_Extension3.default);\n\nexports.default = Palette;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _Colorpicker = __webpack_require__(4);\n\nvar _Colorpicker2 = _interopRequireDefault(_Colorpicker);\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar plugin = 'colorpicker';\n\n_jquery2.default[plugin] = _Colorpicker2.default;\n\n_jquery2.default.fn[plugin] = function (option) {\n var apiArgs = Array.prototype.slice.call(arguments, 1),\n isSingleElement = this.length === 1,\n returnValue = null;\n\n var $jq = this.each(function () {\n var $this = (0, _jquery2.default)(this),\n inst = $this.data(plugin),\n options = (typeof option === 'undefined' ? 'undefined' : _typeof(option)) === 'object' ? option : {};\n\n if (!inst) {\n inst = new _Colorpicker2.default(this, options);\n $this.data(plugin, inst);\n }\n\n if (typeof option === 'string') {\n if (option === 'colorpicker') {\n returnValue = inst;\n } else if (_jquery2.default.isFunction(inst[option])) {\n returnValue = inst[option].apply(inst, apiArgs);\n } else {\n // its a property ?\n if (apiArgs.length) {\n // set property\n inst[option] = apiArgs[0];\n }\n returnValue = inst[option];\n }\n } else {\n returnValue = $this;\n }\n });\n\n return isSingleElement ? returnValue : $jq;\n};\n\n_jquery2.default.fn[plugin].constructor = _Colorpicker2.default;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Color = __webpack_require__(5);\n\nvar _Color2 = _interopRequireDefault(_Color);\n\nvar _Extension = __webpack_require__(1);\n\nvar _Extension2 = _interopRequireDefault(_Extension);\n\nvar _options = __webpack_require__(7);\n\nvar _options2 = _interopRequireDefault(_options);\n\nvar _extensions = __webpack_require__(8);\n\nvar _extensions2 = _interopRequireDefault(_extensions);\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar colorPickerIdCounter = 0;\n\n/**\n * Colorpicker widget class\n */\n\nvar Colorpicker = function () {\n _createClass(Colorpicker, [{\n key: 'color',\n\n\n /**\n * color getter\n *\n * @type {Color|null}\n */\n get: function get() {\n return this.element.data('color');\n }\n\n /**\n * color setter\n *\n * @ignore\n * @param {Color|null} value\n */\n ,\n set: function set(value) {\n this.element.data('color', value);\n }\n\n /**\n * @fires colorpickerCreate\n * @param {Object|String} element\n * @param {Object} options\n * @constructor\n */\n\n }], [{\n key: 'Color',\n\n /**\n * Color class\n *\n * @static\n * @type {Color}\n */\n get: function get() {\n return _Color2.default;\n }\n\n /**\n * Extension class\n *\n * @static\n * @type {Extension}\n */\n\n }, {\n key: 'Extension',\n get: function get() {\n return _Extension2.default;\n }\n\n /**\n * Colorpicker bundled extension classes\n *\n * @static\n * @type {{Extension}}\n */\n\n }, {\n key: 'Extensions',\n get: function get() {\n return _extensions2.default;\n }\n }]);\n\n function Colorpicker(element, options) {\n var _this = this;\n\n _classCallCheck(this, Colorpicker);\n\n colorPickerIdCounter += 1;\n /**\n * The colorpicker instance number\n * @type {number}\n */\n this.id = colorPickerIdCounter;\n\n /**\n * @type {*|jQuery}\n */\n this.element = (0, _jquery2.default)(element).addClass('colorpicker-element');\n this.element.attr('data-colorpicker-id', this.id);\n\n /**\n * @type {defaults}\n */\n this.options = Object.assign({}, _options2.default, options, this.element.data());\n\n /**\n * @type {Extension[]}\n */\n this.extensions = [];\n\n if (!Array.isArray(this.options.extensions)) {\n this.options.extensions = [];\n }\n\n /**\n * @type {*|jQuery}\n */\n this.component = this.options.component;\n this.component = this.component !== false ? this.element.find(this.component) : false;\n if (this.component && this.component.length === 0) {\n this.component = false;\n }\n\n /**\n * @type {*|jQuery}\n */\n this.container = this.options.container === true ? this.element : this.options.container;\n this.container = this.container !== false ? (0, _jquery2.default)(this.container) : false;\n\n /**\n * @type {*|String}\n * @private\n */\n this.currentSlider = null;\n\n /**\n * @type {{left: number, top: number}}\n * @private\n */\n this.mousePointer = {\n left: 0,\n top: 0\n };\n\n /**\n * Latest external event\n *\n * @type {{name: String, e: *}}\n * @private\n */\n this.lastEvent = {\n name: null,\n e: null\n };\n\n // Is the element an input? Should we search inside for any input?\n /**\n * @type {*|jQuery}\n */\n this.input = this.element.is('input') ? this.element : this.options.input ? this.element.find(this.options.input) : false;\n\n if (this.input && this.input.length === 0) {\n this.input = false;\n }\n\n if (this.options.debug) {\n this.options.extensions.push({ name: 'Debugger' });\n }\n\n // Register extensions\n this.options.extensions.forEach(function (ext) {\n _this.addExtension(ext.name, _extensions2.default[ext.name.toLowerCase()], ext);\n });\n\n var colorValue = this.options.color !== false ? this.options.color : this.getValue();\n\n this.color = colorValue ? this.createColor(colorValue) : false;\n\n if (this.options.format === false) {\n // If format is false, use the first parsed one from now on\n this.options.format = this.color.format;\n }\n\n /**\n * @type {boolean}\n * @private\n */\n this.disabled = false;\n\n // Setup picker\n var $picker = this.picker = (0, _jquery2.default)(this.options.template);\n\n if (this.options.customClass) {\n $picker.addClass(this.options.customClass);\n }\n if (this.options.inline) {\n $picker.addClass('colorpicker-inline colorpicker-visible');\n } else {\n $picker.addClass('colorpicker-hidden');\n }\n if (this.options.horizontal) {\n $picker.addClass('colorpicker-horizontal');\n }\n\n if ((this.options.useAlpha || this.hasColor() && this.color.hasTransparency()) && this.options.useAlpha !== false) {\n this.options.useAlpha = true;\n $picker.addClass('colorpicker-with-alpha');\n }\n\n if (this.options.align === 'right') {\n $picker.addClass('colorpicker-right');\n }\n if (this.options.inline === true) {\n $picker.addClass('colorpicker-no-arrow');\n }\n\n // Prevent closing the colorpicker when clicking on itself\n $picker.on('mousedown.colorpicker touchstart.colorpicker', _jquery2.default.proxy(function (e) {\n if (e.target === e.currentTarget) {\n e.preventDefault();\n }\n }, this));\n\n // Bind click/tap events on the sliders\n $picker.find('.colorpicker-saturation, .colorpicker-hue, .colorpicker-alpha').on('mousedown.colorpicker touchstart.colorpicker', _jquery2.default.proxy(this._mousedown, this));\n\n $picker.appendTo(this.container ? this.container : (0, _jquery2.default)('body'));\n\n // Bind other events\n if (this.hasInput()) {\n this.input.on({\n 'keyup.colorpicker': _jquery2.default.proxy(this._keyup, this)\n });\n this.input.on({\n 'change.colorpicker': _jquery2.default.proxy(this._change, this)\n });\n if (this.component === false) {\n this.element.on({\n 'focus.colorpicker': _jquery2.default.proxy(this.show, this)\n });\n }\n if (this.options.inline === false) {\n this.element.on({\n 'focusout.colorpicker': _jquery2.default.proxy(this.hide, this)\n });\n }\n }\n\n if (this.component !== false) {\n this.component.on({\n 'click.colorpicker': _jquery2.default.proxy(this.show, this)\n });\n }\n\n if (this.hasInput() === false && this.component === false && !this.element.has('.colorpicker')) {\n this.element.on({\n 'click.colorpicker': _jquery2.default.proxy(this.show, this)\n });\n }\n\n // for HTML5 input[type='color']\n if (this.hasInput() && this.component !== false && this.input.attr('type') === 'color') {\n this.input.on({\n 'click.colorpicker': _jquery2.default.proxy(this.show, this),\n 'focus.colorpicker': _jquery2.default.proxy(this.show, this)\n });\n }\n\n // Update if there is a color option\n this.update(this.options.color !== false);\n\n (0, _jquery2.default)(_jquery2.default.proxy(function () {\n /**\n * (Colorpicker) When the Colorpicker instance has been created and the DOM is ready.\n *\n * @event colorpickerCreate\n */\n this.element.trigger({\n type: 'colorpickerCreate',\n colorpicker: this,\n color: this.color\n });\n }, this));\n }\n\n /**\n * Creates and registers the given extension\n *\n * @param {String|Extension} extensionName\n * @param {Extension} ExtensionClass\n * @param {Object} [config]\n * @returns {Extension}\n */\n\n\n _createClass(Colorpicker, [{\n key: 'addExtension',\n value: function addExtension(extensionName, ExtensionClass) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var ext = extensionName instanceof _Extension2.default ? extensionName : new ExtensionClass(this, config);\n\n this.extensions.push(ext);\n return ext;\n }\n\n /**\n * Destroys the current instance\n *\n * @fires colorpickerDestroy\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.picker.remove();\n this.element.removeData('colorpicker', 'color').off('.colorpicker');\n if (this.hasInput()) {\n this.input.off('.colorpicker');\n }\n if (this.component !== false) {\n this.component.off('.colorpicker');\n }\n this.element.removeClass('colorpicker-element');\n\n /**\n * (Colorpicker) When the instance is destroyed with all events unbound.\n *\n * @event colorpickerDestroy\n */\n this.element.trigger({\n type: 'colorpickerDestroy',\n colorpicker: this,\n color: this.color\n });\n }\n\n /**\n * Returns true if the current color object is an instance of Color, false otherwise.\n * @returns {boolean}\n */\n\n }, {\n key: 'hasColor',\n value: function hasColor() {\n return this.color instanceof _Color2.default;\n }\n\n /**\n * @returns {*|String|Color}\n */\n\n }, {\n key: 'toInputColorString',\n\n\n /**\n * Formatted color string, with the formatting options applied\n * (e.g. useHashPrefix)\n * @returns {String}\n */\n value: function toInputColorString() {\n var str = this.toCssColorString();\n\n if (!str) {\n return str;\n }\n\n if (this.options.useHashPrefix === false) {\n str = str.replace(/^#/g, '');\n }\n\n return this._resolveColor(str);\n }\n\n /**\n * Formatted color string, suitable for CSS\n * @returns {String}\n */\n\n }, {\n key: 'toCssColorString',\n value: function toCssColorString() {\n if (!this.hasColor()) {\n return '';\n }\n return this.color.toString(this.format);\n }\n\n /**\n * If the widget is not inside a container or inline, rearranges its position relative to its element offset.\n *\n * @param {Event} [e]\n * @private\n * @returns {boolean} Returns false if the widget is inside a container or inline, true otherwise\n */\n\n }, {\n key: '_reposition',\n value: function _reposition(e) {\n this.lastEvent.name = 'reposition';\n this.lastEvent.e = e;\n\n if (this.options.inline !== false || this.options.container) {\n return false;\n }\n var type = this.container && this.container[0] !== window.document.body ? 'position' : 'offset';\n var element = this.component || this.element;\n var offset = element[type]();\n\n if (this.options.align === 'right') {\n offset.left -= this.picker.outerWidth() - element.outerWidth();\n }\n this.picker.css({\n top: offset.top + element.outerHeight(),\n left: offset.left\n });\n return true;\n }\n\n /**\n * Shows the colorpicker widget if hidden.\n * If the input is disabled this call will be ignored.\n *\n * @fires colorpickerShow\n * @param {Event} [e]\n * @returns {boolean} True if was hidden and afterwards visible, false if nothing happened.\n */\n\n }, {\n key: 'show',\n value: function show(e) {\n this.lastEvent.name = 'show';\n this.lastEvent.e = e;\n\n if (this.isVisible() || this.isDisabled()) {\n // Don't show the widget if it's already visible or it is disabled\n return false;\n }\n this.picker.addClass('colorpicker-visible').removeClass('colorpicker-hidden');\n\n this._reposition(e);\n (0, _jquery2.default)(window).on('resize.colorpicker', _jquery2.default.proxy(this._reposition, this));\n\n if (e && (!this.hasInput() || this.input.attr('type') === 'color')) {\n if (e.stopPropagation && e.preventDefault) {\n e.stopPropagation();\n e.preventDefault();\n }\n }\n if ((this.component || !this.input) && this.options.inline === false) {\n (0, _jquery2.default)(window.document).on({\n 'mousedown.colorpicker': _jquery2.default.proxy(this.hide, this)\n });\n }\n\n /**\n * (Colorpicker) When show() is called and the widget can be shown.\n *\n * @event colorpickerShow\n */\n this.element.trigger({\n type: 'colorpickerShow',\n colorpicker: this,\n color: this.color\n });\n\n return true;\n }\n\n /**\n * Hides the colorpicker widget.\n * Hide is prevented when it is triggered by an event whose target element has been clicked/touched.\n *\n * @fires colorpickerHide\n * @param {Event} [e]\n * @returns {boolean} True if was visible and afterwards hidden, false if nothing happened.\n */\n\n }, {\n key: 'hide',\n value: function hide(e) {\n this.lastEvent.name = 'hide';\n this.lastEvent.e = e;\n\n if (this.isHidden()) {\n // Do not trigger if already hidden\n return false;\n }\n if (typeof e !== 'undefined' && e.target) {\n // Prevent hide if triggered by an event and an element inside the colorpicker has been clicked/touched\n if ((0, _jquery2.default)(e.currentTarget).parents('.colorpicker').length > 0 || (0, _jquery2.default)(e.target).parents('.colorpicker').length > 0) {\n return false;\n }\n }\n this.picker.addClass('colorpicker-hidden').removeClass('colorpicker-visible');\n (0, _jquery2.default)(window).off('resize.colorpicker', this._reposition);\n (0, _jquery2.default)(window.document).off({\n 'mousedown.colorpicker': this.hide\n });\n\n /**\n * (Colorpicker) When hide() is called and the widget can be hidden.\n *\n * @event colorpickerHide\n */\n this.element.trigger({\n type: 'colorpickerHide',\n colorpicker: this,\n color: this.color\n });\n return true;\n }\n\n /**\n * Returns true if the colorpicker element has the colorpicker-visible class and not the colorpicker-hidden one.\n * False otherwise.\n *\n * @returns {boolean}\n */\n\n }, {\n key: 'isVisible',\n value: function isVisible() {\n return this.picker.hasClass('colorpicker-visible') && !this.picker.hasClass('colorpicker-hidden');\n }\n\n /**\n * Returns true if the colorpicker element has the colorpicker-hidden class and not the colorpicker-visible one.\n * False otherwise.\n *\n * @returns {boolean}\n */\n\n }, {\n key: 'isHidden',\n value: function isHidden() {\n return this.picker.hasClass('colorpicker-hidden') && !this.picker.hasClass('colorpicker-visible');\n }\n\n /**\n * If the input element is present, it updates the value with the current color object color string.\n * If value is set, this method fires a \"change\" event on the input element.\n *\n * @fires change\n * @private\n */\n\n }, {\n key: '_updateInput',\n value: function _updateInput() {\n if (this.hasInput()) {\n var val = this.toInputColorString();\n\n if (val === this.input.prop('value')) {\n // No need to set value or trigger any event if nothing changed\n return;\n }\n\n this.input.prop('value', val ? val : '');\n\n /**\n * (Input) Triggered on the input element when a new color is selected.\n *\n * @event change\n */\n this.input.trigger({\n type: 'change',\n colorpicker: this,\n color: this.color,\n value: val\n });\n }\n }\n\n /**\n * Changes the color adjustment bars using the current color object information.\n * @private\n */\n\n }, {\n key: '_updatePicker',\n value: function _updatePicker() {\n if (!this.hasColor()) {\n return;\n }\n\n var vertical = this.options.horizontal === false,\n sl = vertical ? this.options.sliders : this.options.slidersHorz;\n\n var saturationGuide = this.picker.find('.colorpicker-saturation .colorpicker-guide'),\n hueGuide = this.picker.find('.colorpicker-hue .colorpicker-guide'),\n alphaGuide = this.picker.find('.colorpicker-alpha .colorpicker-guide');\n\n var hsva = this.color.hsvaRatio;\n\n if (hueGuide.length) {\n hueGuide.css(vertical ? 'top' : 'left', (vertical ? sl.hue.maxTop : sl.hue.maxLeft) * (1 - hsva.h));\n }\n\n if (alphaGuide.length) {\n alphaGuide.css(vertical ? 'top' : 'left', (vertical ? sl.alpha.maxTop : sl.alpha.maxLeft) * (1 - hsva.a));\n }\n\n if (saturationGuide.length) {\n saturationGuide.css({\n 'top': sl.saturation.maxTop - hsva.v * sl.saturation.maxTop,\n 'left': hsva.s * sl.saturation.maxLeft\n });\n }\n\n this.picker.find('.colorpicker-saturation').css('backgroundColor', this.color.getHueOnlyCopy().toHexString()); // we only need hue\n\n this.picker.find('.colorpicker-alpha').css('backgroundColor', this.color.toString('hex6')); // we don't need alpha\n }\n\n /**\n * If the component element is present, its background color is updated\n * @private\n */\n\n }, {\n key: '_updateComponent',\n value: function _updateComponent() {\n if (!this.hasColor()) {\n return;\n }\n\n if (this.component !== false) {\n var icn = this.component.find('i').eq(0);\n\n if (icn.length > 0) {\n icn.css({\n 'backgroundColor': this.toCssColorString()\n });\n } else {\n this.component.css({\n 'backgroundColor': this.toCssColorString()\n });\n }\n }\n }\n\n /**\n * @private\n * @returns {boolean}\n */\n\n }, {\n key: '_shouldUpdate',\n value: function _shouldUpdate() {\n return this.hasColor() && this.getValue(false) !== false;\n }\n\n /**\n * Updated the component color, the input value and the widget if a color is present.\n *\n * If force is true, it is updated anyway.\n *\n * @fires colorpickerUpdate\n * @param {boolean} [force]\n */\n\n }, {\n key: 'update',\n value: function update() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (this._shouldUpdate() || force === true) {\n // Update only if the current value (from input or data) is not empty\n this._updateComponent();\n\n // Do not update input when autoInputFallback is disabled and last event is keyup.\n var preventInputUpdate = this.options.autoInputFallback !== true &&\n // this.isInvalidColor() || // prevent also on invalid color (on create, leaves invalid colors)\n this.lastEvent.name === 'keyup';\n\n if (!preventInputUpdate) {\n this._updateInput();\n }\n\n this._updatePicker();\n\n /**\n * (Colorpicker) Fired when the widget is updated.\n *\n * @event colorpickerUpdate\n */\n this.element.trigger({\n type: 'colorpickerUpdate',\n colorpicker: this,\n color: this.color\n });\n }\n }\n\n /**\n * Returns the color string from the input value or the 'data-color' attribute of the input or element.\n * If empty, it returns the defaultValue parameter.\n *\n * @param {String|*} [defaultValue]\n * @returns {String|*}\n */\n\n }, {\n key: 'getValue',\n value: function getValue() {\n var defaultValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n defaultValue = typeof defaultValue === 'undefined' ? this.fallbackColor : defaultValue;\n var candidates = [],\n val = false;\n\n if (this.hasInput()) {\n candidates.push(this.input.val());\n candidates.push(this.input.data('color'));\n }\n candidates.push(this.element.data('color'));\n\n candidates.map(function (item) {\n if (item && val === false) {\n val = item;\n }\n });\n\n val = val === false ? defaultValue : val;\n\n if (val instanceof _Color2.default) {\n return val.toString(this.format);\n }\n\n return val;\n }\n\n /**\n * Sets the color manually\n *\n * @fires colorpickerChange\n * @param {String|Color} val\n */\n\n }, {\n key: 'setValue',\n value: function setValue(val) {\n if (this.hasColor() && this.color.equals(val)) {\n // equal color object\n return;\n }\n\n var color = val ? this.createColor(val) : false;\n\n if (!this.hasColor() && !color) {\n // color was empty and the new one too\n return;\n }\n\n // force update if color is changed to empty\n var shouldForceUpdate = this.hasColor() && !color;\n\n this.color = color;\n\n /**\n * (Colorpicker) When the color is set programmatically with setValue().\n *\n * @event colorpickerChange\n */\n this.element.trigger({\n type: 'colorpickerChange',\n colorpicker: this,\n color: this.color,\n value: val\n });\n\n // force update if color has changed to empty\n this.update(shouldForceUpdate);\n }\n\n /**\n * Creates a new color using the widget instance options (fallbackColor, format).\n *\n * @fires colorpickerInvalid\n * @param {*} val\n * @param {boolean} useFallback\n * @returns {Color}\n */\n\n }, {\n key: 'createColor',\n value: function createColor(val) {\n var useFallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var color = new _Color2.default(this._resolveColor(val), { format: this.format });\n\n if (!color.isValid()) {\n var invalidColor = color,\n fallback = void 0;\n\n if (useFallback) {\n fallback = this.fallbackColor instanceof _Color2.default && this.fallbackColor.isValid() ? this.fallbackColor : this._resolveColor(this.fallbackColor);\n\n color = new _Color2.default(fallback, { format: this.format });\n\n if (!color.isValid() && useFallback) {\n throw new Error('The fallback color is invalid.');\n }\n }\n\n color.previous = invalidColor;\n\n /**\n * (Colorpicker) Fired when the color is invalid and the fallback color is going to be used.\n *\n * @event colorpickerInvalid\n */\n this.element.trigger({\n type: 'colorpickerInvalid',\n colorpicker: this,\n color: color,\n value: val\n });\n }\n\n if (!this.isAlphaEnabled() && color.hasTransparency()) {\n // Alpha is disabled\n color.setAlpha(1);\n }\n\n if (!this.hasColor()) {\n // No previous color, so no need to compare\n return color;\n }\n\n var hsva = color.hsvaRatio;\n var prevHsva = this.color.hsvaRatio;\n\n if (hsva.s === 0 && hsva.h === 0 && prevHsva.h !== 0) {\n // Hue was set to 0 because saturation was 0, use previous hue, since it was not meant to change...\n color.setHueRatio(prevHsva.h);\n }\n\n if (!this.isAlphaEnabled() && color.hasTransparency()) {\n // Alpha is disabled\n color.setAlpha(1);\n }\n\n return color;\n }\n\n /**\n * Checks if there is a color object, that it is valid and it is not a fallback\n * @returns {boolean}\n */\n\n }, {\n key: 'isInvalidColor',\n value: function isInvalidColor() {\n return !this.hasColor() || !this.color.isValid() || !!this.color.previous;\n }\n\n /**\n * Returns true if the useAlpha option is exactly true, false otherwise\n * @returns {boolean}\n */\n\n }, {\n key: 'isAlphaEnabled',\n value: function isAlphaEnabled() {\n return this.options.useAlpha === true;\n }\n\n /**\n * Resolves a color, in case is not in a standard format (e.g. a custom color alias)\n *\n * @private\n * @param {String|*} color\n * @returns {String|*|null}\n */\n\n }, {\n key: '_resolveColor',\n value: function _resolveColor(color) {\n var extResolvedColor = false;\n\n _jquery2.default.each(this.extensions, function (name, ext) {\n if (extResolvedColor !== false) {\n // skip if resolved\n return;\n }\n extResolvedColor = ext.resolveColor(color);\n });\n\n if (extResolvedColor !== false) {\n color = extResolvedColor;\n }\n\n return color;\n }\n\n /**\n * Returns true if the widget has an associated input element, false otherwise\n * @returns {boolean}\n */\n\n }, {\n key: 'hasInput',\n value: function hasInput() {\n return this.input !== false;\n }\n\n /**\n * Returns true if this instance is disabled\n * @returns {boolean}\n */\n\n }, {\n key: 'isDisabled',\n value: function isDisabled() {\n return this.disabled === true;\n }\n\n /**\n * Disables the widget and the input if any\n *\n * @fires colorpickerDisable\n * @returns {boolean}\n */\n\n }, {\n key: 'disable',\n value: function disable() {\n if (this.hasInput()) {\n this.input.prop('disabled', true);\n }\n this.disabled = true;\n\n /**\n * (Colorpicker) When the widget has been disabled.\n *\n * @event colorpickerDisable\n */\n this.element.trigger({\n type: 'colorpickerDisable',\n colorpicker: this,\n color: this.color\n });\n return true;\n }\n\n /**\n * Enables the widget and the input if any\n *\n * @fires colorpickerEnable\n * @returns {boolean}\n */\n\n }, {\n key: 'enable',\n value: function enable() {\n if (this.hasInput()) {\n this.input.prop('disabled', false);\n }\n this.disabled = false;\n\n /**\n * (Colorpicker) When the widget has been enabled.\n *\n * @event colorpickerEnable\n */\n this.element.trigger({\n type: 'colorpickerEnable',\n colorpicker: this,\n color: this.color\n });\n return true;\n }\n\n /**\n * Function triggered when clicking in one of the color adjustment bars\n *\n * @private\n * @fires mousemove\n * @param {Event} e\n * @returns {boolean}\n */\n\n }, {\n key: '_mousedown',\n value: function _mousedown(e) {\n this.lastEvent.name = 'mousedown';\n this.lastEvent.e = e;\n\n if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {\n e.pageX = e.originalEvent.touches[0].pageX;\n e.pageY = e.originalEvent.touches[0].pageY;\n }\n e.stopPropagation();\n e.preventDefault();\n\n var target = (0, _jquery2.default)(e.target);\n\n // detect the slider and set the limits and callbacks\n var zone = target.closest('div');\n var sl = this.options.horizontal ? this.options.slidersHorz : this.options.sliders;\n\n if (!zone.is('.colorpicker')) {\n if (zone.is('.colorpicker-saturation')) {\n this.currentSlider = _jquery2.default.extend({}, sl.saturation);\n } else if (zone.is('.colorpicker-hue')) {\n this.currentSlider = _jquery2.default.extend({}, sl.hue);\n } else if (zone.is('.colorpicker-alpha')) {\n this.currentSlider = _jquery2.default.extend({}, sl.alpha);\n } else {\n return false;\n }\n var offset = zone.offset();\n // reference to guide's style\n\n this.currentSlider.guide = zone.find('.colorpicker-guide')[0].style;\n this.currentSlider.left = e.pageX - offset.left;\n this.currentSlider.top = e.pageY - offset.top;\n this.mousePointer = {\n left: e.pageX,\n top: e.pageY\n };\n\n /**\n * (window.document) Triggered on mousedown for the document object,\n * so the color adjustment guide is moved to the clicked position.\n *\n * @event mousemove\n */\n (0, _jquery2.default)(window.document).on({\n 'mousemove.colorpicker': _jquery2.default.proxy(this._mousemove, this),\n 'touchmove.colorpicker': _jquery2.default.proxy(this._mousemove, this),\n 'mouseup.colorpicker': _jquery2.default.proxy(this._mouseup, this),\n 'touchend.colorpicker': _jquery2.default.proxy(this._mouseup, this)\n }).trigger('mousemove');\n }\n return false;\n }\n\n /**\n * Function triggered when dragging a guide inside one of the color adjustment bars.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n\n }, {\n key: '_mousemove',\n value: function _mousemove(e) {\n this.lastEvent.name = 'mousemove';\n this.lastEvent.e = e;\n\n var color = !this.hasColor() ? this.createColor(this.fallbackColor) : this.color.getCopy();\n\n if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {\n e.pageX = e.originalEvent.touches[0].pageX;\n e.pageY = e.originalEvent.touches[0].pageY;\n }\n e.stopPropagation();\n e.preventDefault();\n var left = Math.max(0, Math.min(this.currentSlider.maxLeft, this.currentSlider.left + ((e.pageX || this.mousePointer.left) - this.mousePointer.left)));\n var top = Math.max(0, Math.min(this.currentSlider.maxTop, this.currentSlider.top + ((e.pageY || this.mousePointer.top) - this.mousePointer.top)));\n\n this.currentSlider.guide.left = left + 'px';\n this.currentSlider.guide.top = top + 'px';\n if (this.currentSlider.callLeft) {\n color[this.currentSlider.callLeft].call(color, left / this.currentSlider.maxLeft);\n }\n if (this.currentSlider.callTop) {\n color[this.currentSlider.callTop].call(color, top / this.currentSlider.maxTop);\n }\n\n this.setValue(color);\n return false;\n }\n\n /**\n * Function triggered when releasing the click in one of the color adjustment bars.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n\n }, {\n key: '_mouseup',\n value: function _mouseup(e) {\n this.lastEvent.name = 'mouseup';\n this.lastEvent.e = e;\n\n e.stopPropagation();\n e.preventDefault();\n (0, _jquery2.default)(window.document).off({\n 'mousemove.colorpicker': this._mousemove,\n 'touchmove.colorpicker': this._mousemove,\n 'mouseup.colorpicker': this._mouseup,\n 'touchend.colorpicker': this._mouseup\n });\n return false;\n }\n\n /**\n * Function triggered when the input has changed, so the colorpicker gets updated.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n\n }, {\n key: '_change',\n value: function _change(e) {\n this.lastEvent.name = 'change';\n this.lastEvent.e = e;\n\n var val = this.input.val();\n\n if (val !== this.toInputColorString()) {\n this.setValue(val);\n }\n }\n\n /**\n * Function triggered after a keyboard key has been released.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n\n }, {\n key: '_keyup',\n value: function _keyup(e) {\n this.lastEvent.name = 'keyup';\n this.lastEvent.e = e;\n\n var val = this.input.val();\n\n if (val !== this.toInputColorString()) {\n this.setValue(val);\n }\n }\n }, {\n key: 'fallbackColor',\n get: function get() {\n return this.options.fallbackColor ? this.options.fallbackColor : this.hasColor() ? this.color : '#000';\n }\n }, {\n key: 'format',\n get: function get() {\n if (this.options.format) {\n return this.options.format;\n }\n\n if (this.hasColor() && this.color.hasTransparency() && this.color.format.match(/^hex/)) {\n return this.options.enableHex8 ? 'hex8' : this.isAlphaEnabled() ? 'rgba' : 'hex';\n }\n\n if (this.hasColor()) {\n return this.color.format;\n }\n\n return null;\n }\n }]);\n\n return Colorpicker;\n}();\n\nexports.default = Colorpicker;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tinycolor2 = __webpack_require__(6);\n\nvar _tinycolor3 = _interopRequireDefault(_tinycolor2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction unwrapColor(color) {\n if (color instanceof _tinycolor3.default) {\n return {\n r: color._r,\n g: color._g,\n b: color._b,\n a: color._a\n };\n }\n return color;\n}\n\n/**\n * Sanitizes a format string, so it is compatible with tinycolor,\n * or returns the same value if it is not a string.\n *\n * @param {String} format\n * @returns {String|*}\n * @private\n */\nfunction getCompatibleFormat(format) {\n if (format instanceof String || typeof format === 'string') {\n return format.replace(/a$/gi, '');\n }\n\n return format;\n}\n\n/**\n * Color manipulation class that extends the tinycolor library class.\n */\n\nvar Color = function (_tinycolor) {\n _inherits(Color, _tinycolor);\n\n _createClass(Color, [{\n key: 'id',\n\n /**\n * Identifier of the color instance.\n *\n * @type {int}\n * @readonly\n */\n get: function get() {\n return this._tc_id;\n }\n\n /**\n * Format of the parsed color.\n *\n * @type {String}\n * @readonly\n */\n\n }, {\n key: 'format',\n get: function get() {\n return this._format;\n }\n\n /**\n * All options of the current instance.\n *\n * @type {{format: String, gradientType: String}}\n * @readonly\n */\n\n }, {\n key: 'options',\n get: function get() {\n return {\n format: this._format,\n gradientType: this._gradientType\n };\n }\n\n /**\n * @returns {{h, s, v, a}}\n */\n\n }, {\n key: 'hsva',\n get: function get() {\n return this.toHsv();\n }\n\n /**\n * @returns {{h, s, v, a}}\n */\n\n }, {\n key: 'hsvaRatio',\n get: function get() {\n var hsv = this.hsva;\n\n return {\n h: hsv.h / 360,\n s: hsv.s,\n v: hsv.v,\n a: hsv.a\n };\n }\n\n /**\n * foo bar\n * @param {Color|*} color\n * @param {{format}} [options]\n * @constructor\n */\n\n }]);\n\n function Color(color) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { format: null };\n\n _classCallCheck(this, Color);\n\n if (options.format) {\n options.format = getCompatibleFormat(options.format);\n }\n\n /**\n * @type {Color|*}\n */\n var _this = _possibleConstructorReturn(this, (Color.__proto__ || Object.getPrototypeOf(Color)).call(this, unwrapColor(color), options));\n\n _this._originalInput = color; // keep real original color\n /**\n * Hue backup to not lose the information when saturation is 0.\n * @type {number}\n */\n _this._hbak = _this.hsva.h;\n /**\n * If set, it contains a reference to a previous color that caused the creation of this one.\n * @type {Color}\n */\n _this.previous = null;\n return _this;\n }\n\n /**\n * Compares a color object with this one and returns true if it is equal or false if not.\n *\n * @param {Color} color\n * @returns {boolean}\n */\n\n\n _createClass(Color, [{\n key: 'equals',\n value: function equals(color) {\n if (!(color instanceof _tinycolor3.default)) {\n return false;\n }\n return this._r === color._r && this._g === color._g && this._b === color._b && this._a === color._a && this._roundA === color._roundA && this._format === color._format && this._gradientType === color._gradientType && this._ok === color._ok;\n }\n\n /**\n * Imports all variables of the given color to this instance, excepting `_tc_id`.\n * @param {Color} color\n */\n\n }, {\n key: 'importColor',\n value: function importColor(color) {\n if (!(color instanceof _tinycolor3.default)) {\n throw new Error('Color.importColor: The color argument is not an instance of tinycolor.');\n }\n this._originalInput = color._originalInput;\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this._a = color._a;\n this._roundA = color._roundA;\n this._format = getCompatibleFormat(color._format);\n this._gradientType = color._gradientType;\n this._ok = color._ok;\n // omit .previous and ._tc_id import\n }\n\n /**\n * Imports the _r, _g, _b, _a, _hbak and _ok variables of the given color to this instance.\n * @param {Color} color\n */\n\n }, {\n key: 'importRgb',\n value: function importRgb(color) {\n if (!color instanceof Color) {\n throw new Error('Color.importColor: The color argument is not an instance of tinycolor.');\n }\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this._a = color._a;\n this._ok = color._ok;\n this._hbak = color._hbak;\n }\n\n /**\n * @param {{h,s,v,a}} hsv\n */\n\n }, {\n key: 'importHsv',\n value: function importHsv(hsv) {\n this._hbak = hsv.h;\n this.importRgb(new Color(hsv, this.options));\n }\n\n /**\n * @returns {Color}\n */\n\n }, {\n key: 'getCopy',\n value: function getCopy() {\n return new Color(this.hsva, this.options);\n }\n\n /**\n * @returns {Color}\n */\n\n }, {\n key: 'getHueOnlyCopy',\n value: function getHueOnlyCopy() {\n return new Color({ h: this._hbak ? this._hbak : this.hsva.h, s: 100, v: 100 }, this.options);\n }\n\n /**\n * @returns {Color}\n */\n\n }, {\n key: 'getOpaqueCopy',\n value: function getOpaqueCopy() {\n return new Color(Object.assign({}, this.hsva, { a: 1 }), this.options);\n }\n\n /**\n * @param {number} h Degrees from 0 to 360\n */\n\n }, {\n key: 'setHue',\n value: function setHue(h) {\n this.importHsv(Object.assign({}, this.hsva, { h: h }));\n }\n\n /**\n * @param {number} s Percent from 0 o 100\n */\n\n }, {\n key: 'setSaturation',\n value: function setSaturation(s) {\n this.importHsv(Object.assign({}, this.hsva, { s: s }));\n }\n\n /**\n * @param {number} v Percent from 0 o 100\n */\n\n }, {\n key: 'setBrightness',\n value: function setBrightness(v) {\n this.importHsv(Object.assign({}, this.hsva, { v: v }));\n }\n\n /**\n * @param {number} h Ratio from 0.0 to 1.0\n */\n\n }, {\n key: 'setHueRatio',\n value: function setHueRatio(h) {\n if (h === 0) {\n return;\n }\n this.setHue((1 - h) * 360);\n }\n\n /**\n * @param {number} s Ratio from 0.0 to 1.0\n */\n\n }, {\n key: 'setSaturationRatio',\n value: function setSaturationRatio(s) {\n this.setSaturation(s);\n }\n\n /**\n * @param {number} v Ratio from 0.0 to 1.0\n */\n\n }, {\n key: 'setBrightnessRatio',\n value: function setBrightnessRatio(v) {\n this.setBrightness(1 - v);\n }\n\n /**\n * @param {number} a Ratio from 0.0 to 1.0\n */\n\n }, {\n key: 'setAlphaRatio',\n value: function setAlphaRatio(a) {\n this.setAlpha(1 - a);\n }\n\n /**\n * @returns {boolean}\n */\n\n }, {\n key: 'isTransparent',\n value: function isTransparent() {\n return this._a === 0;\n }\n\n /**\n * @returns {boolean}\n */\n\n }, {\n key: 'hasTransparency',\n value: function hasTransparency() {\n return this._a !== 1;\n }\n\n /**\n * @param {string|null} [format] One of \"rgb\", \"prgb\", \"hex\"/\"hex6\", \"hex3\", \"hex8\", \"hsl\", \"hsv\"/\"hsb\", \"name\"\n * @returns {String}\n */\n\n }, {\n key: 'toString',\n value: function toString() {\n var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n format = format ? getCompatibleFormat(format) : this.format;\n\n var colorStr = _get(Color.prototype.__proto__ || Object.getPrototypeOf(Color.prototype), 'toString', this).call(this, format);\n\n if (colorStr && colorStr.match(/^#[0-9a-f]{3,8}$/i)) {\n // Support transparent for hex formats\n if (this.isTransparent() && this._r === 0 && this._g === 0 && this._b === 0) {\n return 'transparent';\n }\n }\n\n return colorStr;\n }\n }]);\n\n return Color;\n}(_tinycolor3.default);\n\nexports.default = Color;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.1\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\n(function(Math) {\n\nvar trimLeft = /^\\s+/,\n trimRight = /\\s+$/,\n tinyCounter = 0,\n mathRound = Math.round,\n mathMin = Math.min,\n mathMax = Math.max,\n mathRandom = Math.random;\n\nfunction tinycolor (color, opts) {\n\n color = (color) ? color : '';\n opts = opts || { };\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n\n var rgb = inputToRGB(color);\n this._originalInput = color,\n this._r = rgb.r,\n this._g = rgb.g,\n this._b = rgb.b,\n this._a = rgb.a,\n this._roundA = mathRound(100*this._a) / 100,\n this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) { this._r = mathRound(this._r); }\n if (this._g < 1) { this._g = mathRound(this._g); }\n if (this._b < 1) { this._b = mathRound(this._b); }\n\n this._ok = rgb.ok;\n this._tc_id = tinyCounter++;\n}\n\ntinycolor.prototype = {\n isDark: function() {\n return this.getBrightness() < 128;\n },\n isLight: function() {\n return !this.isDark();\n },\n isValid: function() {\n return this._ok;\n },\n getOriginalInput: function() {\n return this._originalInput;\n },\n getFormat: function() {\n return this._format;\n },\n getAlpha: function() {\n return this._a;\n },\n getBrightness: function() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r/255;\n GsRGB = rgb.g/255;\n BsRGB = rgb.b/255;\n\n if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}\n if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}\n if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}\n return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);\n },\n setAlpha: function(value) {\n this._a = boundAlpha(value);\n this._roundA = mathRound(100*this._a) / 100;\n return this;\n },\n toHsv: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };\n },\n toHsvString: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);\n return (this._a == 1) ?\n \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" :\n \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \"+ this._roundA + \")\";\n },\n toHsl: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };\n },\n toHslString: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);\n return (this._a == 1) ?\n \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" :\n \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \"+ this._roundA + \")\";\n },\n toHex: function(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function(allow3Char) {\n return '#' + this.toHex(allow3Char);\n },\n toHex8: function(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function(allow4Char) {\n return '#' + this.toHex8(allow4Char);\n },\n toRgb: function() {\n return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };\n },\n toRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \")\" :\n \"rgba(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function() {\n return { r: mathRound(bound01(this._r, 255) * 100) + \"%\", g: mathRound(bound01(this._g, 255) * 100) + \"%\", b: mathRound(bound01(this._b, 255) * 100) + \"%\", a: this._a };\n },\n toPercentageRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%)\" :\n \"rgba(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function() {\n if (this._a === 0) {\n return \"transparent\";\n }\n\n if (this._a < 1) {\n return false;\n }\n\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function(secondColor) {\n var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n\n return \"progid:DXImageTransform.Microsoft.gradient(\"+gradientType+\"startColorstr=\"+hex8String+\",endColorstr=\"+secondHex8String+\")\";\n },\n toString: function(format) {\n var formatSet = !!format;\n format = format || this._format;\n\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n\n return formattedString || this.toHexString();\n },\n clone: function() {\n return tinycolor(this.toString());\n },\n\n _applyModification: function(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function() {\n return this._applyModification(lighten, arguments);\n },\n brighten: function() {\n return this._applyModification(brighten, arguments);\n },\n darken: function() {\n return this._applyModification(darken, arguments);\n },\n desaturate: function() {\n return this._applyModification(desaturate, arguments);\n },\n saturate: function() {\n return this._applyModification(saturate, arguments);\n },\n greyscale: function() {\n return this._applyModification(greyscale, arguments);\n },\n spin: function() {\n return this._applyModification(spin, arguments);\n },\n\n _applyCombination: function(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function() {\n return this._applyCombination(analogous, arguments);\n },\n complement: function() {\n return this._applyCombination(complement, arguments);\n },\n monochromatic: function() {\n return this._applyCombination(monochromatic, arguments);\n },\n splitcomplement: function() {\n return this._applyCombination(splitcomplement, arguments);\n },\n triad: function() {\n return this._applyCombination(triad, arguments);\n },\n tetrad: function() {\n return this._applyCombination(tetrad, arguments);\n }\n};\n\n// If input is an object, force 1 into \"1.0\" to handle ratios properly\n// String input requires \"1.0\" as input, so 1 will be treated as 1\ntinycolor.fromRatio = function(color, opts) {\n if (typeof color == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n }\n else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n\n return tinycolor(color, opts);\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n// \"red\"\n// \"#f00\" or \"f00\"\n// \"#ff0000\" or \"ff0000\"\n// \"#ff000000\" or \"ff000000\"\n// \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n// \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n// \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n// \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n// \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n// \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n// \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n\n if (typeof color == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n\n a = boundAlpha(a);\n\n return {\n ok: ok,\n format: color.format || format,\n r: mathMin(255, mathMax(rgb.r, 0)),\n g: mathMin(255, mathMax(rgb.g, 0)),\n b: mathMin(255, mathMax(rgb.b, 0)),\n a: a\n };\n}\n\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>\n\n// `rgbToRgb`\n// Handle bounds / percentage checking to conform to CSS color spec\n// <http://www.w3.org/TR/css3-color/>\n// *Assumes:* r, g, b in [0, 255] or [0, 1]\n// *Returns:* { r, g, b } in [0, 255]\nfunction rgbToRgb(r, g, b){\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n}\n\n// `rgbToHsl`\n// Converts an RGB color value to HSL.\n// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n// *Returns:* { h, s, l } in [0,1]\nfunction rgbToHsl(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, l = (max + min) / 2;\n\n if(max == min) {\n h = s = 0; // achromatic\n }\n else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n\n h /= 6;\n }\n\n return { h: h, s: s, l: l };\n}\n\n// `hslToRgb`\n// Converts an HSL color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hslToRgb(h, s, l) {\n var r, g, b;\n\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n\n function hue2rgb(p, q, t) {\n if(t < 0) t += 1;\n if(t > 1) t -= 1;\n if(t < 1/6) return p + (q - p) * 6 * t;\n if(t < 1/2) return q;\n if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n }\n\n if(s === 0) {\n r = g = b = l; // achromatic\n }\n else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHsv`\n// Converts an RGB color value to HSV\n// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n// *Returns:* { h, s, v } in [0,1]\nfunction rgbToHsv(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, v = max;\n\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n\n if(max == min) {\n h = 0; // achromatic\n }\n else {\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n\n// `hsvToRgb`\n// Converts an HSV color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHex`\n// Converts an RGB color to hex\n// Assumes r, g, and b are contained in the set [0, 255]\n// Returns a 3 or 6 character hex\nfunction rgbToHex(r, g, b, allow3Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToHex`\n// Converts an RGBA color plus alpha transparency to hex\n// Assumes r, g, b are contained in the set [0, 255] and\n// a in [0, 1]. Returns a 4 or 8 character rgba hex\nfunction rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToArgbHex`\n// Converts an RGBA color to an ARGB Hex8 string\n// Rarely used, but required for \"toFilter()\"\nfunction rgbaToArgbHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n}\n\n// `equals`\n// Can be called with any tinycolor input\ntinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) { return false; }\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n};\n\ntinycolor.random = function() {\n return tinycolor.fromRatio({\n r: mathRandom(),\n g: mathRandom(),\n b: mathRandom()\n });\n};\n\n\n// Modification Functions\n// ----------------------\n// Thanks to less.js for some of the basics here\n// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>\n\nfunction desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction saturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction greyscale(color) {\n return tinycolor(color).desaturate(100);\n}\n\nfunction lighten (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\nfunction brighten(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var rgb = tinycolor(color).toRgb();\n rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));\n rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));\n rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));\n return tinycolor(rgb);\n}\n\nfunction darken (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\n// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n// Values outside of this range will be wrapped into this range.\nfunction spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n}\n\n// Combination Functions\n// ---------------------\n// Thanks to jQuery xColor for some of the ideas behind these\n// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>\n\nfunction complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n}\n\nfunction triad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction tetrad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),\n tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})\n ];\n}\n\nfunction analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n\n for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n}\n\nfunction monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h, s = hsv.s, v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n\n while (results--) {\n ret.push(tinycolor({ h: h, s: s, v: v}));\n v = (v + modification) % 1;\n }\n\n return ret;\n}\n\n// Utility Functions\n// ---------------------\n\ntinycolor.mix = function(color1, color2, amount) {\n amount = (amount === 0) ? 0 : (amount || 50);\n\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n\n var p = amount / 100;\n\n var rgba = {\n r: ((rgb2.r - rgb1.r) * p) + rgb1.r,\n g: ((rgb2.g - rgb1.g) * p) + rgb1.g,\n b: ((rgb2.b - rgb1.b) * p) + rgb1.b,\n a: ((rgb2.a - rgb1.a) * p) + rgb1.a\n };\n\n return tinycolor(rgba);\n};\n\n\n// Readability Functions\n// ---------------------\n// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)\n\n// `contrast`\n// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)\ntinycolor.readability = function(color1, color2) {\n var c1 = tinycolor(color1);\n var c2 = tinycolor(color2);\n return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);\n};\n\n// `isReadable`\n// Ensure that foreground and background color combinations meet WCAG2 guidelines.\n// The third argument is an optional Object.\n// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';\n// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.\n// If the entire object is absent, isReadable defaults to {level:\"AA\",size:\"small\"}.\n\n// *Example*\n// tinycolor.isReadable(\"#000\", \"#111\") => false\n// tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\ntinycolor.isReadable = function(color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n\n out = false;\n\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n\n};\n\n// `mostReadable`\n// Given a base color and a list of possible foreground or background\n// colors for that base, returns the most readable color.\n// Optionally returns Black or White if the most readable color is unreadable.\n// *Example*\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\ntinycolor.mostReadable = function(baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size ;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors ;\n level = args.level;\n size = args.size;\n\n for (var i= 0; i < colorList.length ; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n\n if (tinycolor.isReadable(baseColor, bestColor, {\"level\":level,\"size\":size}) || !includeFallbackColors) {\n return bestColor;\n }\n else {\n args.includeFallbackColors=false;\n return tinycolor.mostReadable(baseColor,[\"#fff\", \"#000\"],args);\n }\n};\n\n\n// Big List of Colors\n// ------------------\n// <http://www.w3.org/TR/css3-color/#svg-color>\nvar names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n};\n\n// Make it easy to access colors via `hexNames[hex]`\nvar hexNames = tinycolor.hexNames = flip(names);\n\n\n// Utilities\n// ---------\n\n// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\nfunction flip(o) {\n var flipped = { };\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n}\n\n// Return a valid alpha value [0,1] with all invalid values being set to 1\nfunction boundAlpha(a) {\n a = parseFloat(a);\n\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n\n return a;\n}\n\n// Take input from [0, n] and return it as [0, 1]\nfunction bound01(n, max) {\n if (isOnePointZero(n)) { n = \"100%\"; }\n\n var processPercent = isPercentage(n);\n n = mathMin(max, mathMax(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if ((Math.abs(n - max) < 0.000001)) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return (n % max) / parseFloat(max);\n}\n\n// Force a number between 0 and 1\nfunction clamp01(val) {\n return mathMin(1, mathMax(0, val));\n}\n\n// Parse a base-16 hex value into a base-10 integer\nfunction parseIntFromHex(val) {\n return parseInt(val, 16);\n}\n\n// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>\nfunction isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n}\n\n// Check to see if string passed in is a percentage\nfunction isPercentage(n) {\n return typeof n === \"string\" && n.indexOf('%') != -1;\n}\n\n// Force a hex value to have 2 characters\nfunction pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}\n\n// Replace a decimal with it's percentage value\nfunction convertToPercentage(n) {\n if (n <= 1) {\n n = (n * 100) + \"%\";\n }\n\n return n;\n}\n\n// Converts a decimal to a hex value\nfunction convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n// Converts a hex value to a decimal\nfunction convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}\n\nvar matchers = (function() {\n\n // <http://www.w3.org/TR/css3-values/#integers>\n var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n // <http://www.w3.org/TR/css3-values/#number-value>\n var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n\n return {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n})();\n\n// `isValidCSSUnit`\n// Take in a single string / number and check to see if it looks like a CSS unit\n// (see `matchers` above for definition).\nfunction isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}\n\n// `stringInputToObject`\n// Permissive string parsing. Take in a number of formats, and output an object\n// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\nfunction stringInputToObject(color) {\n\n color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color == 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: \"name\" };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if ((match = matchers.rgb.exec(color))) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n if ((match = matchers.rgba.exec(color))) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n if ((match = matchers.hsl.exec(color))) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n if ((match = matchers.hsla.exec(color))) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n if ((match = matchers.hsv.exec(color))) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n if ((match = matchers.hsva.exec(color))) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n if ((match = matchers.hex8.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex6.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n if ((match = matchers.hex4.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n a: convertHexToDecimal(match[4] + '' + match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex3.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n\n return false;\n}\n\nfunction validateWCAG2Parms(parms) {\n // return valid WCAG2 parms for isReadable.\n // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n var level, size;\n parms = parms || {\"level\":\"AA\", \"size\":\"small\"};\n level = (parms.level || \"AA\").toUpperCase();\n size = (parms.size || \"small\").toLowerCase();\n if (level !== \"AA\" && level !== \"AAA\") {\n level = \"AA\";\n }\n if (size !== \"small\" && size !== \"large\") {\n size = \"small\";\n }\n return {\"level\":level, \"size\":size};\n}\n\n// Node: Export function\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports = tinycolor;\n}\n// AMD/requirejs: Define the module\nelse if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {return tinycolor;}.call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n}\n// Browser: Expose to window\nelse {\n window.tinycolor = tinycolor;\n}\n\n})(Math);\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n/**\n * @module\n */\n\n/**\n * Colorpicker default options\n */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = {\n /**\n * If true, loads the Debugger extension automatically into the current instance\n * @type {boolean}\n * @default false\n */\n debug: false,\n /**\n * Forces a color, ignoring the one from the elements value or data-color attribute.\n *\n * @type {(String|Color|boolean)}\n * @default false\n */\n color: false,\n /**\n * Forces an specific color format. If false, it will be automatically detected the first time,\n * but if null it will be always recalculated.\n *\n * Note that the ending 'a' of the format meaning \"alpha\" has currently no effect, meaning that rgb is the same as\n * rgba excepting if the alpha channel is disabled (see useAlpha).\n *\n * @type {('rgb'|'rgba'|'prgb'|'prgba'|'hex'|'hex3'|'hex6'|'hex8'|'hsl'|'hsla'|'hsv'|'hsva'|'name'|boolean)}\n * @default false\n */\n format: false,\n /**\n * Horizontal mode layout.\n *\n * If true, the hue and alpha channel bars will be rendered horizontally, above the saturation selector.\n *\n * @type {boolean}\n * @default false\n */\n horizontal: false,\n /**\n * Forces to show the colorpicker as an inline element\n *\n * @type {boolean}\n * @default false\n */\n inline: false,\n /**\n * Children input CSS selector\n *\n * @type {String}\n * @default 'input'\n */\n input: 'input',\n /**\n * Colorpicker container CSS selector. If given, the colorpicker will be placed inside this container.\n * If true, the colorpicker element itself will be used as the container.\n *\n * @type {String|boolean}\n * @default false\n */\n container: false, // container selector\n /**\n * Children color component CSS selector.\n * If it exists, the child <i> element background will be changed on color change.\n *\n * @type {String|boolean}\n * @default '.add-on, .input-group-addon'\n */\n component: '.add-on, .input-group-addon',\n /**\n * Fallback color to use when the given color is invalid.\n * If false, the latest valid color will be used as a fallback.\n *\n * @type {String|Color|boolean}\n * @default false\n */\n fallbackColor: false,\n /**\n * If enabled, the input content will be replaced always with a valid color,\n * if not enabled the invalid color will be left in the input, but valid in the internal color object.\n *\n * @type {boolean}\n * @default false\n */\n autoInputFallback: false,\n /**\n * If true a hash will be prepended to hexadecimal colors.\n * If false, the hash will be removed.\n * This only affects the input values.\n *\n * @type {boolean}\n * @default false\n */\n useHashPrefix: true,\n /**\n * If true or false the alpha adjustment bar will be displayed no matter what.\n * If false it will be always hidden and alpha channel won't be allowed programmatically for this instance,\n * so the selected or typed color will be always opaque.\n *\n * @type {boolean}\n * @default true\n */\n useAlpha: true,\n /**\n * This only applies when the color format is hexadecimal.\n * If true, the alpha channel will be allowed for hexadecimal formatted colors, making them having 4 or 8 chars\n * (RGBA or RRGGBBAA). This format is not yet supported in all modern browsers, so it is disabled by default.\n * If false, rgba will be used whenever there is an alpha change different than 1 and the color format is\n * automatic.\n *\n * @type {boolean}\n * @default true\n */\n enableHex8: false,\n /**\n * Vertical sliders configuration\n * @type {Object}\n */\n sliders: {\n saturation: {\n maxLeft: 100,\n maxTop: 100,\n callLeft: 'setSaturationRatio',\n callTop: 'setBrightnessRatio'\n },\n hue: {\n maxLeft: 0,\n maxTop: 100,\n callLeft: false,\n callTop: 'setHueRatio'\n },\n alpha: {\n maxLeft: 0,\n maxTop: 100,\n callLeft: false,\n callTop: 'setAlphaRatio'\n }\n },\n /**\n * Horizontal sliders configuration\n * @type {Object}\n */\n slidersHorz: {\n saturation: {\n maxLeft: 100,\n maxTop: 100,\n callLeft: 'setSaturationRatio',\n callTop: 'setBrightnessRatio'\n },\n hue: {\n maxLeft: 100,\n maxTop: 0,\n callLeft: 'setHueRatio',\n callTop: false\n },\n alpha: {\n maxLeft: 100,\n maxTop: 0,\n callLeft: 'setAlphaRatio',\n callTop: false\n }\n },\n /**\n * Colorpicker popup alignment.\n * For now only right is supported.\n *\n * @type {('right')}\n * @default 'right'\n */ // TODO: add 'left' and 'auto' support.\n align: 'right',\n /**\n * Custom class to be added to the colorpicker element\n *\n * @type {String}\n */\n customClass: null,\n /**\n * Colorpicker widget template\n * @type {String}\n * @example\n * <!-- This is the default template: -->\n * <div class=\"colorpicker\">\n * <div class=\"colorpicker-saturation\"><i class=\"colorpicker-guide\"><i></i></i></div>\n * <div class=\"colorpicker-hue\"><i class=\"colorpicker-guide\"></i></div>\n * <div class=\"colorpicker-alpha\"><i class=\"colorpicker-guide\"></i></div>\n * <div class=\"colorpicker-color\"><div /></div>\n * </div>\n */\n template: '<div class=\"colorpicker\">\\n <div class=\"colorpicker-saturation\"><i class=\"colorpicker-guide\"><i /></div>\\n <div class=\"colorpicker-hue\"><i class=\"colorpicker-guide\"></i></div>\\n <div class=\"colorpicker-alpha\"><i class=\"colorpicker-guide\"></i></div></div>',\n /**\n *\n * Associative object with the extension class name and its config.\n * Colorpicker comes with many bundled extensions: debugger, palette, preview and swatches (a superset of Palette).\n *\n * @type {Object}\n * @example\n * extensions: [\n * {\n * name: 'swatches'\n * colors: {\n * 'primary': '#337ab7',\n * 'success': '#5cb85c',\n * 'info': '#5bc0de',\n * 'warning': '#f0ad4e',\n * 'danger': '#d9534f'\n * },\n * namesAsValues: true\n * }\n * ]\n */\n extensions: [{\n name: 'preview',\n showText: false\n }]\n};\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Palette = exports.Swatches = exports.Preview = exports.Debugger = undefined;\n\nvar _Debugger = __webpack_require__(9);\n\nvar _Debugger2 = _interopRequireDefault(_Debugger);\n\nvar _Preview = __webpack_require__(10);\n\nvar _Preview2 = _interopRequireDefault(_Preview);\n\nvar _Swatches = __webpack_require__(11);\n\nvar _Swatches2 = _interopRequireDefault(_Swatches);\n\nvar _Palette = __webpack_require__(2);\n\nvar _Palette2 = _interopRequireDefault(_Palette);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.Debugger = _Debugger2.default;\nexports.Preview = _Preview2.default;\nexports.Swatches = _Swatches2.default;\nexports.Palette = _Palette2.default;\nexports.default = {\n 'debugger': _Debugger2.default,\n 'preview': _Preview2.default,\n 'swatches': _Swatches2.default,\n 'palette': _Palette2.default\n};\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _Extension2 = __webpack_require__(1);\n\nvar _Extension3 = _interopRequireDefault(_Extension2);\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Debugger = function (_Extension) {\n _inherits(Debugger, _Extension);\n\n function Debugger(colorpicker) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Debugger);\n\n /**\n * @type {number}\n */\n var _this = _possibleConstructorReturn(this, (Debugger.__proto__ || Object.getPrototypeOf(Debugger)).call(this, colorpicker, options));\n\n _this.eventCounter = 0;\n if (_this.colorpicker.hasInput()) {\n _this.colorpicker.input.on('change.colorpicker-ext', _jquery2.default.proxy(_this.onChangeInput, _this));\n }\n return _this;\n }\n\n /**\n * @fires colorpickerDebug\n * @param {string} eventName\n * @param {*} args\n */\n\n\n _createClass(Debugger, [{\n key: 'log',\n value: function log(eventName) {\n var _console;\n\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n this.eventCounter += 1;\n\n var logMessage = '#' + this.eventCounter + ': Colorpicker#' + this.colorpicker.id + ' [' + eventName + ']';\n\n (_console = console).debug.apply(_console, [logMessage].concat(args));\n\n /**\n * (Colorpicker) Fired by the ConsoleDebug extension whenever it logs something\n *\n * @event colorpickerDebug\n */\n this.colorpicker.element.trigger({\n type: 'colorpickerDebug',\n colorpicker: this.colorpicker,\n color: this.color,\n debug: {\n debugger: this,\n eventName: eventName,\n logArgs: args,\n logMessage: logMessage\n }\n });\n }\n }, {\n key: 'resolveColor',\n value: function resolveColor(color) {\n this.log('resolveColor()', color);\n return false;\n }\n }, {\n key: 'onCreate',\n value: function onCreate(event) {\n this.log('colorpickerCreate');\n return _get(Debugger.prototype.__proto__ || Object.getPrototypeOf(Debugger.prototype), 'onCreate', this).call(this, event);\n }\n }, {\n key: 'onDestroy',\n value: function onDestroy(event) {\n this.log('colorpickerDestroy');\n this.eventCounter = 0;\n\n if (this.colorpicker.hasInput()) {\n this.colorpicker.input.off('.colorpicker-ext');\n }\n\n return _get(Debugger.prototype.__proto__ || Object.getPrototypeOf(Debugger.prototype), 'onDestroy', this).call(this, event);\n }\n }, {\n key: 'onUpdate',\n value: function onUpdate(event) {\n this.log('colorpickerUpdate');\n }\n\n /**\n * @listens _change\n * @param {Event} event\n */\n\n }, {\n key: 'onChangeInput',\n value: function onChangeInput(event) {\n this.log('input:change.colorpicker', event.value, event.color);\n }\n }, {\n key: 'onChange',\n value: function onChange(event) {\n this.log('colorpickerChange', event.value, event.color);\n }\n }, {\n key: 'onInvalid',\n value: function onInvalid(event) {\n this.log('colorpickerInvalid', event.value, event.color);\n }\n }, {\n key: 'onHide',\n value: function onHide(event) {\n this.log('colorpickerHide');\n this.eventCounter = 0;\n }\n }, {\n key: 'onShow',\n value: function onShow(event) {\n this.log('colorpickerShow');\n }\n }, {\n key: 'onDisable',\n value: function onDisable(event) {\n this.log('colorpickerDisable');\n }\n }, {\n key: 'onEnable',\n value: function onEnable(event) {\n this.log('colorpickerEnable');\n }\n }]);\n\n return Debugger;\n}(_Extension3.default);\n\nexports.default = Debugger;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _Extension2 = __webpack_require__(1);\n\nvar _Extension3 = _interopRequireDefault(_Extension2);\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Preview = function (_Extension) {\n _inherits(Preview, _Extension);\n\n function Preview(colorpicker) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Preview);\n\n var _this = _possibleConstructorReturn(this, (Preview.__proto__ || Object.getPrototypeOf(Preview)).call(this, colorpicker, Object.assign({}, {\n template: '<div class=\"colorpicker-bar colorpicker-preview\"><div /></div>',\n showText: true,\n format: colorpicker.format\n }, options)));\n\n _this.element = (0, _jquery2.default)(_this.options.template);\n _this.elementInner = _this.element.find('div');\n return _this;\n }\n\n _createClass(Preview, [{\n key: 'onCreate',\n value: function onCreate(event) {\n _get(Preview.prototype.__proto__ || Object.getPrototypeOf(Preview.prototype), 'onCreate', this).call(this, event);\n this.colorpicker.picker.append(this.element);\n }\n }, {\n key: 'onUpdate',\n value: function onUpdate(event) {\n _get(Preview.prototype.__proto__ || Object.getPrototypeOf(Preview.prototype), 'onUpdate', this).call(this, event);\n\n this.elementInner.css('backgroundColor', event.color.toRgbString());\n\n if (this.options.showText) {\n this.elementInner.html(event.color.toString(this.options.format || this.colorpicker.format));\n\n if (event.color.isDark()) {\n this.elementInner.css('color', 'white');\n } else {\n this.elementInner.css('color', 'black');\n }\n }\n }\n }]);\n\n return Preview;\n}(_Extension3.default);\n\nexports.default = Preview;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _Palette2 = __webpack_require__(2);\n\nvar _Palette3 = _interopRequireDefault(_Palette2);\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar defaults = {\n barTemplate: '<div class=\"colorpicker-bar colorpicker-swatches\"></div>',\n swatchTemplate: '<i class=\"colorpicker-swatch\"></i>'\n};\n\nvar Swatches = function (_Palette) {\n _inherits(Swatches, _Palette);\n\n function Swatches(colorpicker) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Swatches);\n\n return _possibleConstructorReturn(this, (Swatches.__proto__ || Object.getPrototypeOf(Swatches)).call(this, colorpicker, Object.assign({}, defaults, options)));\n }\n\n _createClass(Swatches, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.getLength() > 0;\n }\n }, {\n key: 'onCreate',\n value: function onCreate(event) {\n var _this2 = this;\n\n _get(Swatches.prototype.__proto__ || Object.getPrototypeOf(Swatches.prototype), 'onCreate', this).call(this, event);\n\n if (!this.isEnabled()) {\n return;\n }\n\n var colorpicker = this.colorpicker,\n swatchContainer = (0, _jquery2.default)(this.options.barTemplate),\n isAliased = this.options.namesAsValues === true && !Array.isArray(this.colors);\n\n _jquery2.default.each(this.colors, function (name, value) {\n var $swatch = (0, _jquery2.default)(_this2.options.swatchTemplate).css('background-color', value).attr('data-name', name).attr('data-value', value).attr('title', name + ': ' + value);\n\n $swatch.on('mousedown.colorpicker touchstart.colorpicker', function (e) {\n e.preventDefault();\n colorpicker.setValue(isAliased ? (0, _jquery2.default)(this).data('name') : (0, _jquery2.default)(this).data('value'));\n });\n swatchContainer.append($swatch);\n });\n\n colorpicker.picker.append(swatchContainer);\n }\n }]);\n\n return Swatches;\n}(_Palette3.default);\n\nexports.default = Swatches;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// bootstrap-colorpicker.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 32081b809d19519bb29c","module.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 0\n// module chunks = 0 1","'use strict';\n\nimport $ from 'jquery';\n\n/**\n * Colorpicker extension class.\n */\nclass Extension {\n /**\n * @param {Colorpicker} colorpicker\n * @param {Object} options\n */\n constructor(colorpicker, options = {}) {\n /**\n * @type {Colorpicker}\n */\n this.colorpicker = colorpicker;\n /**\n * @type {Object}\n */\n this.options = options;\n\n if (!(this.colorpicker.element && this.colorpicker.element.length)) {\n throw new Error('Extension: this.colorpicker.element is not valid');\n }\n\n this.colorpicker.element.on('colorpickerCreate.colorpicker-ext', $.proxy(this.onCreate, this));\n this.colorpicker.element.on('colorpickerDestroy.colorpicker-ext', $.proxy(this.onDestroy, this));\n this.colorpicker.element.on('colorpickerUpdate.colorpicker-ext', $.proxy(this.onUpdate, this));\n this.colorpicker.element.on('colorpickerChange.colorpicker-ext', $.proxy(this.onChange, this));\n this.colorpicker.element.on('colorpickerInvalid.colorpicker-ext', $.proxy(this.onInvalid, this));\n this.colorpicker.element.on('colorpickerShow.colorpicker-ext', $.proxy(this.onShow, this));\n this.colorpicker.element.on('colorpickerHide.colorpicker-ext', $.proxy(this.onHide, this));\n this.colorpicker.element.on('colorpickerEnable.colorpicker-ext', $.proxy(this.onEnable, this));\n this.colorpicker.element.on('colorpickerDisable.colorpicker-ext', $.proxy(this.onDisable, this));\n }\n\n /**\n * Function called every time a new color needs to be created.\n * Return false to skip this resolver and continue with other extensions' ones\n * or return anything else to consider the color resolved.\n *\n * @param {Color|String|*} color\n * @return {Color|String|*}\n */\n resolveColor(color) {\n return false;\n }\n\n /**\n * @listens colorpickerCreate\n * @param {Event} event\n */\n onCreate(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerDestroy\n * @param {Event} event\n */\n onDestroy(event) {\n this.colorpicker.element.off('.colorpicker-ext');\n }\n\n /**\n * @listens colorpickerUpdate\n * @param {Event} event\n */\n onUpdate(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerChange\n * @param {Event} event\n */\n onChange(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerInvalid\n * @param {Event} event\n */\n onInvalid(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerHide\n * @param {Event} event\n */\n onHide(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerShow\n * @param {Event} event\n */\n onShow(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerDisable\n * @param {Event} event\n */\n onDisable(event) {\n // to be extended\n }\n\n /**\n * @listens colorpickerEnable\n * @param {Event} event\n */\n onEnable(event) {\n // to be extended\n }\n}\n\nexport default Extension;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/Extension.js","'use strict';\n\nimport Extension from 'Extension';\n\nlet defaults = {\n /**\n * Key-value pairs defining a color alias and its CSS color representation.\n *\n * They can also be just an array of values. In that case, no special names are used, only the real colors.\n *\n * @type {Object|Array}\n * @default null\n * @example\n * {\n * 'black': '#000000',\n * 'white': '#ffffff',\n * 'red': '#FF0000',\n * 'default': '#777777',\n * 'primary': '#337ab7',\n * 'success': '#5cb85c',\n * 'info': '#5bc0de',\n * 'warning': '#f0ad4e',\n * 'danger': '#d9534f'\n * }\n *\n * @example ['#f0ad4e', '#337ab7', '#5cb85c']\n */\n colors: null,\n /**\n * If true, the when a color swatch is selected the name (alias) will be used as input value,\n * otherwise the swatch real color value will be used.\n *\n * @type {boolean}\n * @default true\n */\n namesAsValues: true\n};\n\nclass Palette extends Extension {\n\n /**\n * @returns {Object|Array}\n */\n get colors() {\n return this.options.colors;\n }\n\n constructor(colorpicker, options = {}) {\n super(colorpicker, Object.assign({}, defaults, options));\n\n if ((!Array.isArray(this.options.colors)) && (typeof this.options.colors !== 'object')) {\n this.options.colors = null;\n }\n }\n\n /**\n * @returns {int}\n */\n getLength() {\n if (!this.options.colors) {\n return 0;\n }\n\n if (Array.isArray(this.options.colors)) {\n return this.options.colors.length;\n }\n\n if (typeof this.options.colors === 'object') {\n return Object.keys(this.options.colors).length;\n }\n\n return 0;\n }\n\n resolveColor(color) {\n if (this.getLength() <= 0) {\n return false;\n }\n\n if (Array.isArray(this.options.colors)) {\n if (this.options.colors.indexOf(color) >= 0) {\n return color;\n }\n if (this.options.colors.indexOf(color.toUpperCase()) >= 0) {\n return color.toUpperCase();\n }\n if (this.options.colors.indexOf(color.toLowerCase()) >= 0) {\n return color.toLowerCase();\n }\n return false;\n }\n\n if (typeof this.options.colors !== 'object') {\n return false;\n }\n\n if (!this.options.namesAsValues) {\n return this.getValue(color, false);\n }\n return this.getName(color, this.getName('#' + color, this.getValue(color, false)));\n }\n\n /**\n * Given a color value, returns the corresponding color name or defaultValue.\n *\n * @param {String} value\n * @param {*} defaultValue\n * @returns {*}\n */\n getName(value, defaultValue = false) {\n if (!(typeof value === 'string') || !this.options.colors) {\n return defaultValue;\n }\n for (let name in this.options.colors) {\n if (!this.options.colors.hasOwnProperty(name)) {\n continue;\n }\n if (this.options.colors[name].toLowerCase() === value.toLowerCase()) {\n return name;\n }\n }\n return defaultValue;\n }\n\n /**\n * Given a color name, returns the corresponding color value or defaultValue.\n *\n * @param {String} name\n * @param {*} defaultValue\n * @returns {*}\n */\n getValue(name, defaultValue = false) {\n if (!(typeof name === 'string') || !this.options.colors) {\n return defaultValue;\n }\n if (this.options.colors.hasOwnProperty(name)) {\n return this.options.colors[name];\n }\n return defaultValue;\n }\n}\n\nexport default Palette;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/extensions/Palette.js","'use strict';\n\nimport Colorpicker from './Colorpicker';\nimport $ from 'jquery';\n\nlet plugin = 'colorpicker';\n\n$[plugin] = Colorpicker;\n\n$.fn[plugin] = function (option) {\n let apiArgs = Array.prototype.slice.call(arguments, 1),\n isSingleElement = (this.length === 1),\n returnValue = null;\n\n let $jq = this.each(function () {\n let $this = $(this),\n inst = $this.data(plugin),\n options = ((typeof option === 'object') ? option : {});\n\n if (!inst) {\n inst = new Colorpicker(this, options);\n $this.data(plugin, inst);\n }\n\n if (typeof option === 'string') {\n if (option === 'colorpicker') {\n returnValue = inst;\n } else if ($.isFunction(inst[option])) {\n returnValue = inst[option].apply(inst, apiArgs);\n } else { // its a property ?\n if (apiArgs.length) {\n // set property\n inst[option] = apiArgs[0];\n }\n returnValue = inst[option];\n }\n } else {\n returnValue = $this;\n }\n });\n\n return isSingleElement ? returnValue : $jq;\n};\n\n$.fn[plugin].constructor = Colorpicker;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/jquery-plugin.js","'use strict';\n\nimport Color from './Color';\nimport Extension from './Extension';\nimport defaults from './options';\nimport bundledExtensions from 'extensions';\nimport $ from 'jquery';\n\nlet colorPickerIdCounter = 0;\n\n/**\n * Colorpicker widget class\n */\nclass Colorpicker {\n /**\n * Color class\n *\n * @static\n * @type {Color}\n */\n static get Color() {\n return Color;\n }\n\n /**\n * Extension class\n *\n * @static\n * @type {Extension}\n */\n static get Extension() {\n return Extension;\n }\n\n /**\n * Colorpicker bundled extension classes\n *\n * @static\n * @type {{Extension}}\n */\n static get Extensions() {\n return bundledExtensions;\n }\n\n /**\n * color getter\n *\n * @type {Color|null}\n */\n get color() {\n return this.element.data('color');\n }\n\n /**\n * color setter\n *\n * @ignore\n * @param {Color|null} value\n */\n set color(value) {\n this.element.data('color', value);\n }\n\n /**\n * @fires colorpickerCreate\n * @param {Object|String} element\n * @param {Object} options\n * @constructor\n */\n constructor(element, options) {\n colorPickerIdCounter += 1;\n /**\n * The colorpicker instance number\n * @type {number}\n */\n this.id = colorPickerIdCounter;\n\n /**\n * @type {*|jQuery}\n */\n this.element = $(element).addClass('colorpicker-element');\n this.element.attr('data-colorpicker-id', this.id);\n\n /**\n * @type {defaults}\n */\n this.options = Object.assign({}, defaults, options, this.element.data());\n\n /**\n * @type {Extension[]}\n */\n this.extensions = [];\n\n if (!Array.isArray(this.options.extensions)) {\n this.options.extensions = [];\n }\n\n /**\n * @type {*|jQuery}\n */\n this.component = this.options.component;\n this.component = (this.component !== false) ? this.element.find(this.component) : false;\n if (this.component && (this.component.length === 0)) {\n this.component = false;\n }\n\n /**\n * @type {*|jQuery}\n */\n this.container = (this.options.container === true) ? this.element : this.options.container;\n this.container = (this.container !== false) ? $(this.container) : false;\n\n /**\n * @type {*|String}\n * @private\n */\n this.currentSlider = null;\n\n /**\n * @type {{left: number, top: number}}\n * @private\n */\n this.mousePointer = {\n left: 0,\n top: 0\n };\n\n /**\n * Latest external event\n *\n * @type {{name: String, e: *}}\n * @private\n */\n this.lastEvent = {\n name: null,\n e: null\n };\n\n // Is the element an input? Should we search inside for any input?\n /**\n * @type {*|jQuery}\n */\n this.input = this.element.is('input') ? this.element : (this.options.input ?\n this.element.find(this.options.input) : false);\n\n if (this.input && (this.input.length === 0)) {\n this.input = false;\n }\n\n if (this.options.debug) {\n this.options.extensions.push({name: 'Debugger'});\n }\n\n // Register extensions\n this.options.extensions.forEach((ext) => {\n this.addExtension(ext.name, bundledExtensions[ext.name.toLowerCase()], ext);\n });\n\n let colorValue = this.options.color !== false ? this.options.color : this.getValue();\n\n this.color = colorValue ? this.createColor(colorValue) : false;\n\n if (this.options.format === false) {\n // If format is false, use the first parsed one from now on\n this.options.format = this.color.format;\n }\n\n /**\n * @type {boolean}\n * @private\n */\n this.disabled = false;\n\n // Setup picker\n let $picker = this.picker = $(this.options.template);\n\n if (this.options.customClass) {\n $picker.addClass(this.options.customClass);\n }\n if (this.options.inline) {\n $picker.addClass('colorpicker-inline colorpicker-visible');\n } else {\n $picker.addClass('colorpicker-hidden');\n }\n if (this.options.horizontal) {\n $picker.addClass('colorpicker-horizontal');\n }\n\n if (\n (this.options.useAlpha || (this.hasColor() && this.color.hasTransparency())) &&\n (this.options.useAlpha !== false)\n ) {\n this.options.useAlpha = true;\n $picker.addClass('colorpicker-with-alpha');\n }\n\n if (this.options.align === 'right') {\n $picker.addClass('colorpicker-right');\n }\n if (this.options.inline === true) {\n $picker.addClass('colorpicker-no-arrow');\n }\n\n // Prevent closing the colorpicker when clicking on itself\n $picker.on('mousedown.colorpicker touchstart.colorpicker', $.proxy(function (e) {\n if (e.target === e.currentTarget) {\n e.preventDefault();\n }\n }, this));\n\n // Bind click/tap events on the sliders\n $picker.find('.colorpicker-saturation, .colorpicker-hue, .colorpicker-alpha')\n .on('mousedown.colorpicker touchstart.colorpicker', $.proxy(this._mousedown, this));\n\n $picker.appendTo(this.container ? this.container : $('body'));\n\n // Bind other events\n if (this.hasInput()) {\n this.input.on({\n 'keyup.colorpicker': $.proxy(this._keyup, this)\n });\n this.input.on({\n 'change.colorpicker': $.proxy(this._change, this)\n });\n if (this.component === false) {\n this.element.on({\n 'focus.colorpicker': $.proxy(this.show, this)\n });\n }\n if (this.options.inline === false) {\n this.element.on({\n 'focusout.colorpicker': $.proxy(this.hide, this)\n });\n }\n }\n\n if (this.component !== false) {\n this.component.on({\n 'click.colorpicker': $.proxy(this.show, this)\n });\n }\n\n if ((this.hasInput() === false) && (this.component === false) && !this.element.has('.colorpicker')) {\n this.element.on({\n 'click.colorpicker': $.proxy(this.show, this)\n });\n }\n\n // for HTML5 input[type='color']\n if (this.hasInput() && (this.component !== false) && (this.input.attr('type') === 'color')) {\n this.input.on({\n 'click.colorpicker': $.proxy(this.show, this),\n 'focus.colorpicker': $.proxy(this.show, this)\n });\n }\n\n // Update if there is a color option\n this.update(this.options.color !== false);\n\n $($.proxy(function () {\n /**\n * (Colorpicker) When the Colorpicker instance has been created and the DOM is ready.\n *\n * @event colorpickerCreate\n */\n this.element.trigger({\n type: 'colorpickerCreate',\n colorpicker: this,\n color: this.color\n });\n }, this));\n }\n\n /**\n * Creates and registers the given extension\n *\n * @param {String|Extension} extensionName\n * @param {Extension} ExtensionClass\n * @param {Object} [config]\n * @returns {Extension}\n */\n addExtension(extensionName, ExtensionClass, config = {}) {\n let ext = (extensionName instanceof Extension) ? extensionName : new ExtensionClass(this, config);\n\n this.extensions.push(ext);\n return ext;\n }\n\n /**\n * Destroys the current instance\n *\n * @fires colorpickerDestroy\n */\n destroy() {\n this.picker.remove();\n this.element.removeData('colorpicker', 'color').off('.colorpicker');\n if (this.hasInput()) {\n this.input.off('.colorpicker');\n }\n if (this.component !== false) {\n this.component.off('.colorpicker');\n }\n this.element.removeClass('colorpicker-element');\n\n /**\n * (Colorpicker) When the instance is destroyed with all events unbound.\n *\n * @event colorpickerDestroy\n */\n this.element.trigger({\n type: 'colorpickerDestroy',\n colorpicker: this,\n color: this.color\n });\n }\n\n /**\n * Returns true if the current color object is an instance of Color, false otherwise.\n * @returns {boolean}\n */\n hasColor() {\n return this.color instanceof Color;\n }\n\n /**\n * @returns {*|String|Color}\n */\n get fallbackColor() {\n return this.options.fallbackColor ? this.options.fallbackColor : (this.hasColor() ? this.color : '#000');\n }\n\n get format() {\n if (this.options.format) {\n return this.options.format;\n }\n\n if (this.hasColor() && this.color.hasTransparency() && this.color.format.match(/^hex/)) {\n return this.options.enableHex8 ? 'hex8' : (this.isAlphaEnabled() ? 'rgba' : 'hex');\n }\n\n if (this.hasColor()) {\n return this.color.format;\n }\n\n return null;\n }\n\n /**\n * Formatted color string, with the formatting options applied\n * (e.g. useHashPrefix)\n * @returns {String}\n */\n toInputColorString() {\n let str = this.toCssColorString();\n\n if (!str) {\n return str;\n }\n\n if (this.options.useHashPrefix === false) {\n str = str.replace(/^#/g, '');\n }\n\n return this._resolveColor(str);\n }\n\n /**\n * Formatted color string, suitable for CSS\n * @returns {String}\n */\n toCssColorString() {\n if (!this.hasColor()) {\n return '';\n }\n return this.color.toString(this.format);\n }\n\n /**\n * If the widget is not inside a container or inline, rearranges its position relative to its element offset.\n *\n * @param {Event} [e]\n * @private\n * @returns {boolean} Returns false if the widget is inside a container or inline, true otherwise\n */\n _reposition(e) {\n this.lastEvent.name = 'reposition';\n this.lastEvent.e = e;\n\n if (this.options.inline !== false || this.options.container) {\n return false;\n }\n let type = this.container && this.container[0] !== window.document.body ? 'position' : 'offset';\n let element = this.component || this.element;\n let offset = element[type]();\n\n if (this.options.align === 'right') {\n offset.left -= this.picker.outerWidth() - element.outerWidth();\n }\n this.picker.css({\n top: offset.top + element.outerHeight(),\n left: offset.left\n });\n return true;\n }\n\n /**\n * Shows the colorpicker widget if hidden.\n * If the input is disabled this call will be ignored.\n *\n * @fires colorpickerShow\n * @param {Event} [e]\n * @returns {boolean} True if was hidden and afterwards visible, false if nothing happened.\n */\n show(e) {\n this.lastEvent.name = 'show';\n this.lastEvent.e = e;\n\n if (this.isVisible() || this.isDisabled()) {\n // Don't show the widget if it's already visible or it is disabled\n return false;\n }\n this.picker.addClass('colorpicker-visible').removeClass('colorpicker-hidden');\n\n this._reposition(e);\n $(window).on('resize.colorpicker', $.proxy(this._reposition, this));\n\n if (e && (!this.hasInput() || this.input.attr('type') === 'color')) {\n if (e.stopPropagation && e.preventDefault) {\n e.stopPropagation();\n e.preventDefault();\n }\n }\n if ((this.component || !this.input) && (this.options.inline === false)) {\n $(window.document).on({\n 'mousedown.colorpicker': $.proxy(this.hide, this)\n });\n }\n\n /**\n * (Colorpicker) When show() is called and the widget can be shown.\n *\n * @event colorpickerShow\n */\n this.element.trigger({\n type: 'colorpickerShow',\n colorpicker: this,\n color: this.color\n });\n\n return true;\n }\n\n /**\n * Hides the colorpicker widget.\n * Hide is prevented when it is triggered by an event whose target element has been clicked/touched.\n *\n * @fires colorpickerHide\n * @param {Event} [e]\n * @returns {boolean} True if was visible and afterwards hidden, false if nothing happened.\n */\n hide(e) {\n this.lastEvent.name = 'hide';\n this.lastEvent.e = e;\n\n if (this.isHidden()) {\n // Do not trigger if already hidden\n return false;\n }\n if ((typeof e !== 'undefined') && e.target) {\n // Prevent hide if triggered by an event and an element inside the colorpicker has been clicked/touched\n if (\n $(e.currentTarget).parents('.colorpicker').length > 0 ||\n $(e.target).parents('.colorpicker').length > 0\n ) {\n return false;\n }\n }\n this.picker.addClass('colorpicker-hidden').removeClass('colorpicker-visible');\n $(window).off('resize.colorpicker', this._reposition);\n $(window.document).off({\n 'mousedown.colorpicker': this.hide\n });\n\n /**\n * (Colorpicker) When hide() is called and the widget can be hidden.\n *\n * @event colorpickerHide\n */\n this.element.trigger({\n type: 'colorpickerHide',\n colorpicker: this,\n color: this.color\n });\n return true;\n }\n\n /**\n * Returns true if the colorpicker element has the colorpicker-visible class and not the colorpicker-hidden one.\n * False otherwise.\n *\n * @returns {boolean}\n */\n isVisible() {\n return this.picker.hasClass('colorpicker-visible') && !this.picker.hasClass('colorpicker-hidden');\n }\n\n /**\n * Returns true if the colorpicker element has the colorpicker-hidden class and not the colorpicker-visible one.\n * False otherwise.\n *\n * @returns {boolean}\n */\n isHidden() {\n return this.picker.hasClass('colorpicker-hidden') && !this.picker.hasClass('colorpicker-visible');\n }\n\n /**\n * If the input element is present, it updates the value with the current color object color string.\n * If value is set, this method fires a \"change\" event on the input element.\n *\n * @fires change\n * @private\n */\n _updateInput() {\n if (this.hasInput()) {\n let val = this.toInputColorString();\n\n if (val === this.input.prop('value')) {\n // No need to set value or trigger any event if nothing changed\n return;\n }\n\n this.input.prop('value', val ? val : '');\n\n /**\n * (Input) Triggered on the input element when a new color is selected.\n *\n * @event change\n */\n this.input.trigger({\n type: 'change',\n colorpicker: this,\n color: this.color,\n value: val\n });\n }\n }\n\n /**\n * Changes the color adjustment bars using the current color object information.\n * @private\n */\n _updatePicker() {\n if (!this.hasColor()) {\n return;\n }\n\n let vertical = (this.options.horizontal === false),\n sl = vertical ? this.options.sliders : this.options.slidersHorz;\n\n let saturationGuide = this.picker.find('.colorpicker-saturation .colorpicker-guide'),\n hueGuide = this.picker.find('.colorpicker-hue .colorpicker-guide'),\n alphaGuide = this.picker.find('.colorpicker-alpha .colorpicker-guide');\n\n let hsva = this.color.hsvaRatio;\n\n if (hueGuide.length) {\n hueGuide.css(vertical ? 'top' : 'left', (vertical ? sl.hue.maxTop : sl.hue.maxLeft) * (1 - hsva.h));\n }\n\n if (alphaGuide.length) {\n alphaGuide.css(vertical ? 'top' : 'left', (vertical ? sl.alpha.maxTop : sl.alpha.maxLeft) * (1 - hsva.a));\n }\n\n if (saturationGuide.length) {\n saturationGuide.css({\n 'top': sl.saturation.maxTop - hsva.v * sl.saturation.maxTop,\n 'left': hsva.s * sl.saturation.maxLeft\n });\n }\n\n this.picker.find('.colorpicker-saturation')\n .css('backgroundColor', this.color.getHueOnlyCopy().toHexString()); // we only need hue\n\n this.picker.find('.colorpicker-alpha')\n .css('backgroundColor', this.color.toString('hex6')); // we don't need alpha\n }\n\n /**\n * If the component element is present, its background color is updated\n * @private\n */\n _updateComponent() {\n if (!this.hasColor()) {\n return;\n }\n\n if (this.component !== false) {\n let icn = this.component.find('i').eq(0);\n\n if (icn.length > 0) {\n icn.css({\n 'backgroundColor': this.toCssColorString()\n });\n } else {\n this.component.css({\n 'backgroundColor': this.toCssColorString()\n });\n }\n }\n }\n\n /**\n * @private\n * @returns {boolean}\n */\n _shouldUpdate() {\n return (this.hasColor() && ((this.getValue(false) !== false)));\n }\n\n /**\n * Updated the component color, the input value and the widget if a color is present.\n *\n * If force is true, it is updated anyway.\n *\n * @fires colorpickerUpdate\n * @param {boolean} [force]\n */\n update(force = false) {\n if (this._shouldUpdate() || (force === true)) {\n // Update only if the current value (from input or data) is not empty\n this._updateComponent();\n\n // Do not update input when autoInputFallback is disabled and last event is keyup.\n let preventInputUpdate = (\n (this.options.autoInputFallback !== true) &&\n (\n // this.isInvalidColor() || // prevent also on invalid color (on create, leaves invalid colors)\n (this.lastEvent.name === 'keyup')\n )\n );\n\n if (!preventInputUpdate) {\n this._updateInput();\n }\n\n this._updatePicker();\n\n /**\n * (Colorpicker) Fired when the widget is updated.\n *\n * @event colorpickerUpdate\n */\n this.element.trigger({\n type: 'colorpickerUpdate',\n colorpicker: this,\n color: this.color\n });\n }\n }\n\n /**\n * Returns the color string from the input value or the 'data-color' attribute of the input or element.\n * If empty, it returns the defaultValue parameter.\n *\n * @param {String|*} [defaultValue]\n * @returns {String|*}\n */\n getValue(defaultValue = null) {\n defaultValue = (typeof defaultValue === 'undefined') ? this.fallbackColor : defaultValue;\n let candidates = [], val = false;\n\n if (this.hasInput()) {\n candidates.push(this.input.val());\n candidates.push(this.input.data('color'));\n }\n candidates.push(this.element.data('color'));\n\n candidates.map((item) => {\n if (item && (val === false)) {\n val = item;\n }\n });\n\n val = ((val === false) ? defaultValue : val);\n\n if (val instanceof Color) {\n return val.toString(this.format);\n }\n\n return val;\n }\n\n /**\n * Sets the color manually\n *\n * @fires colorpickerChange\n * @param {String|Color} val\n */\n setValue(val) {\n if (this.hasColor() && this.color.equals(val)) {\n // equal color object\n return;\n }\n\n let color = val ? this.createColor(val) : false;\n\n if (!this.hasColor() && !color) {\n // color was empty and the new one too\n return;\n }\n\n // force update if color is changed to empty\n let shouldForceUpdate = this.hasColor() && !color;\n\n this.color = color;\n\n /**\n * (Colorpicker) When the color is set programmatically with setValue().\n *\n * @event colorpickerChange\n */\n this.element.trigger({\n type: 'colorpickerChange',\n colorpicker: this,\n color: this.color,\n value: val\n });\n\n // force update if color has changed to empty\n this.update(shouldForceUpdate);\n }\n\n /**\n * Creates a new color using the widget instance options (fallbackColor, format).\n *\n * @fires colorpickerInvalid\n * @param {*} val\n * @param {boolean} useFallback\n * @returns {Color}\n */\n createColor(val, useFallback = true) {\n let color = new Color(this._resolveColor(val), {format: this.format});\n\n if (!color.isValid()) {\n let invalidColor = color, fallback;\n\n if (useFallback) {\n fallback = ((this.fallbackColor instanceof Color) && this.fallbackColor.isValid()) ?\n this.fallbackColor : this._resolveColor(this.fallbackColor);\n\n color = new Color(fallback, {format: this.format});\n\n if (!color.isValid() && useFallback) {\n throw new Error('The fallback color is invalid.');\n }\n }\n\n color.previous = invalidColor;\n\n /**\n * (Colorpicker) Fired when the color is invalid and the fallback color is going to be used.\n *\n * @event colorpickerInvalid\n */\n this.element.trigger({\n type: 'colorpickerInvalid',\n colorpicker: this,\n color: color,\n value: val\n });\n }\n\n if (!this.isAlphaEnabled() && color.hasTransparency()) {\n // Alpha is disabled\n color.setAlpha(1);\n }\n\n if (!this.hasColor()) {\n // No previous color, so no need to compare\n return color;\n }\n\n let hsva = color.hsvaRatio;\n let prevHsva = this.color.hsvaRatio;\n\n if (\n hsva.s === 0 &&\n hsva.h === 0 &&\n prevHsva.h !== 0\n ) {\n // Hue was set to 0 because saturation was 0, use previous hue, since it was not meant to change...\n color.setHueRatio(prevHsva.h);\n }\n\n if (!this.isAlphaEnabled() && color.hasTransparency()) {\n // Alpha is disabled\n color.setAlpha(1);\n }\n\n return color;\n }\n\n /**\n * Checks if there is a color object, that it is valid and it is not a fallback\n * @returns {boolean}\n */\n isInvalidColor() {\n return !this.hasColor() || !this.color.isValid() || !!this.color.previous;\n }\n\n /**\n * Returns true if the useAlpha option is exactly true, false otherwise\n * @returns {boolean}\n */\n isAlphaEnabled() {\n return this.options.useAlpha === true;\n }\n\n /**\n * Resolves a color, in case is not in a standard format (e.g. a custom color alias)\n *\n * @private\n * @param {String|*} color\n * @returns {String|*|null}\n */\n _resolveColor(color) {\n let extResolvedColor = false;\n\n $.each(this.extensions, function (name, ext) {\n if (extResolvedColor !== false) {\n // skip if resolved\n return;\n }\n extResolvedColor = ext.resolveColor(color);\n });\n\n if (extResolvedColor !== false) {\n color = extResolvedColor;\n }\n\n return color;\n }\n\n /**\n * Returns true if the widget has an associated input element, false otherwise\n * @returns {boolean}\n */\n hasInput() {\n return (this.input !== false);\n }\n\n /**\n * Returns true if this instance is disabled\n * @returns {boolean}\n */\n isDisabled() {\n return this.disabled === true;\n }\n\n /**\n * Disables the widget and the input if any\n *\n * @fires colorpickerDisable\n * @returns {boolean}\n */\n disable() {\n if (this.hasInput()) {\n this.input.prop('disabled', true);\n }\n this.disabled = true;\n\n /**\n * (Colorpicker) When the widget has been disabled.\n *\n * @event colorpickerDisable\n */\n this.element.trigger({\n type: 'colorpickerDisable',\n colorpicker: this,\n color: this.color\n });\n return true;\n }\n\n /**\n * Enables the widget and the input if any\n *\n * @fires colorpickerEnable\n * @returns {boolean}\n */\n enable() {\n if (this.hasInput()) {\n this.input.prop('disabled', false);\n }\n this.disabled = false;\n\n /**\n * (Colorpicker) When the widget has been enabled.\n *\n * @event colorpickerEnable\n */\n this.element.trigger({\n type: 'colorpickerEnable',\n colorpicker: this,\n color: this.color\n });\n return true;\n }\n\n /**\n * Function triggered when clicking in one of the color adjustment bars\n *\n * @private\n * @fires mousemove\n * @param {Event} e\n * @returns {boolean}\n */\n _mousedown(e) {\n this.lastEvent.name = 'mousedown';\n this.lastEvent.e = e;\n\n if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {\n e.pageX = e.originalEvent.touches[0].pageX;\n e.pageY = e.originalEvent.touches[0].pageY;\n }\n e.stopPropagation();\n e.preventDefault();\n\n let target = $(e.target);\n\n // detect the slider and set the limits and callbacks\n let zone = target.closest('div');\n let sl = this.options.horizontal ? this.options.slidersHorz : this.options.sliders;\n\n if (!zone.is('.colorpicker')) {\n if (zone.is('.colorpicker-saturation')) {\n this.currentSlider = $.extend({}, sl.saturation);\n } else if (zone.is('.colorpicker-hue')) {\n this.currentSlider = $.extend({}, sl.hue);\n } else if (zone.is('.colorpicker-alpha')) {\n this.currentSlider = $.extend({}, sl.alpha);\n } else {\n return false;\n }\n let offset = zone.offset();\n // reference to guide's style\n\n this.currentSlider.guide = zone.find('.colorpicker-guide')[0].style;\n this.currentSlider.left = e.pageX - offset.left;\n this.currentSlider.top = e.pageY - offset.top;\n this.mousePointer = {\n left: e.pageX,\n top: e.pageY\n };\n\n /**\n * (window.document) Triggered on mousedown for the document object,\n * so the color adjustment guide is moved to the clicked position.\n *\n * @event mousemove\n */\n $(window.document).on({\n 'mousemove.colorpicker': $.proxy(this._mousemove, this),\n 'touchmove.colorpicker': $.proxy(this._mousemove, this),\n 'mouseup.colorpicker': $.proxy(this._mouseup, this),\n 'touchend.colorpicker': $.proxy(this._mouseup, this)\n }).trigger('mousemove');\n }\n return false;\n }\n\n /**\n * Function triggered when dragging a guide inside one of the color adjustment bars.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n _mousemove(e) {\n this.lastEvent.name = 'mousemove';\n this.lastEvent.e = e;\n\n let color = !this.hasColor() ? this.createColor(this.fallbackColor) : this.color.getCopy();\n\n if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {\n e.pageX = e.originalEvent.touches[0].pageX;\n e.pageY = e.originalEvent.touches[0].pageY;\n }\n e.stopPropagation();\n e.preventDefault();\n let left = Math.max(\n 0,\n Math.min(\n this.currentSlider.maxLeft,\n this.currentSlider.left + ((e.pageX || this.mousePointer.left) - this.mousePointer.left)\n )\n );\n let top = Math.max(\n 0,\n Math.min(\n this.currentSlider.maxTop,\n this.currentSlider.top + ((e.pageY || this.mousePointer.top) - this.mousePointer.top)\n )\n );\n\n this.currentSlider.guide.left = left + 'px';\n this.currentSlider.guide.top = top + 'px';\n if (this.currentSlider.callLeft) {\n color[this.currentSlider.callLeft].call(color, left / this.currentSlider.maxLeft);\n }\n if (this.currentSlider.callTop) {\n color[this.currentSlider.callTop].call(color, top / this.currentSlider.maxTop);\n }\n\n this.setValue(color);\n return false;\n }\n\n /**\n * Function triggered when releasing the click in one of the color adjustment bars.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n _mouseup(e) {\n this.lastEvent.name = 'mouseup';\n this.lastEvent.e = e;\n\n e.stopPropagation();\n e.preventDefault();\n $(window.document).off({\n 'mousemove.colorpicker': this._mousemove,\n 'touchmove.colorpicker': this._mousemove,\n 'mouseup.colorpicker': this._mouseup,\n 'touchend.colorpicker': this._mouseup\n });\n return false;\n }\n\n /**\n * Function triggered when the input has changed, so the colorpicker gets updated.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n _change(e) {\n this.lastEvent.name = 'change';\n this.lastEvent.e = e;\n\n let val = this.input.val();\n\n if (val !== this.toInputColorString()) {\n this.setValue(val);\n }\n }\n\n /**\n * Function triggered after a keyboard key has been released.\n *\n * @private\n * @param {Event} e\n * @returns {boolean}\n */\n _keyup(e) {\n this.lastEvent.name = 'keyup';\n this.lastEvent.e = e;\n\n let val = this.input.val();\n\n if (val !== this.toInputColorString()) {\n this.setValue(val);\n }\n }\n}\n\nexport default Colorpicker;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/Colorpicker.js","'use strict';\n\nimport tinycolor from 'tinycolor2';\n\nfunction unwrapColor(color) {\n if (color instanceof tinycolor) {\n return {\n r: color._r,\n g: color._g,\n b: color._b,\n a: color._a\n };\n }\n return color;\n}\n\n/**\n * Sanitizes a format string, so it is compatible with tinycolor,\n * or returns the same value if it is not a string.\n *\n * @param {String} format\n * @returns {String|*}\n * @private\n */\nfunction getCompatibleFormat(format) {\n if (format instanceof String || typeof format === 'string') {\n return format.replace(/a$/gi, '');\n }\n\n return format;\n}\n\n/**\n * Color manipulation class that extends the tinycolor library class.\n */\nclass Color extends tinycolor {\n /**\n * Identifier of the color instance.\n *\n * @type {int}\n * @readonly\n */\n get id() {\n return this._tc_id;\n }\n\n /**\n * Format of the parsed color.\n *\n * @type {String}\n * @readonly\n */\n get format() {\n return this._format;\n }\n\n /**\n * All options of the current instance.\n *\n * @type {{format: String, gradientType: String}}\n * @readonly\n */\n get options() {\n return {\n format: this._format,\n gradientType: this._gradientType\n };\n }\n\n /**\n * @returns {{h, s, v, a}}\n */\n get hsva() {\n return this.toHsv();\n }\n\n /**\n * @returns {{h, s, v, a}}\n */\n get hsvaRatio() {\n let hsv = this.hsva;\n\n return {\n h: hsv.h / 360,\n s: hsv.s,\n v: hsv.v,\n a: hsv.a\n };\n }\n\n /**\n * foo bar\n * @param {Color|*} color\n * @param {{format}} [options]\n * @constructor\n */\n constructor(color, options = {format: null}) {\n if (options.format) {\n options.format = getCompatibleFormat(options.format);\n }\n super(unwrapColor(color), options);\n\n /**\n * @type {Color|*}\n */\n this._originalInput = color; // keep real original color\n /**\n * Hue backup to not lose the information when saturation is 0.\n * @type {number}\n */\n this._hbak = this.hsva.h;\n /**\n * If set, it contains a reference to a previous color that caused the creation of this one.\n * @type {Color}\n */\n this.previous = null;\n }\n\n /**\n * Compares a color object with this one and returns true if it is equal or false if not.\n *\n * @param {Color} color\n * @returns {boolean}\n */\n equals(color) {\n if (!(color instanceof tinycolor)) {\n return false;\n }\n return this._r === color._r &&\n this._g === color._g &&\n this._b === color._b &&\n this._a === color._a &&\n this._roundA === color._roundA &&\n this._format === color._format &&\n this._gradientType === color._gradientType &&\n this._ok === color._ok;\n }\n\n /**\n * Imports all variables of the given color to this instance, excepting `_tc_id`.\n * @param {Color} color\n */\n importColor(color) {\n if (!(color instanceof tinycolor)) {\n throw new Error('Color.importColor: The color argument is not an instance of tinycolor.');\n }\n this._originalInput = color._originalInput;\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this._a = color._a;\n this._roundA = color._roundA;\n this._format = getCompatibleFormat(color._format);\n this._gradientType = color._gradientType;\n this._ok = color._ok;\n // omit .previous and ._tc_id import\n }\n\n /**\n * Imports the _r, _g, _b, _a, _hbak and _ok variables of the given color to this instance.\n * @param {Color} color\n */\n importRgb(color) {\n if (!color instanceof Color) {\n throw new Error('Color.importColor: The color argument is not an instance of tinycolor.');\n }\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this._a = color._a;\n this._ok = color._ok;\n this._hbak = color._hbak;\n }\n\n /**\n * @param {{h,s,v,a}} hsv\n */\n importHsv(hsv) {\n this._hbak = hsv.h;\n this.importRgb(new Color(hsv, this.options));\n }\n\n /**\n * @returns {Color}\n */\n getCopy() {\n return new Color(this.hsva, this.options);\n }\n\n /**\n * @returns {Color}\n */\n getHueOnlyCopy() {\n return new Color({h: this._hbak ? this._hbak : this.hsva.h, s: 100, v: 100}, this.options);\n }\n\n /**\n * @returns {Color}\n */\n getOpaqueCopy() {\n return new Color(Object.assign({}, this.hsva, {a: 1}), this.options);\n }\n\n /**\n * @param {number} h Degrees from 0 to 360\n */\n setHue(h) {\n this.importHsv(Object.assign({}, this.hsva, {h: h}));\n }\n\n /**\n * @param {number} s Percent from 0 o 100\n */\n setSaturation(s) {\n this.importHsv(Object.assign({}, this.hsva, {s: s}));\n }\n\n /**\n * @param {number} v Percent from 0 o 100\n */\n setBrightness(v) {\n this.importHsv(Object.assign({}, this.hsva, {v: v}));\n }\n\n /**\n * @param {number} h Ratio from 0.0 to 1.0\n */\n setHueRatio(h) {\n if (h === 0) {\n return;\n }\n this.setHue((1 - h) * 360);\n }\n\n /**\n * @param {number} s Ratio from 0.0 to 1.0\n */\n setSaturationRatio(s) {\n this.setSaturation(s);\n }\n\n /**\n * @param {number} v Ratio from 0.0 to 1.0\n */\n setBrightnessRatio(v) {\n this.setBrightness(1 - v);\n }\n\n /**\n * @param {number} a Ratio from 0.0 to 1.0\n */\n setAlphaRatio(a) {\n this.setAlpha(1 - a);\n }\n\n /**\n * @returns {boolean}\n */\n isTransparent() {\n return this._a === 0;\n }\n\n /**\n * @returns {boolean}\n */\n hasTransparency() {\n return this._a !== 1;\n }\n\n /**\n * @param {string|null} [format] One of \"rgb\", \"prgb\", \"hex\"/\"hex6\", \"hex3\", \"hex8\", \"hsl\", \"hsv\"/\"hsb\", \"name\"\n * @returns {String}\n */\n toString(format = null) {\n format = format ? getCompatibleFormat(format) : this.format;\n\n let colorStr = super.toString(format);\n\n if (colorStr && colorStr.match(/^#[0-9a-f]{3,8}$/i)) {\n // Support transparent for hex formats\n if (this.isTransparent() && (this._r === 0) && (this._g === 0) && (this._b === 0)) {\n return 'transparent';\n }\n }\n\n return colorStr;\n }\n}\n\nexport default Color;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/Color.js","// TinyColor v1.4.1\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\n(function(Math) {\n\nvar trimLeft = /^\\s+/,\n trimRight = /\\s+$/,\n tinyCounter = 0,\n mathRound = Math.round,\n mathMin = Math.min,\n mathMax = Math.max,\n mathRandom = Math.random;\n\nfunction tinycolor (color, opts) {\n\n color = (color) ? color : '';\n opts = opts || { };\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n\n var rgb = inputToRGB(color);\n this._originalInput = color,\n this._r = rgb.r,\n this._g = rgb.g,\n this._b = rgb.b,\n this._a = rgb.a,\n this._roundA = mathRound(100*this._a) / 100,\n this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) { this._r = mathRound(this._r); }\n if (this._g < 1) { this._g = mathRound(this._g); }\n if (this._b < 1) { this._b = mathRound(this._b); }\n\n this._ok = rgb.ok;\n this._tc_id = tinyCounter++;\n}\n\ntinycolor.prototype = {\n isDark: function() {\n return this.getBrightness() < 128;\n },\n isLight: function() {\n return !this.isDark();\n },\n isValid: function() {\n return this._ok;\n },\n getOriginalInput: function() {\n return this._originalInput;\n },\n getFormat: function() {\n return this._format;\n },\n getAlpha: function() {\n return this._a;\n },\n getBrightness: function() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r/255;\n GsRGB = rgb.g/255;\n BsRGB = rgb.b/255;\n\n if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}\n if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}\n if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}\n return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);\n },\n setAlpha: function(value) {\n this._a = boundAlpha(value);\n this._roundA = mathRound(100*this._a) / 100;\n return this;\n },\n toHsv: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };\n },\n toHsvString: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);\n return (this._a == 1) ?\n \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" :\n \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \"+ this._roundA + \")\";\n },\n toHsl: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };\n },\n toHslString: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);\n return (this._a == 1) ?\n \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" :\n \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \"+ this._roundA + \")\";\n },\n toHex: function(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function(allow3Char) {\n return '#' + this.toHex(allow3Char);\n },\n toHex8: function(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function(allow4Char) {\n return '#' + this.toHex8(allow4Char);\n },\n toRgb: function() {\n return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };\n },\n toRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \")\" :\n \"rgba(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function() {\n return { r: mathRound(bound01(this._r, 255) * 100) + \"%\", g: mathRound(bound01(this._g, 255) * 100) + \"%\", b: mathRound(bound01(this._b, 255) * 100) + \"%\", a: this._a };\n },\n toPercentageRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%)\" :\n \"rgba(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function() {\n if (this._a === 0) {\n return \"transparent\";\n }\n\n if (this._a < 1) {\n return false;\n }\n\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function(secondColor) {\n var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n\n return \"progid:DXImageTransform.Microsoft.gradient(\"+gradientType+\"startColorstr=\"+hex8String+\",endColorstr=\"+secondHex8String+\")\";\n },\n toString: function(format) {\n var formatSet = !!format;\n format = format || this._format;\n\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n\n return formattedString || this.toHexString();\n },\n clone: function() {\n return tinycolor(this.toString());\n },\n\n _applyModification: function(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function() {\n return this._applyModification(lighten, arguments);\n },\n brighten: function() {\n return this._applyModification(brighten, arguments);\n },\n darken: function() {\n return this._applyModification(darken, arguments);\n },\n desaturate: function() {\n return this._applyModification(desaturate, arguments);\n },\n saturate: function() {\n return this._applyModification(saturate, arguments);\n },\n greyscale: function() {\n return this._applyModification(greyscale, arguments);\n },\n spin: function() {\n return this._applyModification(spin, arguments);\n },\n\n _applyCombination: function(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function() {\n return this._applyCombination(analogous, arguments);\n },\n complement: function() {\n return this._applyCombination(complement, arguments);\n },\n monochromatic: function() {\n return this._applyCombination(monochromatic, arguments);\n },\n splitcomplement: function() {\n return this._applyCombination(splitcomplement, arguments);\n },\n triad: function() {\n return this._applyCombination(triad, arguments);\n },\n tetrad: function() {\n return this._applyCombination(tetrad, arguments);\n }\n};\n\n// If input is an object, force 1 into \"1.0\" to handle ratios properly\n// String input requires \"1.0\" as input, so 1 will be treated as 1\ntinycolor.fromRatio = function(color, opts) {\n if (typeof color == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n }\n else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n\n return tinycolor(color, opts);\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n// \"red\"\n// \"#f00\" or \"f00\"\n// \"#ff0000\" or \"ff0000\"\n// \"#ff000000\" or \"ff000000\"\n// \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n// \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n// \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n// \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n// \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n// \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n// \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n\n if (typeof color == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n\n a = boundAlpha(a);\n\n return {\n ok: ok,\n format: color.format || format,\n r: mathMin(255, mathMax(rgb.r, 0)),\n g: mathMin(255, mathMax(rgb.g, 0)),\n b: mathMin(255, mathMax(rgb.b, 0)),\n a: a\n };\n}\n\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>\n\n// `rgbToRgb`\n// Handle bounds / percentage checking to conform to CSS color spec\n// <http://www.w3.org/TR/css3-color/>\n// *Assumes:* r, g, b in [0, 255] or [0, 1]\n// *Returns:* { r, g, b } in [0, 255]\nfunction rgbToRgb(r, g, b){\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n}\n\n// `rgbToHsl`\n// Converts an RGB color value to HSL.\n// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n// *Returns:* { h, s, l } in [0,1]\nfunction rgbToHsl(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, l = (max + min) / 2;\n\n if(max == min) {\n h = s = 0; // achromatic\n }\n else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n\n h /= 6;\n }\n\n return { h: h, s: s, l: l };\n}\n\n// `hslToRgb`\n// Converts an HSL color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hslToRgb(h, s, l) {\n var r, g, b;\n\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n\n function hue2rgb(p, q, t) {\n if(t < 0) t += 1;\n if(t > 1) t -= 1;\n if(t < 1/6) return p + (q - p) * 6 * t;\n if(t < 1/2) return q;\n if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n }\n\n if(s === 0) {\n r = g = b = l; // achromatic\n }\n else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHsv`\n// Converts an RGB color value to HSV\n// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n// *Returns:* { h, s, v } in [0,1]\nfunction rgbToHsv(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, v = max;\n\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n\n if(max == min) {\n h = 0; // achromatic\n }\n else {\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n\n// `hsvToRgb`\n// Converts an HSV color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHex`\n// Converts an RGB color to hex\n// Assumes r, g, and b are contained in the set [0, 255]\n// Returns a 3 or 6 character hex\nfunction rgbToHex(r, g, b, allow3Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToHex`\n// Converts an RGBA color plus alpha transparency to hex\n// Assumes r, g, b are contained in the set [0, 255] and\n// a in [0, 1]. Returns a 4 or 8 character rgba hex\nfunction rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToArgbHex`\n// Converts an RGBA color to an ARGB Hex8 string\n// Rarely used, but required for \"toFilter()\"\nfunction rgbaToArgbHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n}\n\n// `equals`\n// Can be called with any tinycolor input\ntinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) { return false; }\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n};\n\ntinycolor.random = function() {\n return tinycolor.fromRatio({\n r: mathRandom(),\n g: mathRandom(),\n b: mathRandom()\n });\n};\n\n\n// Modification Functions\n// ----------------------\n// Thanks to less.js for some of the basics here\n// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>\n\nfunction desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction saturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction greyscale(color) {\n return tinycolor(color).desaturate(100);\n}\n\nfunction lighten (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\nfunction brighten(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var rgb = tinycolor(color).toRgb();\n rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));\n rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));\n rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));\n return tinycolor(rgb);\n}\n\nfunction darken (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\n// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n// Values outside of this range will be wrapped into this range.\nfunction spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n}\n\n// Combination Functions\n// ---------------------\n// Thanks to jQuery xColor for some of the ideas behind these\n// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>\n\nfunction complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n}\n\nfunction triad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction tetrad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),\n tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})\n ];\n}\n\nfunction analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n\n for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n}\n\nfunction monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h, s = hsv.s, v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n\n while (results--) {\n ret.push(tinycolor({ h: h, s: s, v: v}));\n v = (v + modification) % 1;\n }\n\n return ret;\n}\n\n// Utility Functions\n// ---------------------\n\ntinycolor.mix = function(color1, color2, amount) {\n amount = (amount === 0) ? 0 : (amount || 50);\n\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n\n var p = amount / 100;\n\n var rgba = {\n r: ((rgb2.r - rgb1.r) * p) + rgb1.r,\n g: ((rgb2.g - rgb1.g) * p) + rgb1.g,\n b: ((rgb2.b - rgb1.b) * p) + rgb1.b,\n a: ((rgb2.a - rgb1.a) * p) + rgb1.a\n };\n\n return tinycolor(rgba);\n};\n\n\n// Readability Functions\n// ---------------------\n// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)\n\n// `contrast`\n// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)\ntinycolor.readability = function(color1, color2) {\n var c1 = tinycolor(color1);\n var c2 = tinycolor(color2);\n return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);\n};\n\n// `isReadable`\n// Ensure that foreground and background color combinations meet WCAG2 guidelines.\n// The third argument is an optional Object.\n// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';\n// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.\n// If the entire object is absent, isReadable defaults to {level:\"AA\",size:\"small\"}.\n\n// *Example*\n// tinycolor.isReadable(\"#000\", \"#111\") => false\n// tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\ntinycolor.isReadable = function(color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n\n out = false;\n\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n\n};\n\n// `mostReadable`\n// Given a base color and a list of possible foreground or background\n// colors for that base, returns the most readable color.\n// Optionally returns Black or White if the most readable color is unreadable.\n// *Example*\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\ntinycolor.mostReadable = function(baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size ;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors ;\n level = args.level;\n size = args.size;\n\n for (var i= 0; i < colorList.length ; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n\n if (tinycolor.isReadable(baseColor, bestColor, {\"level\":level,\"size\":size}) || !includeFallbackColors) {\n return bestColor;\n }\n else {\n args.includeFallbackColors=false;\n return tinycolor.mostReadable(baseColor,[\"#fff\", \"#000\"],args);\n }\n};\n\n\n// Big List of Colors\n// ------------------\n// <http://www.w3.org/TR/css3-color/#svg-color>\nvar names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n};\n\n// Make it easy to access colors via `hexNames[hex]`\nvar hexNames = tinycolor.hexNames = flip(names);\n\n\n// Utilities\n// ---------\n\n// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\nfunction flip(o) {\n var flipped = { };\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n}\n\n// Return a valid alpha value [0,1] with all invalid values being set to 1\nfunction boundAlpha(a) {\n a = parseFloat(a);\n\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n\n return a;\n}\n\n// Take input from [0, n] and return it as [0, 1]\nfunction bound01(n, max) {\n if (isOnePointZero(n)) { n = \"100%\"; }\n\n var processPercent = isPercentage(n);\n n = mathMin(max, mathMax(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if ((Math.abs(n - max) < 0.000001)) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return (n % max) / parseFloat(max);\n}\n\n// Force a number between 0 and 1\nfunction clamp01(val) {\n return mathMin(1, mathMax(0, val));\n}\n\n// Parse a base-16 hex value into a base-10 integer\nfunction parseIntFromHex(val) {\n return parseInt(val, 16);\n}\n\n// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>\nfunction isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n}\n\n// Check to see if string passed in is a percentage\nfunction isPercentage(n) {\n return typeof n === \"string\" && n.indexOf('%') != -1;\n}\n\n// Force a hex value to have 2 characters\nfunction pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}\n\n// Replace a decimal with it's percentage value\nfunction convertToPercentage(n) {\n if (n <= 1) {\n n = (n * 100) + \"%\";\n }\n\n return n;\n}\n\n// Converts a decimal to a hex value\nfunction convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n// Converts a hex value to a decimal\nfunction convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}\n\nvar matchers = (function() {\n\n // <http://www.w3.org/TR/css3-values/#integers>\n var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n // <http://www.w3.org/TR/css3-values/#number-value>\n var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n\n return {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n})();\n\n// `isValidCSSUnit`\n// Take in a single string / number and check to see if it looks like a CSS unit\n// (see `matchers` above for definition).\nfunction isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}\n\n// `stringInputToObject`\n// Permissive string parsing. Take in a number of formats, and output an object\n// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\nfunction stringInputToObject(color) {\n\n color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color == 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: \"name\" };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if ((match = matchers.rgb.exec(color))) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n if ((match = matchers.rgba.exec(color))) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n if ((match = matchers.hsl.exec(color))) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n if ((match = matchers.hsla.exec(color))) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n if ((match = matchers.hsv.exec(color))) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n if ((match = matchers.hsva.exec(color))) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n if ((match = matchers.hex8.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex6.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n if ((match = matchers.hex4.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n a: convertHexToDecimal(match[4] + '' + match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex3.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n\n return false;\n}\n\nfunction validateWCAG2Parms(parms) {\n // return valid WCAG2 parms for isReadable.\n // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n var level, size;\n parms = parms || {\"level\":\"AA\", \"size\":\"small\"};\n level = (parms.level || \"AA\").toUpperCase();\n size = (parms.size || \"small\").toLowerCase();\n if (level !== \"AA\" && level !== \"AAA\") {\n level = \"AA\";\n }\n if (size !== \"small\" && size !== \"large\") {\n size = \"small\";\n }\n return {\"level\":level, \"size\":size};\n}\n\n// Node: Export function\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports = tinycolor;\n}\n// AMD/requirejs: Define the module\nelse if (typeof define === 'function' && define.amd) {\n define(function () {return tinycolor;});\n}\n// Browser: Expose to window\nelse {\n window.tinycolor = tinycolor;\n}\n\n})(Math);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/tinycolor2/tinycolor.js\n// module id = 6\n// module chunks = 0 1","'use strict';\n/**\n * @module\n */\n\n/**\n * Colorpicker default options\n */\nexport default {\n /**\n * If true, loads the Debugger extension automatically into the current instance\n * @type {boolean}\n * @default false\n */\n debug: false,\n /**\n * Forces a color, ignoring the one from the elements value or data-color attribute.\n *\n * @type {(String|Color|boolean)}\n * @default false\n */\n color: false,\n /**\n * Forces an specific color format. If false, it will be automatically detected the first time,\n * but if null it will be always recalculated.\n *\n * Note that the ending 'a' of the format meaning \"alpha\" has currently no effect, meaning that rgb is the same as\n * rgba excepting if the alpha channel is disabled (see useAlpha).\n *\n * @type {('rgb'|'rgba'|'prgb'|'prgba'|'hex'|'hex3'|'hex6'|'hex8'|'hsl'|'hsla'|'hsv'|'hsva'|'name'|boolean)}\n * @default false\n */\n format: false,\n /**\n * Horizontal mode layout.\n *\n * If true, the hue and alpha channel bars will be rendered horizontally, above the saturation selector.\n *\n * @type {boolean}\n * @default false\n */\n horizontal: false,\n /**\n * Forces to show the colorpicker as an inline element\n *\n * @type {boolean}\n * @default false\n */\n inline: false,\n /**\n * Children input CSS selector\n *\n * @type {String}\n * @default 'input'\n */\n input: 'input',\n /**\n * Colorpicker container CSS selector. If given, the colorpicker will be placed inside this container.\n * If true, the colorpicker element itself will be used as the container.\n *\n * @type {String|boolean}\n * @default false\n */\n container: false, // container selector\n /**\n * Children color component CSS selector.\n * If it exists, the child <i> element background will be changed on color change.\n *\n * @type {String|boolean}\n * @default '.add-on, .input-group-addon'\n */\n component: '.add-on, .input-group-addon',\n /**\n * Fallback color to use when the given color is invalid.\n * If false, the latest valid color will be used as a fallback.\n *\n * @type {String|Color|boolean}\n * @default false\n */\n fallbackColor: false,\n /**\n * If enabled, the input content will be replaced always with a valid color,\n * if not enabled the invalid color will be left in the input, but valid in the internal color object.\n *\n * @type {boolean}\n * @default false\n */\n autoInputFallback: false,\n /**\n * If true a hash will be prepended to hexadecimal colors.\n * If false, the hash will be removed.\n * This only affects the input values.\n *\n * @type {boolean}\n * @default false\n */\n useHashPrefix: true,\n /**\n * If true or false the alpha adjustment bar will be displayed no matter what.\n * If false it will be always hidden and alpha channel won't be allowed programmatically for this instance,\n * so the selected or typed color will be always opaque.\n *\n * @type {boolean}\n * @default true\n */\n useAlpha: true,\n /**\n * This only applies when the color format is hexadecimal.\n * If true, the alpha channel will be allowed for hexadecimal formatted colors, making them having 4 or 8 chars\n * (RGBA or RRGGBBAA). This format is not yet supported in all modern browsers, so it is disabled by default.\n * If false, rgba will be used whenever there is an alpha change different than 1 and the color format is\n * automatic.\n *\n * @type {boolean}\n * @default true\n */\n enableHex8: false,\n /**\n * Vertical sliders configuration\n * @type {Object}\n */\n sliders: {\n saturation: {\n maxLeft: 100,\n maxTop: 100,\n callLeft: 'setSaturationRatio',\n callTop: 'setBrightnessRatio'\n },\n hue: {\n maxLeft: 0,\n maxTop: 100,\n callLeft: false,\n callTop: 'setHueRatio'\n },\n alpha: {\n maxLeft: 0,\n maxTop: 100,\n callLeft: false,\n callTop: 'setAlphaRatio'\n }\n },\n /**\n * Horizontal sliders configuration\n * @type {Object}\n */\n slidersHorz: {\n saturation: {\n maxLeft: 100,\n maxTop: 100,\n callLeft: 'setSaturationRatio',\n callTop: 'setBrightnessRatio'\n },\n hue: {\n maxLeft: 100,\n maxTop: 0,\n callLeft: 'setHueRatio',\n callTop: false\n },\n alpha: {\n maxLeft: 100,\n maxTop: 0,\n callLeft: 'setAlphaRatio',\n callTop: false\n }\n },\n /**\n * Colorpicker popup alignment.\n * For now only right is supported.\n *\n * @type {('right')}\n * @default 'right'\n */ // TODO: add 'left' and 'auto' support.\n align: 'right',\n /**\n * Custom class to be added to the colorpicker element\n *\n * @type {String}\n */\n customClass: null,\n /**\n * Colorpicker widget template\n * @type {String}\n * @example\n * <!-- This is the default template: -->\n * <div class=\"colorpicker\">\n * <div class=\"colorpicker-saturation\"><i class=\"colorpicker-guide\"><i></i></i></div>\n * <div class=\"colorpicker-hue\"><i class=\"colorpicker-guide\"></i></div>\n * <div class=\"colorpicker-alpha\"><i class=\"colorpicker-guide\"></i></div>\n * <div class=\"colorpicker-color\"><div /></div>\n * </div>\n */\n template: `<div class=\"colorpicker\">\n <div class=\"colorpicker-saturation\"><i class=\"colorpicker-guide\"><i /></div>\n <div class=\"colorpicker-hue\"><i class=\"colorpicker-guide\"></i></div>\n <div class=\"colorpicker-alpha\"><i class=\"colorpicker-guide\"></i></div></div>`,\n /**\n *\n * Associative object with the extension class name and its config.\n * Colorpicker comes with many bundled extensions: debugger, palette, preview and swatches (a superset of Palette).\n *\n * @type {Object}\n * @example\n * extensions: [\n * {\n * name: 'swatches'\n * colors: {\n * 'primary': '#337ab7',\n * 'success': '#5cb85c',\n * 'info': '#5bc0de',\n * 'warning': '#f0ad4e',\n * 'danger': '#d9534f'\n * },\n * namesAsValues: true\n * }\n * ]\n */\n extensions: [\n {\n name: 'preview',\n showText: false\n }\n ]\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/options.js","import Debugger from './Debugger';\nimport Preview from './Preview';\nimport Swatches from './Swatches';\nimport Palette from './Palette';\n\nexport {\n Debugger, Preview, Swatches, Palette\n};\n\nexport default {\n 'debugger': Debugger,\n 'preview': Preview,\n 'swatches': Swatches,\n 'palette': Palette\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/extensions/index.js","'use strict';\n\nimport Extension from 'Extension';\nimport $ from 'jquery';\n\nclass Debugger extends Extension {\n constructor(colorpicker, options = {}) {\n super(colorpicker, options);\n\n /**\n * @type {number}\n */\n this.eventCounter = 0;\n if (this.colorpicker.hasInput()) {\n this.colorpicker.input.on('change.colorpicker-ext', $.proxy(this.onChangeInput, this));\n }\n }\n\n /**\n * @fires colorpickerDebug\n * @param {string} eventName\n * @param {*} args\n */\n log(eventName, ...args) {\n this.eventCounter += 1;\n\n let logMessage = `#${this.eventCounter}: Colorpicker#${this.colorpicker.id} [${eventName}]`;\n\n console.debug(logMessage, ...args);\n\n /**\n * (Colorpicker) Fired by the ConsoleDebug extension whenever it logs something\n *\n * @event colorpickerDebug\n */\n this.colorpicker.element.trigger({\n type: 'colorpickerDebug',\n colorpicker: this.colorpicker,\n color: this.color,\n debug: {\n debugger: this,\n eventName: eventName,\n logArgs: args,\n logMessage: logMessage\n }\n });\n }\n\n resolveColor(color) {\n this.log('resolveColor()', color);\n return false;\n }\n\n onCreate(event) {\n this.log('colorpickerCreate');\n return super.onCreate(event);\n }\n\n onDestroy(event) {\n this.log('colorpickerDestroy');\n this.eventCounter = 0;\n\n if (this.colorpicker.hasInput()) {\n this.colorpicker.input.off('.colorpicker-ext');\n }\n\n return super.onDestroy(event);\n }\n\n onUpdate(event) {\n this.log('colorpickerUpdate');\n }\n\n /**\n * @listens _change\n * @param {Event} event\n */\n onChangeInput(event) {\n this.log('input:change.colorpicker', event.value, event.color);\n }\n\n onChange(event) {\n this.log('colorpickerChange', event.value, event.color);\n }\n\n onInvalid(event) {\n this.log('colorpickerInvalid', event.value, event.color);\n }\n\n onHide(event) {\n this.log('colorpickerHide');\n this.eventCounter = 0;\n }\n\n onShow(event) {\n this.log('colorpickerShow');\n }\n\n onDisable(event) {\n this.log('colorpickerDisable');\n }\n\n onEnable(event) {\n this.log('colorpickerEnable');\n }\n}\n\nexport default Debugger;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/extensions/Debugger.js","'use strict';\n\nimport Extension from 'Extension';\nimport $ from 'jquery';\n\nclass Preview extends Extension {\n constructor(colorpicker, options = {}) {\n super(colorpicker, Object.assign({},\n {\n template: '<div class=\"colorpicker-bar colorpicker-preview\"><div /></div>',\n showText: true,\n format: colorpicker.format\n },\n options\n ));\n\n this.element = $(this.options.template);\n this.elementInner = this.element.find('div');\n }\n\n onCreate(event) {\n super.onCreate(event);\n this.colorpicker.picker.append(this.element);\n }\n\n onUpdate(event) {\n super.onUpdate(event);\n\n this.elementInner\n .css('backgroundColor', event.color.toRgbString());\n\n if (this.options.showText) {\n this.elementInner\n .html(event.color.toString(this.options.format || this.colorpicker.format));\n\n if (event.color.isDark()) {\n this.elementInner.css('color', 'white');\n } else {\n this.elementInner.css('color', 'black');\n }\n }\n }\n}\n\nexport default Preview;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/extensions/Preview.js","'use strict';\n\nimport Palette from './Palette';\nimport $ from 'jquery';\n\nlet defaults = {\n barTemplate: '<div class=\"colorpicker-bar colorpicker-swatches\"></div>',\n swatchTemplate: '<i class=\"colorpicker-swatch\"></i>'\n};\n\nclass Swatches extends Palette {\n constructor(colorpicker, options = {}) {\n super(colorpicker, Object.assign({}, defaults, options));\n }\n\n isEnabled() {\n return this.getLength() > 0;\n }\n\n onCreate(event) {\n super.onCreate(event);\n\n if (!this.isEnabled()) {\n return;\n }\n\n let colorpicker = this.colorpicker,\n swatchContainer = $(this.options.barTemplate),\n isAliased = (this.options.namesAsValues === true) && !Array.isArray(this.colors);\n\n $.each(this.colors, (name, value) => {\n let $swatch = $(this.options.swatchTemplate)\n .css('background-color', value)\n .attr('data-name', name)\n .attr('data-value', value)\n .attr('title', `${name}: ${value}`);\n\n $swatch.on('mousedown.colorpicker touchstart.colorpicker',\n function (e) {\n e.preventDefault();\n colorpicker.setValue(isAliased ? $(this).data('name') : $(this).data('value'));\n }\n );\n swatchContainer.append($swatch);\n });\n\n colorpicker.picker.append(swatchContainer);\n }\n}\n\nexport default Swatches;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/extensions/Swatches.js"],"sourceRoot":""}
editor.php → includes/editor.php RENAMED
@@ -30,7 +30,7 @@ function generate_code_editor ($block, $client_code, $process_php) {
30
  $obj = $block_object [$block];
31
  $code = $obj->ai_getCode ($client_code, $process_php);
32
 
33
- wp_enqueue_script ('ai-adb-js', plugins_url ('includes/js/ad-inserter-check.js', __FILE__), array (
34
  'jquery',
35
  'jquery-ui-tabs',
36
  'jquery-ui-button',
@@ -39,7 +39,7 @@ function generate_code_editor ($block, $client_code, $process_php) {
39
  'jquery-ui-dialog',
40
  ), AD_INSERTER_VERSION);
41
 
42
- wp_enqueue_style ('ai-editor-css', plugins_url ('css/ad-inserter.css', __FILE__), array (), AD_INSERTER_VERSION);
43
 
44
  add_action ('media_buttons', 'ai_editor_media_buttons');
45
 
@@ -296,7 +296,7 @@ function generate_code_editor ($block, $client_code, $process_php) {
296
 
297
  function initialize_preview () {
298
 
299
- var debug = <?php echo get_javascript_debugging () ? 'true' : 'false'; ?>;
300
 
301
  function load_from_settings () {
302
 
30
  $obj = $block_object [$block];
31
  $code = $obj->ai_getCode ($client_code, $process_php);
32
 
33
+ wp_enqueue_script ('ai-adb-js', plugins_url ('includes/js/ad-inserter-check.js', AD_INSERTER_FILE), array (
34
  'jquery',
35
  'jquery-ui-tabs',
36
  'jquery-ui-button',
39
  'jquery-ui-dialog',
40
  ), AD_INSERTER_VERSION);
41
 
42
+ wp_enqueue_style ('ai-editor-css', plugins_url ('css/ad-inserter.css', AD_INSERTER_FILE), array (), AD_INSERTER_VERSION);
43
 
44
  add_action ('media_buttons', 'ai_editor_media_buttons');
45
 
296
 
297
  function initialize_preview () {
298
 
299
+ var debug = <?php echo get_backend_javascript_debugging () ? 'true' : 'false'; ?>;
300
 
301
  function load_from_settings () {
302
 
includes/js/ai-adb.js CHANGED
@@ -142,8 +142,7 @@
142
  })(jQuery);
143
 
144
  var ai_adb = false;
145
- var ai_adb_wrapping_div_selector = ".AI_BLOCK_CLASS_NAME";
146
- var ai_adb_debugging = AI_DATAB_AI_JS_DEBUGGING;
147
  var ai_adb_active = false;
148
  var ai_adb_counter = 0;
149
  var ai_adb_overlay = AI_ADB_OVERLAY_WINDOW;
@@ -256,12 +255,31 @@ var ai_adb_detected = function(n) {
256
  $(window).ready(function () {
257
  if (ai_adb_debugging) console.log ("AI ad blocking block actions");
258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  $(".ai-adb-show").each (function () {
260
  $(this).css ({"display": "block", "visibility": "visible"});
261
 
262
  var tracking_data = $(this).data ('ai-tracking');
263
  if (typeof tracking_data != 'undefined') {
264
- var wrapping_div = $(this).closest (ai_adb_wrapping_div_selector);
265
  if (typeof wrapping_div.data ("ai") != "undefined") {
266
 
267
  if ($(this).hasClass ('ai-no-tracking')) {
@@ -282,14 +300,6 @@ var ai_adb_detected = function(n) {
282
  }
283
  });
284
 
285
- $(".ai-adb-hide").each (function () {
286
- $(this).css ({"display": "none", "visibility": "hidden"});
287
- if (ai_adb_debugging) {
288
- var debug_info = $(this).data ("ai-debug");
289
- console.log ("AI ad blocking HIDE", typeof debug_info != "undefined" ? debug_info : "");
290
- }
291
- });
292
-
293
  // ai_adb_process_content ();
294
 
295
  setTimeout (ai_adb_process_content, 10);
142
  })(jQuery);
143
 
144
  var ai_adb = false;
145
+ var ai_adb_debugging = AI_DATAB_AI_FRONTEND_JS_DEBUGGING;
 
146
  var ai_adb_active = false;
147
  var ai_adb_counter = 0;
148
  var ai_adb_overlay = AI_ADB_OVERLAY_WINDOW;
255
  $(window).ready(function () {
256
  if (ai_adb_debugging) console.log ("AI ad blocking block actions");
257
 
258
+ $(".ai-adb-hide").each (function () {
259
+ $(this).css ({"display": "none", "visibility": "hidden"});
260
+
261
+ var wrapping_div = $(this).closest ('div[data-ai]');
262
+ if (typeof wrapping_div.data ("ai") != "undefined") {
263
+ var data = JSON.parse (atob (wrapping_div.data ("ai")));
264
+ if (typeof data !== "undefined" && data.constructor === Array) {
265
+ data [1] = "";
266
+ wrapping_div.data ("ai", btoa (JSON.stringify (data)));
267
+ }
268
+ }
269
+
270
+ if (ai_adb_debugging) {
271
+ var debug_info = $(this).data ("ai-debug");
272
+ console.log ("AI ad blocking HIDE", typeof debug_info != "undefined" ? debug_info : "");
273
+ }
274
+ });
275
+
276
+ // after hide to update tracking data on replace
277
  $(".ai-adb-show").each (function () {
278
  $(this).css ({"display": "block", "visibility": "visible"});
279
 
280
  var tracking_data = $(this).data ('ai-tracking');
281
  if (typeof tracking_data != 'undefined') {
282
+ var wrapping_div = $(this).closest ('div[data-ai]');
283
  if (typeof wrapping_div.data ("ai") != "undefined") {
284
 
285
  if ($(this).hasClass ('ai-no-tracking')) {
300
  }
301
  });
302
 
 
 
 
 
 
 
 
 
303
  // ai_adb_process_content ();
304
 
305
  setTimeout (ai_adb_process_content, 10);
includes/js/ai-adb.min.js CHANGED
@@ -1,8 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
1
  (function($){var keyString="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var uTF8Encode=function(string){string=string.replace(/\x0d\x0a/g,"\n");var output="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128)output+=String.fromCharCode(c);else if(c>127&&c<2048){output+=String.fromCharCode(c>>6|192);output+=String.fromCharCode(c&63|128)}else{output+=String.fromCharCode(c>>12|224);output+=String.fromCharCode(c>>6&63|128);output+=String.fromCharCode(c&63|128)}}return output};
2
  var uTF8Decode=function(input){var string="";var i=0;var c=c1=c2=0;while(i<input.length){c=input.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++}else if(c>191&&c<224){c2=input.charCodeAt(i+1);string+=String.fromCharCode((c&31)<<6|c2&63);i+=2}else{c2=input.charCodeAt(i+1);c3=input.charCodeAt(i+2);string+=String.fromCharCode((c&15)<<12|(c2&63)<<6|c3&63);i+=3}}return string};$.extend({base64Encode:function(input){var output="";var chr1,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;input=uTF8Encode(input);
3
  while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=(chr1&3)<<4|chr2>>4;enc3=(chr2&15)<<2|chr3>>6;enc4=chr3&63;if(isNaN(chr2))enc3=enc4=64;else if(isNaN(chr3))enc4=64;output=output+keyString.charAt(enc1)+keyString.charAt(enc2)+keyString.charAt(enc3)+keyString.charAt(enc4)}return output},base64Decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/=]/g,"");while(i<
4
- input.length){enc1=keyString.indexOf(input.charAt(i++));enc2=keyString.indexOf(input.charAt(i++));enc3=keyString.indexOf(input.charAt(i++));enc4=keyString.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64)output=output+String.fromCharCode(chr2);if(enc4!=64)output=output+String.fromCharCode(chr3)}output=uTF8Decode(output);return output}})})(jQuery);var ai_adb=false;var ai_adb_wrapping_div_selector=".AI_BLOCK_CLASS_NAME";
5
- var ai_adb_debugging=AI_DATAB_AI_JS_DEBUGGING;var ai_adb_active=false;var ai_adb_counter=0;var ai_adb_overlay=AI_ADB_OVERLAY_WINDOW;var ai_adb_message_window=AI_ADB_MESSAGE_WINDOW;var ai_adb_message_undismissible=AI_FUNCB_GET_UNDISMISSIBLE_MESSAGE;var ai_adb_act_cookie_name="aiADB";var ai_adb_pgv_cookie_name="aiADB_PV";var ai_adb_page_redirection_cookie_name="aiADB_PR";var ai_adb_message_cookie_lifetime=AI_FUNCT_GET_NO_ACTION_PERIOD;var ai_adb_action=AI_FUNC_GET_ADB_ACTION;var ai_adb_page_views=AI_FUNCT_GET_DELAY_ACTION;
6
  var ai_adb_selectors="AI_ADB_SELECTORS";var ai_adb_redirection_url="AI_ADB_REDIRECTION_PAGE";
7
  function ai_adb_process_content(){(function($){if(ai_adb_debugging)console.log("AI ad blocking CONTENT PROCESSING");$(".AI_ADB_CONTENT_CSS_BEGIN_CLASS").each(function(){var ai_adb_parent=$(this).parent();if(ai_adb_debugging)console.log("AI ad blocking parent",ai_adb_parent.prop("tagName"),'id="'+ai_adb_parent.attr("id")+'"','class="'+ai_adb_parent.attr("class")+'"');var ai_adb_css=$(this).data("css");if(typeof ai_adb_css=="undefined")ai_adb_css="display: none !important;";var ai_adb_selectors=$(this).data("selectors");
8
  if(typeof ai_adb_selectors=="undefined"||ai_adb_selectors=="")ai_adb_selectors="p";if(ai_adb_debugging)console.log("AI ad blocking CSS, css='"+ai_adb_css+"'","selectors='"+ai_adb_selectors+"'");var ai_adb_action=false;$(ai_adb_parent).find(".AI_ADB_CONTENT_CSS_BEGIN_CLASS, "+ai_adb_selectors).each(function(){if($(this).hasClass("AI_ADB_CONTENT_CSS_BEGIN_CLASS")){$(this).remove();ai_adb_action=true}else if($(this).hasClass("AI_ADB_CONTENT_CSS_END_CLASS")){$(this).remove();ai_adb_action=false}else if(ai_adb_action){var ai_adb_style=
@@ -11,15 +22,15 @@ $(this).attr("style");if(typeof ai_adb_style=="undefined")ai_adb_style="";$(this
11
  $(this).parent();if(ai_adb_debugging)console.log("AI ad blocking REPLACE, parent",ai_adb_parent.prop("tagName"),'id="'+ai_adb_parent.attr("id")+'"','class="'+ai_adb_parent.attr("class")+'"');var ai_adb_text=$(this).data("text");if(typeof ai_adb_text=="undefined")ai_adb_text="";var ai_adb_css=$(this).data("css");if(typeof ai_adb_css=="undefined")ai_adb_css="";var ai_adb_selectors=$(this).data("selectors");if(typeof ai_adb_selectors=="undefined"||ai_adb_selectors=="")ai_adb_selectors="p";if(ai_adb_debugging)console.log("AI ad blocking REPLACE, text='"+
12
  ai_adb_text+"'","css='"+ai_adb_css+"'","selectors='"+ai_adb_selectors+"'");var ai_adb_action=false;$(ai_adb_parent).find(".AI_ADB_CONTENT_REPLACE_BEGIN_CLASS, "+ai_adb_selectors).each(function(){if($(this).hasClass("AI_ADB_CONTENT_REPLACE_BEGIN_CLASS")){$(this).remove();ai_adb_action=true}else if($(this).hasClass("AI_ADB_CONTENT_REPLACE_END_CLASS")){$(this).remove();ai_adb_action=false}else if(ai_adb_action){if(ai_adb_text.length!=0){var n=Math.round($(this).text().length/(ai_adb_text.length+1));
13
  $(this).text(Array(n+1).join(ai_adb_text+" "))}else $(this).text("");var ai_adb_style=$(this).attr("style");if(typeof ai_adb_style=="undefined")ai_adb_style="";$(this).attr("style",ai_adb_style+";"+ai_adb_css)}})})})(jQuery)}
14
- var ai_adb_detected=function(n){if(ai_adb_debugging)console.log("AI ad blocking DETECTED",n);if(!ai_adb_active){ai_adb_active=true;(function($){$(window).ready(function(){if(ai_adb_debugging)console.log("AI ad blocking block actions");$(".ai-adb-show").each(function(){$(this).css({"display":"block","visibility":"visible"});var tracking_data=$(this).data("ai-tracking");if(typeof tracking_data!="undefined"){var wrapping_div=$(this).closest(ai_adb_wrapping_div_selector);if(typeof wrapping_div.data("ai")!=
15
- "undefined"){if($(this).hasClass("ai-no-tracking")){var data=JSON.parse(atob(wrapping_div.data("ai")));if(typeof data!=="undefined"&&data.constructor===Array){data[1]="";tracking_data=btoa(JSON.stringify(data))}}wrapping_div.data("ai",tracking_data)}}if(ai_adb_debugging){var debug_info=$(this).data("ai-debug");console.log("AI ad blocking SHOW",typeof debug_info!="undefined"?debug_info:"")}});$(".ai-adb-hide").each(function(){$(this).css({"display":"none","visibility":"hidden"});if(ai_adb_debugging){var debug_info=
16
- $(this).data("ai-debug");console.log("AI ad blocking HIDE",typeof debug_info!="undefined"?debug_info:"")}});setTimeout(ai_adb_process_content,10)});if(ai_adb_debugging)console.log("AI ad blocking action check");if(ai_adb_page_views!=0){var ai_adb_page_view_counter=1;var cookie=$.cookie(ai_adb_pgv_cookie_name);if(typeof cookie!="undefined")ai_adb_page_view_counter=parseInt(cookie)+1;if(ai_adb_debugging)console.log("AI ad blocking page views cookie:",cookie,"- page view:",ai_adb_page_view_counter);
17
- if(ai_adb_page_view_counter<ai_adb_page_views){if(ai_adb_debugging)console.log("AI ad blocking",ai_adb_page_views,"page views not reached, no action");var d1=ai_adb_page_view_counter;var AI_ADB_STATUS_MESSAGE=1;$.cookie(ai_adb_pgv_cookie_name,ai_adb_page_view_counter,{expires:365,path:"/"});return}}if(ai_adb_message_cookie_lifetime!=0&&(ai_adb_action!=1||!ai_adb_message_undismissible)){var cookie=$.cookie(ai_adb_act_cookie_name);if(ai_adb_debugging)console.log("AI ad blocking cookie:",cookie);if(typeof cookie!=
18
- "undefined"&&cookie=="AI_CONST_AI_ADB_COOKIE_VALUE"){if(ai_adb_debugging)console.log("AI ad blocking valid cookie detected, no action");var AI_ADB_STATUS_MESSAGE=2;return}else if(ai_adb_debugging)console.log("AI ad blocking invalid cookie");$.cookie(ai_adb_act_cookie_name,"AI_CONST_AI_ADB_COOKIE_VALUE",{expires:ai_adb_message_cookie_lifetime,path:"/"})}else $.removeCookie(ai_adb_act_cookie_name,{path:"/"});if(ai_adb_debugging)console.log("AI ad blocking action",ai_adb_action);var AI_ADB_STATUS_MESSAGE=
19
- 3;switch(ai_adb_action){case 1:if(!ai_adb_message_undismissible){ai_adb_overlay.click(function(){$(this).remove();ai_adb_message_window.remove()}).css("cursor","pointer");ai_adb_message_window.click(function(){$(this).remove();ai_adb_overlay.remove()}).css("cursor","pointer");window.onkeydown=function(event){if(event.keyCode===27){ai_adb_overlay.click();ai_adb_message_window.click()}};if(ai_adb_debugging)console.log("AI ad blocking MESSAGE click detection installed")}else;if(ai_adb_debugging)console.log("AI ad blocking MESSAGE");
20
- $("body").prepend(ai_adb_overlay).prepend(ai_adb_message_window);break;case 2:if(ai_adb_redirection_url!=""){if(ai_adb_debugging)console.log("AI ad blocking REDIRECTION to",ai_adb_redirection_url);var redirect=true;if(ai_adb_redirection_url.toLowerCase().substring(0,4)=="http"){if(window.location.href==ai_adb_redirection_url)var redirect=false}else if(window.location.pathname==ai_adb_redirection_url)var redirect=false;if(redirect){var cookie=$.cookie(ai_adb_page_redirection_cookie_name);if(typeof cookie==
21
- "undefined"){var date=new Date;date.setTime(date.getTime()+10*1E3);$.cookie(ai_adb_page_redirection_cookie_name,window.location.href,{expires:date,path:"/"});window.location.replace(ai_adb_redirection_url)}else if(ai_adb_debugging)console.log("AI ad blocking no redirection, cookie:",cookie)}else{if(ai_adb_debugging)console.log("AI ad blocking already on page",window.location.href);jQuery.removeCookie(ai_adb_page_redirection_cookie_name,{path:"/"})}}break}})(jQuery);ai_adb=true}};
22
- var ai_adb_undetected=function(n){ai_adb_counter++;if(ai_adb_debugging)console.log("AI ad blocking not detected",n,"- counter:",ai_adb_counter);if(!ai_adb_active&&ai_adb_counter==3){if(ai_adb_debugging)console.log("AI ad blocking NOT DETECTED");var AI_ADB_STATUS_MESSAGE=4}};if(AI_DBG_AI_DEBUG_AD_BLOCKING)jQuery(document).ready(function(){ai_adb_detected(0)});
23
  if(!document.getElementById("AI_CONST_AI_ADB_1_NAME"))jQuery(document).ready(function(){if(!ai_adb_active||ai_adb_debugging)ai_adb_detected(1)});else jQuery(document).ready(function(){ai_adb_undetected(1)});if(typeof window.AI_CONST_AI_ADB_2_NAME=="undefined")jQuery(document).ready(function(){if(!ai_adb_active||ai_adb_debugging)ai_adb_detected(2)});else jQuery(document).ready(function(){ai_adb_undetected(2)});
24
  jQuery(document).ready(function($){$(window).ready(function(){$("#ai-adb-bar").click(function(){$.removeCookie(ai_adb_act_cookie_name,{path:"/"});$.removeCookie(ai_adb_pgv_cookie_name,{path:"/"});var AI_ADB_STATUS_MESSAGE=5});if($("#banner-advert-container img").length>0){if($("#banner-advert-container img").outerHeight()===0)$(document).ready(function(){if(!ai_adb_active||ai_adb_debugging)ai_adb_detected(3)});else $(document).ready(function(){ai_adb_undetected(3)});$("#banner-advert-container img").remove()}if((!ai_adb_active||
25
  ai_adb_debugging)&&ai_adb_selectors!=""){var ai_adb_el_counter=0;var ai_adb_el_zero=0;var ai_adb_selector=ai_adb_selectors.split(",");$.each(ai_adb_selector,function(i){if(ai_adb_debugging)console.log("AI ad blocking selector",ai_adb_selector[i]);if($(ai_adb_selector[i]).length!=0)$(ai_adb_selector[i]).each(function(n){if(ai_adb_debugging)console.log('AI ad blocking element id="'+$(this).attr("id")+'" class="'+$(this).attr("class")+'" heights:',$(this).outerHeight(),$(this).innerHeight(),$(this).height());
1
+ /*
2
+ http://www.gnu.org/licenses/gpl.html [GNU General Public License]
3
+ @param {jQuery} {base64Encode:function(input))
4
+ @param {jQuery} {base64Decode:function(input))
5
+ @return string
6
+ jQuery Cookie Plugin v1.4.1
7
+ https://github.com/carhartl/jquery-cookie
8
+
9
+ Copyright 2013 Klaus Hartl
10
+ Released under the MIT license
11
+ */
12
  (function($){var keyString="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var uTF8Encode=function(string){string=string.replace(/\x0d\x0a/g,"\n");var output="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128)output+=String.fromCharCode(c);else if(c>127&&c<2048){output+=String.fromCharCode(c>>6|192);output+=String.fromCharCode(c&63|128)}else{output+=String.fromCharCode(c>>12|224);output+=String.fromCharCode(c>>6&63|128);output+=String.fromCharCode(c&63|128)}}return output};
13
  var uTF8Decode=function(input){var string="";var i=0;var c=c1=c2=0;while(i<input.length){c=input.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++}else if(c>191&&c<224){c2=input.charCodeAt(i+1);string+=String.fromCharCode((c&31)<<6|c2&63);i+=2}else{c2=input.charCodeAt(i+1);c3=input.charCodeAt(i+2);string+=String.fromCharCode((c&15)<<12|(c2&63)<<6|c3&63);i+=3}}return string};$.extend({base64Encode:function(input){var output="";var chr1,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;input=uTF8Encode(input);
14
  while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=(chr1&3)<<4|chr2>>4;enc3=(chr2&15)<<2|chr3>>6;enc4=chr3&63;if(isNaN(chr2))enc3=enc4=64;else if(isNaN(chr3))enc4=64;output=output+keyString.charAt(enc1)+keyString.charAt(enc2)+keyString.charAt(enc3)+keyString.charAt(enc4)}return output},base64Decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/=]/g,"");while(i<
15
+ input.length){enc1=keyString.indexOf(input.charAt(i++));enc2=keyString.indexOf(input.charAt(i++));enc3=keyString.indexOf(input.charAt(i++));enc4=keyString.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64)output=output+String.fromCharCode(chr2);if(enc4!=64)output=output+String.fromCharCode(chr3)}output=uTF8Decode(output);return output}})})(jQuery);var ai_adb=false;var ai_adb_debugging=AI_DATAB_AI_FRONTEND_JS_DEBUGGING;
16
+ var ai_adb_active=false;var ai_adb_counter=0;var ai_adb_overlay=AI_ADB_OVERLAY_WINDOW;var ai_adb_message_window=AI_ADB_MESSAGE_WINDOW;var ai_adb_message_undismissible=AI_FUNCB_GET_UNDISMISSIBLE_MESSAGE;var ai_adb_act_cookie_name="aiADB";var ai_adb_pgv_cookie_name="aiADB_PV";var ai_adb_page_redirection_cookie_name="aiADB_PR";var ai_adb_message_cookie_lifetime=AI_FUNCT_GET_NO_ACTION_PERIOD;var ai_adb_action=AI_FUNC_GET_ADB_ACTION;var ai_adb_page_views=AI_FUNCT_GET_DELAY_ACTION;
17
  var ai_adb_selectors="AI_ADB_SELECTORS";var ai_adb_redirection_url="AI_ADB_REDIRECTION_PAGE";
18
  function ai_adb_process_content(){(function($){if(ai_adb_debugging)console.log("AI ad blocking CONTENT PROCESSING");$(".AI_ADB_CONTENT_CSS_BEGIN_CLASS").each(function(){var ai_adb_parent=$(this).parent();if(ai_adb_debugging)console.log("AI ad blocking parent",ai_adb_parent.prop("tagName"),'id="'+ai_adb_parent.attr("id")+'"','class="'+ai_adb_parent.attr("class")+'"');var ai_adb_css=$(this).data("css");if(typeof ai_adb_css=="undefined")ai_adb_css="display: none !important;";var ai_adb_selectors=$(this).data("selectors");
19
  if(typeof ai_adb_selectors=="undefined"||ai_adb_selectors=="")ai_adb_selectors="p";if(ai_adb_debugging)console.log("AI ad blocking CSS, css='"+ai_adb_css+"'","selectors='"+ai_adb_selectors+"'");var ai_adb_action=false;$(ai_adb_parent).find(".AI_ADB_CONTENT_CSS_BEGIN_CLASS, "+ai_adb_selectors).each(function(){if($(this).hasClass("AI_ADB_CONTENT_CSS_BEGIN_CLASS")){$(this).remove();ai_adb_action=true}else if($(this).hasClass("AI_ADB_CONTENT_CSS_END_CLASS")){$(this).remove();ai_adb_action=false}else if(ai_adb_action){var ai_adb_style=
22
  $(this).parent();if(ai_adb_debugging)console.log("AI ad blocking REPLACE, parent",ai_adb_parent.prop("tagName"),'id="'+ai_adb_parent.attr("id")+'"','class="'+ai_adb_parent.attr("class")+'"');var ai_adb_text=$(this).data("text");if(typeof ai_adb_text=="undefined")ai_adb_text="";var ai_adb_css=$(this).data("css");if(typeof ai_adb_css=="undefined")ai_adb_css="";var ai_adb_selectors=$(this).data("selectors");if(typeof ai_adb_selectors=="undefined"||ai_adb_selectors=="")ai_adb_selectors="p";if(ai_adb_debugging)console.log("AI ad blocking REPLACE, text='"+
23
  ai_adb_text+"'","css='"+ai_adb_css+"'","selectors='"+ai_adb_selectors+"'");var ai_adb_action=false;$(ai_adb_parent).find(".AI_ADB_CONTENT_REPLACE_BEGIN_CLASS, "+ai_adb_selectors).each(function(){if($(this).hasClass("AI_ADB_CONTENT_REPLACE_BEGIN_CLASS")){$(this).remove();ai_adb_action=true}else if($(this).hasClass("AI_ADB_CONTENT_REPLACE_END_CLASS")){$(this).remove();ai_adb_action=false}else if(ai_adb_action){if(ai_adb_text.length!=0){var n=Math.round($(this).text().length/(ai_adb_text.length+1));
24
  $(this).text(Array(n+1).join(ai_adb_text+" "))}else $(this).text("");var ai_adb_style=$(this).attr("style");if(typeof ai_adb_style=="undefined")ai_adb_style="";$(this).attr("style",ai_adb_style+";"+ai_adb_css)}})})})(jQuery)}
25
+ var ai_adb_detected=function(n){if(ai_adb_debugging)console.log("AI ad blocking DETECTED",n);if(!ai_adb_active){ai_adb_active=true;(function($){$(window).ready(function(){if(ai_adb_debugging)console.log("AI ad blocking block actions");$(".ai-adb-hide").each(function(){$(this).css({"display":"none","visibility":"hidden"});var wrapping_div=$(this).closest("div[data-ai]");if(typeof wrapping_div.data("ai")!="undefined"){var data=JSON.parse(atob(wrapping_div.data("ai")));if(typeof data!=="undefined"&&
26
+ data.constructor===Array){data[1]="";wrapping_div.data("ai",btoa(JSON.stringify(data)))}}if(ai_adb_debugging){var debug_info=$(this).data("ai-debug");console.log("AI ad blocking HIDE",typeof debug_info!="undefined"?debug_info:"")}});$(".ai-adb-show").each(function(){$(this).css({"display":"block","visibility":"visible"});var tracking_data=$(this).data("ai-tracking");if(typeof tracking_data!="undefined"){var wrapping_div=$(this).closest("div[data-ai]");if(typeof wrapping_div.data("ai")!="undefined"){if($(this).hasClass("ai-no-tracking")){var data=
27
+ JSON.parse(atob(wrapping_div.data("ai")));if(typeof data!=="undefined"&&data.constructor===Array){data[1]="";tracking_data=btoa(JSON.stringify(data))}}wrapping_div.data("ai",tracking_data)}}if(ai_adb_debugging){var debug_info=$(this).data("ai-debug");console.log("AI ad blocking SHOW",typeof debug_info!="undefined"?debug_info:"")}});setTimeout(ai_adb_process_content,10)});if(ai_adb_debugging)console.log("AI ad blocking action check");if(ai_adb_page_views!=0){var ai_adb_page_view_counter=1;var cookie=
28
+ $.cookie(ai_adb_pgv_cookie_name);if(typeof cookie!="undefined")ai_adb_page_view_counter=parseInt(cookie)+1;if(ai_adb_debugging)console.log("AI ad blocking page views cookie:",cookie,"- page view:",ai_adb_page_view_counter);if(ai_adb_page_view_counter<ai_adb_page_views){if(ai_adb_debugging)console.log("AI ad blocking",ai_adb_page_views,"page views not reached, no action");var d1=ai_adb_page_view_counter;var AI_ADB_STATUS_MESSAGE=1;$.cookie(ai_adb_pgv_cookie_name,ai_adb_page_view_counter,{expires:365,
29
+ path:"/"});return}}if(ai_adb_message_cookie_lifetime!=0&&(ai_adb_action!=1||!ai_adb_message_undismissible)){var cookie=$.cookie(ai_adb_act_cookie_name);if(ai_adb_debugging)console.log("AI ad blocking cookie:",cookie);if(typeof cookie!="undefined"&&cookie=="AI_CONST_AI_ADB_COOKIE_VALUE"){if(ai_adb_debugging)console.log("AI ad blocking valid cookie detected, no action");var AI_ADB_STATUS_MESSAGE=2;return}else if(ai_adb_debugging)console.log("AI ad blocking invalid cookie");$.cookie(ai_adb_act_cookie_name,
30
+ "AI_CONST_AI_ADB_COOKIE_VALUE",{expires:ai_adb_message_cookie_lifetime,path:"/"})}else $.removeCookie(ai_adb_act_cookie_name,{path:"/"});if(ai_adb_debugging)console.log("AI ad blocking action",ai_adb_action);var AI_ADB_STATUS_MESSAGE=3;switch(ai_adb_action){case 1:if(!ai_adb_message_undismissible){ai_adb_overlay.click(function(){$(this).remove();ai_adb_message_window.remove()}).css("cursor","pointer");ai_adb_message_window.click(function(){$(this).remove();ai_adb_overlay.remove()}).css("cursor","pointer");
31
+ window.onkeydown=function(event){if(event.keyCode===27){ai_adb_overlay.click();ai_adb_message_window.click()}};if(ai_adb_debugging)console.log("AI ad blocking MESSAGE click detection installed")}else;if(ai_adb_debugging)console.log("AI ad blocking MESSAGE");$("body").prepend(ai_adb_overlay).prepend(ai_adb_message_window);break;case 2:if(ai_adb_redirection_url!=""){if(ai_adb_debugging)console.log("AI ad blocking REDIRECTION to",ai_adb_redirection_url);var redirect=true;if(ai_adb_redirection_url.toLowerCase().substring(0,
32
+ 4)=="http"){if(window.location.href==ai_adb_redirection_url)var redirect=false}else if(window.location.pathname==ai_adb_redirection_url)var redirect=false;if(redirect){var cookie=$.cookie(ai_adb_page_redirection_cookie_name);if(typeof cookie=="undefined"){var date=new Date;date.setTime(date.getTime()+10*1E3);$.cookie(ai_adb_page_redirection_cookie_name,window.location.href,{expires:date,path:"/"});window.location.replace(ai_adb_redirection_url)}else if(ai_adb_debugging)console.log("AI ad blocking no redirection, cookie:",
33
+ cookie)}else{if(ai_adb_debugging)console.log("AI ad blocking already on page",window.location.href);jQuery.removeCookie(ai_adb_page_redirection_cookie_name,{path:"/"})}}break}})(jQuery);ai_adb=true}};var ai_adb_undetected=function(n){ai_adb_counter++;if(ai_adb_debugging)console.log("AI ad blocking not detected",n,"- counter:",ai_adb_counter);if(!ai_adb_active&&ai_adb_counter==3){if(ai_adb_debugging)console.log("AI ad blocking NOT DETECTED");var AI_ADB_STATUS_MESSAGE=4}};if(AI_DBG_AI_DEBUG_AD_BLOCKING)jQuery(document).ready(function(){ai_adb_detected(0)});
34
  if(!document.getElementById("AI_CONST_AI_ADB_1_NAME"))jQuery(document).ready(function(){if(!ai_adb_active||ai_adb_debugging)ai_adb_detected(1)});else jQuery(document).ready(function(){ai_adb_undetected(1)});if(typeof window.AI_CONST_AI_ADB_2_NAME=="undefined")jQuery(document).ready(function(){if(!ai_adb_active||ai_adb_debugging)ai_adb_detected(2)});else jQuery(document).ready(function(){ai_adb_undetected(2)});
35
  jQuery(document).ready(function($){$(window).ready(function(){$("#ai-adb-bar").click(function(){$.removeCookie(ai_adb_act_cookie_name,{path:"/"});$.removeCookie(ai_adb_pgv_cookie_name,{path:"/"});var AI_ADB_STATUS_MESSAGE=5});if($("#banner-advert-container img").length>0){if($("#banner-advert-container img").outerHeight()===0)$(document).ready(function(){if(!ai_adb_active||ai_adb_debugging)ai_adb_detected(3)});else $(document).ready(function(){ai_adb_undetected(3)});$("#banner-advert-container img").remove()}if((!ai_adb_active||
36
  ai_adb_debugging)&&ai_adb_selectors!=""){var ai_adb_el_counter=0;var ai_adb_el_zero=0;var ai_adb_selector=ai_adb_selectors.split(",");$.each(ai_adb_selector,function(i){if(ai_adb_debugging)console.log("AI ad blocking selector",ai_adb_selector[i]);if($(ai_adb_selector[i]).length!=0)$(ai_adb_selector[i]).each(function(n){if(ai_adb_debugging)console.log('AI ad blocking element id="'+$(this).attr("id")+'" class="'+$(this).attr("class")+'" heights:',$(this).outerHeight(),$(this).innerHeight(),$(this).height());
includes/js/ai-rotate.js CHANGED
@@ -1,5 +1,4 @@
1
  jQuery (function ($) {
2
- var wrapping_div_selector = ".AI_BLOCK_CLASS_NAME";
3
  $("div.ai-rotate").each (function () {
4
  var rotate_options = $(".ai-rotate-option", this);
5
  var random_index = Math.floor (Math.random () * rotate_options.length);
@@ -13,10 +12,11 @@ jQuery (function ($) {
13
  option.css ({"display": "", "visibility": "", "position": "", "width": "", "height": "", "top": "", "left": ""}).removeClass ('ai-rotate-option').removeClass ('ai-rotate-options');
14
  $(this).css ({"position": ""}).removeClass ('ai-rotate');
15
 
16
- var wrapping_div = $(this).closest (wrapping_div_selector);
17
-
18
- if (typeof wrapping_div != "undefined") {
19
- wrapping_div.find ('span.ai-option-name').html (' - ' + atob (option.data ('name')));
 
20
  }
21
 
22
  var tracking_updated = false;
@@ -26,6 +26,7 @@ jQuery (function ($) {
26
  var data = JSON.parse (atob (adb_show_wrapping_div.data ("ai-tracking")));
27
  if (typeof data !== "undefined" && data.constructor === Array) {
28
  data [1] = random_index + 1;
 
29
  adb_show_wrapping_div.data ("ai-tracking", btoa (JSON.stringify (data)))
30
  tracking_updated = true;
31
  }
@@ -33,11 +34,12 @@ jQuery (function ($) {
33
  }
34
 
35
  if (!tracking_updated) {
36
- // var wrapping_div = $(this).closest (wrapping_div_selector);
37
  if (typeof wrapping_div.data ("ai") != "undefined") {
38
  var data = JSON.parse (atob (wrapping_div.data ("ai")));
39
  if (typeof data !== "undefined" && data.constructor === Array) {
40
  data [1] = random_index + 1;
 
41
  wrapping_div.data ("ai", btoa (JSON.stringify (data)))
42
  }
43
  }
1
  jQuery (function ($) {
 
2
  $("div.ai-rotate").each (function () {
3
  var rotate_options = $(".ai-rotate-option", this);
4
  var random_index = Math.floor (Math.random () * rotate_options.length);
12
  option.css ({"display": "", "visibility": "", "position": "", "width": "", "height": "", "top": "", "left": ""}).removeClass ('ai-rotate-option').removeClass ('ai-rotate-options');
13
  $(this).css ({"position": ""}).removeClass ('ai-rotate');
14
 
15
+ var option_name = '';
16
+ var debug_block_frame = $(this).closest ('.ai-debug-block');
17
+ if (typeof debug_block_frame != "undefined") {
18
+ var option_name = atob (option.data ('name'));
19
+ debug_block_frame.find ('span.ai-option-name').html (' - ' + option_name);
20
  }
21
 
22
  var tracking_updated = false;
26
  var data = JSON.parse (atob (adb_show_wrapping_div.data ("ai-tracking")));
27
  if (typeof data !== "undefined" && data.constructor === Array) {
28
  data [1] = random_index + 1;
29
+ data [3] = option_name;
30
  adb_show_wrapping_div.data ("ai-tracking", btoa (JSON.stringify (data)))
31
  tracking_updated = true;
32
  }
34
  }
35
 
36
  if (!tracking_updated) {
37
+ var wrapping_div = $(this).closest ('div[data-ai]');
38
  if (typeof wrapping_div.data ("ai") != "undefined") {
39
  var data = JSON.parse (atob (wrapping_div.data ("ai")));
40
  if (typeof data !== "undefined" && data.constructor === Array) {
41
  data [1] = random_index + 1;
42
+ data [3] = option_name;
43
  wrapping_div.data ("ai", btoa (JSON.stringify (data)))
44
  }
45
  }
includes/js/ai-rotate.min.js CHANGED
@@ -1,3 +1,3 @@
1
- jQuery(function($){var wrapping_div_selector=".AI_BLOCK_CLASS_NAME";$("div.ai-rotate").each(function(){var rotate_options=$(".ai-rotate-option",this);var random_index=Math.floor(Math.random()*rotate_options.length);var d=new Date;var n=d.getMilliseconds();if(n%2)random_index=rotate_options.length-random_index-1;rotate_options.hide();var option=$(rotate_options[random_index]);option.css({"display":"","visibility":"","position":"","width":"","height":"","top":"","left":""}).removeClass("ai-rotate-option").removeClass("ai-rotate-options");
2
- $(this).css({"position":""}).removeClass("ai-rotate");var wrapping_div=$(this).closest(wrapping_div_selector);if(typeof wrapping_div!="undefined")wrapping_div.find("span.ai-option-name").html(" - "+atob(option.data("name")));var tracking_updated=false;var adb_show_wrapping_div=$(this).closest(".ai-adb-show");if(typeof adb_show_wrapping_div!="undefined")if(typeof adb_show_wrapping_div.data("ai-tracking")!="undefined"){var data=JSON.parse(atob(adb_show_wrapping_div.data("ai-tracking")));if(typeof data!==
3
- "undefined"&&data.constructor===Array){data[1]=random_index+1;adb_show_wrapping_div.data("ai-tracking",btoa(JSON.stringify(data)));tracking_updated=true}}if(!tracking_updated)if(typeof wrapping_div.data("ai")!="undefined"){var data=JSON.parse(atob(wrapping_div.data("ai")));if(typeof data!=="undefined"&&data.constructor===Array){data[1]=random_index+1;wrapping_div.data("ai",btoa(JSON.stringify(data)))}}})});
1
+ jQuery(function($){$("div.ai-rotate").each(function(){var rotate_options=$(".ai-rotate-option",this);var random_index=Math.floor(Math.random()*rotate_options.length);var d=new Date;var n=d.getMilliseconds();if(n%2)random_index=rotate_options.length-random_index-1;rotate_options.hide();var option=$(rotate_options[random_index]);option.css({"display":"","visibility":"","position":"","width":"","height":"","top":"","left":""}).removeClass("ai-rotate-option").removeClass("ai-rotate-options");$(this).css({"position":""}).removeClass("ai-rotate");
2
+ var option_name="";var debug_block_frame=$(this).closest(".ai-debug-block");if(typeof debug_block_frame!="undefined"){var option_name=atob(option.data("name"));debug_block_frame.find("span.ai-option-name").html(" - "+option_name)}var tracking_updated=false;var adb_show_wrapping_div=$(this).closest(".ai-adb-show");if(typeof adb_show_wrapping_div!="undefined")if(typeof adb_show_wrapping_div.data("ai-tracking")!="undefined"){var data=JSON.parse(atob(adb_show_wrapping_div.data("ai-tracking")));if(typeof data!==
3
+ "undefined"&&data.constructor===Array){data[1]=random_index+1;data[3]=option_name;adb_show_wrapping_div.data("ai-tracking",btoa(JSON.stringify(data)));tracking_updated=true}}if(!tracking_updated){var wrapping_div=$(this).closest("div[data-ai]");if(typeof wrapping_div.data("ai")!="undefined"){var data=JSON.parse(atob(wrapping_div.data("ai")));if(typeof data!=="undefined"&&data.constructor===Array){data[1]=random_index+1;data[3]=option_name;wrapping_div.data("ai",btoa(JSON.stringify(data)))}}}})});
includes/placeholders.php ADDED
@@ -0,0 +1,421 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ //ini_set ('display_errors', 1);
4
+ //error_reporting (E_ALL);
5
+
6
+ function generate_placeholder_editor ($placeholder_url, $block) {
7
+
8
+ $base_placeholder_url = 'http://via.placeholder.com/';
9
+
10
+ $standard_placeholders = array (
11
+ 'Custom',
12
+ '300x250',
13
+ '336x280',
14
+ '728x90',
15
+ '468x60',
16
+ '250x250',
17
+ '300x600',
18
+ '120x600',
19
+ '160x600',
20
+ );
21
+
22
+ $default_placeholder_size = '300x250';
23
+ $default_placeholder_background_color = 'cccccc';
24
+ $default_placeholder_text_color = '969696';
25
+
26
+ $initial_placeholder_size = $default_placeholder_size;
27
+ $initial_placeholder_width = '';
28
+ $initial_placeholder_height = '';
29
+ $initial_placeholder_background_color = $default_placeholder_background_color;
30
+ $initial_placeholder_text_color = $default_placeholder_text_color;
31
+ $initial_placeholder_text = $default_placeholder_size;
32
+ $initial_placeholder_url = $base_placeholder_url . $initial_placeholder_size;
33
+
34
+ $parameters = array ();
35
+ if (strpos ($placeholder_url, $base_placeholder_url) === 0) {
36
+ $initial_placeholder_url = $placeholder_url;
37
+ $url = str_replace ($base_placeholder_url, '', $placeholder_url);
38
+
39
+ $query = '';
40
+ if (strpos ($url, '?') !== false) {
41
+ $query_array = explode ("?", $url);
42
+ $url = $query_array [0];
43
+ $query = $query_array [1];
44
+ }
45
+
46
+ if (strpos ($url, '.') !== false) {
47
+ $url_array = explode (".", $url);
48
+ $url = $url_array [0];
49
+ }
50
+
51
+ $parameters = explode ("/", $url);
52
+
53
+ if (isset ($parameters [0])) {
54
+ $import_error = true;
55
+ if (is_int ($parameters [0])) {
56
+ $placeholder_size = $parameters [0] . 'x' . $parameters [0];
57
+ $initial_placeholder_text = $parameters [0] . ' x ' . $parameters [0];
58
+ $import_error = false;
59
+ } elseif (strpos ($parameters [0], 'x') !== false) {
60
+ $size_array = explode ("x", $parameters [0]);
61
+ if (is_numeric ($size_array [0]) && $size_array [0] > 0 && is_numeric ($size_array [1]) && $size_array [1] > 1) {
62
+ $placeholder_size = $parameters [0];
63
+ $initial_placeholder_width = $size_array [0];
64
+ $initial_placeholder_height = $size_array [1];
65
+ $initial_placeholder_text = $placeholder_size;
66
+ $import_error = false;
67
+ }
68
+ }
69
+ if (!$import_error) {
70
+ $initial_placeholder_size = $placeholder_size;
71
+ }
72
+ }
73
+
74
+ if (isset ($parameters [1])) {
75
+ $initial_placeholder_background_color = $parameters [1];
76
+
77
+ if (isset ($parameters [2])) {
78
+ $initial_placeholder_text_color = $parameters [2];
79
+ }
80
+ }
81
+
82
+ if (strpos ($query, 'text=') === 0) {
83
+ $initial_placeholder_text = trim (str_replace (array ('"', "\\'"), array ('&quot', '&#039'), urldecode (str_replace ('text=', '', $query))));
84
+ }
85
+
86
+ }
87
+
88
+ $placeholder_selection = array_search ($initial_placeholder_size, $standard_placeholders);
89
+ if (count ($parameters) == 0) $placeholder_selection = 1;
90
+ elseif (($placeholder_selection) === false || count ($parameters) != 1) $placeholder_selection = 0;
91
+
92
+ ?><html>
93
+ <head>
94
+ <title><?php echo AD_INSERTER_NAME; ?> Placeholder Editor</title>
95
+ <meta name="viewport" content="width=device-width,initial-scale=1.0">
96
+ <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
97
+ <script src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js'></script>
98
+ <script src='<?php echo plugins_url ('includes/colorpicker/js/bootstrap-colorpicker.min.js', AD_INSERTER_FILE); ?>'></script>
99
+ <link rel='stylesheet' href='https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css'>
100
+ <link rel="stylesheet" href='<?php echo plugins_url ('includes/colorpicker/css/bootstrap-colorpicker.min.css', AD_INSERTER_FILE); ?>'>
101
+ <script>
102
+
103
+ window.onkeydown = function( event ) {
104
+ if (event.keyCode === 27 ) {
105
+ window.close();
106
+ }
107
+ }
108
+
109
+ jQuery(document).ready(function($) {
110
+ var block = <?php echo $block; ?>;
111
+ var base_placeholder_url = '<?php echo $base_placeholder_url; ?>';
112
+
113
+ var default_placeholder_text_color = '<?php echo $default_placeholder_text_color; ?>';
114
+ var default_placeholder_background_color = '<?php echo $default_placeholder_background_color; ?>';
115
+
116
+ var placeholder_size = '<?php echo $initial_placeholder_size; ?>';
117
+ var placeholder_text_color = '<?php echo $initial_placeholder_text_color; ?>';
118
+ var placeholder_background_color = '<?php echo $initial_placeholder_background_color; ?>';
119
+ var placeholder_text = "?php echo $initial_placeholder_text; ?>";
120
+ var placeholder_url = '';
121
+
122
+ var placeholder_width = 1;
123
+ var placeholder_height = 1;
124
+
125
+ function load_from_settings () {
126
+
127
+ if (window.opener != null && !window.opener.closed) {
128
+ var settings = $(window.opener.document).contents();
129
+
130
+ $("select#block-alignment").val (settings.find ("select#block-alignment-" + block + " option:selected").attr('value')).change();
131
+ $("select#block-alignment option:selected").data ('alt-style', '1');
132
+ $("#custom-css").val (settings.find ("#custom-css-" + block).val ());
133
+ $("#block-name").text (settings.find ("#name-label-" + block).text ());
134
+
135
+ process_display_elements ();
136
+ }
137
+ }
138
+
139
+ function apply_to_settings () {
140
+ if (window.opener != null && !window.opener.closed) {
141
+ var settings = $(window.opener.document).contents ();
142
+
143
+ settings.find ('#banner-image-url-' + block).val (placeholder_url).trigger ("input");
144
+
145
+ window.opener.change_banner_image (block);
146
+ }
147
+ }
148
+
149
+ function set_placeholder_data () {
150
+ var selected_size = $("select#placeholder-size option:selected").attr('value');
151
+
152
+ if (selected_size != 0) {
153
+ placeholder_size = $("select#placeholder-size option:selected").text ();
154
+ placeholder_background_color = '<?php echo $default_placeholder_background_color; ?>';
155
+ placeholder_text_color = '<?php echo $default_placeholder_text_color; ?>';
156
+
157
+ var sizes = placeholder_size.split ("x");
158
+ placeholder_width = sizes [0];
159
+ placeholder_height = sizes [1];
160
+
161
+ placeholder_text = placeholder_width + ' x ' + placeholder_height;
162
+
163
+ placeholder_url = base_placeholder_url + placeholder_size + '.png';
164
+ } else {
165
+ placeholder_width = parseInt ($("input#width").val ());
166
+ if (isNaN (placeholder_width) || placeholder_width < 1) placeholder_width = 1;
167
+ if (placeholder_width > 3000) placeholder_width = 3000
168
+
169
+ placeholder_height = parseInt ($("input#height").val ());
170
+ if (isNaN (placeholder_height) || placeholder_height < 1) placeholder_height = 1;
171
+ if (placeholder_height > 3000) placeholder_height = 3000
172
+
173
+ placeholder_size = placeholder_width + 'x' + placeholder_height;
174
+ placeholder_background_color = $("input#background").val ().trim ().replace ('#', '');
175
+ placeholder_text_color = $("input#text-color").val ().trim ().replace ('#', '');
176
+ placeholder_text = $("input#text").val ().trim();
177
+
178
+ if (placeholder_text == '') placeholder_text = ' ';
179
+
180
+ placeholder_url = base_placeholder_url + placeholder_size;
181
+
182
+ if (placeholder_background_color != '') {
183
+ placeholder_url = placeholder_url + '/' + placeholder_background_color;
184
+
185
+ if (placeholder_text_color != '') {
186
+ placeholder_url = placeholder_url + '/' + placeholder_text_color;
187
+ }
188
+ }
189
+
190
+ placeholder_url = placeholder_url + '.png';
191
+
192
+ if (placeholder_text != placeholder_size) {
193
+ placeholder_url = placeholder_url + '?text=' + encodeURIComponent (placeholder_text);
194
+ }
195
+ }
196
+ }
197
+
198
+ function update_placeholder () {
199
+ set_placeholder_data ();
200
+
201
+ $("span#placeholder-name").text (placeholder_size, placeholder_text_color, placeholder_text);
202
+
203
+ $("img#placeholder").attr ('src', placeholder_url);
204
+ }
205
+
206
+ $("button#use-button").button ({
207
+ }).click (function () {
208
+ apply_to_settings ();
209
+ window.close();
210
+ });
211
+
212
+ $("button#edit-button").button ({
213
+ }).click (function () {
214
+ var selected_size = $("select#placeholder-size option:selected").attr('value');
215
+
216
+ if (selected_size != 0) {
217
+ $("input#width").val (placeholder_width);
218
+ $("input#height").val (placeholder_height);
219
+ $("input#background").val ('#' + placeholder_background_color).colorpicker('setValue', '#cccccd');
220
+ $("input#text-color").val ('#' + placeholder_text_color).colorpicker ('setValue', '#969697');
221
+ $("input#text").val (placeholder_text);
222
+
223
+ $("select#placeholder-size").val (0).change ();
224
+ }
225
+ });
226
+
227
+ $("button#cancel-button").button ({
228
+ }).click (function () {
229
+ window.close();
230
+ });
231
+
232
+ $("select#placeholder-size").change (function() {
233
+ var selected_size = $("select#placeholder-size option:selected").attr('value');
234
+
235
+ if (selected_size == 0) {
236
+ var sizes = placeholder_size.split ("x");
237
+ $("input#width").val (sizes [0]);
238
+ $("input#height").val (sizes [1]);
239
+ $('div.custom-placeholder-parameters').show ();
240
+ } else $('div.custom-placeholder-parameters').hide ();
241
+
242
+ update_placeholder ();
243
+ });
244
+
245
+ $("input#width").on ('input', function() {
246
+ update_placeholder ();
247
+ });
248
+
249
+ $("input#height").on ('input', function() {
250
+ update_placeholder ();
251
+ });
252
+
253
+ $("input#background").colorpicker ().on('colorpickerChange colorpickerCreate colorpickerUpdate', function (e) {
254
+ update_placeholder ();
255
+ }).on ('input', function() {
256
+ update_placeholder ();
257
+ });
258
+
259
+ $("input#text-color").colorpicker ().on('colorpickerChange colorpickerCreate colorpickerUpdate', function (e) {
260
+ update_placeholder ();
261
+ }).on ('input', function() {
262
+ update_placeholder ();
263
+ });
264
+
265
+ $("input#text").on ('input', function() {
266
+ update_placeholder ();
267
+ });
268
+
269
+ update_placeholder ();
270
+ });
271
+
272
+ </script>
273
+ <style>
274
+
275
+ a, img {
276
+ border: 0;
277
+ font: inherit;
278
+ font-size: 100%;
279
+ font-style: inherit;
280
+ font-weight: inherit;
281
+ margin: 0;
282
+ outline: 0;
283
+ padding: 0;
284
+ vertical-align: baseline;
285
+ }
286
+
287
+ select, input {
288
+ border-radius: 5px;
289
+ padding: 2px 3px;
290
+ }
291
+
292
+ div#placeholder-parameters {
293
+ margin: 10px 0;
294
+ /* width: 620px;*/
295
+ }
296
+
297
+ img#placeholder {
298
+ float: left;
299
+ margin: 0 8px 8px 0;
300
+ }
301
+ .custom-parameters-right {
302
+ float: right;
303
+ margin: 10px 0;
304
+ }
305
+ .float-left {
306
+ float: left;
307
+ }
308
+
309
+ .float-right {
310
+ float: right;
311
+ margin-left: 10px;
312
+ }
313
+
314
+ @media(max-width: 650px) {
315
+ .float-left {
316
+ clear: both;
317
+ float: none;
318
+ margin: 10px 0;
319
+ }
320
+ .float-right {
321
+ clear: both;
322
+ float: none;
323
+ margin: 10px 0;
324
+ }
325
+ .custom-parameters-right {
326
+ clear: both;
327
+ float: none;
328
+ margin: 10px 0;
329
+ }
330
+ }
331
+ </style>
332
+ </head>
333
+ <body style='font-family: arial; text-align: justify; overflow-x: hidden;'>
334
+ <div id="ai-data" style="display: none;" version="<?php echo AD_INSERTER_VERSION; ?>"></div>
335
+
336
+ <div style="float: right; width: 90px; margin-left: 20px;">
337
+ <button id="use-button" type="button" style="margin: 0 0 10px 0; font-size: 12px; width: 90px; height: 35px; float: right;" title="Select placeholder" >Use</button>
338
+ <button id="edit-button" type="button" style="margin: 0 0 10px 0; font-size: 12px; width: 90px; height: 35px; float: right;" title="Edit placeholder size, colors and text">Edit</button>
339
+ <button id="cancel-button" type="button" style="margin: 0 0 10px 0; font-size: 12px; width: 90px; height: 35px; float: right;" title="Close placeholder editor" >Cancel</button>
340
+ </div>
341
+
342
+ <div style="float: left; margin-right: 20px">
343
+ <h1 style="margin: 0;">Placeholder <span id="placeholder-name"><?php echo $initial_placeholder_size; ?></span></h1>
344
+
345
+ <div id="placeholder-parameters">
346
+
347
+ <div style="float: left; display: inline-block; margin: 10px 0;">
348
+ Size
349
+ <select id="placeholder-size" style="width: 80px; margin-right: 10px;" tabindex="1">
350
+
351
+ <?php
352
+ foreach ($standard_placeholders as $index => $standard_placeholder) {
353
+ ?>
354
+ <option value="<?php echo $index; ?>" <?php echo $index == $placeholder_selection ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo $standard_placeholder; ?></option>
355
+ <?php
356
+ }
357
+ ?>
358
+
359
+ </select>
360
+ </div>
361
+
362
+ <div class="custom-placeholder-parameters custom-parameters-right" style="<?php echo $placeholder_selection == 0 ? '' : 'display: none;'; ?>">
363
+ <div class="float-right">
364
+ Background color
365
+ <input id="background" type="text" value="<?php echo $initial_placeholder_background_color; ?>" size="7" maxlength="7" tabindex="4" />
366
+ </div>
367
+
368
+ <div class="float-right">
369
+ Height
370
+ <input id="height" type="text" value="<?php echo $initial_placeholder_height; ?>" size="4" maxlength="4" tabindex="3" />
371
+ </div>
372
+
373
+ <div class="float-right">
374
+ Width
375
+ <input id="width" type="text" value="<?php echo $initial_placeholder_width; ?>" size="4" maxlength="4" tabindex="2" />
376
+ </div>
377
+ </div>
378
+
379
+ <div style="clear: both;"></div>
380
+
381
+ <div class="custom-placeholder-parameters" style="margin: 10px 0;<?php echo $placeholder_selection == 0 ? '' : ' display: none;'; ?>">
382
+ <div class="float-left">
383
+ Text
384
+ <input id="text" style="width: 215px;" type="text" value="<?php echo $initial_placeholder_text; ?>" size="30" maxlength="40" tabindex="5" />
385
+ </div>
386
+
387
+ <div class="float-right">
388
+ Text color
389
+ <input id="text-color" type="text" value="<?php echo $initial_placeholder_text_color; ?>" size="7" maxlength="7" tabindex="6" />
390
+ </div>
391
+ </div>
392
+ </div>
393
+
394
+ </div>
395
+
396
+ <div style="clear: both;"></div>
397
+
398
+ <p id="p1">Here you can create a universal placeholder image that can be used in place of ads when they are not available yet.
399
+ Placeholder images created here will behave as any other image. You can also save them to local computer or server.</p>
400
+
401
+ <img id="placeholder" src="<?php echo $initial_placeholder_url; ?>" />
402
+
403
+ <p id="p2">Choose between common ad sizes 300x250, 336x280, 728x90, 468x60, 250x250, 300x600 or define custom size. Default placeholders
404
+ are gray with size as placeholder text but you can use any color or text you want. Click on <strong>Edit</strong> button
405
+ to edit placeholder size, color or text. You can also create blank solid color rectangles by clearing placeholder text.</p>
406
+
407
+ <p id="p3"><strong>Please note</strong>: if you have active rotation editor the code window shows only the code for the currently selected option.
408
+ Therefore, code generator will in such case import or generate code for the currently selected option.</p>
409
+
410
+ <p id="p4">Code generator for banners and AdSense generates the code only when you click on the button Generate code.
411
+ It is a tool that can help you to create code for AdSense or banners with links. So if you are using rotation editor and switch between options,
412
+ you need to (optionally) import and generate code for each rotation option.</p>
413
+
414
+ <p id="p5">Ad Inserter has a simple code generator for banners and placeholders. You can select banner image (or placeholder),
415
+ optionally define link (web page address that will open when the banner will be clicked) and select whether to open link in a new tab.</p>
416
+
417
+ </body>
418
+ </html>
419
+ <?php
420
+ }
421
+
preview-adb.php → includes/preview-adb.php RENAMED
@@ -34,7 +34,7 @@ function generate_code_preview_adb ($client_code = null, $process_php = null) {
34
  // $adb_message = $obj->get_ad_data();
35
  $adb_message = $obj->ai_getCode ($client_code, $process_php);
36
 
37
- wp_enqueue_script ('ai-adb-js', plugins_url ('includes/js/ad-inserter-check.js', __FILE__), array (
38
  'jquery',
39
  'jquery-ui-tabs',
40
  'jquery-ui-button',
@@ -43,7 +43,7 @@ function generate_code_preview_adb ($client_code = null, $process_php = null) {
43
  'jquery-ui-dialog',
44
  ), AD_INSERTER_VERSION);
45
 
46
- wp_enqueue_style ('ai-adb-css', plugins_url ('css/ad-inserter.css', __FILE__), array (), AD_INSERTER_VERSION);
47
 
48
  add_action ('media_buttons', 'ai_media_buttons');
49
 
@@ -285,7 +285,7 @@ function generate_code_preview_adb ($client_code = null, $process_php = null) {
285
 
286
  function initialize_preview () {
287
 
288
- var debug = <?php echo get_javascript_debugging () ? 'true' : 'false'; ?>;
289
 
290
  function load_from_settings () {
291
 
34
  // $adb_message = $obj->get_ad_data();
35
  $adb_message = $obj->ai_getCode ($client_code, $process_php);
36
 
37
+ wp_enqueue_script ('ai-adb-js', plugins_url ('includes/js/ad-inserter-check.js', AD_INSERTER_FILE), array (
38
  'jquery',
39
  'jquery-ui-tabs',
40
  'jquery-ui-button',
43
  'jquery-ui-dialog',
44
  ), AD_INSERTER_VERSION);
45
 
46
+ wp_enqueue_style ('ai-adb-css', plugins_url ('css/ad-inserter.css', AD_INSERTER_FILE), array (), AD_INSERTER_VERSION);
47
 
48
  add_action ('media_buttons', 'ai_media_buttons');
49
 
285
 
286
  function initialize_preview () {
287
 
288
+ var debug = <?php echo get_backend_javascript_debugging () ? 'true' : 'false'; ?>;
289
 
290
  function load_from_settings () {
291
 
preview.php → includes/preview.php RENAMED
@@ -28,6 +28,9 @@ function generate_code_preview ($block, $name = null, $alignment = null, $alignm
28
  ai_wp_head_hook ();
29
  $head_code = ob_get_clean ();
30
 
 
 
 
31
  // $block_code = $obj->ai_getProcessedCode (true, true);
32
  $block_code = $obj->ai_getProcessedCode (true, true, $client_code, $process_php);
33
 
@@ -37,7 +40,6 @@ function generate_code_preview ($block, $name = null, $alignment = null, $alignm
37
  $block_code = str_replace ('href="wp-content', 'href="../wp-content', $block_code);
38
  $block_code = str_replace ("href='wp-content", "href='../wp-content", $block_code);
39
 
40
-
41
  ?><html>
42
  <head>
43
  <title><?php echo AD_INSERTER_NAME; ?> Code Preview</title>
@@ -45,13 +47,13 @@ function generate_code_preview ($block, $name = null, $alignment = null, $alignm
45
  <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
46
  <script src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js'></script>
47
  <link rel='stylesheet' href='https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css'>
48
- <script src='<?php echo plugins_url ('includes/js/jquery.mousewheel.min.js', __FILE__); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'></script>
49
- <script src='<?php echo plugins_url ('includes/js/jquery.ui.spinner.js', __FILE__); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'></script>
50
- <link rel='stylesheet' href='<?php echo plugins_url ('css/jquery.ui.spinner.css', __FILE__); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'>
51
- <link rel='stylesheet' href='<?php echo plugins_url ('css/image-picker.css', __FILE__); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'>
52
- <script src='<?php echo plugins_url ('includes/js/image-picker.js', __FILE__); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'></script>
53
- <script src='<?php echo plugins_url ('includes/js/ad-inserter-check.js', __FILE__); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'></script>
54
- <link rel='stylesheet' href='<?php echo plugins_url ('css/ad-inserter.css', __FILE__); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'>
55
  <script>
56
 
57
  // initialize_preview ();
@@ -64,7 +66,7 @@ function generate_code_preview ($block, $name = null, $alignment = null, $alignm
64
 
65
  function initialize_preview () {
66
 
67
- var debug = <?php echo get_javascript_debugging () ? 'true' : 'false'; ?>;
68
  var block = <?php echo $block; ?>;
69
  var code_blocks;
70
  var spinning = false;
@@ -1001,15 +1003,15 @@ div.automatic-insertion img {
1001
  <div style="margin: 20px 0 0 0;">
1002
  Alignment and Style:&nbsp;&nbsp;&nbsp;
1003
  <select id="block-alignment" style="border-radius: 5px; width:120px;">
1004
- <option data-img-src="<?php echo plugins_url ('css/images/blank.png', __FILE__); ?>" data-img-class="automatic-insertion preview default" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_DEFAULT, true)); ?> value="<?php echo AI_ALIGNMENT_DEFAULT; ?>" data-title="<?php echo AI_TEXT_DEFAULT; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_DEFAULT) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_DEFAULT; ?></option>
1005
- <option data-img-src="<?php echo plugins_url ('css/images/blank.png', __FILE__); ?>" data-img-class="automatic-insertion preview align-left" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_LEFT, true)); ?> value="<?php echo AI_ALIGNMENT_LEFT; ?>" data-title="<?php echo AI_TEXT_LEFT; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_LEFT) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_LEFT; ?></option>
1006
- <option data-img-src="<?php echo plugins_url ('css/images/blank.png', __FILE__); ?>" data-img-class="automatic-insertion preview center" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_CENTER, true)); ?> value="<?php echo AI_ALIGNMENT_CENTER; ?>" data-title="<?php echo AI_TEXT_CENTER; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_CENTER) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_CENTER; ?></option>
1007
- <option data-img-src="<?php echo plugins_url ('css/images/blank.png', __FILE__); ?>" data-img-class="automatic-insertion preview align-right" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_RIGHT, true)); ?> value="<?php echo AI_ALIGNMENT_RIGHT; ?>" data-title="<?php echo AI_TEXT_RIGHT; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_RIGHT) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_RIGHT; ?></option>
1008
- <option data-img-src="<?php echo plugins_url ('css/images/blank.png', __FILE__); ?>" data-img-class="automatic-insertion preview float-left" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_FLOAT_LEFT, true)); ?> value="<?php echo AI_ALIGNMENT_FLOAT_LEFT; ?>" data-title="<?php echo AI_TEXT_FLOAT_LEFT; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_FLOAT_LEFT) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_FLOAT_LEFT; ?></option>
1009
- <option data-img-src="<?php echo plugins_url ('css/images/blank.png', __FILE__); ?>" data-img-class="automatic-insertion preview float-right" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_FLOAT_RIGHT, true)); ?> value="<?php echo AI_ALIGNMENT_FLOAT_RIGHT; ?>" data-title="<?php echo AI_TEXT_FLOAT_RIGHT; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_FLOAT_RIGHT) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_FLOAT_RIGHT; ?></option>
1010
  <?php if (function_exists ('ai_preview_style_options')) ai_preview_style_options ($obj, $alignment_type); ?>
1011
- <option data-img-src="<?php echo plugins_url ('css/images/blank.png', __FILE__); ?>" data-img-class="automatic-insertion preview custom-css" value="<?php echo AI_ALIGNMENT_CUSTOM_CSS; ?>" data-title="<?php echo AI_TEXT_CUSTOM_CSS; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_CUSTOM_CSS) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_CUSTOM_CSS; ?></option>
1012
- <option data-img-src="<?php echo plugins_url ('css/images/blank.png', __FILE__); ?>" data-img-class="automatic-insertion preview no-wrapping" value="<?php echo AI_ALIGNMENT_NO_WRAPPING; ?>" data-title="<?php echo AI_TEXT_NO_WRAPPING; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_NO_WRAPPING) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_NO_WRAPPING; ?></option>
1013
  </select>
1014
  <span id="css-index" style="margin: 0 0 0 10px; font-size: 14px;" title="CSS code index"></span>
1015
  </div>
@@ -1022,7 +1024,7 @@ div.automatic-insertion img {
1022
  <span id="css-label" style="vertical-align: middle; margin: 4px 0 0 0 0; width: 36px; font-size: 14px; font-weight: bold; display: none;">CSS</span>
1023
  </td>
1024
  <td style="width: 100%; height: 32px; padding:0;">
1025
- <input id="custom-css" style="width: 100%; display: inline-block; padding: 5px 0 0 0; border-radius: 4px; display: none; font-size: 12px; font-family: Courier, 'Courier New', monospace; font-weight: bold;" type="text" value="<?php echo $custom_css_code; ?>" size="70" maxlength="160" title="Custom CSS code for wrapping div" />
1026
  <span style="width: 100%; display: inline-block; padding: 5px 0 0 2px; font-family: Courier, 'Courier New', monospace; font-size: 12px; font-weight: bold; cursor: pointer;">
1027
  <span id="css-no-wrapping" style="vertical-align: middle; display: none;"></span>
1028
  <span id="css-<?php echo AI_ALIGNMENT_DEFAULT; ?>" class="css-code" style="vertical-align: middle; display: none;" title="CSS code for wrapping div, click to edit"><?php echo $obj->alignment_style (AI_ALIGNMENT_DEFAULT); ?></span>
28
  ai_wp_head_hook ();
29
  $head_code = ob_get_clean ();
30
 
31
+ // Disable AdSense Auto ads (page level ads)
32
+ $head_code = str_replace ('enable_page_level_ads', 'disabled_page_level_ads', $head_code);
33
+
34
  // $block_code = $obj->ai_getProcessedCode (true, true);
35
  $block_code = $obj->ai_getProcessedCode (true, true, $client_code, $process_php);
36
 
40
  $block_code = str_replace ('href="wp-content', 'href="../wp-content', $block_code);
41
  $block_code = str_replace ("href='wp-content", "href='../wp-content", $block_code);
42
 
 
43
  ?><html>
44
  <head>
45
  <title><?php echo AD_INSERTER_NAME; ?> Code Preview</title>
47
  <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
48
  <script src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js'></script>
49
  <link rel='stylesheet' href='https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css'>
50
+ <script src='<?php echo plugins_url ('includes/js/jquery.mousewheel.min.js', AD_INSERTER_FILE); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'></script>
51
+ <script src='<?php echo plugins_url ('includes/js/jquery.ui.spinner.js', AD_INSERTER_FILE); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'></script>
52
+ <link rel='stylesheet' href='<?php echo plugins_url ('css/jquery.ui.spinner.css', AD_INSERTER_FILE); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'>
53
+ <link rel='stylesheet' href='<?php echo plugins_url ('css/image-picker.css', AD_INSERTER_FILE); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'>
54
+ <script src='<?php echo plugins_url ('includes/js/image-picker.js', AD_INSERTER_FILE); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'></script>
55
+ <script src='<?php echo plugins_url ('includes/js/ad-inserter-check.js', AD_INSERTER_FILE); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'></script>
56
+ <link rel='stylesheet' href='<?php echo plugins_url ('css/ad-inserter.css', AD_INSERTER_FILE); ?>?ver=<?php echo AD_INSERTER_VERSION; ?>'>
57
  <script>
58
 
59
  // initialize_preview ();
66
 
67
  function initialize_preview () {
68
 
69
+ var debug = <?php echo get_backend_javascript_debugging () ? 'true' : 'false'; ?>;
70
  var block = <?php echo $block; ?>;
71
  var code_blocks;
72
  var spinning = false;
1003
  <div style="margin: 20px 0 0 0;">
1004
  Alignment and Style:&nbsp;&nbsp;&nbsp;
1005
  <select id="block-alignment" style="border-radius: 5px; width:120px;">
1006
+ <option data-img-src="<?php echo plugins_url ('css/images/blank.png', AD_INSERTER_FILE); ?>" data-img-class="automatic-insertion preview default" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_DEFAULT, true)); ?> value="<?php echo AI_ALIGNMENT_DEFAULT; ?>" data-title="<?php echo AI_TEXT_DEFAULT; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_DEFAULT) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_DEFAULT; ?></option>
1007
+ <option data-img-src="<?php echo plugins_url ('css/images/blank.png', AD_INSERTER_FILE); ?>" data-img-class="automatic-insertion preview align-left" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_LEFT, true)); ?> value="<?php echo AI_ALIGNMENT_LEFT; ?>" data-title="<?php echo AI_TEXT_LEFT; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_LEFT) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_LEFT; ?></option>
1008
+ <option data-img-src="<?php echo plugins_url ('css/images/blank.png', AD_INSERTER_FILE); ?>" data-img-class="automatic-insertion preview center" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_CENTER, true)); ?> value="<?php echo AI_ALIGNMENT_CENTER; ?>" data-title="<?php echo AI_TEXT_CENTER; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_CENTER) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_CENTER; ?></option>
1009
+ <option data-img-src="<?php echo plugins_url ('css/images/blank.png', AD_INSERTER_FILE); ?>" data-img-class="automatic-insertion preview align-right" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_RIGHT, true)); ?> value="<?php echo AI_ALIGNMENT_RIGHT; ?>" data-title="<?php echo AI_TEXT_RIGHT; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_RIGHT) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_RIGHT; ?></option>
1010
+ <option data-img-src="<?php echo plugins_url ('css/images/blank.png', AD_INSERTER_FILE); ?>" data-img-class="automatic-insertion preview float-left" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_FLOAT_LEFT, true)); ?> value="<?php echo AI_ALIGNMENT_FLOAT_LEFT; ?>" data-title="<?php echo AI_TEXT_FLOAT_LEFT; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_FLOAT_LEFT) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_FLOAT_LEFT; ?></option>
1011
+ <option data-img-src="<?php echo plugins_url ('css/images/blank.png', AD_INSERTER_FILE); ?>" data-img-class="automatic-insertion preview float-right" <?php alt_styles_data ($obj->alignment_style (AI_ALIGNMENT_FLOAT_RIGHT, true)); ?> value="<?php echo AI_ALIGNMENT_FLOAT_RIGHT; ?>" data-title="<?php echo AI_TEXT_FLOAT_RIGHT; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_FLOAT_RIGHT) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_FLOAT_RIGHT; ?></option>
1012
  <?php if (function_exists ('ai_preview_style_options')) ai_preview_style_options ($obj, $alignment_type); ?>
1013
+ <option data-img-src="<?php echo plugins_url ('css/images/blank.png', AD_INSERTER_FILE); ?>" data-img-class="automatic-insertion preview custom-css" value="<?php echo AI_ALIGNMENT_CUSTOM_CSS; ?>" data-title="<?php echo AI_TEXT_CUSTOM_CSS; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_CUSTOM_CSS) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_CUSTOM_CSS; ?></option>
1014
+ <option data-img-src="<?php echo plugins_url ('css/images/blank.png', AD_INSERTER_FILE); ?>" data-img-class="automatic-insertion preview no-wrapping" value="<?php echo AI_ALIGNMENT_NO_WRAPPING; ?>" data-title="<?php echo AI_TEXT_NO_WRAPPING; ?>" <?php echo ($alignment_type == AI_ALIGNMENT_NO_WRAPPING) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_NO_WRAPPING; ?></option>
1015
  </select>
1016
  <span id="css-index" style="margin: 0 0 0 10px; font-size: 14px;" title="CSS code index"></span>
1017
  </div>
1024
  <span id="css-label" style="vertical-align: middle; margin: 4px 0 0 0 0; width: 36px; font-size: 14px; font-weight: bold; display: none;">CSS</span>
1025
  </td>
1026
  <td style="width: 100%; height: 32px; padding:0;">
1027
+ <input id="custom-css" style="width: 100%; display: inline-block; padding: 5px 0 0 3px; border-radius: 4px; display: none; font-size: 12px; font-family: Courier, 'Courier New', monospace; font-weight: bold;" type="text" value="<?php echo $custom_css_code; ?>" size="70" maxlength="160" title="Custom CSS code for wrapping div" />
1028
  <span style="width: 100%; display: inline-block; padding: 5px 0 0 2px; font-family: Courier, 'Courier New', monospace; font-size: 12px; font-weight: bold; cursor: pointer;">
1029
  <span id="css-no-wrapping" style="vertical-align: middle; display: none;"></span>
1030
  <span id="css-<?php echo AI_ALIGNMENT_DEFAULT; ?>" class="css-code" style="vertical-align: middle; display: none;" title="CSS code for wrapping div, click to edit"><?php echo $obj->alignment_style (AI_ALIGNMENT_DEFAULT); ?></span>
js/ad-inserter.js CHANGED
@@ -1,4 +1,4 @@
1
- var javascript_version = "2.2.13";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
@@ -254,12 +254,28 @@ function SyntaxHighlight (id, block, settings) {
254
  if (!editor_disabled) {
255
  textarea.val (session.getValue());
256
  }
257
- if (textarea.val () == "") {
258
- textarea.removeAttr ("name");
259
- }
260
 
 
 
 
261
  // else textarea.val (jQuery.base64Encode (textarea.val ()));
262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  jQuery("#ai-active-tab").attr ("value", '[' + active_tab + ',' + active_tab_0 + ']');
264
  });
265
 
@@ -283,7 +299,11 @@ SyntaxHighlight.prototype.applySettings = function () {
283
  };
284
 
285
  function change_block_alignment (block) {
286
- jQuery("select#block-alignment-" + block).change ();
 
 
 
 
287
  }
288
 
289
 
@@ -663,7 +683,7 @@ jQuery(document).ready(function($) {
663
  geo_groups = parseInt (geo_groups_text);
664
  }
665
 
666
- debug = parseInt ($('#ai-data').attr ('javascript_debugging'));
667
 
668
  if (debug) {
669
  var start_time = new Date().getTime();
@@ -768,6 +788,28 @@ jQuery(document).ready(function($) {
768
  // else console.log ("NO DEFAULT VALUE: ", $(this).attr ("name"));
769
  }
770
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
771
  }
772
 
773
  function configure_editor_language (block) {
@@ -1410,6 +1452,7 @@ jQuery(document).ready(function($) {
1410
  var block = $(this).attr('id').replace ("display-type-", "");
1411
  process_display_elements (block);
1412
  });
 
1413
  $("select#block-alignment-"+tab).change (function() {
1414
  var block = $(this).attr('id').replace ("block-alignment-", "");
1415
  var alignment = $("select#block-alignment-"+block+" option:selected").attr('value');
@@ -1867,10 +1910,10 @@ jQuery(document).ready(function($) {
1867
  window_open_post (ajaxurl, 'width='+window_width+',height='+window_height+',top='+window_top+',left='+window_left+',resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no', 'edit', param);
1868
  });
1869
 
1870
- $("#open-image-button-"+tab).click (function (event) {
1871
  $(this).blur ();
1872
 
1873
- var block = $(this).attr('id').replace ("open-image-button-", "");
1874
  var frame;
1875
 
1876
  event.preventDefault();
@@ -1880,7 +1923,7 @@ jQuery(document).ready(function($) {
1880
  return;
1881
  }
1882
 
1883
- frame = wp.media({
1884
  title: 'Select or upload banner image',
1885
  button: {
1886
  text: 'Use this image'
@@ -1907,6 +1950,21 @@ jQuery(document).ready(function($) {
1907
  frame.open();
1908
  });
1909
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1910
  $("#banner-image-url-" + tab).on ('input', function() {
1911
 
1912
  var block = $(this).attr('id').replace ("banner-image-url-", "");
@@ -1916,10 +1974,12 @@ jQuery(document).ready(function($) {
1916
  if (new_image_src == '') {
1917
  new_image_src = '//:0';
1918
  image.hide ();
 
1919
  }
1920
 
1921
  image.attr ('src', new_image_src).load (function () {
1922
  image.show ();
 
1923
  $(this).closest ('.ai-banner').removeClass ('ai-banner-top');
1924
  var width = this.naturalWidth;
1925
  var height = this.naturalHeight;
@@ -1931,6 +1991,7 @@ jQuery(document).ready(function($) {
1931
  .error (function() {
1932
  if (image.is(':visible')) {
1933
  image.hide ().attr ('src', '//:0');
 
1934
  }
1935
  });
1936
 
@@ -1938,7 +1999,9 @@ jQuery(document).ready(function($) {
1938
 
1939
  $("#banner-url-" + tab).on ('input', function() {
1940
  var block = $(this).attr('id').replace ("banner-url-", "");
1941
- $('#banner-link-' + block).attr ('href', $(this).val ());
 
 
1942
  });
1943
 
1944
  $("#import-code-"+tab).click (function () {
@@ -1963,7 +2026,7 @@ jQuery(document).ready(function($) {
1963
  case AI_CODE_BANNER:
1964
  $("#banner-image-url-" + block).val (code_data ['image']).trigger ('input');
1965
  $("#banner-url-" + block).val (code_data ['link']).trigger ('input');
1966
- $("#open-new-window-" + block).attr('checked', code_data ['target'] == '_blank');
1967
  break;
1968
  case AI_CODE_ADSENSE:
1969
  $("#adsense-publisher-id-" + block).val (code_data ['adsense-publisher-id']);
@@ -2006,7 +2069,7 @@ jQuery(document).ready(function($) {
2006
  code_data ['image'] = $("#banner-image-url-" + block).val ();
2007
  code_data ['link'] = $("#banner-url-" + block).val ();
2008
 
2009
- if ($("#open-new-window-" + block).is(":checked"))
2010
  code_data ['target'] = '_blank';
2011
  break;
2012
  case AI_CODE_ADSENSE:
@@ -3051,7 +3114,21 @@ jQuery(document).ready(function($) {
3051
  });
3052
  }
3053
 
 
 
3054
 
 
 
 
 
 
 
 
 
 
 
 
 
3055
 
3056
  if (debug) console.log ("READY");
3057
  if (debug_title) $("#plugin_name").css ("color", "#f00");
@@ -3205,6 +3282,29 @@ jQuery(document).ready(function($) {
3205
  reload_list ();
3206
  });
3207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3208
 
3209
  $("#adsense-load-all").click (function () {
3210
  $(this).parent ().find ('.checkbox-icon').toggleClass ('on');
@@ -3229,6 +3329,12 @@ jQuery(document).ready(function($) {
3229
  update_adsense_authorization ('');
3230
  });
3231
 
 
 
 
 
 
 
3232
  setTimeout (update_rating, 1000);
3233
 
3234
  if (debug) console.log ("");
1
+ var javascript_version = "2.2.14";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
254
  if (!editor_disabled) {
255
  textarea.val (session.getValue());
256
  }
 
 
 
257
 
258
+ // if (textarea.val () == "") {
259
+ // textarea.removeAttr ("name");
260
+ // }
261
  // else textarea.val (jQuery.base64Encode (textarea.val ()));
262
 
263
+ var default_value = textarea.attr ("default");
264
+ var current_value = textarea.val ();
265
+ var name = textarea.attr ("name");
266
+
267
+ if (typeof name != 'undefined') {
268
+ if (typeof default_value != 'undefined') {
269
+ // console.log (textarea.attr ("name"), ": default_value: ", default_value, ", current_value: ", current_value);
270
+
271
+ if (current_value == default_value) {
272
+ textarea.removeAttr ("name");
273
+ // console.log ("REMOVED: ", name);
274
+ }
275
+ }
276
+ // else console.log ("NO DEFAULT VALUE: ", textarea.attr ("name"));
277
+ }
278
+
279
  jQuery("#ai-active-tab").attr ("value", '[' + active_tab + ',' + active_tab_0 + ']');
280
  });
281
 
299
  };
300
 
301
  function change_block_alignment (block) {
302
+ jQuery ("select#block-alignment-" + block).change ();
303
+ }
304
+
305
+ function change_banner_image (block) {
306
+ jQuery ("input#banner-image-url-" + block).trigger ("input");
307
  }
308
 
309
 
683
  geo_groups = parseInt (geo_groups_text);
684
  }
685
 
686
+ debug = parseInt ($('#ai-data').attr ('js_debugging'));
687
 
688
  if (debug) {
689
  var start_time = new Date().getTime();
788
  // else console.log ("NO DEFAULT VALUE: ", $(this).attr ("name"));
789
  }
790
  });
791
+
792
+ // Already removed in SyntaxHighlight
793
+ // $("#tab-" + block + " textarea").each (function() {
794
+ // var default_value = $(this).attr ("default");
795
+ // var current_value = $(this).val ();
796
+ // var name = $(this).attr ("name");
797
+
798
+ // if (typeof name != 'undefined') {
799
+ // if (typeof default_value != 'undefined') {
800
+ // console.log ($(this).attr ("name"), ": default_value: ", default_value, ", current_value: ", current_value);
801
+
802
+ // console.log ('#', current_value, '#');
803
+ // console.log ('#', default_value, '#');
804
+
805
+ // if (current_value == default_value) {
806
+ // $(this).removeAttr ("name");
807
+ // console.log ("REMOVED: ", name);
808
+ // }
809
+ // }
810
+ // else console.log ("NO DEFAULT VALUE: ", $(this).attr ("name"));
811
+ // }
812
+ // });
813
  }
814
 
815
  function configure_editor_language (block) {
1452
  var block = $(this).attr('id').replace ("display-type-", "");
1453
  process_display_elements (block);
1454
  });
1455
+
1456
  $("select#block-alignment-"+tab).change (function() {
1457
  var block = $(this).attr('id').replace ("block-alignment-", "");
1458
  var alignment = $("select#block-alignment-"+block+" option:selected").attr('value');
1910
  window_open_post (ajaxurl, 'width='+window_width+',height='+window_height+',top='+window_top+',left='+window_left+',resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no', 'edit', param);
1911
  });
1912
 
1913
+ $("#select-image-button-"+tab).click (function (event) {
1914
  $(this).blur ();
1915
 
1916
+ var block = $(this).attr('id').replace ("select-image-button-", "");
1917
  var frame;
1918
 
1919
  event.preventDefault();
1923
  return;
1924
  }
1925
 
1926
+ frame = wp.media ({
1927
  title: 'Select or upload banner image',
1928
  button: {
1929
  text: 'Use this image'
1950
  frame.open();
1951
  });
1952
 
1953
+ $("#select-placeholder-button-"+tab).click (function (event) {
1954
+ $(this).blur ();
1955
+
1956
+ var block = $(this).attr('id').replace ("select-placeholder-button-", "");
1957
+ var image_url = $('#banner-image-' + block).attr ('src');
1958
+
1959
+ var window_width = 820;
1960
+ var window_height = 870;
1961
+ var window_left = 100;
1962
+ var window_top = (screen.height / 2) - (870 / 2);
1963
+ var nonce = $("#ai-form").attr ('nonce');
1964
+ var param = {'action': 'ai_ajax_backend', 'placeholder': image_url, 'block': block, 'ai_check': nonce};
1965
+ window_open_post (ajaxurl, 'width='+window_width+',height='+window_height+',top='+window_top+',left='+window_left+',resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no', 'preview', param);
1966
+ });
1967
+
1968
  $("#banner-image-url-" + tab).on ('input', function() {
1969
 
1970
  var block = $(this).attr('id').replace ("banner-image-url-", "");
1974
  if (new_image_src == '') {
1975
  new_image_src = '//:0';
1976
  image.hide ();
1977
+ $('div#tab-banner-' + block + ' table.ai-settings-table').css ('position', 'relative');
1978
  }
1979
 
1980
  image.attr ('src', new_image_src).load (function () {
1981
  image.show ();
1982
+ $('div#tab-banner-' + block + ' table.ai-settings-table').css ('position', 'inherit');
1983
  $(this).closest ('.ai-banner').removeClass ('ai-banner-top');
1984
  var width = this.naturalWidth;
1985
  var height = this.naturalHeight;
1991
  .error (function() {
1992
  if (image.is(':visible')) {
1993
  image.hide ().attr ('src', '//:0');
1994
+ $('div#tab-banner-' + block + ' table.ai-settings-table').css ('position', 'relative');
1995
  }
1996
  });
1997
 
1999
 
2000
  $("#banner-url-" + tab).on ('input', function() {
2001
  var block = $(this).attr('id').replace ("banner-url-", "");
2002
+ var url = $(this).val ().trim();
2003
+ if (url == '') $('#banner-link-' + block).removeAttr ('href'); else
2004
+ $('#banner-link-' + block).attr ('href', $(this).val ());
2005
  });
2006
 
2007
  $("#import-code-"+tab).click (function () {
2026
  case AI_CODE_BANNER:
2027
  $("#banner-image-url-" + block).val (code_data ['image']).trigger ('input');
2028
  $("#banner-url-" + block).val (code_data ['link']).trigger ('input');
2029
+ $("#open-new-tab-" + block).attr('checked', code_data ['target'] == '_blank');
2030
  break;
2031
  case AI_CODE_ADSENSE:
2032
  $("#adsense-publisher-id-" + block).val (code_data ['adsense-publisher-id']);
2069
  code_data ['image'] = $("#banner-image-url-" + block).val ();
2070
  code_data ['link'] = $("#banner-url-" + block).val ();
2071
 
2072
+ if ($("#open-new-tab-" + block).is(":checked"))
2073
  code_data ['target'] = '_blank';
2074
  break;
2075
  case AI_CODE_ADSENSE:
3114
  });
3115
  }
3116
 
3117
+ function update_block_code_demo () {
3118
+ var nonce = $("#ai-form").attr ('nonce');
3119
 
3120
+ var block_class_name = encodeURIComponent ($('#block-class-name').val ());
3121
+ var block_class = $('#block-class').is(":checked") ? 1 : 0;
3122
+ var block_number_class = $('#block-number-class').is(":checked") ? 1 : 0;
3123
+ var inline_styles = $('#inline-styles').is(":checked") ? 1 : 0;
3124
+
3125
+ $.get (ajaxurl + '?action=ai_ajax_backend&update=block-code-demo&block_class_name=' + block_class_name + '&block_class=' + block_class + '&block_number_class=' + block_number_class + '&inline_styles=' + inline_styles + '&ai_check=' + nonce, function (data) {
3126
+ $('span#ai-block-code-demo').html (data);
3127
+ }).fail (function (xhr, status, error) {
3128
+ var message = "Error updating block code demo: " + xhr.status + " " + xhr.statusText ;
3129
+ console.log (message);
3130
+ });
3131
+ }
3132
 
3133
  if (debug) console.log ("READY");
3134
  if (debug_title) $("#plugin_name").css ("color", "#f00");
3282
  reload_list ();
3283
  });
3284
 
3285
+ if ($("#maxmind-db-status").hasClass ('maxmind-db-missing')) {
3286
+ var nonce = $("#ai-form").attr ('nonce');
3287
+ var page = ajaxurl+"?action=ai_ajax_backend&update=maxmind&ai_check=" + nonce;
3288
+
3289
+ $("span.maxmind-db-missing").text ('downloading...');
3290
+ $.get (page, function (update_status) {
3291
+
3292
+ if (update_status == '') {
3293
+ $("span.maxmind-db-missing").closest ('.notice.notice-error').hide ();
3294
+ $("#maxmind-db-status").text ('');
3295
+ } else {
3296
+ console.log (update_status);
3297
+ var status = JSON.parse (update_status);
3298
+ console.log (status);
3299
+ if (typeof status !== "undefined") {
3300
+ $(".notice span.maxmind-db-missing").text (status [0]);
3301
+ $("#maxmind-db-status").text (status [1]);
3302
+ } else $("span.maxmind-db-missing").text ('update error');
3303
+ }
3304
+ }).fail (function(jqXHR, status, err) {
3305
+ $("span.maxmind-db-missing").text ('download error');
3306
+ });
3307
+ }
3308
 
3309
  $("#adsense-load-all").click (function () {
3310
  $(this).parent ().find ('.checkbox-icon').toggleClass ('on');
3329
  update_adsense_authorization ('');
3330
  });
3331
 
3332
+ $('.ai-block-code-demo').change (function () {
3333
+ update_block_code_demo ();
3334
+ }).on('input',function(e){
3335
+ update_block_code_demo ();
3336
+ });
3337
+
3338
  setTimeout (update_rating, 1000);
3339
 
3340
  if (debug) console.log ("");
readme.txt CHANGED
@@ -2,11 +2,11 @@
2
 
3
  Contributors: spacetime
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4
5
- Tags: ads, adsense, ad management, advertising manager, advanced contextual ads, ad rotation, ad injection, adverts, sticky widgets, sticky sidebar, hook, amazon, banners, automatic insertion, amp, geo targeting, multisite, shortcodes, PHP, Javascript, HTML, header, footer, tracking, ad blocking, custom fields
6
  Requires at least: 4.0
7
  Tested up to: 4.9
8
- Requires PHP: 5.2.4
9
- Stable tag: 2.2.12
10
  License: GPLv3
11
 
12
  Insert and manage ads: AdSense, Amazon, banners, ad rotation, sticky ad widgets, shortcodes, AMP, PHP, HTML, CSS, form, tracking, header, footer code
@@ -23,7 +23,6 @@ Ad Inserter is more than just ad manager plugin. It provides many advanced optio
23
  > * Syntax highlighting editor
24
  > * Code preview with visual CSS editor
25
  > * Automatically inserts ads in posts and pages
26
- > * Insert above header (after `<body>` tag, needs Output buffering)
27
  > * Insert before or after post
28
  > * Insert before or after content
29
  > * Insert before or after paragraph
@@ -32,20 +31,22 @@ Ad Inserter is more than just ad manager plugin. It provides many advanced optio
32
  > * Insert before or after comments
33
  > * Insert before or after excerpt
34
  > * Insert before or after any HTML element in post
 
35
  > * Insert in footer (before `</body>` tag)
36
  > * Insert at relative position in posts
37
  > * Insert between posts on blog pages (in-feed AdSense ads)
38
  > * Insert between excerpts on blog pages
39
  > * Insert between comments
40
- > * Insert at custom hook positions
41
  > * Clearance options to avoid insertion near images or headers
42
  > * Insertion exceptions for posts and pages
43
- > * Insert header and footer code
44
  > * Insert raw HTTP response header lines
45
  > * Insert Google Analytics, Piwik or any other web analytics code
46
  > * Insert HTML, CSS, Javascript or PHP code
47
- > * Code generator for banners
48
  > * Visual ad editor
 
49
  > * Manual insertion: widgets, shortcodes, PHP function call
50
  > * Sticky (fixed) widgets (sticky sidebar - the sidebar does not move when the page is scrolled)
51
  > * Custom block alignments and styles
@@ -54,7 +55,6 @@ Ad Inserter is more than just ad manager plugin. It provides many advanced optio
54
  > * Use shortcodes from other plugins
55
  > * Use custom fields as defined in posts
56
  > * PHP code processing
57
- > * Banner code generator
58
  > * Ad rotation (server-side and client-side - works with caching)
59
  > * Ad blocking detection - popup message, page redirection
60
  > * Desktop/mobile device detection (server-side and client-side - works with caching)
@@ -68,11 +68,12 @@ Ad Inserter is more than just ad manager plugin. It provides many advanced optio
68
  And Ad Inserter Pro - all-in-one <a href="http://adinserter.pro/" target="_blank">WordPress ad management plugin</a> has even more advanced features:
69
 
70
  > * 64 code (ad) blocks
71
- > * GEO targeting (works also with caching)
72
  > * Black/White-list IP addresses or countries (works also with caching)
73
  > * Ad impression and click tracking (works also with `<iframe>` Javascript ads like Google AdSense)
 
74
  > * A/B testing
75
- > * Sticky ad positions (left, top, right, bottom)
76
  > * Scheduling with fallback option
77
  > * Ad blocking detection - ad replacement, content protection
78
  > * Ad blocking statistics
@@ -90,7 +91,9 @@ Ad Inserter Wordpress plugin is an advanced advertising manager - it has many fe
90
 
91
  **Endorsed by Amazon**
92
 
93
- > Amazon suggests to use Ad Inserter to add Native Shopping Ads to Wordpress posts. Native Shopping Ads provide highly relevant and dynamic product recommendations in a stylishly designed and responsive ad unit that can be placed at the end of your content or within your content to create a more compelling visitor experience and shopping opportunity.
 
 
94
  >
95
  > * Check <a href="https://affiliate-program.amazon.com/help/topic/t405" target="_blank">Wordpress Integration Guide for Native Shopping Ads</a>
96
  > * Ad Inserter supports advanced contextual ads: check settings for <a href="https://adinserter.pro/settings#amazon">contextual Native Shopping Ads</a> that show items related to the post content (using post tags)
@@ -105,6 +108,7 @@ Ad Inserter is not just another plugin for WordPress ads. Do you enjoy finding t
105
  * to insert ads between paragraphs
106
  * to insert ads between posts
107
  * to insert ads between comments
 
108
  * to insert ads on AMP pages
109
  * to insert different ads for mobile devices
110
  * to insert ads at custom action hooks (e.g. using <a href="https://genesistutorials.com/visual-hook-guide/" target="_blank">Genesis Theme Framework Hook Guide</a>)
@@ -756,6 +760,16 @@ AD CODE RIGHT
756
 
757
  == Changelog ==
758
 
 
 
 
 
 
 
 
 
 
 
759
  = 2.2.13 =
760
  - Added option to disable inline alignment styles for code blocks (using alignment classes)
761
  - Fix for custom CSS codes with single quotation marks
@@ -923,6 +937,16 @@ AD CODE RIGHT
923
 
924
  == Upgrade Notice ==
925
 
 
 
 
 
 
 
 
 
 
 
926
  = 2.2.13 =
927
  Added option to disable inline alignment styles for code blocks (using alignment classes);
928
  Fix for custom CSS codes with single quotation marks
2
 
3
  Contributors: spacetime
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4
5
+ Tags: ads, adsense, ad management, advertising manager, advanced contextual ads, ad rotation, ad injection, adverts, sticky widgets, sticky sidebar, hook, amazon, banners, automatic insertion, amp, geo targeting, multisite, shortcodes, PHP, Javascript, HTML, header, footer, tracking, ad blocking, custom fields, custom posts
6
  Requires at least: 4.0
7
  Tested up to: 4.9
8
+ Requires PHP: 5.3
9
+ Stable tag: 2.2.13
10
  License: GPLv3
11
 
12
  Insert and manage ads: AdSense, Amazon, banners, ad rotation, sticky ad widgets, shortcodes, AMP, PHP, HTML, CSS, form, tracking, header, footer code
23
  > * Syntax highlighting editor
24
  > * Code preview with visual CSS editor
25
  > * Automatically inserts ads in posts and pages
 
26
  > * Insert before or after post
27
  > * Insert before or after content
28
  > * Insert before or after paragraph
31
  > * Insert before or after comments
32
  > * Insert before or after excerpt
33
  > * Insert before or after any HTML element in post
34
+ > * Insert above header (after `<body>` tag, needs Output buffering enabled)
35
  > * Insert in footer (before `</body>` tag)
36
  > * Insert at relative position in posts
37
  > * Insert between posts on blog pages (in-feed AdSense ads)
38
  > * Insert between excerpts on blog pages
39
  > * Insert between comments
40
+ > * Insert at custom hook positions (`do_action ()` WP function in themes)
41
  > * Clearance options to avoid insertion near images or headers
42
  > * Insertion exceptions for posts and pages
43
+ > * Insert header (`<head>` section) and footer code
44
  > * Insert raw HTTP response header lines
45
  > * Insert Google Analytics, Piwik or any other web analytics code
46
  > * Insert HTML, CSS, Javascript or PHP code
47
+ > * Code generator for banners and placeholders
48
  > * Visual ad editor
49
+ > * Banner code generator
50
  > * Manual insertion: widgets, shortcodes, PHP function call
51
  > * Sticky (fixed) widgets (sticky sidebar - the sidebar does not move when the page is scrolled)
52
  > * Custom block alignments and styles
55
  > * Use shortcodes from other plugins
56
  > * Use custom fields as defined in posts
57
  > * PHP code processing
 
58
  > * Ad rotation (server-side and client-side - works with caching)
59
  > * Ad blocking detection - popup message, page redirection
60
  > * Desktop/mobile device detection (server-side and client-side - works with caching)
68
  And Ad Inserter Pro - all-in-one <a href="http://adinserter.pro/" target="_blank">WordPress ad management plugin</a> has even more advanced features:
69
 
70
  > * 64 code (ad) blocks
71
+ > * Geolocation using Webnet77 or <a href="http://www.maxmind.com/" target="_blank">MaxMind</a> databases (works also with caching)
72
  > * Black/White-list IP addresses or countries (works also with caching)
73
  > * Ad impression and click tracking (works also with `<iframe>` Javascript ads like Google AdSense)
74
+ > * External tracking via Google Analytics or Piwik
75
  > * A/B testing
76
+ > * Sticky ad positions with optional close button (left, top, right, bottom)
77
  > * Scheduling with fallback option
78
  > * Ad blocking detection - ad replacement, content protection
79
  > * Ad blocking statistics
91
 
92
  **Endorsed by Amazon**
93
 
94
+ Amazon suggests to use Ad Inserter to add Native Shopping Ads to Wordpress posts.
95
+
96
+ > Native Shopping Ads provide highly relevant and dynamic product recommendations in a stylishly designed and responsive ad unit that can be placed at the end of your content or within your content to create a more compelling visitor experience and shopping opportunity.
97
  >
98
  > * Check <a href="https://affiliate-program.amazon.com/help/topic/t405" target="_blank">Wordpress Integration Guide for Native Shopping Ads</a>
99
  > * Ad Inserter supports advanced contextual ads: check settings for <a href="https://adinserter.pro/settings#amazon">contextual Native Shopping Ads</a> that show items related to the post content (using post tags)
108
  * to insert ads between paragraphs
109
  * to insert ads between posts
110
  * to insert ads between comments
111
+ * to insert ads on custom posts
112
  * to insert ads on AMP pages
113
  * to insert different ads for mobile devices
114
  * to insert ads at custom action hooks (e.g. using <a href="https://genesistutorials.com/visual-hook-guide/" target="_blank">Genesis Theme Framework Hook Guide</a>)
760
 
761
  == Changelog ==
762
 
763
+ = 2.2.14 =
764
+ - Added code generator for placeholders
765
+ - Added option to disable caching (works with WP Super Cache, W3 Total Cache and WP Rocket)
766
+ - Added options to configure classes for wrapping div
767
+ - Added support for external tracking via Google Analytics and Piwik (Pro only)
768
+ - Added support for MaxMind geolocation databases (Pro only)
769
+ - Added option for close button on sticky ads (Pro only)
770
+ - Fix for no paragraph counting inside nested elements
771
+ - Few minor bug fixes, cosmetic changes and code improvements
772
+
773
  = 2.2.13 =
774
  - Added option to disable inline alignment styles for code blocks (using alignment classes)
775
  - Fix for custom CSS codes with single quotation marks
937
 
938
  == Upgrade Notice ==
939
 
940
+ = 2.2.14 =
941
+ Added code generator for placeholders;
942
+ Added option to disable caching (works with WP Super Cache, W3 Total Cache and WP Rocket);
943
+ Added options to configure classes for wrapping div;
944
+ Added support for external tracking via Google Analytics and Piwik (Pro only);
945
+ Added support for MaxMind geolocation databases (Pro only);
946
+ Added option for close button on sticky ads (Pro only);
947
+ Fix for no paragraph counting inside nested elements;
948
+ Few minor bug fixes, cosmetic changes and code improvements
949
+
950
  = 2.2.13 =
951
  Added option to disable inline alignment styles for code blocks (using alignment classes);
952
  Fix for custom CSS codes with single quotation marks
settings.php CHANGED
@@ -55,6 +55,8 @@ function generate_settings_form (){
55
 
56
  $syntax_highlighter_theme = get_syntax_highlighter_theme ();
57
  $block_class_name = get_block_class_name ();
 
 
58
  $inline_styles = get_inline_styles ();
59
 
60
  $default = $block_object [0];
@@ -115,9 +117,10 @@ function generate_settings_form (){
115
 
116
  if (!isset ($_GET ['settings'])): // start of code only for normal settings
117
 
 
118
  ?>
119
 
120
- <div id="ai-data" style="display: none;" version="<?php echo AD_INSERTER_VERSION; ?>" theme="<?php echo $syntax_highlighter_theme; ?>" javascript_debugging="<?php echo $ai_wp_data [AI_JS_DEBUGGING] ? '1' : '0'; ?>" ></div>
121
  <?php
122
  if (function_exists ('ai_data_2')) ai_data_2 ();
123
  ?>
@@ -144,7 +147,7 @@ function generate_settings_form (){
144
  <button type="button" class="ai-top-button" style="display: none; margin: 0 10px 0 0; width: 62px; outline-color: transparent;" onclick="window.open('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4')" title="Support Free Ad Inserter development. If you are making money with Ad Inserter consider donating some small amount. Even 1 dollar counts. Thank you!">Donate</button>
145
  <button type="button" class="ai-top-button" style="display: none; margin: 0 10px 0 0; width: 62px; outline-color: transparent;" onclick="window.open('https://wordpress.org/support/plugin/ad-inserter/reviews/')" title="If you like Ad Inserter and have a moment, please help me spread the word by reviewing the plugin on WordPres">Review</button>
146
  <button type="button" class="ai-top-button" style="display: none; margin: 0 10px 0 0; width: 62px; outline-color: transparent;" onclick="window.open('http://adinserter.pro/')" title="Need more code blocks, GEO targeting, impression and click tracking? Upgrade to Ad Inserter Pro">Go&nbsp;Pro</button>
147
- <button id="ai-list" type="button" class="ai-top-button" style="width: 62px; display: none; margin-right: 0px; outline-color: transparent;" title="Show list of all code blocks"><span>List</span></button>
148
  </div>
149
 
150
  <div style="clear: both;"></div>
@@ -344,6 +347,7 @@ function generate_settings_form (){
344
  </ul>
345
 
346
  <?php
 
347
  for ($block = $start; $block <= $end + 1; $block ++){
348
 
349
  if ($block <= $end) {
@@ -354,14 +358,19 @@ function generate_settings_form (){
354
 
355
  $obj = $block_object [$block];
356
  } else {
 
 
 
 
 
 
 
357
  $default->number = 0;
358
  $default->wp_options [AI_OPTION_BLOCK_NAME] = AD_NAME." 0";
359
 
360
  $tab_visible = false;
361
 
362
  $obj = $default;
363
-
364
- $block = 999;
365
  }
366
 
367
  $client_side_devices = $obj->get_detection_client_side () == AI_ENABLED;
@@ -392,7 +401,8 @@ function generate_settings_form (){
392
  $obj->get_enable_amp () == AI_ENABLED ||
393
  $obj->get_enable_ajax () != AI_ENABLED ||
394
  $obj->get_enable_404 () == AI_ENABLED ||
395
- $obj->get_enable_feed () == AI_ENABLED;
 
396
 
397
  $word_count_options =
398
  intval ($obj->get_minimum_words()) != 0 ||
@@ -404,12 +414,15 @@ function generate_settings_form (){
404
 
405
  $adb_block_action_active = $obj->get_adb_block_action () != AI_ADB_BLOCK_ACTION_DO_NOTHING;
406
 
 
 
407
  $show_misc =
408
  $insertion_options ||
409
  $word_count_options ||
410
  $scheduling_active ||
411
  $filter_active ||
412
- $adb_block_action_active;
 
413
 
414
  if ($show_misc) $misc_style = "font-weight: bold; color: #66f;"; else $misc_style = "";
415
 
@@ -418,6 +431,7 @@ function generate_settings_form (){
418
  if ($scheduling_active) $scheduling_style = "font-weight: bold; color: #66f;"; else $scheduling_style = "";
419
  if ($filter_active) $filter_style = "font-weight: bold; color: #66f;"; else $filter_style = "";
420
  if ($adb_block_action_active) $adb_style = "font-weight: bold; color: #66f;"; else $adb_style = "";
 
421
 
422
  $automatic_insertion = $obj->get_automatic_insertion();
423
 
@@ -568,7 +582,7 @@ function generate_settings_form (){
568
 
569
  <div id="tab-banner-<?php echo $block; ?>" class="ai-banner ai-banner-top responsive-table rounded">
570
  <div class="banner-preview">
571
- <a id="banner-link-<?php echo $block; ?>" href="" target="_blank"><img id="banner-image-<?php echo $block; ?>" src="//:0" style="display: none;" /></a>
572
  </div>
573
  <table class="ai-settings-table">
574
  <tr>
@@ -589,11 +603,12 @@ function generate_settings_form (){
589
  </tr>
590
  <tr>
591
  <td>
592
- <input type="checkbox" id="open-new-window-<?php echo $block; ?>" />
593
  </td>
594
  <td>
595
- <label for="open-new-window-<?php echo $block; ?>" style="display: inline-block; margin-top: 6px;">Open link in a new tab</label>
596
- <button id="open-image-button-<?php echo $block; ?>" type="button" class='ai-button select-image' style="display: none; float: right; margin: 7px 0 0 0;">Select Image</button>
 
597
  </td>
598
  </tr>
599
  </table>
@@ -716,7 +731,7 @@ function generate_settings_form (){
716
  <?php endif; ?>
717
 
718
  <div style="margin: 8px 0;">
719
- <textarea id="block-<?php echo $block; ?>" class="simple-editor" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold;" name="<?php echo AI_OPTION_CODE, WP_FORM_FIELD_POSTFIX, $block; ?>"><?php echo esc_textarea ($obj->get_ad_data()); ?></textarea>
720
  </div>
721
 
722
  <div style="padding: 0; min-height: 28px;">
@@ -1368,44 +1383,67 @@ function generate_settings_form (){
1368
  <li id="ai-misc-filter-<?php echo $block; ?>"><a href="#tab-filter-<?php echo $block; ?>"><span style="<?php echo $filter_style; ?>">Filter</span></a></li>
1369
  <li id="ai-misc-scheduling-<?php echo $block; ?>"><a href="#tab-scheduling-<?php echo $block; ?>"><span style="<?php echo $scheduling_style; ?>">Scheduling</span></a></li>
1370
  <?php if (function_exists ('ai_adb_action_0')) ai_adb_action_0 ($block, $adb_style); ?>
1371
- <li id="ai-misc-general-<?php echo $block; ?>"><a href="#tab-general-<?php echo $block; ?>">General</a></li>
1372
  </ul>
1373
 
1374
- <div id="tab-insertion-<?php echo $block; ?>" class="rounded">
1375
- <div class="max-input">
1376
- <span style="display: table-cell; width: 1px; white-space: nowrap;">
1377
- Insert for
1378
- <select id="display-for-users-<?php echo $block; ?>" style="margin: 0 1px; width:160px" name="<?php echo AI_OPTION_DISPLAY_FOR_USERS, WP_FORM_FIELD_POSTFIX, $block; ?>" default="<?php echo $default->get_display_for_users(); ?>">
1379
- <option value="<?php echo AD_DISPLAY_ALL_USERS; ?>" <?php echo ($obj->get_display_for_users()==AD_DISPLAY_ALL_USERS) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_ALL_USERS; ?></option>
1380
- <option value="<?php echo AD_DISPLAY_LOGGED_IN_USERS; ?>" <?php echo ($obj->get_display_for_users()==AD_DISPLAY_LOGGED_IN_USERS) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_LOGGED_IN_USERS; ?></option>
1381
- <option value="<?php echo AD_DISPLAY_NOT_LOGGED_IN_USERS; ?>" <?php echo ($obj->get_display_for_users()==AD_DISPLAY_NOT_LOGGED_IN_USERS) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_NOT_LOGGED_IN_USERS; ?></option>
1382
- <option value="<?php echo AD_DISPLAY_ADMINISTRATORS; ?>" <?php echo ($obj->get_display_for_users()==AD_DISPLAY_ADMINISTRATORS) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_ADMINISTRATORS; ?></option>
1383
- </select>
1384
- </span>
1385
- <span style="display: table-cell; width: 1px; white-space: nowrap;">
1386
- &nbsp;&nbsp;
1387
- Max <input type="text" style="width: 32px;" name="<?php echo AI_OPTION_MAXIMUM_INSERTIONS, WP_FORM_FIELD_POSTFIX, $block; ?>" default="<?php echo $default->get_maximum_insertions (); ?>" value="<?php echo $obj->get_maximum_insertions (); ?>" size="1" maxlength="3" title="Empty or 0 means no limit" /> insertions
1388
- </span>
1389
- <span style="display: table-cell; width: 1px; white-space: nowrap;">
1390
- <input type="hidden" name="<?php echo AI_OPTION_ENABLE_AMP, WP_FORM_FIELD_POSTFIX, $block; ?>" value="0" />
1391
- <input style="margin-left: 10px;" id="enable-amp-<?php echo $block; ?>" type="checkbox" name="<?php echo AI_OPTION_ENABLE_AMP, WP_FORM_FIELD_POSTFIX, $block; ?>" value="1" default="<?php echo $default->get_enable_amp(true); ?>" <?php if ($obj->get_enable_amp (true) == AI_ENABLED) echo 'checked '; ?> />
1392
- <label for="enable-amp-<?php echo $block; ?>" style="vertical-align: top;<?php if (!$obj->get_enable_amp (true) && $obj->get_enable_amp ()) echo ' color: red;' ?>" title="<?php if (!$obj->get_enable_amp (true) && $obj->get_enable_amp ()) echo "Old settings for AMP pages detected. " ?>To insert different codes on normal and AMP pages separate them with [ADINSERTER AMP] separator. Here you can enable insertion on AMP pages only when you need to insert THE SAME CODE also on AMP pages (no AMP separator).">AMP pages</label>
1393
- </span>
1394
- <span style="display: table-cell; width: 1px; white-space: nowrap;">
1395
- <input type="hidden" name="<?php echo AI_OPTION_ENABLE_AJAX, WP_FORM_FIELD_POSTFIX, $block; ?>" value="0" />
1396
- <input style="margin-left: 10px;" id="enable-ajax-<?php echo $block; ?>" type="checkbox" name="<?php echo AI_OPTION_ENABLE_AJAX, WP_FORM_FIELD_POSTFIX, $block; ?>" value="1" default="<?php echo $default->get_enable_ajax(); ?>" <?php if ($obj->get_enable_ajax () == AI_ENABLED) echo 'checked '; ?> />
1397
- <label for="enable-ajax-<?php echo $block; ?>" style="vertical-align: top;" title="Enable or disable insertion for Ajax requests">Ajax</label>
1398
- </span>
1399
- <span style="display: table-cell; width: 1px; white-space: nowrap;">
1400
- <input type="hidden" name="<?php echo AI_OPTION_ENABLE_FEED, WP_FORM_FIELD_POSTFIX, $block; ?>" value="0" />
1401
- <input style="margin-left: 10px;" id="enable-feed-<?php echo $block; ?>" type="checkbox" name="<?php echo AI_OPTION_ENABLE_FEED, WP_FORM_FIELD_POSTFIX, $block; ?>" value="1" default="<?php echo $default->get_enable_feed(); ?>" <?php if ($obj->get_enable_feed () == AI_ENABLED) echo 'checked '; ?> />
1402
- <label for="enable-feed-<?php echo $block; ?>" style="vertical-align: top;" title="Enable or disable insertion in RSS feeds">RSS Feed</label>
1403
- </span>
1404
- <span style="display: table-cell; width: 1px; white-space: nowrap;">
1405
- <input type="hidden" name="<?php echo AI_OPTION_ENABLE_404, WP_FORM_FIELD_POSTFIX, $block; ?>" value="0" />
1406
- <input style="margin-left: 10px;" id="enable-404-<?php echo $block; ?>" type="checkbox" name="<?php echo AI_OPTION_ENABLE_404, WP_FORM_FIELD_POSTFIX, $block; ?>" value="1" default="<?php echo $default->get_enable_404(); ?>" <?php if ($obj->get_enable_404 () == AI_ENABLED) echo 'checked '; ?> />
1407
- <label for="enable-404-<?php echo $block; ?>" style="vertical-align: top;" title="Enable or disable insertion on page for Error 404: Page not found">Error page</label>
1408
- </span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1409
  </div>
1410
  </div>
1411
 
@@ -1474,8 +1512,9 @@ function generate_settings_form (){
1474
  &nbsp;
1475
  </span>
1476
  <span style="display: table-cell;">
1477
- <input style="width: 100%;" type="text" name="<?php echo AI_OPTION_GENERAL_TAG, WP_FORM_FIELD_POSTFIX, $block; ?>" default="<?php echo $default->get_ad_general_tag(); ?>" value="<?php echo $obj->get_ad_general_tag(); ?>" size="8" maxlength="40" title="Used for {tags} when no page data is found" />
1478
  </span>
 
1479
  <span style="display: table-cell; width: 400px; white-space: nowrap;">
1480
  </span>
1481
  </div>
@@ -1524,7 +1563,7 @@ function generate_settings_form (){
1524
  if ($enabled_f) $style_f = "font-weight: bold; color: #66f;"; else $style_f = "";
1525
  if (defined ('AI_ADBLOCKING_DETECTION') && AI_ADBLOCKING_DETECTION) {
1526
  $adb_action = get_adb_action (true);
1527
- if ($enabled_a) $style_a = "font-weight: bold; color: " . ($adb_action == AI_ADB_ACTION_NONE ? "#66f;" : "#f00;"); else $style_a = "";
1528
  }
1529
  if (false) $style_d = "font-weight: bold; color: #e44;"; else $style_d = "";
1530
  ?>
@@ -1543,167 +1582,176 @@ function generate_settings_form (){
1543
  <li id="ai-d" class="ai-plugin-tab"><a href="#tab-debugging"><span style="<?php echo $style_d ?>">Debugging</span></a></li>
1544
  </ul>
1545
 
1546
- <div id="tab-general" class="rounded">
1547
 
1548
- <table class="ai-settings-table" style="width: 100%;">
 
1549
  <?php if (function_exists ('ai_general_settings')) ai_general_settings (); ?>
1550
- <tr>
1551
- <td style="width: 34%;">
1552
- Syntax highlighting theme
1553
- </td>
1554
- <td>
1555
- <select
1556
- style="width:220px"
1557
- id="syntax-highlighter-theme"
1558
- name="syntax-highlighter-theme"
1559
- value="Value">
1560
- <optgroup label="None">
1561
- <option value="<?php echo AI_OPTION_DISABLED; ?>" <?php echo ($syntax_highlighter_theme == AI_OPTION_DISABLED) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>No Syntax Highlighting</option>
1562
- </optgroup>
1563
- <optgroup label="Light">
1564
- <option value="chrome" <?php echo ($syntax_highlighter_theme == 'chrome') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Chrome</option>
1565
- <option value="clouds" <?php echo ($syntax_highlighter_theme == 'clouds') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Clouds</option>
1566
- <option value="crimson_editor" <?php echo ($syntax_highlighter_theme == 'crimson_editor') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Crimson Editor</option>
1567
- <option value="dawn" <?php echo ($syntax_highlighter_theme == 'dawn') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Dawn</option>
1568
- <option value="dreamweaver" <?php echo ($syntax_highlighter_theme == 'dreamweaver') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Dreamweaver</option>
1569
- <option value="eclipse" <?php echo ($syntax_highlighter_theme == 'eclipse') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Eclipse</option>
1570
- <option value="github" <?php echo ($syntax_highlighter_theme == 'github') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>GitHub</option>
1571
- <option value="katzenmilch" <?php echo ($syntax_highlighter_theme == 'katzenmilch') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Katzenmilch</option>
1572
- <option value="kuroir" <?php echo ($syntax_highlighter_theme == 'kuroir') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Kuroir</option>
1573
- <option value="solarized_light" <?php echo ($syntax_highlighter_theme == 'solarized_light') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Solarized Light</option>
1574
- <option value="textmate" <?php echo ($syntax_highlighter_theme == 'textmate') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Textmate</option>
1575
- <option value="tomorrow" <?php echo ($syntax_highlighter_theme == 'tomorrow') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Tomorrow</option>
1576
- <option value="xcode" <?php echo ($syntax_highlighter_theme == 'xcode') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>XCode</option>
1577
- </optgroup>
1578
- <optgroup label="Dark">
1579
- <option value="ad_inserter" <?php echo ($syntax_highlighter_theme == 'ad_inserter') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Ad Inserter</option>
1580
- <option value="chaos" <?php echo ($syntax_highlighter_theme == 'chaos') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Chaos</option>
1581
- <option value="clouds_midnight" <?php echo ($syntax_highlighter_theme == 'clouds_midnight') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Clouds Midnight</option>
1582
- <option value="cobalt" <?php echo ($syntax_highlighter_theme == 'cobalt') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Cobalt</option>
1583
- <option value="idle_fingers" <?php echo ($syntax_highlighter_theme == 'idle_fingers') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Idle Fingers</option>
1584
- <option value="kr_theme" <?php echo ($syntax_highlighter_theme == 'kr_theme') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>krTheme</option>
1585
- <option value="merbivore" <?php echo ($syntax_highlighter_theme == 'merbivore') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Merbivore</option>
1586
- <option value="merbivore_soft" <?php echo ($syntax_highlighter_theme == 'merbivore_soft') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Merbivore Soft</option>
1587
- <option value="mono_industrial" <?php echo ($syntax_highlighter_theme == 'mono_industrial') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Mono Industrial</option>
1588
- <option value="monokai" <?php echo ($syntax_highlighter_theme == 'monokai') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Monokai</option>
1589
- <option value="pastel_on_dark" <?php echo ($syntax_highlighter_theme == 'pastel_on_dark') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Pastel on Dark</option>
1590
- <option value="solarized_dark" <?php echo ($syntax_highlighter_theme == 'solarized_dark') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Solarized Dark</option>
1591
- <option value="terminal" <?php echo ($syntax_highlighter_theme == 'terminal') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Terminal</option>
1592
- <option value="tomorrow_night" <?php echo ($syntax_highlighter_theme == 'tomorrow_night') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Tomorrow Night</option>
1593
- <option value="tomorrow_night_blue" <?php echo ($syntax_highlighter_theme == 'tomorrow_night_blue') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Tomorrow Night Blue</option>
1594
- <option value="tomorrow_night_bright" <?php echo ($syntax_highlighter_theme == 'tomorrow_night_bright') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Tomorrow Night Bright</option>
1595
- <option value="tomorrow_night_eighties" <?php echo ($syntax_highlighter_theme == 'tomorrow_night_eighties') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Tomorrow Night 80s</option>
1596
- <option value="twilight" <?php echo ($syntax_highlighter_theme == 'twilight') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Twilight</option>
1597
- <option value="vibrant_ink" <?php echo ($syntax_highlighter_theme == 'vibrant_ink') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Vibrant Ink</option>
1598
- </optgroup>
1599
- </select>
1600
- </td>
1601
- </tr>
1602
- <tr>
1603
- <td>
1604
- Block class name
1605
- </td>
1606
- <td>
1607
- <input style="margin-left: 0px;" title="CSS Class Name for the wrapping div" type="text" id="block-class-name" name="block-class-name" value="<?php echo $block_class_name; ?>" default="<?php echo DEFAULT_BLOCK_CLASS_NAME; ?>" size="15" maxlength="40" />
1608
- </td>
1609
- </tr>
1610
- <tr>
1611
- <td>
1612
- Inline styles
1613
- </td>
1614
- <td>
1615
- <select
1616
- id="inline-styles"
1617
- name="inline-styles"
1618
- title="Instead of alignment classes generate inline alignment styles for code blocks"
1619
- default="<?php echo DEFAULT_INLINE_STYLES; ?>">
1620
- <option value="<?php echo AI_DISABLED; ?>" <?php echo ($inline_styles == AI_DISABLED) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_DISABLED; ?></option>
1621
- <option value="<?php echo AI_ENABLED; ?>" <?php echo ($inline_styles == AI_ENABLED) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_ENABLED; ?></option>
1622
- </select>
1623
- </td>
1624
- </tr>
1625
- <tr>
1626
- <td>
1627
- Min. user role for ind. exceptions editing
1628
- </td>
1629
- <td>
1630
- <select style="margin-bottom: 3px;" id="minimum-user-role" name="minimum-user-role" selected-value="1" data="<?php echo get_minimum_user_role (); ?>" default="<?php echo DEFAULT_MINIMUM_USER_ROLE; ?>" style="width:300px">
1631
- <?php wp_dropdown_roles (get_minimum_user_role ()); ?>
1632
- </select>
1633
- </td>
1634
- </tr>
1635
- <tr>
1636
- <td>
1637
- Dynamic blocks
1638
- </td>
1639
- <td>
1640
- <select id="dynamic_blocks" name="dynamic_blocks" default="<?php echo DEFAULT_DYNAMIC_BLOCKS; ?>">
1641
- <option value="<?php echo AI_DYNAMIC_BLOCKS_SERVER_SIDE; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_SERVER_SIDE ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_SERVER_SIDE; ?></option>
1642
- <option value="<?php echo AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_SERVER_SIDE_W3TC; ?></option>
1643
- <option value="<?php echo AI_DYNAMIC_BLOCKS_CLIENT_SIDE; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_CLIENT_SIDE ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_CLIENT_SIDE; ?></option>
1644
- </select>
1645
- </td>
1646
- </tr>
1647
- <tr>
1648
- <td>
1649
- Functions for paragraph counting
1650
- </td>
1651
- <td>
1652
- <select id="paragraph_counting_functions" name="paragraph_counting_functions" default="<?php echo DEFAULT_PARAGRAPH_COUNTING_FUNCTIONS; ?>" title="Standard PHP functions are faster and work in most cases, use Multibyte functions if paragraphs are not counted properly on non-english pages.">
1653
- <option value="<?php echo AI_STANDARD_PARAGRAPH_COUNTING_FUNCTIONS; ?>" <?php echo get_paragraph_counting_functions() == AI_STANDARD_PARAGRAPH_COUNTING_FUNCTIONS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_STANDARD; ?></option>
1654
- <option value="<?php echo AI_MULTIBYTE_PARAGRAPH_COUNTING_FUNCTIONS; ?>" <?php echo get_paragraph_counting_functions() == AI_MULTIBYTE_PARAGRAPH_COUNTING_FUNCTIONS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_MULTIBYTE; ?></option>
1655
- </select>
1656
- </td>
1657
- </tr>
1658
- <tr>
1659
- <td>
1660
- No paragraph counting inside
1661
- </td>
1662
- <td>
1663
- <input type="text" name="no-paragraph-counting-inside" value="<?php echo get_no_paragraph_counting_inside (); ?>" default="<?php echo DEFAULT_NO_PARAGRAPH_COUNTING_INSIDE; ?>" size="40" maxlength="80" />
1664
- </td>
1665
- </tr>
1666
- <tr>
1667
- <td>
1668
- Sticky widget mode
1669
- </td>
1670
- <td>
1671
- <select name="sticky-widget-mode" default="<?php echo DEFAULT_STICKY_WIDGET_MODE; ?>" title="CSS mode is the best approach but may not work with all themes. JavaScript mode works with most themes but may reload ads on page load.">
1672
- <option value="<?php echo AI_STICKY_WIDGET_MODE_CSS; ?>" <?php echo get_sticky_widget_mode() == AI_STICKY_WIDGET_MODE_CSS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_CSS; ?></option>
1673
- <option value="<?php echo AI_STICKY_WIDGET_MODE_JS; ?>" <?php echo get_sticky_widget_mode() == AI_STICKY_WIDGET_MODE_JS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_JS; ?></option>
1674
- </select>
1675
- </td>
1676
- </tr>
1677
- <tr>
1678
- <td>
1679
- Sticky widget top margin
1680
- </td>
1681
- <td>
1682
- <input type="text" name="sticky-widget-margin" value="<?php echo get_sticky_widget_margin (); ?>" default="<?php echo DEFAULT_STICKY_WIDGET_MARGIN; ?>" size="6" maxlength="4" /> px
1683
- </td>
1684
- </tr>
1685
- <tr>
1686
- <td>
1687
- Output buffering
1688
- </td>
1689
- <td>
1690
- <select id="output-buffering" name="output-buffering" default="<?php echo DEFAULT_OUTPUT_BUFFERING; ?>" title="Needed for position Above header but may not work with all themes">
1691
- <option value="<?php echo AI_OUTPUT_BUFFERING_DISABLED; ?>" <?php echo get_output_buffering() == AI_OUTPUT_BUFFERING_DISABLED ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_DISABLED; ?></option>
1692
- <option value="<?php echo AI_OUTPUT_BUFFERING_ENABLED; ?>" <?php echo get_output_buffering() == AI_OUTPUT_BUFFERING_ENABLED ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_ENABLED; ?></option>
1693
- </select>
1694
- </td>
1695
- </tr>
1696
- <tr>
1697
- <td>
1698
- Plugin priority
1699
- </td>
1700
- <td>
1701
- <input type="text" name="plugin_priority" value="<?php echo get_plugin_priority (); ?>" default="<?php echo DEFAULT_PLUGIN_PRIORITY; ?>" size="6" maxlength="6" />
1702
- </td>
1703
- </tr>
1704
  </table>
1705
  </div>
1706
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1707
  <div id="tab-viewports" class="rounded">
1708
  <div style="margin: 0 0 8px 0;">
1709
  <strong>Viewport Settings used for client-side device detection</strong>
@@ -1797,7 +1845,7 @@ function generate_settings_form (){
1797
  </div>
1798
 
1799
  <div style="margin: 8px 0;">
1800
- <textarea id="block-h" name="<?php echo AI_OPTION_CODE, '_block_h'; ?>" class="simple-editor" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold;"><?php echo esc_textarea ($adH->get_ad_data()); ?></textarea>
1801
  </div>
1802
 
1803
  <div id="device-detection-settings-h" class="rounded">
@@ -1853,7 +1901,7 @@ function generate_settings_form (){
1853
  </div>
1854
 
1855
  <div style="margin: 8px 0;">
1856
- <textarea id="block-f" name="<?php echo AI_OPTION_CODE, '_block_f'; ?>" class="simple-editor" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold;"><?php echo esc_textarea ($adF->get_ad_data()); ?></textarea>
1857
  </div>
1858
 
1859
  <div id="device-detection-settings-f" class="rounded">
@@ -1997,7 +2045,7 @@ function generate_settings_form (){
1997
  </div>
1998
 
1999
  <div style="margin: 8px 0;">
2000
- <textarea id="block-a" name="<?php echo AI_OPTION_CODE, '_block_a'; ?>" class="simple-editor small" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold;"><?php echo esc_textarea ($adA->get_ad_data()); ?></textarea>
2001
  </div>
2002
 
2003
  <div class="rounded">
@@ -2056,11 +2104,20 @@ function generate_settings_form (){
2056
  </tr>
2057
  <tr class="system-debugging" style="display: none;">
2058
  <td>
2059
- <label for="javascript-debugging" title="Enable Javascript console output">Javascript debugging</label>
2060
  </td>
2061
  <td>
2062
- <input type="hidden" name="javascript_debugging" value="0" />
2063
- <input type="checkbox" name="javascript_debugging" id="javascript-debugging" value="1" default="<?php echo DEFAULT_JAVASCRIPT_DEBUGGING; ?>" <?php if (get_javascript_debugging ()==AI_ENABLED) echo 'checked '; ?> />
 
 
 
 
 
 
 
 
 
2064
  </td>
2065
  </tr>
2066
  <tr class="system-debugging" style="display: none;">
@@ -2526,7 +2583,9 @@ function code_block_list () {
2526
  </table>
2527
  <?php
2528
  if ($row_counter == 0) {
2529
- echo "<div style='margin: 10px 0 0 20px;'>No code block matches search keywords</div>";
 
 
2530
  }
2531
  }
2532
 
@@ -2896,3 +2955,19 @@ function sidebar_pro_small () { ?>
2896
  <?php
2897
  }
2898
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  $syntax_highlighter_theme = get_syntax_highlighter_theme ();
57
  $block_class_name = get_block_class_name ();
58
+ $block_class = get_block_class ();
59
+ $block_number_class = get_block_number_class ();
60
  $inline_styles = get_inline_styles ();
61
 
62
  $default = $block_object [0];
117
 
118
  if (!isset ($_GET ['settings'])): // start of code only for normal settings
119
 
120
+ if (function_exists ('ai_admin_settings_notices')) ai_admin_settings_notices ();
121
  ?>
122
 
123
+ <div id="ai-data" style="display: none;" version="<?php echo AD_INSERTER_VERSION; ?>" theme="<?php echo $syntax_highlighter_theme; ?>" js_debugging="<?php echo $ai_wp_data [AI_BACKEND_JS_DEBUGGING] ? '1' : '0'; ?>" ></div>
124
  <?php
125
  if (function_exists ('ai_data_2')) ai_data_2 ();
126
  ?>
147
  <button type="button" class="ai-top-button" style="display: none; margin: 0 10px 0 0; width: 62px; outline-color: transparent;" onclick="window.open('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4')" title="Support Free Ad Inserter development. If you are making money with Ad Inserter consider donating some small amount. Even 1 dollar counts. Thank you!">Donate</button>
148
  <button type="button" class="ai-top-button" style="display: none; margin: 0 10px 0 0; width: 62px; outline-color: transparent;" onclick="window.open('https://wordpress.org/support/plugin/ad-inserter/reviews/')" title="If you like Ad Inserter and have a moment, please help me spread the word by reviewing the plugin on WordPres">Review</button>
149
  <button type="button" class="ai-top-button" style="display: none; margin: 0 10px 0 0; width: 62px; outline-color: transparent;" onclick="window.open('http://adinserter.pro/')" title="Need more code blocks, GEO targeting, impression and click tracking? Upgrade to Ad Inserter Pro">Go&nbsp;Pro</button>
150
+ <button id="ai-list" type="button" class="ai-top-button" style="width: 62px; display: none; margin-right: 0px; outline-color: transparent;" title="Show list of all code blocks"><span>Blocks</span></button>
151
  </div>
152
 
153
  <div style="clear: both;"></div>
347
  </ul>
348
 
349
  <?php
350
+
351
  for ($block = $start; $block <= $end + 1; $block ++){
352
 
353
  if ($block <= $end) {
358
 
359
  $obj = $block_object [$block];
360
  } else {
361
+ $block = 999;
362
+
363
+ $manual_widget [$block] = $obj->get_enable_widget() == AI_ENABLED;
364
+ $manual_shortcode [$block] = $obj->get_enable_manual() == AI_ENABLED;
365
+ $manual_php_function [$block] = $obj->get_enable_php_call() == AI_ENABLED;
366
+ $manual [$block] = ($manual_widget [$block] && !empty ($sidebars_with_widget [$block])) || $manual_shortcode [$block] || $manual_php_function [$block];
367
+
368
  $default->number = 0;
369
  $default->wp_options [AI_OPTION_BLOCK_NAME] = AD_NAME." 0";
370
 
371
  $tab_visible = false;
372
 
373
  $obj = $default;
 
 
374
  }
375
 
376
  $client_side_devices = $obj->get_detection_client_side () == AI_ENABLED;
401
  $obj->get_enable_amp () == AI_ENABLED ||
402
  $obj->get_enable_ajax () != AI_ENABLED ||
403
  $obj->get_enable_404 () == AI_ENABLED ||
404
+ $obj->get_enable_feed () == AI_ENABLED ||
405
+ $obj->get_disable_caching ();
406
 
407
  $word_count_options =
408
  intval ($obj->get_minimum_words()) != 0 ||
414
 
415
  $adb_block_action_active = $obj->get_adb_block_action () != AI_ADB_BLOCK_ACTION_DO_NOTHING;
416
 
417
+ $general_options = $obj->get_close_button ();
418
+
419
  $show_misc =
420
  $insertion_options ||
421
  $word_count_options ||
422
  $scheduling_active ||
423
  $filter_active ||
424
+ $adb_block_action_active ||
425
+ $general_options;
426
 
427
  if ($show_misc) $misc_style = "font-weight: bold; color: #66f;"; else $misc_style = "";
428
 
431
  if ($scheduling_active) $scheduling_style = "font-weight: bold; color: #66f;"; else $scheduling_style = "";
432
  if ($filter_active) $filter_style = "font-weight: bold; color: #66f;"; else $filter_style = "";
433
  if ($adb_block_action_active) $adb_style = "font-weight: bold; color: #66f;"; else $adb_style = "";
434
+ if ($general_options) $general_style = "font-weight: bold; color: #66f;"; else $general_style = "";
435
 
436
  $automatic_insertion = $obj->get_automatic_insertion();
437
 
582
 
583
  <div id="tab-banner-<?php echo $block; ?>" class="ai-banner ai-banner-top responsive-table rounded">
584
  <div class="banner-preview">
585
+ <a id="banner-link-<?php echo $block; ?>" class="clear-link" target="_blank"><img id="banner-image-<?php echo $block; ?>" src="//:0" style="display: none;" /></a>
586
  </div>
587
  <table class="ai-settings-table">
588
  <tr>
603
  </tr>
604
  <tr>
605
  <td>
606
+ <input type="checkbox" id="open-new-tab-<?php echo $block; ?>" />
607
  </td>
608
  <td>
609
+ <label for="open-new-tab-<?php echo $block; ?>" style="display: inline-block; margin-top: 6px;">Open link in a new tab</label>
610
+ <button id="select-image-button-<?php echo $block; ?>" type="button" class='ai-button select-image' style="display: none; width: 120px; float: right; margin: 7px 0 0 0;">Select Image</button>
611
+ <button id="select-placeholder-button-<?php echo $block; ?>" type="button" class='ai-button select-image' style="display: none; width: 120px; float: right; margin: 7px 10px 0 0;">Select Placeholder</button>
612
  </td>
613
  </tr>
614
  </table>
731
  <?php endif; ?>
732
 
733
  <div style="margin: 8px 0;">
734
+ <textarea id="block-<?php echo $block; ?>" class="simple-editor" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold;" name="<?php echo AI_OPTION_CODE, WP_FORM_FIELD_POSTFIX, $block; ?>" default=""><?php echo esc_textarea ($obj->get_ad_data()); ?></textarea>
735
  </div>
736
 
737
  <div style="padding: 0; min-height: 28px;">
1383
  <li id="ai-misc-filter-<?php echo $block; ?>"><a href="#tab-filter-<?php echo $block; ?>"><span style="<?php echo $filter_style; ?>">Filter</span></a></li>
1384
  <li id="ai-misc-scheduling-<?php echo $block; ?>"><a href="#tab-scheduling-<?php echo $block; ?>"><span style="<?php echo $scheduling_style; ?>">Scheduling</span></a></li>
1385
  <?php if (function_exists ('ai_adb_action_0')) ai_adb_action_0 ($block, $adb_style); ?>
1386
+ <li id="ai-misc-general-<?php echo $block; ?>"><a href="#tab-general-<?php echo $block; ?>"><span style="<?php echo $general_style; ?>">General</span></a></li>
1387
  </ul>
1388
 
1389
+ <div id="tab-insertion-<?php echo $block; ?>" class="max-input" style="padding: 0";>
1390
+ <div class="rounded">
1391
+ <table class="responsive-table" style="width: 70%">
1392
+ <tbody>
1393
+ <tr>
1394
+ <td>
1395
+ <input type="hidden" name="<?php echo AI_OPTION_ENABLE_AMP, WP_FORM_FIELD_POSTFIX, $block; ?>" value="0" />
1396
+ <input style="" id="enable-amp-<?php echo $block; ?>" type="checkbox" name="<?php echo AI_OPTION_ENABLE_AMP, WP_FORM_FIELD_POSTFIX, $block; ?>" value="1" default="<?php echo $default->get_enable_amp(true); ?>" <?php if ($obj->get_enable_amp (true) == AI_ENABLED) echo 'checked '; ?> />
1397
+ <label for="enable-amp-<?php echo $block; ?>" style="<?php if (!$obj->get_enable_amp (true) && $obj->get_enable_amp ()) echo ' color: red;' ?>" title="<?php if (!$obj->get_enable_amp (true) && $obj->get_enable_amp ()) echo "Old settings for AMP pages detected. " ?>To insert different codes on normal and AMP pages separate them with [ADINSERTER AMP] separator. Here you can enable insertion on AMP pages only when you need to insert THE SAME CODE also on AMP pages (no AMP separator).">AMP pages</label>
1398
+ </td>
1399
+ <td>
1400
+ <input type="hidden" name="<?php echo AI_OPTION_ENABLE_AJAX, WP_FORM_FIELD_POSTFIX, $block; ?>" value="0" />
1401
+ <input style="margin-left: 10px;" id="enable-ajax-<?php echo $block; ?>" type="checkbox" name="<?php echo AI_OPTION_ENABLE_AJAX, WP_FORM_FIELD_POSTFIX, $block; ?>" value="1" default="<?php echo $default->get_enable_ajax(); ?>" <?php if ($obj->get_enable_ajax () == AI_ENABLED) echo 'checked '; ?> />
1402
+ <label for="enable-ajax-<?php echo $block; ?>" title="Enable or disable insertion for Ajax requests">Ajax requests</label>
1403
+ </td>
1404
+ <td>
1405
+ <input type="hidden" name="<?php echo AI_OPTION_ENABLE_FEED, WP_FORM_FIELD_POSTFIX, $block; ?>" value="0" />
1406
+ <input style="margin-left: 10px;" id="enable-feed-<?php echo $block; ?>" type="checkbox" name="<?php echo AI_OPTION_ENABLE_FEED, WP_FORM_FIELD_POSTFIX, $block; ?>" value="1" default="<?php echo $default->get_enable_feed(); ?>" <?php if ($obj->get_enable_feed () == AI_ENABLED) echo 'checked '; ?> />
1407
+ <label for="enable-feed-<?php echo $block; ?>" title="Enable or disable insertion in RSS feeds">RSS Feed</label>
1408
+ </td>
1409
+ <td>
1410
+ <input type="hidden" name="<?php echo AI_OPTION_ENABLE_404, WP_FORM_FIELD_POSTFIX, $block; ?>" value="0" />
1411
+ <input style="margin-left: 10px;" id="enable-404-<?php echo $block; ?>" type="checkbox" name="<?php echo AI_OPTION_ENABLE_404, WP_FORM_FIELD_POSTFIX, $block; ?>" value="1" default="<?php echo $default->get_enable_404(); ?>" <?php if ($obj->get_enable_404 () == AI_ENABLED) echo 'checked '; ?> />
1412
+ <label for="enable-404-<?php echo $block; ?>" title="Enable or disable insertion on page for Error 404: Page not found">Error 404 page</label>
1413
+ </td>
1414
+ <td>
1415
+ </tr>
1416
+ </tbody>
1417
+ </table>
1418
+
1419
+ </div>
1420
+ <div class="rounded">
1421
+
1422
+ <table class="responsive-table" style="width: 100%">
1423
+ <tbody>
1424
+ <tr>
1425
+ <td>
1426
+ Insert for
1427
+ <select id="display-for-users-<?php echo $block; ?>" style="margin: 0 1px; width:160px" name="<?php echo AI_OPTION_DISPLAY_FOR_USERS, WP_FORM_FIELD_POSTFIX, $block; ?>" default="<?php echo $default->get_display_for_users(); ?>">
1428
+ <option value="<?php echo AD_DISPLAY_ALL_USERS; ?>" <?php echo ($obj->get_display_for_users()==AD_DISPLAY_ALL_USERS) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_ALL_USERS; ?></option>
1429
+ <option value="<?php echo AD_DISPLAY_LOGGED_IN_USERS; ?>" <?php echo ($obj->get_display_for_users()==AD_DISPLAY_LOGGED_IN_USERS) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_LOGGED_IN_USERS; ?></option>
1430
+ <option value="<?php echo AD_DISPLAY_NOT_LOGGED_IN_USERS; ?>" <?php echo ($obj->get_display_for_users()==AD_DISPLAY_NOT_LOGGED_IN_USERS) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_NOT_LOGGED_IN_USERS; ?></option>
1431
+ <option value="<?php echo AD_DISPLAY_ADMINISTRATORS; ?>" <?php echo ($obj->get_display_for_users()==AD_DISPLAY_ADMINISTRATORS) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_ADMINISTRATORS; ?></option>
1432
+ </select>
1433
+ </td>
1434
+ <td>
1435
+ Max <input type="text" style="width: 32px;" name="<?php echo AI_OPTION_MAXIMUM_INSERTIONS, WP_FORM_FIELD_POSTFIX, $block; ?>" default="<?php echo $default->get_maximum_insertions (); ?>" value="<?php echo $obj->get_maximum_insertions (); ?>" size="1" maxlength="3" title="Empty or 0 means no limit" /> insertions
1436
+ </td>
1437
+ <td style="width: 50%">
1438
+ <span style="float: right;">
1439
+ <input type="hidden" name="<?php echo AI_OPTION_DISABLE_CACHING, WP_FORM_FIELD_POSTFIX, $block; ?>" value="0" />
1440
+ <input id="disable-caching-<?php echo $block; ?>" type="checkbox" name="<?php echo AI_OPTION_DISABLE_CACHING, WP_FORM_FIELD_POSTFIX, $block; ?>" value="1" default="<?php echo $default->get_disable_caching (); ?>" <?php if ($obj->get_disable_caching () == AI_ENABLED) echo 'checked '; ?> />
1441
+ <label for="disable-caching-<?php echo $block; ?>" title="Disable caching for WP Super Cache, W3 Total Cache and WP Rocket plugins">Disable caching</label>
1442
+ </span>
1443
+ </td>
1444
+ </tr>
1445
+ </tbody>
1446
+ </table>
1447
  </div>
1448
  </div>
1449
 
1512
  &nbsp;
1513
  </span>
1514
  <span style="display: table-cell;">
1515
+ <input style="width: 100%;" type="text" name="<?php echo AI_OPTION_GENERAL_TAG, WP_FORM_FIELD_POSTFIX, $block; ?>" default="<?php echo $default->get_ad_general_tag(); ?>" value="<?php echo $obj->get_ad_general_tag(); ?>" size="8" maxlength="40" title="Used for [adinserter data=''] shortcodes when no data is found" />
1516
  </span>
1517
+ <?php if (function_exists ('ai_tab_general')) ai_tab_general ($block, $obj, $default); ?>
1518
  <span style="display: table-cell; width: 400px; white-space: nowrap;">
1519
  </span>
1520
  </div>
1563
  if ($enabled_f) $style_f = "font-weight: bold; color: #66f;"; else $style_f = "";
1564
  if (defined ('AI_ADBLOCKING_DETECTION') && AI_ADBLOCKING_DETECTION) {
1565
  $adb_action = get_adb_action (true);
1566
+ if ($enabled_a) $style_a = "font-weight: bold; color: " . ($adb_action == AI_ADB_ACTION_NONE ? "#66f;" : "#c0f;"); else $style_a = "";
1567
  }
1568
  if (false) $style_d = "font-weight: bold; color: #e44;"; else $style_d = "";
1569
  ?>
1582
  <li id="ai-d" class="ai-plugin-tab"><a href="#tab-debugging"><span style="<?php echo $style_d ?>">Debugging</span></a></li>
1583
  </ul>
1584
 
1585
+ <div id="tab-general" style="padding: 0;">
1586
 
1587
+ <div class="rounded">
1588
+ <table class="ai-settings-table ai-values" style="width: 100%;">
1589
  <?php if (function_exists ('ai_general_settings')) ai_general_settings (); ?>
1590
+ <tr>
1591
+ <td>
1592
+ Plugin priority
1593
+ </td>
1594
+ <td>
1595
+ <input type="text" name="plugin_priority" value="<?php echo get_plugin_priority (); ?>" default="<?php echo DEFAULT_PLUGIN_PRIORITY; ?>" size="6" maxlength="6" />
1596
+ </td>
1597
+ </tr>
1598
+ <tr>
1599
+ <td>
1600
+ Output buffering
1601
+ </td>
1602
+ <td>
1603
+ <select id="output-buffering" name="output-buffering" default="<?php echo DEFAULT_OUTPUT_BUFFERING; ?>" title="Needed for position Above header but may not work with all themes">
1604
+ <option value="<?php echo AI_OUTPUT_BUFFERING_DISABLED; ?>" <?php echo get_output_buffering() == AI_OUTPUT_BUFFERING_DISABLED ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_DISABLED; ?></option>
1605
+ <option value="<?php echo AI_OUTPUT_BUFFERING_ENABLED; ?>" <?php echo get_output_buffering() == AI_OUTPUT_BUFFERING_ENABLED ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_ENABLED; ?></option>
1606
+ </select>
1607
+ </td>
1608
+ </tr>
1609
+ <tr>
1610
+ <td>
1611
+ Syntax highlighting theme
1612
+ </td>
1613
+ <td>
1614
+ <select
1615
+ id="syntax-highlighter-theme"
1616
+ name="syntax-highlighter-theme"
1617
+ value="Value">
1618
+ <optgroup label="None">
1619
+ <option value="<?php echo AI_OPTION_DISABLED; ?>" <?php echo ($syntax_highlighter_theme == AI_OPTION_DISABLED) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>No Syntax Highlighting</option>
1620
+ </optgroup>
1621
+ <optgroup label="Light">
1622
+ <option value="chrome" <?php echo ($syntax_highlighter_theme == 'chrome') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Chrome</option>
1623
+ <option value="clouds" <?php echo ($syntax_highlighter_theme == 'clouds') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Clouds</option>
1624
+ <option value="crimson_editor" <?php echo ($syntax_highlighter_theme == 'crimson_editor') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Crimson Editor</option>
1625
+ <option value="dawn" <?php echo ($syntax_highlighter_theme == 'dawn') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Dawn</option>
1626
+ <option value="dreamweaver" <?php echo ($syntax_highlighter_theme == 'dreamweaver') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Dreamweaver</option>
1627
+ <option value="eclipse" <?php echo ($syntax_highlighter_theme == 'eclipse') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Eclipse</option>
1628
+ <option value="github" <?php echo ($syntax_highlighter_theme == 'github') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>GitHub</option>
1629
+ <option value="katzenmilch" <?php echo ($syntax_highlighter_theme == 'katzenmilch') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Katzenmilch</option>
1630
+ <option value="kuroir" <?php echo ($syntax_highlighter_theme == 'kuroir') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Kuroir</option>
1631
+ <option value="solarized_light" <?php echo ($syntax_highlighter_theme == 'solarized_light') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Solarized Light</option>
1632
+ <option value="textmate" <?php echo ($syntax_highlighter_theme == 'textmate') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Textmate</option>
1633
+ <option value="tomorrow" <?php echo ($syntax_highlighter_theme == 'tomorrow') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Tomorrow</option>
1634
+ <option value="xcode" <?php echo ($syntax_highlighter_theme == 'xcode') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>XCode</option>
1635
+ </optgroup>
1636
+ <optgroup label="Dark">
1637
+ <option value="ad_inserter" <?php echo ($syntax_highlighter_theme == 'ad_inserter') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Ad Inserter</option>
1638
+ <option value="chaos" <?php echo ($syntax_highlighter_theme == 'chaos') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Chaos</option>
1639
+ <option value="clouds_midnight" <?php echo ($syntax_highlighter_theme == 'clouds_midnight') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Clouds Midnight</option>
1640
+ <option value="cobalt" <?php echo ($syntax_highlighter_theme == 'cobalt') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Cobalt</option>
1641
+ <option value="idle_fingers" <?php echo ($syntax_highlighter_theme == 'idle_fingers') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Idle Fingers</option>
1642
+ <option value="kr_theme" <?php echo ($syntax_highlighter_theme == 'kr_theme') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>krTheme</option>
1643
+ <option value="merbivore" <?php echo ($syntax_highlighter_theme == 'merbivore') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Merbivore</option>
1644
+ <option value="merbivore_soft" <?php echo ($syntax_highlighter_theme == 'merbivore_soft') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Merbivore Soft</option>
1645
+ <option value="mono_industrial" <?php echo ($syntax_highlighter_theme == 'mono_industrial') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Mono Industrial</option>
1646
+ <option value="monokai" <?php echo ($syntax_highlighter_theme == 'monokai') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Monokai</option>
1647
+ <option value="pastel_on_dark" <?php echo ($syntax_highlighter_theme == 'pastel_on_dark') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Pastel on Dark</option>
1648
+ <option value="solarized_dark" <?php echo ($syntax_highlighter_theme == 'solarized_dark') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Solarized Dark</option>
1649
+ <option value="terminal" <?php echo ($syntax_highlighter_theme == 'terminal') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Terminal</option>
1650
+ <option value="tomorrow_night" <?php echo ($syntax_highlighter_theme == 'tomorrow_night') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Tomorrow Night</option>
1651
+ <option value="tomorrow_night_blue" <?php echo ($syntax_highlighter_theme == 'tomorrow_night_blue') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Tomorrow Night Blue</option>
1652
+ <option value="tomorrow_night_bright" <?php echo ($syntax_highlighter_theme == 'tomorrow_night_bright') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Tomorrow Night Bright</option>
1653
+ <option value="tomorrow_night_eighties" <?php echo ($syntax_highlighter_theme == 'tomorrow_night_eighties') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Tomorrow Night 80s</option>
1654
+ <option value="twilight" <?php echo ($syntax_highlighter_theme == 'twilight') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Twilight</option>
1655
+ <option value="vibrant_ink" <?php echo ($syntax_highlighter_theme == 'vibrant_ink') ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>>Vibrant Ink</option>
1656
+ </optgroup>
1657
+ </select>
1658
+ </td>
1659
+ </tr>
1660
+ <tr>
1661
+ <td>
1662
+ Min. user role for ind. exceptions editing
1663
+ </td>
1664
+ <td>
1665
+ <select style="margin-bottom: 3px;" id="minimum-user-role" name="minimum-user-role" selected-value="1" data="<?php echo get_minimum_user_role (); ?>" default="<?php echo DEFAULT_MINIMUM_USER_ROLE; ?>" style="width:300px">
1666
+ <?php wp_dropdown_roles (get_minimum_user_role ()); ?>
1667
+ </select>
1668
+ </td>
1669
+ </tr>
1670
+ <tr>
1671
+ <td>
1672
+ Sticky widget mode
1673
+ </td>
1674
+ <td>
1675
+ <select name="sticky-widget-mode" default="<?php echo DEFAULT_STICKY_WIDGET_MODE; ?>" title="CSS mode is the best approach but may not work with all themes. JavaScript mode works with most themes but may reload ads on page load.">
1676
+ <option value="<?php echo AI_STICKY_WIDGET_MODE_CSS; ?>" <?php echo get_sticky_widget_mode() == AI_STICKY_WIDGET_MODE_CSS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_CSS; ?></option>
1677
+ <option value="<?php echo AI_STICKY_WIDGET_MODE_JS; ?>" <?php echo get_sticky_widget_mode() == AI_STICKY_WIDGET_MODE_JS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_JS; ?></option>
1678
+ </select>
1679
+ </td>
1680
+ </tr>
1681
+ <tr>
1682
+ <td>
1683
+ Sticky widget top margin
1684
+ </td>
1685
+ <td>
1686
+ <input type="text" name="sticky-widget-margin" value="<?php echo get_sticky_widget_margin (); ?>" default="<?php echo DEFAULT_STICKY_WIDGET_MARGIN; ?>" size="6" maxlength="4" /> px
1687
+ </td>
1688
+ </tr>
1689
+ <tr>
1690
+ <td>
1691
+ Dynamic blocks
1692
+ </td>
1693
+ <td>
1694
+ <select id="dynamic_blocks" name="dynamic_blocks" default="<?php echo DEFAULT_DYNAMIC_BLOCKS; ?>">
1695
+ <option value="<?php echo AI_DYNAMIC_BLOCKS_SERVER_SIDE; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_SERVER_SIDE ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_SERVER_SIDE; ?></option>
1696
+ <option value="<?php echo AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_SERVER_SIDE_W3TC; ?></option>
1697
+ <option value="<?php echo AI_DYNAMIC_BLOCKS_CLIENT_SIDE; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_CLIENT_SIDE ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_CLIENT_SIDE; ?></option>
1698
+ </select>
1699
+ </td>
1700
+ </tr>
1701
+ <tr>
1702
+ <td>
1703
+ Functions for paragraph counting
1704
+ </td>
1705
+ <td>
1706
+ <select id="paragraph_counting_functions" name="paragraph_counting_functions" default="<?php echo DEFAULT_PARAGRAPH_COUNTING_FUNCTIONS; ?>" title="Standard PHP functions are faster and work in most cases, use Multibyte functions if paragraphs are not counted properly on non-english pages.">
1707
+ <option value="<?php echo AI_STANDARD_PARAGRAPH_COUNTING_FUNCTIONS; ?>" <?php echo get_paragraph_counting_functions() == AI_STANDARD_PARAGRAPH_COUNTING_FUNCTIONS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_STANDARD; ?></option>
1708
+ <option value="<?php echo AI_MULTIBYTE_PARAGRAPH_COUNTING_FUNCTIONS; ?>" <?php echo get_paragraph_counting_functions() == AI_MULTIBYTE_PARAGRAPH_COUNTING_FUNCTIONS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_MULTIBYTE; ?></option>
1709
+ </select>
1710
+ </td>
1711
+ </tr>
1712
+ <tr>
1713
+ <td>
1714
+ No paragraph counting inside
1715
+ </td>
1716
+ <td>
1717
+ <input type="text" name="no-paragraph-counting-inside" value="<?php echo get_no_paragraph_counting_inside (); ?>" default="<?php echo DEFAULT_NO_PARAGRAPH_COUNTING_INSIDE; ?>" size="40" maxlength="80" />
1718
+ </td>
1719
+ </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1720
  </table>
1721
  </div>
1722
 
1723
+ <div class="rounded">
1724
+ <table class="ai-settings-table" style="width: 100%;">
1725
+ <tr>
1726
+ <td>
1727
+ <span title="CSS Class Name for the wrapping div">Block class name</span>
1728
+ <input id="block-class-name" class="ai-block-code-demo" style="margin-left: 5px;" type="text" name="block-class-name" value="<?php echo $block_class_name; ?>" default="<?php echo DEFAULT_BLOCK_CLASS_NAME; ?>" size="15" maxlength="40" />
1729
+ </td>
1730
+ <td>
1731
+ <span title="Include general plugin block class">Block class</span>
1732
+ <input type="hidden" name="block-class" value="0" />
1733
+ <input id="block-class" class="ai-block-code-demo" style="margin-left: 5px;" type="checkbox" name="block-class"value="1" default="<?php echo DEFAULT_BLOCK_CLASS; ?>" <?php if ($block_class == AI_ENABLED) echo 'checked '; ?> />
1734
+ </td>
1735
+ <td>
1736
+ <span title="Include block number class">Block number class</span>
1737
+ <input type="hidden" name="block-number-class" value="0" />
1738
+ <input id="block-number-class" class="ai-block-code-demo" style="margin-left: 5px;" type="checkbox" name="block-number-class"value="1" default="<?php echo DEFAULT_BLOCK_NUMBER_CLASS; ?>" <?php if ($block_number_class == AI_ENABLED) echo 'checked '; ?> />
1739
+ </td>
1740
+ <td>
1741
+ <span title="Instead of alignment classes generate inline alignment styles for code blocks">Inline styles</span>
1742
+ <input type="hidden" name="inline-styles" value="0" />
1743
+ <input id="inline-styles" class="ai-block-code-demo" style="margin-left: 5px;" type="checkbox" name="inline-styles"value="1" default="<?php echo DEFAULT_INLINE_STYLES; ?>" <?php if ($inline_styles == AI_ENABLED) echo 'checked '; ?> />
1744
+ </td>
1745
+ </tr>
1746
+ </table>
1747
+ <div style="margin-top: 8px;">Preview of the block wrapping code</div>
1748
+ <pre style="margin: 0; padding: 5px; background: #eee; color: #00f;" title="Wrapping div"><span id="ai-block-code-demo" ><?php echo ai_block_code_demo ($block_class_name, $block_class, $block_number_class, $inline_styles); ?></span>
1749
+ <span style="color: #222;">BLOCK CODE</span>
1750
+ &lt;/div&gt;</pre>
1751
+ </div>
1752
+
1753
+ </div>
1754
+
1755
  <div id="tab-viewports" class="rounded">
1756
  <div style="margin: 0 0 8px 0;">
1757
  <strong>Viewport Settings used for client-side device detection</strong>
1845
  </div>
1846
 
1847
  <div style="margin: 8px 0;">
1848
+ <textarea id="block-h" name="<?php echo AI_OPTION_CODE, '_block_h'; ?>" class="simple-editor" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold;" default=""><?php echo esc_textarea ($adH->get_ad_data()); ?></textarea>
1849
  </div>
1850
 
1851
  <div id="device-detection-settings-h" class="rounded">
1901
  </div>
1902
 
1903
  <div style="margin: 8px 0;">
1904
+ <textarea id="block-f" name="<?php echo AI_OPTION_CODE, '_block_f'; ?>" class="simple-editor" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold;" default=""><?php echo esc_textarea ($adF->get_ad_data()); ?></textarea>
1905
  </div>
1906
 
1907
  <div id="device-detection-settings-f" class="rounded">
2045
  </div>
2046
 
2047
  <div style="margin: 8px 0;">
2048
+ <textarea id="block-a" name="<?php echo AI_OPTION_CODE, '_block_a'; ?>" class="simple-editor small" style="background-color:#F9F9F9; font-family: Courier, 'Courier New', monospace; font-weight: bold;" default="<?php echo esc_textarea (AI_DEFAULT_ADB_MESSAGE); ?>"><?php echo esc_textarea ($adA->get_ad_data()); ?></textarea>
2049
  </div>
2050
 
2051
  <div class="rounded">
2104
  </tr>
2105
  <tr class="system-debugging" style="display: none;">
2106
  <td>
2107
+ <label for="backend-js-debugging" title="Enable backend javascript console output">Backend javascript debugging</label>
2108
  </td>
2109
  <td>
2110
+ <input type="hidden" name="backend_js_debugging" value="0" />
2111
+ <input type="checkbox" name="backend_js_debugging" id="backend-js-debugging" value="1" default="<?php echo DEFAULT_BACKEND_JS_DEBUGGING; ?>" <?php if (get_backend_javascript_debugging ()==AI_ENABLED) echo 'checked '; ?> />
2112
+ </td>
2113
+ </tr>
2114
+ <tr class="system-debugging" style="display: none;">
2115
+ <td>
2116
+ <label for="frontend-js-debugging" title="Enable frontend javascript console output">Frontend javascript debugging</label>
2117
+ </td>
2118
+ <td>
2119
+ <input type="hidden" name="frontend_js_debugging" value="0" />
2120
+ <input type="checkbox" name="frontend_js_debugging" id="frontend-js-debugging" value="1" default="<?php echo DEFAULT_FRONTEND_JS_DEBUGGING; ?>" <?php if (get_frontend_javascript_debugging ()==AI_ENABLED) echo 'checked '; ?> />
2121
  </td>
2122
  </tr>
2123
  <tr class="system-debugging" style="display: none;">
2583
  </table>
2584
  <?php
2585
  if ($row_counter == 0) {
2586
+ if ($search_text == '')
2587
+ echo "<div style='margin: 10px 0 0 20px;'>No active code block</div>"; else
2588
+ echo "<div style='margin: 10px 0 0 20px;'>No code block matches search keywords</div>";
2589
  }
2590
  }
2591
 
2955
  <?php
2956
  }
2957
 
2958
+ function ai_block_code_demo ($block_class_name, $block_class, $block_number_class, $inline_styles) {
2959
+ global $block_object;
2960
+ $default = $block_object [0];
2961
+
2962
+ $block_class_name = sanitize_html_class ($block_class_name);
2963
+
2964
+ $classes = array ();
2965
+ if ($block_class_name != '' && $block_class) $classes []= $block_class_name;
2966
+ if (defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !$inline_styles) $classes []= $default->generate_alignment_class ($block_class_name);
2967
+ if ($block_class_name != '' && $block_number_class) $classes []= $block_class_name . '-n';
2968
+
2969
+ $class = count ($classes) ? ' class="' . implode (' ', $classes) . '"' : '';
2970
+ $style = $inline_styles || !defined ('AI_NORMAL_HEADER_STYLES') ? ' style="' . AI_ALIGNMENT_CSS_DEFAULT . '"' : '';
2971
+
2972
+ echo "&lt;div$class$style&gt;";
2973
+ }