Weglot Translate – Translate your WP website - Version 2.0.2

Version Description

(24/07/2018) = * Bugfix : Hide menu on non translatable URL * Bugfix : Hide widget on non translatable URL * Improve max file size HTML

Download this release

Release Info

Developer remyb92
Plugin Icon 128x128 Weglot Translate – Translate your WP website
Version 2.0.2
Comparing to
See all releases

Code changes from version 1.13.1 to 2.0.2

Files changed (164) hide show
  1. WeglotWidget.php +0 -49
  2. {images → app/images}/circular_flag.png +0 -0
  3. {images → app/images}/rect_bright.png +0 -0
  4. {images → app/images}/rect_mate.png +0 -0
  5. {images → app/images}/square_flag.png +0 -0
  6. {images → app/images}/wgarrowdown.png +0 -0
  7. app/javascripts/admin-button-preview.js +105 -0
  8. app/javascripts/admin-change-country.js +101 -0
  9. app/javascripts/admin-check-api-key.js +40 -0
  10. app/javascripts/admin-exclusion.js +62 -0
  11. app/javascripts/admin-prevent-save-form.js +31 -0
  12. app/javascripts/admin-select.js +81 -0
  13. app/javascripts/admin-weglot-box.js +19 -0
  14. app/javascripts/filter-polyfill.js +34 -0
  15. app/javascripts/find-polyfill.js +46 -0
  16. app/javascripts/front.js +35 -0
  17. app/javascripts/index.js +17 -0
  18. resources/selectize/js/selectize.min.js → app/javascripts/selectize.js +0 -0
  19. {images → app/static}/weglot_fav.png +0 -0
  20. {images → app/static}/weglot_fav_bw.png +0 -0
  21. app/styles/_colors.scss +4 -0
  22. app/styles/admin.scss +300 -0
  23. app/styles/index.scss +689 -0
  24. {resources/selectize/css → app/styles}/selectize.css +0 -0
  25. bootstrap.php +103 -0
  26. composer.json +30 -0
  27. dist/admin-css.js +1 -0
  28. dist/admin-js.js +1 -0
  29. resources/selectize/css/selectize.default.css → dist/css/admin-css.css +283 -84
  30. dist/css/front-css.css +1043 -0
  31. dist/front-css.js +1 -0
  32. dist/front-js.js +1 -0
  33. dist/images/circular_flag.png +0 -0
  34. dist/images/rect_bright.png +0 -0
  35. dist/images/rect_mate.png +0 -0
  36. dist/images/square_flag.png +0 -0
  37. dist/images/weglot_fav.png +0 -0
  38. dist/images/weglot_fav_bw.png +0 -0
  39. dist/images/wgarrowdown.png +0 -0
  40. dist/selectize.js +3 -0
  41. includes/wg-settings-page.php +0 -419
  42. includes/wg-status-page.php +0 -171
  43. languages/weglot-de_DE.po +1 -1
  44. languages/weglot-en_GB.po +2 -2
  45. languages/weglot-es_ES.po +1 -1
  46. languages/weglot-fr_FR.po +1 -1
  47. languages/weglot-it_IT.po +1 -1
  48. languages/weglot-nl_NL.po +2 -2
  49. languages/weglot-pt_BR.po +1 -1
  50. languages/weglot-ru_RU.po +1 -1
  51. languages/weglot.pot +1 -1
  52. readme.txt +22 -7
  53. resources/selectize/css/jquery-ui.css +0 -1311
  54. resources/selectize/js/jquery-ui.min.js +0 -13
  55. resources/wp-weglot-admin-css-rtl.css +0 -195
  56. resources/wp-weglot-admin-css.css +0 -203
  57. resources/wp-weglot-admin-js.js +0 -455
  58. resources/wp-weglot-css.css +0 -635
  59. resources/wp-weglot-js.js +0 -29
  60. src/Client/WeglotClient.php +0 -821
  61. src/Exceptions/WeglotException.php +0 -7
  62. src/Helpers/WeglotLang.php +0 -240
  63. src/Helpers/WeglotUrl.php +0 -100
  64. src/Helpers/WeglotUtils.php +0 -307
  65. src/Models/TranslateInterface.php +0 -8
  66. src/Notices/AdminNotices.php +0 -91
  67. src/Third/WooCommerce/WeglotTranslateWoo.php +0 -50
  68. src/Third/Yoast/RedirectHandler.php +0 -110
  69. src/WeglotContext.php +0 -53
  70. src/actions/admin/class-admin-enqueue-weglot.php +88 -0
  71. src/actions/admin/class-customize-menu-weglot.php +170 -0
  72. src/actions/admin/class-options-weglot.php +185 -0
  73. src/actions/admin/class-pages-weglot.php +81 -0
  74. src/actions/admin/class-permalink-weglot.php +43 -0
  75. src/actions/admin/class-plugin-links-weglot.php +44 -0
  76. src/actions/class-email-translate-weglot.php +122 -0
  77. src/actions/class-migration-weglot.php +39 -0
  78. src/actions/class-register-widget-weglot.php +31 -0
  79. src/actions/front/class-front-enqueue-weglot.php +57 -0
  80. src/actions/front/class-redirect-log-user-weglot.php +28 -0
  81. src/actions/front/class-shortcode-weglot.php +40 -0
  82. src/actions/front/class-translate-page-weglot.php +412 -0
  83. src/class-bootstrap-weglot.php +153 -0
  84. src/domcheckers/class-meta-twitter.php +27 -0
  85. src/domlisteners/class-meta-listener-weglot.php +44 -0
  86. src/helpers/class-helper-filter-url-weglot.php +103 -0
  87. src/helpers/class-helper-json-inline-weglot.php +34 -0
  88. src/helpers/class-helper-pages-weglot.php +16 -0
  89. src/helpers/class-helper-rollback-weglot.php +79 -0
  90. src/helpers/class-helper-tabs-admin-weglot.php +79 -0
  91. src/models/class-abstract-notices-weglot.php +44 -0
  92. src/models/class-hooks-interface-weglot.php +17 -0
  93. src/models/class-third-active-interface-weglot.php +18 -0
  94. src/models/class-third-translate-interface-weglot.php +17 -0
  95. src/notices/class-curl-weglot.php +25 -0
  96. src/notices/class-no-configuration-weglot.php +26 -0
  97. src/notices/class-rewrite-module-weglot.php +27 -0
  98. src/services/class-button-service-weglot.php +111 -0
  99. src/services/class-dom-checkers-service-weglot.php +41 -0
  100. src/services/class-dom-listeners-service-weglot.php +38 -0
  101. src/services/class-language-service-weglot.php +78 -0
  102. src/services/class-migration-service-weglot.php +79 -0
  103. src/services/class-multisite-service-weglot.php +48 -0
  104. src/services/class-network-service-weglot.php +63 -0
  105. src/services/class-option-service-weglot.php +136 -0
  106. src/services/class-other-translate-service-weglot.php +78 -0
  107. src/services/class-parser-service-weglot.php +67 -0
  108. src/services/class-redirect-service-weglot.php +94 -0
  109. src/services/class-replace-link-service-weglot.php +214 -0
  110. src/services/class-replace-url-service-weglot.php +141 -0
  111. src/services/class-request-url-service-weglot.php +245 -0
  112. src/services/class-user-api-service-weglot.php +131 -0
  113. src/third/amp/class-amp-enqueue-weglot.php +60 -0
  114. src/third/amp/class-amp-service-weglot.php +27 -0
  115. src/third/woocommerce/class-wc-active-weglot.php +38 -0
  116. src/third/woocommerce/class-wc-filter-urls-weglot.php +126 -0
  117. src/third/woocommerce/class-wc-translate-weglot.php +117 -0
  118. src/third/yoast/class-redirect-handler-weglot.php +118 -0
  119. src/third/yoast/redirect-premium.php +12 -0
  120. src/widgets/class-widget-selector-weglot.php +82 -0
  121. templates/admin/notices/no-configuration.php +19 -0
  122. templates/admin/notices/no-curl.php +15 -0
  123. templates/admin/notices/php-min.php +25 -0
  124. templates/admin/notices/rewrite-module.php +15 -0
  125. templates/admin/pages/nav.php +26 -0
  126. templates/admin/pages/settings.php +73 -0
  127. templates/admin/pages/tabs/advanced.php +101 -0
  128. templates/admin/pages/tabs/appearance.php +305 -0
  129. templates/admin/pages/tabs/settings.php +266 -0
  130. templates/admin/pages/tabs/status.php +141 -0
  131. vendor/autoload.php +1 -1
  132. vendor/composer/autoload_files.php +10 -0
  133. vendor/composer/autoload_namespaces.php +1 -0
  134. vendor/composer/autoload_psr4.php +2 -1
  135. vendor/composer/autoload_real.php +22 -4
  136. vendor/composer/autoload_static.php +27 -4
  137. vendor/composer/installed.json +160 -1
  138. vendor/psr/cache/CHANGELOG.md +16 -0
  139. vendor/psr/cache/LICENSE.txt +19 -0
  140. vendor/psr/cache/README.md +9 -0
  141. vendor/psr/cache/composer.json +25 -0
  142. vendor/psr/cache/src/CacheException.php +10 -0
  143. vendor/psr/cache/src/CacheItemInterface.php +105 -0
  144. vendor/psr/cache/src/CacheItemPoolInterface.php +138 -0
  145. vendor/psr/cache/src/InvalidArgumentException.php +13 -0
  146. vendor/weglot/simplehtmldom/.gitignore +1 -0
  147. vendor/weglot/simplehtmldom/composer.json +26 -0
  148. simple_html_dom.php → vendor/weglot/simplehtmldom/src/simple_html_dom.php +1892 -1871
  149. vendor/weglot/weglot-php/.codeclimate.yml +5 -0
  150. vendor/weglot/weglot-php/.editorconfig +8 -0
  151. vendor/weglot/weglot-php/.env.dist +9 -0
  152. vendor/weglot/weglot-php/.github/ISSUE_TEMPLATE.md +15 -0
  153. vendor/weglot/weglot-php/.github/PULL_REQUEST_TEMPLATE.md +11 -0
  154. vendor/weglot/weglot-php/.gitignore +22 -0
  155. vendor/weglot/weglot-php/.php_cs +20 -0
  156. vendor/weglot/weglot-php/.travis.yml +64 -0
  157. vendor/weglot/weglot-php/CHANGELOG.md +153 -0
  158. vendor/weglot/weglot-php/CODE_OF_CONDUCT.md +73 -0
  159. vendor/weglot/weglot-php/CONTRIBUTING.md +57 -0
  160. vendor/weglot/weglot-php/LICENSE.md +21 -0
  161. vendor/weglot/weglot-php/README.md +236 -0
  162. vendor/weglot/weglot-php/codeception.yml +16 -0
  163. vendor/weglot/weglot-php/composer.json +50 -0
  164. vendor/weglot/weglot-php/data/ca-certificates.crt +1087 -0
WeglotWidget.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
-
3
- class WeglotWidget extends WP_Widget {
4
-
5
- public function __construct() {
6
- parent::__construct( false, $name = __( 'Weglot Translate', 'weglot' ) );
7
- }
8
-
9
- public function WeglotWidget() {
10
- parent::__construct( false, $name = __( 'Weglot Translate', 'weglot' ) );
11
- }
12
-
13
- public function update( $new_instance, $old_instance ) {
14
- $instance = array();
15
- $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
16
- return $instance;
17
- }
18
-
19
- function widget( $args, $instance ) {
20
-
21
- $title = apply_filters( 'widget_title', $instance['title'] );
22
-
23
- $tt = ( ! empty( $title ) ) ? $args['before_title'] . $title . $args['after_title'] : '';
24
-
25
- $button = Weglot::Instance()->returnWidgetCode();
26
- echo $args['before_widget'] . $tt . wp_kses($button, Weglot::Instance()
27
- ->getAllowedTags()) .
28
- $args['after_widget'];
29
- }
30
-
31
- public function form( $instance ) {
32
- if ( isset( $instance['title'] ) ) {
33
- $title = $instance['title'];
34
- } else {
35
- $title = '';
36
- }
37
- // Widget admin form
38
- ?>
39
- <p>
40
- <label for="
41
- <?php
42
- echo esc_html( $this->get_field_id( 'title' ) );
43
- ?>
44
- "><?php esc_html_e( 'Title:', 'weglot' ); ?></label>
45
- <input class="widefat" id="<?php echo esc_html( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_html( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
46
- </p>
47
- <?php
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{images → app/images}/circular_flag.png RENAMED
File without changes
{images → app/images}/rect_bright.png RENAMED
File without changes
{images → app/images}/rect_mate.png RENAMED
File without changes
{images → app/images}/square_flag.png RENAMED
File without changes
{images → app/images}/wgarrowdown.png RENAMED
File without changes
app/javascripts/admin-button-preview.js ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const init_admin_button_preview = function () {
2
+ const $ = jQuery
3
+
4
+ const execute = () => {
5
+ // Init old type flags
6
+ let old_type_flags = $("#type_flags").val()
7
+
8
+ let destination_languages = []
9
+ destination_languages.push($(".country-selector label").data("code-language"));
10
+ $(".country-selector li").each((key, itm) => {
11
+ destination_languages.push($(itm).data("code-language"));
12
+ })
13
+
14
+ const weglot_desination_languages = weglot_languages.available.filter(itm => {
15
+ return destination_languages.indexOf(itm.code) >= 0;
16
+ })
17
+
18
+ $("#weglot-css-inline").text(weglot_css.inline);
19
+
20
+ // Change dropdown
21
+ $("#is_dropdown").on("change", function(){
22
+ $(".country-selector").toggleClass("weglot-inline");
23
+ $(".country-selector").toggleClass("weglot-dropdown");
24
+ })
25
+
26
+ // Change with flags
27
+ $("#with_flags").on("change", function() {
28
+ $(".country-selector label, .country-selector li").toggleClass("weglot-flags");
29
+ });
30
+
31
+ // Change type flags
32
+ $("#type_flags").on("change", function(e) {
33
+ $(".country-selector label, .country-selector li").removeClass(`flag-${old_type_flags}`);
34
+ const new_type_flags = e.target.value;
35
+ $(".country-selector label, .country-selector li").addClass(`flag-${new_type_flags}`);
36
+ old_type_flags = new_type_flags;
37
+ });
38
+
39
+ const set_fullname_language = () => {
40
+ const label_language = weglot_desination_languages.find(
41
+ (itm) => itm.code === $(".country-selector label").data("code-language")
42
+ );
43
+
44
+ $(".country-selector label a, .country-selector label span").text(label_language.local);
45
+
46
+ $(".country-selector li").each((key, itm) => {
47
+ const li_language = weglot_desination_languages.find(
48
+ (lang) => lang.code === $(itm).data("code-language")
49
+ );
50
+
51
+ $(itm).find("a").text(li_language.local);
52
+ })
53
+ }
54
+
55
+ // Change with name
56
+ $("#with_name").on("change", function(e) {
57
+ if(e.target.checked){
58
+ set_fullname_language()
59
+ }
60
+ else{
61
+ $(".country-selector label a, .country-selector label span").text("");
62
+ $(".country-selector li a, .country-selector li span").each(
63
+ (key, itm) => {
64
+ $(itm).text("");
65
+ }
66
+ );
67
+ }
68
+ });
69
+
70
+
71
+
72
+ $("#is_fullname").on("change", function(e){
73
+ if (e.target.checked) {
74
+ set_fullname_language();
75
+
76
+ }
77
+ else {
78
+ const label_language = weglot_desination_languages.find(itm => itm.code === $(".country-selector label").data("code-language"));
79
+
80
+ $(".country-selector label a, .country-selector label span").text(label_language.code.toUpperCase());
81
+ $(".country-selector li").each((key, itm) => {
82
+ const language = weglot_desination_languages.find(lang => lang.code === $(itm).data("code-language"));
83
+
84
+ $(itm).find("a").text(language.code.toUpperCase());
85
+ $(itm).find("span").text(language.code.toUpperCase());
86
+ });
87
+ }
88
+ });
89
+
90
+ $("#override_css").on("keyup", function(e) {
91
+ $("#weglot-css-inline").text(e.target.value);
92
+ })
93
+ }
94
+
95
+ document.addEventListener('DOMContentLoaded', () => {
96
+ if ($(".weglot-preview").length === 0){
97
+ return
98
+ }
99
+
100
+ execute();
101
+ })
102
+ }
103
+
104
+ export default init_admin_button_preview;
105
+
app/javascripts/admin-change-country.js ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const init_admin_change_country = function() {
2
+ const $ = jQuery;
3
+
4
+ if(typeof weglot_css !== "undefined"){
5
+ $("#weglot-css-flag-css").text(weglot_css.flag_css);
6
+ }
7
+
8
+ function refresh_flag_css() {
9
+ var en_flags = new Array();
10
+ var es_flags = new Array();
11
+ var pt_flags = new Array();
12
+ var fr_flags = new Array();
13
+ var ar_flags = new Array();
14
+
15
+ en_flags[1] = [3570, 7841, 48, 2712];
16
+ en_flags[2] = [3720, 449, 3048, 4440];
17
+ en_flags[3] = [3840, 1281, 2712, 4224];
18
+ en_flags[4] = [3240, 5217, 1224, 2112];
19
+ en_flags[5] = [4050, 3585, 1944, 2496];
20
+ en_flags[6] = [2340, 3457, 2016, 2016];
21
+
22
+ es_flags[1] = [4320, 4641, 3144, 3552];
23
+ es_flags[2] = [3750, 353, 2880, 4656];
24
+ es_flags[3] = [4200, 1601, 2568, 3192];
25
+ es_flags[4] = [3990, 5793, 1032, 2232];
26
+ es_flags[5] = [5460, 897, 4104, 3120];
27
+ es_flags[6] = [3810, 7905, 216, 3888];
28
+ es_flags[7] = [3630, 8065, 192, 2376];
29
+ es_flags[8] = [3780, 1473, 2496, 4104];
30
+ es_flags[9] = [6120, 2145, 4680, 2568];
31
+ es_flags[10] = [4440, 3009, 3240, 1176];
32
+ es_flags[11] = [5280, 1825, 3936, 2976];
33
+ es_flags[12] = [4770, 2081, 3624, 1008];
34
+ es_flags[13] = [4080, 3201, 2160, 2544];
35
+ es_flags[14] = [4590, 5761, 3432, 624];
36
+ es_flags[15] = [4350, 2209, 3360, 2688];
37
+ es_flags[16] = [5610, 5249, 3168, 528];
38
+ es_flags[17] = [5070, 1729, 3792, 2952];
39
+ es_flags[18] = [6870, 5953, 96, 3408];
40
+ es_flags[19] = [4020, 5697, 1056, 1224];
41
+
42
+ pt_flags[1] = [1740, 5921, 528, 3504];
43
+
44
+ fr_flags[1] = [2760, 736, 2856, 4416];
45
+ fr_flags[2] = [3840, 1280, 2712, 4224];
46
+ fr_flags[3] = [5700, 7201, 5016, 2400];
47
+ fr_flags[4] = [2220, 4160, 1632, 1944];
48
+
49
+ ar_flags[1] = [1830, 129, 3096, 5664];
50
+ ar_flags[2] = [5100, 2177, 3840, 2904];
51
+ ar_flags[3] = [4890, 3425, 3648, 2136];
52
+ ar_flags[4] = [1320, 3681, 1896, 4080];
53
+ ar_flags[5] = [1260, 3841, 1824, 1200];
54
+ ar_flags[6] = [1020, 3969, 1608, 312];
55
+ ar_flags[7] = [4800, 4065, 3600, 72];
56
+ ar_flags[8] = [4710, 4865, 3504, 480];
57
+ ar_flags[9] = [6720, 5984, 5112, 3792];
58
+ ar_flags[10] = [4500, 7233, 3288, 1800];
59
+ ar_flags[11] = [720, 7522, 384, 3936];
60
+ ar_flags[12] = [690, 7745, 336, 1104];
61
+ ar_flags[13] = [600, 8225, 120, 1272];
62
+ ar_flags[14] = [660, 5569, 840, 576];
63
+
64
+ var enval = $("select.flag-en-type").val();
65
+ var esval = $("select.flag-es-type").val();
66
+ var ptval = $("select.flag-pt-type").val();
67
+ var frval = $("select.flag-fr-type").val();
68
+ var arval = $("select.flag-ar-type").val();
69
+
70
+ var en_style = enval <= 0 ? "" : ".weglot-flags.en a:before, .weglot-flags.en span:before { background-position: -" + en_flags[enval][0] + "px 0; } .weglot-flags.flag-1.en a:before, .weglot-flags.flag-1.en span:before { background-position: -" + en_flags[enval][1] + "px 0; } .weglot-flags.flag-2.en a:before, .weglot-flags.flag-2.en span:before { background-position: -" + en_flags[enval][2] + "px 0; } .weglot-flags.flag-3.en a:before, .weglot-flags.flag-3.en span:before { background-position: -" + en_flags[enval][3] + "px 0; } ";
71
+ var es_style = esval <= 0 ? "" : ".weglot-flags.es a:before, .weglot-flags.es span:before { background-position: -" + es_flags[esval][0] + "px 0; } .weglot-flags.flag-1.es a:before, .weglot-flags.flag-1.es span:before { background-position: -" + es_flags[esval][1] + "px 0; } .weglot-flags.flag-2.es a:before, .weglot-flags.flag-2.es span:before { background-position: -" + es_flags[esval][2] + "px 0; } .weglot-flags.flag-3.es a:before, .weglot-flags.flag-3.es span:before { background-position: -" + es_flags[esval][3] + "px 0; } ";
72
+ var pt_style = ptval <= 0 ? "" : ".weglot-flags.pt a:before, .weglot-flags.pt span:before { background-position: -" + pt_flags[ptval][0] + "px 0; } .weglot-flags.flag-1.pt a:before, .weglot-flags.flag-1.pt span:before { background-position: -" + pt_flags[ptval][1] + "px 0; } .weglot-flags.flag-2.pt a:before, .weglot-flags.flag-2.pt span:before { background-position: -" + pt_flags[ptval][2] + "px 0; } .weglot-flags.flag-3.pt a:before, .weglot-flags.flag-3.pt span:before { background-position: -" + pt_flags[ptval][3] + "px 0; } ";
73
+ var fr_style = frval <= 0 ? "" : ".weglot-flags.fr a:before, .weglot-flags.fr span:before { background-position: -" + fr_flags[frval][0] + "px 0; } .weglot-flags.flag-1.fr a:before, .weglot-flags.flag-1.fr span:before { background-position: -" + fr_flags[frval][1] + "px 0; } .weglot-flags.flag-2.fr a:before, .weglot-flags.flag-2.fr span:before { background-position: -" + fr_flags[frval][2] + "px 0; } .weglot-flags.flag-3.fr a:before, .weglot-flags.flag-3.fr span:before { background-position: -" + fr_flags[frval][3] + "px 0; } ";
74
+ var ar_style = arval <= 0 ? "" : ".weglot-flags.ar a:before, .weglot-flags.ar span:before { background-position: -" + ar_flags[arval][0] + "px 0; } .weglot-flags.flag-1.ar a:before, .weglot-flags.flag-1.ar span:before { background-position: -" + ar_flags[arval][1] + "px 0; } .weglot-flags.flag-2.ar a:before, .weglot-flags.flag-2.ar span:before { background-position: -" + ar_flags[arval][2] + "px 0; } .weglot-flags.flag-3.ar a:before, .weglot-flags.flag-3.ar span:before { background-position: -" + ar_flags[arval][3] + "px 0; } ";
75
+
76
+ $("#flag_css, #weglot-css-flag-css").text(en_style + es_style + pt_style + fr_style + ar_style);
77
+ }
78
+
79
+ const execute = () => {
80
+
81
+ $('.flag-style-openclose').on('click',
82
+ function () {
83
+ $('.flag-style-wrapper').toggle();
84
+ }
85
+ );
86
+
87
+ $("select.flag-en-type, select.flag-es-type, select.flag-pt-type, select.flag-fr-type, select.flag-ar-type").on('change',
88
+ function () {
89
+ refresh_flag_css()
90
+ }
91
+ );
92
+
93
+ };
94
+
95
+ document.addEventListener("DOMContentLoaded", () => {
96
+ execute();
97
+ });
98
+ };
99
+
100
+ export default init_admin_change_country;
101
+
app/javascripts/admin-check-api-key.js ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const init_admin_button_preview = function () {
2
+ const $ = jQuery
3
+
4
+ const execute = () => {
5
+
6
+ $("#api_key").blur(function() {
7
+ var key = $(this).val();
8
+ if( key.length === 0){
9
+ $(".weglot-keyres").remove();
10
+ $("#api_key").after('<span class="weglot-keyres weglot-nokkey"></span>');
11
+ $("#wrap-weglot #submit").prop("disabled", true);
12
+ return;
13
+ }
14
+ $.getJSON(
15
+ "https://weglot.com/api/user-info?api_key=" + key,
16
+ function(data) {
17
+ $(".weglot-keyres").remove();
18
+ $("#api_key").after(
19
+ '<span class="weglot-keyres weglot-okkey"></span>'
20
+ );
21
+ $("#wrap-weglot #submit").prop(
22
+ "disabled",
23
+ false
24
+ );
25
+ }
26
+ ).fail(function() {
27
+ $(".weglot-keyres").remove();
28
+ $("#api_key").after('<span class="weglot-keyres weglot-nokkey"></span>');
29
+ $("#wrap-weglot #submit").prop("disabled", true);
30
+ });
31
+ });
32
+ }
33
+
34
+ document.addEventListener('DOMContentLoaded', () => {
35
+ execute();
36
+ })
37
+ }
38
+
39
+ export default init_admin_button_preview;
40
+
app/javascripts/admin-exclusion.js ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const init_admin_exclusion = function () {
2
+ const $ = jQuery
3
+
4
+ const execute = () => {
5
+ const template_add_exclude_url = document.querySelector("#tpl-exclusion-url");
6
+ const template_add_exclude_block = document.querySelector("#tpl-exclusion-block");
7
+ const parent_exclude_url_append = document.querySelector("#container-exclude_urls");
8
+ const parent_exclude_block_append = document.querySelector("#container-exclude_blocks");
9
+
10
+ function removeLine(e) {
11
+ e.preventDefault()
12
+ this.parentNode.remove()
13
+ }
14
+
15
+ if (document.querySelector("#js-add-exclude-url")) {
16
+
17
+ document
18
+ .querySelector("#js-add-exclude-url")
19
+ .addEventListener("click", (e) => {
20
+ e.preventDefault()
21
+ parent_exclude_url_append.insertAdjacentHTML("beforeend", template_add_exclude_url.innerHTML);
22
+ document
23
+ .querySelector(
24
+ "#container-exclude_urls .item-exclude:last-child .js-btn-remove"
25
+ )
26
+ .addEventListener("click", removeLine);
27
+ });
28
+
29
+ }
30
+
31
+
32
+ if (document.querySelector("#js-add-exclude-block")) {
33
+ document
34
+ .querySelector("#js-add-exclude-block")
35
+ .addEventListener("click", (e) => {
36
+ e.preventDefault()
37
+ parent_exclude_block_append.insertAdjacentHTML("beforeend", template_add_exclude_block.innerHTML);
38
+ document
39
+ .querySelector(
40
+ "#container-exclude_blocks .item-exclude:last-child .js-btn-remove-exclude"
41
+ )
42
+ .addEventListener("click", removeLine);
43
+ });
44
+ }
45
+
46
+ const remove_urls = document
47
+ .querySelectorAll(".js-btn-remove")
48
+
49
+ remove_urls.forEach((el) => {
50
+ el.addEventListener("click", removeLine);
51
+ })
52
+
53
+
54
+ }
55
+
56
+ document.addEventListener('DOMContentLoaded', () => {
57
+ execute();
58
+ })
59
+ }
60
+
61
+ export default init_admin_exclusion;
62
+
app/javascripts/admin-prevent-save-form.js ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const init_prevent_save_form = function () {
2
+
3
+ const $ = jQuery
4
+
5
+ const execute = () => {
6
+
7
+ let warning = false;
8
+ $(document).on({
9
+ change: () => warning = true,
10
+ keyup: () => warning = true
11
+ }, "input[type='text'], select, textarea, input[type='checkbox']")
12
+
13
+ $("input[type='submit']").on("click", (e) => {
14
+ warning = false
15
+ })
16
+
17
+ window.onbeforeunload = function () {
18
+ if (warning) {
19
+ return "You have made changes on this page that you have not yet confirmed. If you navigate away from this page you will lose your unsaved changes";
20
+ }
21
+ }
22
+
23
+ }
24
+
25
+ document.addEventListener('DOMContentLoaded', () => {
26
+ execute();
27
+ })
28
+ }
29
+
30
+ export default init_prevent_save_form;
31
+
app/javascripts/admin-select.js ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const init_admin_select = function(){
2
+
3
+ const $ = jQuery
4
+ const generate_destination_language = () => {
5
+ return weglot_languages.available.filter(itm => {
6
+ return itm.code !== weglot_languages.original
7
+ });
8
+ }
9
+
10
+ let destination_selectize
11
+
12
+ const execute = () => {
13
+ $(".weglot-select-original").selectize({
14
+ delimiter: "|",
15
+ persist: false,
16
+ valueField: "code",
17
+ labelField: "local",
18
+ searchField: ["code", "english", "local"],
19
+ sortField: [
20
+ { field: "code", direction: "asc" },
21
+ { field: "english", direction: "asc" }
22
+ ],
23
+ maxItems: 1,
24
+ plugins: ["remove_button"],
25
+ options: weglot_languages.available,
26
+ onChange: value => {
27
+ if(value.length > 0){
28
+ destination_selectize.data('selectize').clearOptions()
29
+
30
+ destination_selectize
31
+ .data("selectize")
32
+ .addOption(weglot_languages.available.filter(itm => {
33
+ return itm.code !== value
34
+ }));
35
+ }
36
+ }
37
+ });
38
+
39
+
40
+ destination_selectize = $(".weglot-select-destination").selectize(
41
+ {
42
+ delimiter: "|",
43
+ persist: false,
44
+ valueField: "code",
45
+ labelField: "local",
46
+ searchField: ["code", "english", "local"],
47
+ sortField: [
48
+ { field: "code", direction: "asc" },
49
+ { field: "english", direction: "asc" }
50
+ ],
51
+ maxItems: weglot_languages.limit,
52
+ plugins: ["remove_button"],
53
+ options: generate_destination_language(),
54
+ render: {
55
+ option: function(item, escape) {
56
+ return (
57
+ '<div class="weglot__choice__language">' +
58
+ '<span class="weglot__choice__language--local">' +
59
+ escape(item.local) +
60
+ "</span>" +
61
+ '<span class="weglot__choice__language--english">' +
62
+ escape(item.english) +
63
+ " [" +
64
+ escape(item.code) +
65
+ "]</span>" +
66
+ "</div>"
67
+ );
68
+ }
69
+ }
70
+ }
71
+ );
72
+
73
+ }
74
+
75
+ document.addEventListener('DOMContentLoaded', () => {
76
+ execute();
77
+ })
78
+ }
79
+
80
+ export default init_admin_select;
81
+
app/javascripts/admin-weglot-box.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ const init_admin_weglot_box = function () {
4
+ const $ = jQuery
5
+
6
+ const execute = () => {
7
+ $("#weglot-box-first-settings .weglot-btn-close").on("click", function(e) {
8
+ e.preventDefault();
9
+ $("#weglot-box-first-settings").hide();
10
+ })
11
+ }
12
+
13
+ document.addEventListener('DOMContentLoaded', () => {
14
+ execute();
15
+ })
16
+ }
17
+
18
+ export default init_admin_weglot_box;
19
+
app/javascripts/filter-polyfill.js ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (!Array.prototype.filter) {
2
+ Array.prototype.filter = function (func, thisArg) {
3
+ 'use strict';
4
+ if (!((typeof func === 'Function' || typeof func === 'function') && this))
5
+ throw new TypeError();
6
+
7
+ var len = this.length >>> 0,
8
+ res = new Array(len), // preallocate array
9
+ t = this, c = 0, i = -1;
10
+ if (thisArg === undefined) {
11
+ while (++i !== len) {
12
+ // checks to see if the key was set
13
+ if (i in this) {
14
+ if (func(t[i], i, t)) {
15
+ res[c++] = t[i];
16
+ }
17
+ }
18
+ }
19
+ }
20
+ else {
21
+ while (++i !== len) {
22
+ // checks to see if the key was set
23
+ if (i in this) {
24
+ if (func.call(thisArg, t[i], i, t)) {
25
+ res[c++] = t[i];
26
+ }
27
+ }
28
+ }
29
+ }
30
+
31
+ res.length = c; // shrink down array to proper size
32
+ return res;
33
+ };
34
+ }
app/javascripts/find-polyfill.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // https://tc39.github.io/ecma262/#sec-array.prototype.find
2
+ if (!Array.prototype.find) {
3
+ Object.defineProperty(Array.prototype, 'find', {
4
+ value: function (predicate) {
5
+ // 1. Let O be ? ToObject(this value).
6
+ if (this == null) {
7
+ throw new TypeError('"this" is null or not defined');
8
+ }
9
+
10
+ var o = Object(this);
11
+
12
+ // 2. Let len be ? ToLength(? Get(O, "length")).
13
+ var len = o.length >>> 0;
14
+
15
+ // 3. If IsCallable(predicate) is false, throw a TypeError exception.
16
+ if (typeof predicate !== 'function') {
17
+ throw new TypeError('predicate must be a function');
18
+ }
19
+
20
+ // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
21
+ var thisArg = arguments[1];
22
+
23
+ // 5. Let k be 0.
24
+ var k = 0;
25
+
26
+ // 6. Repeat, while k < len
27
+ while (k < len) {
28
+ // a. Let Pk be ! ToString(k).
29
+ // b. Let kValue be ? Get(O, Pk).
30
+ // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
31
+ // d. If testResult is true, return kValue.
32
+ var kValue = o[k];
33
+ if (predicate.call(thisArg, kValue, k, o)) {
34
+ return kValue;
35
+ }
36
+ // e. Increase k by 1.
37
+ k++;
38
+ }
39
+
40
+ // 7. Return undefined.
41
+ return undefined;
42
+ },
43
+ configurable: true,
44
+ writable: true
45
+ });
46
+ }
app/javascripts/front.js ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ document.addEventListener("DOMContentLoaded", function(event) {
3
+
4
+ const getOffset = (element) => {
5
+ let top = 0, left = 0;
6
+ do {
7
+ top += element.offsetTop || 0;
8
+ left += element.offsetLeft || 0;
9
+ element = element.offsetParent;
10
+ } while (element);
11
+
12
+ return {
13
+ top: top,
14
+ left: left
15
+ };
16
+ }
17
+
18
+ const button = document.querySelector(".country-selector");
19
+ if(!button){
20
+ return;
21
+ }
22
+ const h = getOffset( button ).top;
23
+ const body = document.body,html = document.documentElement;
24
+ const page_height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
25
+
26
+ const position = window.getComputedStyle( button ).getPropertyValue( "position" );
27
+ const bottom = window.getComputedStyle( button ).getPropertyValue( "bottom" );
28
+ const top = window.getComputedStyle( button ).getPropertyValue( "top" );
29
+
30
+ if ((position !== "fixed" && h > page_height / 2) || (position === "fixed" && h > 100)) {
31
+ button.className += " weglot-invert";
32
+ }
33
+ return false;
34
+ });
35
+
app/javascripts/index.js ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import InitAdminSelect from './admin-select'
2
+ import InitAdminWeglotBox from './admin-weglot-box'
3
+ import InitAdminExclusion from './admin-exclusion'
4
+ import InitAdminButtonPreview from './admin-button-preview'
5
+ import InitAdminCheckApiKey from './admin-check-api-key'
6
+ import InitAdminChangeCountry from './admin-change-country'
7
+ import InitAdminPreventSaveForm from './admin-prevent-save-form'
8
+ import './find-polyfill'
9
+ import './filter-polyfill'
10
+
11
+ InitAdminSelect()
12
+ InitAdminExclusion();
13
+ InitAdminWeglotBox();
14
+ InitAdminButtonPreview();
15
+ InitAdminCheckApiKey();
16
+ InitAdminChangeCountry();
17
+ InitAdminPreventSaveForm();
resources/selectize/js/selectize.min.js → app/javascripts/selectize.js RENAMED
File without changes
{images → app/static}/weglot_fav.png RENAMED
File without changes
{images → app/static}/weglot_fav_bw.png RENAMED
File without changes
app/styles/_colors.scss ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ $primary: #335ee2;
2
+ $primaryHover: #446dea;
3
+
4
+ $textColor: #24284c;
app/styles/admin.scss ADDED
@@ -0,0 +1,300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '_colors.scss';
2
+ @import 'selectize.css';
3
+
4
+ .weglot__choice__language{
5
+ border-bottom:1px solid #eee;
6
+ margin:5px 0px;
7
+ &--english{
8
+ border-width:50px;
9
+ color:#757575;
10
+ display:block;
11
+ }
12
+ }
13
+
14
+ .btn{
15
+ background:$primary;
16
+ display: inline-block;
17
+ padding: 8px 10px;
18
+ border-radius: 4px;
19
+ transition: .2s background linear,.2s color linear,.2s border linear,.2s text-shadow linear;
20
+ outline: 0;
21
+ -webkit-font-smoothing: antialiased;
22
+ text-rendering: optimizeLegibility;
23
+ font-weight: 700;
24
+ cursor: pointer;
25
+ text-align: center;
26
+ text-decoration: none;
27
+ box-shadow: none;
28
+ white-space: nowrap;
29
+ color:white;
30
+ border:1px solid $primary;
31
+ &.btn-soft{
32
+ background-color: #fff;
33
+ color:$textColor;
34
+ border-color:#eaeaea;
35
+
36
+ }
37
+ &.btn-primary{
38
+ &:active,
39
+ &:focus,
40
+ &:hover{
41
+ border-color: $primaryHover;
42
+ background-color: $primaryHover;
43
+ }
44
+ }
45
+
46
+ }
47
+
48
+ .js-btn-remove{
49
+ border: none;
50
+ background-color: #ed6657;
51
+ color: #fff;
52
+ display: inline-block;
53
+ width: 32px;
54
+ height: 32px;
55
+ position: relative;
56
+ border-radius: 50%;
57
+ cursor: pointer;
58
+ transform: translateY(-5%);
59
+ margin-left:10px;
60
+ transition: opacity 175ms linear;
61
+ outline: 0;
62
+ }
63
+
64
+ .item-exclude{
65
+ position: relative;
66
+ margin-bottom: 10px;
67
+ }
68
+
69
+ input[type='text'],textarea {
70
+ &:focus {
71
+ border-color: $primaryHover;
72
+ box-shadow: none;
73
+ }
74
+ }
75
+
76
+ ::-webkit-input-placeholder,
77
+ :-moz-placeholder,
78
+ ::-moz-placeholder,
79
+ :-ms-input-placeholder
80
+ {
81
+ color: #C0C0C0;
82
+ }
83
+
84
+ .sub-label {
85
+ font-size: 13px;
86
+ font-weight: normal;
87
+ margin: 2px 0 0;
88
+ }
89
+
90
+ .original-select,
91
+ #type_flags {
92
+ padding: 8px;
93
+ height: 36px!important;
94
+ width: 300px;
95
+ }
96
+ #type_flags {
97
+ width: 150px;
98
+ }
99
+
100
+ .selectize-control.multi .selectize-input > div {
101
+ background-color : #eff0ff;
102
+ }
103
+
104
+ input[type="text"], .wg-input-textarea {
105
+ padding:8px;
106
+ }
107
+ .wg-input-textarea::placeholder{
108
+ color:#ccc;
109
+ }
110
+
111
+
112
+ #wrap-weglot{
113
+
114
+ .weglot-nokkey:before {
115
+ content:'\274C';
116
+ display:inline-block;
117
+ color:red;
118
+ padding:0 6px 0 0;
119
+ font-size: 15px;
120
+ padding:0 10px;
121
+ }
122
+ .weglot-okkey:before {
123
+ content: '\2713';
124
+ display: inline-block;
125
+ color: green;
126
+ padding: 0 10px;
127
+ font-size: 20px;
128
+ font-weight: bold;
129
+ padding:0 10px;
130
+ }
131
+ display:flex;
132
+ .wrap {
133
+ flex: 4;
134
+ }
135
+ .weglot-infobox{
136
+ flex:2;
137
+ align-self: start;
138
+ margin:10px 20px 0 2px;
139
+ background-color: #fff;
140
+ background-color: white;
141
+ border: 1px solid #e0e0e0;
142
+ h3 {
143
+ color : white;
144
+ background-color : #24284C;
145
+ padding : 20px;
146
+ margin : 0px;
147
+ font-size: 23px;
148
+ line-height: 1.3;
149
+ }
150
+ div {
151
+ padding: 15px;
152
+ }
153
+ .weglot-editbtn {
154
+ background: #e56b60;
155
+ color: white;
156
+ font-weight: bold;
157
+ border-radius: 0px;
158
+ border-bottom: 2px solid #B7564D;
159
+ font-size: 18px!important;
160
+ height: 37px!important;
161
+ line-height: 34px!important;
162
+ text-decoration : none;
163
+ padding : 10px 15px;
164
+ display : inline-block;
165
+ transition:all .2s ease-in;
166
+ &:hover {
167
+ color : white;
168
+ background: #E87A70;
169
+ }
170
+ p {
171
+ font-size: 15px;
172
+ }
173
+ }
174
+ }
175
+
176
+ .selectize-control,
177
+ input[type="text"],
178
+ .wg-input-textarea {
179
+ width : 100%;
180
+ max-width: 300px;
181
+ }
182
+
183
+ #submit {
184
+ height: 50px;
185
+ padding: 0 30px!important;
186
+ font-size: 16px;
187
+ }
188
+
189
+ .description {
190
+ display: inline-block;
191
+ }
192
+
193
+ .wg-tooltip {
194
+ position : absolute;
195
+ display:none;
196
+ }
197
+
198
+ #mainform {
199
+ margin-bottom: 50px;
200
+ }
201
+ .arrow-up {
202
+ width: 0;
203
+ height: 0;
204
+ border-left: 10px solid transparent;
205
+ border-right: 10px solid transparent;
206
+ border-bottom: 10px solid #24292d;
207
+ position: absolute;
208
+ top: -10px;
209
+ left: 36px;
210
+ }
211
+
212
+ .question-icon {
213
+ font-size : 17px;
214
+ }
215
+
216
+ }
217
+
218
+
219
+ .weglot-info {
220
+ position: relative;
221
+ color: #3741cc;
222
+ font-weight: bold;
223
+
224
+ &:hover {
225
+ .wg-tooltip {
226
+ line-height: 1.4;
227
+ position: absolute;
228
+ top: 27px;
229
+ display: block!important;
230
+ background-color: #24292d;
231
+ width: 160px;
232
+ padding: 10px;
233
+ color: white;
234
+ font-weight: normal;
235
+ border: 1px solid #e0e0e0;
236
+ font-size: 12px;
237
+ }
238
+ }
239
+ }
240
+
241
+ .weglot-box-overlay{
242
+ position: fixed;
243
+ top: 0;
244
+ left: 0;
245
+ display: flex;
246
+ width: 100%;
247
+ height: 100%;
248
+ background-color: rgba(0,0,0,0.85);
249
+ z-index: 9999;
250
+ justify-content: center;
251
+ align-items: center;
252
+ .weglot-box{
253
+ background-color: #fff;
254
+ padding: 25px;
255
+ text-align:center;
256
+ -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
257
+ -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
258
+ box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
259
+ &--title{
260
+ font-size: 24px;
261
+ line-height: 1.3;
262
+ }
263
+ &--text{
264
+ font-size: 18px;
265
+ }
266
+ &--subtext{
267
+ font-size: 12px;
268
+ font-style: italic;
269
+ }
270
+ }
271
+ .weglot-btn-close{
272
+ float:right;
273
+ cursor: pointer;
274
+ }
275
+ }
276
+
277
+
278
+ .flag-style-openclose {
279
+ display: inline-block;
280
+ font-size: 12px;
281
+ color: #51C7A7;
282
+ text-decoration: underline;
283
+ cursor: default;
284
+ margin-right: 20px;
285
+ &:hover{
286
+ opacity : 0.6;
287
+ cursor: pointer;
288
+ }
289
+ }
290
+
291
+ .flag-style-wrapper {
292
+ padding : 15px 0px;
293
+ p {
294
+ font-size : 12px!important;
295
+ }
296
+ select {
297
+ padding : 3px!important;
298
+ font-size : 12px;
299
+ }
300
+ }
app/styles/index.scss ADDED
@@ -0,0 +1,689 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ @import '_colors.scss';
3
+ $heightSelector: 37px;
4
+ $lineHeight: 36px;
5
+
6
+ .country-selector {
7
+ z-Index : 9999;
8
+ text-align: left;
9
+ position: relative;
10
+ display : inline-block;
11
+ width: auto;
12
+
13
+ a {
14
+ padding: 0 10px;
15
+ outline : none;
16
+ text-decoration: none;
17
+ float: none!important;
18
+ white-space: nowrap;
19
+ font-weight : normal;
20
+ cursor: pointer;
21
+ color : black;
22
+ -webkit-touch-callout: none; /* iOS Safari */
23
+ user-select: none;
24
+ &:focus {
25
+ outline : none;
26
+ }
27
+ }
28
+
29
+ ul {
30
+ padding: 0px;
31
+ z-index: 1010;
32
+ list-style: none;
33
+ margin: 0;
34
+ }
35
+
36
+ li {
37
+ margin : 0px;
38
+ padding : 0px;
39
+ }
40
+
41
+ &.weglot-dropdown {
42
+ background-color : white;
43
+
44
+ a, span {
45
+ display: block;
46
+ height: $heightSelector;
47
+ line-height: $lineHeight;
48
+ font-size: 13px;
49
+ padding : 0 10px;
50
+ width : 100%;
51
+ box-sizing: border-box;
52
+ font-weight: normal;
53
+ &:hover{
54
+ cursor: pointer;
55
+ }
56
+ }
57
+
58
+ .wgcurrent {
59
+ border: 1px solid #e0e0e0;
60
+ list-style: none;
61
+ display: block;
62
+ margin: 0;
63
+ a, span{
64
+ padding-right: 60px;
65
+ }
66
+
67
+ &:after {
68
+ display: inline-block;
69
+ position: absolute;
70
+ top: 17px;
71
+ right: 8px;
72
+ width: 13px;
73
+ height: 7px;
74
+ image-rendering: pixelated;
75
+ background : url('../images/wgarrowdown.png') no-repeat;
76
+ content: '';
77
+ transition: all 200ms;
78
+ transform: rotate(-90deg);
79
+ }
80
+ }
81
+
82
+ ul {
83
+ position: absolute;
84
+ min-width: 100%;
85
+ border: 1px solid #ebeef0;
86
+ background: white ;
87
+ left : 0;
88
+ top : initial;
89
+ box-sizing: border-box;
90
+ display : none;
91
+ padding: 0;
92
+
93
+ }
94
+
95
+ input:checked ~ ul{
96
+ display : block;
97
+ }
98
+
99
+ input:checked ~ .wgcurrent:after {
100
+ transform: rotate(0deg);
101
+ }
102
+
103
+ li {
104
+ width : 100%;
105
+ }
106
+
107
+ &.weglot-invert{
108
+ ul{
109
+ bottom:38px;
110
+ }
111
+ input:checked ~ .wgcurrent:after {
112
+ transform: rotate(-180deg);
113
+ }
114
+ }
115
+
116
+ }
117
+
118
+ &.weglot-default {
119
+ position : fixed;
120
+ bottom : 0px;
121
+ right : 40px;
122
+ }
123
+
124
+ &.weglot-inline {
125
+ a {
126
+ &:hover {
127
+ text-decoration : underline;
128
+ color : #00a0d2;
129
+ }
130
+ }
131
+
132
+ .wgcurrent {
133
+ a {
134
+ text-decoration: underline;
135
+ }
136
+ }
137
+
138
+ label {
139
+ margin-bottom: 0;
140
+ display: inline-block;
141
+ vertical-align: middle;
142
+ }
143
+
144
+ ul {
145
+ display: inline-block;
146
+ vertical-align: middle;
147
+ }
148
+
149
+ li {
150
+ line-height:1 !important;
151
+ display : inline-block;
152
+ margin: 2px 0px;
153
+ vertical-align: middle;
154
+ }
155
+
156
+ &.weglot-default {
157
+ bottom : 5px;
158
+ }
159
+ }
160
+
161
+
162
+
163
+ input{
164
+ display:none !important;
165
+ }
166
+
167
+ }
168
+
169
+ .navbar {
170
+ .navbar-nav {
171
+ li.weglot-flags {
172
+ a.weglot-lang {
173
+ &:before{
174
+ position: static;
175
+ transform: none;
176
+ transition: none;
177
+ }
178
+ }
179
+ }
180
+ }
181
+ }
182
+
183
+ html[dir="rtl"]{
184
+ .weglot-flags a:before, .weglot-flags span:before {
185
+ margin-right:0;
186
+ margin-left:10px;
187
+ }
188
+ }
189
+
190
+ .weglot-flags {
191
+ a, span {
192
+ &:before {
193
+ background-image: url('../images/rect_mate.png');
194
+ background-size: auto 20px;
195
+ border-radius: 0px;
196
+ width: 30px;
197
+ height: 20px;
198
+ content: "";
199
+ vertical-align: middle;
200
+ margin-right: 10px;
201
+ display: inline-block;
202
+ overflow: hidden;
203
+ }
204
+ }
205
+ &.flag-1 {
206
+ a, span {
207
+ &:before {
208
+ background-image: url("../images/rect_bright.png");
209
+ }
210
+ }
211
+ }
212
+ &.flag-2 {
213
+ a, span {
214
+ &:before {
215
+ background-image: url("../images/square_flag.png");
216
+ width: 24px;
217
+ height: 24px;
218
+ background-size: auto 24px;
219
+ }
220
+ }
221
+ }
222
+ &.flag-3 {
223
+ a, span {
224
+ &:before {
225
+ background-image: url("../images/circular_flag.png");
226
+ width: 24px;
227
+ height: 24px;
228
+ background-size: auto 24px;
229
+ }
230
+ }
231
+ }
232
+
233
+
234
+ a {
235
+ span:before {
236
+ background-image: none !important;
237
+ display: none !important;
238
+ }
239
+ }
240
+ span {
241
+ a:before {
242
+ background-image: none !important;
243
+ display: none !important;
244
+ }
245
+ }
246
+
247
+ &.hw a:before, &.hw span:before { background-position: -3570px 0; }
248
+ &.af a:before, &.af span:before { background-position: -6570px 0; }
249
+ &.fl a:before, &.fl span:before { background-position: -3060px 0px; }
250
+ &.sq a:before, &.sq span:before { background-position: -2580px 0; }
251
+ &.am a:before, &.am span:before { background-position: -5130px 0; }
252
+ &.ar a:before, &.ar span:before { background-position: -510px 0; }
253
+ &.hy a:before, &.hy span:before { background-position: -1800px 0; }
254
+ &.az a:before, &.az span:before { background-position: -6840px 0; }
255
+ &.ba a:before, &.ba span:before { background-position: -2040px 0; }
256
+ &.eu a:before, &.eu span:before { background-position: -7260px 0; }
257
+ &.be a:before, &.be span:before { background-position: -5310px 0; }
258
+ &.bn a:before, &.bn span:before { background-position: -5400px 0; }
259
+ &.bs a:before, &.bs span:before { background-position: -6390px 0; }
260
+ &.bg a:before, &.bg span:before { background-position: -2730px 0; }
261
+ &.my a:before, &.my span:before { background-position: -3299px 0; }
262
+ &.ca a:before, &.ca span:before { background-position: -7230px 0; }
263
+ &.zh a:before, &.zh span:before { background-position: -3690px 0; }
264
+ &.tw a:before, &.tw span:before { background-position: -2970px 0; }
265
+ &.km a:before, &.km span:before { background-position: -6930px 0; }
266
+ &.ny a:before, &.ny span:before { background-position: -1140px 0; }
267
+ &.co a:before, &.co span:before { background-position: -2520px 0; } /* a faire */
268
+ &.hr a:before, &.hr span:before { background-position: -5910px 0; }
269
+ &.cs a:before, &.cs span:before { background-position: -2700px 0; }
270
+ &.da a:before, &.da span:before { background-position: -2670px 0; }
271
+ &.nl a:before, &.nl span:before { background-position: -2100px 0; }
272
+ &.en a:before, &.en span:before { background-position: -1920px 0; }
273
+ &.eo a:before, &.eo span:before { background-position: -1920px 0; } /* a faire */
274
+ &.et a:before, &.et span:before { background-position: -2640px 0; }
275
+ &.fj a:before, &.fj span:before { background-position: -1710px 0; }
276
+ &.fi a:before, &.fi span:before { background-position: -2550px 0; }
277
+ &.fr a:before, &.fr span:before { background-position: -2520px 0; }
278
+ &.gl a:before, &.gl span:before { background-position: -480px 0; }
279
+ &.ka a:before, &.ka span:before { background-position: -5040px 0; }
280
+ &.de a:before, &.de span:before { background-position: -2490px 0; }
281
+ &.el a:before, &.el span:before { background-position: -2460px 0; }
282
+ &.gu a:before, &.gu span:before { background-position: -1170px 0; }
283
+ &.ht a:before, &.ht span:before { background-position: -4650px 0; }
284
+ &.ha a:before, &.ha span:before { background-position: -900px 0; }
285
+ &.he a:before, &.he span:before { background-position: -1050px 0; }
286
+ &.hi a:before, &.hi span:before { background-position: -1170px 0; }
287
+ &.hu a:before, &.hu span:before { background-position: -2430px 0; }
288
+ &.is a:before, &.is span:before { background-position: -2400px 0; }
289
+ &.ig a:before, &.ig span:before { background-position: -870px 0; }
290
+ &.id a:before, &.id span:before { background-position: -3510px 0; }
291
+ &.ga a:before, &.ga span:before { background-position: -2340px 0; }
292
+ &.it a:before, &.it span:before { background-position: -2310px 0; }
293
+ &.ja a:before, &.ja span:before { background-position: -3480px 0; }
294
+ &.jv a:before, &.jv span:before { background-position: -3360px 0; }
295
+ &.kn a:before, &.kn span:before { background-position: -1170px 0; }
296
+ &.kk a:before, &.kk span:before { background-position: -3150px 0; }
297
+ &.ko a:before, &.ko span:before { background-position: -6990px 0; }
298
+ &.ku a:before, &.ku span:before { background-position: -2430px 0; } /* a faire */
299
+ &.ky a:before, &.ky span:before { background-position: -3420px 0; }
300
+ &.lo a:before, &.lo span:before { background-position: -3450px 0; } /* a faire */
301
+ &.la a:before, &.la span:before { background-position: -2310px 0; }
302
+ &.lv a:before, &.lv span:before { background-position: -2280px 0; }
303
+ &.lt a:before, &.lt span:before { background-position: -2250px 0; }
304
+ &.lb a:before, &.lb span:before { background-position: -2220px 0; }
305
+ &.mk a:before, &.mk span:before { background-position: -2190px 0; }
306
+ &.mg a:before, &.mg span:before { background-position: -1200px 0; }
307
+ &.ms a:before, &.ms span:before { background-position: -3360px 0; }
308
+ &.ml a:before, &.ml span:before { background-position: -1170px 0; }
309
+ &.mt a:before, &.mt span:before { background-position: -2130px 0; }
310
+ &.mi a:before, &.mi span:before { background-position: -3240px 0; }
311
+ &.mr a:before, &.mr span:before { background-position: -1170px 0; }
312
+ &.mn a:before, &.mn span:before { background-position: -6000px 0; }
313
+ &.ne a:before, &.ne span:before { background-position: -3270px 0; }
314
+ &.no a:before, &.no span:before { background-position: -5850px 0; }
315
+ &.ps a:before, &.ps span:before { background-position: -5189px 0; }
316
+ &.fa a:before, &.fa span:before { background-position: -6690px 0; }
317
+ &.pl a:before, &.pl span:before { background-position: -2160px 0; }
318
+ &.pt a:before, &.pt span:before { background-position: -6630px 0; }
319
+ &.pa a:before, &.pa span:before { background-position: -3180px 0; }
320
+ &.ro a:before, &.ro span:before { background-position: -2070px 0; }
321
+ &.ru a:before, &.ru span:before { background-position: -2040px 0; }
322
+ &.sm a:before, &.sm span:before { background-position: -4620px 0; }
323
+ &.gd a:before, &.gd span:before { background-position: -30px 0; }
324
+ &.sr a:before, &.sr span:before { background-position: -4290px 0; }
325
+ &.sn a:before, &.sn span:before { background-position: -540px 0; }
326
+ &.sd a:before, &.sd span:before { background-position: -3180px 0; }
327
+ &.si a:before, &.si span:before { background-position: -2820px 0; }
328
+ &.sk a:before, &.sk span:before { background-position: -6810px 0; }
329
+ &.sl a:before, &.sl span:before { background-position: -2010px 0; }
330
+ &.so a:before, &.so span:before { background-position: -4560px 0; }
331
+ &.st a:before, &.st span:before { background-position: -4830px 0; }
332
+ &.es a:before, &.es span:before { background-position: -480px 0; }
333
+ &.su a:before, &.su span:before { background-position: -4530px 0; }
334
+ &.sw a:before, &.sw span:before { background-position: -1290px 0; }
335
+ &.sv a:before, &.sv span:before { background-position: -1980px 0; }
336
+ &.tl a:before, &.tl span:before { background-position: -3060px 0; }
337
+ &.ty a:before, &.ty span:before { background-position: -6270px 0; }
338
+ &.tg a:before, &.tg span:before { background-position: -2940px 0; }
339
+ &.ta a:before, &.ta span:before { background-position: -1170px 0; }
340
+ &.tt a:before, &.tt span:before { background-position: -2040px 0; }
341
+ &.te a:before, &.te span:before { background-position: -1170px 0; }
342
+ &.th a:before, &.th span:before { background-position: -2910px 0; }
343
+ &.to a:before, &.to span:before { background-position: -6540px 0; }
344
+ &.tr a:before, &.tr span:before { background-position: -1950px 0; }
345
+ &.uk a:before, &.uk span:before { background-position: -1890px 0; }
346
+ &.ur a:before, &.ur span:before { background-position: -3180px 0; }
347
+ &.uz a:before, &.uz span:before { background-position: -2880px 0; }
348
+ &.vi a:before, &.vi span:before { background-position: -2850px 0; }
349
+ &.cy a:before, &.cy span:before { background-position: -6420px 0; }
350
+ &.fy a:before, &.fy span:before { background-position: -2100px 0; }
351
+ &.xh a:before, &.xh span:before { background-position: -6570px 0; }
352
+ &.yi a:before, &.yi span:before { background-position: -1050px 0; }
353
+ &.yo a:before, &.yo span:before { background-position: -870px 0; }
354
+ &.zu a:before, &.zu span:before { background-position: -6570px 0; }
355
+
356
+ &.flag-1 {
357
+ &.hw a:before, &.hw span:before { background-position: -7840px 0; }
358
+ &.fl a:before, &.fl span:before { background-position: 2560px 0; }
359
+ &.af a:before, &.af span:before { background-position: -6848px 0; }
360
+ &.sq a:before, &.sq span:before { background-position: -97px 0; }
361
+ &.am a:before, &.am span:before { background-position: -2369px 0; }
362
+ &.ar a:before, &.ar span:before { background-position: -6465px 0; }
363
+ &.hy a:before, &.hy span:before { background-position: -385px 0; }
364
+ &.az a:before, &.az span:before { background-position: -513px 0; }
365
+ &.ba a:before, &.ba span:before { background-position: -6113px 0; }
366
+ &.eu a:before, &.eu span:before { background-position: -8353px 0; }
367
+ &.be a:before, &.be span:before { background-position: -705px 0; }
368
+ &.bn a:before, &.bn span:before { background-position: -609px 0; }
369
+ &.bs a:before, &.bs span:before { background-position: -929px 0; }
370
+ &.bg a:before, &.bg span:before { background-position: -1121px 0; }
371
+ &.my a:before, &.my span:before { background-position: -4929px 0; }
372
+ &.ca a:before, &.ca span:before { background-position: -8321px 0; }
373
+ &.zh a:before, &.zh span:before { background-position: -1505px 0; }
374
+ &.tw a:before, &.tw span:before { background-position: -6369px 0; }
375
+ &.km a:before, &.km span:before { background-position: -1217px 0; }
376
+ &.ny a:before, &.ny span:before { background-position: -4289px 0; }
377
+ &.co a:before, &.co span:before { background-position: -2561px 0; }
378
+ &.hr a:before, &.hr span:before { background-position: -1793px 0; }
379
+ &.cs a:before, &.cs span:before { background-position: -1921px 0; }
380
+ &.da a:before, &.da span:before { background-position: -1985px 0; }
381
+ &.nl a:before, &.nl span:before { background-position: -5121px 0; }
382
+ &.en a:before, &.en span:before { background-position: -7777px 0; }
383
+ &.eo a:before, &.eo span:before { background-position: -7777px 0; }
384
+ &.et a:before, &.et span:before { background-position: -2337px 0; }
385
+ &.fj a:before, &.fj span:before { background-position: -2497px 0; }
386
+ &.fi a:before, &.fi span:before { background-position: -2529px 0; }
387
+ &.fr a:before, &.fr span:before { background-position: -2561px 0; }
388
+ &.gl a:before, &.gl span:before { background-position: -7009px 0; }
389
+ &.ka a:before, &.ka span:before { background-position: -2721px 0; }
390
+ &.de a:before, &.de span:before { background-position: -2753px 0; }
391
+ &.el a:before, &.el span:before { background-position: -2881px 0; }
392
+ &.gu a:before, &.gu span:before { background-position: -3329px 0; }
393
+ &.ht a:before, &.ht span:before { background-position: -3169px 0; }
394
+ &.ha a:before, &.ha span:before { background-position: -5281px 0; }
395
+ &.he a:before, &.he span:before { background-position: -3521px 0; }
396
+ &.hi a:before, &.hi span:before { background-position: -3329px 0; }
397
+ &.hu a:before, &.hu span:before { background-position: -3265px 0; }
398
+ &.is a:before, &.is span:before { background-position: -3297px 0; }
399
+ &.ig a:before, &.ig span:before { background-position: -5313px 0; }
400
+ &.id a:before, &.id span:before { background-position: -3361px 0; }
401
+ &.ga a:before, &.ga span:before { background-position: -3457px 0; }
402
+ &.it a:before, &.it span:before { background-position: -3553px 0; }
403
+ &.ja a:before, &.ja span:before { background-position: -3617px 0; }
404
+ &.jv a:before, &.jv span:before { background-position: -4321px 0; }
405
+ &.kn a:before, &.kn span:before { background-position: -3329px 0; }
406
+ &.kk a:before, &.kk span:before { background-position: -3713px 0; }
407
+ &.ko a:before, &.ko span:before { background-position: -6913px 0; }
408
+ &.ku a:before, &.ku span:before { background-position: -3265px 0; }
409
+ &.ky a:before, &.ky span:before { background-position: -3873px 0; }
410
+ &.lo a:before, &.lo span:before { background-position: -3904px 0; }
411
+ &.la a:before, &.la span:before { background-position: -3553px 0; }
412
+ &.lv a:before, &.lv span:before { background-position: -3937px 0; }
413
+ &.lt a:before, &.lt span:before { background-position: -4129px 0; }
414
+ &.lb a:before, &.lb span:before { background-position: -4161px 0; }
415
+ &.mk a:before, &.mk span:before { background-position: -4225px 0; }
416
+ &.mg a:before, &.mg span:before { background-position: -4257px 0; }
417
+ &.ms a:before, &.ms span:before { background-position: -4321px 0; }
418
+ &.ml a:before, &.ml span:before { background-position: -3329px 0; }
419
+ &.mt a:before, &.mt span:before { background-position: -4417px 0; }
420
+ &.mi a:before, &.mi span:before { background-position: -5217px 0; }
421
+ &.mr a:before, &.mr span:before { background-position: -3329px 0; }
422
+ &.mn a:before, &.mn span:before { background-position: -4769px 0; }
423
+ &.ne a:before, &.ne span:before { background-position: -5091px 0; }
424
+ &.no a:before, &.no span:before { background-position: -5505px 0; }
425
+ &.ps a:before, &.ps span:before { background-position: -33px 0; }
426
+ &.fa a:before, &.fa span:before { background-position: -3393px 0; }
427
+ &.pl a:before, &.pl span:before { background-position: -5889px 0; }
428
+ &.pt a:before, &.pt span:before { background-position: -993px 0; }
429
+ &.pa a:before, &.pa span:before { background-position: -3329px 0; }
430
+ &.ro a:before, &.ro span:before { background-position: -6081px 0; }
431
+ &.ru a:before, &.ru span:before { background-position: -6113px 0; }
432
+ &.sm a:before, &.sm span:before { background-position: -6369px 0; }
433
+ &.gd a:before, &.gd span:before { background-position: -6497px 0; }
434
+ &.sr a:before, &.sr span:before { background-position: -6561px 0; }
435
+ &.sn a:before, &.sn span:before { background-position: -8287px 0; }
436
+ &.sd a:before, &.sd span:before { background-position: -5601px 0; }
437
+ &.si a:before, &.si span:before { background-position: -7039px 0; }
438
+ &.sk a:before, &.sk span:before { background-position: -6689px 0; }
439
+ &.sl a:before, &.sl span:before { background-position: -6721px 0; }
440
+ &.so a:before, &.so span:before { background-position: -6785px 0; }
441
+ &.st a:before, &.st span:before { background-position: -4001px 0; }
442
+ &.es a:before, &.es span:before { background-position: -7009px 0; }
443
+ &.su a:before, &.su span:before { background-position: -7073px 0; }
444
+ &.sw a:before, &.sw span:before { background-position: -3745px 0; }
445
+ &.sv a:before, &.sv span:before { background-position: -7169px 0; }
446
+ &.tl a:before, &.tl span:before { background-position: -5823px 0; }
447
+ &.ty a:before, &.ty span:before { background-position: -2593px 0; }
448
+ &.tg a:before, &.tg span:before { background-position: -7297px 0; }
449
+ &.ta a:before, &.ta span:before { background-position: -3329px 0; }
450
+ &.tt a:before, &.tt span:before { background-position: -6113px 0; }
451
+ &.te a:before, &.te span:before { background-position: -3329px 0; }
452
+ &.th a:before, &.th span:before { background-position: -7361px 0; }
453
+ &.to a:before, &.to span:before { background-position: -7456px 0; }
454
+ &.tr a:before, &.tr span:before { background-position: -7553px 0; }
455
+ &.uk a:before, &.uk span:before { background-position: -7713px 0; }
456
+ &.ur a:before, &.ur span:before { background-position: -5600px 0; }
457
+ &.uz a:before, &.uz span:before { background-position: -7969px 0; }
458
+ &.vi a:before, &.vi span:before { background-position: -8097px 0; }
459
+ &.cy a:before, &.cy span:before { background-position: -8129px 0; }
460
+ &.fy a:before, &.fy span:before { background-position: -5121px 0; }
461
+ &.xh a:before, &.xh span:before { background-position: -6848px 0; }
462
+ &.yi a:before, &.yi span:before { background-position: -3521px 0; }
463
+ &.yo a:before, &.yo span:before { background-position: -5313px 0; }
464
+ &.zu a:before, &.zu span:before { background-position: -6848px 0; }
465
+ }
466
+ &.flag-2 {
467
+ &.hw a:before, &.hw span:before { background-position: -5448px 0; }
468
+ &.fl a:before, &.fl span:before { background-position: -1008px 0; }
469
+ &.af a:before, &.af span:before { background-position: -4968px 0; }
470
+ &.sq a:before, &.sq span:before { background-position: -2976px 0; }
471
+ &.am a:before, &.am span:before { background-position: -3816px 0; }
472
+ &.ar a:before, &.ar span:before { background-position: -768px 0; }
473
+ &.hy a:before, &.hy span:before { background-position: 0 0; }
474
+ &.az a:before, &.az span:before { background-position: -5136px 0; }
475
+ &.ba a:before, &.ba span:before { background-position: -936px 0; }
476
+ &.eu a:before, &.eu span:before { background-position: -5376px 0; }
477
+ &.be a:before, &.be span:before { background-position: -4224px 0; }
478
+ &.bn a:before, &.bn span:before { background-position: -4056px 0; }
479
+ &.bs a:before, &.bs span:before { background-position: -3984px 0; }
480
+ &.bg a:before, &.bg span:before { background-position: -5040px 0; }
481
+ &.my a:before, &.my span:before { background-position: -1248px 0; }
482
+ &.ca a:before, &.ca span:before { background-position: -5352px 0; }
483
+ &.zh a:before, &.zh span:before { background-position: -2592px 0; }
484
+ &.tw a:before, &.tw span:before { background-position: -3408px 0; }
485
+ &.km a:before, &.km span:before { background-position: -5160px 0; }
486
+ &.ny a:before, &.ny span:before { background-position: -1392px 0; }
487
+ &.co a:before, &.co span:before { background-position: -2304px 0; }
488
+ &.hr a:before, &.hr span:before { background-position: -4416px 0; }
489
+ &.cs a:before, &.cs span:before { background-position: -2472px 0; }
490
+ &.da a:before, &.da span:before { background-position: -2448px 0; }
491
+ &.nl a:before, &.nl span:before { background-position: -1296px 0; }
492
+ &.en a:before, &.en span:before { background-position: -312px 0; }
493
+ &.eo a:before, &.eo span:before { background-position: -312px 0; } /* a faire */
494
+ &.et a:before, &.et span:before { background-position: -2424px 0; }
495
+ &.fj a:before, &.fj span:before { background-position: -576px 0; }
496
+ &.fi a:before, &.fi span:before { background-position: -2328px 0; }
497
+ &.fr a:before, &.fr span:before { background-position: -2304px 0; }
498
+ &.gl a:before, &.gl span:before { background-position: -96px 0; }
499
+ &.ka a:before, &.ka span:before { background-position: -3744px 0; }
500
+ &.de a:before, &.de span:before { background-position: -2256px 0; }
501
+ &.el a:before, &.el span:before { background-position: -2208px 0; }
502
+ &.gu a:before, &.gu span:before { background-position: -1728px 0; }
503
+ &.ht a:before, &.ht span:before { background-position: -3528px 0; }
504
+ &.ha a:before, &.ha span:before { background-position: -1176px 0; }
505
+ &.he a:before, &.he span:before { background-position: -1992px 0; }
506
+ &.hi a:before, &.hi span:before { background-position: -1728px 0; }
507
+ &.hu a:before, &.hu span:before { background-position: -2088px 0; }
508
+ &.is a:before, &.is span:before { background-position: -2064px 0; }
509
+ &.ig a:before, &.ig span:before { background-position: -1103px 0; }
510
+ &.id a:before, &.id span:before { background-position: -2040px 0; }
511
+ &.ga a:before, &.ga span:before { background-position: -2016px 0; }
512
+ &.it a:before, &.it span:before { background-position: -1968px 0; }
513
+ &.ja a:before, &.ja span:before { background-position: -1920px 0; }
514
+ &.jv a:before, &.jv span:before { background-position: -1536px 0; }
515
+ &.kn a:before, &.kn span:before { background-position: -1728px 0; }
516
+ &.kk a:before, &.kk span:before { background-position: -1704px 0; }
517
+ &.ko a:before, &.ko span:before { background-position: -1848px 0; }
518
+ &.ku a:before, &.ku span:before { background-position: -2088px 0; }
519
+ &.ky a:before, &.ky span:before { background-position: -1800px 0; }
520
+ &.lo a:before, &.lo span:before { background-position: -1776px 0; }
521
+ &.la a:before, &.la span:before { background-position: -1968px 0; }
522
+ &.lv a:before, &.lv span:before { background-position: -1752px 0; }
523
+ &.lt a:before, &.lt span:before { background-position: -1656px 0; }
524
+ &.lb a:before, &.lb span:before { background-position: -1632px 0; }
525
+ &.mk a:before, &.mk span:before { background-position: -1440px 0; }
526
+ &.mg a:before, &.mg span:before { background-position: -1560px 0; }
527
+ &.ms a:before, &.ms span:before { background-position: -1536px 0; }
528
+ &.ml a:before, &.ml span:before { background-position: -1728px 0; }
529
+ &.mt a:before, &.mt span:before { background-position: -1200px 0; }
530
+ &.mi a:before, &.mi span:before { background-position: -1224px 0; }
531
+ &.mr a:before, &.mr span:before { background-position: -1728px 0; }
532
+ &.mn a:before, &.mn span:before { background-position: -4800px 0; }
533
+ &.ne a:before, &.ne span:before { background-position: -1320px 0; }
534
+ &.no a:before, &.no span:before { background-position: -4776px 0; }
535
+ &.ps a:before, &.ps span:before { background-position: -4008px 0; }
536
+ &.fa a:before, &.fa span:before { background-position: -5088px 0; }
537
+ &.pl a:before, &.pl span:before { background-position: -984px 0; }
538
+ &.pt a:before, &.pt span:before { background-position: -2784px 0; }
539
+ &.pa a:before, &.pa span:before { background-position: -1728px 0; }
540
+ &.ro a:before, &.ro span:before { background-position: -960px 0; }
541
+ &.ru a:before, &.ru span:before { background-position: -936px 0; }
542
+ &.sm a:before, &.sm span:before { background-position: -3408px 0; }
543
+ &.gd a:before, &.gd span:before { background-position: -4872px 0; }
544
+ &.sr a:before, &.sr span:before { background-position: -3120px 0; }
545
+ &.sn a:before, &.sn span:before { background-position: -72px 0; }
546
+ &.sd a:before, &.sd span:before { background-position: -1128px 0; }
547
+ &.si a:before, &.si span:before { background-position: -480px 0; }
548
+ &.sk a:before, &.sk span:before { background-position: -4152px 0; }
549
+ &.sl a:before, &.sl span:before { background-position: -696px 0; }
550
+ &.so a:before, &.so span:before { background-position: -3336px 0; }
551
+ &.st a:before, &.st span:before { background-position: -3552px 0; }
552
+ &.es a:before, &.es span:before { background-position: -96px 0; }
553
+ &.su a:before, &.su span:before { background-position: -3312px 0; }
554
+ &.sw a:before, &.sw span:before { background-position: -1872px 0; }
555
+ &.sv a:before, &.sv span:before { background-position: -552px 0; }
556
+ &.tl a:before, &.tl span:before { background-position: -1008px 0; }
557
+ &.ty a:before, &.ty span:before { background-position: -4512px 0; }
558
+ &.tg a:before, &.tg span:before { background-position: -264px 0; }
559
+ &.ta a:before, &.ta span:before { background-position: -1728px 0; }
560
+ &.tt a:before, &.tt span:before { background-position: -936px 0; }
561
+ &.te a:before, &.te span:before { background-position: -1728px 0; }
562
+ &.th a:before, &.th span:before { background-position: -456px 0; }
563
+ &.to a:before, &.to span:before { background-position: -3264px 0; }
564
+ &.tr a:before, &.tr span:before { background-position: -360px 0; }
565
+ &.uk a:before, &.uk span:before { background-position: -288px 0; }
566
+ &.ur a:before, &.ur span:before { background-position: -1128px 0; }
567
+ &.uz a:before, &.uz span:before { background-position: -240px 0; }
568
+ &.vi a:before, &.vi span:before { background-position: -144px 0; }
569
+ &.cy a:before, &.cy span:before { background-position: -4848px 0; }
570
+ &.fy a:before, &.fy span:before { background-position: -1296px 0; }
571
+ &.xh a:before, &.xh span:before { background-position: -4968px 0; }
572
+ &.yi a:before, &.yi span:before { background-position: -1992px 0; }
573
+ &.yo a:before, &.yo span:before { background-position: -1103px 0; }
574
+ &.zu a:before, &.zu span:before { background-position: -4968px 0; }
575
+ }
576
+ &.flag-3 {
577
+ &.hw a:before, &.hw span:before { background-position: -2711px 0; }
578
+ &.fl a:before, &.fl span:before { background-position: -5232px 0; }
579
+ &.af a:before, &.af span:before { background-position: -5496px 0; }
580
+ &.sq a:before, &.sq span:before { background-position: -4776px 0; }
581
+ &.am a:before, &.am span:before { background-position: -192px 0; }
582
+ &.ar a:before, &.ar span:before { background-position: -3336px 0; }
583
+ &.hy a:before, &.hy span:before { background-position: -4632px 0; }
584
+ &.az a:before, &.az span:before { background-position: -4536px 0; }
585
+ &.ba a:before, &.ba span:before { background-position: -2664px 0; }
586
+ &.eu a:before, &.eu span:before { background-position: -5808px 0; }
587
+ &.be a:before, &.be span:before { background-position: -144px 0; }
588
+ &.bn a:before, &.bn span:before { background-position: -4488px 0; }
589
+ &.bs a:before, &.bs span:before { background-position: -4392px 0; }
590
+ &.bg a:before, &.bg span:before { background-position: -4296px 0; }
591
+ &.my a:before, &.my span:before { background-position: -3769px 0; }
592
+ &.ca a:before, &.ca span:before { background-position: -5784px 0; }
593
+ &.zh a:before, &.zh span:before { background-position: -3240px 0; }
594
+ &.tw a:before, &.tw span:before { background-position: -4008px 0; }
595
+ &.km a:before, &.km span:before { background-position: -4201px 0; }
596
+ &.ny a:before, &.ny span:before { background-position: -384px 0; }
597
+ &.co a:before, &.co span:before { background-position: -2760px 0; } /* a faire */
598
+ &.hr a:before, &.hr span:before { background-position: -3048px 0; }
599
+ &.cs a:before, &.cs span:before { background-position: -5280px 0; }
600
+ &.da a:before, &.da span:before { background-position: -3024px 0; }
601
+ &.nl a:before, &.nl span:before { background-position: -3360px 0; }
602
+ &.en a:before, &.en span:before { background-position: -2520px 0; }
603
+ &.eo a:before, &.eo span:before { background-position: -2520px 0; } /* a faire */
604
+ &.et a:before, &.et span:before { background-position: -2856px 0; }
605
+ &.fj a:before, &.fj span:before { background-position: -0px 0; }
606
+ &.fi a:before, &.fi span:before { background-position: -2784px 0; }
607
+ &.fr a:before, &.fr span:before { background-position: -2760px 0; }
608
+ &.gl a:before, &.gl span:before { background-position: -3576px 0; }
609
+ &.ka a:before, &.ka span:before { background-position: -1536px 0; }
610
+ &.de a:before, &.de span:before { background-position: -1488px 0; }
611
+ &.el a:before, &.el span:before { background-position: -1416px 0; }
612
+ &.gu a:before, &.gu span:before { background-position: -2304px 0; }
613
+ &.ht a:before, &.ht span:before { background-position: -5160px 0; }
614
+ &.ha a:before, &.ha span:before { background-position: -361px 0; }
615
+ &.he a:before, &.he span:before { background-position: -1608px 0; }
616
+ &.hi a:before, &.hi span:before { background-position: -2304px 0; }
617
+ &.hu a:before, &.hu span:before { background-position: -1920px 0; }
618
+ &.is a:before, &.is span:before { background-position: -840px 0; }
619
+ &.ig a:before, &.ig span:before { background-position: -3457px 0; }
620
+ &.id a:before, &.id span:before { background-position: -4992px 0; }
621
+ &.ga a:before, &.ga span:before { background-position: -2016px 0; }
622
+ &.it a:before, &.it span:before { background-position: -336px 0; }
623
+ &.ja a:before, &.ja span:before { background-position: -2448px 0; }
624
+ &.jv a:before, &.jv span:before { background-position: -864px 0; }
625
+ &.kn a:before, &.kn span:before { background-position: -2304px 0; }
626
+ &.kk a:before, &.kk span:before { background-position: -3912px 0; }
627
+ &.ko a:before, &.ko span:before { background-position: -2256px 0; }
628
+ &.ku a:before, &.ku span:before { background-position: -1920px 0; }
629
+ &.ky a:before, &.ky span:before { background-position: -744px 0; }
630
+ &.lo a:before, &.lo span:before { background-position: -3816px 0; }
631
+ &.la a:before, &.la span:before { background-position: -336px 0; }
632
+ &.lv a:before, &.lv span:before { background-position: -216px 0; }
633
+ &.lt a:before, &.lt span:before { background-position: -1776px 0; }
634
+ &.lb a:before, &.lb span:before { background-position: -1945px 0; }
635
+ &.mk a:before, &.mk span:before { background-position: -2208px 0; }
636
+ &.mg a:before, &.mg span:before { background-position: -5064px 0; }
637
+ &.ms a:before, &.ms span:before { background-position: -864px 0; }
638
+ &.ml a:before, &.ml span:before { background-position: -2304px 0; }
639
+ &.mt a:before, &.mt span:before { background-position: -4920px 0; }
640
+ &.mi a:before, &.mi span:before { background-position: -2113px 0; }
641
+ &.mr a:before, &.mr span:before { background-position: -2304px 0; }
642
+ &.mn a:before, &.mn span:before { background-position: -24px 0; }
643
+ &.ne a:before, &.ne span:before { background-position: -5642px 0; }
644
+ &.no a:before, &.no span:before { background-position: -984px 0; }
645
+ &.ps a:before, &.ps span:before { background-position: -4753px 0; }
646
+ &.fa a:before, &.fa span:before { background-position: -816px 0; }
647
+ &.pl a:before, &.pl span:before { background-position: -4944px 0; }
648
+ &.pt a:before, &.pt span:before { background-position: -4344px 0; }
649
+ &.pa a:before, &.pa span:before { background-position: -2304px 0; }
650
+ &.ro a:before, &.ro span:before { background-position: -3744px 0; }
651
+ &.ru a:before, &.ru span:before { background-position: -2664px 0; }
652
+ &.sm a:before, &.sm span:before { background-position: -1248px 0; }
653
+ &.gd a:before, &.gd span:before { background-position: -3841px 0; }
654
+ &.sr a:before, &.sr span:before { background-position: -3312px 0; }
655
+ &.sn a:before, &.sn span:before { background-position: -5521px 0; }
656
+ &.sd a:before, &.sd span:before { background-position: -1993px 0; }
657
+ &.si a:before, &.si span:before { background-position: -2833px 0; } /* a faire */
658
+ &.sk a:before, &.sk span:before { background-position: -552px 0; }
659
+ &.sl a:before, &.sl span:before { background-position: -936px 0; }
660
+ &.so a:before, &.so span:before { background-position: -4032px 0; }
661
+ &.st a:before, &.st span:before { background-position: -3961px 0; }
662
+ &.es a:before, &.es span:before { background-position: -3576px 0; }
663
+ &.su a:before, &.su span:before { background-position: -3985px 0; }
664
+ &.sw a:before, &.sw span:before { background-position: -912px 0; }
665
+ &.sv a:before, &.sv span:before { background-position: -264px 0; }
666
+ &.tl a:before, &.tl span:before { background-position: -5232px 0; }
667
+ &.ty a:before, &.ty span:before { background-position: -1512px 0; }
668
+ &.tg a:before, &.tg span:before { background-position: -3720px 0; }
669
+ &.ta a:before, &.ta span:before { background-position: -2304px 0; }
670
+ &.tt a:before, &.tt span:before { background-position: -2664px 0; }
671
+ &.te a:before, &.te span:before { background-position: -2304px 0; }
672
+ &.th a:before, &.th span:before { background-position: -4848px 0; }
673
+ &.to a:before, &.to span:before { background-position: -1680px 0; }
674
+ &.tr a:before, &.tr span:before { background-position: -432px 0; }
675
+ &.uk a:before, &.uk span:before { background-position: -5736px 0; }
676
+ &.ur a:before, &.ur span:before { background-position: -1992px 0; }
677
+ &.uz a:before, &.uz span:before { background-position: -2160px 0; }
678
+ &.vi a:before, &.vi span:before { background-position: -3384px 0; }
679
+ &.cy a:before, &.cy span:before { background-position: -5040px 0; }
680
+ &.fy a:before, &.fy span:before { background-position: -3360px 0; }
681
+ &.xh a:before, &.xh span:before { background-position: -5496px 0; }
682
+ &.yi a:before, &.yi span:before { background-position: -1608px 0; }
683
+ &.yo a:before, &.yo span:before { background-position: -3457px 0; }
684
+ &.zu a:before, &.zu span:before { background-position: -5496px 0; }
685
+ }
686
+ }
687
+
688
+
689
+
{resources/selectize/css → app/styles}/selectize.css RENAMED
File without changes
bootstrap.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // phpcs:ignore
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ use WeglotWP\Bootstrap_Weglot;
8
+
9
+ /**
10
+ * Only use for get one context
11
+ *
12
+ * @since 2.0
13
+ */
14
+ abstract class Context_Weglot {
15
+
16
+ /**
17
+ * @static
18
+ * @since 2.0
19
+ * @var Bootstrap_Weglot|null
20
+ */
21
+ protected static $context;
22
+
23
+ /**
24
+ * Create context if not exist
25
+ *
26
+ * @static
27
+ * @since 2.0
28
+ * @return void
29
+ */
30
+ public static function weglot_get_context() {
31
+ if ( null !== self::$context ) {
32
+ return self::$context;
33
+ }
34
+
35
+ self::$context = new Bootstrap_Weglot();
36
+
37
+ $services = [
38
+ '\WeglotWP\Services\Button_Service_Weglot',
39
+ '\WeglotWP\Services\Request_Url_Service_Weglot',
40
+ '\WeglotWP\Services\Option_Service_Weglot',
41
+ '\WeglotWP\Services\Redirect_Service_Weglot',
42
+ '\WeglotWP\Services\Network_Service_Weglot',
43
+ '\WeglotWP\Services\Language_Service_Weglot',
44
+ '\WeglotWP\Services\Replace_Url_Service_Weglot',
45
+ '\WeglotWP\Services\Multisite_Service_Weglot',
46
+ '\WeglotWP\Services\Replace_Link_Service_Weglot',
47
+ '\WeglotWP\Services\Migration_Service_Weglot',
48
+ '\WeglotWP\Services\Dom_Listeners_Service_Weglot',
49
+ '\WeglotWP\Services\Parser_Service_Weglot',
50
+ '\WeglotWP\Third\Woocommerce\WC_Translate_Weglot',
51
+ '\WeglotWP\Third\Woocommerce\WC_Active_Weglot',
52
+ '\WeglotWP\Third\Amp\Amp_Service_Weglot',
53
+ '\WeglotWP\Services\User_Api_Service_Weglot',
54
+ '\WeglotWP\Services\Other_Translate_Service_Weglot',
55
+ '\WeglotWP\Services\Dom_Checkers_Service_Weglot',
56
+ ];
57
+
58
+ self::$context->set_services( $services );
59
+
60
+ $actions = [
61
+ '\WeglotWP\Actions\Email_Translate_Weglot',
62
+ '\WeglotWP\Actions\Register_Widget_Weglot',
63
+ '\WeglotWP\Actions\Admin\Pages_Weglot',
64
+ '\WeglotWP\Actions\Admin\Plugin_Links_Weglot',
65
+ '\WeglotWP\Actions\Admin\Options_Weglot',
66
+ '\WeglotWP\Actions\Admin\Admin_Enqueue_Weglot',
67
+ '\WeglotWP\Actions\Admin\Customize_Menu_Weglot',
68
+ '\WeglotWP\Actions\Admin\Permalink_Weglot',
69
+ '\WeglotWP\Actions\Front\Translate_Page_Weglot',
70
+ '\WeglotWP\Actions\Front\Front_Enqueue_Weglot',
71
+ '\WeglotWP\Actions\Front\Shortcode_Weglot',
72
+ '\WeglotWP\Actions\Front\Redirect_Log_User_Weglot',
73
+ '\WeglotWP\Actions\Migration_Weglot',
74
+ '\WeglotWP\Third\Woocommerce\WC_Filter_Urls_Weglot',
75
+ '\WeglotWP\Third\Amp\Amp_Enqueue_Weglot',
76
+ ];
77
+
78
+ self::$context->set_actions( $actions );
79
+
80
+ return self::$context;
81
+ }
82
+ }
83
+
84
+
85
+ /**
86
+ * Init plugin
87
+ * @since 2.0
88
+ * @version 2.0.1
89
+ * @return void
90
+ */
91
+ function weglot_init() {
92
+ if ( function_exists( 'apache_get_modules' ) && ! in_array( 'mod_rewrite', apache_get_modules() ) ) { //phpcs:ignore
93
+ add_action( 'admin_notices', [ '\WeglotWP\Notices\Rewrite_Module_Weglot', 'admin_notice' ] );
94
+ }
95
+
96
+ if ( ! function_exists( 'curl_version' )) {
97
+ add_action( 'admin_notices', [ '\WeglotWP\Notices\Curl_Weglot', 'admin_notice' ] );
98
+ }
99
+
100
+ load_plugin_textdomain( 'weglot', false, WEGLOT_DIR_LANGUAGES );
101
+
102
+ Context_Weglot::weglot_get_context()->init_plugin();
103
+ }
composer.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "weglot",
3
+ "type": "project",
4
+ "license": "GPL",
5
+ "authors": [
6
+ {
7
+ "name": "Thomas DENEULIN",
8
+ "email": "thomas@weglot.com"
9
+ },
10
+ {
11
+ "name": "Remy BERDA",
12
+ "email": "remy@weglot.com"
13
+ }
14
+ ],
15
+ "require": {
16
+ "weglot/weglot-php": "^0.5"
17
+ },
18
+ "require-dev": {
19
+ "squizlabs/php_codesniffer": "*",
20
+ "wp-coding-standards/wpcs": "^0.13.1"
21
+ },
22
+ "scripts": {
23
+ "post-install-cmd": [
24
+ "\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs"
25
+ ],
26
+ "post-update-cmd": [
27
+ "\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs"
28
+ ]
29
+ }
30
+ }
dist/admin-css.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=6)}({6:function(e,t){}});
dist/admin-js.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function o(l){if(t[l])return t[l].exports;var a=t[l]={i:l,l:!1,exports:{}};return e[l].call(a.exports,a,a.exports,o),a.l=!0,a.exports}o.m=e,o.c=t,o.d=function(e,t,l){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:l})},o.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/dist/",o(o.s=0)}([function(e,t,o){"use strict";o.r(t);var l=function(){const e=jQuery;let t;const o=()=>{e(".weglot-select-original").selectize({delimiter:"|",persist:!1,valueField:"code",labelField:"local",searchField:["code","english","local"],sortField:[{field:"code",direction:"asc"},{field:"english",direction:"asc"}],maxItems:1,plugins:["remove_button"],options:weglot_languages.available,onChange:e=>{e.length>0&&(t.data("selectize").clearOptions(),t.data("selectize").addOption(weglot_languages.available.filter(t=>t.code!==e)))}}),t=e(".weglot-select-destination").selectize({delimiter:"|",persist:!1,valueField:"code",labelField:"local",searchField:["code","english","local"],sortField:[{field:"code",direction:"asc"},{field:"english",direction:"asc"}],maxItems:weglot_languages.limit,plugins:["remove_button"],options:(()=>weglot_languages.available.filter(e=>e.code!==weglot_languages.original))(),render:{option:function(e,t){return'<div class="weglot__choice__language"><span class="weglot__choice__language--local">'+t(e.local)+'</span><span class="weglot__choice__language--english">'+t(e.english)+" ["+t(e.code)+"]</span></div>"}}})};document.addEventListener("DOMContentLoaded",()=>{o()})};var a=function(){const e=jQuery;document.addEventListener("DOMContentLoaded",()=>{e("#weglot-box-first-settings .weglot-btn-close").on("click",function(t){t.preventDefault(),e("#weglot-box-first-settings").hide()})})};var n=function(){jQuery;const e=()=>{const e=document.querySelector("#tpl-exclusion-url"),t=document.querySelector("#tpl-exclusion-block"),o=document.querySelector("#container-exclude_urls"),l=document.querySelector("#container-exclude_blocks");function a(e){e.preventDefault(),this.parentNode.remove()}document.querySelector("#js-add-exclude-url")&&document.querySelector("#js-add-exclude-url").addEventListener("click",t=>{t.preventDefault(),o.insertAdjacentHTML("beforeend",e.innerHTML),document.querySelector("#container-exclude_urls .item-exclude:last-child .js-btn-remove").addEventListener("click",a)}),document.querySelector("#js-add-exclude-block")&&document.querySelector("#js-add-exclude-block").addEventListener("click",e=>{e.preventDefault(),l.insertAdjacentHTML("beforeend",t.innerHTML),document.querySelector("#container-exclude_blocks .item-exclude:last-child .js-btn-remove-exclude").addEventListener("click",a)}),document.querySelectorAll(".js-btn-remove").forEach(e=>{e.addEventListener("click",a)})};document.addEventListener("DOMContentLoaded",()=>{e()})};var r=function(){const e=jQuery;document.addEventListener("DOMContentLoaded",()=>{0!==e(".weglot-preview").length&&(()=>{let t=e("#type_flags").val(),o=[];o.push(e(".country-selector label").data("code-language")),e(".country-selector li").each((t,l)=>{o.push(e(l).data("code-language"))});const l=weglot_languages.available.filter(e=>o.indexOf(e.code)>=0);e("#weglot-css-inline").text(weglot_css.inline),e("#is_dropdown").on("change",function(){e(".country-selector").toggleClass("weglot-inline"),e(".country-selector").toggleClass("weglot-dropdown")}),e("#with_flags").on("change",function(){e(".country-selector label, .country-selector li").toggleClass("weglot-flags")}),e("#type_flags").on("change",function(o){e(".country-selector label, .country-selector li").removeClass(`flag-${t}`);const l=o.target.value;e(".country-selector label, .country-selector li").addClass(`flag-${l}`),t=l});const a=()=>{const t=l.find(t=>t.code===e(".country-selector label").data("code-language"));e(".country-selector label a, .country-selector label span").text(t.local),e(".country-selector li").each((t,o)=>{const a=l.find(t=>t.code===e(o).data("code-language"));e(o).find("a").text(a.local)})};e("#with_name").on("change",function(t){t.target.checked?a():(e(".country-selector label a, .country-selector label span").text(""),e(".country-selector li a, .country-selector li span").each((t,o)=>{e(o).text("")}))}),e("#is_fullname").on("change",function(t){if(t.target.checked)a();else{const t=l.find(t=>t.code===e(".country-selector label").data("code-language"));e(".country-selector label a, .country-selector label span").text(t.code.toUpperCase()),e(".country-selector li").each((t,o)=>{const a=l.find(t=>t.code===e(o).data("code-language"));e(o).find("a").text(a.code.toUpperCase()),e(o).find("span").text(a.code.toUpperCase())})}}),e("#override_css").on("keyup",function(t){e("#weglot-css-inline").text(t.target.value)})})()})};var s=function(){const e=jQuery,t=()=>{e("#api_key").blur(function(){var t=e(this).val();if(0===t.length)return e(".weglot-keyres").remove(),e("#api_key").after('<span class="weglot-keyres weglot-nokkey"></span>'),void e("#wrap-weglot #submit").prop("disabled",!0);e.getJSON("https://weglot.com/api/user-info?api_key="+t,function(t){e(".weglot-keyres").remove(),e("#api_key").after('<span class="weglot-keyres weglot-okkey"></span>'),e("#wrap-weglot #submit").prop("disabled",!1)}).fail(function(){e(".weglot-keyres").remove(),e("#api_key").after('<span class="weglot-keyres weglot-nokkey"></span>'),e("#wrap-weglot #submit").prop("disabled",!0)})})};document.addEventListener("DOMContentLoaded",()=>{t()})};var c=function(){const e=jQuery;"undefined"!=typeof weglot_css&&e("#weglot-css-flag-css").text(weglot_css.flag_css);const t=()=>{e(".flag-style-openclose").on("click",function(){e(".flag-style-wrapper").toggle()}),e("select.flag-en-type, select.flag-es-type, select.flag-pt-type, select.flag-fr-type, select.flag-ar-type").on("change",function(){!function(){var t=new Array,o=new Array,l=new Array,a=new Array,n=new Array;t[1]=[3570,7841,48,2712],t[2]=[3720,449,3048,4440],t[3]=[3840,1281,2712,4224],t[4]=[3240,5217,1224,2112],t[5]=[4050,3585,1944,2496],t[6]=[2340,3457,2016,2016],o[1]=[4320,4641,3144,3552],o[2]=[3750,353,2880,4656],o[3]=[4200,1601,2568,3192],o[4]=[3990,5793,1032,2232],o[5]=[5460,897,4104,3120],o[6]=[3810,7905,216,3888],o[7]=[3630,8065,192,2376],o[8]=[3780,1473,2496,4104],o[9]=[6120,2145,4680,2568],o[10]=[4440,3009,3240,1176],o[11]=[5280,1825,3936,2976],o[12]=[4770,2081,3624,1008],o[13]=[4080,3201,2160,2544],o[14]=[4590,5761,3432,624],o[15]=[4350,2209,3360,2688],o[16]=[5610,5249,3168,528],o[17]=[5070,1729,3792,2952],o[18]=[6870,5953,96,3408],o[19]=[4020,5697,1056,1224],l[1]=[1740,5921,528,3504],a[1]=[2760,736,2856,4416],a[2]=[3840,1280,2712,4224],a[3]=[5700,7201,5016,2400],a[4]=[2220,4160,1632,1944],n[1]=[1830,129,3096,5664],n[2]=[5100,2177,3840,2904],n[3]=[4890,3425,3648,2136],n[4]=[1320,3681,1896,4080],n[5]=[1260,3841,1824,1200],n[6]=[1020,3969,1608,312],n[7]=[4800,4065,3600,72],n[8]=[4710,4865,3504,480],n[9]=[6720,5984,5112,3792],n[10]=[4500,7233,3288,1800],n[11]=[720,7522,384,3936],n[12]=[690,7745,336,1104],n[13]=[600,8225,120,1272],n[14]=[660,5569,840,576];var r=e("select.flag-en-type").val(),s=e("select.flag-es-type").val(),c=e("select.flag-pt-type").val(),i=e("select.flag-fr-type").val(),g=e("select.flag-ar-type").val(),f=r<=0?"":".weglot-flags.en a:before, .weglot-flags.en span:before { background-position: -"+t[r][0]+"px 0; } .weglot-flags.flag-1.en a:before, .weglot-flags.flag-1.en span:before { background-position: -"+t[r][1]+"px 0; } .weglot-flags.flag-2.en a:before, .weglot-flags.flag-2.en span:before { background-position: -"+t[r][2]+"px 0; } .weglot-flags.flag-3.en a:before, .weglot-flags.flag-3.en span:before { background-position: -"+t[r][3]+"px 0; } ",u=s<=0?"":".weglot-flags.es a:before, .weglot-flags.es span:before { background-position: -"+o[s][0]+"px 0; } .weglot-flags.flag-1.es a:before, .weglot-flags.flag-1.es span:before { background-position: -"+o[s][1]+"px 0; } .weglot-flags.flag-2.es a:before, .weglot-flags.flag-2.es span:before { background-position: -"+o[s][2]+"px 0; } .weglot-flags.flag-3.es a:before, .weglot-flags.flag-3.es span:before { background-position: -"+o[s][3]+"px 0; } ",d=c<=0?"":".weglot-flags.pt a:before, .weglot-flags.pt span:before { background-position: -"+l[c][0]+"px 0; } .weglot-flags.flag-1.pt a:before, .weglot-flags.flag-1.pt span:before { background-position: -"+l[c][1]+"px 0; } .weglot-flags.flag-2.pt a:before, .weglot-flags.flag-2.pt span:before { background-position: -"+l[c][2]+"px 0; } .weglot-flags.flag-3.pt a:before, .weglot-flags.flag-3.pt span:before { background-position: -"+l[c][3]+"px 0; } ",p=i<=0?"":".weglot-flags.fr a:before, .weglot-flags.fr span:before { background-position: -"+a[i][0]+"px 0; } .weglot-flags.flag-1.fr a:before, .weglot-flags.flag-1.fr span:before { background-position: -"+a[i][1]+"px 0; } .weglot-flags.flag-2.fr a:before, .weglot-flags.flag-2.fr span:before { background-position: -"+a[i][2]+"px 0; } .weglot-flags.flag-3.fr a:before, .weglot-flags.flag-3.fr span:before { background-position: -"+a[i][3]+"px 0; } ",b=g<=0?"":".weglot-flags.ar a:before, .weglot-flags.ar span:before { background-position: -"+n[g][0]+"px 0; } .weglot-flags.flag-1.ar a:before, .weglot-flags.flag-1.ar span:before { background-position: -"+n[g][1]+"px 0; } .weglot-flags.flag-2.ar a:before, .weglot-flags.flag-2.ar span:before { background-position: -"+n[g][2]+"px 0; } .weglot-flags.flag-3.ar a:before, .weglot-flags.flag-3.ar span:before { background-position: -"+n[g][3]+"px 0; } ";e("#flag_css, #weglot-css-flag-css").text(f+u+d+p+b)}()})};document.addEventListener("DOMContentLoaded",()=>{t()})};var i=function(){const e=jQuery;document.addEventListener("DOMContentLoaded",()=>{(()=>{let t=!1;e(document).on({change:()=>t=!0,keyup:()=>t=!0},"input[type='text'], select, textarea, input[type='checkbox']"),e("input[type='submit']").on("click",e=>{t=!1}),window.onbeforeunload=function(){if(t)return"You have made changes on this page that you have not yet confirmed. If you navigate away from this page you will lose your unsaved changes"}})()})};o(2),o(1);l(),n(),a(),r(),s(),c(),i()},function(e,t){Array.prototype.filter||(Array.prototype.filter=function(e,t){"use strict";if("Function"!=typeof e&&"function"!=typeof e||!this)throw new TypeError;var o=this.length>>>0,l=new Array(o),a=this,n=0,r=-1;if(void 0===t)for(;++r!==o;)r in this&&e(a[r],r,a)&&(l[n++]=a[r]);else for(;++r!==o;)r in this&&e.call(t,a[r],r,a)&&(l[n++]=a[r]);return l.length=n,l})},function(e,t){Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),o=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var l=arguments[1],a=0;a<o;){var n=t[a];if(e.call(l,n,a,t))return n;a++}},configurable:!0,writable:!0})}]);
resources/selectize/css/selectize.default.css → dist/css/admin-css.css RENAMED
@@ -1,5 +1,5 @@
1
  /**
2
- * selectize.default.css (v0.12.4) - Default Theme
3
  * Copyright (c) 2013–2015 Brian Reavis & contributors
4
  *
5
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -13,6 +13,7 @@
13
  *
14
  * @author Brian Reavis <brian@thirdroute.com>
15
  */
 
16
  .selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder {
17
  visibility: visible !important;
18
  background: #f2f2f2 !important;
@@ -88,7 +89,7 @@
88
  vertical-align: middle;
89
  display: inline-block;
90
  padding: 2px 0 0 0;
91
- border-left: 1px solid #0073bb;
92
  -webkit-border-radius: 0 2px 2px 0;
93
  -moz-border-radius: 0 2px 2px 0;
94
  border-radius: 0 2px 2px 0;
@@ -100,13 +101,13 @@
100
  background: rgba(0, 0, 0, 0.05);
101
  }
102
  .selectize-control.plugin-remove_button [data-value].active .remove {
103
- border-left-color: #00578d;
104
  }
105
  .selectize-control.plugin-remove_button .disabled [data-value] .remove:hover {
106
  background: none;
107
  }
108
  .selectize-control.plugin-remove_button .disabled [data-value] .remove {
109
- border-left-color: #aaaaaa;
110
  }
111
  .selectize-control.plugin-remove_button .remove-single {
112
  position: absolute;
@@ -150,7 +151,7 @@
150
  border-radius: 3px;
151
  }
152
  .selectize-control.multi .selectize-input.has-items {
153
- padding: 5px 8px 2px;
154
  }
155
  .selectize-input.full {
156
  background-color: #ffffff;
@@ -179,20 +180,20 @@
179
  cursor: pointer;
180
  margin: 0 3px 3px 0;
181
  padding: 2px 6px;
182
- background: #1da7ee;
183
- color: #ffffff;
184
- border: 1px solid #0073bb;
185
  }
186
  .selectize-control.multi .selectize-input > div.active {
187
- background: #92c836;
188
- color: #ffffff;
189
- border: 1px solid #00578d;
190
  }
191
  .selectize-control.multi .selectize-input.disabled > div,
192
  .selectize-control.multi .selectize-input.disabled > div.active {
193
- color: #ffffff;
194
- background: #d2d2d2;
195
- border: 1px solid #aaaaaa;
196
  }
197
  .selectize-input > input {
198
  display: inline-block !important;
@@ -200,7 +201,7 @@
200
  min-height: 0 !important;
201
  max-height: none !important;
202
  max-width: 100% !important;
203
- margin: 0 1px !important;
204
  text-indent: 0 !important;
205
  border: 0 none !important;
206
  background: none !important;
@@ -321,74 +322,272 @@
321
  opacity: 0.5;
322
  background-color: #fafafa;
323
  }
324
- .selectize-control.multi .selectize-input.has-items {
325
- padding-left: 5px;
326
- padding-right: 5px;
327
- }
328
- .selectize-control.multi .selectize-input.disabled [data-value] {
329
- color: #999;
330
- text-shadow: none;
331
- background: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  -webkit-box-shadow: none;
333
  box-shadow: none;
334
- }
335
- .selectize-control.multi .selectize-input.disabled [data-value],
336
- .selectize-control.multi .selectize-input.disabled [data-value] .remove {
337
- border-color: #e6e6e6;
338
- }
339
- .selectize-control.multi .selectize-input.disabled [data-value] .remove {
340
- background: none;
341
- }
342
- .selectize-control.multi .selectize-input [data-value] {
343
- text-shadow: 0 1px 0 rgba(0, 51, 83, 0.3);
344
- -webkit-border-radius: 3px;
345
- -moz-border-radius: 3px;
346
- border-radius: 3px;
347
- background-color: #1b9dec;
348
- background-image: -moz-linear-gradient(top, #1da7ee, #178ee9);
349
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#1da7ee), to(#178ee9));
350
- background-image: -webkit-linear-gradient(top, #1da7ee, #178ee9);
351
- background-image: -o-linear-gradient(top, #1da7ee, #178ee9);
352
- background-image: linear-gradient(to bottom, #1da7ee, #178ee9);
353
- background-repeat: repeat-x;
354
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff1da7ee', endColorstr='#ff178ee9', GradientType=0);
355
- -webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.2),inset 0 1px rgba(255,255,255,0.03);
356
- box-shadow: 0 1px 0 rgba(0,0,0,0.2),inset 0 1px rgba(255,255,255,0.03);
357
- }
358
- .selectize-control.multi .selectize-input [data-value].active {
359
- background-color: #0085d4;
360
- background-image: -moz-linear-gradient(top, #008fd8, #0075cf);
361
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#008fd8), to(#0075cf));
362
- background-image: -webkit-linear-gradient(top, #008fd8, #0075cf);
363
- background-image: -o-linear-gradient(top, #008fd8, #0075cf);
364
- background-image: linear-gradient(to bottom, #008fd8, #0075cf);
365
- background-repeat: repeat-x;
366
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff008fd8', endColorstr='#ff0075cf', GradientType=0);
367
- }
368
- .selectize-control.single .selectize-input {
369
- -webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.8);
370
- box-shadow: 0 1px 0 rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.8);
371
- background-color: #f9f9f9;
372
- background-image: -moz-linear-gradient(top, #fefefe, #f2f2f2);
373
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fefefe), to(#f2f2f2));
374
- background-image: -webkit-linear-gradient(top, #fefefe, #f2f2f2);
375
- background-image: -o-linear-gradient(top, #fefefe, #f2f2f2);
376
- background-image: linear-gradient(to bottom, #fefefe, #f2f2f2);
377
- background-repeat: repeat-x;
378
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffefefe', endColorstr='#fff2f2f2', GradientType=0);
379
- }
380
- .selectize-control.single .selectize-input,
381
- .selectize-dropdown.single {
382
- border-color: #b8b8b8;
383
- }
384
- .selectize-dropdown .optgroup-header {
385
- padding-top: 7px;
386
- font-weight: bold;
387
- font-size: 0.85em;
388
- }
389
- .selectize-dropdown .optgroup {
390
- border-top: 1px solid #f0f0f0;
391
- }
392
- .selectize-dropdown .optgroup:first-child {
393
- border-top: 0 none;
394
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /**
2
+ * selectize.css (v0.12.4)
3
  * Copyright (c) 2013–2015 Brian Reavis & contributors
4
  *
5
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
13
  *
14
  * @author Brian Reavis <brian@thirdroute.com>
15
  */
16
+
17
  .selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder {
18
  visibility: visible !important;
19
  background: #f2f2f2 !important;
89
  vertical-align: middle;
90
  display: inline-block;
91
  padding: 2px 0 0 0;
92
+ border-left: 1px solid #d0d0d0;
93
  -webkit-border-radius: 0 2px 2px 0;
94
  -moz-border-radius: 0 2px 2px 0;
95
  border-radius: 0 2px 2px 0;
101
  background: rgba(0, 0, 0, 0.05);
102
  }
103
  .selectize-control.plugin-remove_button [data-value].active .remove {
104
+ border-left-color: #cacaca;
105
  }
106
  .selectize-control.plugin-remove_button .disabled [data-value] .remove:hover {
107
  background: none;
108
  }
109
  .selectize-control.plugin-remove_button .disabled [data-value] .remove {
110
+ border-left-color: #ffffff;
111
  }
112
  .selectize-control.plugin-remove_button .remove-single {
113
  position: absolute;
151
  border-radius: 3px;
152
  }
153
  .selectize-control.multi .selectize-input.has-items {
154
+ padding: 6px 8px 3px;
155
  }
156
  .selectize-input.full {
157
  background-color: #ffffff;
180
  cursor: pointer;
181
  margin: 0 3px 3px 0;
182
  padding: 2px 6px;
183
+ background: #f2f2f2;
184
+ color: #303030;
185
+ border: 0 solid #d0d0d0;
186
  }
187
  .selectize-control.multi .selectize-input > div.active {
188
+ background: #e8e8e8;
189
+ color: #303030;
190
+ border: 0 solid #cacaca;
191
  }
192
  .selectize-control.multi .selectize-input.disabled > div,
193
  .selectize-control.multi .selectize-input.disabled > div.active {
194
+ color: #7d7d7d;
195
+ background: #ffffff;
196
+ border: 0 solid #ffffff;
197
  }
198
  .selectize-input > input {
199
  display: inline-block !important;
201
  min-height: 0 !important;
202
  max-height: none !important;
203
  max-width: 100% !important;
204
+ margin: 0 2px 0 0 !important;
205
  text-indent: 0 !important;
206
  border: 0 none !important;
207
  background: none !important;
322
  opacity: 0.5;
323
  background-color: #fafafa;
324
  }
325
+ .weglot__choice__language {
326
+ border-bottom: 1px solid #eee;
327
+ margin: 5px 0px; }
328
+ .weglot__choice__language--english {
329
+ border-width: 50px;
330
+ color: #757575;
331
+ display: block; }
332
+
333
+ .btn {
334
+ background: #335ee2;
335
+ display: inline-block;
336
+ padding: 8px 10px;
337
+ border-radius: 4px;
338
+ -webkit-transition: .2s background linear,.2s color linear,.2s border linear,.2s text-shadow linear;
339
+ -o-transition: .2s background linear,.2s color linear,.2s border linear,.2s text-shadow linear;
340
+ transition: .2s background linear,.2s color linear,.2s border linear,.2s text-shadow linear;
341
+ outline: 0;
342
+ -webkit-font-smoothing: antialiased;
343
+ text-rendering: optimizeLegibility;
344
+ font-weight: 700;
345
+ cursor: pointer;
346
+ text-align: center;
347
+ text-decoration: none;
348
  -webkit-box-shadow: none;
349
  box-shadow: none;
350
+ white-space: nowrap;
351
+ color: white;
352
+ border: 1px solid #335ee2; }
353
+ .btn.btn-soft {
354
+ background-color: #fff;
355
+ color: #24284c;
356
+ border-color: #eaeaea; }
357
+ .btn.btn-primary:active, .btn.btn-primary:focus, .btn.btn-primary:hover {
358
+ border-color: #446dea;
359
+ background-color: #446dea; }
360
+
361
+ .js-btn-remove {
362
+ border: none;
363
+ background-color: #ed6657;
364
+ color: #fff;
365
+ display: inline-block;
366
+ width: 32px;
367
+ height: 32px;
368
+ position: relative;
369
+ border-radius: 50%;
370
+ cursor: pointer;
371
+ -webkit-transform: translateY(-5%);
372
+ -ms-transform: translateY(-5%);
373
+ transform: translateY(-5%);
374
+ margin-left: 10px;
375
+ -webkit-transition: opacity 175ms linear;
376
+ -o-transition: opacity 175ms linear;
377
+ transition: opacity 175ms linear;
378
+ outline: 0; }
379
+
380
+ .item-exclude {
381
+ position: relative;
382
+ margin-bottom: 10px; }
383
+
384
+ input[type='text']:focus, textarea:focus {
385
+ border-color: #446dea;
386
+ -webkit-box-shadow: none;
387
+ box-shadow: none; }
388
+
389
+ ::-webkit-input-placeholder,
390
+ :-moz-placeholder,
391
+ ::-moz-placeholder,
392
+ :-ms-input-placeholder {
393
+ color: #C0C0C0; }
394
+
395
+ .sub-label {
396
+ font-size: 13px;
397
+ font-weight: normal;
398
+ margin: 2px 0 0; }
399
+
400
+ .original-select,
401
+ #type_flags {
402
+ padding: 8px;
403
+ height: 36px !important;
404
+ width: 300px; }
405
+
406
+ #type_flags {
407
+ width: 150px; }
408
+
409
+ .selectize-control.multi .selectize-input > div {
410
+ background-color: #eff0ff; }
411
+
412
+ input[type="text"], .wg-input-textarea {
413
+ padding: 8px; }
414
+
415
+ .wg-input-textarea::-webkit-input-placeholder {
416
+ color: #ccc; }
417
+
418
+ .wg-input-textarea:-ms-input-placeholder {
419
+ color: #ccc; }
420
+
421
+ .wg-input-textarea::-ms-input-placeholder {
422
+ color: #ccc; }
423
+
424
+ .wg-input-textarea::placeholder {
425
+ color: #ccc; }
426
+
427
+ #wrap-weglot {
428
+ display: -webkit-box;
429
+ display: -webkit-flex;
430
+ display: -ms-flexbox;
431
+ display: flex; }
432
+ #wrap-weglot .weglot-nokkey:before {
433
+ content: '\274C';
434
+ display: inline-block;
435
+ color: red;
436
+ padding: 0 6px 0 0;
437
+ font-size: 15px;
438
+ padding: 0 10px; }
439
+ #wrap-weglot .weglot-okkey:before {
440
+ content: '\2713';
441
+ display: inline-block;
442
+ color: green;
443
+ padding: 0 10px;
444
+ font-size: 20px;
445
+ font-weight: bold;
446
+ padding: 0 10px; }
447
+ #wrap-weglot .wrap {
448
+ -webkit-box-flex: 4;
449
+ -webkit-flex: 4;
450
+ -ms-flex: 4;
451
+ flex: 4; }
452
+ #wrap-weglot .weglot-infobox {
453
+ -webkit-box-flex: 2;
454
+ -webkit-flex: 2;
455
+ -ms-flex: 2;
456
+ flex: 2;
457
+ -webkit-align-self: start;
458
+ -ms-flex-item-align: start;
459
+ align-self: start;
460
+ margin: 10px 20px 0 2px;
461
+ background-color: #fff;
462
+ background-color: white;
463
+ border: 1px solid #e0e0e0; }
464
+ #wrap-weglot .weglot-infobox h3 {
465
+ color: white;
466
+ background-color: #24284C;
467
+ padding: 20px;
468
+ margin: 0px;
469
+ font-size: 23px;
470
+ line-height: 1.3; }
471
+ #wrap-weglot .weglot-infobox div {
472
+ padding: 15px; }
473
+ #wrap-weglot .weglot-infobox .weglot-editbtn {
474
+ background: #e56b60;
475
+ color: white;
476
+ font-weight: bold;
477
+ border-radius: 0px;
478
+ border-bottom: 2px solid #B7564D;
479
+ font-size: 18px !important;
480
+ height: 37px !important;
481
+ line-height: 34px !important;
482
+ text-decoration: none;
483
+ padding: 10px 15px;
484
+ display: inline-block;
485
+ -webkit-transition: all .2s ease-in;
486
+ -o-transition: all .2s ease-in;
487
+ transition: all .2s ease-in; }
488
+ #wrap-weglot .weglot-infobox .weglot-editbtn:hover {
489
+ color: white;
490
+ background: #E87A70; }
491
+ #wrap-weglot .weglot-infobox .weglot-editbtn p {
492
+ font-size: 15px; }
493
+ #wrap-weglot .selectize-control,
494
+ #wrap-weglot input[type="text"],
495
+ #wrap-weglot .wg-input-textarea {
496
+ width: 100%;
497
+ max-width: 300px; }
498
+ #wrap-weglot #submit {
499
+ height: 50px;
500
+ padding: 0 30px !important;
501
+ font-size: 16px; }
502
+ #wrap-weglot .description {
503
+ display: inline-block; }
504
+ #wrap-weglot .wg-tooltip {
505
+ position: absolute;
506
+ display: none; }
507
+ #wrap-weglot #mainform {
508
+ margin-bottom: 50px; }
509
+ #wrap-weglot .arrow-up {
510
+ width: 0;
511
+ height: 0;
512
+ border-left: 10px solid transparent;
513
+ border-right: 10px solid transparent;
514
+ border-bottom: 10px solid #24292d;
515
+ position: absolute;
516
+ top: -10px;
517
+ left: 36px; }
518
+ #wrap-weglot .question-icon {
519
+ font-size: 17px; }
520
+
521
+ .weglot-info {
522
+ position: relative;
523
+ color: #3741cc;
524
+ font-weight: bold; }
525
+ .weglot-info:hover .wg-tooltip {
526
+ line-height: 1.4;
527
+ position: absolute;
528
+ top: 27px;
529
+ display: block !important;
530
+ background-color: #24292d;
531
+ width: 160px;
532
+ padding: 10px;
533
+ color: white;
534
+ font-weight: normal;
535
+ border: 1px solid #e0e0e0;
536
+ font-size: 12px; }
537
+
538
+ .weglot-box-overlay {
539
+ position: fixed;
540
+ top: 0;
541
+ left: 0;
542
+ display: -webkit-box;
543
+ display: -webkit-flex;
544
+ display: -ms-flexbox;
545
+ display: flex;
546
+ width: 100%;
547
+ height: 100%;
548
+ background-color: rgba(0, 0, 0, 0.85);
549
+ z-index: 9999;
550
+ -webkit-box-pack: center;
551
+ -webkit-justify-content: center;
552
+ -ms-flex-pack: center;
553
+ justify-content: center;
554
+ -webkit-box-align: center;
555
+ -webkit-align-items: center;
556
+ -ms-flex-align: center;
557
+ align-items: center; }
558
+ .weglot-box-overlay .weglot-box {
559
+ background-color: #fff;
560
+ padding: 25px;
561
+ text-align: center;
562
+ -webkit-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
563
+ box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75); }
564
+ .weglot-box-overlay .weglot-box--title {
565
+ font-size: 24px;
566
+ line-height: 1.3; }
567
+ .weglot-box-overlay .weglot-box--text {
568
+ font-size: 18px; }
569
+ .weglot-box-overlay .weglot-box--subtext {
570
+ font-size: 12px;
571
+ font-style: italic; }
572
+ .weglot-box-overlay .weglot-btn-close {
573
+ float: right;
574
+ cursor: pointer; }
575
+
576
+ .flag-style-openclose {
577
+ display: inline-block;
578
+ font-size: 12px;
579
+ color: #51C7A7;
580
+ text-decoration: underline;
581
+ cursor: default;
582
+ margin-right: 20px; }
583
+ .flag-style-openclose:hover {
584
+ opacity: 0.6;
585
+ cursor: pointer; }
586
+
587
+ .flag-style-wrapper {
588
+ padding: 15px 0px; }
589
+ .flag-style-wrapper p {
590
+ font-size: 12px !important; }
591
+ .flag-style-wrapper select {
592
+ padding: 3px !important;
593
+ font-size: 12px; }
dist/css/front-css.css ADDED
@@ -0,0 +1,1043 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .country-selector {
2
+ z-Index: 9999;
3
+ text-align: left;
4
+ position: relative;
5
+ display: inline-block;
6
+ width: auto; }
7
+ .country-selector a {
8
+ padding: 0 10px;
9
+ outline: none;
10
+ text-decoration: none;
11
+ float: none !important;
12
+ white-space: nowrap;
13
+ font-weight: normal;
14
+ cursor: pointer;
15
+ color: black;
16
+ -webkit-touch-callout: none;
17
+ /* iOS Safari */
18
+ -webkit-user-select: none;
19
+ -moz-user-select: none;
20
+ -ms-user-select: none;
21
+ user-select: none; }
22
+ .country-selector a:focus {
23
+ outline: none; }
24
+ .country-selector ul {
25
+ padding: 0px;
26
+ z-index: 1010;
27
+ list-style: none;
28
+ margin: 0; }
29
+ .country-selector li {
30
+ margin: 0px;
31
+ padding: 0px; }
32
+ .country-selector.weglot-dropdown {
33
+ background-color: white; }
34
+ .country-selector.weglot-dropdown a, .country-selector.weglot-dropdown span {
35
+ display: block;
36
+ height: 37px;
37
+ line-height: 36px;
38
+ font-size: 13px;
39
+ padding: 0 10px;
40
+ width: 100%;
41
+ -webkit-box-sizing: border-box;
42
+ box-sizing: border-box;
43
+ font-weight: normal; }
44
+ .country-selector.weglot-dropdown a:hover, .country-selector.weglot-dropdown span:hover {
45
+ cursor: pointer; }
46
+ .country-selector.weglot-dropdown .wgcurrent {
47
+ border: 1px solid #e0e0e0;
48
+ list-style: none;
49
+ display: block;
50
+ margin: 0; }
51
+ .country-selector.weglot-dropdown .wgcurrent a, .country-selector.weglot-dropdown .wgcurrent span {
52
+ padding-right: 60px; }
53
+ .country-selector.weglot-dropdown .wgcurrent:after {
54
+ display: inline-block;
55
+ position: absolute;
56
+ top: 17px;
57
+ right: 8px;
58
+ width: 13px;
59
+ height: 7px;
60
+ -ms-interpolation-mode: nearest-neighbor;
61
+ image-rendering: -webkit-optimize-contrast;
62
+ image-rendering: -moz-crisp-edges;
63
+ image-rendering: -o-pixelated;
64
+ image-rendering: pixelated;
65
+ background: url("../images/wgarrowdown.png") no-repeat;
66
+ content: '';
67
+ -webkit-transition: all 200ms;
68
+ -o-transition: all 200ms;
69
+ transition: all 200ms;
70
+ -webkit-transform: rotate(-90deg);
71
+ -ms-transform: rotate(-90deg);
72
+ transform: rotate(-90deg); }
73
+ .country-selector.weglot-dropdown ul {
74
+ position: absolute;
75
+ min-width: 100%;
76
+ border: 1px solid #ebeef0;
77
+ background: white;
78
+ left: 0;
79
+ top: initial;
80
+ -webkit-box-sizing: border-box;
81
+ box-sizing: border-box;
82
+ display: none;
83
+ padding: 0; }
84
+ .country-selector.weglot-dropdown input:checked ~ ul {
85
+ display: block; }
86
+ .country-selector.weglot-dropdown input:checked ~ .wgcurrent:after {
87
+ -webkit-transform: rotate(0deg);
88
+ -ms-transform: rotate(0deg);
89
+ transform: rotate(0deg); }
90
+ .country-selector.weglot-dropdown li {
91
+ width: 100%; }
92
+ .country-selector.weglot-dropdown.weglot-invert ul {
93
+ bottom: 38px; }
94
+ .country-selector.weglot-dropdown.weglot-invert input:checked ~ .wgcurrent:after {
95
+ -webkit-transform: rotate(-180deg);
96
+ -ms-transform: rotate(-180deg);
97
+ transform: rotate(-180deg); }
98
+ .country-selector.weglot-default {
99
+ position: fixed;
100
+ bottom: 0px;
101
+ right: 40px; }
102
+ .country-selector.weglot-inline a:hover {
103
+ text-decoration: underline;
104
+ color: #00a0d2; }
105
+ .country-selector.weglot-inline .wgcurrent a {
106
+ text-decoration: underline; }
107
+ .country-selector.weglot-inline label {
108
+ margin-bottom: 0;
109
+ display: inline-block;
110
+ vertical-align: middle; }
111
+ .country-selector.weglot-inline ul {
112
+ display: inline-block;
113
+ vertical-align: middle; }
114
+ .country-selector.weglot-inline li {
115
+ line-height: 1 !important;
116
+ display: inline-block;
117
+ margin: 2px 0px;
118
+ vertical-align: middle; }
119
+ .country-selector.weglot-inline.weglot-default {
120
+ bottom: 5px; }
121
+ .country-selector input {
122
+ display: none !important; }
123
+
124
+ .navbar .navbar-nav li.weglot-flags a.weglot-lang:before {
125
+ position: static;
126
+ -webkit-transform: none;
127
+ -ms-transform: none;
128
+ transform: none;
129
+ -webkit-transition: none;
130
+ -o-transition: none;
131
+ transition: none; }
132
+
133
+ html[dir="rtl"] .weglot-flags a:before, html[dir="rtl"] .weglot-flags span:before {
134
+ margin-right: 0;
135
+ margin-left: 10px; }
136
+
137
+ .weglot-flags {
138
+ /* a faire */
139
+ /* a faire */
140
+ /* a faire */
141
+ /* a faire */ }
142
+ .weglot-flags a:before, .weglot-flags span:before {
143
+ background-image: url("../images/rect_mate.png");
144
+ -webkit-background-size: auto 20px;
145
+ background-size: auto 20px;
146
+ border-radius: 0px;
147
+ width: 30px;
148
+ height: 20px;
149
+ content: "";
150
+ vertical-align: middle;
151
+ margin-right: 10px;
152
+ display: inline-block;
153
+ overflow: hidden; }
154
+ .weglot-flags.flag-1 a:before, .weglot-flags.flag-1 span:before {
155
+ background-image: url("../images/rect_bright.png"); }
156
+ .weglot-flags.flag-2 a:before, .weglot-flags.flag-2 span:before {
157
+ background-image: url("../images/square_flag.png");
158
+ width: 24px;
159
+ height: 24px;
160
+ -webkit-background-size: auto 24px;
161
+ background-size: auto 24px; }
162
+ .weglot-flags.flag-3 a:before, .weglot-flags.flag-3 span:before {
163
+ background-image: url("../images/circular_flag.png");
164
+ width: 24px;
165
+ height: 24px;
166
+ -webkit-background-size: auto 24px;
167
+ background-size: auto 24px; }
168
+ .weglot-flags a span:before {
169
+ background-image: none !important;
170
+ display: none !important; }
171
+ .weglot-flags span a:before {
172
+ background-image: none !important;
173
+ display: none !important; }
174
+ .weglot-flags.hw a:before, .weglot-flags.hw span:before {
175
+ background-position: -3570px 0; }
176
+ .weglot-flags.af a:before, .weglot-flags.af span:before {
177
+ background-position: -6570px 0; }
178
+ .weglot-flags.fl a:before, .weglot-flags.fl span:before {
179
+ background-position: -3060px 0px; }
180
+ .weglot-flags.sq a:before, .weglot-flags.sq span:before {
181
+ background-position: -2580px 0; }
182
+ .weglot-flags.am a:before, .weglot-flags.am span:before {
183
+ background-position: -5130px 0; }
184
+ .weglot-flags.ar a:before, .weglot-flags.ar span:before {
185
+ background-position: -510px 0; }
186
+ .weglot-flags.hy a:before, .weglot-flags.hy span:before {
187
+ background-position: -1800px 0; }
188
+ .weglot-flags.az a:before, .weglot-flags.az span:before {
189
+ background-position: -6840px 0; }
190
+ .weglot-flags.ba a:before, .weglot-flags.ba span:before {
191
+ background-position: -2040px 0; }
192
+ .weglot-flags.eu a:before, .weglot-flags.eu span:before {
193
+ background-position: -7260px 0; }
194
+ .weglot-flags.be a:before, .weglot-flags.be span:before {
195
+ background-position: -5310px 0; }
196
+ .weglot-flags.bn a:before, .weglot-flags.bn span:before {
197
+ background-position: -5400px 0; }
198
+ .weglot-flags.bs a:before, .weglot-flags.bs span:before {
199
+ background-position: -6390px 0; }
200
+ .weglot-flags.bg a:before, .weglot-flags.bg span:before {
201
+ background-position: -2730px 0; }
202
+ .weglot-flags.my a:before, .weglot-flags.my span:before {
203
+ background-position: -3299px 0; }
204
+ .weglot-flags.ca a:before, .weglot-flags.ca span:before {
205
+ background-position: -7230px 0; }
206
+ .weglot-flags.zh a:before, .weglot-flags.zh span:before {
207
+ background-position: -3690px 0; }
208
+ .weglot-flags.tw a:before, .weglot-flags.tw span:before {
209
+ background-position: -2970px 0; }
210
+ .weglot-flags.km a:before, .weglot-flags.km span:before {
211
+ background-position: -6930px 0; }
212
+ .weglot-flags.ny a:before, .weglot-flags.ny span:before {
213
+ background-position: -1140px 0; }
214
+ .weglot-flags.co a:before, .weglot-flags.co span:before {
215
+ background-position: -2520px 0; }
216
+ .weglot-flags.hr a:before, .weglot-flags.hr span:before {
217
+ background-position: -5910px 0; }
218
+ .weglot-flags.cs a:before, .weglot-flags.cs span:before {
219
+ background-position: -2700px 0; }
220
+ .weglot-flags.da a:before, .weglot-flags.da span:before {
221
+ background-position: -2670px 0; }
222
+ .weglot-flags.nl a:before, .weglot-flags.nl span:before {
223
+ background-position: -2100px 0; }
224
+ .weglot-flags.en a:before, .weglot-flags.en span:before {
225
+ background-position: -1920px 0; }
226
+ .weglot-flags.eo a:before, .weglot-flags.eo span:before {
227
+ background-position: -1920px 0; }
228
+ .weglot-flags.et a:before, .weglot-flags.et span:before {
229
+ background-position: -2640px 0; }
230
+ .weglot-flags.fj a:before, .weglot-flags.fj span:before {
231
+ background-position: -1710px 0; }
232
+ .weglot-flags.fi a:before, .weglot-flags.fi span:before {
233
+ background-position: -2550px 0; }
234
+ .weglot-flags.fr a:before, .weglot-flags.fr span:before {
235
+ background-position: -2520px 0; }
236
+ .weglot-flags.gl a:before, .weglot-flags.gl span:before {
237
+ background-position: -480px 0; }
238
+ .weglot-flags.ka a:before, .weglot-flags.ka span:before {
239
+ background-position: -5040px 0; }
240
+ .weglot-flags.de a:before, .weglot-flags.de span:before {
241
+ background-position: -2490px 0; }
242
+ .weglot-flags.el a:before, .weglot-flags.el span:before {
243
+ background-position: -2460px 0; }
244
+ .weglot-flags.gu a:before, .weglot-flags.gu span:before {
245
+ background-position: -1170px 0; }
246
+ .weglot-flags.ht a:before, .weglot-flags.ht span:before {
247
+ background-position: -4650px 0; }
248
+ .weglot-flags.ha a:before, .weglot-flags.ha span:before {
249
+ background-position: -900px 0; }
250
+ .weglot-flags.he a:before, .weglot-flags.he span:before {
251
+ background-position: -1050px 0; }
252
+ .weglot-flags.hi a:before, .weglot-flags.hi span:before {
253
+ background-position: -1170px 0; }
254
+ .weglot-flags.hu a:before, .weglot-flags.hu span:before {
255
+ background-position: -2430px 0; }
256
+ .weglot-flags.is a:before, .weglot-flags.is span:before {
257
+ background-position: -2400px 0; }
258
+ .weglot-flags.ig a:before, .weglot-flags.ig span:before {
259
+ background-position: -870px 0; }
260
+ .weglot-flags.id a:before, .weglot-flags.id span:before {
261
+ background-position: -3510px 0; }
262
+ .weglot-flags.ga a:before, .weglot-flags.ga span:before {
263
+ background-position: -2340px 0; }
264
+ .weglot-flags.it a:before, .weglot-flags.it span:before {
265
+ background-position: -2310px 0; }
266
+ .weglot-flags.ja a:before, .weglot-flags.ja span:before {
267
+ background-position: -3480px 0; }
268
+ .weglot-flags.jv a:before, .weglot-flags.jv span:before {
269
+ background-position: -3360px 0; }
270
+ .weglot-flags.kn a:before, .weglot-flags.kn span:before {
271
+ background-position: -1170px 0; }
272
+ .weglot-flags.kk a:before, .weglot-flags.kk span:before {
273
+ background-position: -3150px 0; }
274
+ .weglot-flags.ko a:before, .weglot-flags.ko span:before {
275
+ background-position: -6990px 0; }
276
+ .weglot-flags.ku a:before, .weglot-flags.ku span:before {
277
+ background-position: -2430px 0; }
278
+ .weglot-flags.ky a:before, .weglot-flags.ky span:before {
279
+ background-position: -3420px 0; }
280
+ .weglot-flags.lo a:before, .weglot-flags.lo span:before {
281
+ background-position: -3450px 0; }
282
+ .weglot-flags.la a:before, .weglot-flags.la span:before {
283
+ background-position: -2310px 0; }
284
+ .weglot-flags.lv a:before, .weglot-flags.lv span:before {
285
+ background-position: -2280px 0; }
286
+ .weglot-flags.lt a:before, .weglot-flags.lt span:before {
287
+ background-position: -2250px 0; }
288
+ .weglot-flags.lb a:before, .weglot-flags.lb span:before {
289
+ background-position: -2220px 0; }
290
+ .weglot-flags.mk a:before, .weglot-flags.mk span:before {
291
+ background-position: -2190px 0; }
292
+ .weglot-flags.mg a:before, .weglot-flags.mg span:before {
293
+ background-position: -1200px 0; }
294
+ .weglot-flags.ms a:before, .weglot-flags.ms span:before {
295
+ background-position: -3360px 0; }
296
+ .weglot-flags.ml a:before, .weglot-flags.ml span:before {
297
+ background-position: -1170px 0; }
298
+ .weglot-flags.mt a:before, .weglot-flags.mt span:before {
299
+ background-position: -2130px 0; }
300
+ .weglot-flags.mi a:before, .weglot-flags.mi span:before {
301
+ background-position: -3240px 0; }
302
+ .weglot-flags.mr a:before, .weglot-flags.mr span:before {
303
+ background-position: -1170px 0; }
304
+ .weglot-flags.mn a:before, .weglot-flags.mn span:before {
305
+ background-position: -6000px 0; }
306
+ .weglot-flags.ne a:before, .weglot-flags.ne span:before {
307
+ background-position: -3270px 0; }
308
+ .weglot-flags.no a:before, .weglot-flags.no span:before {
309
+ background-position: -5850px 0; }
310
+ .weglot-flags.ps a:before, .weglot-flags.ps span:before {
311
+ background-position: -5189px 0; }
312
+ .weglot-flags.fa a:before, .weglot-flags.fa span:before {
313
+ background-position: -6690px 0; }
314
+ .weglot-flags.pl a:before, .weglot-flags.pl span:before {
315
+ background-position: -2160px 0; }
316
+ .weglot-flags.pt a:before, .weglot-flags.pt span:before {
317
+ background-position: -6630px 0; }
318
+ .weglot-flags.pa a:before, .weglot-flags.pa span:before {
319
+ background-position: -3180px 0; }
320
+ .weglot-flags.ro a:before, .weglot-flags.ro span:before {
321
+ background-position: -2070px 0; }
322
+ .weglot-flags.ru a:before, .weglot-flags.ru span:before {
323
+ background-position: -2040px 0; }
324
+ .weglot-flags.sm a:before, .weglot-flags.sm span:before {
325
+ background-position: -4620px 0; }
326
+ .weglot-flags.gd a:before, .weglot-flags.gd span:before {
327
+ background-position: -30px 0; }
328
+ .weglot-flags.sr a:before, .weglot-flags.sr span:before {
329
+ background-position: -4290px 0; }
330
+ .weglot-flags.sn a:before, .weglot-flags.sn span:before {
331
+ background-position: -540px 0; }
332
+ .weglot-flags.sd a:before, .weglot-flags.sd span:before {
333
+ background-position: -3180px 0; }
334
+ .weglot-flags.si a:before, .weglot-flags.si span:before {
335
+ background-position: -2820px 0; }
336
+ .weglot-flags.sk a:before, .weglot-flags.sk span:before {
337
+ background-position: -6810px 0; }
338
+ .weglot-flags.sl a:before, .weglot-flags.sl span:before {
339
+ background-position: -2010px 0; }
340
+ .weglot-flags.so a:before, .weglot-flags.so span:before {
341
+ background-position: -4560px 0; }
342
+ .weglot-flags.st a:before, .weglot-flags.st span:before {
343
+ background-position: -4830px 0; }
344
+ .weglot-flags.es a:before, .weglot-flags.es span:before {
345
+ background-position: -480px 0; }
346
+ .weglot-flags.su a:before, .weglot-flags.su span:before {
347
+ background-position: -4530px 0; }
348
+ .weglot-flags.sw a:before, .weglot-flags.sw span:before {
349
+ background-position: -1290px 0; }
350
+ .weglot-flags.sv a:before, .weglot-flags.sv span:before {
351
+ background-position: -1980px 0; }
352
+ .weglot-flags.tl a:before, .weglot-flags.tl span:before {
353
+ background-position: -3060px 0; }
354
+ .weglot-flags.ty a:before, .weglot-flags.ty span:before {
355
+ background-position: -6270px 0; }
356
+ .weglot-flags.tg a:before, .weglot-flags.tg span:before {
357
+ background-position: -2940px 0; }
358
+ .weglot-flags.ta a:before, .weglot-flags.ta span:before {
359
+ background-position: -1170px 0; }
360
+ .weglot-flags.tt a:before, .weglot-flags.tt span:before {
361
+ background-position: -2040px 0; }
362
+ .weglot-flags.te a:before, .weglot-flags.te span:before {
363
+ background-position: -1170px 0; }
364
+ .weglot-flags.th a:before, .weglot-flags.th span:before {
365
+ background-position: -2910px 0; }
366
+ .weglot-flags.to a:before, .weglot-flags.to span:before {
367
+ background-position: -6540px 0; }
368
+ .weglot-flags.tr a:before, .weglot-flags.tr span:before {
369
+ background-position: -1950px 0; }
370
+ .weglot-flags.uk a:before, .weglot-flags.uk span:before {
371
+ background-position: -1890px 0; }
372
+ .weglot-flags.ur a:before, .weglot-flags.ur span:before {
373
+ background-position: -3180px 0; }
374
+ .weglot-flags.uz a:before, .weglot-flags.uz span:before {
375
+ background-position: -2880px 0; }
376
+ .weglot-flags.vi a:before, .weglot-flags.vi span:before {
377
+ background-position: -2850px 0; }
378
+ .weglot-flags.cy a:before, .weglot-flags.cy span:before {
379
+ background-position: -6420px 0; }
380
+ .weglot-flags.fy a:before, .weglot-flags.fy span:before {
381
+ background-position: -2100px 0; }
382
+ .weglot-flags.xh a:before, .weglot-flags.xh span:before {
383
+ background-position: -6570px 0; }
384
+ .weglot-flags.yi a:before, .weglot-flags.yi span:before {
385
+ background-position: -1050px 0; }
386
+ .weglot-flags.yo a:before, .weglot-flags.yo span:before {
387
+ background-position: -870px 0; }
388
+ .weglot-flags.zu a:before, .weglot-flags.zu span:before {
389
+ background-position: -6570px 0; }
390
+ .weglot-flags.flag-1.hw a:before, .weglot-flags.flag-1.hw span:before {
391
+ background-position: -7840px 0; }
392
+ .weglot-flags.flag-1.fl a:before, .weglot-flags.flag-1.fl span:before {
393
+ background-position: 2560px 0; }
394
+ .weglot-flags.flag-1.af a:before, .weglot-flags.flag-1.af span:before {
395
+ background-position: -6848px 0; }
396
+ .weglot-flags.flag-1.sq a:before, .weglot-flags.flag-1.sq span:before {
397
+ background-position: -97px 0; }
398
+ .weglot-flags.flag-1.am a:before, .weglot-flags.flag-1.am span:before {
399
+ background-position: -2369px 0; }
400
+ .weglot-flags.flag-1.ar a:before, .weglot-flags.flag-1.ar span:before {
401
+ background-position: -6465px 0; }
402
+ .weglot-flags.flag-1.hy a:before, .weglot-flags.flag-1.hy span:before {
403
+ background-position: -385px 0; }
404
+ .weglot-flags.flag-1.az a:before, .weglot-flags.flag-1.az span:before {
405
+ background-position: -513px 0; }
406
+ .weglot-flags.flag-1.ba a:before, .weglot-flags.flag-1.ba span:before {
407
+ background-position: -6113px 0; }
408
+ .weglot-flags.flag-1.eu a:before, .weglot-flags.flag-1.eu span:before {
409
+ background-position: -8353px 0; }
410
+ .weglot-flags.flag-1.be a:before, .weglot-flags.flag-1.be span:before {
411
+ background-position: -705px 0; }
412
+ .weglot-flags.flag-1.bn a:before, .weglot-flags.flag-1.bn span:before {
413
+ background-position: -609px 0; }
414
+ .weglot-flags.flag-1.bs a:before, .weglot-flags.flag-1.bs span:before {
415
+ background-position: -929px 0; }
416
+ .weglot-flags.flag-1.bg a:before, .weglot-flags.flag-1.bg span:before {
417
+ background-position: -1121px 0; }
418
+ .weglot-flags.flag-1.my a:before, .weglot-flags.flag-1.my span:before {
419
+ background-position: -4929px 0; }
420
+ .weglot-flags.flag-1.ca a:before, .weglot-flags.flag-1.ca span:before {
421
+ background-position: -8321px 0; }
422
+ .weglot-flags.flag-1.zh a:before, .weglot-flags.flag-1.zh span:before {
423
+ background-position: -1505px 0; }
424
+ .weglot-flags.flag-1.tw a:before, .weglot-flags.flag-1.tw span:before {
425
+ background-position: -6369px 0; }
426
+ .weglot-flags.flag-1.km a:before, .weglot-flags.flag-1.km span:before {
427
+ background-position: -1217px 0; }
428
+ .weglot-flags.flag-1.ny a:before, .weglot-flags.flag-1.ny span:before {
429
+ background-position: -4289px 0; }
430
+ .weglot-flags.flag-1.co a:before, .weglot-flags.flag-1.co span:before {
431
+ background-position: -2561px 0; }
432
+ .weglot-flags.flag-1.hr a:before, .weglot-flags.flag-1.hr span:before {
433
+ background-position: -1793px 0; }
434
+ .weglot-flags.flag-1.cs a:before, .weglot-flags.flag-1.cs span:before {
435
+ background-position: -1921px 0; }
436
+ .weglot-flags.flag-1.da a:before, .weglot-flags.flag-1.da span:before {
437
+ background-position: -1985px 0; }
438
+ .weglot-flags.flag-1.nl a:before, .weglot-flags.flag-1.nl span:before {
439
+ background-position: -5121px 0; }
440
+ .weglot-flags.flag-1.en a:before, .weglot-flags.flag-1.en span:before {
441
+ background-position: -7777px 0; }
442
+ .weglot-flags.flag-1.eo a:before, .weglot-flags.flag-1.eo span:before {
443
+ background-position: -7777px 0; }
444
+ .weglot-flags.flag-1.et a:before, .weglot-flags.flag-1.et span:before {
445
+ background-position: -2337px 0; }
446
+ .weglot-flags.flag-1.fj a:before, .weglot-flags.flag-1.fj span:before {
447
+ background-position: -2497px 0; }
448
+ .weglot-flags.flag-1.fi a:before, .weglot-flags.flag-1.fi span:before {
449
+ background-position: -2529px 0; }
450
+ .weglot-flags.flag-1.fr a:before, .weglot-flags.flag-1.fr span:before {
451
+ background-position: -2561px 0; }
452
+ .weglot-flags.flag-1.gl a:before, .weglot-flags.flag-1.gl span:before {
453
+ background-position: -7009px 0; }
454
+ .weglot-flags.flag-1.ka a:before, .weglot-flags.flag-1.ka span:before {
455
+ background-position: -2721px 0; }
456
+ .weglot-flags.flag-1.de a:before, .weglot-flags.flag-1.de span:before {
457
+ background-position: -2753px 0; }
458
+ .weglot-flags.flag-1.el a:before, .weglot-flags.flag-1.el span:before {
459
+ background-position: -2881px 0; }
460
+ .weglot-flags.flag-1.gu a:before, .weglot-flags.flag-1.gu span:before {
461
+ background-position: -3329px 0; }
462
+ .weglot-flags.flag-1.ht a:before, .weglot-flags.flag-1.ht span:before {
463
+ background-position: -3169px 0; }
464
+ .weglot-flags.flag-1.ha a:before, .weglot-flags.flag-1.ha span:before {
465
+ background-position: -5281px 0; }
466
+ .weglot-flags.flag-1.he a:before, .weglot-flags.flag-1.he span:before {
467
+ background-position: -3521px 0; }
468
+ .weglot-flags.flag-1.hi a:before, .weglot-flags.flag-1.hi span:before {
469
+ background-position: -3329px 0; }
470
+ .weglot-flags.flag-1.hu a:before, .weglot-flags.flag-1.hu span:before {
471
+ background-position: -3265px 0; }
472
+ .weglot-flags.flag-1.is a:before, .weglot-flags.flag-1.is span:before {
473
+ background-position: -3297px 0; }
474
+ .weglot-flags.flag-1.ig a:before, .weglot-flags.flag-1.ig span:before {
475
+ background-position: -5313px 0; }
476
+ .weglot-flags.flag-1.id a:before, .weglot-flags.flag-1.id span:before {
477
+ background-position: -3361px 0; }
478
+ .weglot-flags.flag-1.ga a:before, .weglot-flags.flag-1.ga span:before {
479
+ background-position: -3457px 0; }
480
+ .weglot-flags.flag-1.it a:before, .weglot-flags.flag-1.it span:before {
481
+ background-position: -3553px 0; }
482
+ .weglot-flags.flag-1.ja a:before, .weglot-flags.flag-1.ja span:before {
483
+ background-position: -3617px 0; }
484
+ .weglot-flags.flag-1.jv a:before, .weglot-flags.flag-1.jv span:before {
485
+ background-position: -4321px 0; }
486
+ .weglot-flags.flag-1.kn a:before, .weglot-flags.flag-1.kn span:before {
487
+ background-position: -3329px 0; }
488
+ .weglot-flags.flag-1.kk a:before, .weglot-flags.flag-1.kk span:before {
489
+ background-position: -3713px 0; }
490
+ .weglot-flags.flag-1.ko a:before, .weglot-flags.flag-1.ko span:before {
491
+ background-position: -6913px 0; }
492
+ .weglot-flags.flag-1.ku a:before, .weglot-flags.flag-1.ku span:before {
493
+ background-position: -3265px 0; }
494
+ .weglot-flags.flag-1.ky a:before, .weglot-flags.flag-1.ky span:before {
495
+ background-position: -3873px 0; }
496
+ .weglot-flags.flag-1.lo a:before, .weglot-flags.flag-1.lo span:before {
497
+ background-position: -3904px 0; }
498
+ .weglot-flags.flag-1.la a:before, .weglot-flags.flag-1.la span:before {
499
+ background-position: -3553px 0; }
500
+ .weglot-flags.flag-1.lv a:before, .weglot-flags.flag-1.lv span:before {
501
+ background-position: -3937px 0; }
502
+ .weglot-flags.flag-1.lt a:before, .weglot-flags.flag-1.lt span:before {
503
+ background-position: -4129px 0; }
504
+ .weglot-flags.flag-1.lb a:before, .weglot-flags.flag-1.lb span:before {
505
+ background-position: -4161px 0; }
506
+ .weglot-flags.flag-1.mk a:before, .weglot-flags.flag-1.mk span:before {
507
+ background-position: -4225px 0; }
508
+ .weglot-flags.flag-1.mg a:before, .weglot-flags.flag-1.mg span:before {
509
+ background-position: -4257px 0; }
510
+ .weglot-flags.flag-1.ms a:before, .weglot-flags.flag-1.ms span:before {
511
+ background-position: -4321px 0; }
512
+ .weglot-flags.flag-1.ml a:before, .weglot-flags.flag-1.ml span:before {
513
+ background-position: -3329px 0; }
514
+ .weglot-flags.flag-1.mt a:before, .weglot-flags.flag-1.mt span:before {
515
+ background-position: -4417px 0; }
516
+ .weglot-flags.flag-1.mi a:before, .weglot-flags.flag-1.mi span:before {
517
+ background-position: -5217px 0; }
518
+ .weglot-flags.flag-1.mr a:before, .weglot-flags.flag-1.mr span:before {
519
+ background-position: -3329px 0; }
520
+ .weglot-flags.flag-1.mn a:before, .weglot-flags.flag-1.mn span:before {
521
+ background-position: -4769px 0; }
522
+ .weglot-flags.flag-1.ne a:before, .weglot-flags.flag-1.ne span:before {
523
+ background-position: -5091px 0; }
524
+ .weglot-flags.flag-1.no a:before, .weglot-flags.flag-1.no span:before {
525
+ background-position: -5505px 0; }
526
+ .weglot-flags.flag-1.ps a:before, .weglot-flags.flag-1.ps span:before {
527
+ background-position: -33px 0; }
528
+ .weglot-flags.flag-1.fa a:before, .weglot-flags.flag-1.fa span:before {
529
+ background-position: -3393px 0; }
530
+ .weglot-flags.flag-1.pl a:before, .weglot-flags.flag-1.pl span:before {
531
+ background-position: -5889px 0; }
532
+ .weglot-flags.flag-1.pt a:before, .weglot-flags.flag-1.pt span:before {
533
+ background-position: -993px 0; }
534
+ .weglot-flags.flag-1.pa a:before, .weglot-flags.flag-1.pa span:before {
535
+ background-position: -3329px 0; }
536
+ .weglot-flags.flag-1.ro a:before, .weglot-flags.flag-1.ro span:before {
537
+ background-position: -6081px 0; }
538
+ .weglot-flags.flag-1.ru a:before, .weglot-flags.flag-1.ru span:before {
539
+ background-position: -6113px 0; }
540
+ .weglot-flags.flag-1.sm a:before, .weglot-flags.flag-1.sm span:before {
541
+ background-position: -6369px 0; }
542
+ .weglot-flags.flag-1.gd a:before, .weglot-flags.flag-1.gd span:before {
543
+ background-position: -6497px 0; }
544
+ .weglot-flags.flag-1.sr a:before, .weglot-flags.flag-1.sr span:before {
545
+ background-position: -6561px 0; }
546
+ .weglot-flags.flag-1.sn a:before, .weglot-flags.flag-1.sn span:before {
547
+ background-position: -8287px 0; }
548
+ .weglot-flags.flag-1.sd a:before, .weglot-flags.flag-1.sd span:before {
549
+ background-position: -5601px 0; }
550
+ .weglot-flags.flag-1.si a:before, .weglot-flags.flag-1.si span:before {
551
+ background-position: -7039px 0; }
552
+ .weglot-flags.flag-1.sk a:before, .weglot-flags.flag-1.sk span:before {
553
+ background-position: -6689px 0; }
554
+ .weglot-flags.flag-1.sl a:before, .weglot-flags.flag-1.sl span:before {
555
+ background-position: -6721px 0; }
556
+ .weglot-flags.flag-1.so a:before, .weglot-flags.flag-1.so span:before {
557
+ background-position: -6785px 0; }
558
+ .weglot-flags.flag-1.st a:before, .weglot-flags.flag-1.st span:before {
559
+ background-position: -4001px 0; }
560
+ .weglot-flags.flag-1.es a:before, .weglot-flags.flag-1.es span:before {
561
+ background-position: -7009px 0; }
562
+ .weglot-flags.flag-1.su a:before, .weglot-flags.flag-1.su span:before {
563
+ background-position: -7073px 0; }
564
+ .weglot-flags.flag-1.sw a:before, .weglot-flags.flag-1.sw span:before {
565
+ background-position: -3745px 0; }
566
+ .weglot-flags.flag-1.sv a:before, .weglot-flags.flag-1.sv span:before {
567
+ background-position: -7169px 0; }
568
+ .weglot-flags.flag-1.tl a:before, .weglot-flags.flag-1.tl span:before {
569
+ background-position: -5823px 0; }
570
+ .weglot-flags.flag-1.ty a:before, .weglot-flags.flag-1.ty span:before {
571
+ background-position: -2593px 0; }
572
+ .weglot-flags.flag-1.tg a:before, .weglot-flags.flag-1.tg span:before {
573
+ background-position: -7297px 0; }
574
+ .weglot-flags.flag-1.ta a:before, .weglot-flags.flag-1.ta span:before {
575
+ background-position: -3329px 0; }
576
+ .weglot-flags.flag-1.tt a:before, .weglot-flags.flag-1.tt span:before {
577
+ background-position: -6113px 0; }
578
+ .weglot-flags.flag-1.te a:before, .weglot-flags.flag-1.te span:before {
579
+ background-position: -3329px 0; }
580
+ .weglot-flags.flag-1.th a:before, .weglot-flags.flag-1.th span:before {
581
+ background-position: -7361px 0; }
582
+ .weglot-flags.flag-1.to a:before, .weglot-flags.flag-1.to span:before {
583
+ background-position: -7456px 0; }
584
+ .weglot-flags.flag-1.tr a:before, .weglot-flags.flag-1.tr span:before {
585
+ background-position: -7553px 0; }
586
+ .weglot-flags.flag-1.uk a:before, .weglot-flags.flag-1.uk span:before {
587
+ background-position: -7713px 0; }
588
+ .weglot-flags.flag-1.ur a:before, .weglot-flags.flag-1.ur span:before {
589
+ background-position: -5600px 0; }
590
+ .weglot-flags.flag-1.uz a:before, .weglot-flags.flag-1.uz span:before {
591
+ background-position: -7969px 0; }
592
+ .weglot-flags.flag-1.vi a:before, .weglot-flags.flag-1.vi span:before {
593
+ background-position: -8097px 0; }
594
+ .weglot-flags.flag-1.cy a:before, .weglot-flags.flag-1.cy span:before {
595
+ background-position: -8129px 0; }
596
+ .weglot-flags.flag-1.fy a:before, .weglot-flags.flag-1.fy span:before {
597
+ background-position: -5121px 0; }
598
+ .weglot-flags.flag-1.xh a:before, .weglot-flags.flag-1.xh span:before {
599
+ background-position: -6848px 0; }
600
+ .weglot-flags.flag-1.yi a:before, .weglot-flags.flag-1.yi span:before {
601
+ background-position: -3521px 0; }
602
+ .weglot-flags.flag-1.yo a:before, .weglot-flags.flag-1.yo span:before {
603
+ background-position: -5313px 0; }
604
+ .weglot-flags.flag-1.zu a:before, .weglot-flags.flag-1.zu span:before {
605
+ background-position: -6848px 0; }
606
+ .weglot-flags.flag-2 {
607
+ /* a faire */ }
608
+ .weglot-flags.flag-2.hw a:before, .weglot-flags.flag-2.hw span:before {
609
+ background-position: -5448px 0; }
610
+ .weglot-flags.flag-2.fl a:before, .weglot-flags.flag-2.fl span:before {
611
+ background-position: -1008px 0; }
612
+ .weglot-flags.flag-2.af a:before, .weglot-flags.flag-2.af span:before {
613
+ background-position: -4968px 0; }
614
+ .weglot-flags.flag-2.sq a:before, .weglot-flags.flag-2.sq span:before {
615
+ background-position: -2976px 0; }
616
+ .weglot-flags.flag-2.am a:before, .weglot-flags.flag-2.am span:before {
617
+ background-position: -3816px 0; }
618
+ .weglot-flags.flag-2.ar a:before, .weglot-flags.flag-2.ar span:before {
619
+ background-position: -768px 0; }
620
+ .weglot-flags.flag-2.hy a:before, .weglot-flags.flag-2.hy span:before {
621
+ background-position: 0 0; }
622
+ .weglot-flags.flag-2.az a:before, .weglot-flags.flag-2.az span:before {
623
+ background-position: -5136px 0; }
624
+ .weglot-flags.flag-2.ba a:before, .weglot-flags.flag-2.ba span:before {
625
+ background-position: -936px 0; }
626
+ .weglot-flags.flag-2.eu a:before, .weglot-flags.flag-2.eu span:before {
627
+ background-position: -5376px 0; }
628
+ .weglot-flags.flag-2.be a:before, .weglot-flags.flag-2.be span:before {
629
+ background-position: -4224px 0; }
630
+ .weglot-flags.flag-2.bn a:before, .weglot-flags.flag-2.bn span:before {
631
+ background-position: -4056px 0; }
632
+ .weglot-flags.flag-2.bs a:before, .weglot-flags.flag-2.bs span:before {
633
+ background-position: -3984px 0; }
634
+ .weglot-flags.flag-2.bg a:before, .weglot-flags.flag-2.bg span:before {
635
+ background-position: -5040px 0; }
636
+ .weglot-flags.flag-2.my a:before, .weglot-flags.flag-2.my span:before {
637
+ background-position: -1248px 0; }
638
+ .weglot-flags.flag-2.ca a:before, .weglot-flags.flag-2.ca span:before {
639
+ background-position: -5352px 0; }
640
+ .weglot-flags.flag-2.zh a:before, .weglot-flags.flag-2.zh span:before {
641
+ background-position: -2592px 0; }
642
+ .weglot-flags.flag-2.tw a:before, .weglot-flags.flag-2.tw span:before {
643
+ background-position: -3408px 0; }
644
+ .weglot-flags.flag-2.km a:before, .weglot-flags.flag-2.km span:before {
645
+ background-position: -5160px 0; }
646
+ .weglot-flags.flag-2.ny a:before, .weglot-flags.flag-2.ny span:before {
647
+ background-position: -1392px 0; }
648
+ .weglot-flags.flag-2.co a:before, .weglot-flags.flag-2.co span:before {
649
+ background-position: -2304px 0; }
650
+ .weglot-flags.flag-2.hr a:before, .weglot-flags.flag-2.hr span:before {
651
+ background-position: -4416px 0; }
652
+ .weglot-flags.flag-2.cs a:before, .weglot-flags.flag-2.cs span:before {
653
+ background-position: -2472px 0; }
654
+ .weglot-flags.flag-2.da a:before, .weglot-flags.flag-2.da span:before {
655
+ background-position: -2448px 0; }
656
+ .weglot-flags.flag-2.nl a:before, .weglot-flags.flag-2.nl span:before {
657
+ background-position: -1296px 0; }
658
+ .weglot-flags.flag-2.en a:before, .weglot-flags.flag-2.en span:before {
659
+ background-position: -312px 0; }
660
+ .weglot-flags.flag-2.eo a:before, .weglot-flags.flag-2.eo span:before {
661
+ background-position: -312px 0; }
662
+ .weglot-flags.flag-2.et a:before, .weglot-flags.flag-2.et span:before {
663
+ background-position: -2424px 0; }
664
+ .weglot-flags.flag-2.fj a:before, .weglot-flags.flag-2.fj span:before {
665
+ background-position: -576px 0; }
666
+ .weglot-flags.flag-2.fi a:before, .weglot-flags.flag-2.fi span:before {
667
+ background-position: -2328px 0; }
668
+ .weglot-flags.flag-2.fr a:before, .weglot-flags.flag-2.fr span:before {
669
+ background-position: -2304px 0; }
670
+ .weglot-flags.flag-2.gl a:before, .weglot-flags.flag-2.gl span:before {
671
+ background-position: -96px 0; }
672
+ .weglot-flags.flag-2.ka a:before, .weglot-flags.flag-2.ka span:before {
673
+ background-position: -3744px 0; }
674
+ .weglot-flags.flag-2.de a:before, .weglot-flags.flag-2.de span:before {
675
+ background-position: -2256px 0; }
676
+ .weglot-flags.flag-2.el a:before, .weglot-flags.flag-2.el span:before {
677
+ background-position: -2208px 0; }
678
+ .weglot-flags.flag-2.gu a:before, .weglot-flags.flag-2.gu span:before {
679
+ background-position: -1728px 0; }
680
+ .weglot-flags.flag-2.ht a:before, .weglot-flags.flag-2.ht span:before {
681
+ background-position: -3528px 0; }
682
+ .weglot-flags.flag-2.ha a:before, .weglot-flags.flag-2.ha span:before {
683
+ background-position: -1176px 0; }
684
+ .weglot-flags.flag-2.he a:before, .weglot-flags.flag-2.he span:before {
685
+ background-position: -1992px 0; }
686
+ .weglot-flags.flag-2.hi a:before, .weglot-flags.flag-2.hi span:before {
687
+ background-position: -1728px 0; }
688
+ .weglot-flags.flag-2.hu a:before, .weglot-flags.flag-2.hu span:before {
689
+ background-position: -2088px 0; }
690
+ .weglot-flags.flag-2.is a:before, .weglot-flags.flag-2.is span:before {
691
+ background-position: -2064px 0; }
692
+ .weglot-flags.flag-2.ig a:before, .weglot-flags.flag-2.ig span:before {
693
+ background-position: -1103px 0; }
694
+ .weglot-flags.flag-2.id a:before, .weglot-flags.flag-2.id span:before {
695
+ background-position: -2040px 0; }
696
+ .weglot-flags.flag-2.ga a:before, .weglot-flags.flag-2.ga span:before {
697
+ background-position: -2016px 0; }
698
+ .weglot-flags.flag-2.it a:before, .weglot-flags.flag-2.it span:before {
699
+ background-position: -1968px 0; }
700
+ .weglot-flags.flag-2.ja a:before, .weglot-flags.flag-2.ja span:before {
701
+ background-position: -1920px 0; }
702
+ .weglot-flags.flag-2.jv a:before, .weglot-flags.flag-2.jv span:before {
703
+ background-position: -1536px 0; }
704
+ .weglot-flags.flag-2.kn a:before, .weglot-flags.flag-2.kn span:before {
705
+ background-position: -1728px 0; }
706
+ .weglot-flags.flag-2.kk a:before, .weglot-flags.flag-2.kk span:before {
707
+ background-position: -1704px 0; }
708
+ .weglot-flags.flag-2.ko a:before, .weglot-flags.flag-2.ko span:before {
709
+ background-position: -1848px 0; }
710
+ .weglot-flags.flag-2.ku a:before, .weglot-flags.flag-2.ku span:before {
711
+ background-position: -2088px 0; }
712
+ .weglot-flags.flag-2.ky a:before, .weglot-flags.flag-2.ky span:before {
713
+ background-position: -1800px 0; }
714
+ .weglot-flags.flag-2.lo a:before, .weglot-flags.flag-2.lo span:before {
715
+ background-position: -1776px 0; }
716
+ .weglot-flags.flag-2.la a:before, .weglot-flags.flag-2.la span:before {
717
+ background-position: -1968px 0; }
718
+ .weglot-flags.flag-2.lv a:before, .weglot-flags.flag-2.lv span:before {
719
+ background-position: -1752px 0; }
720
+ .weglot-flags.flag-2.lt a:before, .weglot-flags.flag-2.lt span:before {
721
+ background-position: -1656px 0; }
722
+ .weglot-flags.flag-2.lb a:before, .weglot-flags.flag-2.lb span:before {
723
+ background-position: -1632px 0; }
724
+ .weglot-flags.flag-2.mk a:before, .weglot-flags.flag-2.mk span:before {
725
+ background-position: -1440px 0; }
726
+ .weglot-flags.flag-2.mg a:before, .weglot-flags.flag-2.mg span:before {
727
+ background-position: -1560px 0; }
728
+ .weglot-flags.flag-2.ms a:before, .weglot-flags.flag-2.ms span:before {
729
+ background-position: -1536px 0; }
730
+ .weglot-flags.flag-2.ml a:before, .weglot-flags.flag-2.ml span:before {
731
+ background-position: -1728px 0; }
732
+ .weglot-flags.flag-2.mt a:before, .weglot-flags.flag-2.mt span:before {
733
+ background-position: -1200px 0; }
734
+ .weglot-flags.flag-2.mi a:before, .weglot-flags.flag-2.mi span:before {
735
+ background-position: -1224px 0; }
736
+ .weglot-flags.flag-2.mr a:before, .weglot-flags.flag-2.mr span:before {
737
+ background-position: -1728px 0; }
738
+ .weglot-flags.flag-2.mn a:before, .weglot-flags.flag-2.mn span:before {
739
+ background-position: -4800px 0; }
740
+ .weglot-flags.flag-2.ne a:before, .weglot-flags.flag-2.ne span:before {
741
+ background-position: -1320px 0; }
742
+ .weglot-flags.flag-2.no a:before, .weglot-flags.flag-2.no span:before {
743
+ background-position: -4776px 0; }
744
+ .weglot-flags.flag-2.ps a:before, .weglot-flags.flag-2.ps span:before {
745
+ background-position: -4008px 0; }
746
+ .weglot-flags.flag-2.fa a:before, .weglot-flags.flag-2.fa span:before {
747
+ background-position: -5088px 0; }
748
+ .weglot-flags.flag-2.pl a:before, .weglot-flags.flag-2.pl span:before {
749
+ background-position: -984px 0; }
750
+ .weglot-flags.flag-2.pt a:before, .weglot-flags.flag-2.pt span:before {
751
+ background-position: -2784px 0; }
752
+ .weglot-flags.flag-2.pa a:before, .weglot-flags.flag-2.pa span:before {
753
+ background-position: -1728px 0; }
754
+ .weglot-flags.flag-2.ro a:before, .weglot-flags.flag-2.ro span:before {
755
+ background-position: -960px 0; }
756
+ .weglot-flags.flag-2.ru a:before, .weglot-flags.flag-2.ru span:before {
757
+ background-position: -936px 0; }
758
+ .weglot-flags.flag-2.sm a:before, .weglot-flags.flag-2.sm span:before {
759
+ background-position: -3408px 0; }
760
+ .weglot-flags.flag-2.gd a:before, .weglot-flags.flag-2.gd span:before {
761
+ background-position: -4872px 0; }
762
+ .weglot-flags.flag-2.sr a:before, .weglot-flags.flag-2.sr span:before {
763
+ background-position: -3120px 0; }
764
+ .weglot-flags.flag-2.sn a:before, .weglot-flags.flag-2.sn span:before {
765
+ background-position: -72px 0; }
766
+ .weglot-flags.flag-2.sd a:before, .weglot-flags.flag-2.sd span:before {
767
+ background-position: -1128px 0; }
768
+ .weglot-flags.flag-2.si a:before, .weglot-flags.flag-2.si span:before {
769
+ background-position: -480px 0; }
770
+ .weglot-flags.flag-2.sk a:before, .weglot-flags.flag-2.sk span:before {
771
+ background-position: -4152px 0; }
772
+ .weglot-flags.flag-2.sl a:before, .weglot-flags.flag-2.sl span:before {
773
+ background-position: -696px 0; }
774
+ .weglot-flags.flag-2.so a:before, .weglot-flags.flag-2.so span:before {
775
+ background-position: -3336px 0; }
776
+ .weglot-flags.flag-2.st a:before, .weglot-flags.flag-2.st span:before {
777
+ background-position: -3552px 0; }
778
+ .weglot-flags.flag-2.es a:before, .weglot-flags.flag-2.es span:before {
779
+ background-position: -96px 0; }
780
+ .weglot-flags.flag-2.su a:before, .weglot-flags.flag-2.su span:before {
781
+ background-position: -3312px 0; }
782
+ .weglot-flags.flag-2.sw a:before, .weglot-flags.flag-2.sw span:before {
783
+ background-position: -1872px 0; }
784
+ .weglot-flags.flag-2.sv a:before, .weglot-flags.flag-2.sv span:before {
785
+ background-position: -552px 0; }
786
+ .weglot-flags.flag-2.tl a:before, .weglot-flags.flag-2.tl span:before {
787
+ background-position: -1008px 0; }
788
+ .weglot-flags.flag-2.ty a:before, .weglot-flags.flag-2.ty span:before {
789
+ background-position: -4512px 0; }
790
+ .weglot-flags.flag-2.tg a:before, .weglot-flags.flag-2.tg span:before {
791
+ background-position: -264px 0; }
792
+ .weglot-flags.flag-2.ta a:before, .weglot-flags.flag-2.ta span:before {
793
+ background-position: -1728px 0; }
794
+ .weglot-flags.flag-2.tt a:before, .weglot-flags.flag-2.tt span:before {
795
+ background-position: -936px 0; }
796
+ .weglot-flags.flag-2.te a:before, .weglot-flags.flag-2.te span:before {
797
+ background-position: -1728px 0; }
798
+ .weglot-flags.flag-2.th a:before, .weglot-flags.flag-2.th span:before {
799
+ background-position: -456px 0; }
800
+ .weglot-flags.flag-2.to a:before, .weglot-flags.flag-2.to span:before {
801
+ background-position: -3264px 0; }
802
+ .weglot-flags.flag-2.tr a:before, .weglot-flags.flag-2.tr span:before {
803
+ background-position: -360px 0; }
804
+ .weglot-flags.flag-2.uk a:before, .weglot-flags.flag-2.uk span:before {
805
+ background-position: -288px 0; }
806
+ .weglot-flags.flag-2.ur a:before, .weglot-flags.flag-2.ur span:before {
807
+ background-position: -1128px 0; }
808
+ .weglot-flags.flag-2.uz a:before, .weglot-flags.flag-2.uz span:before {
809
+ background-position: -240px 0; }
810
+ .weglot-flags.flag-2.vi a:before, .weglot-flags.flag-2.vi span:before {
811
+ background-position: -144px 0; }
812
+ .weglot-flags.flag-2.cy a:before, .weglot-flags.flag-2.cy span:before {
813
+ background-position: -4848px 0; }
814
+ .weglot-flags.flag-2.fy a:before, .weglot-flags.flag-2.fy span:before {
815
+ background-position: -1296px 0; }
816
+ .weglot-flags.flag-2.xh a:before, .weglot-flags.flag-2.xh span:before {
817
+ background-position: -4968px 0; }
818
+ .weglot-flags.flag-2.yi a:before, .weglot-flags.flag-2.yi span:before {
819
+ background-position: -1992px 0; }
820
+ .weglot-flags.flag-2.yo a:before, .weglot-flags.flag-2.yo span:before {
821
+ background-position: -1103px 0; }
822
+ .weglot-flags.flag-2.zu a:before, .weglot-flags.flag-2.zu span:before {
823
+ background-position: -4968px 0; }
824
+ .weglot-flags.flag-3 {
825
+ /* a faire */
826
+ /* a faire */
827
+ /* a faire */ }
828
+ .weglot-flags.flag-3.hw a:before, .weglot-flags.flag-3.hw span:before {
829
+ background-position: -2711px 0; }
830
+ .weglot-flags.flag-3.fl a:before, .weglot-flags.flag-3.fl span:before {
831
+ background-position: -5232px 0; }
832
+ .weglot-flags.flag-3.af a:before, .weglot-flags.flag-3.af span:before {
833
+ background-position: -5496px 0; }
834
+ .weglot-flags.flag-3.sq a:before, .weglot-flags.flag-3.sq span:before {
835
+ background-position: -4776px 0; }
836
+ .weglot-flags.flag-3.am a:before, .weglot-flags.flag-3.am span:before {
837
+ background-position: -192px 0; }
838
+ .weglot-flags.flag-3.ar a:before, .weglot-flags.flag-3.ar span:before {
839
+ background-position: -3336px 0; }
840
+ .weglot-flags.flag-3.hy a:before, .weglot-flags.flag-3.hy span:before {
841
+ background-position: -4632px 0; }
842
+ .weglot-flags.flag-3.az a:before, .weglot-flags.flag-3.az span:before {
843
+ background-position: -4536px 0; }
844
+ .weglot-flags.flag-3.ba a:before, .weglot-flags.flag-3.ba span:before {
845
+ background-position: -2664px 0; }
846
+ .weglot-flags.flag-3.eu a:before, .weglot-flags.flag-3.eu span:before {
847
+ background-position: -5808px 0; }
848
+ .weglot-flags.flag-3.be a:before, .weglot-flags.flag-3.be span:before {
849
+ background-position: -144px 0; }
850
+ .weglot-flags.flag-3.bn a:before, .weglot-flags.flag-3.bn span:before {
851
+ background-position: -4488px 0; }
852
+ .weglot-flags.flag-3.bs a:before, .weglot-flags.flag-3.bs span:before {
853
+ background-position: -4392px 0; }
854
+ .weglot-flags.flag-3.bg a:before, .weglot-flags.flag-3.bg span:before {
855
+ background-position: -4296px 0; }
856
+ .weglot-flags.flag-3.my a:before, .weglot-flags.flag-3.my span:before {
857
+ background-position: -3769px 0; }
858
+ .weglot-flags.flag-3.ca a:before, .weglot-flags.flag-3.ca span:before {
859
+ background-position: -5784px 0; }
860
+ .weglot-flags.flag-3.zh a:before, .weglot-flags.flag-3.zh span:before {
861
+ background-position: -3240px 0; }
862
+ .weglot-flags.flag-3.tw a:before, .weglot-flags.flag-3.tw span:before {
863
+ background-position: -4008px 0; }
864
+ .weglot-flags.flag-3.km a:before, .weglot-flags.flag-3.km span:before {
865
+ background-position: -4201px 0; }
866
+ .weglot-flags.flag-3.ny a:before, .weglot-flags.flag-3.ny span:before {
867
+ background-position: -384px 0; }
868
+ .weglot-flags.flag-3.co a:before, .weglot-flags.flag-3.co span:before {
869
+ background-position: -2760px 0; }
870
+ .weglot-flags.flag-3.hr a:before, .weglot-flags.flag-3.hr span:before {
871
+ background-position: -3048px 0; }
872
+ .weglot-flags.flag-3.cs a:before, .weglot-flags.flag-3.cs span:before {
873
+ background-position: -5280px 0; }
874
+ .weglot-flags.flag-3.da a:before, .weglot-flags.flag-3.da span:before {
875
+ background-position: -3024px 0; }
876
+ .weglot-flags.flag-3.nl a:before, .weglot-flags.flag-3.nl span:before {
877
+ background-position: -3360px 0; }
878
+ .weglot-flags.flag-3.en a:before, .weglot-flags.flag-3.en span:before {
879
+ background-position: -2520px 0; }
880
+ .weglot-flags.flag-3.eo a:before, .weglot-flags.flag-3.eo span:before {
881
+ background-position: -2520px 0; }
882
+ .weglot-flags.flag-3.et a:before, .weglot-flags.flag-3.et span:before {
883
+ background-position: -2856px 0; }
884
+ .weglot-flags.flag-3.fj a:before, .weglot-flags.flag-3.fj span:before {
885
+ background-position: -0px 0; }
886
+ .weglot-flags.flag-3.fi a:before, .weglot-flags.flag-3.fi span:before {
887
+ background-position: -2784px 0; }
888
+ .weglot-flags.flag-3.fr a:before, .weglot-flags.flag-3.fr span:before {
889
+ background-position: -2760px 0; }
890
+ .weglot-flags.flag-3.gl a:before, .weglot-flags.flag-3.gl span:before {
891
+ background-position: -3576px 0; }
892
+ .weglot-flags.flag-3.ka a:before, .weglot-flags.flag-3.ka span:before {
893
+ background-position: -1536px 0; }
894
+ .weglot-flags.flag-3.de a:before, .weglot-flags.flag-3.de span:before {
895
+ background-position: -1488px 0; }
896
+ .weglot-flags.flag-3.el a:before, .weglot-flags.flag-3.el span:before {
897
+ background-position: -1416px 0; }
898
+ .weglot-flags.flag-3.gu a:before, .weglot-flags.flag-3.gu span:before {
899
+ background-position: -2304px 0; }
900
+ .weglot-flags.flag-3.ht a:before, .weglot-flags.flag-3.ht span:before {
901
+ background-position: -5160px 0; }
902
+ .weglot-flags.flag-3.ha a:before, .weglot-flags.flag-3.ha span:before {
903
+ background-position: -361px 0; }
904
+ .weglot-flags.flag-3.he a:before, .weglot-flags.flag-3.he span:before {
905
+ background-position: -1608px 0; }
906
+ .weglot-flags.flag-3.hi a:before, .weglot-flags.flag-3.hi span:before {
907
+ background-position: -2304px 0; }
908
+ .weglot-flags.flag-3.hu a:before, .weglot-flags.flag-3.hu span:before {
909
+ background-position: -1920px 0; }
910
+ .weglot-flags.flag-3.is a:before, .weglot-flags.flag-3.is span:before {
911
+ background-position: -840px 0; }
912
+ .weglot-flags.flag-3.ig a:before, .weglot-flags.flag-3.ig span:before {
913
+ background-position: -3457px 0; }
914
+ .weglot-flags.flag-3.id a:before, .weglot-flags.flag-3.id span:before {
915
+ background-position: -4992px 0; }
916
+ .weglot-flags.flag-3.ga a:before, .weglot-flags.flag-3.ga span:before {
917
+ background-position: -2016px 0; }
918
+ .weglot-flags.flag-3.it a:before, .weglot-flags.flag-3.it span:before {
919
+ background-position: -336px 0; }
920
+ .weglot-flags.flag-3.ja a:before, .weglot-flags.flag-3.ja span:before {
921
+ background-position: -2448px 0; }
922
+ .weglot-flags.flag-3.jv a:before, .weglot-flags.flag-3.jv span:before {
923
+ background-position: -864px 0; }
924
+ .weglot-flags.flag-3.kn a:before, .weglot-flags.flag-3.kn span:before {
925
+ background-position: -2304px 0; }
926
+ .weglot-flags.flag-3.kk a:before, .weglot-flags.flag-3.kk span:before {
927
+ background-position: -3912px 0; }
928
+ .weglot-flags.flag-3.ko a:before, .weglot-flags.flag-3.ko span:before {
929
+ background-position: -2256px 0; }
930
+ .weglot-flags.flag-3.ku a:before, .weglot-flags.flag-3.ku span:before {
931
+ background-position: -1920px 0; }
932
+ .weglot-flags.flag-3.ky a:before, .weglot-flags.flag-3.ky span:before {
933
+ background-position: -744px 0; }
934
+ .weglot-flags.flag-3.lo a:before, .weglot-flags.flag-3.lo span:before {
935
+ background-position: -3816px 0; }
936
+ .weglot-flags.flag-3.la a:before, .weglot-flags.flag-3.la span:before {
937
+ background-position: -336px 0; }
938
+ .weglot-flags.flag-3.lv a:before, .weglot-flags.flag-3.lv span:before {
939
+ background-position: -216px 0; }
940
+ .weglot-flags.flag-3.lt a:before, .weglot-flags.flag-3.lt span:before {
941
+ background-position: -1776px 0; }
942
+ .weglot-flags.flag-3.lb a:before, .weglot-flags.flag-3.lb span:before {
943
+ background-position: -1945px 0; }
944
+ .weglot-flags.flag-3.mk a:before, .weglot-flags.flag-3.mk span:before {
945
+ background-position: -2208px 0; }
946
+ .weglot-flags.flag-3.mg a:before, .weglot-flags.flag-3.mg span:before {
947
+ background-position: -5064px 0; }
948
+ .weglot-flags.flag-3.ms a:before, .weglot-flags.flag-3.ms span:before {
949
+ background-position: -864px 0; }
950
+ .weglot-flags.flag-3.ml a:before, .weglot-flags.flag-3.ml span:before {
951
+ background-position: -2304px 0; }
952
+ .weglot-flags.flag-3.mt a:before, .weglot-flags.flag-3.mt span:before {
953
+ background-position: -4920px 0; }
954
+ .weglot-flags.flag-3.mi a:before, .weglot-flags.flag-3.mi span:before {
955
+ background-position: -2113px 0; }
956
+ .weglot-flags.flag-3.mr a:before, .weglot-flags.flag-3.mr span:before {
957
+ background-position: -2304px 0; }
958
+ .weglot-flags.flag-3.mn a:before, .weglot-flags.flag-3.mn span:before {
959
+ background-position: -24px 0; }
960
+ .weglot-flags.flag-3.ne a:before, .weglot-flags.flag-3.ne span:before {
961
+ background-position: -5642px 0; }
962
+ .weglot-flags.flag-3.no a:before, .weglot-flags.flag-3.no span:before {
963
+ background-position: -984px 0; }
964
+ .weglot-flags.flag-3.ps a:before, .weglot-flags.flag-3.ps span:before {
965
+ background-position: -4753px 0; }
966
+ .weglot-flags.flag-3.fa a:before, .weglot-flags.flag-3.fa span:before {
967
+ background-position: -816px 0; }
968
+ .weglot-flags.flag-3.pl a:before, .weglot-flags.flag-3.pl span:before {
969
+ background-position: -4944px 0; }
970
+ .weglot-flags.flag-3.pt a:before, .weglot-flags.flag-3.pt span:before {
971
+ background-position: -4344px 0; }
972
+ .weglot-flags.flag-3.pa a:before, .weglot-flags.flag-3.pa span:before {
973
+ background-position: -2304px 0; }
974
+ .weglot-flags.flag-3.ro a:before, .weglot-flags.flag-3.ro span:before {
975
+ background-position: -3744px 0; }
976
+ .weglot-flags.flag-3.ru a:before, .weglot-flags.flag-3.ru span:before {
977
+ background-position: -2664px 0; }
978
+ .weglot-flags.flag-3.sm a:before, .weglot-flags.flag-3.sm span:before {
979
+ background-position: -1248px 0; }
980
+ .weglot-flags.flag-3.gd a:before, .weglot-flags.flag-3.gd span:before {
981
+ background-position: -3841px 0; }
982
+ .weglot-flags.flag-3.sr a:before, .weglot-flags.flag-3.sr span:before {
983
+ background-position: -3312px 0; }
984
+ .weglot-flags.flag-3.sn a:before, .weglot-flags.flag-3.sn span:before {
985
+ background-position: -5521px 0; }
986
+ .weglot-flags.flag-3.sd a:before, .weglot-flags.flag-3.sd span:before {
987
+ background-position: -1993px 0; }
988
+ .weglot-flags.flag-3.si a:before, .weglot-flags.flag-3.si span:before {
989
+ background-position: -2833px 0; }
990
+ .weglot-flags.flag-3.sk a:before, .weglot-flags.flag-3.sk span:before {
991
+ background-position: -552px 0; }
992
+ .weglot-flags.flag-3.sl a:before, .weglot-flags.flag-3.sl span:before {
993
+ background-position: -936px 0; }
994
+ .weglot-flags.flag-3.so a:before, .weglot-flags.flag-3.so span:before {
995
+ background-position: -4032px 0; }
996
+ .weglot-flags.flag-3.st a:before, .weglot-flags.flag-3.st span:before {
997
+ background-position: -3961px 0; }
998
+ .weglot-flags.flag-3.es a:before, .weglot-flags.flag-3.es span:before {
999
+ background-position: -3576px 0; }
1000
+ .weglot-flags.flag-3.su a:before, .weglot-flags.flag-3.su span:before {
1001
+ background-position: -3985px 0; }
1002
+ .weglot-flags.flag-3.sw a:before, .weglot-flags.flag-3.sw span:before {
1003
+ background-position: -912px 0; }
1004
+ .weglot-flags.flag-3.sv a:before, .weglot-flags.flag-3.sv span:before {
1005
+ background-position: -264px 0; }
1006
+ .weglot-flags.flag-3.tl a:before, .weglot-flags.flag-3.tl span:before {
1007
+ background-position: -5232px 0; }
1008
+ .weglot-flags.flag-3.ty a:before, .weglot-flags.flag-3.ty span:before {
1009
+ background-position: -1512px 0; }
1010
+ .weglot-flags.flag-3.tg a:before, .weglot-flags.flag-3.tg span:before {
1011
+ background-position: -3720px 0; }
1012
+ .weglot-flags.flag-3.ta a:before, .weglot-flags.flag-3.ta span:before {
1013
+ background-position: -2304px 0; }
1014
+ .weglot-flags.flag-3.tt a:before, .weglot-flags.flag-3.tt span:before {
1015
+ background-position: -2664px 0; }
1016
+ .weglot-flags.flag-3.te a:before, .weglot-flags.flag-3.te span:before {
1017
+ background-position: -2304px 0; }
1018
+ .weglot-flags.flag-3.th a:before, .weglot-flags.flag-3.th span:before {
1019
+ background-position: -4848px 0; }
1020
+ .weglot-flags.flag-3.to a:before, .weglot-flags.flag-3.to span:before {
1021
+ background-position: -1680px 0; }
1022
+ .weglot-flags.flag-3.tr a:before, .weglot-flags.flag-3.tr span:before {
1023
+ background-position: -432px 0; }
1024
+ .weglot-flags.flag-3.uk a:before, .weglot-flags.flag-3.uk span:before {
1025
+ background-position: -5736px 0; }
1026
+ .weglot-flags.flag-3.ur a:before, .weglot-flags.flag-3.ur span:before {
1027
+ background-position: -1992px 0; }
1028
+ .weglot-flags.flag-3.uz a:before, .weglot-flags.flag-3.uz span:before {
1029
+ background-position: -2160px 0; }
1030
+ .weglot-flags.flag-3.vi a:before, .weglot-flags.flag-3.vi span:before {
1031
+ background-position: -3384px 0; }
1032
+ .weglot-flags.flag-3.cy a:before, .weglot-flags.flag-3.cy span:before {
1033
+ background-position: -5040px 0; }
1034
+ .weglot-flags.flag-3.fy a:before, .weglot-flags.flag-3.fy span:before {
1035
+ background-position: -3360px 0; }
1036
+ .weglot-flags.flag-3.xh a:before, .weglot-flags.flag-3.xh span:before {
1037
+ background-position: -5496px 0; }
1038
+ .weglot-flags.flag-3.yi a:before, .weglot-flags.flag-3.yi span:before {
1039
+ background-position: -1608px 0; }
1040
+ .weglot-flags.flag-3.yo a:before, .weglot-flags.flag-3.yo span:before {
1041
+ background-position: -3457px 0; }
1042
+ .weglot-flags.flag-3.zu a:before, .weglot-flags.flag-3.zu span:before {
1043
+ background-position: -5496px 0; }
dist/front-css.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=11)}({11:function(e,t){}});
dist/front-js.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},o.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/dist/",o(o.s=3)}({3:function(e,t){document.addEventListener("DOMContentLoaded",function(e){const t=document.querySelector(".country-selector");if(!t)return;const o=(e=>{let t=0,o=0;do{t+=e.offsetTop||0,o+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:o}})(t).top,n=document.body,r=document.documentElement,u=Math.max(n.scrollHeight,n.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight),i=window.getComputedStyle(t).getPropertyValue("position");window.getComputedStyle(t).getPropertyValue("bottom"),window.getComputedStyle(t).getPropertyValue("top");return("fixed"!==i&&o>u/2||"fixed"===i&&o>100)&&(t.className+=" weglot-invert"),!1})}});
dist/images/circular_flag.png ADDED
Binary file
dist/images/rect_bright.png ADDED
Binary file
dist/images/rect_mate.png ADDED
Binary file
dist/images/square_flag.png ADDED
Binary file
dist/images/weglot_fav.png ADDED
Binary file
dist/images/weglot_fav_bw.png ADDED
Binary file
dist/images/wgarrowdown.png ADDED
Binary file
dist/selectize.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! selectize.js - v0.12.4 | https://github.com/selectize/selectize.js | Apache License (v2) */
2
+ !function(a,b){"function"==typeof define&&define.amd?define("sifter",b):"object"==typeof exports?module.exports=b():a.Sifter=b()}(this,function(){var a=function(a,b){this.items=a,this.settings=b||{diacritics:!0}};a.prototype.tokenize=function(a){if(a=e(String(a||"").toLowerCase()),!a||!a.length)return[];var b,c,d,g,i=[],j=a.split(/ +/);for(b=0,c=j.length;b<c;b++){if(d=f(j[b]),this.settings.diacritics)for(g in h)h.hasOwnProperty(g)&&(d=d.replace(new RegExp(g,"g"),h[g]));i.push({string:j[b],regex:new RegExp(d,"i")})}return i},a.prototype.iterator=function(a,b){var c;c=g(a)?Array.prototype.forEach||function(a){for(var b=0,c=this.length;b<c;b++)a(this[b],b,this)}:function(a){for(var b in this)this.hasOwnProperty(b)&&a(this[b],b,this)},c.apply(a,[b])},a.prototype.getScoreFunction=function(a,b){var c,e,f,g,h;c=this,a=c.prepareSearch(a,b),f=a.tokens,e=a.options.fields,g=f.length,h=a.options.nesting;var i=function(a,b){var c,d;return a?(a=String(a||""),d=a.search(b.regex),d===-1?0:(c=b.string.length/a.length,0===d&&(c+=.5),c)):0},j=function(){var a=e.length;return a?1===a?function(a,b){return i(d(b,e[0],h),a)}:function(b,c){for(var f=0,g=0;f<a;f++)g+=i(d(c,e[f],h),b);return g/a}:function(){return 0}}();return g?1===g?function(a){return j(f[0],a)}:"and"===a.options.conjunction?function(a){for(var b,c=0,d=0;c<g;c++){if(b=j(f[c],a),b<=0)return 0;d+=b}return d/g}:function(a){for(var b=0,c=0;b<g;b++)c+=j(f[b],a);return c/g}:function(){return 0}},a.prototype.getSortFunction=function(a,c){var e,f,g,h,i,j,k,l,m,n,o;if(g=this,a=g.prepareSearch(a,c),o=!a.query&&c.sort_empty||c.sort,m=function(a,b){return"$score"===a?b.score:d(g.items[b.id],a,c.nesting)},i=[],o)for(e=0,f=o.length;e<f;e++)(a.query||"$score"!==o[e].field)&&i.push(o[e]);if(a.query){for(n=!0,e=0,f=i.length;e<f;e++)if("$score"===i[e].field){n=!1;break}n&&i.unshift({field:"$score",direction:"desc"})}else for(e=0,f=i.length;e<f;e++)if("$score"===i[e].field){i.splice(e,1);break}for(l=[],e=0,f=i.length;e<f;e++)l.push("desc"===i[e].direction?-1:1);return j=i.length,j?1===j?(h=i[0].field,k=l[0],function(a,c){return k*b(m(h,a),m(h,c))}):function(a,c){var d,e,f;for(d=0;d<j;d++)if(f=i[d].field,e=l[d]*b(m(f,a),m(f,c)))return e;return 0}:null},a.prototype.prepareSearch=function(a,b){if("object"==typeof a)return a;b=c({},b);var d=b.fields,e=b.sort,f=b.sort_empty;return d&&!g(d)&&(b.fields=[d]),e&&!g(e)&&(b.sort=[e]),f&&!g(f)&&(b.sort_empty=[f]),{options:b,query:String(a||"").toLowerCase(),tokens:this.tokenize(a),total:0,items:[]}},a.prototype.search=function(a,b){var c,d,e,f,g=this;return d=this.prepareSearch(a,b),b=d.options,a=d.query,f=b.score||g.getScoreFunction(d),a.length?g.iterator(g.items,function(a,e){c=f(a),(b.filter===!1||c>0)&&d.items.push({score:c,id:e})}):g.iterator(g.items,function(a,b){d.items.push({score:1,id:b})}),e=g.getSortFunction(d,b),e&&d.items.sort(e),d.total=d.items.length,"number"==typeof b.limit&&(d.items=d.items.slice(0,b.limit)),d};var b=function(a,b){return"number"==typeof a&&"number"==typeof b?a>b?1:a<b?-1:0:(a=i(String(a||"")),b=i(String(b||"")),a>b?1:b>a?-1:0)},c=function(a,b){var c,d,e,f;for(c=1,d=arguments.length;c<d;c++)if(f=arguments[c])for(e in f)f.hasOwnProperty(e)&&(a[e]=f[e]);return a},d=function(a,b,c){if(a&&b){if(!c)return a[b];for(var d=b.split(".");d.length&&(a=a[d.shift()]););return a}},e=function(a){return(a+"").replace(/^\s+|\s+$|/g,"")},f=function(a){return(a+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},g=Array.isArray||"undefined"!=typeof $&&$.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},h={a:"[aḀḁĂăÂâǍǎȺⱥȦȧẠạÄäÀàÁáĀāÃãÅåąĄÃąĄ]",b:"[b␢βΒB฿𐌁ᛒ]",c:"[cĆćĈĉČčĊċC̄c̄ÇçḈḉȻȼƇƈɕᴄCc]",d:"[dĎďḊḋḐḑḌḍḒḓḎḏĐđD̦d̦ƉɖƊɗƋƌᵭᶁᶑȡᴅDdð]",e:"[eÉéÈèÊêḘḙĚěĔĕẼẽḚḛẺẻĖėËëĒēȨȩĘęᶒɆɇȄȅẾếỀềỄễỂểḜḝḖḗḔḕȆȇẸẹỆệⱸᴇEeɘǝƏƐε]",f:"[fƑƒḞḟ]",g:"[gɢ₲ǤǥĜĝĞğĢģƓɠĠġ]",h:"[hĤĥĦħḨḩẖẖḤḥḢḣɦʰǶƕ]",i:"[iÍíÌìĬĭÎîǏǐÏïḮḯĨĩĮįĪīỈỉȈȉȊȋỊịḬḭƗɨɨ̆ᵻᶖİiIıɪIi]",j:"[jȷĴĵɈɉʝɟʲ]",k:"[kƘƙꝀꝁḰḱǨǩḲḳḴḵκϰ₭]",l:"[lŁłĽľĻļĹĺḶḷḸḹḼḽḺḻĿŀȽƚⱠⱡⱢɫɬᶅɭȴʟLl]",n:"[nŃńǸǹŇňÑñṄṅŅņṆṇṊṋṈṉN̈n̈ƝɲȠƞᵰᶇɳȵɴNnŊŋ]",o:"[oØøÖöÓóÒòÔôǑǒŐőŎŏȮȯỌọƟɵƠơỎỏŌōÕõǪǫȌȍՕօ]",p:"[pṔṕṖṗⱣᵽƤƥᵱ]",q:"[qꝖꝗʠɊɋꝘꝙq̃]",r:"[rŔŕɌɍŘřŖŗṘṙȐȑȒȓṚṛⱤɽ]",s:"[sŚśṠṡṢṣꞨꞩŜŝŠšŞşȘșS̈s̈]",t:"[tŤťṪṫŢţṬṭƮʈȚțṰṱṮṯƬƭ]",u:"[uŬŭɄʉỤụÜüÚúÙùÛûǓǔŰűŬŭƯưỦủŪūŨũŲųȔȕ∪]",v:"[vṼṽṾṿƲʋꝞꝟⱱʋ]",w:"[wẂẃẀẁŴŵẄẅẆẇẈẉ]",x:"[xẌẍẊẋχ]",y:"[yÝýỲỳŶŷŸÿỸỹẎẏỴỵɎɏƳƴ]",z:"[zŹźẐẑŽžŻżẒẓẔẕƵƶ]"},i=function(){var a,b,c,d,e="",f={};for(c in h)if(h.hasOwnProperty(c))for(d=h[c].substring(2,h[c].length-1),e+=d,a=0,b=d.length;a<b;a++)f[d.charAt(a)]=c;var g=new RegExp("["+e+"]","g");return function(a){return a.replace(g,function(a){return f[a]}).toLowerCase()}}();return a}),function(a,b){"function"==typeof define&&define.amd?define("microplugin",b):"object"==typeof exports?module.exports=b():a.MicroPlugin=b()}(this,function(){var a={};a.mixin=function(a){a.plugins={},a.prototype.initializePlugins=function(a){var c,d,e,f=this,g=[];if(f.plugins={names:[],settings:{},requested:{},loaded:{}},b.isArray(a))for(c=0,d=a.length;c<d;c++)"string"==typeof a[c]?g.push(a[c]):(f.plugins.settings[a[c].name]=a[c].options,g.push(a[c].name));else if(a)for(e in a)a.hasOwnProperty(e)&&(f.plugins.settings[e]=a[e],g.push(e));for(;g.length;)f.require(g.shift())},a.prototype.loadPlugin=function(b){var c=this,d=c.plugins,e=a.plugins[b];if(!a.plugins.hasOwnProperty(b))throw new Error('Unable to find "'+b+'" plugin');d.requested[b]=!0,d.loaded[b]=e.fn.apply(c,[c.plugins.settings[b]||{}]),d.names.push(b)},a.prototype.require=function(a){var b=this,c=b.plugins;if(!b.plugins.loaded.hasOwnProperty(a)){if(c.requested[a])throw new Error('Plugin has circular dependency ("'+a+'")');b.loadPlugin(a)}return c.loaded[a]},a.define=function(b,c){a.plugins[b]={name:b,fn:c}}};var b={isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)}};return a}),function(a,b){"function"==typeof define&&define.amd?define("selectize",["jquery","sifter","microplugin"],b):"object"==typeof exports?module.exports=b(require("jquery"),require("sifter"),require("microplugin")):a.Selectize=b(a.jQuery,a.Sifter,a.MicroPlugin)}(this,function(a,b,c){"use strict";var d=function(a,b){if("string"!=typeof b||b.length){var c="string"==typeof b?new RegExp(b,"i"):b,d=function(a){var b=0;if(3===a.nodeType){var e=a.data.search(c);if(e>=0&&a.data.length>0){var f=a.data.match(c),g=document.createElement("span");g.className="highlight";var h=a.splitText(e),i=(h.splitText(f[0].length),h.cloneNode(!0));g.appendChild(i),h.parentNode.replaceChild(g,h),b=1}}else if(1===a.nodeType&&a.childNodes&&!/(script|style)/i.test(a.tagName))for(var j=0;j<a.childNodes.length;++j)j+=d(a.childNodes[j]);return b};return a.each(function(){d(this)})}};a.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName;var a=this.parentNode;a.replaceChild(this.firstChild,this),a.normalize()}).end()};var e=function(){};e.prototype={on:function(a,b){this._events=this._events||{},this._events[a]=this._events[a]||[],this._events[a].push(b)},off:function(a,b){var c=arguments.length;return 0===c?delete this._events:1===c?delete this._events[a]:(this._events=this._events||{},void(a in this._events!=!1&&this._events[a].splice(this._events[a].indexOf(b),1)))},trigger:function(a){if(this._events=this._events||{},a in this._events!=!1)for(var b=0;b<this._events[a].length;b++)this._events[a][b].apply(this,Array.prototype.slice.call(arguments,1))}},e.mixin=function(a){for(var b=["on","off","trigger"],c=0;c<b.length;c++)a.prototype[b[c]]=e.prototype[b[c]]};var f=/Mac/.test(navigator.userAgent),g=65,h=13,i=27,j=37,k=38,l=80,m=39,n=40,o=78,p=8,q=46,r=16,s=f?91:17,t=f?18:17,u=9,v=1,w=2,x=!/android/i.test(window.navigator.userAgent)&&!!document.createElement("input").validity,y=function(a){return"undefined"!=typeof a},z=function(a){return"undefined"==typeof a||null===a?null:"boolean"==typeof a?a?"1":"0":a+""},A=function(a){return(a+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},B={};B.before=function(a,b,c){var d=a[b];a[b]=function(){return c.apply(a,arguments),d.apply(a,arguments)}},B.after=function(a,b,c){var d=a[b];a[b]=function(){var b=d.apply(a,arguments);return c.apply(a,arguments),b}};var C=function(a){var b=!1;return function(){b||(b=!0,a.apply(this,arguments))}},D=function(a,b){var c;return function(){var d=this,e=arguments;window.clearTimeout(c),c=window.setTimeout(function(){a.apply(d,e)},b)}},E=function(a,b,c){var d,e=a.trigger,f={};a.trigger=function(){var c=arguments[0];return b.indexOf(c)===-1?e.apply(a,arguments):void(f[c]=arguments)},c.apply(a,[]),a.trigger=e;for(d in f)f.hasOwnProperty(d)&&e.apply(a,f[d])},F=function(a,b,c,d){a.on(b,c,function(b){for(var c=b.target;c&&c.parentNode!==a[0];)c=c.parentNode;return b.currentTarget=c,d.apply(this,[b])})},G=function(a){var b={};if("selectionStart"in a)b.start=a.selectionStart,b.length=a.selectionEnd-b.start;else if(document.selection){a.focus();var c=document.selection.createRange(),d=document.selection.createRange().text.length;c.moveStart("character",-a.value.length),b.start=c.text.length-d,b.length=d}return b},H=function(a,b,c){var d,e,f={};if(c)for(d=0,e=c.length;d<e;d++)f[c[d]]=a.css(c[d]);else f=a.css();b.css(f)},I=function(b,c){if(!b)return 0;var d=a("<test>").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).text(b).appendTo("body");H(c,d,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]);var e=d.width();return d.remove(),e},J=function(a){var b=null,c=function(c,d){var e,f,g,h,i,j,k,l;c=c||window.event||{},d=d||{},c.metaKey||c.altKey||(d.force||a.data("grow")!==!1)&&(e=a.val(),c.type&&"keydown"===c.type.toLowerCase()&&(f=c.keyCode,g=f>=97&&f<=122||f>=65&&f<=90||f>=48&&f<=57||32===f,f===q||f===p?(l=G(a[0]),l.length?e=e.substring(0,l.start)+e.substring(l.start+l.length):f===p&&l.start?e=e.substring(0,l.start-1)+e.substring(l.start+1):f===q&&"undefined"!=typeof l.start&&(e=e.substring(0,l.start)+e.substring(l.start+1))):g&&(j=c.shiftKey,k=String.fromCharCode(c.keyCode),k=j?k.toUpperCase():k.toLowerCase(),e+=k)),h=a.attr("placeholder"),!e&&h&&(e=h),i=I(e,a)+4,i!==b&&(b=i,a.width(i),a.triggerHandler("resize")))};a.on("keydown keyup update blur",c),c()},K=function(a){var b=document.createElement("div");return b.appendChild(a.cloneNode(!0)),b.innerHTML},L=function(a,b){b||(b={});var c="Selectize";console.error(c+": "+a),b.explanation&&(console.group&&console.group(),console.error(b.explanation),console.group&&console.groupEnd())},M=function(c,d){var e,f,g,h,i=this;h=c[0],h.selectize=i;var j=window.getComputedStyle&&window.getComputedStyle(h,null);if(g=j?j.getPropertyValue("direction"):h.currentStyle&&h.currentStyle.direction,g=g||c.parents("[dir]:first").attr("dir")||"",a.extend(i,{order:0,settings:d,$input:c,tabIndex:c.attr("tabindex")||"",tagType:"select"===h.tagName.toLowerCase()?v:w,rtl:/rtl/i.test(g),eventNS:".selectize"+ ++M.count,highlightedValue:null,isOpen:!1,isDisabled:!1,isRequired:c.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===d.loadThrottle?i.onSearchChange:D(i.onSearchChange,d.loadThrottle)}),i.sifter=new b(this.options,{diacritics:d.diacritics}),i.settings.options){for(e=0,f=i.settings.options.length;e<f;e++)i.registerOption(i.settings.options[e]);delete i.settings.options}if(i.settings.optgroups){for(e=0,f=i.settings.optgroups.length;e<f;e++)i.registerOptionGroup(i.settings.optgroups[e]);delete i.settings.optgroups}i.settings.mode=i.settings.mode||(1===i.settings.maxItems?"single":"multi"),"boolean"!=typeof i.settings.hideSelected&&(i.settings.hideSelected="multi"===i.settings.mode),i.initializePlugins(i.settings.plugins),i.setupCallbacks(),i.setupTemplates(),i.setup()};return e.mixin(M),"undefined"!=typeof c?c.mixin(M):L("Dependency MicroPlugin is missing",{explanation:'Make sure you either: (1) are using the "standalone" version of Selectize, or (2) require MicroPlugin before you load Selectize.'}),a.extend(M.prototype,{setup:function(){var b,c,d,e,g,h,i,j,k,l,m=this,n=m.settings,o=m.eventNS,p=a(window),q=a(document),u=m.$input;if(i=m.settings.mode,j=u.attr("class")||"",b=a("<div>").addClass(n.wrapperClass).addClass(j).addClass(i),c=a("<div>").addClass(n.inputClass).addClass("items").appendTo(b),d=a('<input type="text" autocomplete="off" />').appendTo(c).attr("tabindex",u.is(":disabled")?"-1":m.tabIndex),h=a(n.dropdownParent||b),e=a("<div>").addClass(n.dropdownClass).addClass(i).hide().appendTo(h),g=a("<div>").addClass(n.dropdownContentClass).appendTo(e),(l=u.attr("id"))&&(d.attr("id",l+"-selectized"),a("label[for='"+l+"']").attr("for",l+"-selectized")),m.settings.copyClassesToDropdown&&e.addClass(j),b.css({width:u[0].style.width}),m.plugins.names.length&&(k="plugin-"+m.plugins.names.join(" plugin-"),b.addClass(k),e.addClass(k)),(null===n.maxItems||n.maxItems>1)&&m.tagType===v&&u.attr("multiple","multiple"),m.settings.placeholder&&d.attr("placeholder",n.placeholder),!m.settings.splitOn&&m.settings.delimiter){var w=m.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");m.settings.splitOn=new RegExp("\\s*"+w+"+\\s*")}u.attr("autocorrect")&&d.attr("autocorrect",u.attr("autocorrect")),u.attr("autocapitalize")&&d.attr("autocapitalize",u.attr("autocapitalize")),m.$wrapper=b,m.$control=c,m.$control_input=d,m.$dropdown=e,m.$dropdown_content=g,e.on("mouseenter","[data-selectable]",function(){return m.onOptionHover.apply(m,arguments)}),e.on("mousedown click","[data-selectable]",function(){return m.onOptionSelect.apply(m,arguments)}),F(c,"mousedown","*:not(input)",function(){return m.onItemSelect.apply(m,arguments)}),J(d),c.on({mousedown:function(){return m.onMouseDown.apply(m,arguments)},click:function(){return m.onClick.apply(m,arguments)}}),d.on({mousedown:function(a){a.stopPropagation()},keydown:function(){return m.onKeyDown.apply(m,arguments)},keyup:function(){return m.onKeyUp.apply(m,arguments)},keypress:function(){return m.onKeyPress.apply(m,arguments)},resize:function(){m.positionDropdown.apply(m,[])},blur:function(){return m.onBlur.apply(m,arguments)},focus:function(){return m.ignoreBlur=!1,m.onFocus.apply(m,arguments)},paste:function(){return m.onPaste.apply(m,arguments)}}),q.on("keydown"+o,function(a){m.isCmdDown=a[f?"metaKey":"ctrlKey"],m.isCtrlDown=a[f?"altKey":"ctrlKey"],m.isShiftDown=a.shiftKey}),q.on("keyup"+o,function(a){a.keyCode===t&&(m.isCtrlDown=!1),a.keyCode===r&&(m.isShiftDown=!1),a.keyCode===s&&(m.isCmdDown=!1)}),q.on("mousedown"+o,function(a){if(m.isFocused){if(a.target===m.$dropdown[0]||a.target.parentNode===m.$dropdown[0])return!1;m.$control.has(a.target).length||a.target===m.$control[0]||m.blur(a.target)}}),p.on(["scroll"+o,"resize"+o].join(" "),function(){m.isOpen&&m.positionDropdown.apply(m,arguments)}),p.on("mousemove"+o,function(){m.ignoreHover=!1}),this.revertSettings={$children:u.children().detach(),tabindex:u.attr("tabindex")},u.attr("tabindex",-1).hide().after(m.$wrapper),a.isArray(n.items)&&(m.setValue(n.items),delete n.items),x&&u.on("invalid"+o,function(a){a.preventDefault(),m.isInvalid=!0,m.refreshState()}),m.updateOriginalInput(),m.refreshItems(),m.refreshState(),m.updatePlaceholder(),m.isSetup=!0,u.is(":disabled")&&m.disable(),m.on("change",this.onChange),u.data("selectize",m),u.addClass("selectized"),m.trigger("initialize"),n.preload===!0&&m.onSearchChange("")},setupTemplates:function(){var b=this,c=b.settings.labelField,d=b.settings.optgroupLabelField,e={optgroup:function(a){return'<div class="optgroup">'+a.html+"</div>"},optgroup_header:function(a,b){return'<div class="optgroup-header">'+b(a[d])+"</div>"},option:function(a,b){return'<div class="option">'+b(a[c])+"</div>"},item:function(a,b){return'<div class="item">'+b(a[c])+"</div>"},option_create:function(a,b){return'<div class="create">Add <strong>'+b(a.input)+"</strong>&hellip;</div>"}};b.settings.render=a.extend({},e,b.settings.render)},setupCallbacks:function(){var a,b,c={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(a in c)c.hasOwnProperty(a)&&(b=this.settings[c[a]],b&&this.on(a,b))},onClick:function(a){var b=this;b.isFocused||(b.focus(),a.preventDefault())},onMouseDown:function(b){var c=this,d=b.isDefaultPrevented();a(b.target);if(c.isFocused){if(b.target!==c.$control_input[0])return"single"===c.settings.mode?c.isOpen?c.close():c.open():d||c.setActiveItem(null),!1}else d||window.setTimeout(function(){c.focus()},0)},onChange:function(){this.$input.trigger("change")},onPaste:function(b){var c=this;return c.isFull()||c.isInputHidden||c.isLocked?void b.preventDefault():void(c.settings.splitOn&&setTimeout(function(){var b=c.$control_input.val();if(b.match(c.settings.splitOn))for(var d=a.trim(b).split(c.settings.splitOn),e=0,f=d.length;e<f;e++)c.createItem(d[e])},0))},onKeyPress:function(a){if(this.isLocked)return a&&a.preventDefault();var b=String.fromCharCode(a.keyCode||a.which);return this.settings.create&&"multi"===this.settings.mode&&b===this.settings.delimiter?(this.createItem(),a.preventDefault(),!1):void 0},onKeyDown:function(a){var b=(a.target===this.$control_input[0],this);if(b.isLocked)return void(a.keyCode!==u&&a.preventDefault());switch(a.keyCode){case g:if(b.isCmdDown)return void b.selectAll();break;case i:return void(b.isOpen&&(a.preventDefault(),a.stopPropagation(),b.close()));case o:if(!a.ctrlKey||a.altKey)break;case n:if(!b.isOpen&&b.hasOptions)b.open();else if(b.$activeOption){b.ignoreHover=!0;var c=b.getAdjacentOption(b.$activeOption,1);c.length&&b.setActiveOption(c,!0,!0)}return void a.preventDefault();case l:if(!a.ctrlKey||a.altKey)break;case k:if(b.$activeOption){b.ignoreHover=!0;var d=b.getAdjacentOption(b.$activeOption,-1);d.length&&b.setActiveOption(d,!0,!0)}return void a.preventDefault();case h:return void(b.isOpen&&b.$activeOption&&(b.onOptionSelect({currentTarget:b.$activeOption}),a.preventDefault()));case j:return void b.advanceSelection(-1,a);case m:return void b.advanceSelection(1,a);case u:return b.settings.selectOnTab&&b.isOpen&&b.$activeOption&&(b.onOptionSelect({currentTarget:b.$activeOption}),b.isFull()||a.preventDefault()),void(b.settings.create&&b.createItem()&&a.preventDefault());case p:case q:return void b.deleteSelection(a)}return!b.isFull()&&!b.isInputHidden||(f?a.metaKey:a.ctrlKey)?void 0:void a.preventDefault()},onKeyUp:function(a){var b=this;if(b.isLocked)return a&&a.preventDefault();var c=b.$control_input.val()||"";b.lastValue!==c&&(b.lastValue=c,b.onSearchChange(c),b.refreshOptions(),b.trigger("type",c))},onSearchChange:function(a){var b=this,c=b.settings.load;c&&(b.loadedSearches.hasOwnProperty(a)||(b.loadedSearches[a]=!0,b.load(function(d){c.apply(b,[a,d])})))},onFocus:function(a){var b=this,c=b.isFocused;return b.isDisabled?(b.blur(),a&&a.preventDefault(),!1):void(b.ignoreFocus||(b.isFocused=!0,"focus"===b.settings.preload&&b.onSearchChange(""),c||b.trigger("focus"),b.$activeItems.length||(b.showInput(),b.setActiveItem(null),b.refreshOptions(!!b.settings.openOnFocus)),b.refreshState()))},onBlur:function(a,b){var c=this;if(c.isFocused&&(c.isFocused=!1,!c.ignoreFocus)){if(!c.ignoreBlur&&document.activeElement===c.$dropdown_content[0])return c.ignoreBlur=!0,void c.onFocus(a);var d=function(){c.close(),c.setTextboxValue(""),c.setActiveItem(null),c.setActiveOption(null),c.setCaret(c.items.length),c.refreshState(),b&&b.focus&&b.focus(),c.ignoreFocus=!1,c.trigger("blur")};c.ignoreFocus=!0,c.settings.create&&c.settings.createOnBlur?c.createItem(null,!1,d):d()}},onOptionHover:function(a){this.ignoreHover||this.setActiveOption(a.currentTarget,!1)},onOptionSelect:function(b){var c,d,e=this;b.preventDefault&&(b.preventDefault(),b.stopPropagation()),d=a(b.currentTarget),d.hasClass("create")?e.createItem(null,function(){e.settings.closeAfterSelect&&e.close()}):(c=d.attr("data-value"),"undefined"!=typeof c&&(e.lastQuery=null,e.setTextboxValue(""),e.addItem(c),e.settings.closeAfterSelect?e.close():!e.settings.hideSelected&&b.type&&/mouse/.test(b.type)&&e.setActiveOption(e.getOption(c))))},onItemSelect:function(a){var b=this;b.isLocked||"multi"===b.settings.mode&&(a.preventDefault(),b.setActiveItem(a.currentTarget,a))},load:function(a){var b=this,c=b.$wrapper.addClass(b.settings.loadingClass);b.loading++,a.apply(b,[function(a){b.loading=Math.max(b.loading-1,0),a&&a.length&&(b.addOption(a),b.refreshOptions(b.isFocused&&!b.isInputHidden)),b.loading||c.removeClass(b.settings.loadingClass),b.trigger("load",a)}])},setTextboxValue:function(a){var b=this.$control_input,c=b.val()!==a;c&&(b.val(a).triggerHandler("update"),this.lastValue=a)},getValue:function(){return this.tagType===v&&this.$input.attr("multiple")?this.items:this.items.join(this.settings.delimiter)},setValue:function(a,b){var c=b?[]:["change"];E(this,c,function(){this.clear(b),this.addItems(a,b)})},setActiveItem:function(b,c){var d,e,f,g,h,i,j,k,l=this;if("single"!==l.settings.mode){if(b=a(b),!b.length)return a(l.$activeItems).removeClass("active"),l.$activeItems=[],void(l.isFocused&&l.showInput());if(d=c&&c.type.toLowerCase(),"mousedown"===d&&l.isShiftDown&&l.$activeItems.length){for(k=l.$control.children(".active:last"),g=Array.prototype.indexOf.apply(l.$control[0].childNodes,[k[0]]),h=Array.prototype.indexOf.apply(l.$control[0].childNodes,[b[0]]),g>h&&(j=g,g=h,h=j),e=g;e<=h;e++)i=l.$control[0].childNodes[e],l.$activeItems.indexOf(i)===-1&&(a(i).addClass("active"),l.$activeItems.push(i));c.preventDefault()}else"mousedown"===d&&l.isCtrlDown||"keydown"===d&&this.isShiftDown?b.hasClass("active")?(f=l.$activeItems.indexOf(b[0]),l.$activeItems.splice(f,1),b.removeClass("active")):l.$activeItems.push(b.addClass("active")[0]):(a(l.$activeItems).removeClass("active"),l.$activeItems=[b.addClass("active")[0]]);l.hideInput(),this.isFocused||l.focus()}},setActiveOption:function(b,c,d){var e,f,g,h,i,j=this;j.$activeOption&&j.$activeOption.removeClass("active"),j.$activeOption=null,b=a(b),b.length&&(j.$activeOption=b.addClass("active"),!c&&y(c)||(e=j.$dropdown_content.height(),f=j.$activeOption.outerHeight(!0),c=j.$dropdown_content.scrollTop()||0,g=j.$activeOption.offset().top-j.$dropdown_content.offset().top+c,h=g,i=g-e+f,g+f>e+c?j.$dropdown_content.stop().animate({scrollTop:i},d?j.settings.scrollDuration:0):g<c&&j.$dropdown_content.stop().animate({scrollTop:h},d?j.settings.scrollDuration:0)))},selectAll:function(){var a=this;"single"!==a.settings.mode&&(a.$activeItems=Array.prototype.slice.apply(a.$control.children(":not(input)").addClass("active")),a.$activeItems.length&&(a.hideInput(),a.close()),a.focus())},hideInput:function(){var a=this;a.setTextboxValue(""),a.$control_input.css({opacity:0,position:"absolute",left:a.rtl?1e4:-1e4}),a.isInputHidden=!0},showInput:function(){this.$control_input.css({opacity:1,position:"relative",left:0}),this.isInputHidden=!1},focus:function(){var a=this;a.isDisabled||(a.ignoreFocus=!0,a.$control_input[0].focus(),window.setTimeout(function(){a.ignoreFocus=!1,a.onFocus()},0))},blur:function(a){this.$control_input[0].blur(),this.onBlur(null,a)},getScoreFunction:function(a){return this.sifter.getScoreFunction(a,this.getSearchOptions())},getSearchOptions:function(){var a=this.settings,b=a.sortField;return"string"==typeof b&&(b=[{field:b}]),{fields:a.searchField,conjunction:a.searchConjunction,sort:b}},search:function(b){var c,d,e,f=this,g=f.settings,h=this.getSearchOptions();if(g.score&&(e=f.settings.score.apply(this,[b]),"function"!=typeof e))throw new Error('Selectize "score" setting must be a function that returns a function');if(b!==f.lastQuery?(f.lastQuery=b,d=f.sifter.search(b,a.extend(h,{score:e})),f.currentResults=d):d=a.extend(!0,{},f.currentResults),g.hideSelected)for(c=d.items.length-1;c>=0;c--)f.items.indexOf(z(d.items[c].id))!==-1&&d.items.splice(c,1);return d},refreshOptions:function(b){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;"undefined"==typeof b&&(b=!0);var t=this,u=a.trim(t.$control_input.val()),v=t.search(u),w=t.$dropdown_content,x=t.$activeOption&&z(t.$activeOption.attr("data-value"));for(g=v.items.length,"number"==typeof t.settings.maxOptions&&(g=Math.min(g,t.settings.maxOptions)),h={},i=[],c=0;c<g;c++)for(j=t.options[v.items[c].id],k=t.render("option",j),l=j[t.settings.optgroupField]||"",m=a.isArray(l)?l:[l],e=0,f=m&&m.length;e<f;e++)l=m[e],t.optgroups.hasOwnProperty(l)||(l=""),h.hasOwnProperty(l)||(h[l]=document.createDocumentFragment(),i.push(l)),h[l].appendChild(k);for(this.settings.lockOptgroupOrder&&i.sort(function(a,b){var c=t.optgroups[a].$order||0,d=t.optgroups[b].$order||0;return c-d}),n=document.createDocumentFragment(),c=0,g=i.length;c<g;c++)l=i[c],t.optgroups.hasOwnProperty(l)&&h[l].childNodes.length?(o=document.createDocumentFragment(),o.appendChild(t.render("optgroup_header",t.optgroups[l])),o.appendChild(h[l]),n.appendChild(t.render("optgroup",a.extend({},t.optgroups[l],{html:K(o),dom:o})))):n.appendChild(h[l]);if(w.html(n),t.settings.highlight&&v.query.length&&v.tokens.length)for(w.removeHighlight(),c=0,g=v.tokens.length;c<g;c++)d(w,v.tokens[c].regex);if(!t.settings.hideSelected)for(c=0,g=t.items.length;c<g;c++)t.getOption(t.items[c]).addClass("selected");p=t.canCreate(u),p&&(w.prepend(t.render("option_create",{input:u})),s=a(w[0].childNodes[0])),t.hasOptions=v.items.length>0||p,t.hasOptions?(v.items.length>0?(r=x&&t.getOption(x),r&&r.length?q=r:"single"===t.settings.mode&&t.items.length&&(q=t.getOption(t.items[0])),q&&q.length||(q=s&&!t.settings.addPrecedence?t.getAdjacentOption(s,1):w.find("[data-selectable]:first"))):q=s,t.setActiveOption(q),b&&!t.isOpen&&t.open()):(t.setActiveOption(null),b&&t.isOpen&&t.close())},addOption:function(b){var c,d,e,f=this;if(a.isArray(b))for(c=0,d=b.length;c<d;c++)f.addOption(b[c]);else(e=f.registerOption(b))&&(f.userOptions[e]=!0,f.lastQuery=null,f.trigger("option_add",e,b))},registerOption:function(a){var b=z(a[this.settings.valueField]);return"undefined"!=typeof b&&null!==b&&!this.options.hasOwnProperty(b)&&(a.$order=a.$order||++this.order,this.options[b]=a,b)},registerOptionGroup:function(a){var b=z(a[this.settings.optgroupValueField]);return!!b&&(a.$order=a.$order||++this.order,this.optgroups[b]=a,b)},addOptionGroup:function(a,b){b[this.settings.optgroupValueField]=a,(a=this.registerOptionGroup(b))&&this.trigger("optgroup_add",a,b)},removeOptionGroup:function(a){this.optgroups.hasOwnProperty(a)&&(delete this.optgroups[a],this.renderCache={},this.trigger("optgroup_remove",a))},clearOptionGroups:function(){this.optgroups={},this.renderCache={},this.trigger("optgroup_clear")},updateOption:function(b,c){var d,e,f,g,h,i,j,k=this;if(b=z(b),f=z(c[k.settings.valueField]),null!==b&&k.options.hasOwnProperty(b)){if("string"!=typeof f)throw new Error("Value must be set in option data");j=k.options[b].$order,f!==b&&(delete k.options[b],g=k.items.indexOf(b),g!==-1&&k.items.splice(g,1,f)),c.$order=c.$order||j,k.options[f]=c,h=k.renderCache.item,i=k.renderCache.option,h&&(delete h[b],delete h[f]),i&&(delete i[b],delete i[f]),k.items.indexOf(f)!==-1&&(d=k.getItem(b),e=a(k.render("item",c)),d.hasClass("active")&&e.addClass("active"),d.replaceWith(e)),k.lastQuery=null,k.isOpen&&k.refreshOptions(!1)}},removeOption:function(a,b){var c=this;a=z(a);var d=c.renderCache.item,e=c.renderCache.option;d&&delete d[a],e&&delete e[a],delete c.userOptions[a],delete c.options[a],c.lastQuery=null,c.trigger("option_remove",a),c.removeItem(a,b)},clearOptions:function(){var a=this;a.loadedSearches={},a.userOptions={},a.renderCache={},a.options=a.sifter.items={},a.lastQuery=null,a.trigger("option_clear"),a.clear()},getOption:function(a){return this.getElementWithValue(a,this.$dropdown_content.find("[data-selectable]"))},getAdjacentOption:function(b,c){var d=this.$dropdown.find("[data-selectable]"),e=d.index(b)+c;return e>=0&&e<d.length?d.eq(e):a()},getElementWithValue:function(b,c){if(b=z(b),"undefined"!=typeof b&&null!==b)for(var d=0,e=c.length;d<e;d++)if(c[d].getAttribute("data-value")===b)return a(c[d]);return a()},getItem:function(a){return this.getElementWithValue(a,this.$control.children())},addItems:function(b,c){for(var d=a.isArray(b)?b:[b],e=0,f=d.length;e<f;e++)this.isPending=e<f-1,this.addItem(d[e],c)},addItem:function(b,c){var d=c?[]:["change"];E(this,d,function(){var d,e,f,g,h,i=this,j=i.settings.mode;return b=z(b),i.items.indexOf(b)!==-1?void("single"===j&&i.close()):void(i.options.hasOwnProperty(b)&&("single"===j&&i.clear(c),"multi"===j&&i.isFull()||(d=a(i.render("item",i.options[b])),h=i.isFull(),i.items.splice(i.caretPos,0,b),i.insertAtCaret(d),(!i.isPending||!h&&i.isFull())&&i.refreshState(),i.isSetup&&(f=i.$dropdown_content.find("[data-selectable]"),i.isPending||(e=i.getOption(b),g=i.getAdjacentOption(e,1).attr("data-value"),i.refreshOptions(i.isFocused&&"single"!==j),g&&i.setActiveOption(i.getOption(g))),!f.length||i.isFull()?i.close():i.positionDropdown(),i.updatePlaceholder(),i.trigger("item_add",b,d),i.updateOriginalInput({silent:c})))))})},removeItem:function(b,c){var d,e,f,g=this;d=b instanceof a?b:g.getItem(b),b=z(d.attr("data-value")),e=g.items.indexOf(b),e!==-1&&(d.remove(),d.hasClass("active")&&(f=g.$activeItems.indexOf(d[0]),g.$activeItems.splice(f,1)),g.items.splice(e,1),g.lastQuery=null,!g.settings.persist&&g.userOptions.hasOwnProperty(b)&&g.removeOption(b,c),e<g.caretPos&&g.setCaret(g.caretPos-1),g.refreshState(),g.updatePlaceholder(),g.updateOriginalInput({silent:c}),g.positionDropdown(),g.trigger("item_remove",b,d))},createItem:function(b,c){var d=this,e=d.caretPos;b=b||a.trim(d.$control_input.val()||"");var f=arguments[arguments.length-1];if("function"!=typeof f&&(f=function(){}),"boolean"!=typeof c&&(c=!0),!d.canCreate(b))return f(),!1;d.lock();var g="function"==typeof d.settings.create?this.settings.create:function(a){var b={};return b[d.settings.labelField]=a,b[d.settings.valueField]=a,b},h=C(function(a){if(d.unlock(),!a||"object"!=typeof a)return f();var b=z(a[d.settings.valueField]);return"string"!=typeof b?f():(d.setTextboxValue(""),d.addOption(a),d.setCaret(e),d.addItem(b),d.refreshOptions(c&&"single"!==d.settings.mode),void f(a))}),i=g.apply(this,[b,h]);return"undefined"!=typeof i&&h(i),!0},refreshItems:function(){this.lastQuery=null,this.isSetup&&this.addItem(this.items),this.refreshState(),this.updateOriginalInput()},refreshState:function(){this.refreshValidityState(),this.refreshClasses()},refreshValidityState:function(){if(!this.isRequired)return!1;var a=!this.items.length;this.isInvalid=a,this.$control_input.prop("required",a),this.$input.prop("required",!a)},refreshClasses:function(){var b=this,c=b.isFull(),d=b.isLocked;b.$wrapper.toggleClass("rtl",b.rtl),b.$control.toggleClass("focus",b.isFocused).toggleClass("disabled",b.isDisabled).toggleClass("required",b.isRequired).toggleClass("invalid",b.isInvalid).toggleClass("locked",d).toggleClass("full",c).toggleClass("not-full",!c).toggleClass("input-active",b.isFocused&&!b.isInputHidden).toggleClass("dropdown-active",b.isOpen).toggleClass("has-options",!a.isEmptyObject(b.options)).toggleClass("has-items",b.items.length>0),b.$control_input.data("grow",!c&&!d)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(a){var b,c,d,e,f=this;if(a=a||{},f.tagType===v){for(d=[],b=0,c=f.items.length;b<c;b++)e=f.options[f.items[b]][f.settings.labelField]||"",d.push('<option value="'+A(f.items[b])+'" selected="selected">'+A(e)+"</option>");d.length||this.$input.attr("multiple")||d.push('<option value="" selected="selected"></option>'),
3
+ f.$input.html(d.join(""))}else f.$input.val(f.getValue()),f.$input.attr("value",f.$input.val());f.isSetup&&(a.silent||f.trigger("change",f.$input.val()))},updatePlaceholder:function(){if(this.settings.placeholder){var a=this.$control_input;this.items.length?a.removeAttr("placeholder"):a.attr("placeholder",this.settings.placeholder),a.triggerHandler("update",{force:!0})}},open:function(){var a=this;a.isLocked||a.isOpen||"multi"===a.settings.mode&&a.isFull()||(a.focus(),a.isOpen=!0,a.refreshState(),a.$dropdown.css({visibility:"hidden",display:"block"}),a.positionDropdown(),a.$dropdown.css({visibility:"visible"}),a.trigger("dropdown_open",a.$dropdown))},close:function(){var a=this,b=a.isOpen;"single"===a.settings.mode&&a.items.length&&(a.hideInput(),a.$control_input.blur()),a.isOpen=!1,a.$dropdown.hide(),a.setActiveOption(null),a.refreshState(),b&&a.trigger("dropdown_close",a.$dropdown)},positionDropdown:function(){var a=this.$control,b="body"===this.settings.dropdownParent?a.offset():a.position();b.top+=a.outerHeight(!0),this.$dropdown.css({width:a.outerWidth(),top:b.top,left:b.left})},clear:function(a){var b=this;b.items.length&&(b.$control.children(":not(input)").remove(),b.items=[],b.lastQuery=null,b.setCaret(0),b.setActiveItem(null),b.updatePlaceholder(),b.updateOriginalInput({silent:a}),b.refreshState(),b.showInput(),b.trigger("clear"))},insertAtCaret:function(b){var c=Math.min(this.caretPos,this.items.length);0===c?this.$control.prepend(b):a(this.$control[0].childNodes[c]).before(b),this.setCaret(c+1)},deleteSelection:function(b){var c,d,e,f,g,h,i,j,k,l=this;if(e=b&&b.keyCode===p?-1:1,f=G(l.$control_input[0]),l.$activeOption&&!l.settings.hideSelected&&(i=l.getAdjacentOption(l.$activeOption,-1).attr("data-value")),g=[],l.$activeItems.length){for(k=l.$control.children(".active:"+(e>0?"last":"first")),h=l.$control.children(":not(input)").index(k),e>0&&h++,c=0,d=l.$activeItems.length;c<d;c++)g.push(a(l.$activeItems[c]).attr("data-value"));b&&(b.preventDefault(),b.stopPropagation())}else(l.isFocused||"single"===l.settings.mode)&&l.items.length&&(e<0&&0===f.start&&0===f.length?g.push(l.items[l.caretPos-1]):e>0&&f.start===l.$control_input.val().length&&g.push(l.items[l.caretPos]));if(!g.length||"function"==typeof l.settings.onDelete&&l.settings.onDelete.apply(l,[g])===!1)return!1;for("undefined"!=typeof h&&l.setCaret(h);g.length;)l.removeItem(g.pop());return l.showInput(),l.positionDropdown(),l.refreshOptions(!0),i&&(j=l.getOption(i),j.length&&l.setActiveOption(j)),!0},advanceSelection:function(a,b){var c,d,e,f,g,h,i=this;0!==a&&(i.rtl&&(a*=-1),c=a>0?"last":"first",d=G(i.$control_input[0]),i.isFocused&&!i.isInputHidden?(f=i.$control_input.val().length,g=a<0?0===d.start&&0===d.length:d.start===f,g&&!f&&i.advanceCaret(a,b)):(h=i.$control.children(".active:"+c),h.length&&(e=i.$control.children(":not(input)").index(h),i.setActiveItem(null),i.setCaret(a>0?e+1:e))))},advanceCaret:function(a,b){var c,d,e=this;0!==a&&(c=a>0?"next":"prev",e.isShiftDown?(d=e.$control_input[c](),d.length&&(e.hideInput(),e.setActiveItem(d),b&&b.preventDefault())):e.setCaret(e.caretPos+a))},setCaret:function(b){var c=this;if(b="single"===c.settings.mode?c.items.length:Math.max(0,Math.min(c.items.length,b)),!c.isPending){var d,e,f,g;for(f=c.$control.children(":not(input)"),d=0,e=f.length;d<e;d++)g=a(f[d]).detach(),d<b?c.$control_input.before(g):c.$control.append(g)}c.caretPos=b},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){var a=this;a.$input.prop("disabled",!0),a.$control_input.prop("disabled",!0).prop("tabindex",-1),a.isDisabled=!0,a.lock()},enable:function(){var a=this;a.$input.prop("disabled",!1),a.$control_input.prop("disabled",!1).prop("tabindex",a.tabIndex),a.isDisabled=!1,a.unlock()},destroy:function(){var b=this,c=b.eventNS,d=b.revertSettings;b.trigger("destroy"),b.off(),b.$wrapper.remove(),b.$dropdown.remove(),b.$input.html("").append(d.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:d.tabindex}).show(),b.$control_input.removeData("grow"),b.$input.removeData("selectize"),a(window).off(c),a(document).off(c),a(document.body).off(c),delete b.$input[0].selectize},render:function(b,c){var d,e,f="",g=!1,h=this;return"option"!==b&&"item"!==b||(d=z(c[h.settings.valueField]),g=!!d),g&&(y(h.renderCache[b])||(h.renderCache[b]={}),h.renderCache[b].hasOwnProperty(d))?h.renderCache[b][d]:(f=a(h.settings.render[b].apply(this,[c,A])),"option"===b||"option_create"===b?f.attr("data-selectable",""):"optgroup"===b&&(e=c[h.settings.optgroupValueField]||"",f.attr("data-group",e)),"option"!==b&&"item"!==b||f.attr("data-value",d||""),g&&(h.renderCache[b][d]=f[0]),f[0])},clearCache:function(a){var b=this;"undefined"==typeof a?b.renderCache={}:delete b.renderCache[a]},canCreate:function(a){var b=this;if(!b.settings.create)return!1;var c=b.settings.createFilter;return a.length&&("function"!=typeof c||c.apply(b,[a]))&&("string"!=typeof c||new RegExp(c).test(a))&&(!(c instanceof RegExp)||c.test(a))}}),M.count=0,M.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},a.fn.selectize=function(b){var c=a.fn.selectize.defaults,d=a.extend({},c,b),e=d.dataAttr,f=d.labelField,g=d.valueField,h=d.optgroupField,i=d.optgroupLabelField,j=d.optgroupValueField,k=function(b,c){var h,i,j,k,l=b.attr(e);if(l)for(c.options=JSON.parse(l),h=0,i=c.options.length;h<i;h++)c.items.push(c.options[h][g]);else{var m=a.trim(b.val()||"");if(!d.allowEmptyOption&&!m.length)return;for(j=m.split(d.delimiter),h=0,i=j.length;h<i;h++)k={},k[f]=j[h],k[g]=j[h],c.options.push(k);c.items=j}},l=function(b,c){var k,l,m,n,o=c.options,p={},q=function(a){var b=e&&a.attr(e);return"string"==typeof b&&b.length?JSON.parse(b):null},r=function(b,e){b=a(b);var i=z(b.val());if(i||d.allowEmptyOption)if(p.hasOwnProperty(i)){if(e){var j=p[i][h];j?a.isArray(j)?j.push(e):p[i][h]=[j,e]:p[i][h]=e}}else{var k=q(b)||{};k[f]=k[f]||b.text(),k[g]=k[g]||i,k[h]=k[h]||e,p[i]=k,o.push(k),b.is(":selected")&&c.items.push(i)}},s=function(b){var d,e,f,g,h;for(b=a(b),f=b.attr("label"),f&&(g=q(b)||{},g[i]=f,g[j]=f,c.optgroups.push(g)),h=a("option",b),d=0,e=h.length;d<e;d++)r(h[d],f)};for(c.maxItems=b.attr("multiple")?null:1,n=b.children(),k=0,l=n.length;k<l;k++)m=n[k].tagName.toLowerCase(),"optgroup"===m?s(n[k]):"option"===m&&r(n[k])};return this.each(function(){if(!this.selectize){var e,f=a(this),g=this.tagName.toLowerCase(),h=f.attr("placeholder")||f.attr("data-placeholder");h||d.allowEmptyOption||(h=f.children('option[value=""]').text());var i={placeholder:h,options:[],optgroups:[],items:[]};"select"===g?l(f,i):k(f,i),e=new M(f,a.extend(!0,{},c,i,b))}})},a.fn.selectize.defaults=M.defaults,a.fn.selectize.support={validity:x},M.define("drag_drop",function(b){if(!a.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===this.settings.mode){var c=this;c.lock=function(){var a=c.lock;return function(){var b=c.$control.data("sortable");return b&&b.disable(),a.apply(c,arguments)}}(),c.unlock=function(){var a=c.unlock;return function(){var b=c.$control.data("sortable");return b&&b.enable(),a.apply(c,arguments)}}(),c.setup=function(){var b=c.setup;return function(){b.apply(this,arguments);var d=c.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:c.isLocked,start:function(a,b){b.placeholder.css("width",b.helper.css("width")),d.css({overflow:"visible"})},stop:function(){d.css({overflow:"hidden"});var b=c.$activeItems?c.$activeItems.slice():null,e=[];d.children("[data-value]").each(function(){e.push(a(this).attr("data-value"))}),c.setValue(e),c.setActiveItem(b)}})}}()}}),M.define("dropdown_header",function(b){var c=this;b=a.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(a){return'<div class="'+a.headerClass+'"><div class="'+a.titleRowClass+'"><span class="'+a.labelClass+'">'+a.title+'</span><a href="javascript:void(0)" class="'+a.closeClass+'">&times;</a></div></div>'}},b),c.setup=function(){var d=c.setup;return function(){d.apply(c,arguments),c.$dropdown_header=a(b.html(b)),c.$dropdown.prepend(c.$dropdown_header)}}()}),M.define("optgroup_columns",function(b){var c=this;b=a.extend({equalizeWidth:!0,equalizeHeight:!0},b),this.getAdjacentOption=function(b,c){var d=b.closest("[data-group]").find("[data-selectable]"),e=d.index(b)+c;return e>=0&&e<d.length?d.eq(e):a()},this.onKeyDown=function(){var a=c.onKeyDown;return function(b){var d,e,f,g;return!this.isOpen||b.keyCode!==j&&b.keyCode!==m?a.apply(this,arguments):(c.ignoreHover=!0,g=this.$activeOption.closest("[data-group]"),d=g.find("[data-selectable]").index(this.$activeOption),g=b.keyCode===j?g.prev("[data-group]"):g.next("[data-group]"),f=g.find("[data-selectable]"),e=f.eq(Math.min(f.length-1,d)),void(e.length&&this.setActiveOption(e)))}}();var d=function(){var a,b=d.width,c=document;return"undefined"==typeof b&&(a=c.createElement("div"),a.innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',a=a.firstChild,c.body.appendChild(a),b=d.width=a.offsetWidth-a.clientWidth,c.body.removeChild(a)),b},e=function(){var e,f,g,h,i,j,k;if(k=a("[data-group]",c.$dropdown_content),f=k.length,f&&c.$dropdown_content.width()){if(b.equalizeHeight){for(g=0,e=0;e<f;e++)g=Math.max(g,k.eq(e).height());k.css({height:g})}b.equalizeWidth&&(j=c.$dropdown_content.innerWidth()-d(),h=Math.round(j/f),k.css({width:h}),f>1&&(i=j-h*(f-1),k.eq(f-1).css({width:i})))}};(b.equalizeHeight||b.equalizeWidth)&&(B.after(this,"positionDropdown",e),B.after(this,"refreshOptions",e))}),M.define("remove_button",function(b){b=a.extend({label:"&times;",title:"Remove",className:"remove",append:!0},b);var c=function(b,c){c.className="remove-single";var d=b,e='<a href="javascript:void(0)" class="'+c.className+'" tabindex="-1" title="'+A(c.title)+'">'+c.label+"</a>",f=function(a,b){return a+b};b.setup=function(){var g=d.setup;return function(){if(c.append){var h=a(d.$input.context).attr("id"),i=(a("#"+h),d.settings.render.item);d.settings.render.item=function(a){return f(i.apply(b,arguments),e)}}g.apply(b,arguments),b.$control.on("click","."+c.className,function(a){a.preventDefault(),d.isLocked||d.clear()})}}()},d=function(b,c){var d=b,e='<a href="javascript:void(0)" class="'+c.className+'" tabindex="-1" title="'+A(c.title)+'">'+c.label+"</a>",f=function(a,b){var c=a.search(/(<\/[^>]+>\s*)$/);return a.substring(0,c)+b+a.substring(c)};b.setup=function(){var g=d.setup;return function(){if(c.append){var h=d.settings.render.item;d.settings.render.item=function(a){return f(h.apply(b,arguments),e)}}g.apply(b,arguments),b.$control.on("click","."+c.className,function(b){if(b.preventDefault(),!d.isLocked){var c=a(b.currentTarget).parent();d.setActiveItem(c),d.deleteSelection()&&d.setCaret(d.items.length)}})}}()};return"single"===this.settings.mode?void c(this,b):void d(this,b)}),M.define("restore_on_backspace",function(a){var b=this;a.text=a.text||function(a){return a[this.settings.labelField]},this.onKeyDown=function(){var c=b.onKeyDown;return function(b){var d,e;return b.keyCode===p&&""===this.$control_input.val()&&!this.$activeItems.length&&(d=this.caretPos-1,d>=0&&d<this.items.length)?(e=this.options[this.items[d]],this.deleteSelection(b)&&(this.setTextboxValue(a.text.apply(this,[e])),this.refreshOptions(!0)),void b.preventDefault()):c.apply(this,arguments)}}()}),M});
includes/wg-settings-page.php DELETED
@@ -1,419 +0,0 @@
1
- <?php
2
-
3
- use Weglot\Helpers\WeglotUtils;
4
- use Weglot\Helpers\WeglotLang;
5
- use Weglot\WeglotContext;
6
-
7
- $showRTL = false;
8
- $showLTR = false;
9
-
10
- if (WeglotUtils::isLanguageRTL(WeglotContext::getOriginalLanguage())) { // Right lo left language
11
- if (WeglotUtils::hasLanguageLTR(explode(',', WeglotContext::getDestinationLanguage()))) {
12
- $showLTR = true;
13
- }
14
- } else { // Left to right language
15
- if (WeglotUtils::hasLanguageRTL(explode(',', WeglotContext::getDestinationLanguage()))) {
16
- $showRTL = true;
17
- }
18
- } ?>
19
- <div class="wrap">
20
- <?php if ($this->allowed == 0) {
21
- ?>
22
- <div class="wg-status-box">
23
- <h3><?php echo sprintf(esc_html__('Weglot Translate service is not active because you have reached the end of the trial period.', 'weglot'), esc_html__($this->userInfo['limit'])); ?></h3>
24
- <p><?php echo sprintf(esc_html__('To reactivate the service, please %1$supgrade your plan%2$s.', 'weglot'), '<a target="_blank" href="https://weglot.com/change-plan">', '</a>'); ?></p>
25
- </div>
26
- <?php
27
- } ?>
28
-
29
- <?php if (esc_attr(get_option('show_box')) == 'on') {
30
- ?>
31
- <div class="wgbox-blur">
32
- <div class="wgbox">
33
- <div class="wgclose-btn"><?php esc_html_e('Close', 'weglot'); ?></div>
34
- <h3 class="wgbox-title"><?php esc_html_e('Well done! Your website is now multilingual.', 'weglot'); ?></h3>
35
- <p class="wgbox-text"><?php esc_html_e('Go on your website, there is a language switcher. Try it :)', 'weglot'); ?></p>
36
- <a class="wgbox-button button button-primary" href="
37
- <?php
38
- echo esc_html__($this->home_dir); ?>
39
- /" target="_blank">
40
- <?php
41
- esc_html_e('Go on my front page.', 'weglot'); ?>
42
- </a>
43
- <p class="wgbox-subtext"><?php esc_html_e('Next step, edit your translations directly in your Weglot account.', 'weglot'); ?></p>
44
- </div>
45
- </div>
46
- <?php
47
- list($wgfirstlang) = explode(',', get_option('destination_l'));
48
- if (strlen($wgfirstlang) == 2) {
49
- ?>
50
- <iframe style="visibility:hidden;" src="<?php
51
- echo esc_html__($this->home_dir).'/'.esc_html__($wgfirstlang); ?>/" width=1
52
- height=1
53
- ></iframe>
54
- <?php
55
- } ?>
56
- <?php update_option('show_box', 'off');
57
- } ?>
58
- <form class="wg-widget-option-form" method="post" action="options.php">
59
- <?php settings_fields('my-plugin-settings-group'); ?>
60
- <?php do_settings_sections('my-plugin-settings-group'); ?>
61
- <h3 style="border-bottom:1px solid #c0c0c0;padding-bottom:10px;max-width:800px;margin-top:40px;"><?php esc_html_e('Main configuration', 'weglot'); ?></h3>
62
- <table class="form-table">
63
- <tr valign="top">
64
- <th scope="row"><?php esc_html_e('API Key', 'weglot'); ?><p
65
- style="font-weight:normal;margin-top:2px;"><?php echo sprintf(esc_html__('Log in to %1$sWeglot%2$s to get your API key.', 'weglot'), '<a target="_blank" href="https://weglot.com/register-wordpress">', '</a>'); ?></p>
66
- </th>
67
- <td><input type="text" class="wg-input-text" name="project_key"
68
- value="<?php echo esc_attr(get_option('project_key')); ?>"
69
- placeholder="wg_XXXXXXXX" required/></td>
70
- </tr>
71
- <tr valign="top">
72
- <th scope="row"><?php esc_html_e('Original Language', 'weglot'); ?><p
73
- style="font-weight:normal;margin-top:2px;"><?php esc_html_e('What is the original (current) language of your website?', 'weglot'); ?></p>
74
- </th>
75
- <td>
76
- <select class="wg-input-select" name="original_l" style="width :200px;">
77
- <?php
78
- $optionL = get_option('original_l', 'en');
79
- foreach (WeglotLang::getCodeLangs() as $code): ?>
80
- <option <?php selected($optionL, $code); ?> value="<?php echo $code ?>"><?php echo esc_html(WeglotLang::getStrLangByCode($code)); ?></option>
81
- <?php endforeach; ?>
82
- </select>
83
- </td>
84
- </tr>
85
- <tr valign="top">
86
- <th scope="row"><?php esc_html_e('Destination Languages', 'weglot'); ?>
87
- <p style="font-weight:normal;margin-top:2px;"><?php echo sprintf(esc_html__('Choose languages you want to translate into. Supported languages can be found %1$shere%2$s.', 'weglot'), '<a target="_blank" href="https://weglot.com/translation-api#languages_code">', '</a>'); ?></p>
88
- </th>
89
- <td>
90
- <div style="display:inline-block;width:300px; margin-top: 35px;">
91
- <select id="select-lto" multiple class="demo-default"
92
- style=""
93
- placeholder="French, German, Italian, Portuguese, …"
94
- name="destination_l">
95
- <?php foreach (WeglotLang::getCodeLangs() as $code): ?>
96
- <option <?php if (strpos(esc_attr(get_option('destination_l')), $code) !== false) {
97
- echo 'selected';
98
- } ?> value="<?php echo $code ?>"><?php echo esc_html(WeglotLang::getStrLangByCode($code)); ?></option>
99
- <?php endforeach; ?>
100
- </select>
101
- </div>
102
- <input id="destination_input_hidden" type="text"
103
- class="wg-input-text" name="destination_l"
104
- value="<?php echo esc_attr(get_option('destination_l')); ?>"
105
- placeholder="en,es" required style="display:none;"/>
106
- <?php
107
- if ($this->userInfo['plan'] <= 0) {
108
- ?>
109
- <p class="wg-fsubtext"><?php echo sprintf(esc_html__('On the free plan, you can only choose one language and a maximum of 2000 words. If you want to use more than 1 language and 2000 words, please %1$supgrade your plan%2$s.', 'weglot'), '<a target="_blank" href="https://weglot.com/change-plan">', '</a>'); ?></p><?php
110
- } ?> <?php if ($this->userInfo['plan'] >= 18 && $this->userInfo['plan'] <= 19) {
111
- ?>
112
- <p class="wg-fsubtext"><?php echo sprintf(esc_html__('On the Starter plan, you can only choose one language. If you want to use more than 1 language, please %1$supgrade your plan%2$s.', 'weglot'), '<a target="_blank" href="https://weglot.com/change-plan">', '</a>'); ?></p><?php
113
- } ?>
114
- </td>
115
- </tr>
116
- </table>
117
- <h3 style="border-bottom:1px solid #c0c0c0;padding-bottom:10px;max-width:800px;margin-top:40px;"><?php echo esc_html__('Language button appearance', 'weglot') . ' ' . esc_html__('(Optional)', 'weglot'); ?></h3>
118
- <p class="preview-text"><?php esc_html_e('Preview:', 'weglot'); ?></p>
119
- <div class="wg-widget-preview"></div>
120
- <table class="form-table">
121
- <tr valign="top">
122
- <th scope="row"><?php esc_html_e('Dropdown?', 'weglot'); ?></th>
123
- <td><input id="id_is_dropdown" type="checkbox" name="is_dropdown"
124
- <?php
125
- if (esc_attr(get_option('is_dropdown')) == 'on') {
126
- echo 'checked';
127
- } ?>
128
- /><label for="id_is_dropdown"
129
- style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e('Check if you want the button to be a dropdown box.', 'weglot'); ?></label>
130
- </td>
131
- </tr>
132
- <tr valign="top">
133
- <th scope="row"><?php esc_html_e('With flags?', 'weglot'); ?></th>
134
- <td><input id="id_with_flags" type="checkbox" name="with_flags"
135
- <?php
136
- if (esc_attr(get_option('with_flags')) == 'on') {
137
- echo 'checked';
138
- } ?>
139
- /><label for="id_with_flags"
140
- style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e('Check if you want flags in the language button.', 'weglot'); ?></label>
141
- </td>
142
- </tr>
143
- <tr valign="top">
144
- <th scope="row"><?php esc_html_e('Type of flags', 'weglot'); ?></th>
145
- <td>
146
- <select class="wg-input-select" name="type_flags"
147
- style="width :200px;">
148
- <option <?php if (esc_attr(get_option('type_flags')) == '0') {
149
- echo 'selected';
150
- } ?> value="0"><?php esc_html_e('Rectangle mat', 'weglot'); ?></option>
151
- <option <?php if (esc_attr(get_option('type_flags')) == '1') {
152
- echo 'selected';
153
- } ?> value="1"><?php esc_html_e('Rectangle shiny', 'weglot'); ?></option>
154
- <option <?php if (esc_attr(get_option('type_flags')) == '2') {
155
- echo 'selected';
156
- } ?> value="2"><?php esc_html_e('Square', 'weglot'); ?></option>
157
- <option <?php if (esc_attr(get_option('type_flags')) == '3') {
158
- echo 'selected';
159
- } ?> value="3"><?php esc_html_e('Circle', 'weglot'); ?></option>
160
- </select>
161
- <div class="flag-style-openclose"><?php esc_html_e('Change country flags', 'weglot'); ?></div>
162
- <div class="flag-style-wrapper" style="display:none;">
163
- <select class="flag-en-type wg-input-select">
164
- <option value=0><?php esc_html_e('Choose English flag:', 'weglot'); ?></option>
165
- <option value=0><?php esc_html_e('United Kingdom (default)', 'weglot'); ?></option>
166
- <option value=1><?php esc_html_e('United States', 'weglot'); ?></option>
167
- <option value=2><?php esc_html_e('Australia', 'weglot'); ?></option>
168
- <option value=3><?php esc_html_e('Canada', 'weglot'); ?></option>
169
- <option value=4><?php esc_html_e('New Zealand', 'weglot'); ?></option>
170
- <option value=5><?php esc_html_e('Jamaica', 'weglot'); ?></option>
171
- <option value=6><?php esc_html_e('Ireland', 'weglot'); ?></option>
172
- </select>
173
- <select class="flag-es-type wg-input-select">
174
- <option value=0><?php esc_html_e('Choose Spanish flag:', 'weglot'); ?></option>
175
- <option value=0><?php esc_html_e('Spain (default)', 'weglot'); ?></option>
176
- <option value=1><?php esc_html_e('Mexico', 'weglot'); ?></option>
177
- <option value=2><?php esc_html_e('Argentina', 'weglot'); ?></option>
178
- <option value=3><?php esc_html_e('Colombia', 'weglot'); ?></option>
179
- <option value=4><?php esc_html_e('Peru', 'weglot'); ?></option>
180
- <option value=5><?php esc_html_e('Bolivia', 'weglot'); ?></option>
181
- <option value=6><?php esc_html_e('Uruguay', 'weglot'); ?></option>
182
- <option value=7><?php esc_html_e('Venezuela', 'weglot'); ?></option>
183
- <option value=8><?php esc_html_e('Chile', 'weglot'); ?></option>
184
- <option value=9><?php esc_html_e('Ecuador', 'weglot'); ?></option>
185
- <option value=10><?php esc_html_e('Guatemala', 'weglot'); ?></option>
186
- <option value=11><?php esc_html_e('Cuba', 'weglot'); ?></option>
187
- <option value=12><?php esc_html_e('Dominican Republic', 'weglot'); ?></option>
188
- <option value=13><?php esc_html_e('Honduras', 'weglot'); ?></option>
189
- <option value=14><?php esc_html_e('Paraguay', 'weglot'); ?></option>
190
- <option value=15><?php esc_html_e('El Salvador', 'weglot'); ?></option>
191
- <option value=16><?php esc_html_e('Nicaragua', 'weglot'); ?></option>
192
- <option value=17><?php esc_html_e('Costa Rica', 'weglot'); ?></option>
193
- <option value=18><?php esc_html_e('Puerto Rico', 'weglot'); ?></option>
194
- <option value=19><?php esc_html_e('Panama', 'weglot'); ?></option>
195
- </select>
196
- <select class="flag-pt-type wg-input-select">
197
- <option value=0><?php esc_html_e('Choose Portuguese flag:', 'weglot'); ?></option>
198
- <option value=0><?php esc_html_e('Brazil (default)', 'weglot'); ?></option>
199
- <option value=1><?php esc_html_e('Portugal', 'weglot'); ?></option>
200
- </select>
201
- <select class="flag-fr-type wg-input-select">
202
- <option value=0><?php esc_html_e('Choose French flag:', 'weglot'); ?></option>
203
- <option value=0><?php esc_html_e('France (default)', 'weglot'); ?></option>
204
- <option value=1><?php esc_html_e('Belgium', 'weglot'); ?></option>
205
- <option value=2><?php esc_html_e('Canada', 'weglot'); ?></option>
206
- <option value=3><?php esc_html_e('Switzerland', 'weglot'); ?></option>
207
- <option value=4><?php esc_html_e('Luxemburg', 'weglot'); ?></option>
208
- </select>
209
- <select class="flag-ar-type wg-input-select">
210
- <option value=0><?php esc_html_e('Choose Arabic flag:', 'weglot'); ?></option>
211
- <option value=0><?php esc_html_e('Saudi Arabia (default)', 'weglot'); ?></option>
212
- <option value=1><?php esc_html_e('Algeria', 'weglot'); ?></option>
213
- <option value=2><?php esc_html_e('Egypt', 'weglot'); ?></option>
214
- <option value=3><?php esc_html_e('Iraq', 'weglot'); ?></option>
215
- <option value=4><?php esc_html_e('Jordan', 'weglot'); ?></option>
216
- <option value=5><?php esc_html_e('Kuwait', 'weglot'); ?></option>
217
- <option value=6><?php esc_html_e('Lebanon', 'weglot'); ?></option>
218
- <option value=7><?php esc_html_e('Libya', 'weglot'); ?></option>
219
- <option value=8><?php esc_html_e('Morocco', 'weglot'); ?></option>
220
- <option value=14><?php esc_html_e('Oman', 'weglot'); ?></option>
221
- <option value=9><?php esc_html_e('Qatar', 'weglot'); ?></option>
222
- <option value=10><?php esc_html_e('Syria', 'weglot'); ?></option>
223
- <option value=11><?php esc_html_e('Tunisia', 'weglot'); ?></option>
224
- <option value=12><?php esc_html_e('United Arab Emirates', 'weglot'); ?></option>
225
- <option value=13><?php esc_html_e('Yemen', 'weglot'); ?></option>
226
- </select>
227
- <p><?php esc_html_e('If you want to use a different flag, just ask us.', 'weglot'); ?></p>
228
- </div>
229
- </td>
230
- </tr>
231
- <tr valign="top">
232
- <th scope="row"><?php esc_html_e('With name?', 'weglot'); ?></th>
233
- <td><input id="id_with_name" type="checkbox" name="with_name"
234
- <?php
235
- if (esc_attr(get_option('with_name')) == 'on') {
236
- echo 'checked';
237
- } ?>
238
- /><label for="id_with_name"
239
- style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e('Check if you want to display the name of languages.', 'weglot'); ?></label>
240
- </td>
241
- </tr>
242
- <tr valign="top">
243
- <th scope="row"><?php esc_html_e('Full name?', 'weglot'); ?></th>
244
- <td><input id="id_is_fullname" type="checkbox" name="is_fullname"
245
- <?php
246
- if (esc_attr(get_option('is_fullname')) == 'on') {
247
- echo 'checked';
248
- } ?>
249
- /><label for="id_is_fullname"
250
- style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e('Check if you want the name of the languge. Don\'t check if you want the language code.', 'weglot'); ?></label>
251
- </td>
252
- </tr>
253
- <tr valign="top">
254
- <th scope="row"><?php esc_html_e('Override CSS', 'weglot'); ?><p
255
- style="font-weight:normal;margin-top:2px;"><?php esc_html_e('Don\'t change it unless you want a specific style for your button.', 'weglot'); ?></p>
256
- </th>
257
- <td><textarea class="wg-input-textarea" type="text" rows=10 cols=30
258
- name="override_css" placeholder=".country-selector {
259
- margin-bottom: 20px;
260
- background-color: green!important;
261
- }
262
- .country-selector a {
263
- color: blue!important;
264
- }"><?php echo esc_attr(get_option('override_css')); ?></textarea><textarea
265
- class="wg-input-textarea" type="text" name="flag_css"
266
- style="display:none;"><?php echo esc_attr(get_option('flag_css')); ?></textarea>
267
- </td>
268
- </tr>
269
- </table>
270
- <h3 style="border-bottom:1px solid #c0c0c0;padding-bottom:10px;max-width:800px;margin-top:40px;"><?php echo esc_html__('Language button position', 'weglot') . ' ' . esc_html__('(Optional)', 'weglot'); ?></h3>
271
- <h4 style="font-size:14px;line-height: 1.3;font-weight: 600;"><?php esc_html_e('Where will the language button be on my website? By default, bottom right.', 'weglot'); ?></h4>
272
- <table class="form-table">
273
- <tr valign="top">
274
- <th scope="row"><?php esc_html_e('In menu?', 'weglot'); ?></th>
275
- <td><input id="id_is_menu" type="checkbox" name="is_menu"
276
- <?php
277
- if (esc_attr(get_option('is_menu')) == 'on') {
278
- echo 'checked';
279
- } ?>
280
- /><label for="id_is_menu"
281
- style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e('Check if you want to display the button in the navigation menu.', 'weglot'); ?></label>
282
- </td>
283
- </tr>
284
- <tr valign="top">
285
- <th scope="row"><?php esc_html_e('As a widget?', 'weglot'); ?></th>
286
- <td>
287
- <p style="font-weight: normal;font-style: italic;display: inline-block;"><?php esc_html_e('You can place the button in a widget area. Go to Appearance -> Widgets and drag and drop the Weglot Translate widget where you want.', 'weglot'); ?></p>
288
- </td>
289
- </tr>
290
- <tr valign="top">
291
- <th scope="row"><?php esc_html_e('With a shortcode?', 'weglot'); ?></th>
292
- <td>
293
- <p style="font-weight: normal;font-style: italic;display: inline-block;"><?php esc_html_e('You can use the Weglot shortcode [weglot_switcher] wherever you want to place the button.', 'weglot'); ?></p>
294
- </td>
295
- </tr>
296
- <tr valign="top">
297
- <th scope="row"><?php esc_html_e('In the source code?', 'weglot'); ?></th>
298
- <td>
299
- <p style="font-weight: normal;font-style: italic;display: inline-block;"><?php esc_html_e('You can add the code &lt;div id=&quot;weglot_here&quot;&gt;&lt;/div&gt; wherever you want in the source code of your HTML page. The button will appear at this place.', 'weglot'); ?></p>
300
- </td>
301
- </tr>
302
- </table>
303
- <h3 style="border-bottom:1px solid #c0c0c0;padding-bottom:10px;max-width:800px;margin-top:40px;">
304
- <?php
305
- echo esc_html__('Translation Exclusion', 'weglot') . ' ' . esc_html__('(Optional)', 'weglot');
306
- ?>
307
- </h3>
308
- <p><?php esc_html_e('By default, every page is translated. You can exclude parts of a page or a full page here.', 'weglot'); ?></p>
309
- <table class="form-table">
310
- <tr valign="top">
311
- <th scope="row"><?php esc_html_e('Exclude URL here', 'weglot'); ?><p
312
- style="font-weight:normal;margin-top:2px;"><?php esc_html_e('You can write regex.', 'weglot'); ?>
313
- <p></th>
314
- <td><textarea class="wg-input-textarea" type="text" rows=3 cols=30
315
- name="exclude_url"
316
- placeholder=""><?php echo esc_attr(get_option('exclude_url')); ?></textarea>
317
- </td>
318
- </tr>
319
- <tr valign="top">
320
- <th scope="row"><?php esc_html_e('Exclude blocks', 'weglot'); ?><p
321
- style="font-weight:normal;margin-top:2px;"><?php esc_html_e('Enter CSS selectors, separated by commas.', 'weglot'); ?>
322
- <p></th>
323
- <td><textarea class="wg-input-textarea" type="text" rows=3 cols=30
324
- name="exclude_blocks"
325
- placeholder="#top-menu,footer a,.title-3"><?php echo esc_attr(get_option('exclude_blocks')); ?></textarea>
326
- </td>
327
- </tr>
328
- </table>
329
- <?php
330
- $classHideOption = "hidden-option";
331
- if ($this->userInfo['plan'] > 0) {
332
- $classHideOption = "";
333
- }
334
- ?>
335
- <h3 class="<?php echo $classHideOption; ?>" style="border-bottom:1px solid #c0c0c0;padding-bottom:10px;max-width:800px;margin-top:40px;">
336
- <?php
337
- echo esc_html__('Other options', 'weglot') . ' ' . esc_html__('(Optional)', 'weglot'); ?>
338
- </h3>
339
- <table class="form-table <?php echo $classHideOption; ?>">
340
- <tr valign="top" class="hidden-option">
341
- <th scope="row"><?php esc_html_e('Exclude AMP pages ?', 'weglot'); ?></th>
342
- <td><input id="id_exclude_amp" type="checkbox"
343
- name="wg_exclude_amp"
344
- <?php
345
- if (esc_attr(get_option('wg_exclude_amp', 'on')) == 'on') {
346
- echo 'checked';
347
- } ?>
348
- /><label for="id_exclude_amp"
349
- style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e('Exclude translation for Accelerated Mobile Pages. Default : On', 'weglot'); ?></label>
350
- </td>
351
- </tr>
352
-
353
- <?php if ($this->userInfo['plan'] > 0) {
354
- ?>
355
-
356
-
357
- <tr valign="top">
358
- <th scope="row"><?php esc_html_e('Auto redirect?', 'weglot'); ?></th>
359
- <td><input id="id_auto_switch" type="checkbox"
360
- name="wg_auto_switch"
361
- <?php
362
- if (esc_attr(get_option('wg_auto_switch')) == 'on') {
363
- echo 'checked';
364
- } ?>
365
- /><label for="id_auto_switch"
366
- style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e('Check if you want to redirect users based on their browser language.', 'weglot'); ?></label>
367
- </td>
368
- </tr>
369
-
370
- <?php
371
- } ?>
372
- </table>
373
- <?php
374
- if ($showLTR || $showRTL) {
375
- $ltrOrRtl = $showLTR ? esc_html__('Left to Right languages', 'weglot') : esc_html__('Right to Left languages', 'weglot'); ?>
376
- <h3 style="border-bottom:1px solid #c0c0c0;padding-bottom:10px;max-width:800px;margin-top:40px;">
377
- <?php
378
- echo esc_html__('Customize style for ', 'weglot') . esc_html__($ltrOrRtl) . ' ' . esc_html__('(Optional)', 'weglot'); ?>
379
- </h3>
380
- <table class="form-table">
381
- <tr valign="top">
382
- <th scope="row"><?php echo sprintf(esc_html__('Write CSS rules to apply on %s page.', 'weglot'), esc_html__($ltrOrRtl)); ?>
383
- <p style="font-weight:normal;margin-top:2px;">
384
- <p></th>
385
- <td><textarea class="wg-input-textarea" type="text" rows=5
386
- cols=30 name="rtl_ltr_style" placeholder="body {
387
- text-align: right;
388
- }"><?php echo esc_attr(get_option('rtl_ltr_style')); ?></textarea></td>
389
- </tr>
390
- </table>
391
- <?php
392
- } ?>
393
- <?php submit_button(); ?>
394
- </form>
395
- <?php
396
- if (esc_attr(get_option('show_box')) == 'off') {
397
- ?>
398
- <div class="wginfobox">
399
- <h3><?php esc_html_e('Where are my translations?', 'weglot'); ?></h3>
400
- <div>
401
- <p><?php esc_html_e('You can find all your translations in your Weglot account:', 'weglot'); ?></p>
402
- <a href="<?php esc_html_e('https://weglot.com/dashboard', 'weglot'); ?>"
403
- target="_blank"
404
- class="wg-editbtn"><?php esc_html_e('Edit my translations', 'weglot'); ?></a>
405
- </div>
406
- </div><?php
407
- } ?>
408
- <br>
409
- <a target="_blank"
410
- href="http://wordpress.org/support/view/plugin-reviews/weglot?rate=5#postform">
411
- <?php esc_html_e('Love Weglot? Give us 5 stars on WordPress.org :)', 'weglot'); ?>
412
- </a>
413
- <br><br>
414
- <i class="fa fa-question-circle" aria-hidden="true"
415
- style="font-size : 17px;"></i>
416
- <p style="display:inline-block; margin-left:5px;"><?php echo sprintf(esc_html__('If you need any help, you can contact us via our live chat at %1$sweglot.com%2$s or email us at support@weglot.com.', 'weglot'), '<a href="https://weglot.com/" target="_blank">', '</a>') . '<br>' . sprintf(esc_html__('You can also check our %1$sFAQ%2$s', 'weglot'), '<a href="http://support.weglot.com/" target="_blank">', '</a>'); ?></p>
417
- <br><br><br>
418
-
419
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/wg-status-page.php DELETED
@@ -1,171 +0,0 @@
1
-
2
- <?php
3
- use Weglot\WeglotContext;
4
-
5
- $apacheModRewrite = ' <mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
6
- if (!function_exists('apache_get_modules')) {
7
- $apacheModRewrite = 'Unknown';
8
- } elseif (!in_array('mod_rewrite', apache_get_modules())) {
9
- $apacheModRewrite = '<mark class="error"><span class="dashicons dashicons-warning"></span></mark>';
10
- }
11
-
12
- $phpMin56 = true;
13
- if (version_compare(phpversion(), "5.6", "<")) {
14
- $phpMin56 = false;
15
- }
16
-
17
- ?>
18
-
19
- <script>
20
- jQuery(document).ready(function(){
21
- jQuery("#system-report").on("click", function(e){
22
- e.preventDefault();
23
-
24
- jQuery("#view-system-report").slideToggle();
25
- })
26
- })
27
- </script>
28
-
29
- <div class="wrap">
30
- <button class="button" id="system-report">
31
- <?php _e("Get system report", "weglot"); ?>
32
- </button>
33
- <div id="view-system-report" style="display:none";>
34
- <textarea readonly="readonly" style="width:100%; min-height:300px;">
35
- ## WordPress environment
36
-
37
- Home URL: <?php echo home_url() . "\n"; ?>
38
- Site URL: <?php echo site_url() . "\n"; ?>
39
- Weglot version: <?php echo WEGLOT_VERSION . "\n" ?>
40
- WP version: <?php echo get_bloginfo('version') . "\n"; ?>
41
- WP multisite: <?php echo is_multisite() ? "Yes\n" :"-\n" ?>
42
- WP debug mode: <?php echo (defined(WP_DEBUG)) ? "Yes\n" : "-\n"; ?>
43
- Permalink structure: <?php echo get_option('permalink_structure') . "\n"; ?>
44
- Language: <?php echo get_locale() . "\n"; ?>
45
-
46
- ## Server environment
47
-
48
- Server info: <?php echo (isset($_SERVER['SERVER_SOFTWARE'])) ? $_SERVER['SERVER_SOFTWARE'] . "\n" : "Unknown\n" ?>
49
- PHP version: <?php echo phpversion() . "\n"; ?>
50
- Module mod_rewrite: <?php echo $apacheModRewrite . "\n"; ?>
51
-
52
- ## Weglot environment
53
-
54
- Original Language: <?php echo WeglotContext::getOriginalLanguage() . "\n"; ?>
55
- Destination Language: <?php echo WeglotContext::getDestinationLanguage() . "\n"; ?>
56
- Exclude URLs: <?php echo get_option('exclude_url') . "\n"; ?>
57
- Exclude blocks: <?php echo get_option('exclude_blocks') . "\n"; ?>
58
- </textarea>
59
- </div>
60
- <br />
61
- <br />
62
- <table class="widefat" cellspacing="0" id="status">
63
- <thead>
64
- <tr>
65
- <th colspan="3" data-export-label="WordPress Environment"><h2>WordPress environment</h2></th>
66
- </tr>
67
- </thead>
68
- <tbody>
69
- <tr>
70
- <td>Home URL:</td>
71
- <td><?php echo home_url(); ?></td>
72
- </tr>
73
- <tr>
74
- <td>Site URL:</td>
75
- <td><?php echo site_url(); ?></td>
76
- </tr>
77
- <tr>
78
- <td>Weglot version:</td>
79
- <td><?php echo WEGLOT_VERSION ?></td>
80
- </tr>
81
- <tr>
82
- <td>WP version:</td>
83
- <td><?php echo get_bloginfo('version'); ?></td>
84
- </tr>
85
- <tr>
86
- <td>WP multisite:</td>
87
- <td>
88
- <?php echo is_multisite() ? "Yes" :"-" ?>
89
-
90
- </td>
91
- </tr>
92
- <tr>
93
- <td>WP debug mode:</td>
94
- <td>
95
- <?php if (defined(WP_DEBUG) && WP_DEBUG) {
96
- ?>
97
- <mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
98
- <?php
99
- } ?>
100
- </td>
101
- </tr>
102
- <tr>
103
- <td>Permalink structure:</td>
104
- <td><?php echo get_option('permalink_structure'); ?></td>
105
- </tr>
106
- <tr>
107
- <td>Language:</td>
108
- <td><?php echo get_locale(); ?></td>
109
- </tr>
110
- </tbody>
111
- </table>
112
- <br />
113
- <table class="widefat" cellspacing="0">
114
- <thead>
115
- <tr>
116
- <th colspan="3" data-export-label="Server Environment"><h2>Server environment</h2></th>
117
- </tr>
118
- </thead>
119
- <tbody>
120
- <tr>
121
- <td>Server info:</td>
122
- <td><?php echo (isset($_SERVER['SERVER_SOFTWARE'])) ? $_SERVER['SERVER_SOFTWARE'] : "Unknown" ?></td>
123
- </tr>
124
- <tr>
125
- <td>PHP version:</td>
126
- <td>
127
- <?php echo phpversion(); ?>
128
- <?php if (!$phpMin56) {
129
- ?>
130
- <mark class="error">
131
- <span class="dashicons dashicons-warning"></span> - <?php echo __("We recommend a minimum PHP version of 5.6.", "weglot") ?>
132
- </mark>
133
- <?php
134
- } ?>
135
- </td>
136
- </tr>
137
- <tr>
138
- <td>Module mod_rewrite:</td>
139
- <td>
140
- <?php echo $apacheModRewrite; ?>
141
- </td>
142
- </tr>
143
- </tbody>
144
- </table>
145
- <br />
146
- <table class="widefat" cellspacing="0">
147
- <thead>
148
- <tr>
149
- <th colspan="3" data-export-label="Server Environment"><h2>Weglot environment</h2></th>
150
- </tr>
151
- </thead>
152
- <tbody>
153
- <tr>
154
- <td>Original Language:</td>
155
- <td><?php echo WeglotContext::getOriginalLanguage(); ?></td>
156
- </tr>
157
- <tr>
158
- <td>Destination Language:</td>
159
- <td><?php echo WeglotContext::getDestinationLanguage(); ?></td>
160
- </tr>
161
- <tr>
162
- <td>Exclude URLs:</td>
163
- <td><?php echo get_option('exclude_url'); ?></td>
164
- </tr>
165
- <tr>
166
- <td>Exclude blocks:</td>
167
- <td><?php echo get_option('exclude_blocks'); ?></td>
168
- </tr>
169
- </tbody>
170
- </table>
171
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/weglot-de_DE.po CHANGED
@@ -679,7 +679,7 @@ msgid "You can find all your translations in your Weglot account:"
679
  msgstr ""
680
 
681
  #: includes/wg-settings-page.php:264
682
- msgid "https://weglot.com/dashboard"
683
  msgstr ""
684
 
685
  #: includes/wg-settings-page.php:264
679
  msgstr ""
680
 
681
  #: includes/wg-settings-page.php:264
682
+ msgid "https://dashboard.weglot.com/translations/"
683
  msgstr ""
684
 
685
  #: includes/wg-settings-page.php:264
languages/weglot-en_GB.po CHANGED
@@ -694,8 +694,8 @@ msgid "You can find all your translations in your Weglot account:"
694
  msgstr "You can find all your translations in your Weglot account:"
695
 
696
  #: includes/wg-settings-page.php:264
697
- msgid "https://weglot.com/dashboard"
698
- msgstr "https://weglot.com/dashboard"
699
 
700
  #: includes/wg-settings-page.php:264
701
  msgid "Edit my translations"
694
  msgstr "You can find all your translations in your Weglot account:"
695
 
696
  #: includes/wg-settings-page.php:264
697
+ msgid "https://dashboard.weglot.com/translations/"
698
+ msgstr "https://dashboard.weglot.com/translations/"
699
 
700
  #: includes/wg-settings-page.php:264
701
  msgid "Edit my translations"
languages/weglot-es_ES.po CHANGED
@@ -677,7 +677,7 @@ msgid "You can find all your translations in your Weglot account:"
677
  msgstr ""
678
 
679
  #: includes/wg-settings-page.php:264
680
- msgid "https://weglot.com/dashboard"
681
  msgstr ""
682
 
683
  #: includes/wg-settings-page.php:264
677
  msgstr ""
678
 
679
  #: includes/wg-settings-page.php:264
680
+ msgid "https://dashboard.weglot.com/translations/"
681
  msgstr ""
682
 
683
  #: includes/wg-settings-page.php:264
languages/weglot-fr_FR.po CHANGED
@@ -684,7 +684,7 @@ msgid "You can find all your translations in your Weglot account:"
684
  msgstr "Vous pouvez trouver toutes vos traductions dans votre compte Weglot :"
685
 
686
  #: includes/wg-settings-page.php:264
687
- msgid "https://weglot.com/dashboard"
688
  msgstr "https://weglot.com/fr/dashboard"
689
 
690
  #: includes/wg-settings-page.php:264
684
  msgstr "Vous pouvez trouver toutes vos traductions dans votre compte Weglot :"
685
 
686
  #: includes/wg-settings-page.php:264
687
+ msgid "https://dashboard.weglot.com/translations/"
688
  msgstr "https://weglot.com/fr/dashboard"
689
 
690
  #: includes/wg-settings-page.php:264
languages/weglot-it_IT.po CHANGED
@@ -678,7 +678,7 @@ msgid "You can find all your translations in your Weglot account:"
678
  msgstr ""
679
 
680
  #: includes/wg-settings-page.php:264
681
- msgid "https://weglot.com/dashboard"
682
  msgstr ""
683
 
684
  #: includes/wg-settings-page.php:264
678
  msgstr ""
679
 
680
  #: includes/wg-settings-page.php:264
681
+ msgid "https://dashboard.weglot.com/translations/"
682
  msgstr ""
683
 
684
  #: includes/wg-settings-page.php:264
languages/weglot-nl_NL.po CHANGED
@@ -685,8 +685,8 @@ msgid "You can find all your translations in your Weglot account:"
685
  msgstr "Je kunt al je vertalingen in je Weglot-account vinden:"
686
 
687
  #: includes/wg-settings-page.php:264
688
- msgid "https://weglot.com/dashboard"
689
- msgstr "https://weglot.com/dashboard"
690
 
691
  #: includes/wg-settings-page.php:264
692
  msgid "Edit my translations"
685
  msgstr "Je kunt al je vertalingen in je Weglot-account vinden:"
686
 
687
  #: includes/wg-settings-page.php:264
688
+ msgid "https://dashboard.weglot.com/translations/"
689
+ msgstr "https://dashboard.weglot.com/translations/"
690
 
691
  #: includes/wg-settings-page.php:264
692
  msgid "Edit my translations"
languages/weglot-pt_BR.po CHANGED
@@ -677,7 +677,7 @@ msgid "You can find all your translations in your Weglot account:"
677
  msgstr ""
678
 
679
  #: includes/wg-settings-page.php:264
680
- msgid "https://weglot.com/dashboard"
681
  msgstr ""
682
 
683
  #: includes/wg-settings-page.php:264
677
  msgstr ""
678
 
679
  #: includes/wg-settings-page.php:264
680
+ msgid "https://dashboard.weglot.com/translations/"
681
  msgstr ""
682
 
683
  #: includes/wg-settings-page.php:264
languages/weglot-ru_RU.po CHANGED
@@ -679,7 +679,7 @@ msgid "You can find all your translations in your Weglot account:"
679
  msgstr ""
680
 
681
  #: includes/wg-settings-page.php:264
682
- msgid "https://weglot.com/dashboard"
683
  msgstr ""
684
 
685
  #: includes/wg-settings-page.php:264
679
  msgstr ""
680
 
681
  #: includes/wg-settings-page.php:264
682
+ msgid "https://dashboard.weglot.com/translations/"
683
  msgstr ""
684
 
685
  #: includes/wg-settings-page.php:264
languages/weglot.pot CHANGED
@@ -671,7 +671,7 @@ msgid "You can find all your translations in your Weglot account:"
671
  msgstr ""
672
 
673
  #: includes/wg-settings-page.php:264
674
- msgid "https://weglot.com/dashboard"
675
  msgstr ""
676
 
677
  #: includes/wg-settings-page.php:264
671
  msgstr ""
672
 
673
  #: includes/wg-settings-page.php:264
674
+ msgid "https://dashboard.weglot.com/translations/"
675
  msgstr ""
676
 
677
  #: includes/wg-settings-page.php:264
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: remyb92
3
  Tags: translate,translation,language,multilingual,bilingual,international,localization,multilanguage,multi language,translations,translator,multilangues,traduction,traducteur,ubersetzung,mehrsprachig,traduccion,traduzione,vertaling,vertaler,meertalig
4
  Requires at least: 4.5
5
  Tested up to: 4.9
6
- Requires PHP: 5.3
7
- Stable tag: 1.13.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -61,8 +61,8 @@ You can help translate Weglot Translate plugin on [__translate.wordpress.org__](
61
  == Installation ==
62
 
63
  = Minimum Requirements for Weglot Translate =
64
- * WordPress 3.0 or greater
65
- * PHP version 5.3 or greater
66
  * Rewrite rules activated
67
 
68
  = Installation steps for Weglot Translate =
@@ -76,7 +76,7 @@ Weglot Translate is easy to set up:
76
  6. Click on the Save button.
77
  7. (Optional) Go to Appearance -&gt; Widgets and drag and drop the "Weglot Translate" widget where you want it to appear.
78
  8. Refresh your web page, your website is now available in the selected translation languages. You can switch languages to see translated pages.
79
- 9. If you want, you can edit your translations directly in [your account](https://weglot.com/dashboard)
80
 
81
 
82
  == Frequently Asked Questions ==
@@ -85,7 +85,7 @@ Weglot Translate is a freemium plugin: it is free for small websites (under 2000
85
 
86
  In any case, you can try Weglot free for 10 days.
87
  = Edit my translations =
88
- With Weglot Translate, you can modify translations in "Translations" in your Weglot [account here](https://weglot.com/dashboard). If you change a translation, it's automatically saved and displayed on your website.
89
  = The translations I edited are not displayed on my website. =
90
 
91
  All translations edited in your dashboard are automatically displayed in real-time in the translated versions of your website. If you can not see your new translations:
@@ -137,7 +137,7 @@ Weglot Translate is easy to set up:
137
  6. Click on the Save button.
138
  7. (Optional) Go to Appearance -> Widgets and drag and drop the "Weglot Translate" widget where you want it to appear.
139
  8. Refresh your web page, your website is now available in the selected translation languages. You can switch languages to see translated pages.
140
- 9. If you want, you can edit your translations directly in [your account](https://weglot.com/dashboard)
141
 
142
  == Screenshots ==
143
 
@@ -152,6 +152,21 @@ See changelog for upgrade changes.
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  = 1.13.1 (01/06/2018) =
156
  * Bugfix: Error on the encoding of ignored nodes
157
 
3
  Tags: translate,translation,language,multilingual,bilingual,international,localization,multilanguage,multi language,translations,translator,multilangues,traduction,traducteur,ubersetzung,mehrsprachig,traduccion,traduzione,vertaling,vertaler,meertalig
4
  Requires at least: 4.5
5
  Tested up to: 4.9
6
+ Requires PHP: 5.4
7
+ Stable tag: 2.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
61
  == Installation ==
62
 
63
  = Minimum Requirements for Weglot Translate =
64
+ * WordPress 4.5 or greater
65
+ * PHP version 5.4 or greater
66
  * Rewrite rules activated
67
 
68
  = Installation steps for Weglot Translate =
76
  6. Click on the Save button.
77
  7. (Optional) Go to Appearance -&gt; Widgets and drag and drop the "Weglot Translate" widget where you want it to appear.
78
  8. Refresh your web page, your website is now available in the selected translation languages. You can switch languages to see translated pages.
79
+ 9. If you want, you can edit your translations directly in [your account](https://dashboard.weglot.com/translations/)
80
 
81
 
82
  == Frequently Asked Questions ==
85
 
86
  In any case, you can try Weglot free for 10 days.
87
  = Edit my translations =
88
+ With Weglot Translate, you can modify translations in "Translations" in your Weglot [account here](https://dashboard.weglot.com/translations/). If you change a translation, it's automatically saved and displayed on your website.
89
  = The translations I edited are not displayed on my website. =
90
 
91
  All translations edited in your dashboard are automatically displayed in real-time in the translated versions of your website. If you can not see your new translations:
137
  6. Click on the Save button.
138
  7. (Optional) Go to Appearance -> Widgets and drag and drop the "Weglot Translate" widget where you want it to appear.
139
  8. Refresh your web page, your website is now available in the selected translation languages. You can switch languages to see translated pages.
140
+ 9. If you want, you can edit your translations directly in [your account](https://dashboard.weglot.com/translations/)
141
 
142
  == Screenshots ==
143
 
152
 
153
  == Changelog ==
154
 
155
+ = 2.0.2 (24/07/2018) =
156
+ * Bugfix : Hide menu on non translatable URL
157
+ * Bugfix : Hide widget on non translatable URL
158
+ * Improve max file size HTML
159
+
160
+ = 2.0.1 (19/07/2018) =
161
+ * Improve flag style
162
+ * Prevent cURL function
163
+ * Solved nav_class warning
164
+
165
+ = 2.0 (18/07/2018) =
166
+ * Major changes on the plugin architecture
167
+ * Adding developer functions & filters
168
+ * Refactoring
169
+
170
  = 1.13.1 (01/06/2018) =
171
  * Bugfix: Error on the encoding of ignored nodes
172
 
resources/selectize/css/jquery-ui.css DELETED
@@ -1,1311 +0,0 @@
1
- /*! jQuery UI - v1.12.1 - 2016-09-14
2
- * http://jqueryui.com
3
- * Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
- * Copyright jQuery Foundation and other contributors; Licensed MIT */
6
-
7
- /* Layout helpers
8
- ----------------------------------*/
9
- .ui-helper-hidden {
10
- display: none;
11
- }
12
- .ui-helper-hidden-accessible {
13
- border: 0;
14
- clip: rect(0 0 0 0);
15
- height: 1px;
16
- margin: -1px;
17
- overflow: hidden;
18
- padding: 0;
19
- position: absolute;
20
- width: 1px;
21
- }
22
- .ui-helper-reset {
23
- margin: 0;
24
- padding: 0;
25
- border: 0;
26
- outline: 0;
27
- line-height: 1.3;
28
- text-decoration: none;
29
- font-size: 100%;
30
- list-style: none;
31
- }
32
- .ui-helper-clearfix:before,
33
- .ui-helper-clearfix:after {
34
- content: "";
35
- display: table;
36
- border-collapse: collapse;
37
- }
38
- .ui-helper-clearfix:after {
39
- clear: both;
40
- }
41
- .ui-helper-zfix {
42
- width: 100%;
43
- height: 100%;
44
- top: 0;
45
- left: 0;
46
- position: absolute;
47
- opacity: 0;
48
- filter:Alpha(Opacity=0); /* support: IE8 */
49
- }
50
-
51
- .ui-front {
52
- z-index: 100;
53
- }
54
-
55
-
56
- /* Interaction Cues
57
- ----------------------------------*/
58
- .ui-state-disabled {
59
- cursor: default !important;
60
- pointer-events: none;
61
- }
62
-
63
-
64
- /* Icons
65
- ----------------------------------*/
66
- .ui-icon {
67
- display: inline-block;
68
- vertical-align: middle;
69
- margin-top: -.25em;
70
- position: relative;
71
- text-indent: -99999px;
72
- overflow: hidden;
73
- background-repeat: no-repeat;
74
- }
75
-
76
- .ui-widget-icon-block {
77
- left: 50%;
78
- margin-left: -8px;
79
- display: block;
80
- }
81
-
82
- /* Misc visuals
83
- ----------------------------------*/
84
-
85
- /* Overlays */
86
- .ui-widget-overlay {
87
- position: fixed;
88
- top: 0;
89
- left: 0;
90
- width: 100%;
91
- height: 100%;
92
- }
93
- .ui-accordion .ui-accordion-header {
94
- display: block;
95
- cursor: pointer;
96
- position: relative;
97
- margin: 2px 0 0 0;
98
- padding: .5em .5em .5em .7em;
99
- font-size: 100%;
100
- }
101
- .ui-accordion .ui-accordion-content {
102
- padding: 1em 2.2em;
103
- border-top: 0;
104
- overflow: auto;
105
- }
106
- .ui-autocomplete {
107
- position: absolute;
108
- top: 0;
109
- left: 0;
110
- cursor: default;
111
- }
112
- .ui-menu {
113
- list-style: none;
114
- padding: 0;
115
- margin: 0;
116
- display: block;
117
- outline: 0;
118
- }
119
- .ui-menu .ui-menu {
120
- position: absolute;
121
- }
122
- .ui-menu .ui-menu-item {
123
- margin: 0;
124
- cursor: pointer;
125
- /* support: IE10, see #8844 */
126
- list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
127
- }
128
- .ui-menu .ui-menu-item-wrapper {
129
- position: relative;
130
- padding: 3px 1em 3px .4em;
131
- }
132
- .ui-menu .ui-menu-divider {
133
- margin: 5px 0;
134
- height: 0;
135
- font-size: 0;
136
- line-height: 0;
137
- border-width: 1px 0 0 0;
138
- }
139
- .ui-menu .ui-state-focus,
140
- .ui-menu .ui-state-active {
141
- margin: -1px;
142
- }
143
-
144
- /* icon support */
145
- .ui-menu-icons {
146
- position: relative;
147
- }
148
- .ui-menu-icons .ui-menu-item-wrapper {
149
- padding-left: 2em;
150
- }
151
-
152
- /* left-aligned */
153
- .ui-menu .ui-icon {
154
- position: absolute;
155
- top: 0;
156
- bottom: 0;
157
- left: .2em;
158
- margin: auto 0;
159
- }
160
-
161
- /* right-aligned */
162
- .ui-menu .ui-menu-icon {
163
- left: auto;
164
- right: 0;
165
- }
166
- .ui-button {
167
- padding: .4em 1em;
168
- display: inline-block;
169
- position: relative;
170
- line-height: normal;
171
- margin-right: .1em;
172
- cursor: pointer;
173
- vertical-align: middle;
174
- text-align: center;
175
- -webkit-user-select: none;
176
- -moz-user-select: none;
177
- -ms-user-select: none;
178
- user-select: none;
179
-
180
- /* Support: IE <= 11 */
181
- overflow: visible;
182
- }
183
-
184
- .ui-button,
185
- .ui-button:link,
186
- .ui-button:visited,
187
- .ui-button:hover,
188
- .ui-button:active {
189
- text-decoration: none;
190
- }
191
-
192
- /* to make room for the icon, a width needs to be set here */
193
- .ui-button-icon-only {
194
- width: 2em;
195
- box-sizing: border-box;
196
- text-indent: -9999px;
197
- white-space: nowrap;
198
- }
199
-
200
- /* no icon support for input elements */
201
- input.ui-button.ui-button-icon-only {
202
- text-indent: 0;
203
- }
204
-
205
- /* button icon element(s) */
206
- .ui-button-icon-only .ui-icon {
207
- position: absolute;
208
- top: 50%;
209
- left: 50%;
210
- margin-top: -8px;
211
- margin-left: -8px;
212
- }
213
-
214
- .ui-button.ui-icon-notext .ui-icon {
215
- padding: 0;
216
- width: 2.1em;
217
- height: 2.1em;
218
- text-indent: -9999px;
219
- white-space: nowrap;
220
-
221
- }
222
-
223
- input.ui-button.ui-icon-notext .ui-icon {
224
- width: auto;
225
- height: auto;
226
- text-indent: 0;
227
- white-space: normal;
228
- padding: .4em 1em;
229
- }
230
-
231
- /* workarounds */
232
- /* Support: Firefox 5 - 40 */
233
- input.ui-button::-moz-focus-inner,
234
- button.ui-button::-moz-focus-inner {
235
- border: 0;
236
- padding: 0;
237
- }
238
- .ui-controlgroup {
239
- vertical-align: middle;
240
- display: inline-block;
241
- }
242
- .ui-controlgroup > .ui-controlgroup-item {
243
- float: left;
244
- margin-left: 0;
245
- margin-right: 0;
246
- }
247
- .ui-controlgroup > .ui-controlgroup-item:focus,
248
- .ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
249
- z-index: 9999;
250
- }
251
- .ui-controlgroup-vertical > .ui-controlgroup-item {
252
- display: block;
253
- float: none;
254
- width: 100%;
255
- margin-top: 0;
256
- margin-bottom: 0;
257
- text-align: left;
258
- }
259
- .ui-controlgroup-vertical .ui-controlgroup-item {
260
- box-sizing: border-box;
261
- }
262
- .ui-controlgroup .ui-controlgroup-label {
263
- padding: .4em 1em;
264
- }
265
- .ui-controlgroup .ui-controlgroup-label span {
266
- font-size: 80%;
267
- }
268
- .ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
269
- border-left: none;
270
- }
271
- .ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
272
- border-top: none;
273
- }
274
- .ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
275
- border-right: none;
276
- }
277
- .ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
278
- border-bottom: none;
279
- }
280
-
281
- /* Spinner specific style fixes */
282
- .ui-controlgroup-vertical .ui-spinner-input {
283
-
284
- /* Support: IE8 only, Android < 4.4 only */
285
- width: 75%;
286
- width: calc( 100% - 2.4em );
287
- }
288
- .ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
289
- border-top-style: solid;
290
- }
291
-
292
- .ui-checkboxradio-label .ui-icon-background {
293
- box-shadow: inset 1px 1px 1px #ccc;
294
- border-radius: .12em;
295
- border: none;
296
- }
297
- .ui-checkboxradio-radio-label .ui-icon-background {
298
- width: 16px;
299
- height: 16px;
300
- border-radius: 1em;
301
- overflow: visible;
302
- border: none;
303
- }
304
- .ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
305
- .ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
306
- background-image: none;
307
- width: 8px;
308
- height: 8px;
309
- border-width: 4px;
310
- border-style: solid;
311
- }
312
- .ui-checkboxradio-disabled {
313
- pointer-events: none;
314
- }
315
- .ui-datepicker {
316
- width: 17em;
317
- padding: .2em .2em 0;
318
- display: none;
319
- }
320
- .ui-datepicker .ui-datepicker-header {
321
- position: relative;
322
- padding: .2em 0;
323
- }
324
- .ui-datepicker .ui-datepicker-prev,
325
- .ui-datepicker .ui-datepicker-next {
326
- position: absolute;
327
- top: 2px;
328
- width: 1.8em;
329
- height: 1.8em;
330
- }
331
- .ui-datepicker .ui-datepicker-prev-hover,
332
- .ui-datepicker .ui-datepicker-next-hover {
333
- top: 1px;
334
- }
335
- .ui-datepicker .ui-datepicker-prev {
336
- left: 2px;
337
- }
338
- .ui-datepicker .ui-datepicker-next {
339
- right: 2px;
340
- }
341
- .ui-datepicker .ui-datepicker-prev-hover {
342
- left: 1px;
343
- }
344
- .ui-datepicker .ui-datepicker-next-hover {
345
- right: 1px;
346
- }
347
- .ui-datepicker .ui-datepicker-prev span,
348
- .ui-datepicker .ui-datepicker-next span {
349
- display: block;
350
- position: absolute;
351
- left: 50%;
352
- margin-left: -8px;
353
- top: 50%;
354
- margin-top: -8px;
355
- }
356
- .ui-datepicker .ui-datepicker-title {
357
- margin: 0 2.3em;
358
- line-height: 1.8em;
359
- text-align: center;
360
- }
361
- .ui-datepicker .ui-datepicker-title select {
362
- font-size: 1em;
363
- margin: 1px 0;
364
- }
365
- .ui-datepicker select.ui-datepicker-month,
366
- .ui-datepicker select.ui-datepicker-year {
367
- width: 45%;
368
- }
369
- .ui-datepicker table {
370
- width: 100%;
371
- font-size: .9em;
372
- border-collapse: collapse;
373
- margin: 0 0 .4em;
374
- }
375
- .ui-datepicker th {
376
- padding: .7em .3em;
377
- text-align: center;
378
- font-weight: bold;
379
- border: 0;
380
- }
381
- .ui-datepicker td {
382
- border: 0;
383
- padding: 1px;
384
- }
385
- .ui-datepicker td span,
386
- .ui-datepicker td a {
387
- display: block;
388
- padding: .2em;
389
- text-align: right;
390
- text-decoration: none;
391
- }
392
- .ui-datepicker .ui-datepicker-buttonpane {
393
- background-image: none;
394
- margin: .7em 0 0 0;
395
- padding: 0 .2em;
396
- border-left: 0;
397
- border-right: 0;
398
- border-bottom: 0;
399
- }
400
- .ui-datepicker .ui-datepicker-buttonpane button {
401
- float: right;
402
- margin: .5em .2em .4em;
403
- cursor: pointer;
404
- padding: .2em .6em .3em .6em;
405
- width: auto;
406
- overflow: visible;
407
- }
408
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
409
- float: left;
410
- }
411
-
412
- /* with multiple calendars */
413
- .ui-datepicker.ui-datepicker-multi {
414
- width: auto;
415
- }
416
- .ui-datepicker-multi .ui-datepicker-group {
417
- float: left;
418
- }
419
- .ui-datepicker-multi .ui-datepicker-group table {
420
- width: 95%;
421
- margin: 0 auto .4em;
422
- }
423
- .ui-datepicker-multi-2 .ui-datepicker-group {
424
- width: 50%;
425
- }
426
- .ui-datepicker-multi-3 .ui-datepicker-group {
427
- width: 33.3%;
428
- }
429
- .ui-datepicker-multi-4 .ui-datepicker-group {
430
- width: 25%;
431
- }
432
- .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
433
- .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
434
- border-left-width: 0;
435
- }
436
- .ui-datepicker-multi .ui-datepicker-buttonpane {
437
- clear: left;
438
- }
439
- .ui-datepicker-row-break {
440
- clear: both;
441
- width: 100%;
442
- font-size: 0;
443
- }
444
-
445
- /* RTL support */
446
- .ui-datepicker-rtl {
447
- direction: rtl;
448
- }
449
- .ui-datepicker-rtl .ui-datepicker-prev {
450
- right: 2px;
451
- left: auto;
452
- }
453
- .ui-datepicker-rtl .ui-datepicker-next {
454
- left: 2px;
455
- right: auto;
456
- }
457
- .ui-datepicker-rtl .ui-datepicker-prev:hover {
458
- right: 1px;
459
- left: auto;
460
- }
461
- .ui-datepicker-rtl .ui-datepicker-next:hover {
462
- left: 1px;
463
- right: auto;
464
- }
465
- .ui-datepicker-rtl .ui-datepicker-buttonpane {
466
- clear: right;
467
- }
468
- .ui-datepicker-rtl .ui-datepicker-buttonpane button {
469
- float: left;
470
- }
471
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
472
- .ui-datepicker-rtl .ui-datepicker-group {
473
- float: right;
474
- }
475
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
476
- .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
477
- border-right-width: 0;
478
- border-left-width: 1px;
479
- }
480
-
481
- /* Icons */
482
- .ui-datepicker .ui-icon {
483
- display: block;
484
- text-indent: -99999px;
485
- overflow: hidden;
486
- background-repeat: no-repeat;
487
- left: .5em;
488
- top: .3em;
489
- }
490
- .ui-dialog {
491
- position: absolute;
492
- top: 0;
493
- left: 0;
494
- padding: .2em;
495
- outline: 0;
496
- }
497
- .ui-dialog .ui-dialog-titlebar {
498
- padding: .4em 1em;
499
- position: relative;
500
- }
501
- .ui-dialog .ui-dialog-title {
502
- float: left;
503
- margin: .1em 0;
504
- white-space: nowrap;
505
- width: 90%;
506
- overflow: hidden;
507
- text-overflow: ellipsis;
508
- }
509
- .ui-dialog .ui-dialog-titlebar-close {
510
- position: absolute;
511
- right: .3em;
512
- top: 50%;
513
- width: 20px;
514
- margin: -10px 0 0 0;
515
- padding: 1px;
516
- height: 20px;
517
- }
518
- .ui-dialog .ui-dialog-content {
519
- position: relative;
520
- border: 0;
521
- padding: .5em 1em;
522
- background: none;
523
- overflow: auto;
524
- }
525
- .ui-dialog .ui-dialog-buttonpane {
526
- text-align: left;
527
- border-width: 1px 0 0 0;
528
- background-image: none;
529
- margin-top: .5em;
530
- padding: .3em 1em .5em .4em;
531
- }
532
- .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
533
- float: right;
534
- }
535
- .ui-dialog .ui-dialog-buttonpane button {
536
- margin: .5em .4em .5em 0;
537
- cursor: pointer;
538
- }
539
- .ui-dialog .ui-resizable-n {
540
- height: 2px;
541
- top: 0;
542
- }
543
- .ui-dialog .ui-resizable-e {
544
- width: 2px;
545
- right: 0;
546
- }
547
- .ui-dialog .ui-resizable-s {
548
- height: 2px;
549
- bottom: 0;
550
- }
551
- .ui-dialog .ui-resizable-w {
552
- width: 2px;
553
- left: 0;
554
- }
555
- .ui-dialog .ui-resizable-se,
556
- .ui-dialog .ui-resizable-sw,
557
- .ui-dialog .ui-resizable-ne,
558
- .ui-dialog .ui-resizable-nw {
559
- width: 7px;
560
- height: 7px;
561
- }
562
- .ui-dialog .ui-resizable-se {
563
- right: 0;
564
- bottom: 0;
565
- }
566
- .ui-dialog .ui-resizable-sw {
567
- left: 0;
568
- bottom: 0;
569
- }
570
- .ui-dialog .ui-resizable-ne {
571
- right: 0;
572
- top: 0;
573
- }
574
- .ui-dialog .ui-resizable-nw {
575
- left: 0;
576
- top: 0;
577
- }
578
- .ui-draggable .ui-dialog-titlebar {
579
- cursor: move;
580
- }
581
- .ui-draggable-handle {
582
- -ms-touch-action: none;
583
- touch-action: none;
584
- }
585
- .ui-resizable {
586
- position: relative;
587
- }
588
- .ui-resizable-handle {
589
- position: absolute;
590
- font-size: 0.1px;
591
- display: block;
592
- -ms-touch-action: none;
593
- touch-action: none;
594
- }
595
- .ui-resizable-disabled .ui-resizable-handle,
596
- .ui-resizable-autohide .ui-resizable-handle {
597
- display: none;
598
- }
599
- .ui-resizable-n {
600
- cursor: n-resize;
601
- height: 7px;
602
- width: 100%;
603
- top: -5px;
604
- left: 0;
605
- }
606
- .ui-resizable-s {
607
- cursor: s-resize;
608
- height: 7px;
609
- width: 100%;
610
- bottom: -5px;
611
- left: 0;
612
- }
613
- .ui-resizable-e {
614
- cursor: e-resize;
615
- width: 7px;
616
- right: -5px;
617
- top: 0;
618
- height: 100%;
619
- }
620
- .ui-resizable-w {
621
- cursor: w-resize;
622
- width: 7px;
623
- left: -5px;
624
- top: 0;
625
- height: 100%;
626
- }
627
- .ui-resizable-se {
628
- cursor: se-resize;
629
- width: 12px;
630
- height: 12px;
631
- right: 1px;
632
- bottom: 1px;
633
- }
634
- .ui-resizable-sw {
635
- cursor: sw-resize;
636
- width: 9px;
637
- height: 9px;
638
- left: -5px;
639
- bottom: -5px;
640
- }
641
- .ui-resizable-nw {
642
- cursor: nw-resize;
643
- width: 9px;
644
- height: 9px;
645
- left: -5px;
646
- top: -5px;
647
- }
648
- .ui-resizable-ne {
649
- cursor: ne-resize;
650
- width: 9px;
651
- height: 9px;
652
- right: -5px;
653
- top: -5px;
654
- }
655
- .ui-progressbar {
656
- height: 2em;
657
- text-align: left;
658
- overflow: hidden;
659
- }
660
- .ui-progressbar .ui-progressbar-value {
661
- margin: -1px;
662
- height: 100%;
663
- }
664
- .ui-progressbar .ui-progressbar-overlay {
665
- background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
666
- height: 100%;
667
- filter: alpha(opacity=25); /* support: IE8 */
668
- opacity: 0.25;
669
- }
670
- .ui-progressbar-indeterminate .ui-progressbar-value {
671
- background-image: none;
672
- }
673
- .ui-selectable {
674
- -ms-touch-action: none;
675
- touch-action: none;
676
- }
677
- .ui-selectable-helper {
678
- position: absolute;
679
- z-index: 100;
680
- border: 1px dotted black;
681
- }
682
- .ui-selectmenu-menu {
683
- padding: 0;
684
- margin: 0;
685
- position: absolute;
686
- top: 0;
687
- left: 0;
688
- display: none;
689
- }
690
- .ui-selectmenu-menu .ui-menu {
691
- overflow: auto;
692
- overflow-x: hidden;
693
- padding-bottom: 1px;
694
- }
695
- .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
696
- font-size: 1em;
697
- font-weight: bold;
698
- line-height: 1.5;
699
- padding: 2px 0.4em;
700
- margin: 0.5em 0 0 0;
701
- height: auto;
702
- border: 0;
703
- }
704
- .ui-selectmenu-open {
705
- display: block;
706
- }
707
- .ui-selectmenu-text {
708
- display: block;
709
- margin-right: 20px;
710
- overflow: hidden;
711
- text-overflow: ellipsis;
712
- }
713
- .ui-selectmenu-button.ui-button {
714
- text-align: left;
715
- white-space: nowrap;
716
- width: 14em;
717
- }
718
- .ui-selectmenu-icon.ui-icon {
719
- float: right;
720
- margin-top: 0;
721
- }
722
- .ui-slider {
723
- position: relative;
724
- text-align: left;
725
- }
726
- .ui-slider .ui-slider-handle {
727
- position: absolute;
728
- z-index: 2;
729
- width: 1.2em;
730
- height: 1.2em;
731
- cursor: default;
732
- -ms-touch-action: none;
733
- touch-action: none;
734
- }
735
- .ui-slider .ui-slider-range {
736
- position: absolute;
737
- z-index: 1;
738
- font-size: .7em;
739
- display: block;
740
- border: 0;
741
- background-position: 0 0;
742
- }
743
-
744
- /* support: IE8 - See #6727 */
745
- .ui-slider.ui-state-disabled .ui-slider-handle,
746
- .ui-slider.ui-state-disabled .ui-slider-range {
747
- filter: inherit;
748
- }
749
-
750
- .ui-slider-horizontal {
751
- height: .8em;
752
- }
753
- .ui-slider-horizontal .ui-slider-handle {
754
- top: -.3em;
755
- margin-left: -.6em;
756
- }
757
- .ui-slider-horizontal .ui-slider-range {
758
- top: 0;
759
- height: 100%;
760
- }
761
- .ui-slider-horizontal .ui-slider-range-min {
762
- left: 0;
763
- }
764
- .ui-slider-horizontal .ui-slider-range-max {
765
- right: 0;
766
- }
767
-
768
- .ui-slider-vertical {
769
- width: .8em;
770
- height: 100px;
771
- }
772
- .ui-slider-vertical .ui-slider-handle {
773
- left: -.3em;
774
- margin-left: 0;
775
- margin-bottom: -.6em;
776
- }
777
- .ui-slider-vertical .ui-slider-range {
778
- left: 0;
779
- width: 100%;
780
- }
781
- .ui-slider-vertical .ui-slider-range-min {
782
- bottom: 0;
783
- }
784
- .ui-slider-vertical .ui-slider-range-max {
785
- top: 0;
786
- }
787
- .ui-sortable-handle {
788
- -ms-touch-action: none;
789
- touch-action: none;
790
- }
791
- .ui-spinner {
792
- position: relative;
793
- display: inline-block;
794
- overflow: hidden;
795
- padding: 0;
796
- vertical-align: middle;
797
- }
798
- .ui-spinner-input {
799
- border: none;
800
- background: none;
801
- color: inherit;
802
- padding: .222em 0;
803
- margin: .2em 0;
804
- vertical-align: middle;
805
- margin-left: .4em;
806
- margin-right: 2em;
807
- }
808
- .ui-spinner-button {
809
- width: 1.6em;
810
- height: 50%;
811
- font-size: .5em;
812
- padding: 0;
813
- margin: 0;
814
- text-align: center;
815
- position: absolute;
816
- cursor: default;
817
- display: block;
818
- overflow: hidden;
819
- right: 0;
820
- }
821
- /* more specificity required here to override default borders */
822
- .ui-spinner a.ui-spinner-button {
823
- border-top-style: none;
824
- border-bottom-style: none;
825
- border-right-style: none;
826
- }
827
- .ui-spinner-up {
828
- top: 0;
829
- }
830
- .ui-spinner-down {
831
- bottom: 0;
832
- }
833
- .ui-tabs {
834
- position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
835
- padding: .2em;
836
- }
837
- .ui-tabs .ui-tabs-nav {
838
- margin: 0;
839
- padding: .2em .2em 0;
840
- }
841
- .ui-tabs .ui-tabs-nav li {
842
- list-style: none;
843
- float: left;
844
- position: relative;
845
- top: 0;
846
- margin: 1px .2em 0 0;
847
- border-bottom-width: 0;
848
- padding: 0;
849
- white-space: nowrap;
850
- }
851
- .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
852
- float: left;
853
- padding: .5em 1em;
854
- text-decoration: none;
855
- }
856
- .ui-tabs .ui-tabs-nav li.ui-tabs-active {
857
- margin-bottom: -1px;
858
- padding-bottom: 1px;
859
- }
860
- .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
861
- .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
862
- .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
863
- cursor: text;
864
- }
865
- .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
866
- cursor: pointer;
867
- }
868
- .ui-tabs .ui-tabs-panel {
869
- display: block;
870
- border-width: 0;
871
- padding: 1em 1.4em;
872
- background: none;
873
- }
874
- .ui-tooltip {
875
- padding: 8px;
876
- position: absolute;
877
- z-index: 9999;
878
- max-width: 300px;
879
- }
880
- body .ui-tooltip {
881
- border-width: 2px;
882
- }
883
- /* Component containers
884
- ----------------------------------*/
885
- .ui-widget {
886
- font-family: Verdana,Arial,sans-serif;
887
- font-size: 1.1em;
888
- }
889
- .ui-widget .ui-widget {
890
- font-size: 1em;
891
- }
892
- .ui-widget input,
893
- .ui-widget select,
894
- .ui-widget textarea,
895
- .ui-widget button {
896
- font-family: Verdana,Arial,sans-serif;
897
- font-size: 1em;
898
- }
899
- .ui-widget.ui-widget-content {
900
- border: 1px solid #d3d3d3;
901
- }
902
- .ui-widget-content {
903
- border: 1px solid #aaaaaa;
904
- background: #ffffff;
905
- color: #222222;
906
- }
907
- .ui-widget-content a {
908
- color: #222222;
909
- }
910
- .ui-widget-header {
911
- border: 1px solid #aaaaaa;
912
- background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
913
- color: #222222;
914
- font-weight: bold;
915
- }
916
- .ui-widget-header a {
917
- color: #222222;
918
- }
919
-
920
- /* Interaction states
921
- ----------------------------------*/
922
- .ui-state-default,
923
- .ui-widget-content .ui-state-default,
924
- .ui-widget-header .ui-state-default,
925
- .ui-button,
926
-
927
- /* We use html here because we need a greater specificity to make sure disabled
928
- works properly when clicked or hovered */
929
- html .ui-button.ui-state-disabled:hover,
930
- html .ui-button.ui-state-disabled:active {
931
- border: 1px solid #d3d3d3;
932
- background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
933
- font-weight: normal;
934
- color: #555555;
935
- }
936
- .ui-state-default a,
937
- .ui-state-default a:link,
938
- .ui-state-default a:visited,
939
- a.ui-button,
940
- a:link.ui-button,
941
- a:visited.ui-button,
942
- .ui-button {
943
- color: #555555;
944
- text-decoration: none;
945
- }
946
- .ui-state-hover,
947
- .ui-widget-content .ui-state-hover,
948
- .ui-widget-header .ui-state-hover,
949
- .ui-state-focus,
950
- .ui-widget-content .ui-state-focus,
951
- .ui-widget-header .ui-state-focus,
952
- .ui-button:hover,
953
- .ui-button:focus {
954
- border: 1px solid #999999;
955
- background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
956
- font-weight: normal;
957
- color: #212121;
958
- }
959
- .ui-state-hover a,
960
- .ui-state-hover a:hover,
961
- .ui-state-hover a:link,
962
- .ui-state-hover a:visited,
963
- .ui-state-focus a,
964
- .ui-state-focus a:hover,
965
- .ui-state-focus a:link,
966
- .ui-state-focus a:visited,
967
- a.ui-button:hover,
968
- a.ui-button:focus {
969
- color: #212121;
970
- text-decoration: none;
971
- }
972
-
973
- .ui-visual-focus {
974
- box-shadow: 0 0 3px 1px rgb(94, 158, 214);
975
- }
976
- .ui-state-active,
977
- .ui-widget-content .ui-state-active,
978
- .ui-widget-header .ui-state-active,
979
- a.ui-button:active,
980
- .ui-button:active,
981
- .ui-button.ui-state-active:hover {
982
- border: 1px solid #aaaaaa;
983
- background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
984
- font-weight: normal;
985
- color: #212121;
986
- }
987
- .ui-icon-background,
988
- .ui-state-active .ui-icon-background {
989
- border: #aaaaaa;
990
- background-color: #212121;
991
- }
992
- .ui-state-active a,
993
- .ui-state-active a:link,
994
- .ui-state-active a:visited {
995
- color: #212121;
996
- text-decoration: none;
997
- }
998
-
999
- /* Interaction Cues
1000
- ----------------------------------*/
1001
- .ui-state-highlight,
1002
- .ui-widget-content .ui-state-highlight,
1003
- .ui-widget-header .ui-state-highlight {
1004
- border: 1px solid #fcefa1;
1005
- background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
1006
- color: #363636;
1007
- }
1008
- .ui-state-checked {
1009
- border: 1px solid #fcefa1;
1010
- background: #fbf9ee;
1011
- }
1012
- .ui-state-highlight a,
1013
- .ui-widget-content .ui-state-highlight a,
1014
- .ui-widget-header .ui-state-highlight a {
1015
- color: #363636;
1016
- }
1017
- .ui-state-error,
1018
- .ui-widget-content .ui-state-error,
1019
- .ui-widget-header .ui-state-error {
1020
- border: 1px solid #cd0a0a;
1021
- background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
1022
- color: #cd0a0a;
1023
- }
1024
- .ui-state-error a,
1025
- .ui-widget-content .ui-state-error a,
1026
- .ui-widget-header .ui-state-error a {
1027
- color: #cd0a0a;
1028
- }
1029
- .ui-state-error-text,
1030
- .ui-widget-content .ui-state-error-text,
1031
- .ui-widget-header .ui-state-error-text {
1032
- color: #cd0a0a;
1033
- }
1034
- .ui-priority-primary,
1035
- .ui-widget-content .ui-priority-primary,
1036
- .ui-widget-header .ui-priority-primary {
1037
- font-weight: bold;
1038
- }
1039
- .ui-priority-secondary,
1040
- .ui-widget-content .ui-priority-secondary,
1041
- .ui-widget-header .ui-priority-secondary {
1042
- opacity: .7;
1043
- filter:Alpha(Opacity=70); /* support: IE8 */
1044
- font-weight: normal;
1045
- }
1046
- .ui-state-disabled,
1047
- .ui-widget-content .ui-state-disabled,
1048
- .ui-widget-header .ui-state-disabled {
1049
- opacity: .35;
1050
- filter:Alpha(Opacity=35); /* support: IE8 */
1051
- background-image: none;
1052
- }
1053
- .ui-state-disabled .ui-icon {
1054
- filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
1055
- }
1056
-
1057
- /* Icons
1058
- ----------------------------------*/
1059
-
1060
- /* states and images */
1061
- .ui-icon {
1062
- width: 16px;
1063
- height: 16px;
1064
- }
1065
- .ui-icon,
1066
- .ui-widget-content .ui-icon {
1067
- background-image: url("images/ui-icons_222222_256x240.png");
1068
- }
1069
- .ui-widget-header .ui-icon {
1070
- background-image: url("images/ui-icons_222222_256x240.png");
1071
- }
1072
- .ui-state-hover .ui-icon,
1073
- .ui-state-focus .ui-icon,
1074
- .ui-button:hover .ui-icon,
1075
- .ui-button:focus .ui-icon {
1076
- background-image: url("images/ui-icons_454545_256x240.png");
1077
- }
1078
- .ui-state-active .ui-icon,
1079
- .ui-button:active .ui-icon {
1080
- background-image: url("images/ui-icons_454545_256x240.png");
1081
- }
1082
- .ui-state-highlight .ui-icon,
1083
- .ui-button .ui-state-highlight.ui-icon {
1084
- background-image: url("images/ui-icons_2e83ff_256x240.png");
1085
- }
1086
- .ui-state-error .ui-icon,
1087
- .ui-state-error-text .ui-icon {
1088
- background-image: url("images/ui-icons_cd0a0a_256x240.png");
1089
- }
1090
- .ui-button .ui-icon {
1091
- background-image: url("images/ui-icons_888888_256x240.png");
1092
- }
1093
-
1094
- /* positioning */
1095
- .ui-icon-blank { background-position: 16px 16px; }
1096
- .ui-icon-caret-1-n { background-position: 0 0; }
1097
- .ui-icon-caret-1-ne { background-position: -16px 0; }
1098
- .ui-icon-caret-1-e { background-position: -32px 0; }
1099
- .ui-icon-caret-1-se { background-position: -48px 0; }
1100
- .ui-icon-caret-1-s { background-position: -65px 0; }
1101
- .ui-icon-caret-1-sw { background-position: -80px 0; }
1102
- .ui-icon-caret-1-w { background-position: -96px 0; }
1103
- .ui-icon-caret-1-nw { background-position: -112px 0; }
1104
- .ui-icon-caret-2-n-s { background-position: -128px 0; }
1105
- .ui-icon-caret-2-e-w { background-position: -144px 0; }
1106
- .ui-icon-triangle-1-n { background-position: 0 -16px; }
1107
- .ui-icon-triangle-1-ne { background-position: -16px -16px; }
1108
- .ui-icon-triangle-1-e { background-position: -32px -16px; }
1109
- .ui-icon-triangle-1-se { background-position: -48px -16px; }
1110
- .ui-icon-triangle-1-s { background-position: -65px -16px; }
1111
- .ui-icon-triangle-1-sw { background-position: -80px -16px; }
1112
- .ui-icon-triangle-1-w { background-position: -96px -16px; }
1113
- .ui-icon-triangle-1-nw { background-position: -112px -16px; }
1114
- .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
1115
- .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
1116
- .ui-icon-arrow-1-n { background-position: 0 -32px; }
1117
- .ui-icon-arrow-1-ne { background-position: -16px -32px; }
1118
- .ui-icon-arrow-1-e { background-position: -32px -32px; }
1119
- .ui-icon-arrow-1-se { background-position: -48px -32px; }
1120
- .ui-icon-arrow-1-s { background-position: -65px -32px; }
1121
- .ui-icon-arrow-1-sw { background-position: -80px -32px; }
1122
- .ui-icon-arrow-1-w { background-position: -96px -32px; }
1123
- .ui-icon-arrow-1-nw { background-position: -112px -32px; }
1124
- .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
1125
- .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
1126
- .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
1127
- .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
1128
- .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
1129
- .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
1130
- .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
1131
- .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
1132
- .ui-icon-arrowthick-1-n { background-position: 1px -48px; }
1133
- .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
1134
- .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
1135
- .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
1136
- .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
1137
- .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
1138
- .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
1139
- .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
1140
- .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
1141
- .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
1142
- .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
1143
- .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
1144
- .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
1145
- .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
1146
- .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
1147
- .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
1148
- .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
1149
- .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
1150
- .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
1151
- .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
1152
- .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
1153
- .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
1154
- .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
1155
- .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
1156
- .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
1157
- .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
1158
- .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
1159
- .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
1160
- .ui-icon-arrow-4 { background-position: 0 -80px; }
1161
- .ui-icon-arrow-4-diag { background-position: -16px -80px; }
1162
- .ui-icon-extlink { background-position: -32px -80px; }
1163
- .ui-icon-newwin { background-position: -48px -80px; }
1164
- .ui-icon-refresh { background-position: -64px -80px; }
1165
- .ui-icon-shuffle { background-position: -80px -80px; }
1166
- .ui-icon-transfer-e-w { background-position: -96px -80px; }
1167
- .ui-icon-transferthick-e-w { background-position: -112px -80px; }
1168
- .ui-icon-folder-collapsed { background-position: 0 -96px; }
1169
- .ui-icon-folder-open { background-position: -16px -96px; }
1170
- .ui-icon-document { background-position: -32px -96px; }
1171
- .ui-icon-document-b { background-position: -48px -96px; }
1172
- .ui-icon-note { background-position: -64px -96px; }
1173
- .ui-icon-mail-closed { background-position: -80px -96px; }
1174
- .ui-icon-mail-open { background-position: -96px -96px; }
1175
- .ui-icon-suitcase { background-position: -112px -96px; }
1176
- .ui-icon-comment { background-position: -128px -96px; }
1177
- .ui-icon-person { background-position: -144px -96px; }
1178
- .ui-icon-print { background-position: -160px -96px; }
1179
- .ui-icon-trash { background-position: -176px -96px; }
1180
- .ui-icon-locked { background-position: -192px -96px; }
1181
- .ui-icon-unlocked { background-position: -208px -96px; }
1182
- .ui-icon-bookmark { background-position: -224px -96px; }
1183
- .ui-icon-tag { background-position: -240px -96px; }
1184
- .ui-icon-home { background-position: 0 -112px; }
1185
- .ui-icon-flag { background-position: -16px -112px; }
1186
- .ui-icon-calendar { background-position: -32px -112px; }
1187
- .ui-icon-cart { background-position: -48px -112px; }
1188
- .ui-icon-pencil { background-position: -64px -112px; }
1189
- .ui-icon-clock { background-position: -80px -112px; }
1190
- .ui-icon-disk { background-position: -96px -112px; }
1191
- .ui-icon-calculator { background-position: -112px -112px; }
1192
- .ui-icon-zoomin { background-position: -128px -112px; }
1193
- .ui-icon-zoomout { background-position: -144px -112px; }
1194
- .ui-icon-search { background-position: -160px -112px; }
1195
- .ui-icon-wrench { background-position: -176px -112px; }
1196
- .ui-icon-gear { background-position: -192px -112px; }
1197
- .ui-icon-heart { background-position: -208px -112px; }
1198
- .ui-icon-star { background-position: -224px -112px; }
1199
- .ui-icon-link { background-position: -240px -112px; }
1200
- .ui-icon-cancel { background-position: 0 -128px; }
1201
- .ui-icon-plus { background-position: -16px -128px; }
1202
- .ui-icon-plusthick { background-position: -32px -128px; }
1203
- .ui-icon-minus { background-position: -48px -128px; }
1204
- .ui-icon-minusthick { background-position: -64px -128px; }
1205
- .ui-icon-close { background-position: -80px -128px; }
1206
- .ui-icon-closethick { background-position: -96px -128px; }
1207
- .ui-icon-key { background-position: -112px -128px; }
1208
- .ui-icon-lightbulb { background-position: -128px -128px; }
1209
- .ui-icon-scissors { background-position: -144px -128px; }
1210
- .ui-icon-clipboard { background-position: -160px -128px; }
1211
- .ui-icon-copy { background-position: -176px -128px; }
1212
- .ui-icon-contact { background-position: -192px -128px; }
1213
- .ui-icon-image { background-position: -208px -128px; }
1214
- .ui-icon-video { background-position: -224px -128px; }
1215
- .ui-icon-script { background-position: -240px -128px; }
1216
- .ui-icon-alert { background-position: 0 -144px; }
1217
- .ui-icon-info { background-position: -16px -144px; }
1218
- .ui-icon-notice { background-position: -32px -144px; }
1219
- .ui-icon-help { background-position: -48px -144px; }
1220
- .ui-icon-check { background-position: -64px -144px; }
1221
- .ui-icon-bullet { background-position: -80px -144px; }
1222
- .ui-icon-radio-on { background-position: -96px -144px; }
1223
- .ui-icon-radio-off { background-position: -112px -144px; }
1224
- .ui-icon-pin-w { background-position: -128px -144px; }
1225
- .ui-icon-pin-s { background-position: -144px -144px; }
1226
- .ui-icon-play { background-position: 0 -160px; }
1227
- .ui-icon-pause { background-position: -16px -160px; }
1228
- .ui-icon-seek-next { background-position: -32px -160px; }
1229
- .ui-icon-seek-prev { background-position: -48px -160px; }
1230
- .ui-icon-seek-end { background-position: -64px -160px; }
1231
- .ui-icon-seek-start { background-position: -80px -160px; }
1232
- /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1233
- .ui-icon-seek-first { background-position: -80px -160px; }
1234
- .ui-icon-stop { background-position: -96px -160px; }
1235
- .ui-icon-eject { background-position: -112px -160px; }
1236
- .ui-icon-volume-off { background-position: -128px -160px; }
1237
- .ui-icon-volume-on { background-position: -144px -160px; }
1238
- .ui-icon-power { background-position: 0 -176px; }
1239
- .ui-icon-signal-diag { background-position: -16px -176px; }
1240
- .ui-icon-signal { background-position: -32px -176px; }
1241
- .ui-icon-battery-0 { background-position: -48px -176px; }
1242
- .ui-icon-battery-1 { background-position: -64px -176px; }
1243
- .ui-icon-battery-2 { background-position: -80px -176px; }
1244
- .ui-icon-battery-3 { background-position: -96px -176px; }
1245
- .ui-icon-circle-plus { background-position: 0 -192px; }
1246
- .ui-icon-circle-minus { background-position: -16px -192px; }
1247
- .ui-icon-circle-close { background-position: -32px -192px; }
1248
- .ui-icon-circle-triangle-e { background-position: -48px -192px; }
1249
- .ui-icon-circle-triangle-s { background-position: -64px -192px; }
1250
- .ui-icon-circle-triangle-w { background-position: -80px -192px; }
1251
- .ui-icon-circle-triangle-n { background-position: -96px -192px; }
1252
- .ui-icon-circle-arrow-e { background-position: -112px -192px; }
1253
- .ui-icon-circle-arrow-s { background-position: -128px -192px; }
1254
- .ui-icon-circle-arrow-w { background-position: -144px -192px; }
1255
- .ui-icon-circle-arrow-n { background-position: -160px -192px; }
1256
- .ui-icon-circle-zoomin { background-position: -176px -192px; }
1257
- .ui-icon-circle-zoomout { background-position: -192px -192px; }
1258
- .ui-icon-circle-check { background-position: -208px -192px; }
1259
- .ui-icon-circlesmall-plus { background-position: 0 -208px; }
1260
- .ui-icon-circlesmall-minus { background-position: -16px -208px; }
1261
- .ui-icon-circlesmall-close { background-position: -32px -208px; }
1262
- .ui-icon-squaresmall-plus { background-position: -48px -208px; }
1263
- .ui-icon-squaresmall-minus { background-position: -64px -208px; }
1264
- .ui-icon-squaresmall-close { background-position: -80px -208px; }
1265
- .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
1266
- .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
1267
- .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
1268
- .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
1269
- .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
1270
- .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
1271
-
1272
-
1273
- /* Misc visuals
1274
- ----------------------------------*/
1275
-
1276
- /* Corner radius */
1277
- .ui-corner-all,
1278
- .ui-corner-top,
1279
- .ui-corner-left,
1280
- .ui-corner-tl {
1281
- border-top-left-radius: 4px;
1282
- }
1283
- .ui-corner-all,
1284
- .ui-corner-top,
1285
- .ui-corner-right,
1286
- .ui-corner-tr {
1287
- border-top-right-radius: 4px;
1288
- }
1289
- .ui-corner-all,
1290
- .ui-corner-bottom,
1291
- .ui-corner-left,
1292
- .ui-corner-bl {
1293
- border-bottom-left-radius: 4px;
1294
- }
1295
- .ui-corner-all,
1296
- .ui-corner-bottom,
1297
- .ui-corner-right,
1298
- .ui-corner-br {
1299
- border-bottom-right-radius: 4px;
1300
- }
1301
-
1302
- /* Overlays */
1303
- .ui-widget-overlay {
1304
- background: #aaaaaa;
1305
- opacity: .3;
1306
- filter: Alpha(Opacity=30); /* support: IE8 */
1307
- }
1308
- .ui-widget-shadow {
1309
- -webkit-box-shadow: -8px -8px 8px #aaaaaa;
1310
- box-shadow: -8px -8px 8px #aaaaaa;
1311
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
resources/selectize/js/jquery-ui.min.js DELETED
@@ -1,13 +0,0 @@
1
- /*! jQuery UI - v1.12.1 - 2016-09-14
2
- * http://jqueryui.com
3
- * Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
4
- * Copyright jQuery Foundation and other contributors; Licensed MIT */
5
-
6
- (function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=n(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(m.inline?m.dpDiv.parent()[0]:m.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}function r(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{},t.ui.version="1.12.1";var h=0,l=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},h=e.split(".")[0];e=e.split(".")[1];var l=h+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[h]=t[h]||{},n=t[h][e],o=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:h,widgetName:e,widgetFullName:l}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,s,n=l.call(arguments,1),o=0,a=n.length;a>o;o++)for(i in n[o])s=n[o][i],n[o].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(n){var o="string"==typeof n,a=l.call(arguments,1),r=this;return o?this.length||"instance"!==n?this.each(function(){var i,o=t.data(this,s);return"instance"===n?(r=o,!1):o?t.isFunction(o[n])&&"_"!==n.charAt(0)?(i=o[n].apply(o,a),i!==o&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+n+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+n+"'")}):r=void 0:(a.length&&(n=t.widget.extend.apply(null,[n].concat(a))),this.each(function(){var e=t.data(this,s);e?(e.option(n||{}),e._init&&e._init()):t.data(this,s,new i(n,this))})),r}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):h.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=h.test(i[1])?i[1]:"center",t=l.exec(i[0]),e=l.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each(function(){var s,r,h=t(this),l=h.outerWidth(),c=h.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=l+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),I=e(k.my,h.outerWidth(),h.outerHeight());"right"===n.my[0]?D.left-=l:"center"===n.my[0]&&(D.left-=l/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=I[0],D.top+=I[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:l,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+I[0],u[1]+I[1]],my:n.my,at:n.at,within:b,elem:h})}),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-l,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:h,left:D.left,top:D.top,width:l,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-h,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var c="ui-effects-",u="ui-effects-style",d="ui-effects-animated",p=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(p),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(p.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),l=l.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(d)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(c+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;n>s;s++)null!==e[s]&&(i=t.data(c+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(u,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(u)||"",t.removeData(u)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(c+"placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e=c+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){r.removeData(d),t.effects.cleanUp(r),"hide"===s.mode&&r.hide(),a()}function a(){t.isFunction(h)&&h.call(r[0]),t.isFunction(e)&&e()}var r=t(this);s.mode=c.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(r[l](),a()):n.call(r[0],s,i):(r.is(":hidden")?"hide"===l:"show"===l)?(r[l](),a()):n.call(r[0],s,a)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,a=s.queue,r=a||"fx",h=s.complete,l=s.mode,c=[],u=function(e){var i=t(this),s=t.effects.mode(i,l)||o;i.data(d,!0),c.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?l?this[l](s.duration,h):this.each(function(){h&&h.call(this)}):a===!1?this.each(u).each(i):this.queue(r,u).queue(r,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n)
7
- }}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}();var f=t.effects;t.effects.define("blind","hide",function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},h=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),h&&h.css(t.effects.clipToBox(r)),r.clip=a),h&&h.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var s,n,o,a=t(this),r=e.mode,h="hide"===r,l="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(l||h?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),l&&(n={opacity:1},n[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),h&&(u/=Math.pow(2,d-1)),n={},n[m]=o;d>v;v++)s={},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=h?2*u:u/2;h&&(s={opacity:0},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)}),t.effects.define("clip","hide",function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,h=r||"horizontal"===a,l=r||"vertical"===a;s=o.cssClip(),n.clip={top:l?(s.bottom-s.top)/2:s.top,right:h?(s.right-s.left)/2:s.right,bottom:l?(s.bottom-s.top)/2:s.bottom,left:h?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var s,n=t(this),o=e.mode,a="show"===o,r=e.direction||"left",h="up"===r||"down"===r?"top":"left",l="up"===r||"left"===r?"-=":"+=",c="+="===l?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,u[h]=l+s,a&&(n.css(u),u[h]=c+s,u.opacity=1),n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),i()}var o,a,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,g="show"===f,m=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/d),v=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(h=m.top+o*v,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*_,l=a-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(g?l*_:0),top:h+(g?c*v:0),opacity:g?0:1}).animate({left:r+(g?0:l*_),top:h+(g?0:c*v),opacity:g?1:0},e.duration||500,e.easing,s)}),t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,h=/([0-9]+)%/.exec(r),l=!!e.horizFirst,c=l?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(s),p=s.cssClip(),f={clip:t.extend({},p)},g={clip:t.extend({},p)},m=[p[c[0]],p[c[1]]],_=s.queue().length;h&&(r=parseInt(h[1],10)/100*m[a?0:1]),f.clip[c[0]]=r,g.clip[c[0]]=r,g.clip[c[1]]=0,o&&(s.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=p),s.queue(function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(g),u,e.easing),i()}).animate(f,u,e.easing).animate(g,u,e.easing).queue(i),t.effects.unshift(s,_,4)}),t.effects.define("highlight","show",function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var s,n,o,a=t(this),r=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],l=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},("box"===d||"both"===d)&&(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,h,n.from.y,_),v=t.effects.setTransition(a,h,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,l,n.from.x,_),v=t.effects.setTransition(a,l,n.to.x,v))),("content"===d||"both"===d)&&n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),("content"===d||"both"===d)&&(h=h.concat(["marginTop","marginBottom"]).concat(r),l=l.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,h,n.from.y,o),a=t.effects.setTransition(i,h,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,l,n.from.x,o),a=t.effects.setTransition(i,l,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)}),t.effects.define("pulsate","show",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=o||a,h=2*(e.times||5)+(r?1:0),l=e.duration/h,c=0,u=1,d=s.queue().length;for((o||!s.is(":visible"))&&(s.css("opacity",0).show(),c=1);h>u;u++)s.animate({opacity:c},l,e.easing),c=1-c;s.animate({opacity:c},l,e.easing),s.queue(i),t.effects.unshift(s,d,h+1)}),t.effects.define("shake",function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,h=2*r+1,l=Math.round(e.duration/h),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,l,e.easing);r>s;s++)n.animate(p,l,e.easing).animate(f,l,e.easing);n.animate(p,l,e.easing).animate(d,l/2,e.easing).queue(i),t.effects.unshift(n,g,h+1)}),t.effects.define("slide","show",function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u=e.distance||o["top"===l?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[l],d[l]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[h][1]]=d.clip[a[h][0]],"show"===r&&(o.cssClip(d.clip),o.css(l,d[l]),d.clip=s,d[l]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});var f;t.uiBackCompat!==!1&&(f=t.effects.define("transfer",function(e,i){t(this).transfer(e,i)})),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,s=this.options.icons;s&&(e=t("<span>"),this._addClass(e,"ui-accordion-header-icon","ui-icon "+s.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,s.header)._addClass(i,null,s.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void 0)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=t(this),i=e.uniqueId().attr("id"),s=e.next(),n=s.uniqueId().attr("id");e.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(e=n.height(),this.element.siblings(":visible").each(function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each(function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,s,n=this.options,o=this.active,a=t(e.currentTarget),r=a[0]===o[0],h=r&&n.collapsible,l=h?t():a.next(),c=o.next(),u={oldHeader:o,oldPanel:c,newHeader:h?t():a,newPanel:l};e.preventDefault(),r&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=h?!1:this.headers.index(a),this.active=r?t():a,this._toggle(u),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),n.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,n.icons.activeHeader)._addClass(i,null,n.icons.header)),r||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),n.icons&&(s=a.children(".ui-accordion-header-icon"),this._removeClass(s,null,n.icons.header)._addClass(s,null,n.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(t(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var s,n,o,a=this,r=0,h=t.css("box-sizing"),l=t.length&&(!e.length||t.index()<e.index()),c=this.options.animate||{},u=l&&c.down||c,d=function(){a._toggleComplete(i)};return"number"==typeof u&&(o=u),"string"==typeof u&&(n=u),n=n||u.easing||c.easing,o=o||u.duration||c.duration,e.length?t.length?(s=t.show().outerHeight(),e.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(this.showProps,{duration:o,easing:n,complete:d,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==a.options.heightStyle&&(i.now=Math.round(s-e.outerHeight()-r),r=0)}}),void 0):e.animate(this.hideProps,o,n,d):t.animate(this.showProps,o,n,d)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),s=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&s.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),s=t(e.currentTarget);i[0]===s[0]&&(this._removeClass(s.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,s))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){var i=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,s,n,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,s=this.previousFilter||"",o=!1,n=e.keyCode>=96&&105>=e.keyCode?""+(e.keyCode-96):String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),n===s?o=!0:n=s+n,i=this._filterMenuItems(n),i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(e.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(e,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,s,n,o,a=this,r=this.options.icons.submenu,h=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),s=h.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),s=t("<span>").data("ui-menu-submenu-caret",!0);a._addClass(s,"ui-menu-icon","ui-icon "+r),i.attr("aria-haspopup","true").prepend(s),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(s,"ui-menu","ui-widget ui-widget-content ui-front"),e=h.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),n=i.not(".ui-menu-item, .ui-menu-divider"),o=n.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(n,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t+""),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this._removeClass(s.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(e),void 0)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first())),void 0):(this.next(e),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)},_filterMenuItems:function(e){var i=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}}),t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;
8
- this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),void 0):(this._searchTimeout(t),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(t),this._change(t),void 0)}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:n})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&t.trim(s).length&&(this.liveRegion.children().hide(),t("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,i){var s=i.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=s})),!1!==this._trigger("select",e,{item:s})&&this._value(s.value),this.term=this._value(),this.close(e),this.selectedItem=s}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),s=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;(!e||e&&!i&&!s)&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[t](e),void 0):(this.search(null,e),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}}),t.ui.autocomplete;var g=/ui-corner-([a-z]){2,6}/g;t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(s,n){var o,a={};return n?"controlgroupLabel"===s?(o=e.element.find(n),o.each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),i=i.concat(o.get()),void 0):(t.fn[s]&&(a=e["_"+s+"Options"]?e["_"+s+"Options"]("middle"):{classes:{}},e.element.find(n).each(function(){var n=t(this),o=n[s]("instance"),r=t.widget.extend({},a);if("button"!==s||!n.parent(".ui-spinner").length){o||(o=n[s]()[s]("instance")),o&&(r.classes=e._resolveClassesValues(r.classes,o)),n[s](r);var h=n[s]("widget");t.data(h[0],"ui-controlgroup-data",o?o:n[s]("instance")),i.push(h[0])}})),void 0):void 0}),this.childWidgets=t(t.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this),s=i.data("ui-controlgroup-data");s&&s[e]&&s[e]()})},_updateCornerClass:function(t,e){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",s=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null,s)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var s={};return t.each(e,function(n){var o=i.options.classes[n]||"";o=t.trim(o.replace(g,"")),s[n]=(o+" "+e[n]).replace(/\s+/g," ")}),s},_setOption:function(t,e){return"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?(this._callChildMethod(e?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,s){var n=e[s]().data("ui-controlgroup-data");if(n&&i["_"+n.widgetName+"Options"]){var o=i["_"+n.widgetName+"Options"](1===e.length?"only":s);o.classes=i._resolveClassesValues(o.classes,n),n.element[n.widgetName](o)}else i._updateCornerClass(e[s](),s)}),this._callChildMethod("refresh"))}}),t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,s=this,n=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){s.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(n.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(n.disabled=e),n},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,s="input[name='"+t.ui.escapeSelector(i)+"']";return i?(e=this.form.length?t(this.form[0].elements).filter(s):t(s).filter(function(){return 0===t(this).form().length}),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){return"label"!==t||e?(this._super(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e),this.element[0].disabled=e,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio,t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),t=this.element[0].disabled,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var s="iconPosition"!==e,n=s?this.options.iconPosition:i,o="top"===n||"bottom"===n;this.icon?s&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),s&&this._addClass(this.icon,null,i),this._attachIcon(n),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(n))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),t.uiBackCompat!==!1&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){return"text"===t?(this._super("showLabel",e),void 0):("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button,t.extend(t.ui,{datepicker:{version:"1.12.1"}});var m;t.extend(s.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return a(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var s=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.on("focus",this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,n,o){var r,h,l,c,u,d=this._dialogInst;return d||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),a(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+c,l/2-150+u]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),m===n&&(m=null))},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,s){var n,o,r,h,l=this._getInst(e);return 2===arguments.length&&"string"==typeof i?"defaults"===i?t.extend({},t.datepicker._defaults):l?"all"===i?t.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),a(l.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,r)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),l),this._autoSize(l),this._setDate(l,o),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,s,n=t.datepicker._getInst(e.target);return t.datepicker._get(n,"constrainInput")?(i=t.datepicker._possibleChars(t.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var s,n,o,r,h,l,c;s=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==s&&(t.datepicker._curInst.dpDiv.stop(!0,!0),s&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),n=t.datepicker._get(s,"beforeShow"),o=n?n.apply(e,[e,s]):{},o!==!1&&(a(s.settings,o),s.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(s),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),h={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(s),h=t.datepicker._checkOffset(s,h,r),s.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),s.inline||(l=t.datepicker._get(s,"showAnim"),c=t.datepicker._get(s,"duration"),s.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[l]?s.dpDiv.show(l,t.datepicker._get(s,"showOptions"),c):s.dpDiv[l||"show"](l?c:null),t.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),t.datepicker._curInst=s))
9
- }},_updateDatepicker:function(e){this.maxRows=4,m=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,s=this._getNumberOfMonths(e),n=s[1],a=17,r=e.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),s=this._get(a,"duration"),n=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),s,n):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(a,"onClose"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).val(n))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(e,i,s){if(null==e||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,o,a,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),u=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,g=-1,m=-1,_=-1,v=-1,b=!1,y=function(t){var i=e.length>n+1&&e.charAt(n+1)===t;return i&&n++,i},w=function(t){var e=y(t),s="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n="y"===t?s:1,o=RegExp("^\\d{"+n+","+s+"}"),a=i.substring(h).match(o);if(!a)throw"Missing number at position "+h;return h+=a[0].length,parseInt(a[0],10)},k=function(e,s,n){var o=-1,a=t.map(y(e)?n:s,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(a,function(t,e){var s=e[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(o=e[0],h+=s.length,!1):void 0}),-1!==o)return o+1;throw"Unknown name at position "+h},x=function(){if(i.charAt(h)!==e.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;e.length>n;n++)if(b)"'"!==e.charAt(n)||y("'")?x():b=!1;else switch(e.charAt(n)){case"d":_=w("d");break;case"D":k("D",u,d);break;case"o":v=w("o");break;case"m":m=w("m");break;case"M":m=k("M",p,f);break;case"y":g=w("y");break;case"@":r=new Date(w("@")),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"!":r=new Date((w("!")-this._ticksTo1970)/1e4),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"'":y("'")?x():b=!0;break;default:x()}if(i.length>h&&(a=i.substr(h),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c>=g?0:-100)),v>-1)for(m=1,_=v;;){if(o=this._getDaysInMonth(g,m-1),o>=_)break;m++,_-=o}if(r=this._daylightSavingAdjust(new Date(g,m-1,_)),r.getFullYear()!==g||r.getMonth()+1!==m||r.getDate()!==_)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=h("y")?e.getFullYear():(10>e.getFullYear()%100?"0":"")+e.getFullYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(r){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":a+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}l=h.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,_,v,b,y,w,k,x,C,D,I,T,P,M,S,H,z,O,A,N,W,E,F,L,R=new Date,B=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),j=this._get(t,"showButtonPanel"),q=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),$=this._get(t,"stepMonths"),X=1!==U[0]||1!==U[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-U[0]*U[1]+1,J.getDate())),e=Q&&Q>e?Q:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-$,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+$,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:B,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;U[0]>k;k++){for(x="",this.maxRows=4,C=0;U[1]>C;C++){if(D=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),I=" ui-corner-all",T="",X){if(T+="<div class='ui-datepicker-group",U[1]>1)switch(C){case 0:T+=" ui-datepicker-group-first",I=" ui-corner-"+(Y?"right":"left");break;case U[1]-1:T+=" ui-datepicker-group-last",I=" ui-corner-"+(Y?"left":"right");break;default:T+=" ui-datepicker-group-middle",I=""}T+="'>"}for(T+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===k?Y?o:s:"")+(/all|right/.test(I)&&0===k?Y?s:o:"")+this._generateMonthYearHeader(t,Z,te,Q,J,k>0||C>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",P=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)M=(w+c)%7,P+="<th scope='col'"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[M]+"'>"+p[M]+"</span></th>";for(T+=P+"</tr></thead><tbody>",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),H=(this._getFirstDayOfMonth(te,Z)-c+7)%7,z=Math.ceil((H+S)/7),O=X?this.maxRows>z?this.maxRows:z:z,this.maxRows=O,A=this._daylightSavingAdjust(new Date(te,Z,1-H)),N=0;O>N;N++){for(T+="<tr>",W=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(A)+"</td>":"",w=0;7>w;w++)E=m?m.apply(t.input?t.input[0]:null,[A]):[!0,""],F=A.getMonth()!==Z,L=F&&!v||!E[0]||Q&&Q>A||J&&A>J,W+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(A.getTime()===D.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===A.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!_?"":" "+E[1]+(A.getTime()===G.getTime()?" "+this._currentClass:"")+(A.getTime()===B.getTime()?" ui-datepicker-today":""))+"'"+(F&&!_||!E[2]?"":" title='"+E[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+A.getMonth()+"' data-year='"+A.getFullYear()+"'")+">"+(F&&!_?"&#xa0;":L?"<span class='ui-state-default'>"+A.getDate()+"</span>":"<a class='ui-state-default"+(A.getTime()===B.getTime()?" ui-state-highlight":"")+(A.getTime()===G.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+A.getDate()+"</a>")+"</td>",A.setDate(A.getDate()+1),A=this._daylightSavingAdjust(A);T+=W+"</tr>"}Z++,Z>11&&(Z=0,te++),T+="</tbody></table>"+(X?"</div>"+(U[0]>0&&C===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=T}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(v||(b+=y+(!o&&m&&_?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!_)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new s,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1",t.datepicker,t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var _=!1;t(document).on("mouseup",function(){_=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!_){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,n="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),_=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,_=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(this._blurActiveElement(e),this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);s.closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}
10
- },_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),h=t.pageX,l=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(h=this.originalPageX),"x"===a.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY<n.scrollSensitivity?a.scrollTop=o=a.scrollTop+n.scrollSpeed:e.pageY-s.overflowOffset.top<n.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+a.offsetWidth-e.pageX<n.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+n.scrollSpeed:e.pageX-s.overflowOffset.left<n.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(e.pageY-t(r).scrollTop()<n.scrollSensitivity?o=t(r).scrollTop(t(r).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(r).scrollTop())<n.scrollSensitivity&&(o=t(r).scrollTop(t(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(e.pageX-t(r).scrollLeft()<n.scrollSensitivity?o=t(r).scrollLeft(t(r).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(r).scrollLeft())<n.scrollSensitivity&&(o=t(r).scrollLeft(t(r).scrollLeft()+n.scrollSpeed)))),o!==!1&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(s,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var n=s.options;s.snapElements=[],t(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var e=t(this),i=e.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,s){var n,o,a,r,h,l,c,u,d,p,f=s.options,g=f.snapTolerance,m=i.offset.left,_=m+s.helperProportions.width,v=i.offset.top,b=v+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)h=s.snapElements[d].left-s.margins.left,l=h+s.snapElements[d].width,c=s.snapElements[d].top-s.margins.top,u=c+s.snapElements[d].height,h-g>_||m>l+g||c-g>b||v>u+g||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=g>=Math.abs(c-b),o=g>=Math.abs(u-v),a=g>=Math.abs(h-_),r=g>=Math.abs(l-m),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=g>=Math.abs(c-v),o=g>=Math.abs(u-b),a=g>=Math.abs(h-m),r=g>=Math.abs(l-_),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable,t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("<div>"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,g=s.maxWidth&&p>s.maxWidth,m=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),g&&(p-=l),m&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable,t.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog
11
- },disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t.ui.safeBlur(t.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+t(this).css("z-index")}).get(),o=Math.max.apply(null,n);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),s=!0),s&&!i&&this._trigger("focus",e),s},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=t(t.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(e){function i(){var e=t.ui.safeActiveElement(this.document[0]),i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),void 0;if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay(function(){n.trigger("focus")}),e.preventDefault()):(this._delay(function(){s.trigger("focus")}),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this._removeClass(this.uiDialog,"ui-dialog-buttons"),void 0):(t.each(i,function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,o={icon:s.icon,iconPosition:s.iconPosition,showLabel:s.showLabel,icons:s.icons,text:s.text},delete s.click,delete s.icon,delete s.iconPosition,delete s.showLabel,delete s.icons,"boolean"==typeof s.text&&delete s.text,t("<button></button>",s).button(o).appendTo(e.uiButtonSet).on("click",function(){n.apply(e.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){i._addClass(t(this),"ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,o){var a=o.offset.left-i.document.scrollLeft(),r=o.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" "+"top"+(r>=0?"+":"")+r,of:i.window},i._removeClass(t(this),"ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){i._addClass(t(this),"ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,o){var a=i.uiDialog.offset(),r=a.left-i.document.scrollLeft(),h=a.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},i._removeClass(t(this),"ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,s=!1,n={};t.each(e,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,i){var s,n,o=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&(s=o.is(":data(ui-draggable)"),s&&!i&&o.draggable("destroy"),!s&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(n=o.is(":data(ui-resizable)"),n&&!i&&o.resizable("destroy"),n&&"string"==typeof i&&o.resizable("option","handles",i),n||i===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}}),t.ui.dialog,t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],void 0):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;t.length>e;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if("accept"===e)this.accept=t.isFunction(i)?i:function(t){return t.is(i)};else if("scope"===e){var s=t.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=t(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&v(s,t.extend(i,{offset:i.element.offset()}),i.options.tolerance,e)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var v=t.ui.intersect=function(){function t(t,e,i){return t>=e&&e+i>t}return function(e,i,s,n){if(!i.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,r=o+e.helperProportions.width,h=a+e.helperProportions.height,l=i.offset.left,c=i.offset.top,u=l+i.proportions().width,d=c+i.proportions().height;switch(s){case"fit":return o>=l&&u>=r&&a>=c&&d>=h;case"intersect":return o+e.helperProportions.width/2>l&&u>r-e.helperProportions.width/2&&a+e.helperProportions.height/2>c&&d>h-e.helperProportions.height/2;case"pointer":return t(n.pageY,c,i.proportions().height)&&t(n.pageX,l,i.proportions().width);case"touch":return(a>=c&&d>=a||h>=c&&d>=h||c>a&&h>d)&&(o>=l&&u>=o||r>=l&&u>=r||l>o&&r>u);default:return!1}}}();t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&v(e,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=v(e,this,this.options.tolerance,i),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===n}),o.length&&(s=t(o[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}},t.uiBackCompat!==!1&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),t.ui.droppable,t.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=t("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){return void 0===t?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),void 0)},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,e===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}}),t.widget("ui.selectable",t.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each(function(){var i=t(this),s=i.offset(),n={left:s.left-e.elementPos.left,top:s.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:i,left:n.left,top:n.top,right:n.left+i.outerWidth(),bottom:n.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=t("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(i._removeClass(s.$element,"ui-selected"),s.selected=!1,i._addClass(s.$element,"ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),i._removeClass(n.$element,s?"ui-unselecting":"ui-selected")._addClass(n.$element,s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,h=e.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),l=!1,c={};i&&i.element!==s.element[0]&&(c.left=i.left+s.elementPos.left,c.right=i.right+s.elementPos.left,c.top=i.top+s.elementPos.top,c.bottom=i.bottom+s.elementPos.top,"touch"===n.tolerance?l=!(c.left>r||o>c.right||c.top>h||a>c.bottom):"fit"===n.tolerance&&(l=c.left>o&&r>c.right&&c.top>a&&h>c.bottom),l?(i.selected&&(s._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(s._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(s._addClass(i.$element,"ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,s._addClass(i.$element,"ui-selected"),i.selected=!0):(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(s._removeClass(i.$element,"ui-selected"),i.selected=!1,s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-selecting")._addClass(s.$element,"ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),t.widget("ui.selectmenu",[t.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=t()},_drawButton:function(){var e,i=this,s=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=t("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=t("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(s).appendTo(this.button),this.options.width!==!1&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){i._rendered||i._refreshMenu()})},_drawMenu:function(){var e=this;this.menu=t("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=t("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,i){t.preventDefault(),e._setSelection(),e._select(i.item.data("ui-selectmenu-item"),t)},focus:function(t,i){var s=i.item.data("ui-selectmenu-item");null!=e.focusIndex&&s.index!==e.focusIndex&&(e._trigger("focus",t,{item:s}),e.isOpen||e._select(s,t)),e.focusIndex=s.index,e.button.attr("aria-activedescendant",e.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(t.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var i=t("<span>");return this._setText(i,e.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(e,i){var s=this,n="";t.each(i,function(i,o){var a;o.optgroup!==n&&(a=t("<li>",{text:o.optgroup}),s._addClass(a,"ui-selectmenu-optgroup","ui-menu-divider"+(o.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),a.appendTo(e),n=o.optgroup),s._renderItemData(e,o)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(e,i){var s=t("<li>"),n=t("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(s,null,"ui-state-disabled"),this._setText(n,i.label),s.append(n).appendTo(e)},_setText:function(t,e){e?t.text(e):t.html("&#160;")},_move:function(t,e){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),n+=":not(.ui-state-disabled)"),s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](n).eq(-1):i[t+"All"](n).eq(0),s.length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?(t=window.getSelection(),t.removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(t(e.target).closest(".ui-selectmenu-menu, #"+t.ui.escapeSelector(this.ids.button)).length||this.close(e))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection(),t.rangeCount&&(this.range=t.getRangeAt(0))):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(e){var i=!0;switch(e.keyCode){case t.ui.keyCode.TAB:case t.ui.keyCode.ESCAPE:this.close(e),i=!1;break;case t.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case t.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case t.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case t.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case t.ui.keyCode.LEFT:this._move("prev",e);break;case t.ui.keyCode.RIGHT:this._move("next",e);break;case t.ui.keyCode.HOME:case t.ui.keyCode.PAGE_UP:this._move("first",e);break;case t.ui.keyCode.END:case t.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),i=!1}i&&e.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;return t===!1?(this.button.css("width",""),void 0):(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t),void 0)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(e){var i=this,s=[];e.each(function(e,n){s.push(i._parseOption(t(n),e))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1
12
- },_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle"),o="<span tabindex='0'></span>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===e.range||"max"===e.range)&&this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,h,l,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),h=o.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-o.width()/2,top:e.pageY-h.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n,o=this.value(),a=this.values();this._hasMultipleValues()&&(n=this.values(e?0:1),o=this.values(e),2===this.options.values.length&&this.options.range===!0&&(i=0===e?Math.min(n,i):Math.max(n,i)),a[e]=i),i!==o&&(s=this._trigger("slide",t,this._uiHash(e,i,a)),s!==!1&&(this._hasMultipleValues()?this.values(e,i):this.value(i)))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),void 0;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),this._super(e,i),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=n-1;s>=0;s--)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,s=Math.round((t-e)/i)*i;t=s+e,t>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,c={};this._hasMultipleValues()?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},r.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},r.animate))},_handleEvents:{keydown:function(e){var i,s,n,o,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),i=this._start(e,a),i===!1))return}switch(o=this.options.step,s=n=this._hasMultipleValues()?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(e,a,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td>&#160;</td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,h,l,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[a],l=!1,e[u]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(e[u]-h)&&(n=Math.abs(e[u]-h),o=this.items[s],this.direction=l?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;
13
- this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);null!=n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var e=this.element[0]===t.ui.safeActiveElement(this.document[0]);e||(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i,s,n;return"culture"===t||"numberFormat"===t?(i=this._parse(this.element.val()),this.options[t]=e,this.element.val(this._format(i)),void 0):(("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(s=this.buttons.first().find(".ui-icon"),this._removeClass(s,null,this.options.icons.up),this._addClass(s,null,e.up),n=this.buttons.last().find(".ui-icon"),this._removeClass(n,null,this.options.icons.down),this._addClass(n,null,e.down)),this._super(t,e),void 0)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:r(function(t){this._super(t)}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null===t?!1:t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:r(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:r(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:r(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(r(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),t.uiBackCompat!==!1&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),t.ui.spinner,t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var t=/#.*$/;return function(e){var i,s;i=e.href.replace(t,""),s=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return e.hash.length>1&&i===s}}(),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===e&&(s&&this.tabs.each(function(i,n){return t(n).attr("aria-controls")===s?(e=i,!1):void 0}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1===e)&&(e=this.tabs.length?0:!1)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),-1===e&&(e=i?!1:0)),!i&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}e.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e),void 0)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(i,s){var n,o,a,r=t(s).uniqueId().attr("id"),h=t(s).closest("li"),l=h.attr("aria-controls");e._isLocal(s)?(n=s.hash,a=n.substring(1),o=e.element.find(e._sanitizeSelector(n))):(a=h.attr("aria-controls")||t({}).uniqueId()[0].id,n="#"+a,o=e.element.find(n),o.length||(o=e._createPanel(a),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":a,"aria-labelledby":r}),o.attr("aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,s,n;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),n=0;s=this.tabs[n];n++)i=t(s),e===!0||-1!==t.inArray(n,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===!0)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,h=r?t():this._getPanelForTab(o),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():o,newPanel:h};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){o._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;i!==!1&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(i!==!0){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var s=this,n=this.tabs.eq(e),o=n.find(".ui-tabs-anchor"),a=this._getPanelForTab(n),r={tab:n,panel:a},h=function(t,e){"abort"===e&&s.panels.stop(!1,!0),s._removeClass(n,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(n,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,n){setTimeout(function(){a.html(t),s._trigger("load",i,r),h(n,e)},1)}).fail(function(t,e){setTimeout(function(){h(t,e)},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),t.uiBackCompat!==!1&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),t.ui.tabs,t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s.element[0],e.close(n,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);return e.is("[title]")?e.data("ui-tooltip-title",e.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s||s.nodeType||s.jquery?this._open(e,t,s):(i=s.call(t[0],function(i){n._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}),i&&this._open(e,t,i),void 0)},_open:function(e,i,s){function n(t){l.of=t,a.is(":hidden")||a.position(l)}var o,a,r,h,l=t.extend({},this.options.position);if(s){if(o=this._find(i))return o.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),h=t("<div>").html(a.find(".ui-tooltip-content").html()),h.removeAttr("name").find("[name]").removeAttr("name"),h.removeAttr("id").find("[id]").removeAttr("id"),h.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(l.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(e){var i=t("<div>").attr("role","tooltip"),s=t("<div>").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip});
 
 
 
 
 
 
 
 
 
 
 
 
 
resources/wp-weglot-admin-css-rtl.css DELETED
@@ -1,195 +0,0 @@
1
- .wg-widget-option-form {
2
- width : 60%;
3
- display : inline-block;
4
- vertical-align : top;
5
- }
6
- .wginfobox {
7
- max-width : 36%;
8
- margin-right : 4%;
9
- display : inline-block;
10
- background-color : white;
11
- border : 1px solid #e0e0e0;
12
- -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
13
- -moz-box-sizing: border-box; /* Firefox, other Gecko */
14
- box-sizing: border-box; /* Opera/IE 8+ */
15
- vertical-align : top;
16
- }
17
- .wginfobox h3 {
18
- color : white;
19
- background-color : #24284C;
20
- padding : 20px;
21
- margin : 0px;
22
- font-size: 23px;
23
- line-height: 1.3;
24
- }
25
- .wginfobox div {
26
- padding : 15px;
27
- }
28
- .wg-editbtn {
29
- background: #e56b60;
30
- color: white;
31
- font-weight: bold;
32
- border-radius: 0px;
33
- border-bottom: 2px solid #B7564D;
34
- font-size: 18px!important;
35
- height: 37px!important;
36
- line-height: 34px!important;
37
- text-decoration : none;
38
- padding : 10px 15px;
39
- display : inline-block;
40
- }
41
- .wg-editbtn:hover {
42
- color : white;
43
- background: #E87A70;
44
- }
45
- .wg-editbtn p {
46
- font-size: 15px;
47
- }
48
- .preview-text {
49
- display: inline-block;
50
- font-weight: bold;
51
- font-size: 15px;
52
- margin-left: 40px;
53
- }
54
- .wg-widget-preview {
55
- /*border: 1px solid #e0e0e0;
56
- background-color: white;*/
57
- -webkit-box-sizing: border-box;
58
- -moz-box-sizing: border-box;
59
- box-sizing: border-box;
60
- padding: 10px;
61
- display: inline-block;
62
-
63
- }
64
- .wg-input-textarea,
65
- .wg-input-text {
66
- padding : 8px;
67
- vertical-align: middle;
68
- width: 300px;
69
- }
70
- .wp-admin .wg-input-select {
71
- padding : 8px;
72
- height : 37px;
73
- }
74
- .country-selector {
75
- z-Index : 100!important;
76
- }
77
- .wgbox-blur {
78
- position: fixed;
79
- top: 0;
80
- right: 0;
81
- display: inline-block;
82
- width: 100%;
83
- height: 100%;
84
- background-color: rgba(0,0,0,0.85);
85
- text-align: center;
86
- z-index: 200;
87
- }
88
- .wgbox {
89
- display: inline-block;
90
- max-width: 550px;
91
- background-color: white;
92
- margin-top: 100px;
93
- padding: 25px;
94
- }
95
- .wgbox-title {
96
- font-size: 24px;
97
- line-height: 1.3;
98
- }
99
- .wgbox-text {
100
- font-size: 18px;
101
- }
102
- .wgbox-button {
103
-
104
- }
105
- .wgclose-btn {
106
- float : left;
107
- cursor : pointer;
108
- position : relative;
109
- top:-10px;
110
- }
111
- .wgclose-btn:hover {
112
- color : #707070;
113
- text-decoration:underline;
114
- }
115
- .wgbox-subtext {
116
- font-size : 14px;
117
- }
118
- .wg-fsubtext {
119
- font-size: 12px!important;
120
- font-style: italic;
121
- margin: 5px;
122
- }
123
- .wg-suberror {
124
- color : red;
125
- font-size: 12px!important;
126
- margin: 5px;
127
- }
128
- .wg-nokkey:before {
129
- content:'\274C';
130
- display:inline-block;
131
- color:red;
132
- padding:0 0 0 6px;
133
- font-size: 15px;
134
- padding:0 10px;
135
- }
136
- .wg-okkey:before {
137
- content: '\2713';
138
- display: inline-block;
139
- color: green;
140
- padding: 0 10px;
141
- font-size: 20px;
142
- font-weight: bold;
143
- padding:0 10px;
144
- }
145
- .wg-status-box {
146
- margin: 50px 0;
147
-
148
- }
149
- .wg-status-box h3 {
150
- color : #E87A70;
151
- }
152
- .wg-status-box h3:before {
153
- content: '\26A0';
154
- display: inline-block;
155
- font-size: 31px;
156
- margin: 5px 0 0 9px;
157
- vertical-align: bottom;
158
- }
159
- .wg-widget-preview a {
160
- color : black;
161
- }
162
- .flag-style-openclose {
163
- display: inline-block;
164
- font-size: 12px;
165
- color: #51C7A7;
166
- text-decoration: underline;
167
- cursor: default;
168
- margin-right: 20px;
169
- }
170
- .flag-style-openclose:hover{
171
- opacity : 0.6;
172
- }
173
- .flag-style-wrapper {
174
- padding : 15px 0px;
175
- }
176
- .flag-style-wrapper p {
177
- font-size : 12px!important;
178
- }
179
- .flag-style-wrapper select {
180
- padding : 3px!important;
181
- font-size : 12px;
182
- }
183
-
184
- ::-webkit-input-placeholder {
185
- color: #b0b0b0;
186
- }
187
- :-moz-placeholder { /* Firefox 18- */
188
- color: #b0b0b0;
189
- }
190
- ::-moz-placeholder { /* Firefox 19+ */
191
- color: #b0b0b0;
192
- }
193
- :-ms-input-placeholder {
194
- color: #b0b0b0;
195
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
resources/wp-weglot-admin-css.css DELETED
@@ -1,203 +0,0 @@
1
- .hidden-option{
2
- display:none;
3
- }
4
- .wg-widget-option-form {
5
- width : 60%;
6
- display : inline-block;
7
- vertical-align : top;
8
- }
9
- .wginfobox {
10
- max-width : 36%;
11
- margin-left : 4%;
12
- display : inline-block;
13
- background-color : white;
14
- border : 1px solid #e0e0e0;
15
- -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
16
- -moz-box-sizing: border-box; /* Firefox, other Gecko */
17
- box-sizing: border-box; /* Opera/IE 8+ */
18
- vertical-align : top;
19
- }
20
- .wginfobox h3 {
21
- color : white;
22
- background-color : #24284C;
23
- padding : 20px;
24
- margin : 0px;
25
- font-size: 23px;
26
- line-height: 1.3;
27
- }
28
- .wginfobox div {
29
- padding : 15px;
30
- }
31
- .wg-editbtn {
32
- background: #e56b60;
33
- color: white;
34
- font-weight: bold;
35
- border-radius: 0px;
36
- border-bottom: 2px solid #B7564D;
37
- font-size: 18px!important;
38
- height: 37px!important;
39
- line-height: 34px!important;
40
- text-decoration : none;
41
- padding : 10px 15px;
42
- display : inline-block;
43
- }
44
- .wg-editbtn:hover {
45
- color : white;
46
- background: #E87A70;
47
- }
48
- .wg-editbtn p {
49
- font-size: 15px;
50
- }
51
- .preview-text {
52
- display: inline-block;
53
- font-weight: bold;
54
- font-size: 15px;
55
- margin-right: 40px;
56
- }
57
- .wg-widget-preview {
58
- /*border: 1px solid #e0e0e0;
59
- background-color: white;*/
60
- -webkit-box-sizing: border-box;
61
- -moz-box-sizing: border-box;
62
- box-sizing: border-box;
63
- padding: 10px;
64
- display: inline-block;
65
-
66
- }
67
- .wg-input-textarea,
68
- .wg-input-text {
69
- padding : 8px;
70
- vertical-align: middle;
71
- width: 300px;
72
- }
73
- .wp-admin .wg-input-select {
74
- padding : 8px;
75
- height : 37px;
76
- }
77
- .country-selector {
78
- z-Index : 9!important;
79
- }
80
- .wgbox-blur {
81
- position: fixed;
82
- top: 0;
83
- left: 0;
84
- display: inline-block;
85
- width: 100%;
86
- height: 100%;
87
- background-color: rgba(0,0,0,0.85);
88
- text-align: center;
89
- z-index: 200;
90
- }
91
- .wgbox {
92
- display: inline-block;
93
- max-width: 550px;
94
- background-color: white;
95
- margin-top: 100px;
96
- padding: 25px;
97
- }
98
- .wgbox-title {
99
- font-size: 24px;
100
- line-height: 1.3;
101
- }
102
- .wgbox-text {
103
- font-size: 18px;
104
- }
105
- .wgbox-button {
106
-
107
- }
108
- .wgclose-btn {
109
- float : right;
110
- cursor : pointer;
111
- position : relative;
112
- top:-10px;
113
- }
114
- .wgclose-btn:hover {
115
- color : #707070;
116
- text-decoration:underline;
117
- }
118
- .wgbox-subtext {
119
- font-size : 14px;
120
- }
121
- .wg-fsubtext {
122
- font-size: 12px!important;
123
- font-style: italic;
124
- margin: 5px;
125
- }
126
- .wg-suberror {
127
- color : red;
128
- font-size: 12px!important;
129
- margin: 5px;
130
- }
131
- .wg-nokkey:before {
132
- content:'\274C';
133
- display:inline-block;
134
- color:red;
135
- padding:0 6px 0 0;
136
- font-size: 15px;
137
- padding:0 10px;
138
- }
139
- .wg-okkey:before {
140
- content: '\2713';
141
- display: inline-block;
142
- color: green;
143
- padding: 0 10px;
144
- font-size: 20px;
145
- font-weight: bold;
146
- padding:0 10px;
147
- }
148
- .wg-status-box {
149
- margin: 50px 0;
150
-
151
- }
152
- .wg-status-box h3 {
153
- color : #E87A70;
154
- }
155
- .wg-status-box h3:before {
156
- content: '\26A0';
157
- display: inline-block;
158
- font-size: 31px;
159
- margin: 5px 9px 0 0;
160
- vertical-align: bottom;
161
- }
162
- .wg-widget-preview a {
163
- color : black;
164
- }
165
- .flag-style-openclose {
166
- display: inline-block;
167
- font-size: 12px;
168
- color: #51C7A7;
169
- text-decoration: underline;
170
- cursor: default;
171
- margin-left: 20px;
172
- }
173
- .flag-style-openclose:hover{
174
- opacity : 0.6;
175
- }
176
- .flag-style-wrapper {
177
- padding : 15px 0px;
178
- }
179
- .flag-style-wrapper p {
180
- font-size : 12px!important;
181
- }
182
- .flag-style-wrapper select {
183
- padding : 3px!important;
184
- font-size : 12px;
185
- }
186
-
187
- ::-webkit-input-placeholder {
188
- color: #b0b0b0;
189
- }
190
- :-moz-placeholder { /* Firefox 18- */
191
- color: #b0b0b0;
192
- }
193
- ::-moz-placeholder { /* Firefox 19+ */
194
- color: #b0b0b0;
195
- }
196
- :-ms-input-placeholder {
197
- color: #b0b0b0;
198
- }
199
- #submit {
200
- height: 50px;
201
- padding: 0 30px!important;
202
- font-size: 16px;
203
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
resources/wp-weglot-admin-js.js DELETED
@@ -1,455 +0,0 @@
1
- jQuery(
2
- function($) {
3
-
4
- generateWGWidgetCode();
5
- $( "select[name=original_l]" ).change(
6
- function() {
7
- generateWGWidgetCode();
8
- }
9
- );
10
- $( "select[name=type_flags]" ).change(
11
- function() {
12
- generateWGWidgetCode();
13
- }
14
- );
15
- $( "input[name=destination_l]" ).blur(
16
- function() {
17
- generateWGWidgetCode();
18
- }
19
- );
20
- $( 'input[name=with_flags]' ).change(
21
- function() {
22
- generateWGWidgetCode();
23
- }
24
- );
25
- $( 'input[name=with_name]' ).change(
26
- function() {
27
- generateWGWidgetCode();
28
- }
29
- );
30
- $( 'input[name=is_dropdown]' ).change(
31
- function() {
32
- generateWGWidgetCode();
33
- }
34
- );
35
- $( 'input[name=is_fullname]' ).change(
36
- function() {
37
- generateWGWidgetCode();
38
- }
39
- );
40
- $( 'input[name=is_menu]' ).change(
41
- function() {
42
- if (this.checked) {
43
- $( 'input[name=is_dropdown]' ).prop( 'checked', false );
44
- generateWGWidgetCode();
45
- }
46
- }
47
- );
48
- $( 'textarea[name=override_css]' ).blur(
49
- function() {
50
- var style_value = $( this ).val();
51
- if (style_value != "") {
52
- var style = $( '<style wgstyle>' + $( this ).val() + '</style>' );
53
- $( 'style[wgstyle]' ).remove();
54
- $( 'html > body' ).append( style );
55
- generateWGWidgetCode();
56
- } else {
57
- $( 'style[wgstyle]' ).remove();
58
- }
59
- }
60
- );
61
-
62
- $( "select.flag-en-type, select.flag-es-type, select.flag-pt-type, select.flag-fr-type, select.flag-ar-type" ).change(
63
- function() {
64
- refreshFlagCSS();
65
- generateWGWidgetCode();
66
- }
67
- );
68
-
69
- $( '.wgclose-btn' ).click(
70
- function() {
71
- $( '.wgbox-blur' ).hide();
72
- }
73
- );
74
- $( '.flag-style-openclose' ).click(
75
- function() {
76
- $( '.flag-style-wrapper' ).toggle();
77
- }
78
- );
79
- $( 'input[name=project_key]' ).blur(
80
- function() {
81
- var key = $( this ).val();
82
- $.getJSON(
83
- "https://weglot.com/api/user-info?api_key=" + key, function( data ) {
84
- $( '.wg-keyres' ).remove();
85
- $( 'input[name=project_key]' ).after( '<span class="wg-keyres wg-okkey"></span>' );
86
- $( '.wg-widget-option-form input[type=submit]' ).prop( 'disabled', false );
87
- }
88
- ).fail(
89
- function() {
90
- $( '.wg-keyres' ).remove();
91
- $( 'input[name=project_key]' ).after( '<span class="wg-keyres wg-nokkey"></span>' )
92
- $( '.wg-widget-option-form input[type=submit]' ).prop( 'disabled', true );
93
- }
94
- );
95
- }
96
- );
97
- function generateWGWidgetCode() {
98
- var original = $( "select[name=original_l]" ).val();
99
- var destination = $( "input[name=destination_l]" ).val();
100
- var dests = destination.split( ',' );
101
- var list = '';
102
-
103
- var flag_class = "";
104
- if ($( 'input[name=with_flags]' ).is( ':checked' )) {
105
- flag_class += "wg-flags ";
106
- flag_class += ($( "select[name=type_flags]" ).val() == "0") ? "" : "flag-" + $( "select[name=type_flags]" ).val() + " ";
107
- }
108
-
109
- if (destination.length > 1) {
110
- list += '<ul>';
111
- for (var i = 0;i < dests.length;i++) {
112
- var d = dests[i];
113
- var l_name = $( 'input[name=with_name]' ).is( ':checked' ) ? ($( 'input[name=is_fullname]' ).is( ':checked' ) ? getLangNameFromCode( d,false ) : d.toUpperCase()) : "";
114
- list += '<li class="wg-li ' + flag_class + d + '"><a href="#">' + l_name + '</a></li>';
115
- }
116
- list += '</ul>';
117
- }
118
-
119
- var current_name = $( 'input[name=with_name]' ).is( ':checked' ) ? ($( 'input[name=is_fullname]' ).is( ':checked' ) ? getLangNameFromCode( original,false ) : original.toUpperCase()) : "";
120
-
121
- if ($( 'input[name=is_dropdown]' ).is( ':checked' )) {
122
- var opt_class = "wg-drop";
123
- } else {
124
- var opt_class = "wg-list";
125
- }
126
-
127
- var style = $( '<style wgstyle1>' + $( 'textarea[name=flag_css]' ).text() + '</style>' );
128
- $( 'style[wgstyle1]' ).remove();
129
- $( 'html > body' ).append( style );
130
-
131
- var button = '<aside id="weglot_switcher" wg-notranslate class="' + opt_class + ' country-selector closed" onclick="openClose(this);"><div class="wgcurrent wg-li ' + flag_class + original + '"><a href="javascript:void(0);">' + current_name + '</a></div>' + list + '</aside>';
132
- $( ".wg-widget-preview" ).html( button );
133
- }
134
-
135
- function updateDestInput() {
136
-
137
- var l = $( "#select-lto" ).val();
138
- if (l) {
139
- $( "#destination_input_hidden" ).val( l.join( ',' ) );
140
- } else {
141
- $( "#destination_input_hidden" ).val( "" );
142
- }
143
- }
144
-
145
- function refreshFlagCSS() {
146
- var en_flags = new Array();
147
- var es_flags = new Array();
148
- var pt_flags = new Array();
149
- var fr_flags = new Array();
150
- var ar_flags = new Array();
151
-
152
- en_flags[1] = [3570,7841,48,2712];
153
- en_flags[2] = [3720,449,3048,4440];
154
- en_flags[3] = [3840,1281,2712,4224];
155
- en_flags[4] = [3240,5217,1224,2112];
156
- en_flags[5] = [4050,3585,1944,2496];
157
- en_flags[6] = [2340,3457,2016,2016];
158
-
159
- es_flags[1] = [4320,4641,3144,3552];
160
- es_flags[2] = [3750,353,2880,4656];
161
- es_flags[3] = [4200,1601,2568,3192];
162
- es_flags[4] = [3990,5793,1032,2232];
163
- es_flags[5] = [5460,897,4104,3120];
164
- es_flags[6] = [3810,7905,216,3888];
165
- es_flags[7] = [3630,8065,192,2376];
166
- es_flags[8] = [3780,1473,2496,4104];
167
- es_flags[9] = [6120,2145,4680,2568];
168
- es_flags[10] = [4440,3009,3240,1176];
169
- es_flags[11] = [5280,1825,3936,2976];
170
- es_flags[12] = [4770,2081,3624,1008];
171
- es_flags[13] = [4080,3201,2160,2544];
172
- es_flags[14] = [4590,5761,3432,624];
173
- es_flags[15] = [4350,2209,3360,2688];
174
- es_flags[16] = [5610,5249,3168,528];
175
- es_flags[17] = [5070,1729,3792,2952];
176
- es_flags[18] = [6870,5953,96,3408];
177
- es_flags[19] = [4020,5697,1056,1224];
178
-
179
- pt_flags[1] = [1740,5921,528,3504];
180
-
181
- fr_flags[1] = [2760,736,2856,4416];
182
- fr_flags[2] = [3840,1280,2712,4224];
183
- fr_flags[3] = [5700,7201,5016,2400];
184
- fr_flags[4] = [2220,4160,1632,1944];
185
-
186
- ar_flags[1] = [1830,129,3096,5664];
187
- ar_flags[2] = [5100,2177,3840,2904];
188
- ar_flags[3] = [4890,3425,3648,2136];
189
- ar_flags[4] = [1320,3681,1896,4080];
190
- ar_flags[5] = [1260,3841,1824,1200];
191
- ar_flags[6] = [1020,3969,1608,312];
192
- ar_flags[7] = [4800,4065,3600,72];
193
- ar_flags[8] = [4710,4865,3504,480];
194
- ar_flags[9] = [6720,5984,5112,3792];
195
- ar_flags[10] = [4500,7233,3288,1800];
196
- ar_flags[11] = [720,7522,384,3936];
197
- ar_flags[12] = [690,7745,336,1104];
198
- ar_flags[13] = [600,8225,120,1272];
199
- ar_flags[14] = [660,5569,840,576];
200
-
201
- var enval = $( "select.flag-en-type" ).val();
202
- var esval = $( "select.flag-es-type" ).val();
203
- var ptval = $( "select.flag-pt-type" ).val();
204
- var frval = $( "select.flag-fr-type" ).val();
205
- var arval = $( "select.flag-ar-type" ).val();
206
-
207
- var en_style = enval <= 0 ? "" : ".wg-li.en a:before { background-position: -" + en_flags[enval][0] + "px 0; } .wg-li.flag-1.en a:before { background-position: -" + en_flags[enval][1] + "px 0; } .wg-li.flag-2.en a:before { background-position: -" + en_flags[enval][2] + "px 0; } .wg-li.flag-3.en a:before { background-position: -" + en_flags[enval][3] + "px 0; } ";
208
- var es_style = esval <= 0 ? "" : ".wg-li.es a:before { background-position: -" + es_flags[esval][0] + "px 0; } .wg-li.flag-1.es a:before { background-position: -" + es_flags[esval][1] + "px 0; } .wg-li.flag-2.es a:before { background-position: -" + es_flags[esval][2] + "px 0; } .wg-li.flag-3.es a:before { background-position: -" + es_flags[esval][3] + "px 0; } ";
209
- var pt_style = ptval <= 0 ? "" : ".wg-li.pt a:before { background-position: -" + pt_flags[ptval][0] + "px 0; } .wg-li.flag-1.pt a:before { background-position: -" + pt_flags[ptval][1] + "px 0; } .wg-li.flag-2.pt a:before { background-position: -" + pt_flags[ptval][2] + "px 0; } .wg-li.flag-3.pt a:before { background-position: -" + pt_flags[ptval][3] + "px 0; } ";
210
- var fr_style = frval <= 0 ? "" : ".wg-li.fr a:before { background-position: -" + fr_flags[frval][0] + "px 0; } .wg-li.flag-1.fr a:before { background-position: -" + fr_flags[frval][1] + "px 0; } .wg-li.flag-2.fr a:before { background-position: -" + fr_flags[frval][2] + "px 0; } .wg-li.flag-3.fr a:before { background-position: -" + fr_flags[frval][3] + "px 0; } ";
211
- var ar_style = arval <= 0 ? "" : ".wg-li.ar a:before { background-position: -" + ar_flags[arval][0] + "px 0; } .wg-li.flag-1.ar a:before { background-position: -" + ar_flags[arval][1] + "px 0; } .wg-li.flag-2.ar a:before { background-position: -" + ar_flags[arval][2] + "px 0; } .wg-li.flag-3.ar a:before { background-position: -" + ar_flags[arval][3] + "px 0; } ";
212
-
213
- $( 'textarea[name=flag_css]' ).text( en_style + es_style + pt_style + fr_style + ar_style );
214
- }
215
- function getLangNameFromCode (original,english) {
216
- switch (original) {
217
- case "af":
218
- return english ? "Afrikaans" : "Afrikaans";
219
- case "sq":
220
- return english ? "Albanian" : "Shqip";
221
- case "am":
222
- return english ? "Amharic" : "አማርኛ";
223
- case "ar":
224
- return english ? "Arabic" : "‏العربية‏";
225
- case "hy":
226
- return english ? "Armenian" : "հայերեն";
227
- case "az":
228
- return english ? "Azerbaijani" : "Azərbaycan dili";
229
- case "ba":
230
- return english ? "Bashkir" : "башҡорт теле";
231
- case "eu":
232
- return english ? "Basque" : "Euskara";
233
- case "be":
234
- return english ? "Belarusian" : "Беларуская";
235
- case "bn":
236
- return english ? "Bengali" : "বাংলা";
237
- case "bs":
238
- return english ? "Bosnian" : "Bosanski";
239
- case "bg":
240
- return english ? "Bulgarian" : "български";
241
- case "my":
242
- return english ? "Burmese" : "မြန်မာ";
243
- case "ca":
244
- return english ? "Catalan" : "Català";
245
- case "km":
246
- return english ? "Khmer" : "ភាសាខ្មែរ";
247
- case "ny":
248
- return english ? "Chichewa" : "Chicheŵa";
249
- case "co":
250
- return english ? "Corsican" : "Corsu";
251
- case "zh":
252
- return english ? "Simplified Chinese" : "中文 (简体)";
253
- case "tw":
254
- return english ? "Traditional Chinese" : "中文 (繁體)";
255
- case "hr":
256
- return english ? "Croatian" : "Hrvatski";
257
- case "cs":
258
- return english ? "Czech" : "Čeština";
259
- case "da":
260
- return english ? "Danish" : "Dansk";
261
- case "nl":
262
- return english ? "Dutch" : "Nederlands";
263
- case "en":
264
- return english ? "English" : "English";
265
- case "eo":
266
- return english ? "Esperanto" : "Esperanto";
267
- case "et":
268
- return english ? "Estonian" : "Eesti";
269
- case "fj":
270
- return english ? "Fijian" : "Fidžin";
271
- case "fl":
272
- return english ? "Filipino" : "Filipino";
273
- case "fi":
274
- return english ? "Finnish" : "Suomi";
275
- case "fr":
276
- return english ? "French" : "Français";
277
- case "gl":
278
- return english ? "Galician" : "Galego";
279
- case "ka":
280
- return english ? "Georgian" : "ქართული";
281
- case "de":
282
- return english ? "German" : "Deutsch";
283
- case "el":
284
- return english ? "Greek" : "Ελληνικά";
285
- case "gu":
286
- return english ? "Gujarati" : "ગુજરાતી";
287
- case "ht":
288
- return english ? "Haitian" : "Kreyòl ayisyen";
289
- case "ha":
290
- return english ? "Hausa" : "Hausa";
291
- case "hw":
292
- return english ? "Hawaiann" : "Hawaiann";
293
- case "he":
294
- return english ? "Hebrew" : "עברית";
295
- case "hi":
296
- return english ? "Hindi" : "हिंदी";
297
- case "hu":
298
- return english ? "Hungarian" : "Magyar";
299
- case "is":
300
- return english ? "Icelandic" : "Íslenska";
301
- case "ig":
302
- return english ? "Igbo" : "Igbo";
303
- case "id":
304
- return english ? "Indonesian" : "Bahasa Indonesia";
305
- case "ga":
306
- return english ? "Irish" : "Gaeilge";
307
- case "it":
308
- return english ? "Italian" : "Italiano";
309
- case "ja":
310
- return english ? "Japanese" : "日本語";
311
- case "jv":
312
- return english ? "Javanese" : "baṣa Jawa";
313
- case "kn":
314
- return english ? "Kannada" : "ಕನ್ನಡ";
315
- case "kk":
316
- return english ? "Kazakh" : "Қазақша";
317
- case "ko":
318
- return english ? "Korean" : "한국어";
319
- case "ku":
320
- return english ? "Kurdish" : "Kurdí";
321
- case "ky":
322
- return english ? "Kyrgyz" : "кыргызча";
323
- case "lo":
324
- return english ? "Lao" : "ລາວ";
325
- case "la":
326
- return english ? "Latin" : "Latine";
327
- case "lv":
328
- return english ? "Latvian" : "Latviešu";
329
- case "lt":
330
- return english ? "Lithuanian" : "Lietuvių";
331
- case "lb":
332
- return english ? "Luxembourgish" : "Lëtzebuergesch";
333
- case "mk":
334
- return english ? "Macedonian" : "Македонски";
335
- case "mg":
336
- return english ? "Malagasy" : "Malagasy";
337
- case "ms":
338
- return english ? "Malay" : "Bahasa Melayu";
339
- case "ml":
340
- return english ? "Malayalam" : "മലയാളം";
341
- case "mt":
342
- return english ? "Maltese" : "Malti";
343
- case "mi":
344
- return english ? "Māori" : "Māori";
345
- case "mr":
346
- return english ? "Marathi" : "मराठी";
347
- case "mn":
348
- return english ? "Mongolian" : "Монгол";
349
- case "ne":
350
- return english ? "Nepali" : "नेपाली";
351
- case "no":
352
- return english ? "Norwegian" : "Norsk";
353
- case "ps":
354
- return english ? "Pashto" : "پښتو";
355
- case "fa":
356
- return english ? "Persian" : "فارسی";
357
- case "pl":
358
- return english ? "Polish" : "Polski";
359
- case "pt":
360
- return english ? "Portuguese" : "Português";
361
- case "pa":
362
- return english ? "Punjabi" : "ਪੰਜਾਬੀ";
363
- case "ro":
364
- return english ? "Romanian" : "Română";
365
- case "ru":
366
- return english ? "Russian" : "Русский";
367
- case "sm":
368
- return english ? "Samoan" : "Samoa";
369
- case "gd":
370
- return english ? "Scottish Gaelic" : "Gàidhlig na h-Alba";
371
- case "sr":
372
- return english ? "Serbian" : "Српски";
373
- case "sn":
374
- return english ? "Shona" : "chiShona";
375
- case "sd":
376
- return english ? "Sindhi" : "سنڌي";
377
- case "si":
378
- return english ? "Sinhalese" : "සිංහල";
379
- case "sk":
380
- return english ? "Slovak" : "Slovenčina";
381
- case "sl":
382
- return english ? "Slovenian" : "Slovenščina";
383
- case "so":
384
- return english ? "Somali" : "af Soomaali";
385
- case "st":
386
- return english ? "Southern Sotho" : "seSotho";
387
- case "es":
388
- return english ? "Spanish" : "Español";
389
- case "su":
390
- return english ? "Sundanese" : "Sunda";
391
- case "sw":
392
- return english ? "Swahili" : "Kiswahili";
393
- case "sv":
394
- return english ? "Swedish" : "Svenska";
395
- case "tl":
396
- return english ? "Tagalog" : "Tagalog";
397
- case "ty":
398
- return english ? "Tahitian" : "Tahitian";
399
- case "tg":
400
- return english ? "Tajik" : "Тоҷикӣ";
401
- case "ta":
402
- return english ? "Tamil" : "தமிழ்";
403
- case "tt":
404
- return english ? "Tatar" : "Tatar";
405
- case "te":
406
- return english ? "Telugu" : "తెలుగు";
407
- case "th":
408
- return english ? "Thai" : "ภาษาไทย";
409
- case "to":
410
- return english ? "Tongan" : "Tonga";
411
- case "tr":
412
- return english ? "Turkish" : "Türkçe";
413
- case "uk":
414
- return english ? "Ukrainian" : "Українська";
415
- case "ur":
416
- return english ? "Urdu" : "اردو";
417
- case "uz":
418
- return english ? "Uzbek" : "O'zbek";
419
- case "vi":
420
- return english ? "Vietnamese" : "Tiếng Việt";
421
- case "cy":
422
- return english ? "Welsh" : "Cymraeg";
423
- case "fy": //t
424
- return english ? "Western Frisian" : "Frysk";
425
- case "xh": //t
426
- return english ? "Xhosa" : "isiXhosa";
427
- case "yi": //t
428
- return english ? "Yiddish" : "ײִדיש";
429
- case "yo": //t
430
- return english ? "Yoruba" : "Yorùbá";
431
- case "zu": //t
432
- return english ? "Zulu" : "isiZulu";
433
- }
434
- }
435
-
436
- $selectL = $( '#select-lto' ).selectize(
437
- {
438
- plugins: ['remove_button', 'drag_drop'],
439
- onChange: function () {
440
- updateDestInput();
441
- setTimeout( function(){ generateWGWidgetCode(); }, 1 );
442
- },
443
- onDropdownOpen: function () {
444
- $( ".selectize-dropdown-content .option" ).show();
445
- var original = $( "select[name=original_l]" ).val();
446
- if (original) {
447
- $( ".selectize-dropdown-content .option[data-value='" + original + "']" ).hide()
448
- }
449
- }
450
- }
451
- );
452
- $selectL = $selectL[0].selectize;
453
-
454
- }
455
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
resources/wp-weglot-css.css DELETED
@@ -1,635 +0,0 @@
1
- /* STYLE OF WIDGET */
2
- .country-selector {
3
- z-Index : 9999;
4
- text-align: left;
5
- position: relative;
6
- display : inline-block;
7
- width: auto;
8
- }
9
- .wg-drop.country-selector {
10
- background-color : white;
11
- }
12
- .country-selector a {
13
- padding: 0 10px;
14
- outline : none;
15
- text-decoration: none;
16
- float: none!important;
17
- white-space: nowrap;
18
-
19
- }
20
- .country-selector a:focus {
21
- outline : none;
22
- }
23
- .wg-drop.country-selector a {
24
- display: block;
25
- height: 37px;
26
- line-height: 36px;
27
- color : black;
28
- font-size: 13px;
29
- padding : 0 10px;
30
- }
31
- .wg-drop.country-selector :not(.wgcurrent) a {
32
- width : 100%;
33
- -webkit-box-sizing: border-box;
34
- -moz-box-sizing: border-box;
35
- box-sizing: border-box;
36
- }
37
- .wg-list.country-selector a:hover {
38
- text-decoration : underline;
39
- color : #00a0d2;
40
- }
41
-
42
- .wg-default {
43
- position : fixed;
44
- bottom : 0px;
45
- right : 40px;
46
- }
47
- .wg-default.wg-list {
48
- margin-bottom : 7px;
49
- }
50
- .wg-default.wg-list a {
51
- color : black;
52
- }
53
- .wg-drop.country-selector .wgcurrent a{
54
- padding-right: 60px;
55
- }
56
- .wg-list.country-selector .wgcurrent a{
57
- text-decoration: underline;
58
- }
59
- .wg-list.country-selector .wgcurrent{
60
- display : inline-block;
61
- vertical-align: middle;
62
- }
63
-
64
- .country-selector ul {
65
- padding: 0px;
66
- z-index: 1010;
67
- list-style: none;
68
- margin: 0;
69
- }
70
- .wg-drop.country-selector .wgcurrent {
71
- border: 1px solid #e0e0e0;
72
- list-style: none;
73
- }
74
- .wg-drop.country-selector ul {
75
- position: absolute;
76
- min-width: 100%;
77
- border: 1px solid #ebeef0;
78
- background: white ;
79
- left : 0;
80
- top : initial;
81
- -webkit-box-sizing: border-box;
82
- -moz-box-sizing: border-box;
83
- box-sizing: border-box;
84
- }
85
- .wg-drop.country-selector:not(.closed) ul {
86
- display:block;
87
- background-color: white;
88
- max-height: 300px;
89
- overflow-y: auto;
90
- }
91
-
92
- .country-selector li {
93
- margin : 0px;
94
- padding : 0px;
95
- }
96
- .wg-list.country-selector li {
97
- display : inline-block;
98
- margin: 2px 0px;
99
- vertical-align: middle;
100
- }
101
- .wg-drop.country-selector li {
102
- width : 100%;
103
- }
104
-
105
- .wg-drop.country-selector .wgcurrent:after {
106
- display: inline-block;
107
- position: absolute;
108
- top: 17px;
109
- right: 8px;
110
- width: 13px;
111
- height: 7px;
112
- image-rendering: pixelated;
113
- background-image : url('../images/wgarrowdown.png');
114
- background-repeat : no-repeat;
115
- content: '';
116
- -webkit-transition: all 200ms;
117
- -moz-transition: all 200ms;
118
- -ms-transition: all 200ms;
119
- -o-transition: all 200ms;
120
- transition: all 200ms;
121
- }
122
-
123
- .wg-list.country-selector ul {
124
- display: inline-block;
125
- vertical-align: middle;
126
- }
127
-
128
- .wg-drop.country-selector.closed ul {
129
- display: none;
130
- }
131
- .wg-drop.country-selector.closed .wgcurrent:after {
132
- -webkit-transform: rotate(-90deg);
133
- -moz-transform: rotate(-90deg);
134
- -ms-transform: rotate(-90deg);
135
- -o-transform: rotate(-90deg);
136
- transform: rotate(-90deg);
137
- }
138
- .wg-drop.weg-openup ul {
139
- bottom : 38px;
140
- }
141
- .wg-drop.weg-openup .wgcurrent:after {
142
- -webkit-transform: rotate(-180deg);
143
- -moz-transform: rotate(-180deg);
144
- -ms-transform: rotate(-180deg);
145
- -o-transform: rotate(-180deg);
146
- transform: rotate(-180deg);
147
- }
148
-
149
- .wg-drop.country-selector:not(.closed) a:hover {
150
- color: #1ba0e3;
151
- }
152
-
153
-
154
- .wg-flags a:before {
155
- content: "";
156
- vertical-align: middle;
157
- margin-right: 10px;
158
- margin-top: -1px;
159
- display: inline-block;
160
- overflow: hidden;
161
- }
162
-
163
- /* flags style */
164
- .wg-flags a:before {
165
- background-image: url(../images/rect_mate.png);
166
- background-size: auto 100%;
167
- border-radius: 0px;
168
- width: 30px;
169
- height: 20px;
170
- }
171
-
172
- .wg-li.hw a:before { background-position: -3570px 0; }
173
- .wg-li.af a:before { background-position: -6570px 0; }
174
- .wg-li.fl a:before { background-position: -3060px 0px; }
175
- .wg-li.sq a:before { background-position: -2580px 0; }
176
- .wg-li.am a:before { background-position: -5130px 0; }
177
- .wg-li.ar a:before { background-position: -510px 0; }
178
- .wg-li.hy a:before { background-position: -1800px 0; }
179
- .wg-li.az a:before { background-position: -6840px 0; }
180
- .wg-li.ba a:before { background-position: -2040px 0; }
181
- .wg-li.eu a:before { background-position: -7260px 0; }
182
- .wg-li.be a:before { background-position: -5310px 0; }
183
- .wg-li.bn a:before { background-position: -5400px 0; }
184
- .wg-li.bs a:before { background-position: -6390px 0; }
185
- .wg-li.bg a:before { background-position: -2730px 0; }
186
- .wg-li.my a:before { background-position: -3299px 0; }
187
- .wg-li.ca a:before { background-position: -7230px 0; }
188
- .wg-li.zh a:before { background-position: -3690px 0; }
189
- .wg-li.tw a:before { background-position: -2970px 0; }
190
- .wg-li.km a:before { background-position: -6930px 0; }
191
- .wg-li.ny a:before { background-position: -1140px 0; }
192
- .wg-li.co a:before { background-position: -2520px 0; } /* a faire */
193
- .wg-li.hr a:before { background-position: -5910px 0; }
194
- .wg-li.cs a:before { background-position: -2700px 0; }
195
- .wg-li.da a:before { background-position: -2670px 0; }
196
- .wg-li.nl a:before { background-position: -2100px 0; }
197
- .wg-li.en a:before { background-position: -1920px 0; }
198
- .wg-li.eo a:before { background-position: -1920px 0; } /* a faire */
199
- .wg-li.et a:before { background-position: -2640px 0; }
200
- .wg-li.fj a:before { background-position: -1710px 0; }
201
- .wg-li.fi a:before { background-position: -2550px 0; }
202
- .wg-li.fr a:before { background-position: -2520px 0; }
203
- .wg-li.gl a:before { background-position: -480px 0; }
204
- .wg-li.ka a:before { background-position: -5040px 0; }
205
- .wg-li.de a:before { background-position: -2490px 0; }
206
- .wg-li.el a:before { background-position: -2460px 0; }
207
- .wg-li.gu a:before { background-position: -1170px 0; }
208
- .wg-li.ht a:before { background-position: -4650px 0; }
209
- .wg-li.ha a:before { background-position: -900px 0; }
210
- .wg-li.he a:before { background-position: -1050px 0; }
211
- .wg-li.hi a:before { background-position: -1170px 0; }
212
- .wg-li.hu a:before { background-position: -2430px 0; }
213
- .wg-li.is a:before { background-position: -2400px 0; }
214
- .wg-li.ig a:before { background-position: -870px 0; }
215
- .wg-li.id a:before { background-position: -3510px 0; }
216
- .wg-li.ga a:before { background-position: -2340px 0; }
217
- .wg-li.it a:before { background-position: -2310px 0; }
218
- .wg-li.ja a:before { background-position: -3480px 0; }
219
- .wg-li.jv a:before { background-position: -3360px 0; }
220
- .wg-li.kn a:before { background-position: -1170px 0; }
221
- .wg-li.kk a:before { background-position: -3150px 0; }
222
- .wg-li.ko a:before { background-position: -6990px 0; }
223
- .wg-li.ku a:before { background-position: -2430px 0; } /* a faire */
224
- .wg-li.ky a:before { background-position: -3420px 0; }
225
- .wg-li.lo a:before { background-position: -3450px 0; } /* a faire */
226
- .wg-li.la a:before { background-position: -2310px 0; }
227
- .wg-li.lv a:before { background-position: -2280px 0; }
228
- .wg-li.lt a:before { background-position: -2250px 0; }
229
- .wg-li.lb a:before { background-position: -2220px 0; }
230
- .wg-li.mk a:before { background-position: -2190px 0; }
231
- .wg-li.mg a:before { background-position: -1200px 0; }
232
- .wg-li.ms a:before { background-position: -3360px 0; }
233
- .wg-li.ml a:before { background-position: -1170px 0; }
234
- .wg-li.mt a:before { background-position: -2130px 0; }
235
- .wg-li.mi a:before { background-position: -3240px 0; }
236
- .wg-li.mr a:before { background-position: -1170px 0; }
237
- .wg-li.mn a:before { background-position: -6000px 0; }
238
- .wg-li.ne a:before { background-position: -3270px 0; }
239
- .wg-li.no a:before { background-position: -5850px 0; }
240
- .wg-li.ps a:before { background-position: -5189px 0; }
241
- .wg-li.fa a:before { background-position: -6690px 0; }
242
- .wg-li.pl a:before { background-position: -2160px 0; }
243
- .wg-li.pt a:before { background-position: -6630px 0; }
244
- .wg-li.pa a:before { background-position: -3180px 0; }
245
- .wg-li.ro a:before { background-position: -2070px 0; }
246
- .wg-li.ru a:before { background-position: -2040px 0; }
247
- .wg-li.sm a:before { background-position: -4620px 0; }
248
- .wg-li.gd a:before { background-position: -30px 0; }
249
- .wg-li.sr a:before { background-position: -4290px 0; }
250
- .wg-li.sn a:before { background-position: -540px 0; }
251
- .wg-li.sd a:before { background-position: -3180px 0; }
252
- .wg-li.si a:before { background-position: -2820px 0; }
253
- .wg-li.sk a:before { background-position: -6810px 0; }
254
- .wg-li.sl a:before { background-position: -2010px 0; }
255
- .wg-li.so a:before { background-position: -4560px 0; }
256
- .wg-li.st a:before { background-position: -4830px 0; }
257
- .wg-li.es a:before { background-position: -480px 0; }
258
- .wg-li.su a:before { background-position: -4530px 0; }
259
- .wg-li.sw a:before { background-position: -1290px 0; }
260
- .wg-li.sv a:before { background-position: -1980px 0; }
261
- .wg-li.tl a:before { background-position: -3060px 0; }
262
- .wg-li.ty a:before { background-position: -6270px 0; }
263
- .wg-li.tg a:before { background-position: -2940px 0; }
264
- .wg-li.ta a:before { background-position: -1170px 0; }
265
- .wg-li.tt a:before { background-position: -2040px 0; }
266
- .wg-li.te a:before { background-position: -1170px 0; }
267
- .wg-li.th a:before { background-position: -2910px 0; }
268
- .wg-li.to a:before { background-position: -6540px 0; }
269
- .wg-li.tr a:before { background-position: -1950px 0; }
270
- .wg-li.uk a:before { background-position: -1890px 0; }
271
- .wg-li.ur a:before { background-position: -3180px 0; }
272
- .wg-li.uz a:before { background-position: -2880px 0; }
273
- .wg-li.vi a:before { background-position: -2850px 0; }
274
- .wg-li.cy a:before { background-position: -6420px 0; }
275
- .wg-li.fy a:before { background-position: -2100px 0; }
276
- .wg-li.xh a:before { background-position: -6570px 0; }
277
- .wg-li.yi a:before { background-position: -1050px 0; }
278
- .wg-li.yo a:before { background-position: -870px 0; }
279
- .wg-li.zu a:before { background-position: -6570px 0; }
280
-
281
-
282
-
283
-
284
-
285
-
286
-
287
-
288
- .wg-flags.flag-1 a:before {
289
- background-image: url("../images/rect_bright.png");
290
- border-radius: 0px;
291
- width: 30px;
292
- height: 20px;
293
- }
294
-
295
- .wg-li.flag-1.hw a:before { background-position: -7840px 0; }
296
- .wg-li.flag-1.fl a:before { background-position: 2560px 0; }
297
- .wg-li.flag-1.af a:before { background-position: -6848px 0; }
298
- .wg-li.flag-1.sq a:before { background-position: -97px 0; }
299
- .wg-li.flag-1.am a:before { background-position: -2369px 0; }
300
- .wg-li.flag-1.ar a:before { background-position: -6465px 0; }
301
- .wg-li.flag-1.hy a:before { background-position: -385px 0; }
302
- .wg-li.flag-1.az a:before { background-position: -513px 0; }
303
- .wg-li.flag-1.ba a:before { background-position: -6113px 0; }
304
- .wg-li.flag-1.eu a:before { background-position: -8353px 0; }
305
- .wg-li.flag-1.be a:before { background-position: -705px 0; }
306
- .wg-li.flag-1.bn a:before { background-position: -609px 0; }
307
- .wg-li.flag-1.bs a:before { background-position: -929px 0; }
308
- .wg-li.flag-1.bg a:before { background-position: -1121px 0; }
309
- .wg-li.flag-1.my a:before { background-position: -4929px 0; }
310
- .wg-li.flag-1.ca a:before { background-position: -8321px 0; }
311
- .wg-li.flag-1.zh a:before { background-position: -1505px 0; }
312
- .wg-li.flag-1.tw a:before { background-position: -6369px 0; }
313
- .wg-li.flag-1.km a:before { background-position: -1217px 0; }
314
- .wg-li.flag-1.ny a:before { background-position: -4289px 0; }
315
- .wg-li.flag-1.co a:before { background-position: -2561px 0; }
316
- .wg-li.flag-1.hr a:before { background-position: -1793px 0; }
317
- .wg-li.flag-1.cs a:before { background-position: -1921px 0; }
318
- .wg-li.flag-1.da a:before { background-position: -1985px 0; }
319
- .wg-li.flag-1.nl a:before { background-position: -5121px 0; }
320
- .wg-li.flag-1.en a:before { background-position: -7777px 0; }
321
- .wg-li.flag-1.eo a:before { background-position: -7777px 0; }
322
- .wg-li.flag-1.et a:before { background-position: -2337px 0; }
323
- .wg-li.flag-1.fj a:before { background-position: -2497px 0; }
324
- .wg-li.flag-1.fi a:before { background-position: -2529px 0; }
325
- .wg-li.flag-1.fr a:before { background-position: -2561px 0; }
326
- .wg-li.flag-1.gl a:before { background-position: -7009px 0; }
327
- .wg-li.flag-1.ka a:before { background-position: -2721px 0; }
328
- .wg-li.flag-1.de a:before { background-position: -2753px 0; }
329
- .wg-li.flag-1.el a:before { background-position: -2881px 0; }
330
- .wg-li.flag-1.gu a:before { background-position: -3329px 0; }
331
- .wg-li.flag-1.ht a:before { background-position: -3169px 0; }
332
- .wg-li.flag-1.ha a:before { background-position: -5281px 0; }
333
- .wg-li.flag-1.he a:before { background-position: -3521px 0; }
334
- .wg-li.flag-1.hi a:before { background-position: -3329px 0; }
335
- .wg-li.flag-1.hu a:before { background-position: -3265px 0; }
336
- .wg-li.flag-1.is a:before { background-position: -3297px 0; }
337
- .wg-li.flag-1.ig a:before { background-position: -5313px 0; }
338
- .wg-li.flag-1.id a:before { background-position: -3361px 0; }
339
- .wg-li.flag-1.ga a:before { background-position: -3457px 0; }
340
- .wg-li.flag-1.it a:before { background-position: -3553px 0; }
341
- .wg-li.flag-1.ja a:before { background-position: -3617px 0; }
342
- .wg-li.flag-1.jv a:before { background-position: -4321px 0; }
343
- .wg-li.flag-1.kn a:before { background-position: -3329px 0; }
344
- .wg-li.flag-1.kk a:before { background-position: -3713px 0; }
345
- .wg-li.flag-1.ko a:before { background-position: -6913px 0; }
346
- .wg-li.flag-1.ku a:before { background-position: -3265px 0; }
347
- .wg-li.flag-1.ky a:before { background-position: -3873px 0; }
348
- .wg-li.flag-1.lo a:before { background-position: -3904px 0; }
349
- .wg-li.flag-1.la a:before { background-position: -3553px 0; }
350
- .wg-li.flag-1.lv a:before { background-position: -3937px 0; }
351
- .wg-li.flag-1.lt a:before { background-position: -4129px 0; }
352
- .wg-li.flag-1.lb a:before { background-position: -4161px 0; }
353
- .wg-li.flag-1.mk a:before { background-position: -4225px 0; }
354
- .wg-li.flag-1.mg a:before { background-position: -4257px 0; }
355
- .wg-li.flag-1.ms a:before { background-position: -4321px 0; }
356
- .wg-li.flag-1.ml a:before { background-position: -3329px 0; }
357
- .wg-li.flag-1.mt a:before { background-position: -4417px 0; }
358
- .wg-li.flag-1.mi a:before { background-position: -5217px 0; }
359
- .wg-li.flag-1.mr a:before { background-position: -3329px 0; }
360
- .wg-li.flag-1.mn a:before { background-position: -4769px 0; }
361
- .wg-li.flag-1.ne a:before { background-position: -5091px 0; }
362
- .wg-li.flag-1.no a:before { background-position: -5505px 0; }
363
- .wg-li.flag-1.ps a:before { background-position: -33px 0; }
364
- .wg-li.flag-1.fa a:before { background-position: -3393px 0; }
365
- .wg-li.flag-1.pl a:before { background-position: -5889px 0; }
366
- .wg-li.flag-1.pt a:before { background-position: -993px 0; }
367
- .wg-li.flag-1.pa a:before { background-position: -3329px 0; }
368
- .wg-li.flag-1.ro a:before { background-position: -6081px 0; }
369
- .wg-li.flag-1.ru a:before { background-position: -6113px 0; }
370
- .wg-li.flag-1.sm a:before { background-position: -6369px 0; }
371
- .wg-li.flag-1.gd a:before { background-position: -6497px 0; }
372
- .wg-li.flag-1.sr a:before { background-position: -6561px 0; }
373
- .wg-li.flag-1.sn a:before { background-position: -8287px 0; }
374
- .wg-li.flag-1.sd a:before { background-position: -5601px 0; }
375
- .wg-li.flag-1.si a:before { background-position: -7039px 0; }
376
- .wg-li.flag-1.sk a:before { background-position: -6689px 0; }
377
- .wg-li.flag-1.sl a:before { background-position: -6721px 0; }
378
- .wg-li.flag-1.so a:before { background-position: -6785px 0; }
379
- .wg-li.flag-1.st a:before { background-position: -4001px 0; }
380
- .wg-li.flag-1.es a:before { background-position: -7009px 0; }
381
- .wg-li.flag-1.su a:before { background-position: -7073px 0; }
382
- .wg-li.flag-1.sw a:before { background-position: -3745px 0; }
383
- .wg-li.flag-1.sv a:before { background-position: -7169px 0; }
384
- .wg-li.flag-1.tl a:before { background-position: -5823px 0; }
385
- .wg-li.flag-1.ty a:before { background-position: -2593px 0; }
386
- .wg-li.flag-1.tg a:before { background-position: -7297px 0; }
387
- .wg-li.flag-1.ta a:before { background-position: -3329px 0; }
388
- .wg-li.flag-1.tt a:before { background-position: -6113px 0; }
389
- .wg-li.flag-1.te a:before { background-position: -3329px 0; }
390
- .wg-li.flag-1.th a:before { background-position: -7361px 0; }
391
- .wg-li.flag-1.to a:before { background-position: -7456px 0; }
392
- .wg-li.flag-1.tr a:before { background-position: -7553px 0; }
393
- .wg-li.flag-1.uk a:before { background-position: -7713px 0; }
394
- .wg-li.flag-1.ur a:before { background-position: -5600px 0; }
395
- .wg-li.flag-1.uz a:before { background-position: -7969px 0; }
396
- .wg-li.flag-1.vi a:before { background-position: -8097px 0; }
397
- .wg-li.flag-1.cy a:before { background-position: -8129px 0; }
398
- .wg-li.flag-1.fy a:before { background-position: -5121px 0; }
399
- .wg-li.flag-1.xh a:before { background-position: -6848px 0; }
400
- .wg-li.flag-1.yi a:before { background-position: -3521px 0; }
401
- .wg-li.flag-1.yo a:before { background-position: -5313px 0; }
402
- .wg-li.flag-1.zu a:before { background-position: -6848px 0; }
403
-
404
-
405
- .wg-flags.flag-2 a:before {
406
- background-image: url("../images/square_flag.png");
407
- border-radius: 0px;
408
- width: 24px;
409
- height: 24px;
410
- }
411
-
412
- .wg-li.flag-2.hw a:before { background-position: -5448px 0; }
413
- .wg-li.flag-2.fl a:before { background-position: -1008px 0; }
414
- .wg-li.flag-2.af a:before { background-position: -4968px 0; }
415
- .wg-li.flag-2.sq a:before { background-position: -2976px 0; }
416
- .wg-li.flag-2.am a:before { background-position: -3816px 0; }
417
- .wg-li.flag-2.ar a:before { background-position: -768px 0; }
418
- .wg-li.flag-2.hy a:before { background-position: 0 0; }
419
- .wg-li.flag-2.az a:before { background-position: -5136px 0; }
420
- .wg-li.flag-2.ba a:before { background-position: -936px 0; }
421
- .wg-li.flag-2.eu a:before { background-position: -5376px 0; }
422
- .wg-li.flag-2.be a:before { background-position: -4224px 0; }
423
- .wg-li.flag-2.bn a:before { background-position: -4056px 0; }
424
- .wg-li.flag-2.bs a:before { background-position: -3984px 0; }
425
- .wg-li.flag-2.bg a:before { background-position: -5040px 0; }
426
- .wg-li.flag-2.my a:before { background-position: -1248px 0; }
427
- .wg-li.flag-2.ca a:before { background-position: -5352px 0; }
428
- .wg-li.flag-2.zh a:before { background-position: -2592px 0; }
429
- .wg-li.flag-2.tw a:before { background-position: -3408px 0; }
430
- .wg-li.flag-2.km a:before { background-position: -5160px 0; }
431
- .wg-li.flag-2.ny a:before { background-position: -1392px 0; }
432
- .wg-li.flag-2.co a:before { background-position: -2304px 0; }
433
- .wg-li.flag-2.hr a:before { background-position: -4416px 0; }
434
- .wg-li.flag-2.cs a:before { background-position: -2472px 0; }
435
- .wg-li.flag-2.da a:before { background-position: -2448px 0; }
436
- .wg-li.flag-2.nl a:before { background-position: -1296px 0; }
437
- .wg-li.flag-2.en a:before { background-position: -312px 0; }
438
- .wg-li.flag-2.eo a:before { background-position: -312px 0; } /* a faire */
439
- .wg-li.flag-2.et a:before { background-position: -2424px 0; }
440
- .wg-li.flag-2.fj a:before { background-position: -576px 0; }
441
- .wg-li.flag-2.fi a:before { background-position: -2328px 0; }
442
- .wg-li.flag-2.fr a:before { background-position: -2304px 0; }
443
- .wg-li.flag-2.gl a:before { background-position: -96px 0; }
444
- .wg-li.flag-2.ka a:before { background-position: -3744px 0; }
445
- .wg-li.flag-2.de a:before { background-position: -2256px 0; }
446
- .wg-li.flag-2.el a:before { background-position: -2208px 0; }
447
- .wg-li.flag-2.gu a:before { background-position: -1728px 0; }
448
- .wg-li.flag-2.ht a:before { background-position: -3528px 0; }
449
- .wg-li.flag-2.ha a:before { background-position: -1176px 0; }
450
- .wg-li.flag-2.he a:before { background-position: -1992px 0; }
451
- .wg-li.flag-2.hi a:before { background-position: -1728px 0; }
452
- .wg-li.flag-2.hu a:before { background-position: -2088px 0; }
453
- .wg-li.flag-2.is a:before { background-position: -2064px 0; }
454
- .wg-li.flag-2.ig a:before { background-position: -1103px 0; }
455
- .wg-li.flag-2.id a:before { background-position: -2040px 0; }
456
- .wg-li.flag-2.ga a:before { background-position: -2016px 0; }
457
- .wg-li.flag-2.it a:before { background-position: -1968px 0; }
458
- .wg-li.flag-2.ja a:before { background-position: -1920px 0; }
459
- .wg-li.flag-2.jv a:before { background-position: -1536px 0; }
460
- .wg-li.flag-2.kn a:before { background-position: -1728px 0; }
461
- .wg-li.flag-2.kk a:before { background-position: -1704px 0; }
462
- .wg-li.flag-2.ko a:before { background-position: -1848px 0; }
463
- .wg-li.flag-2.ku a:before { background-position: -2088px 0; }
464
- .wg-li.flag-2.ky a:before { background-position: -1800px 0; }
465
- .wg-li.flag-2.lo a:before { background-position: -1776px 0; }
466
- .wg-li.flag-2.la a:before { background-position: -1968px 0; }
467
- .wg-li.flag-2.lv a:before { background-position: -1752px 0; }
468
- .wg-li.flag-2.lt a:before { background-position: -1656px 0; }
469
- .wg-li.flag-2.lb a:before { background-position: -1632px 0; }
470
- .wg-li.flag-2.mk a:before { background-position: -1440px 0; }
471
- .wg-li.flag-2.mg a:before { background-position: -1560px 0; }
472
- .wg-li.flag-2.ms a:before { background-position: -1536px 0; }
473
- .wg-li.flag-2.ml a:before { background-position: -1728px 0; }
474
- .wg-li.flag-2.mt a:before { background-position: -1200px 0; }
475
- .wg-li.flag-2.mi a:before { background-position: -1224px 0; }
476
- .wg-li.flag-2.mr a:before { background-position: -1728px 0; }
477
- .wg-li.flag-2.mn a:before { background-position: -4800px 0; }
478
- .wg-li.flag-2.ne a:before { background-position: -1320px 0; }
479
- .wg-li.flag-2.no a:before { background-position: -4776px 0; }
480
- .wg-li.flag-2.ps a:before { background-position: -4008px 0; }
481
- .wg-li.flag-2.fa a:before { background-position: -5088px 0; }
482
- .wg-li.flag-2.pl a:before { background-position: -984px 0; }
483
- .wg-li.flag-2.pt a:before { background-position: -2784px 0; }
484
- .wg-li.flag-2.pa a:before { background-position: -1728px 0; }
485
- .wg-li.flag-2.ro a:before { background-position: -960px 0; }
486
- .wg-li.flag-2.ru a:before { background-position: -936px 0; }
487
- .wg-li.flag-2.sm a:before { background-position: -3408px 0; }
488
- .wg-li.flag-2.gd a:before { background-position: -4872px 0; }
489
- .wg-li.flag-2.sr a:before { background-position: -3120px 0; }
490
- .wg-li.flag-2.sn a:before { background-position: -72px 0; }
491
- .wg-li.flag-2.sd a:before { background-position: -1128px 0; }
492
- .wg-li.flag-2.si a:before { background-position: -480px 0; }
493
- .wg-li.flag-2.sk a:before { background-position: -4152px 0; }
494
- .wg-li.flag-2.sl a:before { background-position: -696px 0; }
495
- .wg-li.flag-2.so a:before { background-position: -3336px 0; }
496
- .wg-li.flag-2.st a:before { background-position: -3552px 0; }
497
- .wg-li.flag-2.es a:before { background-position: -96px 0; }
498
- .wg-li.flag-2.su a:before { background-position: -3312px 0; }
499
- .wg-li.flag-2.sw a:before { background-position: -1872px 0; }
500
- .wg-li.flag-2.sv a:before { background-position: -552px 0; }
501
- .wg-li.flag-2.tl a:before { background-position: -1008px 0; }
502
- .wg-li.flag-2.ty a:before { background-position: -4512px 0; }
503
- .wg-li.flag-2.tg a:before { background-position: -264px 0; }
504
- .wg-li.flag-2.ta a:before { background-position: -1728px 0; }
505
- .wg-li.flag-2.tt a:before { background-position: -936px 0; }
506
- .wg-li.flag-2.te a:before { background-position: -1728px 0; }
507
- .wg-li.flag-2.th a:before { background-position: -456px 0; }
508
- .wg-li.flag-2.to a:before { background-position: -3264px 0; }
509
- .wg-li.flag-2.tr a:before { background-position: -360px 0; }
510
- .wg-li.flag-2.uk a:before { background-position: -288px 0; }
511
- .wg-li.flag-2.ur a:before { background-position: -1128px 0; }
512
- .wg-li.flag-2.uz a:before { background-position: -240px 0; }
513
- .wg-li.flag-2.vi a:before { background-position: -144px 0; }
514
- .wg-li.flag-2.cy a:before { background-position: -4848px 0; }
515
- .wg-li.flag-2.fy a:before { background-position: -1296px 0; }
516
- .wg-li.flag-2.xh a:before { background-position: -4968px 0; }
517
- .wg-li.flag-2.yi a:before { background-position: -1992px 0; }
518
- .wg-li.flag-2.yo a:before { background-position: -1103px 0; }
519
- .wg-li.flag-2.zu a:before { background-position: -4968px 0; }
520
-
521
- .wg-flags.flag-3 a:before {
522
- background-image: url("../images/circular_flag.png");
523
- border-radius: 0px;
524
- width: 24px;
525
- height: 24px;
526
- }
527
-
528
- .wg-li.flag-3.hw a:before { background-position: -2711px 0; }
529
- .wg-li.flag-3.fl a:before { background-position: -5232px 0; }
530
- .wg-li.flag-3.af a:before { background-position: -5496px 0; }
531
- .wg-li.flag-3.sq a:before { background-position: -4776px 0; }
532
- .wg-li.flag-3.am a:before { background-position: -192px 0; }
533
- .wg-li.flag-3.ar a:before { background-position: -3336px 0; }
534
- .wg-li.flag-3.hy a:before { background-position: -4632px 0; }
535
- .wg-li.flag-3.az a:before { background-position: -4536px 0; }
536
- .wg-li.flag-3.ba a:before { background-position: -2664px 0; }
537
- .wg-li.flag-3.eu a:before { background-position: -5808px 0; }
538
- .wg-li.flag-3.be a:before { background-position: -144px 0; }
539
- .wg-li.flag-3.bn a:before { background-position: -4488px 0; }
540
- .wg-li.flag-3.bs a:before { background-position: -4392px 0; }
541
- .wg-li.flag-3.bg a:before { background-position: -4296px 0; }
542
- .wg-li.flag-3.my a:before { background-position: -3769px 0; }
543
- .wg-li.flag-3.ca a:before { background-position: -5784px 0; }
544
- .wg-li.flag-3.zh a:before { background-position: -3240px 0; }
545
- .wg-li.flag-3.tw a:before { background-position: -4008px 0; }
546
- .wg-li.flag-3.km a:before { background-position: -4201px 0; }
547
- .wg-li.flag-3.ny a:before { background-position: -384px 0; }
548
- .wg-li.flag-3.co a:before { background-position: -2760px 0; } /* a faire */
549
- .wg-li.flag-3.hr a:before { background-position: -3048px 0; }
550
- .wg-li.flag-3.cs a:before { background-position: -5280px 0; }
551
- .wg-li.flag-3.da a:before { background-position: -3024px 0; }
552
- .wg-li.flag-3.nl a:before { background-position: -3360px 0; }
553
- .wg-li.flag-3.en a:before { background-position: -2520px 0; }
554
- .wg-li.flag-3.eo a:before { background-position: -2520px 0; } /* a faire */
555
- .wg-li.flag-3.et a:before { background-position: -2856px 0; }
556
- .wg-li.flag-3.fj a:before { background-position: -0px 0; }
557
- .wg-li.flag-3.fi a:before { background-position: -2784px 0; }
558
- .wg-li.flag-3.fr a:before { background-position: -2760px 0; }
559
- .wg-li.flag-3.gl a:before { background-position: -3576px 0; }
560
- .wg-li.flag-3.ka a:before { background-position: -1536px 0; }
561
- .wg-li.flag-3.de a:before { background-position: -1488px 0; }
562
- .wg-li.flag-3.el a:before { background-position: -1416px 0; }
563
- .wg-li.flag-3.gu a:before { background-position: -2304px 0; }
564
- .wg-li.flag-3.ht a:before { background-position: -5160px 0; }
565
- .wg-li.flag-3.ha a:before { background-position: -361px 0; }
566
- .wg-li.flag-3.he a:before { background-position: -1608px 0; }
567
- .wg-li.flag-3.hi a:before { background-position: -2304px 0; }
568
- .wg-li.flag-3.hu a:before { background-position: -1920px 0; }
569
- .wg-li.flag-3.is a:before { background-position: -840px 0; }
570
- .wg-li.flag-3.ig a:before { background-position: -3457px 0; }
571
- .wg-li.flag-3.id a:before { background-position: -4992px 0; }
572
- .wg-li.flag-3.ga a:before { background-position: -2016px 0; }
573
- .wg-li.flag-3.it a:before { background-position: -336px 0; }
574
- .wg-li.flag-3.ja a:before { background-position: -2448px 0; }
575
- .wg-li.flag-3.jv a:before { background-position: -864px 0; }
576
- .wg-li.flag-3.kn a:before { background-position: -2304px 0; }
577
- .wg-li.flag-3.kk a:before { background-position: -3912px 0; }
578
- .wg-li.flag-3.ko a:before { background-position: -2256px 0; }
579
- .wg-li.flag-3.ku a:before { background-position: -1920px 0; }
580
- .wg-li.flag-3.ky a:before { background-position: -744px 0; }
581
- .wg-li.flag-3.lo a:before { background-position: -3816px 0; }
582
- .wg-li.flag-3.la a:before { background-position: -336px 0; }
583
- .wg-li.flag-3.lv a:before { background-position: -216px 0; }
584
- .wg-li.flag-3.lt a:before { background-position: -1776px 0; }
585
- .wg-li.flag-3.lb a:before { background-position: -1945px 0; }
586
- .wg-li.flag-3.mk a:before { background-position: -2208px 0; }
587
- .wg-li.flag-3.mg a:before { background-position: -5064px 0; }
588
- .wg-li.flag-3.ms a:before { background-position: -864px 0; }
589
- .wg-li.flag-3.ml a:before { background-position: -2304px 0; }
590
- .wg-li.flag-3.mt a:before { background-position: -4920px 0; }
591
- .wg-li.flag-3.mi a:before { background-position: -2113px 0; }
592
- .wg-li.flag-3.mr a:before { background-position: -2304px 0; }
593
- .wg-li.flag-3.mn a:before { background-position: -24px 0; }
594
- .wg-li.flag-3.ne a:before { background-position: -5642px 0; }
595
- .wg-li.flag-3.no a:before { background-position: -984px 0; }
596
- .wg-li.flag-3.ps a:before { background-position: -4753px 0; }
597
- .wg-li.flag-3.fa a:before { background-position: -816px 0; }
598
- .wg-li.flag-3.pl a:before { background-position: -4944px 0; }
599
- .wg-li.flag-3.pt a:before { background-position: -4344px 0; }
600
- .wg-li.flag-3.pa a:before { background-position: -2304px 0; }
601
- .wg-li.flag-3.ro a:before { background-position: -3744px 0; }
602
- .wg-li.flag-3.ru a:before { background-position: -2664px 0; }
603
- .wg-li.flag-3.sm a:before { background-position: -1248px 0; }
604
- .wg-li.flag-3.gd a:before { background-position: -3841px 0; }
605
- .wg-li.flag-3.sr a:before { background-position: -3312px 0; }
606
- .wg-li.flag-3.sn a:before { background-position: -5521px 0; }
607
- .wg-li.flag-3.sd a:before { background-position: -1993px 0; }
608
- .wg-li.flag-3.si a:before { background-position: -2833px 0; } /* a faire */
609
- .wg-li.flag-3.sk a:before { background-position: -552px 0; }
610
- .wg-li.flag-3.sl a:before { background-position: -936px 0; }
611
- .wg-li.flag-3.so a:before { background-position: -4032px 0; }
612
- .wg-li.flag-3.st a:before { background-position: -3961px 0; }
613
- .wg-li.flag-3.es a:before { background-position: -3576px 0; }
614
- .wg-li.flag-3.su a:before { background-position: -3985px 0; }
615
- .wg-li.flag-3.sw a:before { background-position: -912px 0; }
616
- .wg-li.flag-3.sv a:before { background-position: -264px 0; }
617
- .wg-li.flag-3.tl a:before { background-position: -5232px 0; }
618
- .wg-li.flag-3.ty a:before { background-position: -1512px 0; }
619
- .wg-li.flag-3.tg a:before { background-position: -3720px 0; }
620
- .wg-li.flag-3.ta a:before { background-position: -2304px 0; }
621
- .wg-li.flag-3.tt a:before { background-position: -2664px 0; }
622
- .wg-li.flag-3.te a:before { background-position: -2304px 0; }
623
- .wg-li.flag-3.th a:before { background-position: -4848px 0; }
624
- .wg-li.flag-3.to a:before { background-position: -1680px 0; }
625
- .wg-li.flag-3.tr a:before { background-position: -432px 0; }
626
- .wg-li.flag-3.uk a:before { background-position: -5736px 0; }
627
- .wg-li.flag-3.ur a:before { background-position: -1992px 0; }
628
- .wg-li.flag-3.uz a:before { background-position: -2160px 0; }
629
- .wg-li.flag-3.vi a:before { background-position: -3384px 0; }
630
- .wg-li.flag-3.cy a:before { background-position: -5040px 0; }
631
- .wg-li.flag-3.fy a:before { background-position: -3360px 0; }
632
- .wg-li.flag-3.xh a:before { background-position: -5496px 0; }
633
- .wg-li.flag-3.yi a:before { background-position: -1608px 0; }
634
- .wg-li.flag-3.yo a:before { background-position: -3457px 0; }
635
- .wg-li.flag-3.zu a:before { background-position: -5496px 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
resources/wp-weglot-js.js DELETED
@@ -1,29 +0,0 @@
1
- function openClose(link) {
2
- link.className = (link.className.indexOf( "country-selector closed" ) < 0 ) ? link.className.replace( "country-selector","country-selector closed" ) : link.className.replace( "country-selector closed","country-selector" );
3
- var body = document.body,html = document.documentElement;
4
- var page_height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
5
- var h = getOffset( link ).top;
6
-
7
- var position = window.getComputedStyle( link ).getPropertyValue( "position" );
8
- var bottom = window.getComputedStyle( link ).getPropertyValue( "bottom" );
9
- var top = window.getComputedStyle( link ).getPropertyValue( "top" );
10
-
11
- if ((position != "fixed" && h > page_height / 2) || (position == "fixed" && h > 100)) {
12
- link.className += " weg-openup";
13
- }
14
- return false;
15
- }
16
-
17
- function getOffset (element) {
18
- var top = 0, left = 0;
19
- do {
20
- top += element.offsetTop || 0;
21
- left += element.offsetLeft || 0;
22
- element = element.offsetParent;
23
- } while(element);
24
-
25
- return {
26
- top: top,
27
- left: left
28
- };
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Client/WeglotClient.php DELETED
@@ -1,821 +0,0 @@
1
- <?php
2
- namespace Weglot\Client;
3
-
4
- use Weglot\Exceptions\WeglotException;
5
- use Weglot\Third\WooCommerce\WeglotTranslateWoo;
6
- use WeglotSDP;
7
-
8
- class WeglotClient
9
- {
10
- protected $api_key;
11
-
12
- const API_BASE = 'https://api.weglot.com';
13
- const API_BASE_OLD = 'https://weglot.com/api/';
14
- const NUMBER_MAX_CHARS = 500;
15
-
16
- protected static $NODES_TO_IGNORE = null;
17
-
18
- public function __construct($key)
19
- {
20
- self::$NODES_TO_IGNORE = array("strong","em","abbr","acronym","b","bdo","big","cite","kbd","q","small","sub","sup");
21
-
22
- $this->api_key = $key;
23
-
24
- if ($this->api_key == null || mb_strlen($this->api_key) == 0) {
25
- return null;
26
- }
27
-
28
- $this->initThird();
29
- }
30
-
31
- public function initThird() // TODO : Dependency injection
32
- {
33
- $this->thirds = array();
34
-
35
- if (class_exists('WooCommerce')) {
36
- $this->thirds["woocommerce"] = new WeglotTranslateWoo();
37
- }
38
- }
39
-
40
- public function hasAncestorAttribute($node, $attribute)
41
- {
42
- $currentNode = $node;
43
-
44
- if (isset($currentNode->$attribute)) {
45
- return true;
46
- }
47
-
48
- while ($currentNode->parent() && $currentNode->parent()->tag != 'html') {
49
- if (isset($currentNode->parent()->$attribute)) {
50
- return true;
51
- } else {
52
- $currentNode = $currentNode->parent();
53
- }
54
- }
55
- return false;
56
- }
57
-
58
- public function checkTitle($row)
59
- {
60
- return true;
61
- }
62
-
63
- public function checkText($row)
64
- {
65
- return ($row->parent()->tag != 'script'
66
- && $row->parent()->tag != 'style'
67
- && $row->parent()->tag != 'noscript'
68
- && $row->parent()->tag != 'title'
69
- && $row->parent()->tag != 'code'
70
- && ! is_numeric($this->full_trim($row->outertext))
71
- && ! preg_match('/^\d+%$/', $this->full_trim($row->outertext))
72
- && strpos($row->outertext, '[vc_') === false);
73
- }
74
-
75
- public function checkButton($row)
76
- {
77
- return (! is_numeric($this->full_trim($row->value))
78
- && ! preg_match('/^\d+%$/', $this->full_trim($row->value)));
79
- }
80
-
81
- public function checkTd_dt($row)
82
- {
83
- return true;
84
- }
85
-
86
- public function checkInput_dv($row)
87
- {
88
- return true;
89
- }
90
-
91
- public function checkInput_dobt($row)
92
- {
93
- return true;
94
- }
95
-
96
- public function checkRad_obt($row)
97
- {
98
- return true;
99
- }
100
-
101
-
102
- public function checkPlaceholder($row)
103
- {
104
- return (! is_numeric($this->full_trim($row->placeholder))
105
- && ! preg_match('/^\d+%$/', $this->full_trim($row->placeholder)));
106
- }
107
-
108
- public function checkMeta_desc($row)
109
- {
110
- return (! is_numeric($this->full_trim($row->placeholder))
111
- && ! preg_match('/^\d+%$/', $this->full_trim($row->placeholder)));
112
- }
113
-
114
- public function checkIframe_src($row)
115
- {
116
- return (strpos($this->full_trim($row->src), 'youtube.') !== false);
117
- }
118
-
119
- public function checkSource_src($row)
120
- {
121
- return true;
122
- }
123
-
124
- public function checkImg_src($row)
125
- {
126
- return true;
127
- }
128
-
129
- public function checkImg_alt($row)
130
- {
131
- return true;
132
- }
133
-
134
- public function checkA_pdf($row)
135
- {
136
- return (
137
- strtolower(substr($this->full_trim($row->href), -4)) == '.pdf'
138
- || strtolower(substr($this->full_trim($row->href), -4)) == '.rar'
139
- || strtolower(substr($this->full_trim($row->href), -4)) == 'docx'
140
- );
141
- }
142
-
143
- public function checkA_title($row)
144
- {
145
- return true;
146
- }
147
-
148
- public function checkA_dv($row)
149
- {
150
- return true;
151
- }
152
-
153
- public function checkA_dt($row)
154
- {
155
- return true;
156
- }
157
-
158
- public function checkA_dto($row)
159
- {
160
- return true;
161
- }
162
-
163
- public function checkA_dho($row)
164
- {
165
- return true;
166
- }
167
-
168
- public function checkA_dco($row)
169
- {
170
- return true;
171
- }
172
-
173
- public function checkA_dte($row)
174
- {
175
- return true;
176
- }
177
-
178
- public function searchForId($id, $array)
179
- {
180
- foreach ($array as $key => $val) {
181
- if ($val['uid'] === $id) {
182
- return $key;
183
- }
184
- }
185
- return null;
186
- }
187
-
188
- function ignoreNodes($dom)
189
- {
190
- foreach (self::$NODES_TO_IGNORE as $n) {
191
-
192
- $openRegex = "#<$n( [^>]*)?>#";
193
- $closeRegex = "</$n>";
194
-
195
- $dom = preg_replace($openRegex, "&lt;$n$1&gt;", $dom);
196
- $dom = str_replace($closeRegex, "&lt;/$n&gt;", $dom);
197
- }
198
-
199
- return $dom;
200
- }
201
-
202
- function decodeNode($dom) {
203
- return str_replace('&gt;','>',str_replace('&lt;','<',$dom));
204
- }
205
-
206
-
207
- public function translateDomFromTo($dom, $l_from, $l_to)
208
- {
209
- if (strlen($this->api_key) == 36) {
210
- $dom = $this->ignoreNodes($dom);
211
- }
212
-
213
- $html = WeglotSDP\str_get_html($dom, true, true, WG_DEFAULT_TARGET_CHARSET, false, WG_DEFAULT_BR_TEXT, WG_DEFAULT_SPAN_TEXT);
214
-
215
- $exceptions = explode(',', get_option('exclude_blocks'));
216
- array_push($exceptions, '#wpadminbar');
217
- foreach ($exceptions as $exception) {
218
- foreach ($html->find($exception) as $k => $row) {
219
- $attribute = 'data-wg-notranslate';
220
- $row->$attribute = '';
221
- }
222
- }
223
-
224
- $words = array();
225
- $nodes = array();
226
- $prewords = array();
227
- $endwords = array();
228
-
229
- $elements_to_check = array(
230
-
231
- 'title'
232
- => array(
233
- array(
234
- 'property' => 'innertext',
235
- 't' => 4,
236
- 'type' => 'text',
237
- ),
238
- ),
239
-
240
-
241
- 'meta[name="description"],meta[property="og:title"],meta[property="og:description"],meta[property="og:site_name"],meta[name="twitter:title"],meta[name="twitter:description"]'
242
- => array(
243
- array(
244
- 'property' => 'content',
245
- 't' => 4,
246
- 'type' => 'meta_desc',
247
- ),
248
- ),
249
-
250
- 'meta[name="twitter:image"],meta[name="og:image"]'
251
- => array(
252
- array(
253
- 'property' => 'content',
254
- 't' => 6,
255
- 'type' => 'meta_desc',
256
- ),
257
- ),
258
-
259
- 'text'
260
- => array(
261
- array(
262
- 'property' => 'outertext',
263
- 't' => 1,
264
- 'type' => 'text',
265
- ),
266
- ),
267
-
268
-
269
- "input[type='submit'],input[type='button'],button"
270
- => array(
271
- array(
272
- 'property' => 'value',
273
- 't' => 2,
274
- 'type' => 'button',
275
- ),
276
- array(
277
- 'property' => 'data-value',
278
- 't' => 1,
279
- 'type' => 'input_dv',
280
- ),
281
- array(
282
- 'property' => 'data-order_button_text',
283
- 't' => 1,
284
- 'type' => 'input_dobt',
285
- ),
286
- ),
287
-
288
- "input[type='radio']"
289
- => array(
290
- array(
291
- 'property' => 'data-order_button_text',
292
- 't' => 2,
293
- 'type' => 'rad_obt',
294
- ),
295
- ),
296
-
297
-
298
- "td"
299
- => array(
300
- array(
301
- 'property' => 'data-title',
302
- 't' => 2,
303
- 'type' => 'td_dt',
304
- ),
305
- ),
306
-
307
- "input[type=\'text\'],input[type=\'password\'],input[type=\'search\'],input[type=\'email\'],input:not([type]),textarea"
308
- => array(
309
- array(
310
- 'property' => 'placeholder',
311
- 't' => 3,
312
- 'type' => 'placeholder',
313
- ),
314
- ),
315
-
316
- 'iframe'
317
- => array(
318
- array(
319
- 'property' => 'src',
320
- 't' => 5,
321
- 'type' => 'iframe_src',
322
- ),
323
- ),
324
-
325
- 'img'
326
- => array(
327
- array(
328
- 'property' => 'src',
329
- 't' => 6,
330
- 'type' => 'img_src',
331
- ),
332
- array(
333
- 'property' => 'alt',
334
- 't' => 7,
335
- 'type' => 'img_alt',
336
- ),
337
- ),
338
-
339
- 'source'
340
- => array(
341
- array(
342
- 'property' => 'src',
343
- 't' => 5,
344
- 'type' => 'source_src',
345
- ),
346
- ),
347
-
348
- 'a'
349
- => array(
350
- array(
351
- 'property' => 'href',
352
- 't' => 8,
353
- 'type' => 'a_pdf',
354
- ),
355
- array(
356
- 'property' => 'title',
357
- 't' => 1,
358
- 'type' => 'a_title',
359
- ),
360
- array(
361
- 'property' => 'data-value',
362
- 't' => 1,
363
- 'type' => 'a_dv',
364
- ),
365
- array(
366
- 'property' => 'data-title',
367
- 't' => 1,
368
- 'type' => 'a_dt',
369
- ),
370
- array(
371
- 'property' => 'data-tooltip',
372
- 't' => 1,
373
- 'type' => 'a_dto',
374
- ),
375
- array(
376
- 'property' => 'data-hover',
377
- 't' => 1,
378
- 'type' => 'a_dho',
379
- ),
380
- array(
381
- 'property' => 'data-content',
382
- 't' => 1,
383
- 'type' => 'a_dco',
384
- ),
385
- array(
386
- 'property' => 'data-text',
387
- 't' => 1,
388
- 'type' => 'a_dte',
389
- ),
390
- array(
391
- 'property' => 'data-avia-tooltip',
392
- 't' => 1,
393
- 'type' => 'a_dat'
394
- )
395
- ),
396
- );
397
-
398
- $elements_to_check = apply_filters("weglot_elements_to_check", $elements_to_check);
399
-
400
- foreach ($elements_to_check as $key => $elem) {
401
- foreach ($html->find($key) as $k => $row) {
402
- foreach ($elem as $element) {
403
- $property = $element['property'];
404
- $t = $element['t'];
405
- $type = $element['type'];
406
- $functionName = apply_filters('weglot_check_type_element', 'check' . ucfirst($type), $type);
407
-
408
- $checkType = true;
409
- if (method_exists($this, $functionName)) {
410
- $checkType = $this->$functionName($row);
411
- } elseif (function_exists($functionName)) {
412
- $checkType = $functionName($row);
413
- }
414
-
415
- if (
416
- $this->full_trim($row->$property) != '' &&
417
- ! $this->hasAncestorAttribute($row, 'data-wg-notranslate') &&
418
- $checkType &&
419
- (strlen($row->$property) <= self::NUMBER_MAX_CHARS || preg_match('/\s|。|。|︒/u', $row->$property) )
420
- ) {
421
- array_push(
422
- $words,
423
- array(
424
- 't' => $t,
425
- 'w' => $this->trim_inline($row->$property,$prewords,$endwords),
426
- )
427
- );
428
- array_push(
429
- $nodes,
430
- array(
431
- 'node' => $row,
432
- 'type' => $type,
433
- 'property' => $property,
434
- )
435
- );
436
- } else {
437
- if(strpos($row->$property, '&gt;') !== false || strpos($row->$property, '&lt;') !== false) {
438
- $row->$property = $this->decodeNode($row->$property);
439
- }
440
- }
441
- }
442
- }
443
- }
444
-
445
-
446
- $microData = array("description");
447
- $jsons = array();
448
- $nbJsonStrings = 0;
449
- foreach ($html->find('script[type="application/ld+json"]') as $k => $row) {
450
- $mustAddjson = false;
451
- $json = json_decode($row->innertext, true);
452
- if (json_last_error() === JSON_ERROR_NONE) {
453
- foreach ($microData as $key) {
454
- $path = explode(">", $key);
455
- $value = $this->getValue($json, $path);
456
-
457
- if (isset($value)) {
458
- $mustAddjson = true;
459
- $this->addValues($value, $words, $nbJsonStrings);
460
- }
461
- }
462
-
463
- if ($mustAddjson) {
464
- array_push($jsons, array('node' => $row, 'json' => $json));
465
- }
466
- }
467
- }
468
-
469
- $countWC18n = 0;
470
- if (isset($this->thirds["woocommerce"])) {
471
- $countWC18n = $this->thirds["woocommerce"]->translate($dom, $words); // TODO : Improve countWC18n
472
- }
473
-
474
- $title = 'Empty title';
475
- foreach ($html->find('title') as $k => $row) {
476
- if ($row->innertext != '') {
477
- $title = $row->innertext;
478
- }
479
- }
480
-
481
-
482
- $absolute_url = $this->full_url($_SERVER);
483
- if (strpos($absolute_url, 'admin-ajax.php') !== false) {
484
- if (isset($_SERVER['HTTP_REFERER'])) {
485
- $absolute_url = sanitize_text_field(wp_unslash($_SERVER['HTTP_REFERER']));
486
- }
487
- $title = 'Ajax data';
488
- }
489
-
490
- $otherWords = apply_filters("weglot_words_translate", array());
491
-
492
- if (!empty($otherWords) && is_array($otherWords)) {
493
- foreach ($otherWords as $otherWord) {
494
-
495
- if (strlen($otherWord) > self::NUMBER_MAX_CHARS && preg_match('/\s|。|。|︒/u', $otherWord) == false) {
496
- continue;
497
- }
498
-
499
- $words[] = array(
500
- "t" => 1,
501
- "w" => $otherWord
502
- );
503
- }
504
- }
505
-
506
- $bot = $this->bot_detected();
507
- $parameters = array(
508
- 'l_from' => $l_from,
509
- 'l_to' => $l_to,
510
- 'title' => $title,
511
- 'request_url' => $absolute_url,
512
- 'bot' => $bot,
513
- 'words' => $words,
514
- );
515
- $results = $this->doRequest(self::API_BASE . '/translate?api_key=' . $this->api_key, $parameters);
516
-
517
- $json = json_decode($results, true);
518
- if (json_last_error() !== JSON_ERROR_NONE) {
519
- throw new WeglotException('Error with Weglot Api (0001) : ' . json_last_error() . ' Error is: ' . serialize($results));
520
- }
521
-
522
- $answer = $json;
523
- if (!isset($answer['to_words'])) {
524
- throw new WeglotException('Unknown error with Weglot Api (0005) Error is: ' . serialize($results));
525
- }
526
-
527
- $translated_words = $answer['to_words'];
528
- $from_words = $answer['from_words'];
529
-
530
- $totalWordsToTranslate = count($nodes) + $nbJsonStrings + $countWC18n + count($otherWords);
531
- if ($totalWordsToTranslate !== count($translated_words)) {
532
- throw new WeglotException('Unknown error with Weglot Api (0006)');
533
- }
534
-
535
- for ($i = 0;$i < count($nodes);$i++) {
536
- $currentNode = $nodes[$i];
537
- $property = $currentNode['property'];
538
- $type = $currentNode['type'];
539
-
540
- if ($type == "meta_desc") {
541
- $currentNode['node']->$property = htmlspecialchars($translated_words[$i]);
542
- } else {
543
- $currentNode['node']->$property = $prewords[$i].$translated_words[$i].$endwords[$i];
544
- }
545
-
546
-
547
- if ($currentNode['type'] == 'img_src') {
548
- $currentNode['node']->src = $translated_words[$i];
549
- if ($currentNode['node']->hasAttribute('srcset') && $currentNode['node']->srcset != '' && htmlspecialchars_decode($translated_words[$i]) != htmlspecialchars_decode($words[$i]['w'])) {
550
- $currentNode['node']->srcset = '';
551
- }
552
- }
553
- }
554
-
555
- $index = count($nodes);
556
- for ($i = 0;$i < count($jsons);$i++) {
557
- $currentJson = $jsons[$i];
558
- $jsonArray = $currentJson['json'];
559
- $node = $currentJson['node'];
560
- foreach ($microData as $key) {
561
- $path = explode(">", $key);
562
- $hasV = $this->getValue($jsonArray, $path);
563
-
564
- if (isset($hasV)) {
565
- $this->setValues($jsonArray, $path, $translated_words, $index);
566
- }
567
- }
568
- $node->innertext = json_encode($jsonArray, JSON_PRETTY_PRINT);
569
- }
570
-
571
- $dom = $html->save();
572
-
573
- for ($i = 0; $i < $countWC18n; $i++) {
574
- $dom = str_replace('\"'.$this->unformatFromApi($from_words[$i + $index + $nbJsonStrings]).'\"', '\"'.$this->unformatFromApi($translated_words[$i + $index + $nbJsonStrings]).'\"', $dom);
575
- }
576
-
577
-
578
- if (empty($otherWords)) {
579
- return $dom;
580
- }
581
-
582
- $fromWords = array_slice($from_words, $index+ $nbJsonStrings + $countWC18n);
583
- $otherWordsTranslated = array_slice($translated_words, $index+ $nbJsonStrings + $countWC18n);
584
-
585
- foreach ($fromWords as $key => $fromWord) {
586
- if(!preg_match("#<[^>\"']*".$fromWord."[^>\"']*>#",$dom)) {
587
- $dom = preg_replace("#\b$fromWord\b#", $otherWordsTranslated[$key], $dom);
588
- }
589
- }
590
-
591
- return $dom;
592
- }
593
-
594
- public function getUserInfo()
595
- {
596
- $results = $this->doRequest(self::API_BASE_OLD . 'user-info?api_key=' . $this->api_key, null);
597
- $json = json_decode($results, true);
598
- if (json_last_error() == JSON_ERROR_NONE) {
599
- if (isset($json['succeeded']) && ($json['succeeded'] == 0 || $json['succeeded'] == 1)) {
600
- if ($json['succeeded'] == 1) {
601
- if (isset($json['answer'])) {
602
- $answer = $json['answer'];
603
- return $answer;
604
- } else {
605
- throw new WeglotException('Unknown error with Weglot Api (0004)');
606
- }
607
- } else {
608
- $error = isset($json['error']) ? $json['error'] : 'Unknown error with Weglot Api (0003)';
609
- throw new WeglotException($error);
610
- }
611
- } else {
612
- throw new WeglotException('Unknown error with Weglot Api (0002) : ' . $json);
613
- }
614
- } else {
615
- throw new WeglotException('Unknown error with Weglot Api (0001) : ' . json_last_error());
616
- }
617
- }
618
-
619
- public function doRequest($url, $parameters)
620
- {
621
- if ($parameters) {
622
- $payload = json_encode($parameters);
623
- if (json_last_error() == JSON_ERROR_NONE) {
624
- $response = wp_remote_post(
625
- $url,
626
- array(
627
- 'method' => 'POST',
628
- 'timeout' => 45,
629
- 'redirection' => 5,
630
- 'blocking' => true,
631
- 'headers' => array(
632
- 'Content-type' => 'application/json',
633
- ),
634
- 'body' => $payload,
635
- 'cookies' => array(),
636
- 'sslverify' => false,
637
- )
638
- );
639
- } else {
640
- throw new WeglotException('Cannot json encode parameters: ' . json_last_error());
641
- }
642
- } else {
643
- $response = wp_remote_get(
644
- $url,
645
- array(
646
- 'method' => 'GET',
647
- 'timeout' => 45,
648
- 'redirection' => 5,
649
- 'blocking' => true,
650
- 'headers' => array(
651
- 'Content-type' => 'application/json',
652
- ),
653
- 'body' => null,
654
- 'cookies' => array(),
655
- 'sslverify' => false,
656
- )
657
- );
658
- }
659
-
660
- if (is_wp_error($response)) {
661
- $error_message = $response->get_error_message();
662
- throw new WeglotException('Error doing the external request to ' . $url . ': ' . $error_message);
663
- } else {
664
- return $response['body'];
665
- }
666
- }
667
-
668
-
669
-
670
- public function bot_detected()
671
- {
672
- if (isset($_SERVER['HTTP_USER_AGENT'])) {
673
- $ua = sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT']));
674
- }
675
- if (isset($ua)) {
676
- if (preg_match('/bot|favicon|crawl|facebook|slurp|spider/i', $ua)) {
677
- if (strpos($ua, 'Google') !== false || strpos($ua, 'facebook') !== false || strpos($ua, 'wprocketbot') !== false || strpos($ua, 'SemrushBot') !== false) {
678
- return 2;
679
- } elseif (strpos($ua, 'bing') !== false) {
680
- return 3;
681
- } elseif (strpos($ua, 'yahoo') !== false) {
682
- return 4;
683
- } elseif (strpos($ua, 'Baidu') !== false) {
684
- return 5;
685
- } elseif (strpos($ua, 'Yandex') !== false) {
686
- return 6;
687
- } else {
688
- return 1;
689
- }
690
- } else {
691
- return 0;
692
- }
693
- } else {
694
- return 1;
695
- }
696
- }
697
-
698
-
699
- public function addValues($value, &$words, &$nbJsonStrings)
700
- {
701
- if (is_array($value)) {
702
- foreach ($value as $key => $val) {
703
- $this->addValues($val, $words, $nbJsonStrings);
704
- }
705
- } else {
706
- array_push(
707
- $words,
708
- array(
709
- 't' => 1,
710
- 'w' => $value,
711
- )
712
- );
713
- $nbJsonStrings++;
714
- }
715
- }
716
-
717
- public function setValues(&$data, $path, $translatedwords, &$index)
718
- {
719
- $temp = &$data;
720
- foreach ($path as $key) {
721
- if (array_key_exists($key, $temp)) {
722
- $temp = &$temp[$key];
723
- } else {
724
- return null;
725
- }
726
- }
727
-
728
- if (is_array($temp)) {
729
- foreach ($temp as $key => &$val) {
730
- $this->setValues($val, null, $translatedwords, $index) ;
731
- }
732
- } else {
733
- $temp = $translatedwords[$index];
734
- $index++;
735
- }
736
- }
737
-
738
- public function getValue($data, $path)
739
- {
740
- $temp = $data;
741
- foreach ($path as $key) {
742
- if (array_key_exists($key, $temp)) {
743
- $temp = $temp[$key];
744
- } else {
745
- return null;
746
- }
747
- }
748
- return $temp ;
749
- }
750
-
751
- public function formatForApi($string)
752
- {
753
- $string = '"'.$string.'"';
754
- return json_decode(str_replace('\\/', '/', str_replace('\\\\', '\\', $string)));
755
- }
756
-
757
- public function unformatFromApi($string)
758
- {
759
- $string = str_replace('"', '', str_replace('/', '\\\\/', str_replace('\\u', '\\\\u', json_encode($string))));
760
- return $string;
761
- }
762
-
763
- public function url_origin($s, $use_forwarded_host = false)
764
- {
765
- $ssl = (! empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false;
766
- $sp = strtolower($s['SERVER_PROTOCOL']);
767
- $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');
768
- $port = $s['SERVER_PORT'];
769
- $port = ((! $ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port;
770
- $host = ($use_forwarded_host && isset($s['HTTP_X_FORWARDED_HOST'])) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);
771
- $host = isset($host) ? $host : $s['SERVER_NAME'] . $port;
772
- return $protocol . '://' . $host;
773
- }
774
- public function full_url($s, $use_forwarded_host = false)
775
- {
776
- return $this->url_origin($s, $use_forwarded_host) . $s['REQUEST_URI'];
777
- }
778
- public function full_trim($word)
779
- {
780
- return trim($word, " \t\n\r\0\x0B\xA0�");
781
- }
782
-
783
- /* This function remove inline tag when they are wrapping the whole sentence */
784
- public function trim_inline($word,&$prewords,&$endwords) {
785
-
786
- $word = html_entity_decode($word);
787
-
788
- $all_nodes = "";
789
- foreach (self::$NODES_TO_IGNORE as $n) {
790
- $all_nodes .= $n.'|';
791
- }
792
- $all_nodes = trim($all_nodes,'|');
793
-
794
- $regex = "#^<($all_nodes)>.*</($all_nodes)>$#";
795
-
796
- $pre = "";
797
- $suf = "";
798
-
799
- while(preg_match($regex,$word,$matches)) {
800
- $b = $matches[1];
801
- $prefix = "<$b>";
802
- $suffix = "</$b>";
803
-
804
- if (substr($word, 0, strlen($prefix)) == $prefix) {
805
- $word = substr($word, strlen($prefix));
806
- $pre .= $prefix;
807
- }
808
-
809
- if (substr($word, strlen($word)-strlen($suffix), strlen($suffix)) == $suffix) {
810
- $word = substr($word , 0 , strlen($word)-strlen($suffix));
811
- $suf .=$suffix;
812
- }
813
- }
814
-
815
- array_push($prewords,$pre);
816
- array_push($endwords,$suf);
817
-
818
- return $this->ignoreNodes($word);
819
- }
820
-
821
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Exceptions/WeglotException.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- namespace Weglot\Exceptions;
4
-
5
- class WeglotException extends \Exception
6
- {
7
- }
 
 
 
 
 
 
 
src/Helpers/WeglotLang.php DELETED
@@ -1,240 +0,0 @@
1
- <?php
2
-
3
- namespace Weglot\Helpers;
4
-
5
- abstract class WeglotLang
6
- {
7
- public static function getCodeLangs()
8
- {
9
- return array(
10
- 'af',
11
- 'hw',
12
- 'sq',
13
- 'am',
14
- 'ar',
15
- 'hy',
16
- 'az',
17
- 'ba',
18
- 'eu',
19
- 'be',
20
- 'bn',
21
- 'bs',
22
- 'bg',
23
- 'my',
24
- 'ca',
25
- 'ny',
26
- 'zh',
27
- 'tw',
28
- 'co',
29
- 'hr',
30
- 'cs',
31
- 'da',
32
- 'nl',
33
- 'en',
34
- 'eo',
35
- 'et',
36
- 'fj',
37
- 'fi',
38
- 'fr',
39
- 'fl',
40
- 'gl',
41
- 'ka',
42
- 'de',
43
- 'el',
44
- 'gu',
45
- 'ht',
46
- 'ha',
47
- 'he',
48
- 'hi',
49
- 'hu',
50
- 'is',
51
- 'ig',
52
- 'id',
53
- 'ga',
54
- 'it',
55
- 'ja',
56
- 'jv',
57
- 'kn',
58
- 'kk',
59
- 'km',
60
- 'ko',
61
- 'ku',
62
- 'ky',
63
- 'lo',
64
- 'la',
65
- 'lv',
66
- 'lt',
67
- 'lb',
68
- 'mk',
69
- 'mg',
70
- 'ms',
71
- 'ml',
72
- 'mt',
73
- 'mi',
74
- 'mr',
75
- 'mn',
76
- 'ne',
77
- 'no',
78
- 'ps',
79
- 'fa',
80
- 'pl',
81
- 'pt',
82
- 'pa',
83
- 'ro',
84
- 'ru',
85
- 'sm',
86
- 'gd',
87
- 'sr',
88
- 'sn',
89
- 'sd',
90
- 'si',
91
- 'sk',
92
- 'sl',
93
- 'so',
94
- 'st',
95
- 'es',
96
- 'su',
97
- 'sw',
98
- 'sv',
99
- 'tl',
100
- 'ty',
101
- 'tg',
102
- 'ta',
103
- 'tt',
104
- 'te',
105
- 'th',
106
- 'to',
107
- 'tr',
108
- 'uk',
109
- 'ur',
110
- 'uz',
111
- 'vi',
112
- 'cy',
113
- 'fy',
114
- 'xh',
115
- 'yi',
116
- 'yo',
117
- 'zu',
118
- );
119
- }
120
-
121
- public static function getStrLangs()
122
- {
123
- return array(
124
- 'af' => __('Afrikaans', 'weglot'),
125
- 'sq' => __('Albanian', 'weglot'),
126
- 'am' => __('Amharic', 'weglot'),
127
- 'ar' => __('Arabic', 'weglot'),
128
- 'hy' => __('Armenian', 'weglot'),
129
- 'az' => __('Azerbaijani', 'weglot'),
130
- 'ba' => __('Bashkir', 'weglot'),
131
- 'eu' => __('Basque', 'weglot'),
132
- 'be' => __('Belarusian', 'weglot'),
133
- 'bn' => __('Bengali', 'weglot'),
134
- 'bs' => __('Bosnian', 'weglot'),
135
- 'bg' => __('Bulgarian', 'weglot'),
136
- 'my' => __('Burmese', 'weglot'),
137
- 'ca' => __('Catalan', 'weglot'),
138
- 'ny' => __('Chichewa', 'weglot'),
139
- 'zh' => __('Simplified Chinese', 'weglot'),
140
- 'tw' => __('Traditional Chinese', 'weglot'),
141
- 'co' => __('Corsican', 'weglot'),
142
- 'hr' => __('Croatian', 'weglot'),
143
- 'cs' => __('Czech', 'weglot'),
144
- 'da' => __('Danish', 'weglot'),
145
- 'nl' => __('Dutch', 'weglot'),
146
- 'en' => __('English', 'weglot'),
147
- 'eo' => __('Esperanto', 'weglot'),
148
- 'et' => __('Estonian', 'weglot'),
149
- 'fj' => __('Fijian', 'weglot'),
150
- 'fi' => __('Finnish', 'weglot'),
151
- 'fl' => __('Filipino', 'weglot'),
152
- 'fr' => __('French', 'weglot'),
153
- 'gl' => __('Galician', 'weglot'),
154
- 'ka' => __('Georgian', 'weglot'),
155
- 'de' => __('German', 'weglot'),
156
- 'el' => __('Greek', 'weglot'),
157
- 'gu' => __('Gujarati', 'weglot'),
158
- 'ht' => __('Haitian', 'weglot'),
159
- 'ha' => __('Hausa', 'weglot'),
160
- 'hw' => __('Hawaiann', 'weglot'),
161
- 'he' => __('Hebrew', 'weglot'),
162
- 'hi' => __('Hindi', 'weglot'),
163
- 'hu' => __('Hungarian', 'weglot'),
164
- 'is' => __('Icelandic', 'weglot'),
165
- 'ig' => __('Igbo', 'weglot'),
166
- 'id' => __('Indonesian', 'weglot'),
167
- 'ga' => __('Irish', 'weglot'),
168
- 'it' => __('Italian', 'weglot'),
169
- 'ja' => __('Japanese', 'weglot'),
170
- 'jv' => __('Javanese', 'weglot'),
171
- 'kn' => __('Kannada', 'weglot'),
172
- 'kk' => __('Kazakh', 'weglot'),
173
- 'km' => __('Khmer', 'weglot'),
174
- 'ko' => __('Korean', 'weglot'),
175
- 'ku' => __('Kurdish', 'weglot'),
176
- 'ky' => __('Kyrgyz', 'weglot'),
177
- 'lo' => __('Lao', 'weglot'),
178
- 'la' => __('Latin', 'weglot'),
179
- 'lv' => __('Latvian', 'weglot'),
180
- 'lt' => __('Lithuanian', 'weglot'),
181
- 'lb' => __('Luxembourgish', 'weglot'),
182
- 'mk' => __('Macedonian', 'weglot'),
183
- 'mg' => __('Malagasy', 'weglot'),
184
- 'ms' => __('Malay', 'weglot'),
185
- 'ml' => __('Malayalam', 'weglot'),
186
- 'mt' => __('Maltese', 'weglot'),
187
- 'mi' => __('Māori', 'weglot'),
188
- 'mr' => __('Marathi', 'weglot'),
189
- 'mn' => __('Mongolian', 'weglot'),
190
- 'ne' => __('Nepali', 'weglot'),
191
- 'no' => __('Norwegian', 'weglot'),
192
- 'ps' => __('Pashto', 'weglot'),
193
- 'fa' => __('Persian', 'weglot'),
194
- 'pl' => __('Polish', 'weglot'),
195
- 'pt' => __('Portuguese', 'weglot'),
196
- 'pa' => __('Punjabi', 'weglot'),
197
- 'ro' => __('Romanian', 'weglot'),
198
- 'ru' => __('Russian', 'weglot'),
199
- 'sm' => __('Samoan', 'weglot'),
200
- 'gd' => __('Gaelic', 'weglot'),
201
- 'sr' => __('Serbian', 'weglot'),
202
- 'sn' => __('Shona', 'weglot'),
203
- 'sd' => __('Sindhi', 'weglot'),
204
- 'si' => __('Sinhalese', 'weglot'),
205
- 'sk' => __('Slovak', 'weglot'),
206
- 'sl' => __('Slovenian', 'weglot'),
207
- 'so' => __('Somali', 'weglot'),
208
- 'st' => __('Sotho', 'weglot'),
209
- 'es' => __('Spanish', 'weglot'),
210
- 'su' => __('Sundanese', 'weglot'),
211
- 'sw' => __('Swahili', 'weglot'),
212
- 'sv' => __('Swedish', 'weglot'),
213
- 'tl' => __('Tagalog', 'weglot'),
214
- 'ty' => __('Tahitian', 'weglot'),
215
- 'tg' => __('Tajik', 'weglot'),
216
- 'ta' => __('Tamil', 'weglot'),
217
- 'tt' => __('Tatar', 'weglot'),
218
- 'te' => __('Telugu', 'weglot'),
219
- 'th' => __('Thai', 'weglot'),
220
- 'to' => __('Tongan', 'weglot'),
221
- 'tr' => __('Turkish', 'weglot'),
222
- 'uk' => __('Ukrainian', 'weglot'),
223
- 'ur' => __('Urdu', 'weglot'),
224
- 'uz' => __('Uzbek', 'weglot'),
225
- 'vi' => __('Vietnamese', 'weglot'),
226
- 'cy' => __('Welsh', 'weglot'),
227
- 'fy' => __('Frisian', 'weglot'),
228
- 'xh' => __('Xhosa', 'weglot'),
229
- 'yi' => __('Yiddish', 'weglot'),
230
- 'yo' => __('Yoruba', 'weglot'),
231
- 'zu' => __('Zulu', 'weglot'),
232
- );
233
- }
234
-
235
- public static function getStrLangByCode($code)
236
- {
237
- $langs = self::getStrLangs();
238
- return (array_key_exists($code, $langs)) ? $langs[$code] : "";
239
- }
240
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Helpers/WeglotUrl.php DELETED
@@ -1,100 +0,0 @@
1
- <?php
2
-
3
- namespace Weglot\Helpers;
4
-
5
- use Weglot\WeglotContext;
6
-
7
- abstract class WeglotUrl
8
- {
9
- public static function isEligibleURL($url) // Change this in another helper and remove static
10
- {
11
- $url = urldecode(self::URLToRelative($url));
12
- //Format exclude URL
13
- $excludeURL = get_option('exclude_url'); // Too dependecy WP
14
-
15
- if (!empty($excludeURL)) {
16
- $excludeURL = preg_replace('#\s+#', ',', trim($excludeURL));
17
-
18
- $excludedUrls = explode(',', $excludeURL);
19
- foreach ($excludedUrls as &$ex_url) {
20
- $ex_url = self::URLToRelative($ex_url);
21
- }
22
- $excludeURL = implode(',', $excludedUrls);
23
- }
24
-
25
- $exclusions = preg_replace('#\s+#', ',', $excludeURL);
26
-
27
- $listRegex = explode(',', $exclusions);
28
-
29
- $excludeAmp = apply_filters("weglot_exclude_amp", true); // Too dependecy WP
30
-
31
- if ($excludeAmp) {
32
- $listRegex[] = apply_filters('weglot_regex_amp', '([&\?/])amp(/)?$');
33
- }
34
-
35
- if (empty($exclusions)) {
36
- return true;
37
- }
38
-
39
- foreach ($listRegex as $regex) {
40
- $str = self::escapeSlash($regex);
41
- $prepareRegex = sprintf('/%s/', $str);
42
- if (preg_match($prepareRegex, $url) === 1) {
43
- return false;
44
- }
45
- }
46
-
47
- return true;
48
- }
49
-
50
- public static function escapeSlash($str) // Change this in another helper and remove static
51
- {
52
- return str_replace('/', '\/', $str);
53
- }
54
-
55
- public static function URLToRelative($url) // Change this in another helper and remove static
56
- {
57
- if ((substr($url, 0, 7) == 'http://') || (substr($url, 0, 8) == 'https://')) {
58
- // the current link is an "absolute" URL - parse it to get just the path
59
- $parsed = parse_url($url);
60
- $path = isset($parsed['path']) ? $parsed['path'] : '';
61
- $query = isset($parsed['query']) ? '?' . $parsed['query'] : '';
62
- $fragment = isset($parsed['fragment']) ? '#' . $parsed['fragment'] : '';
63
-
64
- if (self::getHomeDirectory()) {
65
- $relative = str_replace(self::getHomeDirectory(), '', $path);
66
-
67
- return ($relative == '') ? '/' : $relative;
68
- } else {
69
- return $path . $query . $fragment;
70
- }
71
- }
72
- return $url;
73
- }
74
-
75
- /** Returns the subdirectories where WP is installed
76
- *
77
- * returns /directories if there is one
78
- * return empty string otherwise
79
- *
80
- */
81
- public static function getHomeDirectory()
82
- {
83
- $homeDir = WeglotContext::getHomeDirectory();
84
- if (isset($homeDir) ) {
85
- return $homeDir;
86
- }
87
-
88
- $opt_siteurl = trim(get_option('siteurl'), '/');
89
- $opt_home = trim(get_option('home'), '/');
90
- if ($opt_siteurl != '' && $opt_home != '') {
91
- if ((substr($opt_home, 0, 7) == 'http://' && strpos(substr($opt_home, 7), '/') !== false) || (substr($opt_home, 0, 8) == 'https://' && strpos(substr($opt_home, 8), '/') !== false)) {
92
- $parsed_url = parse_url($opt_home);
93
- $path = isset($parsed_url['path']) ? $parsed_url['path'] : '/';
94
- WeglotContext::setHomeDirectory($path);
95
- return $path;
96
- }
97
- }
98
- return null;
99
- }
100
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Helpers/WeglotUtils.php DELETED
@@ -1,307 +0,0 @@
1
- <?php
2
-
3
- namespace Weglot\Helpers;
4
-
5
- class WeglotUtils
6
- {
7
- public static function getLangNameFromCode($code, $english)
8
- {
9
- switch ($code) {
10
- case "af":
11
- return $english ? "Afrikaans" : "Afrikaans";
12
- case "sq":
13
- return $english ? "Albanian" : "Shqip";
14
- case "am":
15
- return $english ? "Amharic" : "አማርኛ";
16
- case "ar":
17
- return $english ? "Arabic" : "‏العربية‏";
18
- case "hy":
19
- return $english ? "Armenian" : "հայերեն";
20
- case "az":
21
- return $english ? "Azerbaijani" : "Azərbaycan dili";
22
- case "ba":
23
- return $english ? "Bashkir" : "башҡорт теле";
24
- case "eu":
25
- return $english ? "Basque" : "Euskara";
26
- case "be":
27
- return $english ? "Belarusian" : "Беларуская";
28
- case "bn":
29
- return $english ? "Bengali" : "বাংলা";
30
- case "bs":
31
- return $english ? "Bosnian" : "Bosanski";
32
- case "bg":
33
- return $english ? "Bulgarian" : "български";
34
- case "my":
35
- return $english ? "Burmese" : "မြန်မာ";
36
- case "ca":
37
- return $english ? "Catalan" : "Català";
38
- case "km":
39
- return $english ? "Khmer" : "ភាសាខ្មែរ";
40
- case "ny":
41
- return $english ? "Chichewa" : "Chicheŵa";
42
- case "co":
43
- return $english ? "Corsican" : "Corsu";
44
- case "zh":
45
- return $english ? "Simplified Chinese" : "中文 (简体)";
46
- case "tw":
47
- return $english ? "Traditional Chinese" : "中文 (繁體)";
48
- case "hr":
49
- return $english ? "Croatian" : "Hrvatski";
50
- case "cs":
51
- return $english ? "Czech" : "Čeština";
52
- case "da":
53
- return $english ? "Danish" : "Dansk";
54
- case "nl":
55
- return $english ? "Dutch" : "Nederlands";
56
- case "en":
57
- return $english ? "English" : "English";
58
- case "eo":
59
- return $english ? "Esperanto" : "Esperanto";
60
- case "et":
61
- return $english ? "Estonian" : "Eesti";
62
- case "fj":
63
- return $english ? "Fijian" : "Fidžin";
64
- case "fl":
65
- return $english ? "Filipino" : "Filipino";
66
- case "fi":
67
- return $english ? "Finnish" : "Suomi";
68
- case "fr":
69
- return $english ? "French" : "Français";
70
- case "gl":
71
- return $english ? "Galician" : "Galego";
72
- case "ka":
73
- return $english ? "Georgian" : "ქართული";
74
- case "de":
75
- return $english ? "German" : "Deutsch";
76
- case "el":
77
- return $english ? "Greek" : "Ελληνικά";
78
- case "gu":
79
- return $english ? "Gujarati" : "ગુજરાતી";
80
- case "ht":
81
- return $english ? "Haitian" : "Kreyòl ayisyen";
82
- case "ha":
83
- return $english ? "Hausa" : "Hausa";
84
- case "hw":
85
- return $english ? "Hawaiann" : "Hawaiann";
86
- case "he":
87
- return $english ? "Hebrew" : "עברית";
88
- case "hi":
89
- return $english ? "Hindi" : "हिंदी";
90
- case "hu":
91
- return $english ? "Hungarian" : "Magyar";
92
- case "is":
93
- return $english ? "Icelandic" : "Íslenska";
94
- case "ig":
95
- return $english ? "Igbo" : "Igbo";
96
- case "id":
97
- return $english ? "Indonesian" : "Bahasa Indonesia";
98
- case "ga":
99
- return $english ? "Irish" : "Gaeilge";
100
- case "it":
101
- return $english ? "Italian" : "Italiano";
102
- case "ja":
103
- return $english ? "Japanese" : "日本語";
104
- case "jv":
105
- return $english ? "Javanese" : "baṣa Jawa";
106
- case "kn":
107
- return $english ? "Kannada" : "ಕನ್ನಡ";
108
- case "kk":
109
- return $english ? "Kazakh" : "Қазақша";
110
- case "ko":
111
- return $english ? "Korean" : "한국어";
112
- case "ku":
113
- return $english ? "Kurdish" : "Kurdí";
114
- case "ky":
115
- return $english ? "Kyrgyz" : "кыргызча";
116
- case "lo":
117
- return $english ? "Lao" : "ລາວ";
118
- case "la":
119
- return $english ? "Latin" : "Latine";
120
- case "lv":
121
- return $english ? "Latvian" : "Latviešu";
122
- case "lt":
123
- return $english ? "Lithuanian" : "Lietuvių";
124
- case "lb":
125
- return $english ? "Luxembourgish" : "Lëtzebuergesch";
126
- case "mk":
127
- return $english ? "Macedonian" : "Македонски";
128
- case "mg":
129
- return $english ? "Malagasy" : "Malagasy";
130
- case "ms":
131
- return $english ? "Malay" : "Bahasa Melayu";
132
- case "ml":
133
- return $english ? "Malayalam" : "മലയാളം";
134
- case "mt":
135
- return $english ? "Maltese" : "Malti";
136
- case "mi":
137
- return $english ? "Māori" : "Māori";
138
- case "mr":
139
- return $english ? "Marathi" : "मराठी";
140
- case "mn":
141
- return $english ? "Mongolian" : "Монгол";
142
- case "ne":
143
- return $english ? "Nepali" : "नेपाली";
144
- case "no":
145
- return $english ? "Norwegian" : "Norsk";
146
- case "ps":
147
- return $english ? "Pashto" : "پښتو";
148
- case "fa":
149
- return $english ? "Persian" : "فارسی";
150
- case "pl":
151
- return $english ? "Polish" : "Polski";
152
- case "pt":
153
- return $english ? "Portuguese" : "Português";
154
- case "pa":
155
- return $english ? "Punjabi" : "ਪੰਜਾਬੀ";
156
- case "ro":
157
- return $english ? "Romanian" : "Română";
158
- case "ru":
159
- return $english ? "Russian" : "Русский";
160
- case "sm":
161
- return $english ? "Samoan" : "Samoa";
162
- case "gd":
163
- return $english ? "Scottish Gaelic" : "Gàidhlig na h-Alba";
164
- case "sr":
165
- return $english ? "Serbian" : "Српски";
166
- case "sn":
167
- return $english ? "Shona" : "chiShona";
168
- case "sd":
169
- return $english ? "Sindhi" : "سنڌي";
170
- case "si":
171
- return $english ? "Sinhalese" : "සිංහල";
172
- case "sk":
173
- return $english ? "Slovak" : "Slovenčina";
174
- case "sl":
175
- return $english ? "Slovenian" : "Slovenščina";
176
- case "so":
177
- return $english ? "Somali" : "af Soomaali";
178
- case "st":
179
- return $english ? "Southern Sotho" : "seSotho";
180
- case "es":
181
- return $english ? "Spanish" : "Español";
182
- case "su":
183
- return $english ? "Sundanese" : "Sunda";
184
- case "sw":
185
- return $english ? "Swahili" : "Kiswahili";
186
- case "sv":
187
- return $english ? "Swedish" : "Svenska";
188
- case "tl":
189
- return $english ? "Tagalog" : "Tagalog";
190
- case "ty":
191
- return $english ? "Tahitian" : "Tahitian";
192
- case "tg":
193
- return $english ? "Tajik" : "Тоҷикӣ";
194
- case "ta":
195
- return $english ? "Tamil" : "தமிழ்";
196
- case "tt":
197
- return $english ? "Tatar" : "Tatar";
198
- case "te":
199
- return $english ? "Telugu" : "తెలుగు";
200
- case "th":
201
- return $english ? "Thai" : "ภาษาไทย";
202
- case "to":
203
- return $english ? "Tongan" : "Tonga";
204
- case "tr":
205
- return $english ? "Turkish" : "Türkçe";
206
- case "uk":
207
- return $english ? "Ukrainian" : "Українська";
208
- case "ur":
209
- return $english ? "Urdu" : "اردو";
210
- case "uz":
211
- return $english ? "Uzbek" : "O'zbek";
212
- case "vi":
213
- return $english ? "Vietnamese" : "Tiếng Việt";
214
- case "cy":
215
- return $english ? "Welsh" : "Cymraeg";
216
- case "fy":
217
- return $english ? "Western Frisian" : "Frysk";
218
- case "xh":
219
- return $english ? "Xhosa" : "isiXhosa";
220
- case "yi":
221
- return $english ? "Yiddish" : "ײִדיש";
222
- case "yo":
223
- return $english ? "Yoruba" : "Yorùbá";
224
- case "zu":
225
- return $english ? "Zulu" : "isiZulu";
226
- }
227
- }
228
-
229
- public static function str_lreplace($search, $replace, $subject)
230
- {
231
- $pos = strrpos($subject, $search);
232
-
233
- if ($pos !== false) {
234
- $subject = substr_replace($subject, $replace, $pos, strlen($search));
235
- }
236
- return $subject;
237
- }
238
-
239
- public static function is_HTML($string)
240
- {
241
- return ((preg_match('/<head/', $string, $m) != 0) && !(preg_match('/<xsl/', $string, $m) != 0));
242
- }
243
-
244
- public static function is_AJAX_HTML($string)
245
- {
246
- $r = preg_match_all('/<(a|div|span|p|i|aside|input|textarea|select|h1|h2|h3|h4|meta|button|form|li|strong|ul|option)/',
247
- $string, $m, PREG_PATTERN_ORDER);
248
- if (isset($string[0]) && $string[0] != '{' && $r && $r >= 1) {
249
- return true;
250
- } else {
251
- return false;
252
- }
253
- }
254
-
255
- public static function endsWith($haystack, $needle)
256
- {
257
- // search forward starting from end minus needle length characters
258
- return $needle === '' || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle,
259
- $temp) !== false);
260
- }
261
-
262
- public static function hasLanguageRTL($arrayOfCode)
263
- {
264
- foreach ($arrayOfCode as $code) {
265
- if (self::isLanguageRTL($code)) {
266
- return true;
267
- }
268
- }
269
- return false;
270
- }
271
-
272
- public static function isLanguageRTL($code)
273
- {
274
- $rtls = array('ar', 'he', 'fa');
275
- if (in_array($code, $rtls)) {
276
- return true;
277
- }
278
- return false;
279
- }
280
-
281
- public static function hasLanguageLTR($arrayOfCode)
282
- {
283
- foreach ($arrayOfCode as $code) {
284
- if (!self::isLanguageRTL($code)) {
285
- return true;
286
- }
287
- }
288
- return false;
289
- }
290
-
291
-
292
- public static function is_bot()
293
- {
294
- $ua = array_key_exists('HTTP_USER_AGENT', $_SERVER) ? sanitize_text_field(
295
- wp_unslash($_SERVER['HTTP_USER_AGENT'])
296
- ) : 'Unknown';
297
- if (isset($ua)) {
298
- if (preg_match('/bot|favicon|crawl|facebook|Face|slurp|spider/i', $ua)) {
299
- return true;
300
- } else {
301
- return false;
302
- }
303
- } else {
304
- return true;
305
- }
306
- }
307
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Models/TranslateInterface.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
-
3
- namespace Weglot\Models;
4
-
5
- interface TranslateInterface
6
- {
7
- public function translate($html, &$words);
8
- }
 
 
 
 
 
 
 
 
src/Notices/AdminNotices.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
-
3
- namespace Weglot\Notices;
4
-
5
- class AdminNotices
6
- {
7
- public function wgExceededFreeLimit()
8
- {
9
- add_action('admin_notices', array($this, 'wgExceededFreeLimitNotice'), 0);
10
- }
11
-
12
- /**
13
- * @see wgExceededFreeLimit
14
- */
15
- public function wgExceededFreeLimitNotice()
16
- {
17
- ?>
18
- <div class="updated settings-error notice is-dismissible">
19
- <p><?php echo sprintf(esc_html__('Weglot Translate is not active because you have exceeded the free limit. Please %1$supgrade your plan%2$s if you want to keep the service running.', 'weglot'), '<a target="_blank" href="https://weglot.com/change-plan">', '</a>'); ?></p>
20
- </div>
21
- <?php
22
- }
23
-
24
- public function wgRequireRewriteModule()
25
- {
26
- add_action('admin_notices', array($this, 'wgRequireRewriteModuleNotice'), 0);
27
- }
28
-
29
- /**
30
- * @see wgRequireRewriteModule
31
- */
32
- public function wgRequireRewriteModuleNotice()
33
- {
34
- ?>
35
- <div class="error settings-error notice is-dismissible">
36
- <p><?php echo sprintf(esc_html__('Weglot Translate: You need to activate the mod_rewrite module. You can find more information here : %1$sUsing Permalinks%2$s. If you need help, just ask us directly at support@weglot.com.', 'weglot'), '<a target="_blank" href="https://codex.wordpress.org/Using_Permalinks">', '</a>'); ?></p>
37
- </div>
38
- <?php
39
- }
40
-
41
- public function wgNeedConfiguration()
42
- {
43
- add_action('admin_notices', array($this, 'wgNeedConfigurationNotice'), 0);
44
- }
45
-
46
- /**
47
- * @see wgNeedConfiguration
48
- */
49
- public function wgNeedConfigurationNotice()
50
- {
51
- ?>
52
- <div class="error settings-error notice is-dismissible">
53
- <p><?php echo sprintf(esc_html__('Weglot Translate is installed but not yet configured, you need to configure Weglot here : %1$sWeglot configuration page%2$s. The configuration takes only 1 minute! ', 'weglot'), '<a href="'.admin_url().'admin.php?page=weglot">', '</a>'); ?></p>
54
- </div>
55
- <?php
56
- }
57
-
58
- public function thirdNotices()
59
- {
60
- add_action('admin_notices', array($this, 'wgGtranslateNotice'), 0);
61
- }
62
-
63
- public function hasGTranslatePlugin() // Not single responsability
64
- {
65
- return is_plugin_active('gtranslate/gtranslate.php');
66
- }
67
-
68
-
69
- public function wgGtranslateNotice()
70
- {
71
- if (!$this->hasGTranslatePlugin()) {
72
- return;
73
- }
74
-
75
-
76
- $screen = get_current_screen();
77
-
78
- if ($screen->id === "toplevel_page_Weglot") {
79
- return;
80
- }
81
-
82
- $pluginFile = 'gtranslate/gtranslate.php';
83
- $deactivateLink = wp_nonce_url('plugins.php?action=deactivate&amp;plugin='.urlencode($pluginFile).'&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_' . $pluginFile)
84
-
85
- ?>
86
- <div class="error settings-error notice is-dismissible">
87
- <p><?php echo sprintf(esc_html__('Please %1$sdeactivate GTranslate%2$s. This plugin causes conflicts with Weglot.', 'weglot'), '<a href="'.$deactivateLink.'">', '</a>'); ?></p>
88
- </div>
89
- <?php
90
- }
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Third/WooCommerce/WeglotTranslateWoo.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
-
3
- namespace Weglot\Third\WooCommerce;
4
-
5
- use Weglot\Models\TranslateInterface;
6
-
7
- class WeglotTranslateWoo implements TranslateInterface
8
- {
9
- public function translate($html, &$words)
10
- {
11
- $countTranslate = 0;
12
- $countTranslate += $this->addWCLabels($html, $words);
13
-
14
- return $countTranslate;
15
- }
16
-
17
- public function addWCLabels($html, &$words)
18
- {
19
- $count = 0;
20
-
21
- preg_match('#wc_address_i18n_params(.*?);#', $html, $match);
22
- if (!isset($match[1])) {
23
- return $count;
24
- }
25
-
26
- preg_match_all('#(label|placeholder)\\\":\\\"(.*?)\\\"#', $match[1], $all);
27
-
28
- $allWords = $all[2];
29
-
30
- foreach ($allWords as $value) {
31
- $value = $this->formatForApi($value);
32
- array_push(
33
- $words,
34
- array(
35
- 't' => 1,
36
- 'w' => $value,
37
- )
38
- );
39
- $count++;
40
- }
41
-
42
- return $count;
43
- }
44
-
45
- public function formatForApi($string) // TODO : Refactoring in a service
46
- {
47
- $string = '"'.$string.'"';
48
- return json_decode(str_replace('\\/', '/', str_replace('\\\\', '\\', $string)));
49
- }
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Third/Yoast/RedirectHandler.php DELETED
@@ -1,110 +0,0 @@
1
- <?php
2
-
3
- namespace Weglot\Third\Yoast;
4
-
5
- use Weglot\Helpers\WeglotLang;
6
- use Weglot\Helpers\WeglotUrl;
7
-
8
- /**
9
- * Override Yoast Premium
10
- */
11
- class RedirectHandler extends \WPSEO_Redirect_Handler{
12
-
13
- /**
14
- * The options where the URL redirects are stored.
15
- *
16
- * @var string
17
- */
18
- private $normal_option_name = 'wpseo-premium-redirects-export-plain';
19
-
20
- /**
21
- * The option name where the regex redirects are stored.
22
- *
23
- * @var string
24
- */
25
- private $regex_option_name = 'wpseo-premium-redirects-export-regex';
26
-
27
- /**
28
- * The URL that is called at the moment.
29
- *
30
- * @var string
31
- */
32
- protected $request_url = '';
33
-
34
- public function load() {
35
-
36
- // Only handle the redirect when the option for php redirects is enabled.
37
- if ( ! $this->load_php_redirects() ) {
38
- return;
39
- }
40
-
41
- // Set the requested URL.
42
- $this->set_request_url();
43
-
44
- // Check the normal redirects.
45
- $this->handle_normal_redirects( $this->request_url );
46
-
47
- do_action("weglot_another_redirect_override", $this->request_url);
48
- }
49
-
50
- protected function set_request_url() {
51
- $this->request_url = $this->get_request_uri();
52
- }
53
-
54
- /**
55
- * Checks if the current URL matches a normal redirect.
56
- *
57
- * @param string $request_url The request url to look for.
58
- *
59
- * @return void
60
- */
61
- protected function handle_normal_redirects( $request_url ) {
62
- // Setting the redirects.
63
- $redirects = $this->get_redirects( $this->normal_option_name );
64
- $this->redirects = $this->normalize_redirects( $redirects );
65
-
66
- // Trim the slashes, to match the variants of a request URL (Like: url, /url, /url/, url/).
67
- if ( $request_url !== '/' ) {
68
- $request_url = trim( $request_url, '/' );
69
- }
70
-
71
- $redirect_url = "";
72
-
73
- if(isset($request_url[2]) && $request_url[2] === "/"){
74
- $codeLanguage = explode("/", $request_url);
75
-
76
- $langs = WeglotLang::getCodeLangs();
77
- if(!in_array($codeLanguage[0], $langs)){ // Default behavior Yoast
78
- $redirect_url = $this->find_url( $request_url );
79
- }
80
- else{
81
- $redirect_url = str_replace($codeLanguage[0] . "/", "", $request_url);
82
- $redirect_url = $this->find_url( $redirect_url );
83
-
84
- if(!empty($redirect_url)){ // If find URL redirect on Yoast
85
-
86
- // Prepare Eligible URL from Yoast
87
- $eligibleUrl = $redirect_url["url"];
88
- if($eligibleUrl[0] !== "/"){
89
- $eligibleUrl = "/" . $eligibleUrl;
90
- }
91
- if(substr($eligibleUrl, -1) !== "/"){
92
- $eligibleUrl .= "/";
93
- }
94
-
95
- if(WeglotUrl::isEligibleURL($eligibleUrl)){
96
- $redirect_url["url"] = sprintf("%s/%s", $codeLanguage[0], $redirect_url["url"]);
97
- }
98
-
99
- }
100
- }
101
- }
102
-
103
- // Get the URL and doing the redirect.
104
- if ( ! empty( $redirect_url ) ) {
105
- $this->is_redirected = true;
106
- $this->do_redirect( $redirect_url['url'], $redirect_url['type'] );
107
- }
108
- }
109
-
110
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WeglotContext.php DELETED
@@ -1,53 +0,0 @@
1
- <?php
2
-
3
- namespace Weglot;
4
-
5
- abstract class WeglotContext
6
- {
7
- protected static $originalLang;
8
-
9
- protected static $destinationLang;
10
-
11
- protected static $homeDirectory;
12
-
13
- protected static $currentLang;
14
-
15
- public static function setOriginalLanguage($originalL)
16
- {
17
- self::$originalLang = $originalL;
18
- }
19
-
20
- public static function setDestinationLanguage($destL)
21
- {
22
- self::$destinationLang = $destL;
23
- }
24
-
25
- public static function getOriginalLanguage()
26
- {
27
- return self::$originalLang;
28
- }
29
-
30
- public static function getDestinationLanguage(){
31
- return self::$destinationLang;
32
- }
33
-
34
- public static function setHomeDirectory($homeDir)
35
- {
36
- self::$homeDirectory = $homeDir;
37
- }
38
-
39
- public static function getHomeDirectory()
40
- {
41
- return self::$homeDirectory;
42
- }
43
-
44
- public static function setCurrentLanguage($currentLang)
45
- {
46
- self::$currentLang = $currentLang;
47
- }
48
-
49
- public static function getCurrentLanguage()
50
- {
51
- return self::$currentLang;
52
- }
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/actions/admin/class-admin-enqueue-weglot.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions\Admin;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+ use WeglotWP\Helpers\Helper_Pages_Weglot;
11
+ use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
12
+
13
+ /**
14
+ * Enqueue CSS / JS on administration
15
+ *
16
+ * @since 2.0
17
+ *
18
+ */
19
+ class Admin_Enqueue_Weglot implements Hooks_Interface_Weglot {
20
+
21
+ /**
22
+ * @since 2.0
23
+ */
24
+ public function __construct() {
25
+ $this->language_services = weglot_get_service( 'Language_Service_Weglot' );
26
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
27
+ $this->user_api_services = weglot_get_service( 'User_Api_Service_Weglot' );
28
+ }
29
+
30
+ /**
31
+ * @see Hooks_Interface_Weglot
32
+ *
33
+ * @since 2.0
34
+ * @return void
35
+ */
36
+ public function hooks() {
37
+ add_action( 'admin_enqueue_scripts', [ $this, 'weglot_admin_enqueue_scripts' ] );
38
+ }
39
+
40
+
41
+ /**
42
+ * Register CSS and JS
43
+ *
44
+ * @see admin_enqueue_scripts
45
+ * @since 2.0
46
+ * @param string $page
47
+ * @return void
48
+ */
49
+ public function weglot_admin_enqueue_scripts( $page ) {
50
+ if ( ! in_array( $page, [ 'toplevel_page_' . Helper_Pages_Weglot::SETTINGS ], true ) ) {
51
+ return;
52
+ }
53
+
54
+ wp_enqueue_script( 'weglot-admin-selectize-js', WEGLOT_URL_DIST . '/selectize.js', [ 'jquery' ] );
55
+
56
+ wp_enqueue_script( 'weglot-admin', WEGLOT_URL_DIST . '/admin-js.js', [ 'weglot-admin-selectize-js' ], [], WEGLOT_VERSION );
57
+
58
+ $user_info = $this->user_api_services->get_user_info();
59
+ $plans = $this->user_api_services->get_plans();
60
+ $limit = 1000;
61
+ if (
62
+ $user_info['plan'] <= 0 ||
63
+ in_array( $user_info['plan'], $plans['starter_free']['ids'] ) // phpcs:ignore
64
+ ) {
65
+ $limit = $plans['starter_free']['limit_language'];
66
+ } elseif (
67
+ in_array( $user_info['plan'], $plans['business']['ids'] ) // phpcs:ignore
68
+ ) {
69
+ $limit = $plans['business']['limit_language'];
70
+ }
71
+
72
+ wp_localize_script( 'weglot-admin', 'weglot_languages', [
73
+ 'available' => $this->language_services->get_languages_available(),
74
+ 'limit' => $limit,
75
+ 'original' => weglot_get_original_language(),
76
+ ]);
77
+
78
+ wp_enqueue_style( 'weglot-admin-css', WEGLOT_URL_DIST . '/css/admin-css.css', [], WEGLOT_VERSION );
79
+
80
+ if ( isset( $_GET['tab'] ) && Helper_Tabs_Admin_Weglot::APPEARANCE === $_GET['tab'] ) { //phpcs:ignore
81
+ wp_enqueue_style( 'weglot-css', WEGLOT_URL_DIST . '/css/front-css.css', [], WEGLOT_VERSION );
82
+ wp_localize_script( 'weglot-admin', 'weglot_css', [
83
+ 'inline' => $this->option_services->get_css_custom_inline(),
84
+ 'flag_css' => $this->option_services->get_option( 'flag_css' ),
85
+ ]);
86
+ }
87
+ }
88
+ }
src/actions/admin/class-customize-menu-weglot.php ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions\Admin;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+ use WeglotWP\Helpers\Helper_Pages_Weglot;
11
+
12
+ /**
13
+ *
14
+ * @since 2.0
15
+ *
16
+ */
17
+ class Customize_Menu_Weglot implements Hooks_Interface_Weglot {
18
+
19
+ /**
20
+ * @since 2.0
21
+ */
22
+ public function __construct() {
23
+ $this->language_services = weglot_get_service( 'Language_Service_Weglot' );
24
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
25
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
26
+ $this->button_services = weglot_get_service( 'Button_Service_Weglot' );
27
+ return $this;
28
+ }
29
+
30
+ /**
31
+ * @see Hooks_Interface_Weglot
32
+ *
33
+ * @since 2.0
34
+ * @return void
35
+ */
36
+ public function hooks() {
37
+ add_action( 'admin_head-nav-menus.php', [ $this, 'add_nav_menu_meta_boxes' ] );
38
+ add_filter( 'nav_menu_link_attributes', [ $this, 'add_nav_menu_link_attributes' ], 10, 2 );
39
+ add_filter( 'nav_menu_css_class', [ $this, 'add_nav_menu_css_class' ], 10, 2 );
40
+
41
+ if ( $this->option_services->get_option( 'is_menu' ) ) {
42
+ add_filter( 'wp_nav_menu_items', [ $this, 'weglot_fallback_menu' ] );
43
+ }
44
+ }
45
+
46
+ /**
47
+ * @since 2.0
48
+ * @param string $items
49
+ * @return string
50
+ */
51
+ public function weglot_fallback_menu( $items ) {
52
+ $button = $this->button_services->get_html();
53
+ $items .= $button;
54
+
55
+ return $items;
56
+ }
57
+
58
+ /**
59
+ * @since 2.0
60
+ * @version 2.0.2
61
+ * @see nav_menu_link_attributes
62
+ * @param array $classes
63
+ * @param object $item
64
+ * @return void
65
+ */
66
+ public function add_nav_menu_css_class( $classes, $item ) {
67
+ $str = 'weglot_menu_title-';
68
+ if ( strpos( $item->post_name, $str ) !== false ) {
69
+ if ( ! $this->request_url_services->is_translatable_url() || ! weglot_current_url_is_eligible() ) {
70
+ $attrs['style'] = 'display:none';
71
+ return $attrs;
72
+ }
73
+
74
+ $options = $this->option_services->get_options();
75
+ $with_flags = $options['with_flags'];
76
+ $type_flags = $options['type_flags'];
77
+
78
+ $flag_class = $with_flags ? 'weglot-flags ' : '';
79
+ $flag_class .= '0' === $type_flags ? '' : 'flag-' . $type_flags . ' ';
80
+
81
+ $lang = explode( '-', substr( $item->post_name, strlen( $str ) ) );
82
+
83
+ $classes[] = apply_filters( 'weglot_nav_menu_link_class', $flag_class . $lang[0] );
84
+ }
85
+
86
+ return $classes;
87
+ }
88
+
89
+ /**
90
+ * @since 2.0
91
+ * @see nav_menu_link_attributes
92
+ * @param array $attrs
93
+ * @param object $item
94
+ * @return void
95
+ */
96
+ public function add_nav_menu_link_attributes( $attrs, $item ) {
97
+ $str = 'weglot_menu_title-';
98
+ if ( strpos( $item->post_name, $str ) !== false ) {
99
+ $current_language = $this->request_url_services->get_current_language();
100
+
101
+ if ( ! $this->request_url_services->is_translatable_url() || ! weglot_current_url_is_eligible() ) {
102
+ $attrs['style'] = 'display:none';
103
+ return $attrs;
104
+ }
105
+
106
+ if ( ! isset( $attrs['class'] ) ) {
107
+ $attrs['class'] = '';
108
+ }
109
+
110
+ $attrs['class'] .= ' weglot-lang';
111
+
112
+ $attrs['data-wg-notranslate'] = 'true';
113
+ }
114
+
115
+ return $attrs;
116
+ }
117
+
118
+ /**
119
+ * @since 2.0
120
+ *
121
+ * @return void
122
+ */
123
+ public function add_nav_menu_meta_boxes() {
124
+ add_meta_box( 'weglot_nav_link', __( 'Weglot switcher', 'weglot' ), [ $this, 'nav_menu_links' ], 'nav-menus', 'side', 'low' );
125
+ }
126
+
127
+ /**
128
+ * Output menu links.
129
+ * @since 2.0
130
+ * @see add_meta_box weglot_nav_link
131
+ */
132
+ public function nav_menu_links() {
133
+ $languages_configured = $this->language_services->get_languages_configured();
134
+
135
+ $languages_configured = apply_filters( 'weglot_custom_nav_menu_items', $languages_configured ); ?>
136
+ <div id="posttype-weglot-languages" class="posttypediv">
137
+ <div id="tabs-panel-weglot-endpoints" class="tabs-panel tabs-panel-active">
138
+ <ul id="weglot-endpoints-checklist" class="categorychecklist form-no-clear">
139
+ <?php
140
+ $i = 1;
141
+ foreach ( $languages_configured as $key => $language ) : //phpcs:ignore
142
+ ?>
143
+ <li>
144
+ <label class="menu-item-title">
145
+ <input type="checkbox" class="menu-item-checkbox" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-object-id]" value="<?php echo esc_attr( $i ); ?>" /> <?php echo esc_html( $language->getEnglishName() ); ?>
146
+ </label>
147
+ <input type="hidden" class="menu-item-type" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-type]" value="custom" />
148
+ <input type="hidden" class="menu-item-title" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-title]" value="[weglot_menu_title-<?php echo esc_attr( $language->getIso639() ); ?>]" />
149
+ <input type="hidden" class="menu-item-url" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-url]" value="[weglot_menu_current_url-<?php echo esc_attr( $language->getIso639() ); ?>]" />
150
+ <input type="hidden" class="menu-item-classes" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-classes]" />
151
+ </li>
152
+ <?php
153
+ $i++;
154
+ endforeach; //phpcs:ignore ?>
155
+ </ul>
156
+ </div>
157
+ <p class="button-controls">
158
+ <span class="list-controls">
159
+ <a href="<?php echo esc_url( admin_url( 'nav-menus.php?page-tab=all&selectall=1#posttype-weglot-languages' ) ); ?>" class="select-all"><?php esc_html_e( 'Select all', 'weglot' ); ?></a>
160
+ </span>
161
+ <span class="add-to-menu">
162
+ <button type="submit" class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to menu', 'weglot' ); ?>" name="add-post-type-menu-item" id="submit-posttype-weglot-languages"><?php esc_html_e( 'Add to menu', 'weglot' ); ?></button>
163
+ <span class="spinner"></span>
164
+ </span>
165
+ </p>
166
+ </div>
167
+ <?php
168
+ }
169
+ }
170
+
src/actions/admin/class-options-weglot.php ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions\Admin;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
10
+
11
+ use WeglotWP\Models\Hooks_Interface_Weglot;
12
+
13
+ /**
14
+ * Sanitize options after submit form
15
+ *
16
+ * @since 2.0
17
+ */
18
+ class Options_Weglot implements Hooks_Interface_Weglot {
19
+
20
+ /**
21
+ * @since 2.0
22
+ */
23
+ public function __construct() {
24
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
25
+ $this->user_api_services = weglot_get_service( 'User_Api_Service_Weglot' );
26
+ }
27
+
28
+ /**
29
+ * @see Hooks_Interface_Weglot
30
+ *
31
+ * @since 2.0
32
+ * @return void
33
+ */
34
+ public function hooks() {
35
+ add_action( 'admin_init', [ $this, 'weglot_options_init' ] );
36
+ $api_key = $this->option_services->get_option( 'api_key' );
37
+ if ( empty( $api_key ) ) {
38
+ add_action( 'admin_notices', [ '\WeglotWP\Notices\No_Configuration_Weglot', 'admin_notice' ] );
39
+ }
40
+ }
41
+
42
+ /**
43
+ * Activate plugin
44
+ *
45
+ * @return void
46
+ */
47
+ public function activate() {
48
+ update_option( 'weglot_version', WEGLOT_VERSION );
49
+ $options = $this->option_services->get_options();
50
+
51
+ $this->option_services->set_options( $options );
52
+ }
53
+
54
+ /**
55
+ * Register setting options
56
+ *
57
+ * @see admin_init
58
+ * @since 2.0
59
+ *
60
+ * @return void
61
+ */
62
+ public function weglot_options_init() {
63
+ register_setting( WEGLOT_OPTION_GROUP, WEGLOT_SLUG, [ $this, 'sanitize_options' ] );
64
+ }
65
+
66
+ /**
67
+ * Callback register_setting for sanitize options
68
+ *
69
+ * @since 2.0
70
+ *
71
+ * @param array $options
72
+ * @return array
73
+ */
74
+ public function sanitize_options( $options ) {
75
+ $tab = ( isset( $_POST['tab'] ) ) ? $_POST['tab'] : null; //phpcs:ignore
76
+ $options_bdd = $this->option_services->get_options();
77
+
78
+ $new_options = wp_parse_args( $options, $options_bdd );
79
+
80
+ switch ( $tab ) {
81
+ case Helper_Tabs_Admin_Weglot::SETTINGS:
82
+ $new_options = $this->sanitize_options_settings( $new_options, $options );
83
+ if ( $options_bdd['has_first_settings'] ) {
84
+ $new_options['has_first_settings'] = false;
85
+ $new_options['show_box_first_settings'] = true;
86
+ }
87
+ break;
88
+ case Helper_Tabs_Admin_Weglot::APPEARANCE:
89
+ $new_options = $this->sanitize_options_appearance( $new_options, $options );
90
+ break;
91
+ case Helper_Tabs_Admin_Weglot::ADVANCED:
92
+ $new_options = $this->sanitize_options_advanced( $new_options, $options );
93
+ break;
94
+ }
95
+
96
+ return $new_options;
97
+ }
98
+
99
+ /**
100
+ * @since 2.0
101
+ * @param array $new_options
102
+ * @param array $options
103
+ * @return array
104
+ */
105
+ public function sanitize_options_settings( $new_options, $options ) {
106
+ $user_info = $this->user_api_services->get_user_info();
107
+ $plans = $this->user_api_services->get_plans();
108
+ $options_bdd = $this->option_services->get_options();
109
+
110
+ $old_destination_languages = array_diff( $options_bdd['destination_language'], $new_options['destination_language'] );
111
+
112
+ if ( ! empty( $old_destination_languages ) ) {
113
+ foreach ( $old_destination_languages as $destination_language ) {
114
+ $nav_menu = get_page_by_title( sprintf( '[weglot_menu_title-%s]', $destination_language ), 'OBJECT', 'nav_menu_item' ); //phpcs:ignore
115
+ if ( ! $nav_menu ) {
116
+ continue;
117
+ }
118
+ wp_delete_post( $nav_menu->ID, true );
119
+ }
120
+ }
121
+
122
+ // Limit language
123
+ if (
124
+ $user_info['plan'] <= 0 ||
125
+ in_array( $user_info['plan'], $plans['starter_free']['ids'] ) // phpcs:ignore
126
+ ) {
127
+ $new_options['destination_language'] = array_splice( $options['destination_language'], 0, $plans['starter_free']['limit_language'] );
128
+ } elseif (
129
+ in_array( $user_info['plan'], $plans['business']['ids'] ) // phpcs:ignore
130
+ ) {
131
+ $new_options['destination_language'] = array_splice( $options['destination_language'], 0, $plans['business']['limit_language'] );
132
+ }
133
+
134
+ if ( isset( $options['exclude_urls'] ) ) {
135
+ $new_options['exclude_urls'] = array_filter( $options['exclude_urls'], function( $value ) {
136
+ return '' !== $value;
137
+ } );
138
+ } else {
139
+ $new_options['exclude_urls'] = [];
140
+ }
141
+
142
+ if ( isset( $options['exclude_blocks'] ) ) {
143
+ $new_options['exclude_blocks'] = array_filter( $options['exclude_blocks'], function( $value ) {
144
+ return '' !== $value;
145
+ } );
146
+ } else {
147
+ $new_options['exclude_blocks'] = [];
148
+ }
149
+
150
+ return $new_options;
151
+ }
152
+
153
+ /**
154
+ * @since 2.0
155
+ * @param array $new_options
156
+ * @param array $options
157
+ * @return array
158
+ */
159
+ public function sanitize_options_advanced( $new_options, $options ) {
160
+ $new_options['auto_redirect'] = isset( $options['auto_redirect'] ) ? 1 : 0;
161
+ $new_options['email_translate'] = isset( $options['email_translate'] ) ? 1 : 0;
162
+ $new_options['translate_amp'] = isset( $options['translate_amp'] ) ? 1 : 0;
163
+ return $new_options;
164
+ }
165
+
166
+ /**
167
+ * @since 2.0
168
+ * @param array $new_options
169
+ * @param array $options
170
+ * @return array
171
+ */
172
+ public function sanitize_options_appearance( $new_options, $options ) {
173
+ $new_options['is_menu'] = isset( $options['is_menu'] ) ? 1 : 0;
174
+ $new_options['is_fullname'] = isset( $options['is_fullname'] ) ? 1 : 0;
175
+ $new_options['with_name'] = isset( $options['with_name'] ) ? 1 : 0;
176
+ $new_options['is_dropdown'] = isset( $options['is_dropdown'] ) ? 1 : 0;
177
+ $new_options['with_flags'] = isset( $options['with_flags'] ) ? 1 : 0;
178
+
179
+ $new_options['type_flags'] = isset( $options['type_flags'] ) ? $options['type_flags'] : '0';
180
+ $new_options['override_css'] = isset( $options['override_css'] ) ? $options['override_css'] : '';
181
+ $new_options['flag_css'] = isset( $options['flag_css'] ) ? $options['flag_css'] : '';
182
+
183
+ return $new_options;
184
+ }
185
+ }
src/actions/admin/class-pages-weglot.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions\Admin;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+
11
+ use WeglotWP\Helpers\Helper_Pages_Weglot;
12
+ use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
13
+
14
+ /**
15
+ * Register pages administration
16
+ *
17
+ * @since 2.0
18
+ *
19
+ */
20
+ class Pages_Weglot implements Hooks_Interface_Weglot {
21
+
22
+ /**
23
+ * @since 2.0
24
+ */
25
+ public function __construct() {
26
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
27
+ $this->language_services = weglot_get_service( 'Language_Service_Weglot' );
28
+ $this->button_services = weglot_get_service( 'Button_Service_Weglot' );
29
+ $this->user_api_services = weglot_get_service( 'User_Api_Service_Weglot' );
30
+ return $this;
31
+ }
32
+
33
+ /**
34
+ * @see Hooks_Interface_Weglot
35
+ *
36
+ * @since 2.0
37
+ * @return void
38
+ */
39
+ public function hooks() {
40
+ add_action( 'admin_menu', [ $this, 'weglot_plugin_menu' ] );
41
+ }
42
+
43
+ /**
44
+ * Add menu and sub pages
45
+ *
46
+ * @see admin_menu
47
+ *
48
+ * @since 2.0
49
+ * @return void
50
+ */
51
+ public function weglot_plugin_menu() {
52
+ add_menu_page( 'Weglot', 'Weglot', 'manage_options', Helper_Pages_Weglot::SETTINGS, [ $this, 'weglot_plugin_settings_page' ], WEGLOT_URL_DIST . '/images/weglot_fav_bw.png' );
53
+ }
54
+
55
+ /**
56
+ * Page settings
57
+ *
58
+ * @since 2.0
59
+ *
60
+ * @return void
61
+ */
62
+ public function weglot_plugin_settings_page() {
63
+ $this->tabs = Helper_Tabs_Admin_Weglot::get_full_tabs();
64
+ $this->tab_active = Helper_Tabs_Admin_Weglot::SETTINGS;
65
+
66
+ if ( isset( $_GET['tab'] ) ) { // phpcs:ignore
67
+ $this->tab_active = sanitize_text_field( wp_unslash( $_GET['tab'] ) ); // phpcs:ignore
68
+ }
69
+
70
+ $this->options = $this->option_services->get_options();
71
+
72
+ try {
73
+ $user_info = $this->user_api_services->get_user_info();
74
+ $this->option_services->set_option_by_key( 'allowed', $user_info['allowed'] );
75
+ } catch ( \Exception $e ) {
76
+ // If an exception occurs, do nothing, keep wg_allowed.
77
+ }
78
+
79
+ include_once WEGLOT_TEMPLATES_ADMIN_PAGES . '/settings.php';
80
+ }
81
+ }
src/actions/admin/class-permalink-weglot.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions\Admin;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+ /**
11
+ * Permalink Weglot
12
+ *
13
+ * @since 2.0
14
+ */
15
+ class Permalink_Weglot {
16
+
17
+ /**
18
+ *
19
+ * @since 2.0
20
+ * @return void
21
+ */
22
+ public function activate() {
23
+ $structure = get_option( 'permalink_structure' );
24
+ if ( empty( $structure ) ) {
25
+ add_option( 'weglot_old_permalink_structure', $structure );
26
+ update_option( 'permalink_structure', '/%postname%/' );
27
+ }
28
+ }
29
+
30
+ /**
31
+ *
32
+ * @since 2.0
33
+ * @return void
34
+ */
35
+ public function deactivate() {
36
+ $old_structure = get_option( 'weglot_old_permalink_structure' );
37
+ if ( $old_structure ) {
38
+ delete_option( 'weglot_old_permalink_structure' );
39
+ update_option( 'permalink_structure', $old_structure );
40
+ }
41
+ }
42
+ }
43
+
src/actions/admin/class-plugin-links-weglot.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions\Admin;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+ use WeglotWP\Helpers\Helper_Pages_Weglot;
11
+
12
+ /**
13
+ * Update links on plugin page
14
+ *
15
+ * @since 2.0
16
+ */
17
+ class Plugin_Links_Weglot implements Hooks_Interface_Weglot {
18
+ /**
19
+ * @see Hooks_Interface_Weglot
20
+ *
21
+ * @since 2.0
22
+ * @return void
23
+ */
24
+ public function hooks() {
25
+ add_filter( 'plugin_action_links_' . WEGLOT_BNAME, [ $this, 'weglot_plugin_action_links' ] );
26
+ }
27
+
28
+ /**
29
+ * Add links
30
+ *
31
+ * @see plugin_action_links_WEGLOT_BNAME
32
+ *
33
+ * @param array $links
34
+ * @return array
35
+ */
36
+ public function weglot_plugin_action_links( $links ) {
37
+ $url = get_admin_url( null, sprintf( 'admin.php?page=%s', Helper_Pages_Weglot::SETTINGS ) );
38
+ $text = __( 'Settings', 'weglot' );
39
+
40
+ $links[] = sprintf( '<a href="%s">%s</a>', $url, $text );
41
+ return $links;
42
+ }
43
+ }
44
+
src/actions/class-email-translate-weglot.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+
11
+ use Weglot\Client\Client;
12
+ use Weglot\Parser\Parser;
13
+ use Weglot\Parser\ConfigProvider\ServerConfigProvider;
14
+
15
+
16
+ /**
17
+ * Translate Emails who use wp_mail
18
+ *
19
+ * @since 2.0
20
+ *
21
+ */
22
+ class Email_Translate_Weglot implements Hooks_Interface_Weglot {
23
+
24
+ /**
25
+ * @since 2.0
26
+ */
27
+ public function __construct() {
28
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
29
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
30
+ }
31
+
32
+ /**
33
+ * @see Hooks_Interface_Weglot
34
+ *
35
+ * @since 2.0
36
+ * @return void
37
+ */
38
+ public function hooks() {
39
+ add_filter( 'wp_mail', [ $this, 'weglot_translate_emails' ], 10, 1 );
40
+ }
41
+
42
+ /**
43
+ * Translate emails
44
+ *
45
+ * @since 2.0
46
+ * @param array $args
47
+ * @return array
48
+ */
49
+ public function weglot_translate_emails( $args ) {
50
+ $translate_email = $this->option_services->get_option( 'email_translate' );
51
+ if ( ! $translate_email ) {
52
+ return $args;
53
+ }
54
+
55
+ $current_and_original_language = weglot_get_current_and_original_language();
56
+
57
+ $message_and_subject = [
58
+ 'subject' => $args['subject'],
59
+ 'message' => $args['message'],
60
+ ];
61
+
62
+ if ( $current_and_original_language['current'] !== $current_and_original_language['original'] ) {
63
+ $message_and_subject_translated = $this->translate_email( $message_and_subject, $current_and_original_language['current'] );
64
+ } elseif ( isset( $_SERVER['HTTP_REFERER'] ) ) { //phpcs:ignore
65
+ $url = $this->request_url_services
66
+ ->create_url_object( $_SERVER['HTTP_REFERER'] ); //phpcs:ignore
67
+
68
+ $choose_current_language = $url->detectCurrentLanguage();
69
+ if ( $choose_current_language !== $current_and_original_language['original'] ) { //If language in referer
70
+ $message_and_subject_translated = $this->translate_email( $message_and_subject, $choose_current_language );
71
+ } elseif ( strpos( $_SERVER['HTTP_REFERER'], 'wg_language=' ) !== false ) { //phpcs:ignore
72
+ //If language in parameter
73
+
74
+ $pos = strpos( $_SERVER['HTTP_REFERER'], 'wg_language=' ); //phpcs:ignore
75
+ $start = $pos + strlen( 'wg_language=' );
76
+ $choose_current_language = substr( $_SERVER['HTTP_REFERER'], $start, 2 ); //phpcs:ignore
77
+ if ( $choose_current_language && $choose_current_language !== $current_and_original_language['original'] ) {
78
+ $message_and_subject_translated = $this->translate_email( $message_and_subject, $choose_current_language );
79
+ }
80
+ }
81
+ }
82
+
83
+ if ( strpos( $message_and_subject_translated['subject'], '</p>' ) !== false ) {
84
+ $pos = strpos( $message_and_subject_translated['subject'], '</p>' ) + 4;
85
+ $args['subject'] = substr( $message_and_subject_translated['subject'], 3, $pos - 7 );
86
+ $args['message'] = $message_and_subject_translated['message'];
87
+ }
88
+
89
+ return $args;
90
+ }
91
+
92
+ /**
93
+ * Translate email with parser
94
+ *
95
+ * @param string $body
96
+ * @param string $language
97
+ * @param mixed $args
98
+ * @return mixed
99
+ */
100
+ protected function translate_email( $args, $language ) {
101
+ $api_key = $this->option_services->get_option( 'api_key' );
102
+
103
+ if ( ! $api_key ) {
104
+ return $args;
105
+ }
106
+
107
+ $current_and_original_language = weglot_get_current_and_original_language();
108
+ $exclude_blocks = $this->option_services->get_exclude_blocks();
109
+
110
+ $config = new ServerConfigProvider();
111
+ $client = new Client( $api_key );
112
+ $parser = new Parser( $client, $config, $exclude_blocks );
113
+
114
+ $translated_subject = $parser->translate( '<p>' . $args['subject'] . '</p>', $current_and_original_language['original'], $current_and_original_language['current'] ); //phpcs:ignore
115
+ $translated_message = $parser->translate( $args['message'], $current_and_original_language['original'], $current_and_original_language['current'] ); //phpcs:ignore
116
+
117
+ return [
118
+ 'subject' => $translated_subject,
119
+ 'message' => $translated_message,
120
+ ];
121
+ }
122
+ }
src/actions/class-migration-weglot.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions;
4
+
5
+ defined( 'ABSPATH' ) or die( 'Cheatin&#8217; uh?' );
6
+
7
+ use WeglotWP\Models\Hooks_Interface_Weglot;
8
+
9
+ /**
10
+ * Migration Weglot
11
+ *
12
+ * @since 2.0
13
+ */
14
+ class Migration_Weglot implements Hooks_Interface_Weglot {
15
+
16
+
17
+ /**
18
+ * @since 2.0
19
+ */
20
+ public function __construct() {
21
+ $this->migration_services = weglot_get_service( 'Migration_Service_Weglot' );
22
+ }
23
+
24
+
25
+ /**
26
+ * @see HooksInterface
27
+ * @return void
28
+ */
29
+ public function hooks() {
30
+ if ( ! defined( 'WEGLOT_LATEST_VERSION' ) && ! defined( 'WEGLOT_VERSION' ) ) {
31
+ return;
32
+ }
33
+
34
+ $weglot_version = get_option( 'weglot_version' );
35
+ if ( ! $weglot_version && version_compare( WEGLOT_LATEST_VERSION, '2.0', '<' ) ) {
36
+ $this->migration_services->update_v200();
37
+ }
38
+ }
39
+ }
src/actions/class-register-widget-weglot.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions;
4
+
5
+ defined( 'ABSPATH' ) or die( 'Cheatin&#8217; uh?' );
6
+
7
+ use WeglotWP\Models\Hooks_Interface_Weglot;
8
+
9
+ /**
10
+ * Registe widget weglot
11
+ *
12
+ * @since 2.0
13
+ */
14
+ class Register_Widget_Weglot implements Hooks_Interface_Weglot {
15
+
16
+ /**
17
+ * @see HooksInterface
18
+ * @return void
19
+ */
20
+ public function hooks() {
21
+ add_action( 'widgets_init', [ $this, 'register_widget_weglot' ] );
22
+ }
23
+
24
+ /**
25
+ * @since 2.0
26
+ * @return void
27
+ */
28
+ public function register_widget_weglot() {
29
+ register_widget( 'WeglotWP\Widgets\Widget_Selector_Weglot' );
30
+ }
31
+ }
src/actions/front/class-front-enqueue-weglot.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions\Front;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+
11
+ /**
12
+ * Enqueue CSS / JS on front
13
+ *
14
+ * @since 2.0
15
+ */
16
+ class Front_Enqueue_Weglot implements Hooks_Interface_Weglot {
17
+
18
+ /**
19
+ * @since 2.0
20
+ */
21
+ public function __construct() {
22
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
23
+ }
24
+
25
+ /**
26
+ * @see Hooks_Interface_Weglot
27
+ *
28
+ * @since 2.0
29
+ * @return void
30
+ */
31
+ public function hooks() {
32
+ add_action( 'wp_enqueue_scripts', [ $this, 'weglot_wp_enqueue_scripts' ] );
33
+ add_action( 'login_enqueue_scripts', [ $this, 'weglot_wp_enqueue_scripts' ] );
34
+ }
35
+
36
+
37
+
38
+ /**
39
+ * @see wp_enqueue_scripts
40
+ * @since 2.0
41
+ *
42
+ * @return void
43
+ */
44
+ public function weglot_wp_enqueue_scripts() {
45
+
46
+ // Add JS
47
+ wp_register_script( 'wp-weglot-js', WEGLOT_URL_DIST . '/front-js.js', false, WEGLOT_VERSION, false );
48
+ wp_enqueue_script( 'wp-weglot-js' );
49
+
50
+ // Add CSS
51
+ wp_register_style( 'weglot-css', WEGLOT_URL_DIST . '/css/front-css.css', false, WEGLOT_VERSION, false );
52
+ wp_enqueue_style( 'weglot-css' );
53
+
54
+ wp_add_inline_style( 'weglot-css', $this->option_services->get_css_custom_inline() );
55
+ wp_add_inline_style( 'weglot-css', $this->option_services->get_flag_css() );
56
+ }
57
+ }
src/actions/front/class-redirect-log-user-weglot.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions\Front;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+
11
+ /**
12
+ *
13
+ * @since 2.0
14
+ */
15
+ class Redirect_Log_User_Weglot implements Hooks_Interface_Weglot {
16
+
17
+ /**
18
+ * @see Hooks_Interface_Weglot
19
+ *
20
+ * @since 2.0
21
+ * @return void
22
+ */
23
+ public function hooks() {
24
+ // add_filter( 'login_redirect', [ '\WeglotWP\Helpers\Helper_Filter_Url_Weglot', 'filter_url_log_redirect' ] );
25
+ add_filter( 'logout_redirect', [ '\WeglotWP\Helpers\Helper_Filter_Url_Weglot', 'filter_url_log_redirect' ] );
26
+ }
27
+ }
28
+
src/actions/front/class-shortcode-weglot.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions\Front;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+
11
+ /**
12
+ *
13
+ * @since 2.0
14
+ */
15
+ class Shortcode_Weglot {
16
+
17
+ /**
18
+ * @since 2.0
19
+ */
20
+ public function __construct() {
21
+ $this->button_services = weglot_get_service( 'Button_Service_Weglot' );
22
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
23
+
24
+ add_shortcode( 'weglot_switcher', [ $this, 'weglot_switcher_callback' ] );
25
+ }
26
+
27
+ /**
28
+ * @see weglot_switcher
29
+ * @since 2.0
30
+ *
31
+ * @return string
32
+ */
33
+ public function weglot_switcher_callback() {
34
+ if ( ! $this->request_url_services->is_translatable_url() ) {
35
+ return;
36
+ }
37
+
38
+ return $this->button_services->get_html( 'weglot-shortcode' ); //phpcs:ignore
39
+ }
40
+ }
src/actions/front/class-translate-page-weglot.php ADDED
@@ -0,0 +1,412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Actions\Front;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+
11
+ use Weglot\Client\Api\Enum\BotType;
12
+ use Weglot\Client\Client;
13
+ use Weglot\Util\Server;
14
+ use Weglot\Client\Api\Exception\ApiError;
15
+
16
+ /**
17
+ * Translate page
18
+ *
19
+ * @since 2.0
20
+ */
21
+ class Translate_Page_Weglot implements Hooks_Interface_Weglot {
22
+
23
+ /**
24
+ * @since 2.0
25
+ */
26
+ public function __construct() {
27
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
28
+ $this->button_services = weglot_get_service( 'Button_Service_Weglot' );
29
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
30
+ $this->redirect_services = weglot_get_service( 'Redirect_Service_Weglot' );
31
+ $this->replace_url_services = weglot_get_service( 'Replace_Url_Service_Weglot' );
32
+ $this->replace_link_services = weglot_get_service( 'Replace_Link_Service_Weglot' );
33
+ $this->language_services = weglot_get_service( 'Language_Service_Weglot' );
34
+ $this->parser_services = weglot_get_service( 'Parser_Service_Weglot' );
35
+ $this->wc_active_services = weglot_get_service( 'WC_Active_Weglot' );
36
+ $this->other_translate_services = weglot_get_service( 'Other_Translate_Service_Weglot' );
37
+ }
38
+
39
+
40
+ /**
41
+ * @see Hooks_Interface_Weglot
42
+ *
43
+ * @since 2.0
44
+ * @return void
45
+ */
46
+ public function hooks() {
47
+ if ( is_admin() ) {
48
+ return;
49
+ }
50
+
51
+ $this->api_key = $this->option_services->get_option( 'api_key' );
52
+
53
+ if ( ! $this->api_key ) {
54
+ return;
55
+ }
56
+
57
+ if (
58
+ null === $this->request_url_services->get_current_language() ||
59
+ ! $this->request_url_services->is_translatable_url()
60
+ ) {
61
+ return;
62
+ }
63
+
64
+ $this->current_language = $this->request_url_services->get_current_language();
65
+
66
+ $this->prepare_rtl_language();
67
+
68
+ add_action( 'init', [ $this, 'weglot_init' ] );
69
+ add_action( 'wp_head', [ $this, 'weglot_href_lang' ] );
70
+ }
71
+
72
+ /**
73
+ * @see init
74
+ * @since 2.0
75
+ * @version 2.0.1
76
+ * @return void
77
+ */
78
+ public function weglot_init() {
79
+ do_action( 'weglot_init_start' );
80
+
81
+ $this->noredirect = false;
82
+ $this->original_language = $this->option_services->get_option( 'original_language' );
83
+ if ( empty( $this->original_language ) ) {
84
+ return;
85
+ }
86
+
87
+ $full_url = $this->request_url_services->get_full_url();
88
+ // URL not eligible
89
+ if ( ! $this->request_url_services->is_eligible_url( $full_url ) ) {
90
+ return;
91
+ }
92
+
93
+ $active_translation = apply_filters( 'weglot_active_translation', true );
94
+ // Default : yes
95
+ if ( ! $active_translation ) {
96
+ return;
97
+ }
98
+
99
+ $this->redirect_services->verify_no_redirect();
100
+ $this->check_need_to_redirect();
101
+ $this->prepare_request_uri();
102
+
103
+ do_action( 'weglot_init_before_translate_page' );
104
+
105
+ if ( ! function_exists( 'curl_version' ) ) {
106
+ return;
107
+ }
108
+
109
+ ob_start( [ $this, 'weglot_treat_page' ] );
110
+ }
111
+
112
+
113
+
114
+ /**
115
+ * @since 2.0
116
+ *
117
+ * @param array $array
118
+ * @param string $to
119
+ * @param Parser $parser
120
+ * @return void
121
+ */
122
+ public function translate_array( $array ) {
123
+ $array_not_ajax_html = apply_filters( 'weglot_array_not_ajax_html', [ 'redirecturl', 'url' ] );
124
+
125
+ foreach ( $array as $key => $val ) {
126
+ if ( is_array( $val ) ) {
127
+ $array[ $key ] = $this->translate_array( $val );
128
+ } else {
129
+ if ( $this->is_ajax_html( $val ) ) {
130
+ $parser = $this->parser_services->get_parser();
131
+ $array[$key] = $parser->translate( $val, $this->original_language, $this->current_language ); //phpcs:ignore
132
+ } elseif ( in_array( $key, $array_not_ajax_html ) ) { //phpcs:ignore
133
+ $array[$key] = $this->replace_link_services->replace_url( $val ); //phpcs:ignore
134
+ }
135
+ }
136
+ }
137
+
138
+ return $array;
139
+ }
140
+
141
+ /**
142
+ * @since 2.0
143
+ *
144
+ * @param string $string
145
+ * @return boolean
146
+ */
147
+ public function is_ajax_html( $string ) {
148
+ $preg_match_ajax_html = apply_filters( 'weglot_is_ajax_html_regex', '/<(a|div|span|p|i|aside|input|textarea|select|h1|h2|h3|h4|meta|button|form|li|strong|ul|option)/' );
149
+ $result = preg_match_all( $preg_match_ajax_html, $string, $m, PREG_PATTERN_ORDER );
150
+
151
+ if ( isset( $string[0] ) && '{' !== $string[0] && $result && $result >= 1 ) {
152
+ return true;
153
+ } else {
154
+ return false;
155
+ }
156
+ }
157
+
158
+
159
+ /**
160
+ * @since 2.0
161
+ *
162
+ * @return void
163
+ */
164
+ public function check_need_to_redirect() {
165
+ if (
166
+ ! wp_doing_ajax() && // no ajax
167
+ $this->request_url_services->get_weglot_url()->getBaseUrl() === '/' && // front_page
168
+ ! $this->redirect_services->get_no_redirect() && // No force redirect
169
+ ! Server::detectBot( $_SERVER ) !== BotType::OTHER && //phpcs:ignore
170
+ $this->option_services->get_option( 'auto_redirect' ) // have option redirect
171
+ ) {
172
+ $this->redirect_services->auto_redirect();
173
+ }
174
+ }
175
+
176
+ /**
177
+ * @since 2.0
178
+ *
179
+ * @return void
180
+ */
181
+ public function prepare_request_uri() {
182
+ // Use for good process on URL
183
+ $_SERVER['REQUEST_URI'] = str_replace(
184
+ '/' . $this->current_language . '/',
185
+ '/',
186
+ $_SERVER['REQUEST_URI'] //phpcs:ignore
187
+ );
188
+ }
189
+
190
+ /**
191
+ * @since 2.0
192
+ *
193
+ * @return void
194
+ */
195
+ public function prepare_rtl_language() {
196
+ if ( $this->request_url_services->is_language_rtl( $this->current_language ) ) {
197
+ $GLOBALS['text_direction'] = 'rtl';
198
+ } else {
199
+ $GLOBALS['text_direction'] = 'ltr';
200
+ }
201
+ }
202
+
203
+ /**
204
+ * @since 2.0.2
205
+ *
206
+ * Check if there are Weglot menu links and make sure there is the data-wg-notranslate
207
+ * @param string $content
208
+ * @return string
209
+ */
210
+ public function fix_menu_link( $content ) {
211
+ $content = preg_replace( '#<a([^\>]+?)?href="(http|https):\/\/\[weglot_#', '<a$1 data-wg-notranslate="true" href="$2://[weglot_', $content );
212
+
213
+ return $content;
214
+ }
215
+
216
+ /**
217
+ * @see weglot_init / ob_start
218
+ * @since 2.0
219
+ * @version 2.0.2
220
+ * @param string $content
221
+ * @return string
222
+ */
223
+ public function weglot_treat_page( $content ) {
224
+ $allowed = $this->option_services->get_option( 'allowed' );
225
+
226
+ if ( ! $allowed ) {
227
+ $content = $this->weglot_render_dom( $content );
228
+ return $content . '<!--Not allowed-->';
229
+ }
230
+
231
+ // No need to translate but prepare new dom with button
232
+ if ( $this->current_language === $this->original_language ) {
233
+ return $this->weglot_render_dom( $content );
234
+ }
235
+
236
+ $parser = $this->parser_services->get_parser();
237
+
238
+ // Choose type translate
239
+ $type = ( $this->is_json( $content ) ) ? 'json' : 'html';
240
+ $type = apply_filters( 'weglot_type_treat_page', $type );
241
+
242
+ try {
243
+ switch ( $type ) {
244
+ case 'json':
245
+ $json = json_decode( $content, true );
246
+ $content = $this->translate_array( $json );
247
+ $content = apply_filters( 'weglot_json_treat_page', $content );
248
+
249
+ return wp_json_encode( $content );
250
+ break;
251
+ case 'html':
252
+ $content = $this->fix_menu_link( $content );
253
+ $translated_content = $parser->translate( $content, $this->original_language, $this->current_language ); // phpcs:ignore
254
+
255
+ if ( $this->wc_active_services->is_active() ) {
256
+ // @TODO : Improve this with multiple service
257
+ $translated_content = weglot_get_service( 'WC_Translate_Weglot' )->translate_words( $translated_content );
258
+ }
259
+
260
+ $translated_content = $this->other_translate_services->translate_words( $translated_content );
261
+
262
+ $translated_content = apply_filters( 'weglot_html_treat_page', $translated_content );
263
+
264
+ return $this->weglot_render_dom( $translated_content );
265
+ break;
266
+ default:
267
+ $name_filter = sprintf( 'weglot_%s_treat_page', $type );
268
+ return apply_filters( $name_filter, $content, $parser, $this->original_language, $this->current_language );
269
+ break;
270
+
271
+ }
272
+ } catch ( ApiError $e ) {
273
+ $content .= '<!--Weglot error API : ' . $this->remove_comments( $e->getMessage() ) . '-->';
274
+ if ( strpos( $e->getMessage(), 'NMC' ) !== false ) {
275
+ $this->option_services->set_option_by_key( 'allowed', false );
276
+ }
277
+ return $content;
278
+ } catch ( \Exception $e ) {
279
+ $content .= '<!--Weglot error : ' . $this->remove_comments( $e->getMessage() ) . '-->';
280
+ return $content;
281
+ }
282
+ }
283
+
284
+ /**
285
+ * @since 2.0
286
+ *
287
+ * @param string $html
288
+ * @return string
289
+ */
290
+ private function remove_comments( $html ) {
291
+ return preg_replace( '/<!--(.*)-->/Uis', '', $html );
292
+ }
293
+
294
+ /**
295
+ * @since 2.0
296
+ *
297
+ * @param string $string
298
+ * @return boolean
299
+ */
300
+ public function is_json( $string ) {
301
+ return is_string( $string ) && is_array( json_decode( $string, true ) ) && ( JSON_ERROR_NONE === json_last_error() ) ? true : false;
302
+ }
303
+
304
+ /**
305
+ * @since 2.0
306
+ * @param string $dom
307
+ * @return string
308
+ */
309
+ public function weglot_add_button_html( $dom ) {
310
+ $options = $this->option_services->get_options();
311
+
312
+ // Place the button if we see markup
313
+ if ( strpos( $dom, '<div id="weglot_here"></div>' ) !== false ) {
314
+ $button_html = $this->button_services->get_html( 'weglot-shortcode' );
315
+ $dom = str_replace( '<div id="weglot_here"></div>', $button_html, $dom );
316
+ }
317
+
318
+ if ( strpos( $dom, '[weglot_menu' ) !== false ) {
319
+ $languages_configured = $this->language_services->get_languages_configured();
320
+
321
+ $is_fullname = $options['is_fullname'];
322
+ $with_name = $options['with_name'];
323
+
324
+ foreach ( $languages_configured as $language ) {
325
+ $shortcode_title = sprintf( '\[weglot_menu_title-%s\]', $language->getIso639() );
326
+ $shortcode_title_without_bracket = sprintf( 'weglot_menu_title-%s', $language->getIso639() );
327
+ $shortcode_title_html = str_replace( '\[', '%5B', $shortcode_title );
328
+ $shortcode_title_html = str_replace( '\]', '%5D', $shortcode_title_html );
329
+ $shortcode_url = sprintf( '(http|https):\/\/\[weglot_menu_current_url-%s\]', $language->getIso639() );
330
+ $shortcode_url_html = str_replace( '\[', '%5B', $shortcode_url );
331
+ $shortcode_url_html = str_replace( '\]', '%5D', $shortcode_url_html );
332
+
333
+ $url = $this->request_url_services->get_weglot_url();
334
+
335
+ $name = '';
336
+ if ( $with_name ) {
337
+ $name = ( $is_fullname ) ? $language->getLocalName() : strtoupper( $language->getIso639() );
338
+ }
339
+
340
+ $dom = preg_replace( '#' . $shortcode_title . '#i', $name, $dom );
341
+ $dom = preg_replace( '#' . $shortcode_title_html . '#i', $name, $dom );
342
+ $dom = preg_replace( '#' . $shortcode_title_without_bracket . '#i', $name, $dom );
343
+
344
+ $link_menu = $url->getForLanguage( $language->getIso639() );
345
+ if ( weglot_has_auto_redirect() && strpos( $link_menu, 'no_lredirect' ) === false && ( is_home() || is_front_page() ) ) {
346
+ $link_menu .= '?no_lredirect=true';
347
+ }
348
+
349
+ $dom = preg_replace( '#' . $shortcode_url . '#i', $link_menu, $dom );
350
+ $dom = preg_replace( '#' . $shortcode_url_html . '#i', $link_menu, $dom );
351
+ }
352
+
353
+ $dom .= sprintf( '<!--Weglot %s-->', WEGLOT_VERSION );
354
+ }
355
+
356
+ // Place the button if not in the page
357
+ if ( strpos( $dom, sprintf( '<!--Weglot %s-->', WEGLOT_VERSION ) ) === false ) {
358
+ $button_html = $this->button_services->get_html( 'weglot-default' );
359
+ $dom = ( strpos( $dom, '</body>' ) !== false) ? str_replace( '</body>', $button_html . ' </body>', $dom ) : str_replace( '</footer>', $button_html . ' </footer>', $dom );
360
+ }
361
+
362
+ return $dom;
363
+ }
364
+
365
+ /**
366
+ * @since 2.0
367
+ * @param string $dom
368
+ * @return string
369
+ */
370
+ public function weglot_replace_link( $dom ) {
371
+ $dom = $this->replace_url_services->modify_link( '/<a([^\>]+?)?href=(\"|\')([^\s\>]+?)(\"|\')([^\>]+?)?>/', $dom, 'a' );
372
+ $dom = $this->replace_url_services->modify_link( '/<([^\>]+?)?data-link=(\"|\')([^\s\>]+?)(\"|\')([^\>]+?)?>/', $dom, 'datalink' );
373
+ $dom = $this->replace_url_services->modify_link( '/<([^\>]+?)?data-url=(\"|\')([^\s\>]+?)(\"|\')([^\>]+?)?>/', $dom, 'dataurl' );
374
+ $dom = $this->replace_url_services->modify_link( '/<([^\>]+?)?data-cart-url=(\"|\')([^\s\>]+?)(\"|\')([^\>]+?)?>/', $dom, 'datacart' );
375
+ $dom = $this->replace_url_services->modify_link( '/<form([^\>]+?)?action=(\"|\')([^\s\>]+?)(\"|\')/', $dom, 'form' );
376
+ $dom = $this->replace_url_services->modify_link( '/<link rel="canonical"(.*?)?href=(\"|\')([^\s\>]+?)(\"|\')/', $dom, 'canonical' );
377
+ $dom = $this->replace_url_services->modify_link( '/<link rel="amphtml"(.*?)?href=(\"|\')([^\s\>]+?)(\"|\')/', $dom, 'amp' );
378
+ $dom = $this->replace_url_services->modify_link( '/<meta property="og:url"(.*?)?content=(\"|\')([^\s\>]+?)(\"|\')/', $dom, 'meta' );
379
+
380
+ return $dom;
381
+ }
382
+
383
+ /**
384
+ * @since 2.0
385
+ * @param string $dom
386
+ * @return string
387
+ */
388
+ public function weglot_render_dom( $dom ) {
389
+ $dom = $this->weglot_add_button_html( $dom );
390
+
391
+ // We only need this on translated page
392
+ if ( $this->current_language !== $this->original_language ) {
393
+ $dom = $this->weglot_replace_link( $dom );
394
+
395
+ $dom = preg_replace( '/<html (.*?)?lang=(\"|\')(\S*)(\"|\')/', '<html $1lang=$2' . $this->current_language . '$4', $dom );
396
+ $dom = preg_replace( '/property="og:locale" content=(\"|\')(\S*)(\"|\')/', 'property="og:locale" content=$1' . $this->current_language . '$3', $dom );
397
+ }
398
+ return apply_filters( 'weglot_render_dom', $dom );
399
+ }
400
+
401
+ /**
402
+ * @see wp_head
403
+ * @since 2.0
404
+ * @return void
405
+ */
406
+ public function weglot_href_lang() {
407
+ $href_lang_tags = $this->request_url_services->get_weglot_url()->generateHrefLangsTags(); //phpcs:ignore
408
+ echo apply_filters( 'weglot_href_lang', $href_lang_tags ); //phpcs:ignore
409
+ }
410
+ }
411
+
412
+
src/class-bootstrap-weglot.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+
11
+ /**
12
+ * Init plugin
13
+ *
14
+ * @since 2.0
15
+ */
16
+ class Bootstrap_Weglot {
17
+ /**
18
+ * List actions WordPress
19
+ * @since 2.0
20
+ * @var array
21
+ */
22
+ protected $actions = [];
23
+
24
+ /**
25
+ * List class services
26
+ * @since 2.0
27
+ * @var array
28
+ */
29
+ protected $services = [];
30
+
31
+ /**
32
+ * Set actions
33
+ *
34
+ * @since 2.0
35
+ * @param array $actions
36
+ * @return BootStrap_Weglot
37
+ */
38
+ public function set_actions( $actions ) {
39
+ $this->actions = $actions;
40
+ return $this;
41
+ }
42
+
43
+ /**
44
+ * Get services
45
+ * @since 2.0
46
+ * @return array
47
+ */
48
+ public function get_actions() {
49
+ return $this->actions;
50
+ }
51
+
52
+ /**
53
+ * Set services
54
+ * @since 2.0
55
+ * @param array $services
56
+ * @return BootStrap_Weglot
57
+ */
58
+ public function set_services( $services ) {
59
+ foreach ( $services as $service ) {
60
+ $this->set_service( $service );
61
+ }
62
+ return $this;
63
+ }
64
+
65
+ /**
66
+ * Set a service
67
+ * @since 2.0
68
+ * @param string $service
69
+ * @return BootStrap_Weglot
70
+ */
71
+ public function set_service( $service ) {
72
+ $name = explode( '\\', $service );
73
+ end( $name );
74
+ $key = key( $name );
75
+ $this->services[ $name[ $key ] ] = $service;
76
+ return $this;
77
+ }
78
+
79
+
80
+ /**
81
+ * Get services
82
+ * @since 2.0
83
+ * @return array
84
+ */
85
+ public function get_services() {
86
+ return $this->services;
87
+ }
88
+
89
+ /**
90
+ * Get one service by classname
91
+ * @since 2.0
92
+ * @param string $name
93
+ * @return object
94
+ */
95
+ public function get_service( $name ) {
96
+ if ( ! array_key_exists( $name, $this->services ) ) {
97
+ return null;
98
+ // @TODO : Throw exception
99
+ }
100
+
101
+ if ( is_string( $this->services[ $name ] ) ) {
102
+ $this->services[ $name ] = new $this->services[ $name ]();
103
+ }
104
+
105
+ return $this->services[ $name ];
106
+ }
107
+
108
+ /**
109
+ * Init plugin
110
+ * @since 2.0
111
+ * @return void
112
+ */
113
+ public function init_plugin() {
114
+ foreach ( $this->actions as $action ) {
115
+ $action = new $action();
116
+ if ( $action instanceof Hooks_Interface_Weglot ) {
117
+ $action->hooks();
118
+ }
119
+ }
120
+ }
121
+
122
+ /**
123
+ * Activate plugin
124
+ * @since 2.0
125
+ * @return void
126
+ */
127
+ public function activate_plugin() {
128
+ foreach ( $this->actions as $action ) {
129
+ $action = new $action();
130
+ if ( ! method_exists( $action, 'activate' ) ) {
131
+ continue;
132
+ }
133
+
134
+ $action->activate();
135
+ }
136
+ }
137
+
138
+ /**
139
+ * Deactivate plugin
140
+ * @since 2.0
141
+ * @return void
142
+ */
143
+ public function deactivate_plugin() {
144
+ foreach ( $this->actions as $action ) {
145
+ $action = new $action();
146
+ if ( ! method_exists( $action, 'deactivate' ) ) {
147
+ continue;
148
+ }
149
+
150
+ $action->deactivate();
151
+ }
152
+ }
153
+ }
src/domcheckers/class-meta-twitter.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Domcheckers;
4
+
5
+ use Weglot\Parser\Check\Dom\AbstractDomChecker;
6
+ use Weglot\Client\Api\Enum\WordType;
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+ /**
12
+ * @since 2.0
13
+ */
14
+ class Meta_Twitter extends AbstractDomChecker {
15
+ /**
16
+ * {@inheritdoc}
17
+ */
18
+ const DOM = "meta[name='twitter:image'],meta[name='twitter:card'],meta[name='twitter:site'],meta[name='twitter:creator']";
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ const PROPERTY = 'content';
23
+ /**
24
+ * {@inheritdoc}
25
+ */
26
+ const WORD_TYPE = WordType::META_CONTENT;
27
+ }
src/domlisteners/class-meta-listener-weglot.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Domlisteners;
4
+
5
+ use Weglot\Parser\Listener\AbstractCrawlerAfterListener;
6
+ use Weglot\Parser\Parser;
7
+ use Weglot\Client\Api\Enum\WordType;
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * @since 2.0
15
+ */
16
+ final class Meta_Listener_Weglot extends AbstractCrawlerAfterListener {
17
+ protected $attributes = [
18
+ 'name' => [
19
+ 'twitter:image',
20
+ 'twitter:card',
21
+ 'twitter:site',
22
+ 'twitter:creator',
23
+ ],
24
+ ];
25
+
26
+ /**
27
+ * {@inheritdoc}
28
+ */
29
+ protected function xpath() {
30
+ $selectors = [];
31
+ foreach ( $this->attributes as $name => $values ) {
32
+ foreach ( $values as $value ) {
33
+ $selectors[] = '@' . $name . ' = \'' . $value . '\'';
34
+ }
35
+ }
36
+ return '//meta[(' . implode( ' or ', $selectors ) . ') and not(ancestor-or-self::*[@' . Parser::ATTRIBUTE_NO_TRANSLATE . '])]/@content';
37
+ }
38
+ /**
39
+ * {@inheritdoc}
40
+ */
41
+ protected function type( \DOMNode $node ) {
42
+ return WordType::META_CONTENT;
43
+ }
44
+ }
src/helpers/class-helper-filter-url-weglot.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Helpers;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ /**
10
+ * Function helper for URL replace filter
11
+ *
12
+ * @since 2.0
13
+ */
14
+ abstract class Helper_Filter_Url_Weglot {
15
+
16
+ /**
17
+ * @since 2.0.2
18
+ * @param string $url
19
+ * @return string
20
+ */
21
+ protected static function get_clean_base_url( $url ) {
22
+ if ( strpos( $url, 'http' ) === false ) {
23
+ $url = sprintf( '%s%s', get_site_url(), $url );
24
+ }
25
+
26
+ return apply_filters( 'weglot_get_clean_base_url', $url );
27
+ }
28
+
29
+ /**
30
+ * Filter URL log redirection
31
+ * @since 2.0
32
+ * @version 2.0.2
33
+ * @param string $url_filter
34
+ * @return string
35
+ */
36
+ public static function filter_url_log_redirect( $url_filter ) {
37
+ $current_and_original_language = weglot_get_current_and_original_language();
38
+ $request_url_service = weglot_get_request_url_service();
39
+ $choose_current_language = $current_and_original_language['current'];
40
+
41
+ $url_filter = self::get_clean_base_url( $url_filter );
42
+
43
+ $url = $request_url_service->create_url_object( $url_filter );
44
+
45
+ if ( $current_and_original_language['current'] === $current_and_original_language['original']
46
+ && isset( $_SERVER['HTTP_REFERER'] ) //phpcs:ignore
47
+ ) {
48
+ $url = $request_url_service->create_url_object( $_SERVER['HTTP_REFERER'] ); //phpcs:ignore
49
+ $choose_current_language = $url->detectCurrentLanguage();
50
+
51
+ if ( $choose_current_language !== $current_and_original_language['original'] ) {
52
+ $url = $request_url_service->create_url_object( $url_filter );
53
+ }
54
+ }
55
+
56
+ return $url->getForLanguage( $choose_current_language );
57
+ }
58
+
59
+
60
+ /**
61
+ * Filter url without Ajax
62
+ *
63
+ * @since 2.0
64
+ * @param string $url_filter
65
+ * @return string
66
+ */
67
+ public static function filter_url_without_ajax( $url_filter ) {
68
+ $current_and_original_language = weglot_get_current_and_original_language();
69
+ $request_url_service = weglot_get_request_url_service();
70
+ if ( $current_and_original_language['current'] === $current_and_original_language['original'] ) {
71
+ return $url_filter;
72
+ }
73
+
74
+ $url = $request_url_service->create_url_object( $url_filter );
75
+
76
+ return $url->getForLanguage( $current_and_original_language['current'] );
77
+ }
78
+
79
+ /**
80
+ * Filter url with optional Ajax
81
+ *
82
+ * @since 2.0
83
+ * @param string $url_filter
84
+ * @return string
85
+ */
86
+ public static function filter_url_with_ajax( $url_filter ) {
87
+ $current_and_original_language = weglot_get_current_and_original_language();
88
+ $choose_current_language = $current_and_original_language['current'];
89
+ $request_url_service = weglot_get_request_url_service();
90
+ if ( $current_and_original_language['current'] !== $current_and_original_language['original'] ) { // Not ajax
91
+ $url = $request_url_service->create_url_object( $url_filter );
92
+ } else {
93
+ if ( isset( $_SERVER['HTTP_REFERER'] ) ) { //phpcs:ignore
94
+ // Ajax
95
+ $url = $request_url_service->create_url_object( $_SERVER['HTTP_REFERER'] ); //phpcs:ignore
96
+ $choose_current_language = $url->detectCurrentLanguage();
97
+ $url = $request_url_service->create_url_object( $url_filter );
98
+ }
99
+ }
100
+
101
+ return $url->getForLanguage( $choose_current_language );
102
+ }
103
+ }
src/helpers/class-helper-json-inline-weglot.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Helpers;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ /**
10
+ *
11
+ * @since 2.0
12
+ */
13
+ abstract class Helper_Json_Inline_Weglot {
14
+
15
+ /**
16
+ * @since 2.0
17
+ * @param string $string
18
+ * @return string
19
+ */
20
+ public static function format_for_api( $string ) {
21
+ $string = '"' . $string . '"';
22
+ return json_decode( str_replace( '\\/', '/', str_replace( '\\\\', '\\', $string ) ) );
23
+ }
24
+
25
+ /**
26
+ * @since 2.0
27
+ * @param string $string
28
+ * @return string
29
+ */
30
+ public static function unformat_from_api( $string ) {
31
+ $string = str_replace( '"', '', str_replace( '/', '\\\\/', str_replace( '\\u', '\\\\u', json_encode( $string ) ) ) ); //phpcs:ignore
32
+ return $string;
33
+ }
34
+ }
src/helpers/class-helper-pages-weglot.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Helpers;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ /**
10
+ * Name pages
11
+ *
12
+ * @since 2.0
13
+ */
14
+ abstract class Helper_Pages_Weglot {
15
+ const SETTINGS = 'weglot-settings';
16
+ }
src/helpers/class-helper-rollback-weglot.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * This file need to be compatible with PHP 5.3
5
+ * Example : Don't use short syntax for array()
6
+ */
7
+
8
+ namespace WeglotWP\Helpers;
9
+
10
+ // Exit if accessed directly.
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ class Helper_Rollback_Weglot extends \Plugin_Upgrader {
16
+
17
+ /**
18
+ * Plugin rollback.
19
+ *
20
+ * @param $plugin
21
+ * @param array $args
22
+ *
23
+ * @return array|bool|\WP_Error
24
+ */
25
+ public function rollback( $plugin, $args = array() ) {
26
+ $defaults = array(
27
+ 'clear_update_cache' => true,
28
+ );
29
+ $parsed_args = wp_parse_args( $args, $defaults );
30
+
31
+ $this->init();
32
+ $this->upgrade_strings();
33
+
34
+ if ( 0 ) {
35
+ $this->skin->before();
36
+ $this->skin->set_result( false );
37
+ $this->skin->error( 'up_to_date' );
38
+ $this->skin->after();
39
+
40
+ return false;
41
+ }
42
+
43
+ $plugin_slug = $this->skin->plugin;
44
+
45
+ $plugin_version = $this->skin->options['version'];
46
+
47
+ $download_endpoint = 'https://downloads.wordpress.org/plugin/';
48
+
49
+ $url = $download_endpoint . $plugin_slug . '.' . $plugin_version . '.zip';
50
+
51
+ add_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ), 10, 2 );
52
+ add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 );
53
+
54
+ $this->run( array(
55
+ 'package' => $url,
56
+ 'destination' => WP_PLUGIN_DIR,
57
+ 'clear_destination' => true,
58
+ 'clear_working' => true,
59
+ 'hook_extra' => array(
60
+ 'plugin' => $plugin,
61
+ 'type' => 'plugin',
62
+ 'action' => 'update',
63
+ ),
64
+ ) );
65
+
66
+ // Cleanup our hooks, in case something else does a upgrade on this connection.
67
+ remove_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ) );
68
+ remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) );
69
+
70
+ if ( ! $this->result || is_wp_error( $this->result ) ) {
71
+ return $this->result;
72
+ }
73
+
74
+ // Force refresh of plugin update information.
75
+ wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
76
+
77
+ return true;
78
+ }
79
+ }
src/helpers/class-helper-tabs-admin-weglot.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Helpers;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ /**
10
+ * Name pages
11
+ *
12
+ * @since 2.0
13
+ */
14
+ abstract class Helper_Tabs_Admin_Weglot {
15
+
16
+ /**
17
+ * @var string
18
+ */
19
+ const SETTINGS = 'settings';
20
+
21
+ /**
22
+ * @var string
23
+ */
24
+ const ADVANCED = 'advanced';
25
+
26
+ /**
27
+ * @var string
28
+ */
29
+ const STATUS = 'status';
30
+
31
+ /**
32
+ * @var string
33
+ */
34
+ const APPEARANCE = 'appearance';
35
+
36
+ /**
37
+ * Get tabs constant
38
+ *
39
+ * @since 2.0
40
+ * @static
41
+ * @return array
42
+ */
43
+ public static function get_tabs() {
44
+ return [
45
+ self::SETTINGS,
46
+ self::ADVANCED,
47
+ self::STATUS,
48
+ self::APPEARANCE,
49
+ ];
50
+ }
51
+
52
+ /**
53
+ * Get full tabs information
54
+ * @static
55
+ * @since 2.0
56
+ *
57
+ * @return void
58
+ */
59
+ public static function get_full_tabs() {
60
+ return [
61
+ self::SETTINGS => [
62
+ 'title' => __( 'General', 'weglot' ),
63
+ 'url' => get_admin_url( null, sprintf( 'admin.php?page=%s&tab=%s', Helper_Pages_Weglot::SETTINGS, self::SETTINGS ) ),
64
+ ],
65
+ self::APPEARANCE => [
66
+ 'title' => __( 'Language button', 'weglot' ),
67
+ 'url' => get_admin_url( null, sprintf( 'admin.php?page=%s&tab=%s', Helper_Pages_Weglot::SETTINGS, self::APPEARANCE ) ),
68
+ ],
69
+ self::ADVANCED => [
70
+ 'title' => __( 'Advanced', 'weglot' ),
71
+ 'url' => get_admin_url( null, sprintf( 'admin.php?page=%s&tab=%s', Helper_Pages_Weglot::SETTINGS, self::ADVANCED ) ),
72
+ ],
73
+ self::STATUS => [
74
+ 'title' => __( 'Status', 'weglot' ),
75
+ 'url' => get_admin_url( null, sprintf( 'admin.php?page=%s&tab=%s', Helper_Pages_Weglot::SETTINGS, self::STATUS ) ),
76
+ ],
77
+ ];
78
+ }
79
+ }
src/models/class-abstract-notices-weglot.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Models;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ /**
10
+ * Abstract class for manage admin notices
11
+ *
12
+ * @abstract
13
+ * @since 2.0
14
+ */
15
+ abstract class Abstract_Notices_Weglot {
16
+
17
+ /**
18
+ * Get template file for admin notice
19
+ * @static
20
+ * @since 2.0
21
+ *
22
+ * @return string
23
+ */
24
+ public static function get_template_file() {
25
+ return '';
26
+ }
27
+
28
+ /**
29
+ * Callback for admin_notice hook
30
+ *
31
+ * @since 2.0
32
+ * @static
33
+ *
34
+ * @return string
35
+ */
36
+ public static function admin_notice() {
37
+ $class_call = get_called_class();
38
+ if ( ! file_exists( $class_call::get_template_file() ) ) {
39
+ return;
40
+ }
41
+
42
+ include_once $class_call::get_template_file();
43
+ }
44
+ }
src/models/class-hooks-interface-weglot.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Models;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ /**
10
+ * Hooks interface
11
+ *
12
+ * @since 2.0
13
+ *
14
+ */
15
+ interface Hooks_Interface_Weglot {
16
+ public function hooks();
17
+ }
src/models/class-third-active-interface-weglot.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Models;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ /**
10
+ * Third Active
11
+ *
12
+ * @since 2.0
13
+ *
14
+ */
15
+ interface Third_Active_Interface_Weglot {
16
+ public function is_active();
17
+ }
18
+
src/models/class-third-translate-interface-weglot.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Models;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ /**
10
+ * Third translate
11
+ *
12
+ * @since 2.0
13
+ *
14
+ */
15
+ interface Third_Translate_Interface_Weglot {
16
+ public function translate_words( $content );
17
+ }
src/notices/class-curl-weglot.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Notices;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Abstract_Notices_Weglot;
10
+
11
+ /**
12
+ * @since 2.0.1
13
+ */
14
+ class Curl_Weglot extends Abstract_Notices_Weglot {
15
+
16
+ /**
17
+ * @since 2.0.1
18
+ * @static
19
+ * @return string
20
+ */
21
+ public static function get_template_file() {
22
+ return WEGLOT_TEMPLATES_ADMIN_NOTICES . '/no-curl.php';
23
+ }
24
+ }
25
+
src/notices/class-no-configuration-weglot.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Notices;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Abstract_Notices_Weglot;
10
+
11
+ /**
12
+ * @since 2.0
13
+ */
14
+ class No_Configuration_Weglot extends Abstract_Notices_Weglot {
15
+
16
+ /**
17
+ * Get template file for admin notice
18
+ * @since 2.0
19
+ * @static
20
+ * @return string
21
+ */
22
+ public static function get_template_file() {
23
+ return WEGLOT_TEMPLATES_ADMIN_NOTICES . '/no-configuration.php';
24
+ }
25
+ }
26
+
src/notices/class-rewrite-module-weglot.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Notices;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Abstract_Notices_Weglot;
10
+
11
+ /**
12
+ * Rewrite module notice template
13
+ *
14
+ * @since 2.0
15
+ */
16
+ class Rewrite_Module_Weglot extends Abstract_Notices_Weglot {
17
+
18
+ /**
19
+ * Get template file for admin notice
20
+ * @since 2.0
21
+ * @static
22
+ * @return string
23
+ */
24
+ public static function get_template_file() {
25
+ return WEGLOT_TEMPLATES_ADMIN_NOTICES . '/rewrite-module.php';
26
+ }
27
+ }
src/services/class-button-service-weglot.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+ /**
11
+ * Button services
12
+ *
13
+ * @since 2.0
14
+ */
15
+ class Button_Service_Weglot {
16
+
17
+ /**
18
+ * @since 2.0
19
+ */
20
+ public function __construct() {
21
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
22
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
23
+ $this->language_services = weglot_get_service( 'Language_Service_Weglot' );
24
+ $this->amp_services = weglot_get_service( 'Amp_Service_Weglot' );
25
+ }
26
+
27
+
28
+ /**
29
+ * Get html button switcher
30
+ *
31
+ * @since 2.0
32
+ * @return string
33
+ * @param string $add_class
34
+ */
35
+ public function get_html( $add_class = '' ) {
36
+ $options = $this->option_services->get_options();
37
+ $is_fullname = $options['is_fullname'];
38
+ $with_name = $options['with_name'];
39
+ $is_dropdown = $options['is_dropdown'];
40
+ $with_flags = $options['with_flags'];
41
+ $type_flags = $options['type_flags'];
42
+ $weglot_url = $this->request_url_services->get_weglot_url();
43
+
44
+ $translate_amp = weglot_get_translate_amp_translation();
45
+ $amp_regex = $this->amp_services->get_regex( true );
46
+
47
+ if ( $translate_amp && preg_match( '#' . $amp_regex . '#', $weglot_url->getUrl() ) === 1 ) {
48
+ $add_class .= ' weglot-invert';
49
+ }
50
+
51
+ $destination_language = $options['destination_language'];
52
+ $original_language = $options['original_language'];
53
+ $current_language = $this->request_url_services->get_current_language();
54
+
55
+ $flag_class = $with_flags ? 'weglot-flags ' : '';
56
+ $flag_class .= '0' === $type_flags ? '' : 'flag-' . $type_flags . ' ';
57
+
58
+ $class_aside = $is_dropdown ? 'weglot-dropdown ' : 'weglot-inline ';
59
+
60
+ $languages = $this->language_services->get_languages_available();
61
+
62
+ $button_html = sprintf( '<!--Weglot %s-->', WEGLOT_VERSION );
63
+ $button_html .= sprintf( "<aside data-wg-notranslate class='country-selector %s'>", $class_aside . $add_class );
64
+
65
+ if ( ! empty( $original_language ) && ! empty( $destination_language ) ) {
66
+ $name = '';
67
+ if ( $with_name ) {
68
+ $name = ( $is_fullname ) ? $languages[ $current_language ]->getLocalName() : strtoupper( $languages[ $current_language ]->getIso639() );
69
+ }
70
+
71
+ $button_html .= sprintf( '<input id="weglot_choice" type="checkbox" name="menu"/><label for="weglot_choice" class="wgcurrent wg-li %s" data-code-language="%s"><span>%s</span></label>', $flag_class . $current_language, $languages[ $current_language ]->getIso639(), $name );
72
+
73
+ $button_html .= '<ul>';
74
+
75
+ array_unshift( $destination_language, $original_language );
76
+
77
+ foreach ( $destination_language as $key => $key_code ) {
78
+ if ( $key_code === $current_language ) {
79
+ continue;
80
+ }
81
+
82
+ $name = '';
83
+ if ( $with_name ) {
84
+ $name = ( $is_fullname ) ? $languages[ $key_code ]->getLocalName() : strtoupper( $languages[ $key_code ]->getIso639() );
85
+ }
86
+
87
+ $button_html .= sprintf( '<li class="wg-li %s" data-code-language="%s">', $flag_class . $key_code, $key_code );
88
+
89
+ $link_button = $weglot_url->getForLanguage( $key_code );
90
+
91
+ if ( weglot_has_auto_redirect() && strpos( $link_button, 'no_lredirect' ) === false && ( is_home() || is_front_page() ) ) {
92
+ $link_button .= '?no_lredirect=true';
93
+ }
94
+
95
+ $button_html .= sprintf(
96
+ '<a data-wg-notranslate href="%s">%s</a>',
97
+ $link_button,
98
+ $name
99
+ );
100
+
101
+ $button_html .= '</li>';
102
+ }
103
+
104
+ $button_html .= '</ul>';
105
+ }
106
+
107
+ $button_html .= '</aside>';
108
+
109
+ return apply_filters( 'weglot_button_html', $button_html );
110
+ }
111
+ }
src/services/class-dom-checkers-service-weglot.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use Weglot\Util\Text;
10
+
11
+ /**
12
+ * Dom Checkers
13
+ *
14
+ * @since 2.0
15
+ */
16
+ class Dom_Checkers_Service_Weglot {
17
+ /**
18
+ * @since 2.0
19
+ */
20
+ public function __construct() {
21
+ $this->dom_checkers = [
22
+ '\WeglotWP\Domcheckers\Meta_Twitter',
23
+ ];
24
+ }
25
+ /**
26
+ * @since 2.0
27
+ * @return array
28
+ */
29
+ public function get_dom_checkers() {
30
+ $files = array_diff( scandir( __DIR__ . '/../domcheckers' ), [ '..', '.' ] );
31
+ $checkers = array_map( function ( $filename ) {
32
+ // Thanks WPCS :)
33
+ $filename = Text::removeFileExtension( $filename );
34
+ $filename = str_replace( 'class-', '', $filename );
35
+ $filename = implode( '_', array_map( 'ucfirst', explode( '-', $filename ) ) );
36
+ return '\\WeglotWP\\Domcheckers\\' . $filename;
37
+ }, $files);
38
+
39
+ return apply_filters( 'weglot_get_dom_checkers', $checkers );
40
+ }
41
+ }
src/services/class-dom-listeners-service-weglot.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use Weglot\Util\Text;
10
+
11
+
12
+ /**
13
+ * Dom Checkers
14
+ *
15
+ * @since 2.0
16
+ */
17
+ class Dom_Listeners_Service_Weglot {
18
+
19
+ /**
20
+ * @since 2.0
21
+ */
22
+ public function __construct() {
23
+ if ( '1' === WEGLOT_LIB_PARSER ) {
24
+ return;
25
+ }
26
+ $this->dom_listeners = [
27
+ 'parser.crawler.after' => new \WeglotWP\Domlisteners\Meta_Listener_Weglot(),
28
+ ];
29
+ }
30
+
31
+ /**
32
+ * @since 2.0
33
+ * @return array
34
+ */
35
+ public function get_dom_listeners() {
36
+ return apply_filters( 'weglot_get_dom_listeners', $this->dom_listeners );
37
+ }
38
+ }
src/services/class-language-service-weglot.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+ use Weglot\Client\Endpoint\Languages;
11
+ use Weglot\Client\Client;
12
+
13
+ /**
14
+ * Language service
15
+ *
16
+ * @since 2.0
17
+ */
18
+ class Language_Service_Weglot {
19
+ protected $languages = null;
20
+
21
+ /**
22
+ * @since 2.0
23
+ */
24
+ public function __construct() {
25
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
26
+ }
27
+
28
+
29
+ /**
30
+ * Get languages available from API
31
+ * @since 2.0
32
+ *
33
+ * @return array
34
+ */
35
+ public function get_languages_available() {
36
+ if ( null === $this->languages ) {
37
+ $client = new Client( $this->option_services->get_option( 'api_key' ) );
38
+ $languages = new Languages( $client );
39
+ $this->languages = $languages->handle();
40
+ }
41
+
42
+ return $this->languages;
43
+ }
44
+
45
+ /**
46
+ * Get language entry
47
+ * @since 2.0
48
+ * @param string $key_code
49
+ * @return array
50
+ */
51
+ public function get_language( $key_code ) {
52
+ return $this->get_languages_available()[ $key_code ];
53
+ }
54
+
55
+ /**
56
+ * @since 2.0
57
+ * @return array
58
+ * @param null|string $type
59
+ */
60
+ public function get_languages_configured( $type = null ) {
61
+ $languages[] = weglot_get_original_language();
62
+ $languages = array_merge( $languages, weglot_get_destination_language() );
63
+ $languages_object = [];
64
+
65
+ foreach ( $languages as $language ) {
66
+ switch ( $type ) {
67
+ case 'code':
68
+ $languages_object[] = $this->get_language( $language )->getIso639();
69
+ break;
70
+ default:
71
+ $languages_object[] = $this->get_language( $language );
72
+ break;
73
+ }
74
+ }
75
+
76
+ return $languages_object;
77
+ }
78
+ }
src/services/class-migration-service-weglot.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+ /**
11
+ * Migration service
12
+ *
13
+ * @since 2.0
14
+ */
15
+ class Migration_Service_Weglot {
16
+
17
+ /**
18
+ * @since 2.0
19
+ */
20
+ public function __construct() {
21
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
22
+ }
23
+
24
+ /**
25
+ * Update V1 to V2 plugin
26
+ * @since 2.0
27
+ * @return void
28
+ */
29
+ public function update_v200() {
30
+ $api_key = get_option( 'project_key' );
31
+ $original_language = get_option( 'original_l' );
32
+ $destination_language = get_option( 'destination_l' );
33
+ $auto_switch = get_option( 'wg_auto_switch' );
34
+ $wg_exclude_amp = get_option( 'wg_exclude_amp' );
35
+ $override_css = get_option( 'override_css' );
36
+ $flag_css = get_option( 'flag_css' );
37
+ $with_flags = get_option( 'with_flags' );
38
+ $type_flags = get_option( 'type_flags' );
39
+ $with_name = get_option( 'with_name' );
40
+ $is_dropdown = get_option( 'is_dropdown' );
41
+ $is_fullname = get_option( 'is_fullname' );
42
+ $is_menu = get_option( 'is_menu' );
43
+ $exclude_url = get_option( 'exclude_url' );
44
+ $exclude_blocks = get_option( 'exclude_blocks' );
45
+ $rtl_ltr_style = get_option( 'rtl_ltr_style' );
46
+ $allowed = get_option( 'wg_allowed' );
47
+
48
+ $destination_language = explode( ',', $destination_language );
49
+ $exclude_blocks = empty( $exclude_blocks ) ? [] : explode( ',', $exclude_blocks );
50
+ $exclude_url = empty( $exclude_url ) ? [] : explode( ',', $exclude_url );
51
+
52
+ $new_options = [
53
+ 'api_key' => $api_key,
54
+ 'original_language' => $original_language,
55
+ 'destination_language' => empty( $destination_language ) ? [] : $destination_language,
56
+ 'translate_amp' => ( 'on' === $wg_exclude_amp ) ? false : true,
57
+ 'exclude_blocks' => empty( $exclude_blocks ) ? [] : $exclude_blocks,
58
+ 'exclude_urls' => $exclude_url,
59
+ 'auto_redirect' => ( 'on' === $auto_switch ) ? true : false,
60
+ 'email_translate' => false,
61
+ 'flag_css' => $flag_css,
62
+ 'is_fullname' => ( 'on' === $is_fullname ) ? true : false,
63
+ 'with_name' => ( 'on' === $with_name ) ? true : false,
64
+ 'is_dropdown' => ( 'on' === $is_dropdown ) ? true : false,
65
+ 'type_flags' => $type_flags,
66
+ 'with_flags' => ( 'on' === $with_flags ) ? true : false,
67
+ 'override_css' => $override_css,
68
+ 'has_first_settings' => false,
69
+ 'show_box_first_settings' => false,
70
+ 'allowed' => $allowed,
71
+ 'rtl_ltr_style' => $rtl_ltr_style,
72
+ 'is_menu' => ( 'on' === $is_menu ) ? true : false,
73
+ ];
74
+
75
+ $this->option_services->set_options( $new_options );
76
+ update_option( 'weglot_version', WEGLOT_VERSION );
77
+ }
78
+ }
79
+
src/services/class-multisite-service-weglot.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+ /**
11
+ * Multisite service
12
+ *
13
+ * @since 2.0
14
+ */
15
+ class Multisite_Service_Weglot {
16
+
17
+ /**
18
+ * @since 2.0
19
+ */
20
+ public function __construct() {
21
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
22
+ }
23
+
24
+ /**
25
+ * @since 2.0
26
+ *
27
+ * @return array
28
+ */
29
+ public function get_list_of_network_path() {
30
+ $paths = [];
31
+
32
+ if ( is_multisite() ) {
33
+ $sites = get_sites( [
34
+ 'number' => 0,
35
+ ] );
36
+
37
+ foreach ( $sites as $site ) {
38
+ $path = $site->path;
39
+ array_push( $paths, $path );
40
+ }
41
+ } else {
42
+ array_push( $paths, $this->request_url_services->get_home_wordpress_directory() );
43
+ }
44
+
45
+ return $paths;
46
+ }
47
+ }
48
+
src/services/class-network-service-weglot.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ /**
10
+ * Network service
11
+ *
12
+ * @since 2.0
13
+ */
14
+ class Network_Service_Weglot {
15
+
16
+ /**
17
+ * @since 2.0
18
+ * @var array|null
19
+ */
20
+ protected $networks = null;
21
+
22
+ /**
23
+ * @since 2.0
24
+ */
25
+ public function __construct() {
26
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
27
+ }
28
+
29
+ /**
30
+ * @since 2.0
31
+ *
32
+ * @return Network_Service_Weglot
33
+ */
34
+ public function set_networks() {
35
+ if ( is_multisite() ) {
36
+ $sites = get_sites( [
37
+ 'number' => 0,
38
+ ] );
39
+
40
+ foreach ( $sites as $site ) {
41
+ $path = $site->path;
42
+ array_push( $this->networks, $path );
43
+ }
44
+ } else {
45
+ array_push( $this->networks, $this->request_url_services->get_home_wordpress_directory() . '/' );
46
+ }
47
+
48
+ return $this;
49
+ }
50
+
51
+
52
+ /**
53
+ * @since 2.0
54
+ * @return array
55
+ */
56
+ public function get_networks() {
57
+ if ( null === $this->networks ) {
58
+ $this->set_networks();
59
+ }
60
+
61
+ return $this->networks;
62
+ }
63
+ }
src/services/class-option-service-weglot.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ /**
10
+ * Option services
11
+ *
12
+ * @since 2.0
13
+ */
14
+ class Option_Service_Weglot {
15
+
16
+ /**
17
+ * @var array
18
+ */
19
+ protected $options_default = [
20
+ 'api_key' => '',
21
+ 'original_language' => 'en',
22
+ 'destination_language' => [],
23
+ 'translate_amp' => false,
24
+ 'exclude_blocks' => [],
25
+ 'exclude_urls' => [],
26
+ 'auto_redirect' => false,
27
+ 'email_translate' => false,
28
+ 'is_fullname' => false,
29
+ 'with_name' => true,
30
+ 'is_dropdown' => true,
31
+ 'type_flags' => 0,
32
+ 'with_flags' => true,
33
+ 'override_css' => '',
34
+ 'has_first_settings' => true,
35
+ 'show_box_first_settings' => false,
36
+ 'rtl_ltr_style' => '',
37
+ 'allowed' => true,
38
+ ];
39
+
40
+ /**
41
+ * Get options default
42
+ *
43
+ * @since 2.0
44
+ * @return array
45
+ */
46
+ public function get_options_default() {
47
+ return $this->options_default;
48
+ }
49
+
50
+ /**
51
+ * @since 2.0
52
+ * @return array
53
+ */
54
+ public function get_options() {
55
+ return wp_parse_args( get_option( WEGLOT_SLUG ), $this->get_options_default() );
56
+ }
57
+
58
+ /**
59
+ * @since 2.0
60
+ * @param string $name
61
+ * @return array
62
+ */
63
+ public function get_option( $name ) {
64
+ $options = $this->get_options();
65
+ if ( ! array_key_exists( $name, $options ) ) {
66
+ return null; // @TODO : throw exception
67
+ }
68
+
69
+ return $options[ $name ];
70
+ }
71
+
72
+ /**
73
+ * @since 2.0
74
+ * @return array
75
+ */
76
+ public function get_exclude_blocks() {
77
+ $exclude_blocks = $this->get_option( 'exclude_blocks' );
78
+ $exclude_blocks[] = '#wpadminbar';
79
+ $exclude_blocks[] = '#query-monitor';
80
+
81
+ return apply_filters( 'weglot_exclude_blocks', $exclude_blocks );
82
+ }
83
+
84
+ /**
85
+ * @since 2.0
86
+ * @return array
87
+ */
88
+ public function get_exclude_urls() {
89
+ $exclude_urls = $this->get_option( 'exclude_urls' );
90
+ $exclude_urls[] = '/wp-login.php';
91
+
92
+ return apply_filters( 'weglot_exclude_urls', $exclude_urls );
93
+ }
94
+
95
+ /**
96
+ * @since 2.0
97
+ *
98
+ * @return string
99
+ */
100
+ public function get_css_custom_inline() {
101
+ return apply_filters( 'weglot_css_custom_inline', $this->get_option( 'override_css' ) );
102
+ }
103
+
104
+ /**
105
+ * @since 2.0
106
+ *
107
+ * @return string
108
+ */
109
+ public function get_flag_css() {
110
+ return apply_filters( 'weglot_flag_css', $this->get_option( 'flag_css' ) );
111
+ }
112
+
113
+
114
+ /**
115
+ * @since 2.0
116
+ * @param array $options
117
+ * @return Option_Service_Weglot
118
+ */
119
+ public function set_options( $options ) {
120
+ update_option( WEGLOT_SLUG, $options );
121
+ return $this;
122
+ }
123
+
124
+ /**
125
+ *
126
+ * @param string $key
127
+ * @param mixed $value
128
+ * @return Option_Service_Weglot
129
+ */
130
+ public function set_option_by_key( $key, $value ) {
131
+ $options = $this->get_options();
132
+ $options[ $key ] = $value;
133
+ $this->set_options( $options );
134
+ return $this;
135
+ }
136
+ }
src/services/class-other-translate-service-weglot.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use Weglot\Client\Api\WordCollection;
10
+ use Weglot\Client\Api\WordEntry;
11
+ use Weglot\Client\Api\Enum\WordType;
12
+ use Weglot\Client\Client;
13
+ use Weglot\Client\Endpoint\Translate;
14
+ use Weglot\Client\Api\TranslateEntry;
15
+ use Weglot\Client\Api\Enum\BotType;
16
+
17
+ use WeglotWP\Helpers\Helper_Json_Inline_Weglot;
18
+
19
+
20
+ /**
21
+ *
22
+ * @since 2.0
23
+ */
24
+ class Other_Translate_Service_Weglot {
25
+ protected $max_chars = 500;
26
+
27
+
28
+ /**
29
+ * @since 2.0
30
+ *
31
+ * @param string $content
32
+ * @return string
33
+ */
34
+ public function translate_words( $content ) {
35
+ $words = apply_filters( 'weglot_words_translate', [] );
36
+
37
+ if ( empty( $words ) || ! is_array( $words ) ) {
38
+ return $content;
39
+ }
40
+
41
+ // TranslateEntry
42
+ $params = [
43
+ 'language_from' => weglot_get_original_language(),
44
+ 'language_to' => weglot_get_current_language(),
45
+ 'request_url' => weglot_get_current_full_url(),
46
+ 'bot' => BotType::HUMAN,
47
+ ];
48
+
49
+ $translate = new TranslateEntry( $params );
50
+
51
+ $word_collection = $translate->getInputWords();
52
+
53
+ foreach ( $words as $value ) {
54
+ if ( strlen( $value ) > $this->max_chars && preg_match( '/\s|。|。|︒/u', $value ) === false ) {
55
+ continue;
56
+ }
57
+
58
+ $value = Helper_Json_Inline_Weglot::format_for_api( $value );
59
+ $word_collection->addOne( new WordEntry( $value, WordType::TEXT ) );
60
+ }
61
+
62
+ $client = new Client( weglot_get_option( 'api_key' ) );
63
+ $translate = new Translate( $translate, $client );
64
+
65
+ $object = $translate->handle();
66
+
67
+ foreach ( $object->getInputWords() as $key => $input_word ) {
68
+ $from_input = Helper_Json_Inline_Weglot::unformat_from_api( $input_word->getWord() );
69
+ $to_output = Helper_Json_Inline_Weglot::unformat_from_api( $object->getOutputWords()[ $key ]->getWord() );
70
+
71
+ if ( ! preg_match( "#<[^>\"']*" . $from_input . "[^>\"']*>#", $content ) ) {
72
+ $content = preg_replace( "#\b$from_input\b#", $to_output, $content );
73
+ }
74
+ }
75
+
76
+ return $content;
77
+ }
78
+ }
src/services/class-parser-service-weglot.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ use WeglotWP\Models\Hooks_Interface_Weglot;
6
+
7
+
8
+ use Weglot\Client\Client;
9
+ use Weglot\Parser\Parser;
10
+ use Weglot\Util\Url;
11
+ use Weglot\Util\Server;
12
+ use Weglot\Parser\ConfigProvider\ServerConfigProvider;
13
+
14
+ if ( ! defined( 'ABSPATH' ) ) {
15
+ exit;
16
+ }
17
+
18
+
19
+ /**
20
+ * Parser abstraction
21
+ *
22
+ * @since 2.0
23
+ */
24
+ class Parser_Service_Weglot {
25
+
26
+ /**
27
+ * @since 2.0
28
+ */
29
+ public function __construct() {
30
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
31
+
32
+ if ( '2' === WEGLOT_LIB_PARSER ) {
33
+ $this->dom_listeners_services = weglot_get_service( 'Dom_Listeners_Service_Weglot' );
34
+ } else {
35
+ $this->dom_checkers_services = weglot_get_service( 'Dom_Checkers_Service_Weglot' );
36
+ }
37
+
38
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
39
+ }
40
+
41
+ /**
42
+ * @since 2.0
43
+ * @return array
44
+ */
45
+ public function get_parser() {
46
+ $exclude_blocks = $this->option_services->get_exclude_blocks();
47
+ if ( ! empty( $exclude_blocks ) ) {
48
+ $exclude_blocks = array_map( function( $item ) {
49
+ return $this->request_url_services->url_to_relative( $item );
50
+ }, $exclude_blocks);
51
+ }
52
+
53
+ $api_key = $this->option_services->get_option( 'api_key' );
54
+
55
+ $config = new ServerConfigProvider();
56
+ $client = new Client( $api_key );
57
+ if ( '2' === WEGLOT_LIB_PARSER ) {
58
+ $listeners = $this->dom_listeners_services->get_dom_listeners();
59
+ $parser = new Parser( $client, $config, $exclude_blocks, $listeners );
60
+ } else {
61
+ $parser = new Parser( $client, $config, $exclude_blocks );
62
+ $parser->getDomCheckerProvider()->addCheckers( $this->dom_checkers_services->get_dom_checkers() );
63
+ }
64
+
65
+ return $parser;
66
+ }
67
+ }
src/services/class-redirect-service-weglot.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use Weglot\Util\Url;
10
+ use Weglot\Util\Server;
11
+
12
+
13
+ /**
14
+ * Redirect URL
15
+ *
16
+ * @since 2.0
17
+ */
18
+ class Redirect_Service_Weglot {
19
+ /**
20
+ * @since 2.0
21
+ *
22
+ * @var string
23
+ */
24
+ protected $weglot_url = null;
25
+
26
+ /**
27
+ *
28
+ * @var boolean
29
+ */
30
+ protected $no_redirect = false;
31
+
32
+ /**
33
+ * @since 2.0
34
+ */
35
+ public function __construct() {
36
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
37
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
38
+ }
39
+
40
+ /**
41
+ * @since 2.0
42
+ *
43
+ * @return bool
44
+ */
45
+ public function get_no_redirect() {
46
+ return $this->no_redirect;
47
+ }
48
+
49
+ /**
50
+ * @since 2.0
51
+ *
52
+ * @return string
53
+ */
54
+ public function auto_redirect() {
55
+ if ( ! isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) { //phpcs:ignore
56
+ return;
57
+ }
58
+
59
+ $server_lang = substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ); //phpcs:ignore
60
+ $destination_languages = $this->option_services->get_option( 'destination_language' );
61
+
62
+ if (
63
+ in_array( $server_lang, $destination_languages, true ) &&
64
+ $server_lang !== $this->request_url_services->get_current_language()
65
+ ) {
66
+ $url_auto_redirect = apply_filters( 'weglot_url_auto_redirect', $this->request_url_services->get_weglot_url()->getForLanguage( $server_lang ) );
67
+ wp_safe_redirect( $url_auto_redirect );
68
+ exit();
69
+ }
70
+ }
71
+
72
+ /**
73
+ * @since 2.0
74
+ *
75
+ * @return void
76
+ */
77
+ public function verify_no_redirect() {
78
+ if ( strpos( $this->request_url_services->get_weglot_url()->getUrl(), '?no_lredirect=true' ) === false ) {
79
+ return;
80
+ }
81
+
82
+ $this->no_redirect = true;
83
+
84
+ if ( isset( $_SERVER['REQUEST_URI'] ) ) { // phpcs:ignore
85
+ $_SERVER['REQUEST_URI'] = str_replace(
86
+ '?no_lredirect=true',
87
+ '',
88
+ $_SERVER['REQUEST_URI'] //phpcs:ignore
89
+ );
90
+ }
91
+ }
92
+ }
93
+
94
+
src/services/class-replace-link-service-weglot.php ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ /**
10
+ * @since 2.0
11
+ */
12
+ class Replace_Link_Service_Weglot {
13
+
14
+ /**
15
+ * @since 2.0
16
+ */
17
+ public function __construct() {
18
+ $this->multisite_service = weglot_get_service( 'Multisite_Service_Weglot' );
19
+ }
20
+
21
+ /**
22
+ * Replace an URL
23
+ * @since 2.0
24
+ * @param string $url
25
+ * @return string
26
+ */
27
+ public function replace_url( $url ) {
28
+ $current_and_original = weglot_get_current_and_original_language();
29
+
30
+ $parsed_url = wp_parse_url( $url );
31
+ $scheme = isset( $parsed_url['scheme'] ) ? $parsed_url['scheme'] . '://' : '';
32
+ $host = isset( $parsed_url['host'] ) ? $parsed_url['host'] : '';
33
+ $port = isset( $parsed_url['port'] ) ? ':' . $parsed_url['port'] : '';
34
+ $user = isset( $parsed_url['user'] ) ? $parsed_url['user'] : '';
35
+ $pass = isset( $parsed_url['pass'] ) ? ':' . $parsed_url['pass'] : '';
36
+ $pass = ($user || $pass) ? "$pass@" : '';
37
+ $path = isset( $parsed_url['path'] ) ? $parsed_url['path'] : '/';
38
+ $query = isset( $parsed_url['query'] ) ? '?' . $parsed_url['query'] : '';
39
+ $fragment = isset( $parsed_url['fragment'] ) ? '#' . $parsed_url['fragment'] : '';
40
+
41
+ $current_language = $current_and_original['current'];
42
+
43
+ if ( $current_and_original['current'] === $current_and_original['original'] ) {
44
+ return $url;
45
+ } else {
46
+ $url_translated = ( strlen( $path ) > 2 && substr( $path, 0, 4 ) === "/$current_language/" ) ?
47
+ "$scheme$user$pass$host$port$path$query$fragment" : "$scheme$user$pass$host$port/$current_language$path$query$fragment";
48
+
49
+ foreach ( array_reverse( $this->multisite_service->get_list_of_network_path() ) as $np ) {
50
+ if ( strlen( $np ) > 2 && strpos( $url_translated, $np ) !== false ) {
51
+ $url_translated = str_replace(
52
+ str_replace( '//', '/', '/' . $current_language . $np . '/'),
53
+ str_replace( '//', '/', $np . '/' . $current_language . '/'),
54
+ $url_translated
55
+ );
56
+ }
57
+ }
58
+
59
+ return $url_translated;
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Replace href in <a>
65
+ * @since 2.0
66
+ * @param string $translated_page
67
+ * @param string $current_url
68
+ * @param string $quote1
69
+ * @param string $quote2
70
+ * @param string $sometags
71
+ * @param string $sometags2
72
+ * @return string
73
+ */
74
+ public function replace_a( $translated_page, $current_url, $quote1, $quote2, $sometags = null, $sometags2 = null ) {
75
+ $current_language = weglot_get_current_language();
76
+
77
+ $translated_page = preg_replace( '/<a' . preg_quote( $sometags, '/' ) . 'href=' . preg_quote( $quote1 . $current_url . $quote2, '/' ) . preg_quote( $sometags2, '/' ) . '>/', '<a' . $sometags . 'href=' . $quote1 . $this->replace_url( $current_url, $current_language ) . $quote2 . $sometags2 . '>', $translated_page );
78
+
79
+ return $translated_page;
80
+ }
81
+
82
+ /**
83
+ * Replace data-link attribute
84
+ *
85
+ * @since 2.0
86
+ * @param string $translated_page
87
+ * @param string $current_url
88
+ * @param string $quote1
89
+ * @param string $quote2
90
+ * @param string $sometags
91
+ * @param string $sometags2
92
+ * @return string
93
+ */
94
+ public function replace_datalink( $translated_page, $current_url, $quote1, $quote2, $sometags = null, $sometags2 = null ) {
95
+ $current_language = weglot_get_current_language();
96
+ $translated_page = preg_replace( '/<' . preg_quote( $sometags, '/' ) . 'data-link=' . preg_quote( $quote1 . $current_url . $quote2, '/' ) . '/', '<' . $sometags . 'data-link=' . $quote1 . $this->replace_url( $current_url, $current_language ) . $quote2, $translated_page );
97
+
98
+ return $translated_page;
99
+ }
100
+
101
+ /**
102
+ * Replace data-url attribute
103
+ *
104
+ * @since 2.0
105
+ * @param string $translated_page
106
+ * @param string $current_url
107
+ * @param string $quote1
108
+ * @param string $quote2
109
+ * @param string $sometags
110
+ * @param string $sometags2
111
+ * @return string
112
+ */
113
+ public function replace_dataurl( $translated_page, $current_url, $quote1, $quote2, $sometags = null, $sometags2 = null ) {
114
+ $current_language = weglot_get_current_language();
115
+ $translated_page = preg_replace( '/<' . preg_quote( $sometags, '/' ) . 'data-url=' . preg_quote( $quote1 . $current_url . $quote2, '/' ) . '/', '<' . $sometags . 'data-url=' . $quote1 . $this->replace_url( $current_url, $current_language ) . $quote2, $translated_page );
116
+
117
+ return $translated_page;
118
+ }
119
+
120
+ /**
121
+ * Replace data-cart-url attribute
122
+ *
123
+ * @since 2.0
124
+ * @param string $translated_page
125
+ * @param string $current_url
126
+ * @param string $quote1
127
+ * @param string $quote2
128
+ * @param string $sometags
129
+ * @param string $sometags2
130
+ * @return string
131
+ */
132
+ public function replace_datacart( $translated_page, $current_url, $quote1, $quote2, $sometags = null, $sometags2 = null ) {
133
+ $current_language = weglot_get_current_language();
134
+ $translated_page = preg_replace( '/<' . preg_quote( $sometags, '/' ) . 'data-cart-url=' . preg_quote( $quote1 . $current_url . $quote2, '/' ) . '/', '<' . $sometags . 'data-cart-url=' . $quote1 . $this->replace_url( $current_url, $current_language ) . $quote2, $translated_page );
135
+
136
+ return $translated_page;
137
+ }
138
+
139
+ /**
140
+ * Replace form action attribute
141
+ *
142
+ * @since 2.0
143
+ * @param string $translated_page
144
+ * @param string $current_url
145
+ * @param string $quote1
146
+ * @param string $quote2
147
+ * @param string $sometags
148
+ * @param string $sometags2
149
+ * @return string
150
+ */
151
+ public function replace_form( $translated_page, $current_url, $quote1, $quote2, $sometags = null, $sometags2 = null ) {
152
+ $current_language = weglot_get_current_language();
153
+ $translated_page = preg_replace( '/<form' . preg_quote( $sometags, '/' ) . 'action=' . preg_quote( $quote1 . $current_url . $quote2, '/' ) . '/', '<form ' . $sometags . 'action=' . $quote1 . $this->replace_url( $current_url, $current_language ) . $quote2, $translated_page );
154
+
155
+ return $translated_page;
156
+ }
157
+
158
+ /**
159
+ * Replace canonical attribute
160
+ *
161
+ * @since 2.0
162
+ * @param string $translated_page
163
+ * @param string $current_url
164
+ * @param string $quote1
165
+ * @param string $quote2
166
+ * @param string $sometags
167
+ * @param string $sometags2
168
+ * @return string
169
+ */
170
+ public function replace_canonical( $translated_page, $current_url, $quote1, $quote2, $sometags = null, $sometags2 = null ) {
171
+ $current_language = weglot_get_current_language();
172
+ $translated_page = preg_replace( '/<link rel="canonical"' . preg_quote( $sometags, '/' ) . 'href=' . preg_quote( $quote1 . $current_url . $quote2, '/' ) . '/', '<link rel="canonical"' . $sometags . 'href=' . $quote1 . $this->replace_url( $current_url, $current_language ) . $quote2, $translated_page );
173
+
174
+ return $translated_page;
175
+ }
176
+
177
+ /**
178
+ * Replace amphtml attribute
179
+ *
180
+ * @since 2.0
181
+ * @param string $translated_page
182
+ * @param string $current_url
183
+ * @param string $quote1
184
+ * @param string $quote2
185
+ * @param string $sometags
186
+ * @param string $sometags2
187
+ * @return string
188
+ */
189
+ public function replace_amp( $translated_page, $current_url, $quote1, $quote2, $sometags = null, $sometags2 = null ) {
190
+ $current_language = weglot_get_current_language();
191
+ $translated_page = preg_replace( '/<link rel="amphtml"' . preg_quote( $sometags, '/' ) . 'href=' . preg_quote( $quote1 . $current_url . $quote2, '/' ) . '/', '<link rel="amphtml"' . $sometags . 'href=' . $quote1 . $this->replace_url( $current_url, $current_language ) . $quote2, $translated_page );
192
+
193
+ return $translated_page;
194
+ }
195
+
196
+ /**
197
+ * Replace meta og url attribute
198
+ *
199
+ * @since 2.0
200
+ * @param string $translated_page
201
+ * @param string $current_url
202
+ * @param string $quote1
203
+ * @param string $quote2
204
+ * @param string $sometags
205
+ * @param string $sometags2
206
+ * @return string
207
+ */
208
+ public function replace_meta( $translated_page, $current_url, $quote1, $quote2, $sometags = null, $sometags2 = null ) {
209
+ $current_language = weglot_get_current_language();
210
+ $translated_page = preg_replace( '/<meta property="og:url"' . preg_quote( $sometags, '/' ) . 'content=' . preg_quote( $quote1 . $current_url . $quote2, '/' ) . '/', '<meta property="og:url"' . $sometags . 'content=' . $quote1 . $this->replace_url( $current_url, $current_language ) . $quote2, $translated_page );
211
+
212
+ return $translated_page;
213
+ }
214
+ }
src/services/class-replace-url-service-weglot.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+ /**
11
+ * Replace URL
12
+ *
13
+ * @since 2.0
14
+ */
15
+ class Replace_Url_Service_Weglot {
16
+
17
+ /**
18
+ * @since 2.0
19
+ */
20
+ public function __construct() {
21
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
22
+ $this->replace_link_service = weglot_get_service( 'Replace_Link_Service_Weglot' );
23
+ }
24
+
25
+ /**
26
+ * Replace link
27
+ *
28
+ * @param string $pattern
29
+ * @param string $translated_page
30
+ * @param string $type
31
+ * @return string
32
+ */
33
+ public function modify_link( $pattern, $translated_page, $type ) {
34
+ $current_language = weglot_get_current_language();
35
+
36
+ preg_match_all( $pattern, $translated_page, $out, PREG_PATTERN_ORDER );
37
+ $count_out_0 = count( $out[0] );
38
+ for ( $i = 0;$i < $count_out_0; $i++ ) {
39
+ $sometags = ( isset( $out[1] ) ) ? $out[1][ $i ] : null;
40
+ $quote1 = ( isset( $out[2] ) ) ? $out[2][ $i ] : null;
41
+ $current_url = ( isset( $out[3] ) ) ? $out[3][ $i ] : null;
42
+ $quote2 = ( isset( $out[4] ) ) ? $out[4][ $i ] : null;
43
+ $sometags2 = ( isset( $out[5] ) ) ? $out[5][ $i ] : null;
44
+
45
+ $length_link = apply_filters( 'weglot_length_replace_a', 1500 ); // Prevent error on long URL (preg_match_all Compilation failed: regular expression is too large at offset)
46
+ if ( strlen( $current_url ) >= $length_link ) {
47
+ continue;
48
+ }
49
+
50
+ if ( self::check_link( $current_url, $sometags, $sometags2 ) ) {
51
+ $function_name = 'replace_' . $type;
52
+
53
+ $translated_page = $this->replace_link_service->$function_name(
54
+ $translated_page,
55
+ $current_url,
56
+ $quote1,
57
+ $quote2,
58
+ $sometags,
59
+ $sometags2
60
+ );
61
+ }
62
+ }
63
+
64
+ return $translated_page;
65
+ }
66
+
67
+ /**
68
+ * @since 2.0
69
+ * @param string $current_url
70
+ * @param string $sometags
71
+ * @param string $sometags2
72
+ * @return string
73
+ */
74
+ public function check_link( $current_url, $sometags = null, $sometags2 = null ) {
75
+ $admin_url = admin_url();
76
+ $parsed_url = wp_parse_url( $current_url );
77
+
78
+ return (
79
+ (
80
+ ( $current_url[0] === 'h' && $parsed_url['host'] === $_SERVER['HTTP_HOST'] ) || //phpcs:ignore
81
+ ( isset( $current_url[0] ) && $current_url[0] === '/' && ( isset( $current_url[1] ) ) && '/' !== $current_url[1] ) //phpcs:ignore
82
+ ) &&
83
+ strpos( $current_url, $admin_url ) === false
84
+ && strpos( $current_url, 'wp-login' ) === false
85
+ && ! $this->is_link_a_file( $current_url )
86
+ && $this->request_url_services->is_eligible_url( $current_url )
87
+ && strpos( $sometags, 'data-wg-notranslate' ) === false
88
+ && strpos( $sometags2, 'data-wg-notranslate' ) === false
89
+ );
90
+ }
91
+
92
+ /**
93
+ * @since 2.0
94
+ *
95
+ * @param string $current_url
96
+ * @return boolean
97
+ */
98
+ public function is_link_a_file( $current_url ) {
99
+ $files = [
100
+ 'pdf',
101
+ 'rar',
102
+ 'doc',
103
+ 'docx',
104
+ 'jpg',
105
+ 'jpeg',
106
+ 'png',
107
+ 'ppt',
108
+ 'pptx',
109
+ 'xls',
110
+ 'zip',
111
+ 'mp4',
112
+ 'xlsx',
113
+ ];
114
+
115
+ foreach ( $files as $file ) {
116
+ if ( self::ends_with( $current_url, '.' . $file ) ) {
117
+ return true;
118
+ }
119
+ }
120
+ return false;
121
+ }
122
+
123
+ /**
124
+ * search forward starting from end minus needle length characters
125
+ * @since 2.0
126
+ *
127
+ * @param string $haystack
128
+ * @param string $needle
129
+ * @return boolean
130
+ */
131
+ public function ends_with( $haystack, $needle ) {
132
+ $temp = strlen( $haystack );
133
+
134
+ return '' === $needle ||
135
+ (
136
+ ( $temp - strlen( $needle ) ) >= 0 && strpos( $haystack, $needle, $temp ) !== false
137
+ );
138
+ }
139
+ }
140
+
141
+
src/services/class-request-url-service-weglot.php ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use Weglot\Util\Url;
10
+ use Weglot\Util\Server;
11
+
12
+
13
+ /**
14
+ * Request URL
15
+ *
16
+ * @since 2.0
17
+ */
18
+ class Request_Url_Service_Weglot {
19
+ /**
20
+ * @since 2.0
21
+ *
22
+ * @var string
23
+ */
24
+ protected $weglot_url = null;
25
+
26
+ /**
27
+ * @since 2.0
28
+ */
29
+ public function __construct() {
30
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
31
+ $this->amp_services = weglot_get_service( 'Amp_Service_Weglot' );
32
+ }
33
+
34
+ /**
35
+ * Use for abstract \Weglot\Util\Url
36
+ *
37
+ * @param string $url
38
+ * @return Weglot\Util\Url
39
+ */
40
+ public function create_url_object( $url ) {
41
+ return new Url(
42
+ $url,
43
+ $this->option_services->get_option( 'original_language' ),
44
+ $this->option_services->get_option( 'destination_language' ),
45
+ $this->get_home_wordpress_directory()
46
+ );
47
+ }
48
+
49
+ /**
50
+ * @since 2.0
51
+ *
52
+ * @return string
53
+ */
54
+ public function init_weglot_url() {
55
+ $exclude_urls_option = $this->option_services->get_exclude_urls();
56
+
57
+ if ( ! empty( $exclude_urls_option ) ) {
58
+ $exclude_urls_option = array_map( function( $item ) {
59
+ return $this->url_to_relative( $item );
60
+ }, $exclude_urls_option);
61
+ }
62
+
63
+ $this->weglot_url = new Url(
64
+ $this->get_full_url(),
65
+ $this->option_services->get_option( 'original_language' ),
66
+ $this->option_services->get_option( 'destination_language' ),
67
+ $this->get_home_wordpress_directory()
68
+ );
69
+
70
+ $this->weglot_url->setExcludedUrls( $exclude_urls_option );
71
+
72
+ return $this;
73
+ }
74
+
75
+ /**
76
+ * Get request URL in process
77
+ * @since 2.0
78
+ * @return \Weglot\Util\Url
79
+ */
80
+ public function get_weglot_url() {
81
+ if ( null === $this->weglot_url ) {
82
+ $this->init_weglot_url();
83
+ }
84
+
85
+ return $this->weglot_url;
86
+ }
87
+
88
+ /**
89
+ * Abstraction of \Weglot\Util\Url
90
+ * @since 2.0
91
+ * @return string
92
+ */
93
+ public function get_current_language() {
94
+ if ( wp_doing_ajax() && isset( $_SERVER['HTTP_REFERER'] ) ) { //phpcs:ignore
95
+ return $this->create_url_object( $_SERVER['HTTP_REFERER'] )->detectCurrentLanguage(); //phpcs:ignore
96
+ }
97
+
98
+ return $this->get_weglot_url()->detectCurrentLanguage();
99
+ }
100
+
101
+ /**
102
+ * Abstraction of \Weglot\Util\Url
103
+ * @since 2.0
104
+ *
105
+ * @return boolean
106
+ */
107
+ public function is_translatable_url() {
108
+ return $this->get_weglot_url()->isTranslable();
109
+ }
110
+
111
+
112
+ /**
113
+ * @since 2.0
114
+ *
115
+ * @return string
116
+ * @param mixed $use_forwarded_host
117
+ */
118
+ public function get_full_url( $use_forwarded_host = false ) {
119
+ return Server::fullUrl($_SERVER, $use_forwarded_host); //phpcs:ignore
120
+ }
121
+
122
+
123
+ /**
124
+ * @todo : Change this when weglot-php included
125
+ *
126
+ * @param string $code
127
+ * @return boolean
128
+ */
129
+ public function is_language_rtl( $code ) {
130
+ $rtls = [ 'ar', 'he', 'fa' ];
131
+ if ( in_array( $code, $rtls, true ) ) {
132
+ return true;
133
+ }
134
+
135
+ return false;
136
+ }
137
+
138
+ /**
139
+ * @since 2.0
140
+ *
141
+ * @return string|null
142
+ */
143
+ public function get_home_wordpress_directory() {
144
+ $opt_siteurl = trim( get_option( 'siteurl' ), '/' );
145
+ $opt_home = trim( get_option( 'home' ), '/' );
146
+ if ( empty( $opt_siteurl ) || empty( $opt_home ) ) {
147
+ return null;
148
+ }
149
+
150
+ if (
151
+ ( substr( $opt_home, 0, 7 ) === 'http://' && strpos( substr( $opt_home, 7 ), '/' ) !== false) || ( substr( $opt_home, 0, 8 ) === 'https://' && strpos( substr( $opt_home, 8 ), '/' ) !== false ) ) {
152
+ $parsed_url = parse_url( $opt_home ); // phpcs:ignore
153
+ $path = isset( $parsed_url['path'] ) ? $parsed_url['path'] : '/';
154
+ return $path;
155
+ }
156
+
157
+ return null;
158
+ }
159
+
160
+
161
+ /**
162
+ * Is eligible URL
163
+ * @since 2.0
164
+ * @param string $url
165
+ * @return boolean
166
+ */
167
+ public function is_eligible_url( $url ) {
168
+ $url = urldecode( $this->url_to_relative( $url ) );
169
+
170
+ //Format exclude URL
171
+ $exclude_urls_option = weglot_get_exclude_urls();
172
+
173
+ if ( ! empty( $exclude_urls_option ) ) {
174
+ $exclude_urls_option = implode( ',', $exclude_urls_option );
175
+ $exclude_urls_option = preg_replace( '#\s+#', ',', trim( $exclude_urls_option ) );
176
+
177
+ $excluded_urls = explode( ',', $exclude_urls_option );
178
+ foreach ( $excluded_urls as $key => $ex_url ) {
179
+ $excluded_urls[$key] = $this->url_to_relative( $ex_url ); //phpcs:ignore
180
+ }
181
+ $exclude_urls_option = implode( ',', $excluded_urls );
182
+ }
183
+
184
+ $exclusions = preg_replace( '#\s+#', ',', $exclude_urls_option );
185
+
186
+ $list_regex = [];
187
+ if ( ! empty( $exclusions ) ) {
188
+ $list_regex = explode( ',', $exclusions );
189
+ }
190
+
191
+ $translate_amp = weglot_get_translate_amp_translation();
192
+
193
+ if ( ! $translate_amp ) {
194
+ $list_regex[] = $this->amp_services->get_regex();
195
+ }
196
+
197
+ foreach ( $list_regex as $regex ) {
198
+ $str = $this->escape_slash( $regex );
199
+ $prepare_regex = sprintf( '/%s/', $str );
200
+ if ( preg_match( $prepare_regex, $url ) === 1 ) {
201
+ return apply_filters( 'weglot_is_eligible_url', false, $url );
202
+ }
203
+ }
204
+
205
+ return apply_filters( 'weglot_is_eligible_url', true, $url );
206
+ }
207
+
208
+ /**
209
+ * @since 2.0
210
+ *
211
+ * @param string $str
212
+ * @return string
213
+ */
214
+ public function escape_slash( $str ) {
215
+ return str_replace( '/', '\/', $str );
216
+ }
217
+
218
+
219
+ /**
220
+ * @since 2.0
221
+ *
222
+ * @param string $url
223
+ * @return string
224
+ */
225
+ public function url_to_relative( $url ) {
226
+ if ( ( substr( $url, 0, 7 ) === 'http://' ) || ( substr( $url, 0, 8 ) === 'https://' ) ) {
227
+ // the current link is an "absolute" URL - parse it to get just the path
228
+ $parsed = wp_parse_url( $url );
229
+ $path = isset( $parsed['path'] ) ? $parsed['path'] : '';
230
+ $query = isset( $parsed['query'] ) ? '?' . $parsed['query'] : '';
231
+ $fragment = isset( $parsed['fragment'] ) ? '#' . $parsed['fragment'] : '';
232
+
233
+ if ( $this->get_home_wordpress_directory() ) {
234
+ $relative = str_replace( $this->get_home_wordpress_directory(), '', $path );
235
+
236
+ return ( empty( $relative ) ) ? '/' : $relative;
237
+ }
238
+
239
+ return $path . $query . $fragment;
240
+ }
241
+ return $url;
242
+ }
243
+ }
244
+
245
+
src/services/class-user-api-service-weglot.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+
11
+ /**
12
+ * @since 2.0
13
+ */
14
+ class User_Api_Service_Weglot {
15
+ const API_BASE = 'https://api.weglot.com';
16
+ const API_BASE_OLD = 'https://weglot.com/api/';
17
+
18
+ protected $user_info = null;
19
+
20
+ /**
21
+ * @since 2.0
22
+ * @return array
23
+ */
24
+ public function get_plans() {
25
+ return [
26
+ 'starter_free' => [
27
+ 'ids' => [ 18, 19, 1001, 1002 ],
28
+ 'limit_language' => 1,
29
+ ],
30
+ 'business' => [
31
+ 'ids' => [ 1, 4, 1003, 1004 ],
32
+ 'limit_language' => 5,
33
+ ],
34
+ ];
35
+ }
36
+
37
+ /**
38
+ * @since 2.0
39
+ * @version 2.0.1
40
+ * @return array
41
+ */
42
+ public function get_user_info() {
43
+ if ( null !== $this->user_info ) {
44
+ return $this->user_info;
45
+ }
46
+
47
+ try {
48
+ $results = $this->do_request( self::API_BASE_OLD . 'user-info?api_key=' . weglot_get_api_key(), null );
49
+ $json = json_decode( $results, true );
50
+ if ( json_last_error() !== JSON_ERROR_NONE ) {
51
+ throw new \Exception( 'Unknown error with Weglot Api (0001) : ' . json_last_error() );
52
+ }
53
+
54
+ if ( isset( $json['succeeded'] ) && ( 0 === $json['succeeded'] || 1 === $json['succeeded'] ) ) {
55
+ if ( 1 !== $json['succeeded'] ) {
56
+ $error = isset( $json['error'] ) ? $json['error'] : 'Unknown error with Weglot Api (0003)';
57
+ throw new \Exception( $error );
58
+ }
59
+
60
+ if ( ! isset( $json['answer'] ) ) {
61
+ throw new \Exception( 'Unknown error with Weglot Api (0004)' );
62
+ }
63
+
64
+ $answer = $json['answer'];
65
+ $this->user_info = $answer;
66
+ return $this->user_info;
67
+ } else {
68
+ throw new \Exception( 'Unknown error with Weglot Api (0002) : ' . $json );
69
+ }
70
+ } catch ( \Exception $e) {
71
+ return ['allowed' => true];
72
+ }
73
+ }
74
+
75
+ /**
76
+ *
77
+ * @param string $url
78
+ * @param array $parameters
79
+ * @return array
80
+ */
81
+ public function do_request( $url, $parameters ) {
82
+ if ( $parameters ) {
83
+ $payload = json_encode( $parameters ); //phpcs:ignore
84
+ if ( json_last_error() === JSON_ERROR_NONE ) {
85
+ $response = wp_remote_post(
86
+ $url,
87
+ array(
88
+ 'method' => 'POST',
89
+ 'timeout' => 45,
90
+ 'redirection' => 5,
91
+ 'blocking' => true,
92
+ 'headers' => array(
93
+ 'Content-type' => 'application/json',
94
+ ),
95
+ 'body' => $payload,
96
+ 'cookies' => array(),
97
+ 'sslverify' => false,
98
+ )
99
+ );
100
+ } else {
101
+ throw new \Exception( 'Cannot json encode parameters: ' . json_last_error() );
102
+ }
103
+ } else {
104
+ $response = wp_remote_get( //phpcs:ignore
105
+ $url,
106
+ [
107
+ 'method' => 'GET',
108
+ 'timeout' => 45,
109
+ 'redirection' => 5,
110
+ 'blocking' => true,
111
+ 'headers' => [
112
+ 'Content-type' => 'application/json',
113
+ ],
114
+ 'body' => null,
115
+ 'cookies' => [],
116
+ 'sslverify' => false,
117
+ ]
118
+ );
119
+ }
120
+
121
+ if ( is_wp_error( $response ) ) {
122
+ $error_message = $response->get_error_message();
123
+ throw new \Exception( 'Error doing the external request to ' . $url . ': ' . $error_message );
124
+ } else {
125
+ return $response['body'];
126
+ }
127
+ }
128
+ }
129
+
130
+
131
+
src/third/amp/class-amp-enqueue-weglot.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\Amp;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+
11
+ /**
12
+ * Amp_Enqueue_Weglot
13
+ *
14
+ * @since 2.0
15
+ */
16
+ class Amp_Enqueue_Weglot implements Hooks_Interface_Weglot {
17
+
18
+ /**
19
+ * @since 2.0
20
+ */
21
+ public function __construct() {
22
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
23
+ }
24
+
25
+ /**
26
+ * @since 2.0
27
+ * @see Hooks_Interface_Weglot
28
+ *
29
+ * @return void
30
+ */
31
+ public function hooks() {
32
+ if ( ! defined( 'AMPFORWP_PLUGIN_DIR' ) && ! defined( 'AMP__VERSION' ) ) {
33
+ return;
34
+ }
35
+
36
+ add_action( 'amp_post_template_css', [ $this, 'weglot_amp_post_template_css' ] );
37
+ add_action( 'amp_post_template_head', [ $this, 'weglot_amp_post_template_head' ] );
38
+ }
39
+
40
+ /**
41
+ * @since 2.0
42
+ *
43
+ * @return void
44
+ */
45
+ public function weglot_amp_post_template_head() {
46
+ ?>
47
+ <link rel="stylesheet" href="<?php echo esc_url( WEGLOT_URL_DIST . '/css/front-css.css' ); ?>" />
48
+ <?php
49
+ }
50
+
51
+ /**
52
+ * @since 2.0
53
+ *
54
+ * @return void
55
+ */
56
+ public function weglot_amp_post_template_css() {
57
+ echo $this->option_services->get_css_custom_inline(); //phpcs:ignore
58
+ echo $this->option_services->get_flag_css(); //phpcs:ignore
59
+ }
60
+ }
src/third/amp/class-amp-service-weglot.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\Amp;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+ /**
11
+ * @since 2.0
12
+ */
13
+ class Amp_Service_Weglot {
14
+
15
+ /**
16
+ * @since 2.0
17
+ * @param mixed $with_escape
18
+ */
19
+ public function get_regex( $with_escape = false ) {
20
+ $regex = '([&\?/])amp(/)?$';
21
+ if ( $with_escape ) {
22
+ $regex = str_replace( '/', '\/', $regex );
23
+ }
24
+
25
+ return apply_filters( 'weglot_regex_amp', $regex );
26
+ }
27
+ }
src/third/woocommerce/class-wc-active-weglot.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\Woocommerce;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+ use WeglotWP\Models\Third_Active_Interface_Weglot;
11
+
12
+
13
+
14
+ /**
15
+ * WC_Active_Weglot
16
+ *
17
+ * @since 2.0
18
+ */
19
+ class WC_Active_Weglot implements Third_Active_Interface_Weglot {
20
+
21
+ /**
22
+ * WooCommerce is active ?
23
+ * @since 2.0
24
+ *
25
+ * @return boolean
26
+ */
27
+ public function is_active() {
28
+ if ( ! function_exists( 'is_plugin_active' ) ) {
29
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
30
+ }
31
+
32
+ if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
33
+ return false;
34
+ }
35
+
36
+ return true;
37
+ }
38
+ }
src/third/woocommerce/class-wc-filter-urls-weglot.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\Woocommerce;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Hooks_Interface_Weglot;
10
+ use WeglotWP\Helpers\Helper_Filter_Url_Weglot;
11
+
12
+ /**
13
+ * WC_Filter_Urls_Weglot
14
+ *
15
+ * @since 2.0
16
+ */
17
+ class WC_Filter_Urls_Weglot implements Hooks_Interface_Weglot {
18
+
19
+ /**
20
+ * @since 2.0
21
+ * @return void
22
+ */
23
+ public function __construct() {
24
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
25
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
26
+ $this->wc_active_services = weglot_get_service( 'WC_Active_Weglot' );
27
+ }
28
+
29
+ /**
30
+ * @since 2.0
31
+ * @see Hooks_Interface_Weglot
32
+ *
33
+ * @return void
34
+ */
35
+ public function hooks() {
36
+ if ( ! $this->wc_active_services->is_active() ) {
37
+ return;
38
+ }
39
+
40
+ add_filter( 'woocommerce_get_cart_url', [ '\WeglotWP\Helpers\Helper_Filter_Url_Weglot', 'filter_url_without_ajax' ] );
41
+ add_filter( 'woocommerce_get_checkout_url', [ '\WeglotWP\Helpers\Helper_Filter_Url_Weglot', 'filter_url_without_ajax' ] );
42
+ add_filter( 'woocommerce_payment_successful_result', [ $this, 'woocommerce_filter_url_array' ] );
43
+ add_filter( 'woocommerce_get_checkout_order_received_url', [ $this, 'woocommerce_filter_order_received_url' ] );
44
+ add_action( 'woocommerce_reset_password_notification', [ $this, 'woocommerce_filter_reset_password' ] );
45
+
46
+ add_filter( 'woocommerce_login_redirect', [ '\WeglotWP\Helpers\Helper_Filter_Url_Weglot', 'filter_url_log_redirect' ] );
47
+ add_filter( 'woocommerce_registration_redirect', [ '\WeglotWP\Helpers\Helper_Filter_Url_Weglot', 'filter_url_log_redirect' ] );
48
+ }
49
+
50
+ /**
51
+ * Filter woocommerce order received URL
52
+ *
53
+ * @since 2.0
54
+ * @param string $url_filter
55
+ * @return string
56
+ */
57
+ public function woocommerce_filter_order_received_url( $url_filter ) {
58
+ $current_and_original_language = weglot_get_current_and_original_language();
59
+ $choose_current_language = $current_and_original_language['current'];
60
+ $url = $this->request_url_services->create_url_object( $url_filter );
61
+ if ( $current_and_original_language['current'] !== $current_and_original_language['original'] ) { // Not ajax
62
+
63
+ if ( substr( get_option( 'permalink_structure' ), -1 ) ) {
64
+ return str_replace( '/?key', '?key', $url->getForLanguage( $choose_current_language ) );
65
+ } else {
66
+ return str_replace( '//?key', '/?key', str_replace( '?key', '/?key', $url->getForLanguage( $choose_current_language ) ) );
67
+ }
68
+ } else {
69
+ if ( isset( $_SERVER['HTTP_REFERER'] ) ) { //phpcs:ignore
70
+ // Ajax
71
+ $choose_current_language = $url->detectCurrentLanguage();
72
+ if ( $choose_current_language && $choose_current_language !== $current_and_original_language['original'] ) {
73
+ if ( substr( get_option( 'permalink_structure' ), -1 ) !== '/' ) {
74
+ return str_replace( '/?key', '?key', $url->getForLanguage( $choose_current_language ) );
75
+ } else {
76
+ return str_replace( '//?key', '/?key', str_replace( '?key', '/?key', $url->getForLanguage( $choose_current_language ) ) );
77
+ }
78
+ }
79
+ }
80
+ }
81
+ return $url_filter;
82
+ }
83
+
84
+ /**
85
+ * Filter array woocommerce filter with optional Ajax
86
+ *
87
+ * @since 2.0
88
+ * @param array $result
89
+ * @return string
90
+ */
91
+ public function woocommerce_filter_url_array( $result ) {
92
+ $current_and_original_language = weglot_get_current_and_original_language();
93
+ $choose_current_language = $current_and_original_language['current'];
94
+ if ( $current_and_original_language['current'] !== $current_and_original_language['original'] ) { // Not ajax
95
+ $url = $this->request_url_services->create_url_object( $result['redirect'] );
96
+ } else {
97
+ if ( isset( $_SERVER['HTTP_REFERER'] ) ) { //phpcs:ignore
98
+ // Ajax
99
+ $url = $this->request_url_services->create_url_object( $_SERVER['HTTP_REFERER'] ); //phpcs:ignore
100
+ $choose_current_language = $url->detectCurrentLanguage();
101
+ $url = $this->request_url_services->create_url_object( $result['redirect'] );
102
+ }
103
+ }
104
+ $result['redirect'] = $url->getForLanguage( $choose_current_language );
105
+ return $result;
106
+ }
107
+
108
+
109
+ /**
110
+ * Redirect URL Lost password for WooCommerce
111
+ * @param mixed $url
112
+ */
113
+ public function woocommerce_filter_reset_password( $url ) {
114
+ $current_and_original_language = weglot_get_current_and_original_language();
115
+
116
+ if ( $current_and_original_language['current'] === $current_and_original_language['original'] ) {
117
+ return $url;
118
+ }
119
+
120
+ $url_redirect = add_query_arg( 'reset-link-sent', 'true', wc_get_account_endpoint_url( 'lost-password' ) );
121
+ $url_redirect = $this->request_url_services->create_url_object( $url_redirect );
122
+
123
+ wp_redirect( $url_redirect->getForLanguage( $current_and_original_language['current'] ) ); //phpcs:ignore
124
+ exit;
125
+ }
126
+ }
src/third/woocommerce/class-wc-translate-weglot.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\Woocommerce;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use Weglot\Client\Api\WordCollection;
10
+ use Weglot\Client\Api\WordEntry;
11
+ use Weglot\Client\Api\Enum\WordType;
12
+ use Weglot\Client\Client;
13
+ use Weglot\Client\Endpoint\Translate;
14
+ use Weglot\Client\Api\TranslateEntry;
15
+ use Weglot\Client\Api\Enum\BotType;
16
+
17
+ use WeglotWP\Helpers\Helper_Json_Inline_Weglot;
18
+
19
+
20
+
21
+ /**
22
+ * WC_Translate_Weglot
23
+ *
24
+ * @since 2.0
25
+ */
26
+ class WC_Translate_Weglot {
27
+ protected function translate_entries( $all_words ) {
28
+ // TranslateEntry
29
+ $params = [
30
+ 'language_from' => weglot_get_original_language(),
31
+ 'language_to' => weglot_get_current_language(),
32
+ 'request_url' => weglot_get_current_full_url(),
33
+ 'bot' => BotType::HUMAN,
34
+ ];
35
+
36
+ $translate = new TranslateEntry( $params );
37
+
38
+ $word_collection = $translate->getInputWords();
39
+ foreach ( $all_words as $value ) {
40
+ $value = Helper_Json_Inline_Weglot::format_for_api( $value );
41
+ $word_collection->addOne( new WordEntry( $value, WordType::TEXT ) );
42
+ }
43
+
44
+ $client = new Client( weglot_get_option( 'api_key' ) );
45
+ $translate = new Translate( $translate, $client );
46
+
47
+ return $translate->handle();
48
+ }
49
+
50
+ /**
51
+ * @since 2.0
52
+ *
53
+ * @param string $content
54
+ * @return array
55
+ */
56
+ protected function translate_adresse_i18n( $content ) {
57
+ preg_match( '#wc_address_i18n_params(.*?);#', $content, $match );
58
+
59
+ if ( ! isset( $match[1] ) ) {
60
+ return $content;
61
+ }
62
+
63
+ preg_match_all( '#(label|placeholder)\\\":\\\"(.*?)\\\"#', $match[1], $all );
64
+
65
+ $object = $this->translate_entries( $all[2] );
66
+
67
+ foreach ( $object->getInputWords() as $key => $input_word ) {
68
+ $from_input = Helper_Json_Inline_Weglot::unformat_from_api( $input_word->getWord() );
69
+ $to_output = Helper_Json_Inline_Weglot::unformat_from_api( $object->getOutputWords()[ $key ]->getWord() );
70
+
71
+ $content = str_replace( '\"' . $from_input . '\"', '\"' . $to_output . '\"', $content );
72
+ }
73
+
74
+ return $content;
75
+ }
76
+
77
+
78
+ /**
79
+ * @since 2.0
80
+ *
81
+ * @param string $content
82
+ * @return array
83
+ */
84
+ protected function translate_add_to_cart_params( $content ) {
85
+ preg_match( '#wc_add_to_cart_params(.*?);#', $content, $match );
86
+
87
+ if ( ! isset( $match[1] ) ) {
88
+ return $content;
89
+ }
90
+
91
+ preg_match_all( '#i18n_view_cart\":\"(.*?)\"#', $match[1], $all );
92
+
93
+ $object = $this->translate_entries( $all[1] );
94
+
95
+ foreach ( $object->getInputWords() as $key => $input_word ) {
96
+ $from_input = Helper_Json_Inline_Weglot::unformat_from_api( $input_word->getWord() );
97
+ $to_output = Helper_Json_Inline_Weglot::unformat_from_api( $object->getOutputWords()[ $key ]->getWord() );
98
+
99
+ $content = str_replace( '"' . $from_input . '"', '"' . $to_output . '"', $content );
100
+ }
101
+
102
+ return $content;
103
+ }
104
+
105
+ /**
106
+ * @since 2.0
107
+ *
108
+ * @param string $content
109
+ * @return string
110
+ */
111
+ public function translate_words( $content ) {
112
+ $content = $this->translate_adresse_i18n( $content );
113
+ $content = $this->translate_add_to_cart_params( $content );
114
+
115
+ return $content;
116
+ }
117
+ }
src/third/yoast/class-redirect-handler-weglot.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ /**
8
+ * Override Yoast Premium
9
+ */
10
+ class Redirect_Handler_Weglot extends \WPSEO_Redirect_Handler {
11
+
12
+ /**
13
+ * The options where the URL redirects are stored.
14
+ *
15
+ * @var string
16
+ */
17
+ private $normal_option_name = 'wpseo-premium-redirects-export-plain';
18
+
19
+ /**
20
+ * The option name where the regex redirects are stored.
21
+ *
22
+ * @var string
23
+ */
24
+ private $regex_option_name = 'wpseo-premium-redirects-export-regex';
25
+
26
+ /**
27
+ * The URL that is called at the moment.
28
+ * @since 2.0
29
+ * @var string
30
+ */
31
+ protected $request_url = '';
32
+
33
+ public function load() {
34
+ $original_destination = weglot_get_current_and_original_language();
35
+
36
+ if ( empty( $original_destination['original'] ) || empty( $original_destination['destination'] ) ) {
37
+ return;
38
+ }
39
+
40
+ // Only handle the redirect when the option for php redirects is enabled.
41
+ if ( ! $this->load_php_redirects() ) {
42
+ return;
43
+ }
44
+
45
+ // Set the requested URL.
46
+ $this->set_request_url();
47
+
48
+ // Check the normal redirects.
49
+ $this->handle_normal_redirects( $this->request_url );
50
+
51
+ do_action( 'weglot_another_redirect_override', $this->request_url );
52
+ }
53
+
54
+ /**
55
+ * @since 2.0
56
+ *
57
+ * @return void
58
+ */
59
+ protected function set_request_url() {
60
+ $this->request_url = $this->get_request_uri();
61
+ }
62
+
63
+ /**
64
+ * Checks if the current URL matches a normal redirect.
65
+ *
66
+ * @param string $request_url The request url to look for.
67
+ *
68
+ * @return void
69
+ */
70
+ protected function handle_normal_redirects( $request_url ) {
71
+ // Setting the redirects.
72
+ $redirects = $this->get_redirects( $this->normal_option_name );
73
+ $this->redirects = $this->normalize_redirects( $redirects );
74
+
75
+ // Trim the slashes, to match the variants of a request URL (Like: url, /url, /url/, url/).
76
+ if ( '/' !== $request_url ) {
77
+ $request_url = trim( $request_url, '/' );
78
+ }
79
+
80
+ $redirect_url = '';
81
+
82
+ if ( isset( $request_url[2] ) && '/' === $request_url[2] ) {
83
+ $code_language = explode( '/', $request_url );
84
+
85
+ $langs = weglot_get_languages_configured( 'code' );
86
+
87
+ if ( ! in_array( $code_language[0], $langs ) ) { // phpcs:ignore
88
+ //Default behavior Yoast
89
+ $redirect_url = $this->find_url( $request_url );
90
+ } else {
91
+ $redirect_url = str_replace( $code_language[0] . '/', '', $request_url );
92
+ $redirect_url = $this->find_url( $redirect_url );
93
+
94
+ if ( ! empty( $redirect_url ) ) { // If find URL redirect on Yoast
95
+
96
+ // Prepare Eligible URL from Yoast
97
+ $eligible_url = $redirect_url['url'];
98
+ if ( '/' !== $eligible_url[0] ) {
99
+ $eligible_url = '/' . $eligible_url;
100
+ }
101
+ if ( substr( $eligible_url, -1 ) !== '/' ) {
102
+ $eligible_url .= '/';
103
+ }
104
+
105
+ if ( weglot_is_eligible_url( $eligible_url ) ) {
106
+ $redirect_url['url'] = sprintf( '%s/%s', $code_language[0], $redirect_url['url'] );
107
+ }
108
+ }
109
+ }
110
+ }
111
+
112
+ // Get the URL and doing the redirect.
113
+ if ( ! empty( $redirect_url ) ) {
114
+ $this->is_redirected = true;
115
+ $this->do_redirect( $redirect_url['url'], $redirect_url['type'] );
116
+ }
117
+ }
118
+ }
src/third/yoast/redirect-premium.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ require_once $dir_yoast_premium_inside . 'classes/redirect/redirect-handler.php';
8
+ require_once $dir_yoast_premium_inside . 'classes/redirect/redirect-util.php';
9
+ require_once __DIR__ . '/class-redirect-handler-weglot.php';
10
+
11
+ $redirect_handler = new Redirect_Handler_Weglot();
12
+ $redirect_handler->load();
src/widgets/class-widget-selector-weglot.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Widgets;
4
+
5
+ defined( 'ABSPATH' ) or die( 'Cheatin&#8217; uh?' );
6
+
7
+
8
+ class Widget_Selector_Weglot extends \WP_Widget {
9
+
10
+ /**
11
+ * Register widget with WordPress.
12
+ */
13
+ public function __construct() {
14
+ parent::__construct(
15
+ WEGLOT_SLUG,
16
+ __( 'Weglot Translate', 'weglot' ),
17
+ [
18
+ 'description' => __( 'Display Weglot selector in widget', 'weglot' ),
19
+ ]
20
+ );
21
+ }
22
+
23
+ /**
24
+ * Front-end display of widget.
25
+ *
26
+ * @see WP_Widget::widget()
27
+ *
28
+ * @param array $args Widget arguments.
29
+ * @param array $instance Saved values from database.
30
+ */
31
+ public function widget( $args, $instance ) {
32
+ if ( ! weglot_current_url_is_eligible() ) {
33
+ return;
34
+ }
35
+
36
+ $title = apply_filters( 'widget_title', $instance['title'] );
37
+
38
+ $tt = ( ! empty( $title ) ) ? $args['before_title'] . $title . $args['after_title'] : '';
39
+
40
+ $button = weglot_get_button_selector_html( 'weglot-widget' );
41
+
42
+ echo $args['before_widget'] . $tt . $button . $args['after_widget']; //phpcs:ignore
43
+ }
44
+
45
+ /**
46
+ * Back-end widget form.
47
+ *
48
+ * @see WP_Widget::form()
49
+ *
50
+ * @param array $instance Previously saved values from database.
51
+ */
52
+ public function form( $instance ) {
53
+ if ( isset( $instance['title'] ) ) {
54
+ $title = $instance['title'];
55
+ } else {
56
+ $title = '';
57
+ } ?>
58
+ <p>
59
+ <label for="<?php echo esc_html( $this->get_field_id( 'title' ) ); ?>">
60
+ <?php esc_html_e( 'Title:', 'weglot' ); ?>
61
+ </label>
62
+ <input class="widefat" id="<?php echo esc_html( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_html( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
63
+ </p>
64
+ <?php
65
+ }
66
+
67
+ /**
68
+ * Sanitize widget form values as they are saved.
69
+ *
70
+ * @see WP_Widget::update()
71
+ *
72
+ * @param array $new_instance Values just sent to be saved.
73
+ * @param array $old_instance Previously saved values from database.
74
+ *
75
+ * @return array Updated safe values to be saved.
76
+ */
77
+ public function update( $new_instance, $old_instance ) {
78
+ $instance = [];
79
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
80
+ return $instance;
81
+ }
82
+ }
templates/admin/notices/no-configuration.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
8
+
9
+ $tab_settings = Helper_Tabs_Admin_Weglot::get_full_tabs()[ Helper_Tabs_Admin_Weglot::SETTINGS ];
10
+
11
+ ?>
12
+ <div class="error settings-error notice is-dismissible">
13
+ <p>
14
+ <?php
15
+ // translators: 1 HTML Tag, 2 HTML Tag
16
+ echo sprintf( esc_html__( 'Weglot Translate is installed but not yet configured, you need to configure Weglot here : %1$sWeglot configuration page%2$s. The configuration takes only 1 minute! ', 'weglot' ), '<a href="' . esc_url( $tab_settings['url'] ) . '">', '</a>' );
17
+ ?>
18
+ </p>
19
+ </div>
templates/admin/notices/no-curl.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ ?>
8
+ <div class="error settings-error notice is-dismissible">
9
+ <p>
10
+ <?php
11
+ // translators: 1 HTML Tag, 2 HTML Tag
12
+ echo esc_html__( 'Weglot Translate: You need to activate cURL. If you need help, just ask us directly at support@weglot.com.', 'weglot' );
13
+ ?>
14
+ </p>
15
+ </div>
templates/admin/notices/php-min.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ ?>
8
+ <div class="error settings-error notice is-dismissible">
9
+ <p>
10
+ <?php
11
+ /* translators: 1 is a plugin name, 2 is Weglot version, 3 is current php version. */
12
+ echo sprintf( esc_html__( '%1$s requires PHP %2$s minimum, your website is actually running version %3$s.', 'weglot' ), '<strong>Weglot translate</strong>', '<code>' . esc_attr( WEGLOT_PHP_MIN ) . '</code>', '<code>' . esc_attr( phpversion() ) . '</code>' );
13
+ ?>
14
+ </p>
15
+ <p>
16
+ <?php
17
+ echo esc_html__( 'If you are not able to upgrade, you can rollback to the previous version by using the button below.', 'weglot' );
18
+ ?>
19
+ </p>
20
+ <p>
21
+ <a href="<?php echo wp_nonce_url( admin_url( 'admin-post.php?action=weglot_rollback' ), 'weglot_rollback' ); //phpcs:ignore ?>" class="button">
22
+ <?php echo esc_html__( 'Re-install version 1.13.1', 'weglot' ); ?>
23
+ </a>
24
+ </p>
25
+ </div>
templates/admin/notices/rewrite-module.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ ?>
8
+ <div class="error settings-error notice is-dismissible">
9
+ <p>
10
+ <?php
11
+ // translators: 1 HTML Tag, 2 HTML Tag
12
+ echo sprintf( esc_html__( 'Weglot Translate: You need to activate the mod_rewrite module. You can find more information here : %1$sUsing Permalinks%2$s. If you need help, just ask us directly at support@weglot.com.', 'weglot' ), '<a target="_blank" href="https://codex.wordpress.org/Using_Permalinks">', '</a>' );
13
+ ?>
14
+ </p>
15
+ </div>
templates/admin/pages/nav.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ ?>
10
+
11
+ <nav class="nav-tab-wrapper">
12
+ <?php
13
+ foreach ( $this->tabs as $key => $tab ) {
14
+ $class_active = ( $this->tab_active === $key ) ? 'nav-tab-active' : '';
15
+ if ( Helper_Tabs_Admin_Weglot::STATUS !== $key ) {
16
+ ?>
17
+ <a
18
+ href="<?php echo esc_url( $tab['url'] ); ?>"
19
+ class="nav-tab <?php echo esc_html( $class_active ); ?>">
20
+ <?php echo esc_html( $tab['title'] ); ?>
21
+ </a>
22
+ <?php
23
+ }
24
+ }
25
+ ?>
26
+ </nav>
templates/admin/pages/settings.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
8
+
9
+
10
+ ?>
11
+
12
+ <div id="wrap-weglot">
13
+ <div class="wrap">
14
+ <?php include_once WEGLOT_TEMPLATES_ADMIN_PAGES . '/nav.php'; ?>
15
+
16
+ <form method="post" id="mainform" action="<?php echo esc_url( admin_url( 'options.php' ) ); ?>">
17
+ <?php
18
+ switch ( $this->tab_active ) {
19
+ case Helper_Tabs_Admin_Weglot::SETTINGS:
20
+ default:
21
+ include_once WEGLOT_TEMPLATES_ADMIN_PAGES . '/tabs/settings.php';
22
+ break;
23
+ case Helper_Tabs_Admin_Weglot::APPEARANCE:
24
+ include_once WEGLOT_TEMPLATES_ADMIN_PAGES . '/tabs/appearance.php';
25
+ break;
26
+ case Helper_Tabs_Admin_Weglot::ADVANCED:
27
+ include_once WEGLOT_TEMPLATES_ADMIN_PAGES . '/tabs/advanced.php';
28
+ break;
29
+ case Helper_Tabs_Admin_Weglot::STATUS:
30
+ include_once WEGLOT_TEMPLATES_ADMIN_PAGES . '/tabs/status.php';
31
+ break;
32
+ }
33
+
34
+ if ( ! in_array( $this->tab_active, [ Helper_Tabs_Admin_Weglot::STATUS ], true ) ) {
35
+ settings_fields( WEGLOT_OPTION_GROUP );
36
+ submit_button();
37
+ }
38
+ ?>
39
+ <input type="hidden" name="tab" value="<?php echo esc_attr( $this->tab_active ); ?>">
40
+ </form>
41
+
42
+ <hr>
43
+ <a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/weglot?rate=5#postform">
44
+ <?php esc_html_e( 'Love Weglot? Give us 5 stars on WordPress.org :)', 'weglot' ); ?>
45
+ </a>
46
+ <i class="fa fa-question-circle question-icon" aria-hidden="true"></i>
47
+ <p class="weglot-five-stars">
48
+ <?php
49
+ // translators: 1 HTML Tag, 2 HTML Tag
50
+ echo sprintf( esc_html__( 'If you need any help, you can contact us via email us at support@weglot.com.', 'weglot' ), '<a href="https://weglot.com/" target="_blank">', '</a>' );
51
+ echo '<br>';
52
+ // translators: 1 HTML Tag, 2 HTML Tag
53
+ echo sprintf( esc_html__( 'You can also check our %1$sFAQ%2$s', 'weglot' ), '<a href="http://support.weglot.com/" target="_blank">', '</a>' );
54
+ ?>
55
+ </p>
56
+ </div>
57
+ <?php
58
+ if ( ! $this->options['has_first_settings'] ) :
59
+ ?>
60
+ <div class="weglot-infobox">
61
+ <h3><?php esc_html_e( 'Where are my translations?', 'weglot' ); ?></h3>
62
+ <div>
63
+ <p><?php esc_html_e( 'You can find all your translations in your Weglot account:', 'weglot' ); ?></p>
64
+ <a href="<?php esc_html_e( 'https://dashboard.weglot.com/translations/', 'weglot' ); ?>" target="_blank" class="weglot-editbtn">
65
+ <?php esc_html_e( 'Edit my translations', 'weglot' ); ?>
66
+ </a>
67
+ </div>
68
+ </div>
69
+ <?php
70
+ endif;
71
+ ?>
72
+ </div>
73
+
templates/admin/pages/tabs/advanced.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ use Weglot\Client\Client;
8
+
9
+ use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
10
+
11
+ $options_available = [
12
+ 'auto_redirect' => [
13
+ 'key' => 'auto_redirect',
14
+ 'label' => __( 'Auto redirection', 'weglot' ),
15
+ 'description' => __( 'Check if you want to redirect users based on their browser language.', 'weglot' ),
16
+ ],
17
+ 'email_translate' => [
18
+ 'key' => 'email_translate',
19
+ 'label' => __( 'Translate email', 'weglot' ),
20
+ 'description' => __( 'Check to translate all emails who use function wp_mail', 'weglot' ),
21
+ ],
22
+ 'translate_amp' => [
23
+ 'key' => 'translate_amp',
24
+ 'label' => __( 'Translate AMP', 'weglot' ),
25
+ 'description' => __( 'Translate AMP page', 'weglot' ),
26
+ ],
27
+ ];
28
+
29
+ ?>
30
+
31
+
32
+ <table class="form-table">
33
+ <tbody>
34
+ <tr valign="top">
35
+ <th scope="row" class="titledesc">
36
+ <label for="<?php echo esc_attr( $options_available['auto_redirect']['key'] ); ?>">
37
+ <?php echo esc_html( $options_available['auto_redirect']['label'] ); ?>
38
+ </label>
39
+ </th>
40
+ <td class="forminp forminp-text">
41
+ <input
42
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['auto_redirect']['key'] ) ); ?>"
43
+ id="<?php echo esc_attr( $options_available['auto_redirect']['key'] ); ?>"
44
+ type="checkbox"
45
+ <?php checked( $this->options[ $options_available['auto_redirect']['key'] ], 1 ); ?>
46
+ >
47
+ <p class="description"><?php echo esc_html( $options_available['auto_redirect']['description'] ); ?></p>
48
+ </td>
49
+ </tr>
50
+ <tr valign="top">
51
+ <th scope="row" class="titledesc">
52
+ <label for="<?php echo esc_attr( $options_available['email_translate']['key'] ); ?>">
53
+ <?php echo esc_html( $options_available['email_translate']['label'] ); ?>
54
+ </label>
55
+ </th>
56
+ <td class="forminp forminp-text">
57
+ <input
58
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['email_translate']['key'] ) ); ?>"
59
+ id="<?php echo esc_attr( $options_available['email_translate']['key'] ); ?>"
60
+ type="checkbox"
61
+ <?php checked( $this->options[ $options_available['email_translate']['key'] ], 1 ); ?>
62
+ >
63
+ <p class="description"><?php echo esc_html( $options_available['email_translate']['description'] ); ?></p>
64
+ </td>
65
+ </tr>
66
+ <tr valign="top">
67
+ <th scope="row" class="titledesc">
68
+ <label for="<?php echo esc_attr( $options_available['translate_amp']['key'] ); ?>">
69
+ <?php echo esc_html( $options_available['translate_amp']['label'] ); ?>
70
+ </label>
71
+ </th>
72
+ <td class="forminp forminp-text">
73
+ <input
74
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['translate_amp']['key'] ) ); ?>"
75
+ id="<?php echo esc_attr( $options_available['translate_amp']['key'] ); ?>"
76
+ type="checkbox"
77
+ <?php checked( $this->options[ $options_available['translate_amp']['key'] ], 1 ); ?>
78
+ >
79
+ <p class="description"><?php echo esc_html( $options_available['translate_amp']['description'] ); ?></p>
80
+ </td>
81
+ </tr>
82
+ </tbody>
83
+ </table>
84
+
85
+ <div class="notice notice-info is-dismissible">
86
+ <p>
87
+ <?php
88
+ // translators: 1 HTML Tag, 2 HTML Tag
89
+ echo sprintf( esc_html__( 'If you need any help, you can contact us via email us at support@weglot.com.', 'weglot' ), '<a href="https://weglot.com/" target="_blank">', '</a>' );
90
+ ?>
91
+ </p>
92
+ <p>
93
+ <?php esc_html_e( 'You can also return to version 1.13.1 by clicking on the button below', 'weglot' ); ?>
94
+ </p>
95
+ <p>
96
+ <a href="<?php echo wp_nonce_url( admin_url( 'admin-post.php?action=weglot_rollback' ), 'weglot_rollback' ); //phpcs:ignore ?>" class="button">
97
+ <?php echo esc_html__( 'Re-install version 1.13.1', 'weglot' ); ?>
98
+ </a>
99
+ </p>
100
+ </div>
101
+
templates/admin/pages/tabs/appearance.php ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+ use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
7
+
8
+ $options_available = [
9
+ 'type_flags' => [
10
+ 'key' => 'type_flags',
11
+ 'label' => __( 'Type of flags', 'weglot' ),
12
+ 'description' => '',
13
+ ],
14
+ 'is_fullname' => [
15
+ 'key' => 'is_fullname',
16
+ 'label' => __( 'Is fullname', 'weglot' ),
17
+ 'description' => __( "Check if you want the name of the languge. Don't check if you want the language code.", 'weglot' ),
18
+ ],
19
+ 'with_name' => [
20
+ 'key' => 'with_name',
21
+ 'label' => __( 'With name', 'weglot' ),
22
+ 'description' => __( 'Check if you want to display the name of languages.', 'weglot' ),
23
+ ],
24
+ 'is_dropdown' => [
25
+ 'key' => 'is_dropdown',
26
+ 'label' => __( 'Is dropdown', 'weglot' ),
27
+ 'description' => __( 'Check if you want the button to be a dropdown box.', 'weglot' ),
28
+ ],
29
+ 'with_flags' => [
30
+ 'key' => 'with_flags',
31
+ 'label' => __( 'With flags', 'weglot' ),
32
+ 'description' => __( 'Check if you want flags in the language button.', 'weglot' ),
33
+ ],
34
+ 'override_css' => [
35
+ 'key' => 'override_css',
36
+ 'label' => __( 'Override CSS', 'weglot' ),
37
+ 'description' => __( "Don't change it unless you want a specific style for your button.", 'weglot' ),
38
+ ],
39
+ 'flag_css' => [
40
+ 'key' => 'flag_css',
41
+ ],
42
+ ];
43
+
44
+ ?>
45
+ <style id="weglot-css-inline"></style>
46
+ <style id="weglot-css-flag-css"></style>
47
+ <h3>
48
+ <?php echo esc_html__( 'Language button design', 'weglot' ) . ' ' . esc_html__( '(Optional)', 'weglot' ); ?>
49
+ </h3>
50
+ <hr />
51
+ <table class="form-table">
52
+ <tbody>
53
+ <tr valign="top">
54
+ <th scope="row" class="titledesc">
55
+ <label>
56
+ <?php echo esc_html__( 'Button preview', 'weglot' ); ?>
57
+ </label>
58
+ </th>
59
+ <td class="forminp forminp-text">
60
+ <?php echo $this->button_services->get_html( 'weglot-preview' ); //phpcs:ignore ?>
61
+ </td>
62
+ </tr>
63
+ <tr valign="top">
64
+ <th scope="row" class="titledesc">
65
+ <label for="<?php echo esc_attr( $options_available['is_dropdown']['key'] ); ?>">
66
+ <?php echo esc_html( $options_available['is_dropdown']['label'] ); ?>
67
+ </label>
68
+ </th>
69
+ <td class="forminp forminp-text">
70
+ <input
71
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['is_dropdown']['key'] ) ); ?>"
72
+ id="<?php echo esc_attr( $options_available['is_dropdown']['key'] ); ?>"
73
+ type="checkbox"
74
+ <?php checked( $this->options[ $options_available['is_dropdown']['key'] ], 1 ); ?>
75
+ >
76
+ <p class="description"><?php echo esc_html( $options_available['is_dropdown']['description'] ); ?></p>
77
+ </td>
78
+ </tr>
79
+ <tr valign="top">
80
+ <th scope="row" class="titledesc">
81
+ <label for="<?php echo esc_attr( $options_available['with_flags']['key'] ); ?>">
82
+ <?php echo esc_html( $options_available['with_flags']['label'] ); ?>
83
+ </label>
84
+ </th>
85
+ <td class="forminp forminp-text">
86
+ <input
87
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['with_flags']['key'] ) ); ?>"
88
+ id="<?php echo esc_attr( $options_available['with_flags']['key'] ); ?>"
89
+ type="checkbox"
90
+ <?php checked( $this->options[ $options_available['with_flags']['key'] ], 1 ); ?>
91
+ >
92
+ <p class="description"><?php echo esc_html( $options_available['with_flags']['description'] ); ?></p>
93
+ </td>
94
+ </tr>
95
+ <tr valign="top">
96
+ <th scope="row" class="titledesc">
97
+ <label for="<?php echo esc_attr( $options_available['type_flags']['key'] ); ?>">
98
+ <?php echo esc_html( $options_available['type_flags']['label'] ); ?>
99
+ </label>
100
+ </th>
101
+ <td class="forminp forminp-text">
102
+ <select
103
+ class="wg-input-select"
104
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['type_flags']['key'] ) ); ?>"
105
+ id="<?php echo esc_attr( $options_available['type_flags']['key'] ); ?>"
106
+ >
107
+ <option <?php selected( $this->options[ $options_available['type_flags']['key'] ], '0' ); ?> value="0">
108
+ <?php esc_html_e( 'Rectangle mat', 'weglot' ); ?>
109
+ </option>
110
+ <option <?php selected( $this->options[ $options_available['type_flags']['key'] ], '1' ); ?> value="1">
111
+ <?php esc_html_e( 'Rectangle shiny', 'weglot' ); ?>
112
+ </option>
113
+ <option <?php selected( $this->options[ $options_available['type_flags']['key'] ], '2' ); ?> value="2">
114
+ <?php esc_html_e( 'Square', 'weglot' ); ?>
115
+ </option>
116
+ <option <?php selected( $this->options[ $options_available['type_flags']['key'] ], '3' ); ?> value="3">
117
+ <?php esc_html_e( 'Circle', 'weglot' ); ?>
118
+ </option>
119
+ </select>
120
+ <div class="flag-style-openclose"><?php esc_html_e( 'Change country flags', 'weglot' ); ?></div>
121
+ <div class="flag-style-wrapper" style="display:none;">
122
+ <select class="flag-en-type wg-input-select">
123
+ <option value=0><?php esc_html_e( 'Choose English flag:', 'weglot' ); ?></option>
124
+ <option value=0><?php esc_html_e( 'United Kingdom (default)', 'weglot' ); ?></option>
125
+ <option value=1><?php esc_html_e( 'United States', 'weglot' ); ?></option>
126
+ <option value=2><?php esc_html_e( 'Australia', 'weglot' ); ?></option>
127
+ <option value=3><?php esc_html_e( 'Canada', 'weglot' ); ?></option>
128
+ <option value=4><?php esc_html_e( 'New Zealand', 'weglot' ); ?></option>
129
+ <option value=5><?php esc_html_e( 'Jamaica', 'weglot' ); ?></option>
130
+ <option value=6><?php esc_html_e( 'Ireland', 'weglot' ); ?></option>
131
+ </select>
132
+ <select class="flag-es-type wg-input-select">
133
+ <option value=0><?php esc_html_e( 'Choose Spanish flag:', 'weglot' ); ?></option>
134
+ <option value=0><?php esc_html_e( 'Spain (default)', 'weglot' ); ?></option>
135
+ <option value=1><?php esc_html_e( 'Mexico', 'weglot' ); ?></option>
136
+ <option value=2><?php esc_html_e( 'Argentina', 'weglot' ); ?></option>
137
+ <option value=3><?php esc_html_e( 'Colombia', 'weglot' ); ?></option>
138
+ <option value=4><?php esc_html_e( 'Peru', 'weglot' ); ?></option>
139
+ <option value=5><?php esc_html_e( 'Bolivia', 'weglot' ); ?></option>
140
+ <option value=6><?php esc_html_e( 'Uruguay', 'weglot' ); ?></option>
141
+ <option value=7><?php esc_html_e( 'Venezuela', 'weglot' ); ?></option>
142
+ <option value=8><?php esc_html_e( 'Chile', 'weglot' ); ?></option>
143
+ <option value=9><?php esc_html_e( 'Ecuador', 'weglot' ); ?></option>
144
+ <option value=10><?php esc_html_e( 'Guatemala', 'weglot' ); ?></option>
145
+ <option value=11><?php esc_html_e( 'Cuba', 'weglot' ); ?></option>
146
+ <option value=12><?php esc_html_e( 'Dominican Republic', 'weglot' ); ?></option>
147
+ <option value=13><?php esc_html_e( 'Honduras', 'weglot' ); ?></option>
148
+ <option value=14><?php esc_html_e( 'Paraguay', 'weglot' ); ?></option>
149
+ <option value=15><?php esc_html_e( 'El Salvador', 'weglot' ); ?></option>
150
+ <option value=16><?php esc_html_e( 'Nicaragua', 'weglot' ); ?></option>
151
+ <option value=17><?php esc_html_e( 'Costa Rica', 'weglot' ); ?></option>
152
+ <option value=18><?php esc_html_e( 'Puerto Rico', 'weglot' ); ?></option>
153
+ <option value=19><?php esc_html_e( 'Panama', 'weglot' ); ?></option>
154
+ </select>
155
+ <select class="flag-pt-type wg-input-select">
156
+ <option value=0><?php esc_html_e( 'Choose Portuguese flag:', 'weglot' ); ?></option>
157
+ <option value=0><?php esc_html_e( 'Brazil (default)', 'weglot' ); ?></option>
158
+ <option value=1><?php esc_html_e( 'Portugal', 'weglot' ); ?></option>
159
+ </select>
160
+ <select class="flag-fr-type wg-input-select">
161
+ <option value=0><?php esc_html_e( 'Choose French flag:', 'weglot' ); ?></option>
162
+ <option value=0><?php esc_html_e( 'France (default)', 'weglot' ); ?></option>
163
+ <option value=1><?php esc_html_e( 'Belgium', 'weglot' ); ?></option>
164
+ <option value=2><?php esc_html_e( 'Canada', 'weglot' ); ?></option>
165
+ <option value=3><?php esc_html_e( 'Switzerland', 'weglot' ); ?></option>
166
+ <option value=4><?php esc_html_e( 'Luxemburg', 'weglot' ); ?></option>
167
+ </select>
168
+ <select class="flag-ar-type wg-input-select">
169
+ <option value=0><?php esc_html_e( 'Choose Arabic flag:', 'weglot' ); ?></option>
170
+ <option value=0><?php esc_html_e( 'Saudi Arabia (default)', 'weglot' ); ?></option>
171
+ <option value=1><?php esc_html_e( 'Algeria', 'weglot' ); ?></option>
172
+ <option value=2><?php esc_html_e( 'Egypt', 'weglot' ); ?></option>
173
+ <option value=3><?php esc_html_e( 'Iraq', 'weglot' ); ?></option>
174
+ <option value=4><?php esc_html_e( 'Jordan', 'weglot' ); ?></option>
175
+ <option value=5><?php esc_html_e( 'Kuwait', 'weglot' ); ?></option>
176
+ <option value=6><?php esc_html_e( 'Lebanon', 'weglot' ); ?></option>
177
+ <option value=7><?php esc_html_e( 'Libya', 'weglot' ); ?></option>
178
+ <option value=8><?php esc_html_e( 'Morocco', 'weglot' ); ?></option>
179
+ <option value=14><?php esc_html_e( 'Oman', 'weglot' ); ?></option>
180
+ <option value=9><?php esc_html_e( 'Qatar', 'weglot' ); ?></option>
181
+ <option value=10><?php esc_html_e( 'Syria', 'weglot' ); ?></option>
182
+ <option value=11><?php esc_html_e( 'Tunisia', 'weglot' ); ?></option>
183
+ <option value=12><?php esc_html_e( 'United Arab Emirates', 'weglot' ); ?></option>
184
+ <option value=13><?php esc_html_e( 'Yemen', 'weglot' ); ?></option>
185
+ </select>
186
+ <p><?php esc_html_e( 'If you want to use a different flag, just ask us.', 'weglot' ); ?></p>
187
+ </div>
188
+ <textarea id="flag_css" name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['flag_css']['key'] ) ); ?>" style="display:none;"><?php echo esc_attr( $this->options['flag_css'] ); ?></textarea>
189
+ </td>
190
+ </tr>
191
+ <tr valign="top">
192
+ <th scope="row" class="titledesc">
193
+ <label for="<?php echo esc_attr( $options_available['with_name']['key'] ); ?>">
194
+ <?php echo esc_html( $options_available['with_name']['label'] ); ?>
195
+ </label>
196
+ </th>
197
+ <td class="forminp forminp-text">
198
+ <input
199
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['with_name']['key'] ) ); ?>"
200
+ id="<?php echo esc_attr( $options_available['with_name']['key'] ); ?>"
201
+ type="checkbox"
202
+ <?php checked( $this->options[ $options_available['with_name']['key'] ], 1 ); ?>
203
+ >
204
+ <p class="description"><?php echo esc_html( $options_available['with_name']['description'] ); ?></p>
205
+ </td>
206
+ </tr>
207
+ <tr valign="top">
208
+ <th scope="row" class="titledesc">
209
+ <label for="<?php echo esc_attr( $options_available['is_fullname']['key'] ); ?>">
210
+ <?php echo esc_html( $options_available['is_fullname']['label'] ); ?>
211
+ </label>
212
+ </th>
213
+ <td class="forminp forminp-text">
214
+ <input
215
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['is_fullname']['key'] ) ); ?>"
216
+ id="<?php echo esc_attr( $options_available['is_fullname']['key'] ); ?>"
217
+ type="checkbox"
218
+ <?php checked( $this->options[ $options_available['is_fullname']['key'] ], 1 ); ?>
219
+ >
220
+ <p class="description"><?php echo esc_html( $options_available['is_fullname']['description'] ); ?></p>
221
+ </td>
222
+ </tr>
223
+ <tr valign="top">
224
+ <th scope="row" class="titledesc">
225
+ <label for="<?php echo esc_attr( $options_available['override_css']['key'] ); ?>">
226
+ <?php echo esc_html( $options_available['override_css']['label'] ); ?>
227
+ </label>
228
+ <p class="sub-label"><?php echo esc_html( $options_available['override_css']['description'] ); ?></p>
229
+ </td>
230
+ </th>
231
+ <td class="forminp forminp-text">
232
+ <textarea
233
+ class="wg-input-textarea"
234
+ id="<?php echo esc_attr( $options_available['override_css']['key'] ); ?>"
235
+ type="text"
236
+ rows="10"
237
+ cols="30"
238
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['override_css']['key'] ) ); ?>" placeholder=".weglot-selector {
239
+ margin-bottom: 20px;
240
+ }"><?php echo $this->options[ $options_available['override_css']['key'] ]; //phpcs:ignore?></textarea>
241
+ </tr>
242
+ </tbody>
243
+ </table>
244
+
245
+
246
+ <h3>
247
+ <?php echo esc_html_e( 'Language button position', 'weglot' ) . ' ' . esc_html__( '(Optional)', 'weglot' ); ?>
248
+ </h3>
249
+ <hr />
250
+
251
+ <p><?php esc_html_e( 'Where will the language button be on my website? By default, bottom right.', 'weglot' ); ?></p>
252
+
253
+ <table class="form-table">
254
+ <?php if ( isset( $this->options['is_menu'] ) && $this->options['is_menu'] ) : ?>
255
+ <tr valign="top">
256
+ <th scope="row" class="titledesc">
257
+ <label for="is_menu>">
258
+ <?php echo esc_html__( 'In menu (Weglot translate V1) ?', 'weglot' ); ?>
259
+ </label>
260
+ </th>
261
+ <td class="forminp forminp-text">
262
+ <input
263
+ name="is_menu"
264
+ id="is_menu"
265
+ type="checkbox"
266
+ checked
267
+ style="display:inline-block;"
268
+ >
269
+ <div class="notice notice-error is-dismissible" style="display: inline-block; position: relative; width: 80%; vertical-align: middle;">
270
+ <p>
271
+ <?php
272
+ // translators: 1 HTML Tag, 2 HTML Tag
273
+ echo esc_html__( 'Warning, this feature will be depreciated. We strongly advise you to uncheck the option and use and use the functionality: "In menu".', 'weglot' );
274
+ ?>
275
+ </p>
276
+ </div>
277
+ </td>
278
+ </tr>
279
+ <?php endif; ?>
280
+ <tr valign="top">
281
+ <th scope="row"><?php esc_html_e( 'In menu?', 'weglot' ); ?></th>
282
+ <td>
283
+ <?php esc_html_e( 'You can place the button in a menu area. Go to Appearance -> Menus and drag and drop the Weglot Translate Custom link where you want.', 'weglot' ); ?>
284
+ </td>
285
+ </tr>
286
+ <tr valign="top">
287
+ <th scope="row"><?php esc_html_e( 'As a widget?', 'weglot' ); ?></th>
288
+ <td>
289
+ <?php esc_html_e( 'You can place the button in a widget area. Go to Appearance -> Widgets and drag and drop the Weglot Translate widget where you want.', 'weglot' ); ?>
290
+ </td>
291
+ </tr>
292
+ <tr valign="top">
293
+ <th scope="row"><?php esc_html_e( 'With a shortcode?', 'weglot' ); ?></th>
294
+ <td>
295
+ <?php esc_html_e( 'You can use the Weglot shortcode [weglot_switcher] wherever you want to place the button.', 'weglot' ); ?>
296
+ </td>
297
+ </tr>
298
+ <tr valign="top">
299
+ <th scope="row"><?php esc_html_e( 'In the source code?', 'weglot' ); ?></th>
300
+ <td>
301
+ <?php esc_html_e( 'You can add the code &lt;div id=&quot;weglot_here&quot;&gt;&lt;/div&gt; wherever you want in the source code of your HTML page. The button will appear at this place.', 'weglot' ); ?>
302
+ </td>
303
+ </tr>
304
+ </table>
305
+
templates/admin/pages/tabs/settings.php ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+ use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
7
+
8
+ $options_available = [
9
+ 'api_key' => [
10
+ 'key' => 'api_key',
11
+ 'label' => __( 'API Key', 'weglot' ),
12
+ 'description' => __( 'Log in to <a target="_blank" href="https://weglot.com/register-wordpress">Weglot</a> to get your API key. <span class="weglot-info">Why?<span class="wg-tooltip"><span class="arrow-up"></span>A Weglot account is needed to access and manage your translations. It takes nothing more than 20 seconds !</span></span>', 'weglot' ),
13
+ ],
14
+ 'original_language' => [
15
+ 'key' => 'original_language',
16
+ 'label' => __( 'Original language', 'weglot' ),
17
+ 'description' => 'What is the original (current) language of your website?',
18
+ ],
19
+ 'destination_language' => [
20
+ 'key' => 'destination_language',
21
+ 'label' => __( 'Destination language', 'weglot' ),
22
+ 'description' => 'Choose languages you want to translate into. Supported languages can be found <a target="_blank" href="https://weglot.com/translation-api#languages_code">here</a>.',
23
+ ],
24
+ 'exclude_urls' => [
25
+ 'key' => 'exclude_urls',
26
+ 'label' => __( 'Exclusion URL', 'weglot' ),
27
+ 'description' => __( 'Add URL that you want to exclude from translations. You can use regular expression to match multiple URLs. ', 'weglot' ),
28
+ ],
29
+ 'exclude_blocks' => [
30
+ 'key' => 'exclude_blocks',
31
+ 'label' => __( 'Exclusion Blocks', 'weglot' ),
32
+ 'description' => __( 'Enter the CSS selector of blocks you don\'t want to translate (like a sidebar, a menu, a paragraph etc...', 'weglot' ),
33
+ ],
34
+ ];
35
+
36
+
37
+ $languages = $this->language_services->get_languages_available();
38
+ $user_info = $this->user_api_services->get_user_info();
39
+ $plans = $this->user_api_services->get_plans();
40
+
41
+ ?>
42
+
43
+ <h3><?php esc_html_e( 'Main configuration', 'weglot' ); ?></h3>
44
+ <hr>
45
+ <table class="form-table">
46
+ <tbody>
47
+ <tr valign="top">
48
+ <th scope="row" class="titledesc">
49
+ <label for="<?php echo esc_attr( $options_available['api_key']['key'] ); ?>">
50
+ <?php echo esc_html( $options_available['api_key']['label'] ); ?>
51
+ </label>
52
+ <p class="sub-label"><?php echo $options_available['api_key']['description']; //phpcs:ignore ?></p>
53
+ </th>
54
+ <td class="forminp forminp-text">
55
+ <input
56
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['api_key']['key'] ) ); ?>"
57
+ id="<?php echo esc_attr( $options_available['api_key']['key'] ); ?>"
58
+ type="text"
59
+ placeholder="wg_XXXXXXXXXXXX"
60
+ value="<?php echo esc_attr( $this->options[ $options_available['api_key']['key'] ] ); ?>"
61
+ >
62
+ </td>
63
+ </tr>
64
+ <tr valign="top">
65
+ <th scope="row" class="titledesc">
66
+ <label for="<?php echo esc_attr( $options_available['original_language']['key'] ); ?>">
67
+ <?php echo esc_html( $options_available['original_language']['label'] ); ?>
68
+ </label>
69
+ <p class="sub-label"><?php echo $options_available['original_language']['description']; //phpcs:ignore ?></p>
70
+ </th>
71
+ <td class="forminp forminp-text">
72
+ <select
73
+ class="weglot-select weglot-select-original"
74
+ style="display:none"
75
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['original_language']['key'] ) ); ?>"
76
+ id="<?php echo esc_attr( $options_available['original_language']['key'] ); ?>"
77
+ >
78
+ <?php foreach ( $languages as $language ) : ?>
79
+ <option
80
+ value="<?php echo esc_attr( $language->getIso639() ); ?>"
81
+ <?php selected( $language->getIso639(), $this->options[ $options_available['original_language']['key'] ] ); ?>
82
+ >
83
+ <?php echo esc_html__( $language->getEnglishName() ); //phpcs:ignore ?>
84
+ </option>
85
+ <?php endforeach; ?>
86
+ </select>
87
+ </td>
88
+ </tr>
89
+ <tr valign="top">
90
+ <th scope="row" class="titledesc">
91
+ <label for="<?php echo esc_attr( $options_available['destination_language']['key'] ); ?>">
92
+ <?php echo esc_html( $options_available['destination_language']['label'] ); ?>
93
+ </label>
94
+ <p class="sub-label"><?php echo $options_available['destination_language']['description']; //phpcs:ignore ?></p>
95
+ </th>
96
+ <td class="forminp forminp-text">
97
+ <select
98
+ class="weglot-select weglot-select-destination"
99
+ style="display:none"
100
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['destination_language']['key'] ) ); ?>[]"
101
+ id="<?php echo esc_attr( $options_available['destination_language']['key'] ); ?>"
102
+ multiple="true"
103
+ required
104
+ >
105
+ <?php foreach ( $languages as $language ) : ?>
106
+ <option
107
+ value="<?php echo esc_attr( $language->getIso639() ); ?>"
108
+ <?php selected( true, in_array( $language->getIso639(), $this->options[ $options_available['destination_language']['key'] ], true ) ); ?>
109
+ >
110
+ <?php echo esc_html( $language->getLocalName() ); ?>
111
+ </option>
112
+ <?php endforeach; ?>
113
+ </select>
114
+
115
+ <?php
116
+ if ( $user_info['plan'] <= 0 ) {
117
+ ?>
118
+ <p class="description">
119
+ <?php // translators: 1 HTML Tag, 2 HTML Tag ?>
120
+ <?php echo sprintf( esc_html__( 'On the free plan, you can only choose one language and a maximum of 2000 words. If you want to use more than 1 language and 2000 words, please %1$supgrade your plan%2$s.', 'weglot' ), '<a target="_blank" href="https://weglot.com/change-plan">', '</a>' ); ?>
121
+ </p>
122
+ <?php
123
+ } elseif ( in_array( $user_info['plan'], $plans['starter_free']['ids'] ) ) { //phpcs:ignore
124
+ ?>
125
+ <p class="description">
126
+ <?php // translators: 1 HTML Tag, 2 HTML Tag ?>
127
+ <?php echo sprintf( esc_html__( 'On the Starter plan, you can choose one language. If you want to use more than 1 language, please %1$supgrade your plan%2$s.', 'weglot' ), '<a target="_blank" href="https://weglot.com/change-plan">', '</a>' ); ?>
128
+ </p>
129
+ <?php
130
+ } elseif ( in_array( $user_info['plan'], $plans['business']['ids'] ) ) { //phpcs:ignore
131
+ ?>
132
+ <p class="description">
133
+ <?php // translators: 1 HTML Tag, 2 HTML Tag ?>
134
+ <?php echo sprintf( esc_html__( 'On the Business plan, you can choose five languages. If you want to use more than language, please %1$supgrade your plan%2$s.', 'weglot' ), '<a target="_blank" href="https://weglot.com/change-plan">', '</a>' ); ?>
135
+ </p>
136
+ <?php
137
+ }
138
+ ?>
139
+ </td>
140
+ </tr>
141
+ </tbody>
142
+ </table>
143
+
144
+ <h3><?php esc_html_e( 'Translation Exclusion (Optional)', 'weglot' ); ?> </h3>
145
+ <hr>
146
+ <p><?php esc_html__( 'By default, every page is translated. You can exclude parts of a page or a full page here.', 'weglot' ); ?></p>
147
+ <table class="form-table">
148
+ <tbody>
149
+ <tr valign="top">
150
+ <th scope="row" class="titledesc">
151
+ <label for="<?php echo esc_attr( $options_available['exclude_urls']['key'] ); ?>">
152
+ <?php echo esc_html( $options_available['exclude_urls']['label'] ); ?>
153
+ </label>
154
+ <p class="sub-label"><?php echo esc_html( $options_available['exclude_urls']['description'] ); ?></p>
155
+ </th>
156
+ <td class="forminp forminp-text">
157
+ <div id="container-<?php echo esc_attr( $options_available['exclude_urls']['key'] ); ?>">
158
+ <?php
159
+ if ( ! empty( $this->options[ $options_available['exclude_urls']['key'] ] ) ) :
160
+ foreach ( $this->options[ $options_available['exclude_urls']['key'] ] as $option ) :
161
+ ?>
162
+ <div class="item-exclude">
163
+ <input
164
+ type="text"
165
+ placeholder="/my-awesome-url"
166
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['exclude_urls']['key'] ) ); ?>[]"
167
+ value="<?php echo esc_attr( $option ); ?>"
168
+ >
169
+ <button class="js-btn-remove js-btn-remove-exclude-url">
170
+ <span class="dashicons dashicons-minus"></span>
171
+ </button>
172
+ </div>
173
+ <?php
174
+ endforeach;
175
+ endif;
176
+ ?>
177
+ </div>
178
+ <button id="js-add-exclude-url" class="btn btn-soft"><?php esc_html_e( 'Add an URL to exclude', 'weglot' ); ?></button>
179
+ </td>
180
+ </tr>
181
+ <tr valign="top">
182
+ <th scope="row" class="titledesc">
183
+ <label for="<?php echo esc_attr( $options_available['exclude_blocks']['key'] ); ?>">
184
+ <?php echo esc_html( $options_available['exclude_blocks']['label'] ); ?>
185
+ </label>
186
+ <p class="sub-label"><?php echo esc_html( $options_available['exclude_blocks']['description'] ); ?></p>
187
+ </th>
188
+ <td class="forminp forminp-text">
189
+ <div id="container-<?php echo esc_attr( $options_available['exclude_blocks']['key'] ); ?>">
190
+ <?php
191
+ if ( ! empty( $this->options[ $options_available['exclude_blocks']['key'] ] ) ) :
192
+ foreach ( $this->options[ $options_available['exclude_blocks']['key'] ] as $option ) :
193
+ ?>
194
+ <div class="item-exclude">
195
+ <input
196
+ type="text"
197
+ placeholder=".my-class"
198
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['exclude_blocks']['key'] ) ); ?>[]"
199
+ value="<?php echo esc_attr( $option ); ?>"
200
+ >
201
+ <button class="js-btn-remove js-btn-remove-exclude">
202
+ <span class="dashicons dashicons-minus"></span>
203
+ </button>
204
+ </div>
205
+ <?php
206
+ endforeach;
207
+ endif;
208
+ ?>
209
+ </div>
210
+ <button id="js-add-exclude-block" class="btn btn-soft"><?php esc_html_e( 'Add a block to exclude', 'weglot' ); ?></button>
211
+ </td>
212
+ </tr>
213
+ </tbody>
214
+ </table>
215
+
216
+
217
+ <?php if ( ! $this->options['has_first_settings'] && $this->options['show_box_first_settings'] ) : ?>
218
+ <?php $this->option_services->set_option_by_key( 'show_box_first_settings', false ); // remove showbox ?>
219
+ <div id="weglot-box-first-settings" class="weglot-box-overlay">
220
+ <div class="weglot-box">
221
+ <a class="weglot-btn-close"><?php esc_html_e( 'Close', 'weglot' ); ?></a>
222
+ <h3 class="weglot-box--title"><?php esc_html_e( 'Well done! Your website is now multilingual.', 'weglot' ); ?></h3>
223
+ <p class="weglot-box--text"><?php esc_html_e( 'Go on your website, there is a language switcher. Try it :)', 'weglot' ); ?></p>
224
+ <a class="button button-primary" href="<?php echo esc_attr( home_url() ); ?>" target="_blank">
225
+ <?php esc_html_e( 'Go on my front page.', 'weglot' ); ?>
226
+ </a>
227
+ <p class="weglot-box--subtext"><?php esc_html_e( 'Next step, edit your translations directly in your Weglot account.', 'weglot' ); ?></p>
228
+ </div>
229
+ </div>
230
+ <?php
231
+ if ( $this->options[ $options_available['destination_language']['key'] ] && count( $this->options[ $options_available['destination_language']['key'] ] ) > 0 ) :
232
+ ?>
233
+ <iframe
234
+ style="visibility:hidden;"
235
+ src="<?php echo esc_url( sprintf( '%s/%s', home_url(), $this->options[ $options_available['destination_language']['key'] ][0] ) ); ?>/" width="1" height="1">
236
+ </iframe>
237
+ <?php endif; ?>
238
+ <?php endif; ?>
239
+
240
+ <template id="tpl-exclusion-url">
241
+ <div class="item-exclude">
242
+ <input
243
+ type="text"
244
+ placeholder="/my-awesome-url"
245
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['exclude_urls']['key'] ) ); ?>[]"
246
+ value=""
247
+ >
248
+ <button class="js-btn-remove js-btn-remove-exclude">
249
+ <span class="dashicons dashicons-minus"></span>
250
+ </button>
251
+ </div>
252
+ </template>
253
+
254
+ <template id="tpl-exclusion-block">
255
+ <div class="item-exclude">
256
+ <input
257
+ type="text"
258
+ placeholder=".my-class"
259
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['exclude_blocks']['key'] ) ); ?>[]"
260
+ value=""
261
+ >
262
+ <button class="js-btn-remove js-btn-remove-exclude">
263
+ <span class="dashicons dashicons-minus"></span>
264
+ </button>
265
+ </div>
266
+ </template>
templates/admin/pages/tabs/status.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ use Weglot\WeglotContext;
8
+
9
+ ?>
10
+
11
+ <h2><?php esc_html_e( 'Status', 'weglot' ); ?></h2>
12
+
13
+
14
+ <?php
15
+
16
+ $apache_mod_rewrite = ' <mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
17
+ if ( ! function_exists( 'apache_get_modules' ) ) {
18
+ $apache_mod_rewrite = 'Unknown';
19
+ } elseif ( ! in_array( 'mod_rewrite', apache_get_modules(), true ) ) {
20
+ $apache_mod_rewrite = '<mark class="error"><span class="dashicons dashicons-warning"></span></mark>';
21
+ }
22
+
23
+ $php_min_54 = true;
24
+ if ( version_compare( phpversion(), '5.4', '<' ) ) {
25
+ $php_min_54 = false;
26
+ }
27
+
28
+ ?>
29
+
30
+
31
+ <div class="wrap">
32
+ <table class="widefat" cellspacing="0" id="status">
33
+ <thead>
34
+ <tr>
35
+ <th colspan="3" data-export-label="WordPress Environment"><h2>WordPress environment</h2></th>
36
+ </tr>
37
+ </thead>
38
+ <tbody>
39
+ <tr>
40
+ <td><?php esc_html_e( 'Home URL', 'weglot' ); ?></td>
41
+ <td><?php echo esc_attr( home_url() ); ?></td>
42
+ </tr>
43
+ <tr>
44
+ <td><?php esc_html_e( 'Site URL', 'weglot' ); ?></td>
45
+ <td><?php echo esc_attr( site_url() ); ?></td>
46
+ </tr>
47
+ <tr>
48
+ <td><?php esc_html_e( 'Weglot version', 'weglot' ); ?></td>
49
+ <td><?php echo esc_attr( WEGLOT_VERSION ); ?></td>
50
+ </tr>
51
+ <tr>
52
+ <td><?php esc_html_e( 'WordPress version', 'weglot' ); ?></td>
53
+ <td><?php echo esc_attr( get_bloginfo( 'version' ) ); ?></td>
54
+ </tr>
55
+ <tr>
56
+ <td><?php esc_html_e( 'Is multisite', 'weglot' ); ?></td>
57
+ <td>
58
+ <?php echo is_multisite() ? 'Yes' : '-'; ?>
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <td><?php esc_html_e( 'WordPress Debug mode', 'weglot' ); ?></td>
63
+ <td>
64
+ <?php if ( defined( WP_DEBUG ) && WP_DEBUG ): //phpcs:ignore ?>
65
+ <mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
66
+ <?php endif; ?>
67
+ </td>
68
+ </tr>
69
+ <tr>
70
+ <td><?php esc_html_e( 'Permalink Structure', 'weglot' ); ?></td>
71
+ <td><?php echo esc_attr( get_option( 'permalink_structure' ) ); ?></td>
72
+ </tr>
73
+ <tr>
74
+ <td><?php esc_html_e( 'Language', 'weglot' ); ?></td>
75
+ <td><?php echo esc_attr( get_locale() ); ?></td>
76
+ </tr>
77
+ </tbody>
78
+ </table>
79
+ <br />
80
+ <table class="widefat" cellspacing="0">
81
+ <thead>
82
+ <tr>
83
+ <th colspan="3" data-export-label="Server Environment"><h2><?php esc_html_e( 'Server environment', 'weglot' ); ?></h2></th>
84
+ </tr>
85
+ </thead>
86
+ <tbody>
87
+ <tr>
88
+ <td><?php esc_html_e( 'Server info', 'weglot' ); ?></td>
89
+ <td><?php echo ( isset( $_SERVER['SERVER_SOFTWARE'] ) ) ? $_SERVER['SERVER_SOFTWARE'] : 'Unknown' //phpcs:ignore ?></td>
90
+ </tr>
91
+ <tr>
92
+ <td><?php esc_html_e( 'PHP Version', 'weglot' ); ?></td>
93
+ <td>
94
+ <?php echo phpversion(); //phpcs:ignore ?>
95
+ <?php if ( ! $php_min_54 ) : ?>
96
+ <mark class="error">
97
+ <span class="dashicons dashicons-warning"></span> -
98
+ <?php echo esc_html__( 'We need a minimum PHP version : 5.4.', 'weglot' ); ?>
99
+ </mark>
100
+ <?php endif; ?>
101
+ </td>
102
+ </tr>
103
+ <tr>
104
+ <td><?php esc_html_e( 'Module mod_rewrite', 'weglot' ); ?></td>
105
+ <td>
106
+ <?php echo $apache_mod_rewrite; //phpcs:ignore ?>
107
+ </td>
108
+ </tr>
109
+ </tbody>
110
+ </table>
111
+ <br />
112
+ <table class="widefat" cellspacing="0">
113
+ <thead>
114
+ <tr>
115
+ <th colspan="3" data-export-label="Server Environment"><h2><?php esc_html_e( 'Weglot environment', 'weglot' ); ?></h2></th>
116
+ </tr>
117
+ </thead>
118
+ <tbody>
119
+ <tr>
120
+ <td><?php esc_html_e( 'Original Language', 'weglot' ); ?></td>
121
+ <td><?php echo esc_attr( weglot_get_original_language() ); ?></td>
122
+ </tr>
123
+ <tr>
124
+ <td><?php esc_html_e( 'Destination Language', 'weglot' ); ?></td>
125
+ <td>
126
+ <?php foreach ( weglot_get_destination_language() as $language ) : ?>
127
+ <?php echo esc_attr( sprintf( '%s - ', $language ) ); ?>
128
+ <?php endforeach; ?>
129
+ </td>
130
+ </tr>
131
+ <tr>
132
+ <td><?php esc_html_e( 'Exclude URLs', 'weglot' ); ?></td>
133
+ <td><?php echo esc_attr( get_option( 'exclude_url' ) ); ?></td>
134
+ </tr>
135
+ <tr>
136
+ <td><?php esc_html_e( 'Exclude Blocks', 'weglot' ); ?></td>
137
+ <td><?php echo esc_attr( get_option( 'exclude_blocks' ) ); ?></td>
138
+ </tr>
139
+ </tbody>
140
+ </table>
141
+ </div>
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit22b676e0f36abfbf19cdf3636d910ced::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit3bd609a78d0c14eccfb424db48f7418f::getLoader();
vendor/composer/autoload_files.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_files.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ '6c200413eed8aeea54dbaf934a31b127' => $vendorDir . '/weglot/simplehtmldom/src/simple_html_dom.php',
10
+ );
vendor/composer/autoload_namespaces.php CHANGED
@@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'SimpleHtmlDom' => array($vendorDir . '/weglot/simplehtmldom/src'),
10
  );
vendor/composer/autoload_psr4.php CHANGED
@@ -6,5 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- 'Weglot\\' => array($baseDir . '/src'),
 
10
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Weglot\\' => array($vendorDir . '/weglot/weglot-php/src'),
10
+ 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
11
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit22b676e0f36abfbf19cdf3636d910ced
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit22b676e0f36abfbf19cdf3636d910ced
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit22b676e0f36abfbf19cdf3636d910ced', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit22b676e0f36abfbf19cdf3636d910ced', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit22b676e0f36abfbf19cdf3636d910ced::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -47,6 +47,24 @@ class ComposerAutoloaderInit22b676e0f36abfbf19cdf3636d910ced
47
 
48
  $loader->register(true);
49
 
 
 
 
 
 
 
 
 
 
50
  return $loader;
51
  }
52
  }
 
 
 
 
 
 
 
 
 
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit3bd609a78d0c14eccfb424db48f7418f
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit3bd609a78d0c14eccfb424db48f7418f', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit3bd609a78d0c14eccfb424db48f7418f', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit3bd609a78d0c14eccfb424db48f7418f::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
47
 
48
  $loader->register(true);
49
 
50
+ if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInit3bd609a78d0c14eccfb424db48f7418f::$files;
52
+ } else {
53
+ $includeFiles = require __DIR__ . '/autoload_files.php';
54
+ }
55
+ foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequire3bd609a78d0c14eccfb424db48f7418f($fileIdentifier, $file);
57
+ }
58
+
59
  return $loader;
60
  }
61
  }
62
+
63
+ function composerRequire3bd609a78d0c14eccfb424db48f7418f($fileIdentifier, $file)
64
+ {
65
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
+ require $file;
67
+
68
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
69
+ }
70
+ }
vendor/composer/autoload_static.php CHANGED
@@ -4,27 +4,50 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit22b676e0f36abfbf19cdf3636d910ced
8
  {
 
 
 
 
9
  public static $prefixLengthsPsr4 = array (
10
  'W' =>
11
  array (
12
  'Weglot\\' => 7,
13
  ),
 
 
 
 
14
  );
15
 
16
  public static $prefixDirsPsr4 = array (
17
  'Weglot\\' =>
18
  array (
19
- 0 => __DIR__ . '/../..' . '/src',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  ),
21
  );
22
 
23
  public static function getInitializer(ClassLoader $loader)
24
  {
25
  return \Closure::bind(function () use ($loader) {
26
- $loader->prefixLengthsPsr4 = ComposerStaticInit22b676e0f36abfbf19cdf3636d910ced::$prefixLengthsPsr4;
27
- $loader->prefixDirsPsr4 = ComposerStaticInit22b676e0f36abfbf19cdf3636d910ced::$prefixDirsPsr4;
 
28
 
29
  }, null, ClassLoader::class);
30
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit3bd609a78d0c14eccfb424db48f7418f
8
  {
9
+ public static $files = array (
10
+ '6c200413eed8aeea54dbaf934a31b127' => __DIR__ . '/..' . '/weglot/simplehtmldom/src/simple_html_dom.php',
11
+ );
12
+
13
  public static $prefixLengthsPsr4 = array (
14
  'W' =>
15
  array (
16
  'Weglot\\' => 7,
17
  ),
18
+ 'P' =>
19
+ array (
20
+ 'Psr\\Cache\\' => 10,
21
+ ),
22
  );
23
 
24
  public static $prefixDirsPsr4 = array (
25
  'Weglot\\' =>
26
  array (
27
+ 0 => __DIR__ . '/..' . '/weglot/weglot-php/src',
28
+ ),
29
+ 'Psr\\Cache\\' =>
30
+ array (
31
+ 0 => __DIR__ . '/..' . '/psr/cache/src',
32
+ ),
33
+ );
34
+
35
+ public static $prefixesPsr0 = array (
36
+ 'S' =>
37
+ array (
38
+ 'SimpleHtmlDom' =>
39
+ array (
40
+ 0 => __DIR__ . '/..' . '/weglot/simplehtmldom/src',
41
+ ),
42
  ),
43
  );
44
 
45
  public static function getInitializer(ClassLoader $loader)
46
  {
47
  return \Closure::bind(function () use ($loader) {
48
+ $loader->prefixLengthsPsr4 = ComposerStaticInit3bd609a78d0c14eccfb424db48f7418f::$prefixLengthsPsr4;
49
+ $loader->prefixDirsPsr4 = ComposerStaticInit3bd609a78d0c14eccfb424db48f7418f::$prefixDirsPsr4;
50
+ $loader->prefixesPsr0 = ComposerStaticInit3bd609a78d0c14eccfb424db48f7418f::$prefixesPsr0;
51
 
52
  }, null, ClassLoader::class);
53
  }
vendor/composer/installed.json CHANGED
@@ -1 +1,160 @@
1
- []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "psr/cache",
4
+ "version": "1.0.1",
5
+ "version_normalized": "1.0.1.0",
6
+ "source": {
7
+ "type": "git",
8
+ "url": "https://github.com/php-fig/cache.git",
9
+ "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
10
+ },
11
+ "dist": {
12
+ "type": "zip",
13
+ "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
14
+ "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
15
+ "shasum": ""
16
+ },
17
+ "require": {
18
+ "php": ">=5.3.0"
19
+ },
20
+ "time": "2016-08-06T20:24:11+00:00",
21
+ "type": "library",
22
+ "extra": {
23
+ "branch-alias": {
24
+ "dev-master": "1.0.x-dev"
25
+ }
26
+ },
27
+ "installation-source": "dist",
28
+ "autoload": {
29
+ "psr-4": {
30
+ "Psr\\Cache\\": "src/"
31
+ }
32
+ },
33
+ "notification-url": "https://packagist.org/downloads/",
34
+ "license": [
35
+ "MIT"
36
+ ],
37
+ "authors": [
38
+ {
39
+ "name": "PHP-FIG",
40
+ "homepage": "http://www.php-fig.org/"
41
+ }
42
+ ],
43
+ "description": "Common interface for caching libraries",
44
+ "keywords": [
45
+ "cache",
46
+ "psr",
47
+ "psr-6"
48
+ ]
49
+ },
50
+ {
51
+ "name": "weglot/simplehtmldom",
52
+ "version": "0.3",
53
+ "version_normalized": "0.3.0.0",
54
+ "source": {
55
+ "type": "git",
56
+ "url": "https://github.com/weglot/simple_html_dom.git",
57
+ "reference": "e760e7f2dd3c1f0ec9df8e16b900a0fe920bf9fe"
58
+ },
59
+ "dist": {
60
+ "type": "zip",
61
+ "url": "https://api.github.com/repos/weglot/simple_html_dom/zipball/e760e7f2dd3c1f0ec9df8e16b900a0fe920bf9fe",
62
+ "reference": "e760e7f2dd3c1f0ec9df8e16b900a0fe920bf9fe",
63
+ "shasum": ""
64
+ },
65
+ "require": {
66
+ "php": ">=5.3.0"
67
+ },
68
+ "time": "2018-07-23T15:42:35+00:00",
69
+ "type": "library",
70
+ "installation-source": "dist",
71
+ "autoload": {
72
+ "psr-0": {
73
+ "SimpleHtmlDom": "src/"
74
+ },
75
+ "files": [
76
+ "src/simple_html_dom.php"
77
+ ]
78
+ },
79
+ "notification-url": "https://packagist.org/downloads/",
80
+ "license": [
81
+ "MIT"
82
+ ],
83
+ "authors": [
84
+ {
85
+ "name": "S.C. Chen",
86
+ "email": "me578022@gmail.com"
87
+ }
88
+ ],
89
+ "description": "Composer package that gives you access to and (unlike all the others at this time) autoloads S.C. Chen's PHP Simple HTML DOM Parser Library",
90
+ "homepage": "http://simplehtmldom.sourceforge.net/",
91
+ "keywords": [
92
+ "Simple",
93
+ "dom",
94
+ "html"
95
+ ]
96
+ },
97
+ {
98
+ "name": "weglot/weglot-php",
99
+ "version": "0.5.10",
100
+ "version_normalized": "0.5.10.0",
101
+ "source": {
102
+ "type": "git",
103
+ "url": "https://github.com/weglot/weglot-php.git",
104
+ "reference": "b7e3bc5a4d24c2c2e3988aae28f85b62f2c90804"
105
+ },
106
+ "dist": {
107
+ "type": "zip",
108
+ "url": "https://api.github.com/repos/weglot/weglot-php/zipball/b7e3bc5a4d24c2c2e3988aae28f85b62f2c90804",
109
+ "reference": "b7e3bc5a4d24c2c2e3988aae28f85b62f2c90804",
110
+ "shasum": ""
111
+ },
112
+ "require": {
113
+ "php": ">=5.4",
114
+ "psr/cache": "^1.0",
115
+ "weglot/simplehtmldom": "^0.3"
116
+ },
117
+ "require-dev": {
118
+ "codeception/codeception": "^2.4",
119
+ "vlucas/phpdotenv": "^2.4"
120
+ },
121
+ "time": "2018-07-23T16:56:37+00:00",
122
+ "type": "library",
123
+ "installation-source": "dist",
124
+ "autoload": {
125
+ "psr-4": {
126
+ "Weglot\\": "src/"
127
+ }
128
+ },
129
+ "notification-url": "https://packagist.org/downloads/",
130
+ "license": [
131
+ "MIT"
132
+ ],
133
+ "authors": [
134
+ {
135
+ "name": "Thomas Deneulin",
136
+ "email": "thomas@weglot.com",
137
+ "role": "Review"
138
+ },
139
+ {
140
+ "name": "Baptiste Leduc",
141
+ "email": "baptiste@weglot.com",
142
+ "homepage": "https://baptiste-leduc.now.sh/",
143
+ "role": "Developer"
144
+ }
145
+ ],
146
+ "description": "PHP library for the Weglot API",
147
+ "homepage": "https://weglot.com/",
148
+ "keywords": [
149
+ "Weglot",
150
+ "i18n",
151
+ "languages",
152
+ "localization",
153
+ "php",
154
+ "translate",
155
+ "translation",
156
+ "translator",
157
+ "weglot-library"
158
+ ]
159
+ }
160
+ ]
vendor/psr/cache/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file, in reverse chronological order by release.
4
+
5
+ ## 1.0.1 - 2016-08-06
6
+
7
+ ### Fixed
8
+
9
+ - Make spacing consistent in phpdoc annotations php-fig/cache#9 - chalasr
10
+ - Fix grammar in phpdoc annotations php-fig/cache#10 - chalasr
11
+ - Be more specific in docblocks that `getItems()` and `deleteItems()` take an array of strings (`string[]`) compared to just `array` php-fig/cache#8 - GrahamCampbell
12
+ - For `expiresAt()` and `expiresAfter()` in CacheItemInterface fix docblock to specify null as a valid parameters as well as an implementation of DateTimeInterface php-fig/cache#7 - GrahamCampbell
13
+
14
+ ## 1.0.0 - 2015-12-11
15
+
16
+ Initial stable release; reflects accepted PSR-6 specification
vendor/psr/cache/LICENSE.txt ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2015 PHP Framework Interoperability Group
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
vendor/psr/cache/README.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ PSR Cache
2
+ =========
3
+
4
+ This repository holds all interfaces defined by
5
+ [PSR-6](http://www.php-fig.org/psr/psr-6/).
6
+
7
+ Note that this is not a Cache implementation of its own. It is merely an
8
+ interface that describes a Cache implementation. See the specification for more
9
+ details.
vendor/psr/cache/composer.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "psr/cache",
3
+ "description": "Common interface for caching libraries",
4
+ "keywords": ["psr", "psr-6", "cache"],
5
+ "license": "MIT",
6
+ "authors": [
7
+ {
8
+ "name": "PHP-FIG",
9
+ "homepage": "http://www.php-fig.org/"
10
+ }
11
+ ],
12
+ "require": {
13
+ "php": ">=5.3.0"
14
+ },
15
+ "autoload": {
16
+ "psr-4": {
17
+ "Psr\\Cache\\": "src/"
18
+ }
19
+ },
20
+ "extra": {
21
+ "branch-alias": {
22
+ "dev-master": "1.0.x-dev"
23
+ }
24
+ }
25
+ }
vendor/psr/cache/src/CacheException.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Psr\Cache;
4
+
5
+ /**
6
+ * Exception interface for all exceptions thrown by an Implementing Library.
7
+ */
8
+ interface CacheException
9
+ {
10
+ }
vendor/psr/cache/src/CacheItemInterface.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Psr\Cache;
4
+
5
+ /**
6
+ * CacheItemInterface defines an interface for interacting with objects inside a cache.
7
+ *
8
+ * Each Item object MUST be associated with a specific key, which can be set
9
+ * according to the implementing system and is typically passed by the
10
+ * Cache\CacheItemPoolInterface object.
11
+ *
12
+ * The Cache\CacheItemInterface object encapsulates the storage and retrieval of
13
+ * cache items. Each Cache\CacheItemInterface is generated by a
14
+ * Cache\CacheItemPoolInterface object, which is responsible for any required
15
+ * setup as well as associating the object with a unique Key.
16
+ * Cache\CacheItemInterface objects MUST be able to store and retrieve any type
17
+ * of PHP value defined in the Data section of the specification.
18
+ *
19
+ * Calling Libraries MUST NOT instantiate Item objects themselves. They may only
20
+ * be requested from a Pool object via the getItem() method. Calling Libraries
21
+ * SHOULD NOT assume that an Item created by one Implementing Library is
22
+ * compatible with a Pool from another Implementing Library.
23
+ */
24
+ interface CacheItemInterface
25
+ {
26
+ /**
27
+ * Returns the key for the current cache item.
28
+ *
29
+ * The key is loaded by the Implementing Library, but should be available to
30
+ * the higher level callers when needed.
31
+ *
32
+ * @return string
33
+ * The key string for this cache item.
34
+ */
35
+ public function getKey();
36
+
37
+ /**
38
+ * Retrieves the value of the item from the cache associated with this object's key.
39
+ *
40
+ * The value returned must be identical to the value originally stored by set().
41
+ *
42
+ * If isHit() returns false, this method MUST return null. Note that null
43
+ * is a legitimate cached value, so the isHit() method SHOULD be used to
44
+ * differentiate between "null value was found" and "no value was found."
45
+ *
46
+ * @return mixed
47
+ * The value corresponding to this cache item's key, or null if not found.
48
+ */
49
+ public function get();
50
+
51
+ /**
52
+ * Confirms if the cache item lookup resulted in a cache hit.
53
+ *
54
+ * Note: This method MUST NOT have a race condition between calling isHit()
55
+ * and calling get().
56
+ *
57
+ * @return bool
58
+ * True if the request resulted in a cache hit. False otherwise.
59
+ */
60
+ public function isHit();
61
+
62
+ /**
63
+ * Sets the value represented by this cache item.
64
+ *
65
+ * The $value argument may be any item that can be serialized by PHP,
66
+ * although the method of serialization is left up to the Implementing
67
+ * Library.
68
+ *
69
+ * @param mixed $value
70
+ * The serializable value to be stored.
71
+ *
72
+ * @return static
73
+ * The invoked object.
74
+ */
75
+ public function set($value);
76
+
77
+ /**
78
+ * Sets the expiration time for this cache item.
79
+ *
80
+ * @param \DateTimeInterface|null $expiration
81
+ * The point in time after which the item MUST be considered expired.
82
+ * If null is passed explicitly, a default value MAY be used. If none is set,
83
+ * the value should be stored permanently or for as long as the
84
+ * implementation allows.
85
+ *
86
+ * @return static
87
+ * The called object.
88
+ */
89
+ public function expiresAt($expiration);
90
+
91
+ /**
92
+ * Sets the expiration time for this cache item.
93
+ *
94
+ * @param int|\DateInterval|null $time
95
+ * The period of time from the present after which the item MUST be considered
96
+ * expired. An integer parameter is understood to be the time in seconds until
97
+ * expiration. If null is passed explicitly, a default value MAY be used.
98
+ * If none is set, the value should be stored permanently or for as long as the
99
+ * implementation allows.
100
+ *
101
+ * @return static
102
+ * The called object.
103
+ */
104
+ public function expiresAfter($time);
105
+ }
vendor/psr/cache/src/CacheItemPoolInterface.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Psr\Cache;
4
+
5
+ /**
6
+ * CacheItemPoolInterface generates CacheItemInterface objects.
7
+ *
8
+ * The primary purpose of Cache\CacheItemPoolInterface is to accept a key from
9
+ * the Calling Library and return the associated Cache\CacheItemInterface object.
10
+ * It is also the primary point of interaction with the entire cache collection.
11
+ * All configuration and initialization of the Pool is left up to an
12
+ * Implementing Library.
13
+ */
14
+ interface CacheItemPoolInterface
15
+ {
16
+ /**
17
+ * Returns a Cache Item representing the specified key.
18
+ *
19
+ * This method must always return a CacheItemInterface object, even in case of
20
+ * a cache miss. It MUST NOT return null.
21
+ *
22
+ * @param string $key
23
+ * The key for which to return the corresponding Cache Item.
24
+ *
25
+ * @throws InvalidArgumentException
26
+ * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException
27
+ * MUST be thrown.
28
+ *
29
+ * @return CacheItemInterface
30
+ * The corresponding Cache Item.
31
+ */
32
+ public function getItem($key);
33
+
34
+ /**
35
+ * Returns a traversable set of cache items.
36
+ *
37
+ * @param string[] $keys
38
+ * An indexed array of keys of items to retrieve.
39
+ *
40
+ * @throws InvalidArgumentException
41
+ * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException
42
+ * MUST be thrown.
43
+ *
44
+ * @return array|\Traversable
45
+ * A traversable collection of Cache Items keyed by the cache keys of
46
+ * each item. A Cache item will be returned for each key, even if that
47
+ * key is not found. However, if no keys are specified then an empty
48
+ * traversable MUST be returned instead.
49
+ */
50
+ public function getItems(array $keys = array());
51
+
52
+ /**
53
+ * Confirms if the cache contains specified cache item.
54
+ *
55
+ * Note: This method MAY avoid retrieving the cached value for performance reasons.
56
+ * This could result in a race condition with CacheItemInterface::get(). To avoid
57
+ * such situation use CacheItemInterface::isHit() instead.
58
+ *
59
+ * @param string $key
60
+ * The key for which to check existence.
61
+ *
62
+ * @throws InvalidArgumentException
63
+ * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException
64
+ * MUST be thrown.
65
+ *
66
+ * @return bool
67
+ * True if item exists in the cache, false otherwise.
68
+ */
69
+ public function hasItem($key);
70
+
71
+ /**
72
+ * Deletes all items in the pool.
73
+ *
74
+ * @return bool
75
+ * True if the pool was successfully cleared. False if there was an error.
76
+ */
77
+ public function clear();
78
+
79
+ /**
80
+ * Removes the item from the pool.
81
+ *
82
+ * @param string $key
83
+ * The key to delete.
84
+ *
85
+ * @throws InvalidArgumentException
86
+ * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException
87
+ * MUST be thrown.
88
+ *
89
+ * @return bool
90
+ * True if the item was successfully removed. False if there was an error.
91
+ */
92
+ public function deleteItem($key);
93
+
94
+ /**
95
+ * Removes multiple items from the pool.
96
+ *
97
+ * @param string[] $keys
98
+ * An array of keys that should be removed from the pool.
99
+
100
+ * @throws InvalidArgumentException
101
+ * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException
102
+ * MUST be thrown.
103
+ *
104
+ * @return bool
105
+ * True if the items were successfully removed. False if there was an error.
106
+ */
107
+ public function deleteItems(array $keys);
108
+
109
+ /**
110
+ * Persists a cache item immediately.
111
+ *
112
+ * @param CacheItemInterface $item
113
+ * The cache item to save.
114
+ *
115
+ * @return bool
116
+ * True if the item was successfully persisted. False if there was an error.
117
+ */
118
+ public function save(CacheItemInterface $item);
119
+
120
+ /**
121
+ * Sets a cache item to be persisted later.
122
+ *
123
+ * @param CacheItemInterface $item
124
+ * The cache item to save.
125
+ *
126
+ * @return bool
127
+ * False if the item could not be queued or if a commit was attempted and failed. True otherwise.
128
+ */
129
+ public function saveDeferred(CacheItemInterface $item);
130
+
131
+ /**
132
+ * Persists any deferred cache items.
133
+ *
134
+ * @return bool
135
+ * True if all not-yet-saved items were successfully saved or there were none. False otherwise.
136
+ */
137
+ public function commit();
138
+ }
vendor/psr/cache/src/InvalidArgumentException.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Psr\Cache;
4
+
5
+ /**
6
+ * Exception interface for invalid cache arguments.
7
+ *
8
+ * Any time an invalid argument is passed into a method it must throw an
9
+ * exception class which implements Psr\Cache\InvalidArgumentException.
10
+ */
11
+ interface InvalidArgumentException extends CacheException
12
+ {
13
+ }
vendor/weglot/simplehtmldom/.gitignore ADDED
@@ -0,0 +1 @@
 
1
+ .idea/
vendor/weglot/simplehtmldom/composer.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "weglot/simplehtmldom",
3
+ "description": "Composer package that gives you access to and (unlike all the others at this time) autoloads S.C. Chen's PHP Simple HTML DOM Parser Library",
4
+ "keywords": ["html", "dom", "simple"],
5
+ "homepage" : "http://simplehtmldom.sourceforge.net/",
6
+ "type": "library",
7
+ "license": "MIT",
8
+ "authors": [
9
+ {
10
+ "name": "S.C. Chen",
11
+ "email": "me578022@gmail.com"
12
+ }
13
+ ],
14
+ "require": {
15
+ "php": ">=5.3.0"
16
+ },
17
+ "autoload": {
18
+ "psr-0": {
19
+ "SimpleHtmlDom": "src/"
20
+ },
21
+ "files": [
22
+ "src/simple_html_dom.php"
23
+ ]
24
+ }
25
+
26
+ }
simple_html_dom.php → vendor/weglot/simplehtmldom/src/simple_html_dom.php RENAMED
@@ -1,1871 +1,1892 @@
1
- <?php
2
- /**
3
- * Website: http://sourceforge.net/projects/simplehtmldom/
4
- * Acknowledge: Jose Solorzano (https://sourceforge.net/projects/php-html/)
5
- * Contributions by:
6
- * Yousuke Kumakura (Attribute filters)
7
- * Vadim Voituk (Negative indexes supports of "find" method)
8
- * Antcs (Constructor with automatically load contents either text or file/url)
9
- *
10
- * all affected sections have comments starting with "PaperG"
11
- *
12
- * Paperg - Added case insensitive testing of the value of the selector.
13
- * Paperg - Added tag_start for the starting index of tags - NOTE: This works but not accurately.
14
- * This tag_start gets counted AFTER \r\n have been crushed out, and after the remove_noice calls so it will not reflect the REAL position of the tag in the source,
15
- * it will almost always be smaller by some amount.
16
- * We use this to determine how far into the file the tag in question is. This "percentage will never be accurate as the $dom->size is the "real" number of bytes the dom was created from.
17
- * but for most purposes, it's a really good estimation.
18
- * Paperg - Added the forceTagsClosed to the dom constructor. Forcing tags closed is great for malformed html, but it CAN lead to parsing errors.
19
- * Allow the user to tell us how much they trust the html.
20
- * Paperg add the text and plaintext to the selectors for the find syntax. plaintext implies text in the innertext of a node. text implies that the tag is a text node.
21
- * This allows for us to find tags based on the text they contain.
22
- * Create find_ancestor_tag to see if a tag is - at any level - inside of another specific tag.
23
- * Paperg: added parse_charset so that we know about the character set of the source document.
24
- * NOTE: If the user's system has a routine called get_last_retrieve_url_contents_content_type availalbe, we will assume it's returning the content-type header from the
25
- * last transfer or curl_exec, and we will parse that and use it in preference to any other method of charset detection.
26
- *
27
- * Found infinite loop in the case of broken html in restore_noise. Rewrote to protect from that.
28
- * PaperG (John Schlick) Added get_display_size for "IMG" tags.
29
- *
30
- * Licensed under The MIT License
31
- * Redistributions of files must retain the above copyright notice.
32
- *
33
- * @author S.C. Chen <me578022@gmail.com>
34
- * @author John Schlick
35
- * @author Rus Carroll
36
- * @version 1.5 ($Rev: 196 $)
37
- * @package PlaceLocalInclude
38
- * @subpackage simple_html_dom
39
- */
40
- namespace WeglotSDP {
41
- /**
42
- * All of the Defines for the classes below.
43
- * @author S.C. Chen <me578022@gmail.com>
44
- */
45
- define('WG_HDOM_TYPE_ELEMENT', 1);
46
- define('WG_HDOM_TYPE_COMMENT', 2);
47
- define('WG_HDOM_TYPE_TEXT', 3);
48
- define('WG_HDOM_TYPE_ENDTAG', 4);
49
- define('WG_HDOM_TYPE_ROOT', 5);
50
- define('WG_HDOM_TYPE_UNKNOWN', 6);
51
- define('WG_HDOM_QUOTE_DOUBLE', 0);
52
- define('WG_HDOM_QUOTE_SINGLE', 1);
53
- define('WG_HDOM_QUOTE_NO', 3);
54
- define('WG_HDOM_INFO_BEGIN', 0);
55
- define('WG_HDOM_INFO_END', 1);
56
- define('WG_HDOM_INFO_QUOTE', 2);
57
- define('WG_HDOM_INFO_SPACE', 3);
58
- define('WG_HDOM_INFO_TEXT', 4);
59
- define('WG_HDOM_INFO_INNER', 5);
60
- define('WG_HDOM_INFO_OUTER', 6);
61
- define('WG_HDOM_INFO_ENDSPACE', 7);
62
- define('WG_DEFAULT_TARGET_CHARSET', 'UTF-8');
63
- define('WG_DEFAULT_BR_TEXT', "\r\n");
64
- define('WG_DEFAULT_SPAN_TEXT', " ");
65
- define('WG_MAX_FILE_SIZE', 100000000);
66
- // helper functions
67
- // -----------------------------------------------------------------------------
68
- // get html dom from file
69
- // $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1.
70
- function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = WG_DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=WG_DEFAULT_BR_TEXT, $defaultSpanText=WG_DEFAULT_SPAN_TEXT)
71
- {
72
- // We DO force the tags to be terminated.
73
- $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
74
- // For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done.
75
- $contents = file_get_contents($url, $use_include_path, $context, $offset);
76
- // Paperg - use our own mechanism for getting the contents as we want to control the timeout.
77
- //$contents = retrieve_url_contents($url);
78
- if (empty($contents) || strlen($contents) > WG_MAX_FILE_SIZE) {
79
- return false;
80
- }
81
- // The second parameter can force the selectors to all be lowercase.
82
- $dom->load($contents, $lowercase, $stripRN);
83
- return $dom;
84
- }
85
-
86
- // get html dom from string
87
- function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = WG_DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=WG_DEFAULT_BR_TEXT, $defaultSpanText=WG_DEFAULT_SPAN_TEXT)
88
- {
89
- $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
90
- if (empty($str) || strlen($str) > WG_MAX_FILE_SIZE) {
91
- $dom->clear();
92
- return false;
93
- }
94
- $dom->load($str, $lowercase, $stripRN);
95
- return $dom;
96
- }
97
-
98
- // dump html dom tree
99
- function dump_html_tree($node, $show_attr=true, $deep=0)
100
- {
101
- $node->dump($node);
102
- }
103
-
104
-
105
- /**
106
- * simple html dom node
107
- * PaperG - added ability for "find" routine to lowercase the value of the selector.
108
- * PaperG - added $tag_start to track the start position of the tag in the total byte index
109
- *
110
- * @package PlaceLocalInclude
111
- */
112
- class simple_html_dom_node
113
- {
114
- public $nodetype = WG_HDOM_TYPE_TEXT;
115
- public $tag = 'text';
116
- public $attr = array();
117
- public $children = array();
118
- public $nodes = array();
119
- public $parent = null;
120
- // The "info" array - see WG_HDOM_INFO_... for what each element contains.
121
- public $_ = array();
122
- public $tag_start = 0;
123
- private $dom = null;
124
-
125
- public function __construct($dom)
126
- {
127
- $this->dom = $dom;
128
- $dom->nodes[] = $this;
129
- }
130
-
131
- public function __destruct()
132
- {
133
- $this->clear();
134
- }
135
-
136
- public function __toString()
137
- {
138
- return $this->outertext();
139
- }
140
-
141
- // clean up memory due to php5 circular references memory leak...
142
- public function clear()
143
- {
144
- $this->dom = null;
145
- $this->nodes = null;
146
- $this->parent = null;
147
- $this->children = null;
148
- }
149
-
150
- // dump node's tree
151
- public function dump($show_attr=true, $deep=0)
152
- {
153
- $lead = str_repeat(' ', $deep);
154
-
155
- echo $lead.$this->tag;
156
- if ($show_attr && count($this->attr)>0) {
157
- echo '(';
158
- foreach ($this->attr as $k=>$v) {
159
- echo "[$k]=>\"".$this->$k.'", ';
160
- }
161
- echo ')';
162
- }
163
- echo "\n";
164
-
165
- if ($this->nodes) {
166
- foreach ($this->nodes as $c) {
167
- $c->dump($show_attr, $deep+1);
168
- }
169
- }
170
- }
171
-
172
-
173
- // Debugging function to dump a single dom node with a bunch of information about it.
174
- public function dump_node($echo=true)
175
- {
176
- $string = $this->tag;
177
- if (count($this->attr)>0) {
178
- $string .= '(';
179
- foreach ($this->attr as $k=>$v) {
180
- $string .= "[$k]=>\"".$this->$k.'", ';
181
- }
182
- $string .= ')';
183
- }
184
- if (count($this->_)>0) {
185
- $string .= ' $_ (';
186
- foreach ($this->_ as $k=>$v) {
187
- if (is_array($v)) {
188
- $string .= "[$k]=>(";
189
- foreach ($v as $k2=>$v2) {
190
- $string .= "[$k2]=>\"".$v2.'", ';
191
- }
192
- $string .= ")";
193
- } else {
194
- $string .= "[$k]=>\"".$v.'", ';
195
- }
196
- }
197
- $string .= ")";
198
- }
199
-
200
- if (isset($this->text)) {
201
- $string .= " text: (" . $this->text . ")";
202
- }
203
-
204
- $string .= " WG_HDOM_INNER_INFO: '";
205
- if (isset($node->_[WG_HDOM_INFO_INNER])) {
206
- $string .= $node->_[WG_HDOM_INFO_INNER] . "'";
207
- } else {
208
- $string .= ' NULL ';
209
- }
210
-
211
- $string .= " children: " . count($this->children);
212
- $string .= " nodes: " . count($this->nodes);
213
- $string .= " tag_start: " . $this->tag_start;
214
- $string .= "\n";
215
-
216
- if ($echo) {
217
- echo $string;
218
- return;
219
- } else {
220
- return $string;
221
- }
222
- }
223
-
224
- // returns the parent of node
225
- // If a node is passed in, it will reset the parent of the current node to that one.
226
- public function parent($parent=null)
227
- {
228
- // I am SURE that this doesn't work properly.
229
- // It fails to unset the current node from it's current parents nodes or children list first.
230
- if ($parent !== null) {
231
- $this->parent = $parent;
232
- $this->parent->nodes[] = $this;
233
- $this->parent->children[] = $this;
234
- }
235
-
236
- return $this->parent;
237
- }
238
-
239
- // verify that node has children
240
- public function has_child()
241
- {
242
- return !empty($this->children);
243
- }
244
-
245
- // returns children of node
246
- public function children($idx=-1)
247
- {
248
- if ($idx===-1) {
249
- return $this->children;
250
- }
251
- if (isset($this->children[$idx])) {
252
- return $this->children[$idx];
253
- }
254
- return null;
255
- }
256
-
257
- // returns the first child of node
258
- public function first_child()
259
- {
260
- if (count($this->children)>0) {
261
- return $this->children[0];
262
- }
263
- return null;
264
- }
265
-
266
- // returns the last child of node
267
- public function last_child()
268
- {
269
- if (($count=count($this->children))>0) {
270
- return $this->children[$count-1];
271
- }
272
- return null;
273
- }
274
-
275
- // returns the next sibling of node
276
- public function next_sibling()
277
- {
278
- if ($this->parent===null) {
279
- return null;
280
- }
281
-
282
- $idx = 0;
283
- $count = count($this->parent->children);
284
- while ($idx<$count && $this!==$this->parent->children[$idx]) {
285
- ++$idx;
286
- }
287
- if (++$idx>=$count) {
288
- return null;
289
- }
290
- return $this->parent->children[$idx];
291
- }
292
-
293
- // returns the previous sibling of node
294
- public function prev_sibling()
295
- {
296
- if ($this->parent===null) {
297
- return null;
298
- }
299
- $idx = 0;
300
- $count = count($this->parent->children);
301
- while ($idx<$count && $this!==$this->parent->children[$idx]) {
302
- ++$idx;
303
- }
304
- if (--$idx<0) {
305
- return null;
306
- }
307
- return $this->parent->children[$idx];
308
- }
309
-
310
- // function to locate a specific ancestor tag in the path to the root.
311
- public function find_ancestor_tag($tag)
312
- {
313
- global $debugObject;
314
- if (is_object($debugObject)) {
315
- $debugObject->debugLogEntry(1);
316
- }
317
-
318
- // Start by including ourselves in the comparison.
319
- $returnDom = $this;
320
-
321
- while (!is_null($returnDom)) {
322
- if (is_object($debugObject)) {
323
- $debugObject->debugLog(2, "Current tag is: " . $returnDom->tag);
324
- }
325
-
326
- if ($returnDom->tag == $tag) {
327
- break;
328
- }
329
- $returnDom = $returnDom->parent;
330
- }
331
- return $returnDom;
332
- }
333
-
334
- // get dom node's inner html
335
- public function innertext()
336
- {
337
- if (isset($this->_[WG_HDOM_INFO_INNER])) {
338
- return $this->_[WG_HDOM_INFO_INNER];
339
- }
340
- if (isset($this->_[WG_HDOM_INFO_TEXT])) {
341
- return $this->dom->restore_noise($this->_[WG_HDOM_INFO_TEXT]);
342
- }
343
-
344
- $ret = '';
345
- foreach ($this->nodes as $n) {
346
- $ret .= $n->outertext();
347
- }
348
- return $ret;
349
- }
350
-
351
- // get dom node's outer text (with tag)
352
- public function outertext()
353
- {
354
- global $debugObject;
355
- if (is_object($debugObject)) {
356
- $text = '';
357
- if ($this->tag == 'text') {
358
- if (!empty($this->text)) {
359
- $text = " with text: " . $this->text;
360
- }
361
- }
362
- $debugObject->debugLog(1, 'Innertext of tag: ' . $this->tag . $text);
363
- }
364
-
365
- if ($this->tag==='root') {
366
- return $this->innertext();
367
- }
368
-
369
- // trigger callback
370
- if ($this->dom && $this->dom->callback!==null) {
371
- call_user_func_array($this->dom->callback, array($this));
372
- }
373
-
374
- if (isset($this->_[WG_HDOM_INFO_OUTER])) {
375
- return $this->_[WG_HDOM_INFO_OUTER];
376
- }
377
- if (isset($this->_[WG_HDOM_INFO_TEXT])) {
378
- return $this->dom->restore_noise($this->_[WG_HDOM_INFO_TEXT]);
379
- }
380
-
381
- // render begin tag
382
- if ($this->dom && $this->dom->nodes[$this->_[WG_HDOM_INFO_BEGIN]]) {
383
- $ret = $this->dom->nodes[$this->_[WG_HDOM_INFO_BEGIN]]->makeup();
384
- } else {
385
- $ret = "";
386
- }
387
-
388
- // render inner text
389
- if (isset($this->_[WG_HDOM_INFO_INNER])) {
390
- // If it's a br tag... don't return the WG_HDOM_INNER_INFO that we may or may not have added.
391
- if ($this->tag != "br") {
392
- $ret .= $this->_[WG_HDOM_INFO_INNER];
393
- }
394
- } else {
395
- if ($this->nodes) {
396
- foreach ($this->nodes as $n) {
397
- $ret .= $this->convert_text($n->outertext());
398
- }
399
- }
400
- }
401
-
402
- // render end tag
403
- if (isset($this->_[WG_HDOM_INFO_END]) && $this->_[WG_HDOM_INFO_END]!=0) {
404
- $ret .= '</'.$this->tag.'>';
405
- }
406
- return $ret;
407
- }
408
-
409
- // get dom node's plain text
410
- public function text()
411
- {
412
- if (isset($this->_[WG_HDOM_INFO_INNER])) {
413
- return $this->_[WG_HDOM_INFO_INNER];
414
- }
415
- switch ($this->nodetype) {
416
- case WG_HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[WG_HDOM_INFO_TEXT]);
417
- case WG_HDOM_TYPE_COMMENT: return '';
418
- case WG_HDOM_TYPE_UNKNOWN: return '';
419
- }
420
- if (strcasecmp($this->tag, 'script')===0) {
421
- return '';
422
- }
423
- if (strcasecmp($this->tag, 'style')===0) {
424
- return '';
425
- }
426
-
427
- $ret = '';
428
- // In rare cases, (always node type 1 or WG_HDOM_TYPE_ELEMENT - observed for some span tags, and some p tags) $this->nodes is set to NULL.
429
- // NOTE: This indicates that there is a problem where it's set to NULL without a clear happening.
430
- // WHY is this happening?
431
- if (!is_null($this->nodes)) {
432
- foreach ($this->nodes as $n) {
433
- $ret .= $this->convert_text($n->text());
434
- }
435
-
436
- // If this node is a span... add a space at the end of it so multiple spans don't run into each other. This is plaintext after all.
437
- if ($this->tag == "span") {
438
- $ret .= $this->dom->WG_DEFAULT_SPAN_TEXT;
439
- }
440
- }
441
- return $ret;
442
- }
443
-
444
- public function xmltext()
445
- {
446
- $ret = $this->innertext();
447
- $ret = str_ireplace('<![CDATA[', '', $ret);
448
- $ret = str_replace(']]>', '', $ret);
449
- return $ret;
450
- }
451
-
452
- // build node's text with tag
453
- public function makeup()
454
- {
455
- // text, comment, unknown
456
- if (isset($this->_[WG_HDOM_INFO_TEXT])) {
457
- return $this->dom->restore_noise($this->_[WG_HDOM_INFO_TEXT]);
458
- }
459
-
460
- $ret = '<'.$this->tag;
461
- $i = -1;
462
-
463
- foreach ($this->attr as $key=>$val) {
464
- ++$i;
465
-
466
- // skip removed attribute
467
- if ($val===null || $val===false) {
468
- continue;
469
- }
470
-
471
- $ret .= $this->_[WG_HDOM_INFO_SPACE][$i][0];
472
- //no value attr: nowrap, checked selected...
473
- if ($val===true) {
474
- $ret .= $key;
475
- } else {
476
- switch ($this->_[WG_HDOM_INFO_QUOTE][$i]) {
477
- case WG_HDOM_QUOTE_DOUBLE: $quote = '"'; break;
478
- case WG_HDOM_QUOTE_SINGLE: $quote = '\''; break;
479
- default: $quote = '';
480
- }
481
- $ret .= $key.$this->_[WG_HDOM_INFO_SPACE][$i][1].'='.$this->_[WG_HDOM_INFO_SPACE][$i][2].$quote.$val.$quote;
482
- }
483
- }
484
- $ret = $this->dom->restore_noise($ret);
485
- return $ret . $this->_[WG_HDOM_INFO_ENDSPACE] . '>';
486
- }
487
-
488
- // find elements by css selector
489
- //PaperG - added ability for find to lowercase the value of the selector.
490
- public function find($selector, $idx=null, $lowercase=false)
491
- {
492
- $selectors = $this->parse_selector($selector);
493
- if (($count=count($selectors))===0) {
494
- return array();
495
- }
496
- $found_keys = array();
497
-
498
- // find each selector
499
- for ($c=0; $c<$count; ++$c) {
500
- // The change on the below line was documented on the sourceforge code tracker id 2788009
501
- // used to be: if (($levle=count($selectors[0]))===0) return array();
502
- if (($levle=count($selectors[$c]))===0) {
503
- return array();
504
- }
505
- if (!isset($this->_[WG_HDOM_INFO_BEGIN])) {
506
- return array();
507
- }
508
-
509
- $head = array($this->_[WG_HDOM_INFO_BEGIN]=>1);
510
-
511
- // handle descendant selectors, no recursive!
512
- for ($l=0; $l<$levle; ++$l) {
513
- $ret = array();
514
- foreach ($head as $k=>$v) {
515
- $n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k];
516
- //PaperG - Pass this optional parameter on to the seek function.
517
- $n->seek($selectors[$c][$l], $ret, $lowercase);
518
- }
519
- $head = $ret;
520
- }
521
-
522
- foreach ($head as $k=>$v) {
523
- if (!isset($found_keys[$k])) {
524
- $found_keys[$k] = 1;
525
- }
526
- }
527
- }
528
-
529
- // sort keys
530
- ksort($found_keys);
531
-
532
- $found = array();
533
- foreach ($found_keys as $k=>$v) {
534
- $found[] = $this->dom->nodes[$k];
535
- }
536
-
537
- // return nth-element or array
538
- if (is_null($idx)) {
539
- return $found;
540
- } elseif ($idx<0) {
541
- $idx = count($found) + $idx;
542
- }
543
- return (isset($found[$idx])) ? $found[$idx] : null;
544
- }
545
-
546
- // seek for given conditions
547
- // PaperG - added parameter to allow for case insensitive testing of the value of a selector.
548
- protected function seek($selector, &$ret, $lowercase=false)
549
- {
550
- global $debugObject;
551
- if (is_object($debugObject)) {
552
- $debugObject->debugLogEntry(1);
553
- }
554
-
555
- list($tag, $key, $val, $exp, $no_key) = $selector;
556
-
557
- // xpath index
558
- if ($tag && $key && is_numeric($key)) {
559
- $count = 0;
560
- foreach ($this->children as $c) {
561
- if ($tag==='*' || $tag===$c->tag) {
562
- if (++$count==$key) {
563
- $ret[$c->_[WG_HDOM_INFO_BEGIN]] = 1;
564
- return;
565
- }
566
- }
567
- }
568
- return;
569
- }
570
-
571
- $end = (!empty($this->_[WG_HDOM_INFO_END])) ? $this->_[WG_HDOM_INFO_END] : 0;
572
- if ($end==0) {
573
- $parent = $this->parent;
574
- while (!isset($parent->_[WG_HDOM_INFO_END]) && $parent!==null) {
575
- $end -= 1;
576
- $parent = $parent->parent;
577
- }
578
- $end += $parent->_[WG_HDOM_INFO_END];
579
- }
580
-
581
- for ($i=$this->_[WG_HDOM_INFO_BEGIN]+1; $i<$end; ++$i) {
582
- $node = $this->dom->nodes[$i];
583
-
584
- $pass = true;
585
-
586
- if ($tag==='*' && !$key) {
587
- if (in_array($node, $this->children, true)) {
588
- $ret[$i] = 1;
589
- }
590
- continue;
591
- }
592
-
593
- // compare tag
594
- if ($tag && $tag!=$node->tag && $tag!=='*') {
595
- $pass=false;
596
- }
597
- // compare key
598
- if ($pass && $key) {
599
- if ($no_key) {
600
- if (isset($node->attr[$key])) {
601
- $pass=false;
602
- }
603
- } else {
604
- if (($key != "plaintext") && !isset($node->attr[$key])) {
605
- $pass=false;
606
- }
607
- }
608
- }
609
- // compare value
610
- if ($pass && $key && $val && $val!=='*') {
611
- // If they have told us that this is a "plaintext" search then we want the plaintext of the node - right?
612
- if ($key == "plaintext") {
613
- // $node->plaintext actually returns $node->text();
614
- $nodeKeyValue = $node->text();
615
- } else {
616
- // this is a normal search, we want the value of that attribute of the tag.
617
- $nodeKeyValue = $node->attr[$key];
618
- }
619
- if (is_object($debugObject)) {
620
- $debugObject->debugLog(2, "testing node: " . $node->tag . " for attribute: " . $key . $exp . $val . " where nodes value is: " . $nodeKeyValue);
621
- }
622
-
623
- //PaperG - If lowercase is set, do a case insensitive test of the value of the selector.
624
- if ($lowercase) {
625
- $check = $this->match($exp, strtolower($val), strtolower($nodeKeyValue));
626
- } else {
627
- $check = $this->match($exp, $val, $nodeKeyValue);
628
- }
629
- if (is_object($debugObject)) {
630
- $debugObject->debugLog(2, "after match: " . ($check ? "true" : "false"));
631
- }
632
-
633
- // handle multiple class
634
- if (!$check && strcasecmp($key, 'class')===0) {
635
- foreach (explode(' ', $node->attr[$key]) as $k) {
636
- // Without this, there were cases where leading, trailing, or double spaces lead to our comparing blanks - bad form.
637
- if (!empty($k)) {
638
- if ($lowercase) {
639
- $check = $this->match($exp, strtolower($val), strtolower($k));
640
- } else {
641
- $check = $this->match($exp, $val, $k);
642
- }
643
- if ($check) {
644
- break;
645
- }
646
- }
647
- }
648
- }
649
- if (!$check) {
650
- $pass = false;
651
- }
652
- }
653
- if ($pass) {
654
- $ret[$i] = 1;
655
- }
656
- unset($node);
657
- }
658
- // It's passed by reference so this is actually what this function returns.
659
- if (is_object($debugObject)) {
660
- $debugObject->debugLog(1, "EXIT - ret: ", $ret);
661
- }
662
- }
663
-
664
- protected function match($exp, $pattern, $value)
665
- {
666
- global $debugObject;
667
- if (is_object($debugObject)) {
668
- $debugObject->debugLogEntry(1);
669
- }
670
-
671
- switch ($exp) {
672
- case '=':
673
- return ($value===$pattern);
674
- case '!=':
675
- return ($value!==$pattern);
676
- case '^=':
677
- return preg_match("/^".preg_quote($pattern, '/')."/", $value);
678
- case '$=':
679
- return preg_match("/".preg_quote($pattern, '/')."$/", $value);
680
- case '*=':
681
- if ($pattern[0]=='/') {
682
- return preg_match($pattern, $value);
683
- }
684
- return preg_match("/".$pattern."/i", $value);
685
- }
686
- return false;
687
- }
688
-
689
- protected function parse_selector($selector_string)
690
- {
691
- global $debugObject;
692
- if (is_object($debugObject)) {
693
- $debugObject->debugLogEntry(1);
694
- }
695
-
696
- // pattern of CSS selectors, modified from mootools
697
- // Paperg: Add the colon to the attrbute, so that it properly finds <tag attr:ibute="something" > like google does.
698
- // Note: if you try to look at this attribute, yo MUST use getAttribute since $dom->x:y will fail the php syntax check.
699
- // Notice the \[ starting the attbute? and the @? following? This implies that an attribute can begin with an @ sign that is not captured.
700
- // This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression.
701
- // farther study is required to determine of this should be documented or removed.
702
- // $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
703
- $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
704
- preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER);
705
- if (is_object($debugObject)) {
706
- $debugObject->debugLog(2, "Matches Array: ", $matches);
707
- }
708
-
709
- $selectors = array();
710
- $result = array();
711
- //print_r($matches);
712
-
713
- foreach ($matches as $m) {
714
- $m[0] = trim($m[0]);
715
- if ($m[0]==='' || $m[0]==='/' || $m[0]==='//') {
716
- continue;
717
- }
718
- // for browser generated xpath
719
- if ($m[1]==='tbody') {
720
- continue;
721
- }
722
-
723
- list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false);
724
- if (!empty($m[2])) {
725
- $key='id';
726
- $val=$m[2];
727
- }
728
- if (!empty($m[3])) {
729
- $key='class';
730
- $val=$m[3];
731
- }
732
- if (!empty($m[4])) {
733
- $key=$m[4];
734
- }
735
- if (!empty($m[5])) {
736
- $exp=$m[5];
737
- }
738
- if (!empty($m[6])) {
739
- $val=$m[6];
740
- }
741
-
742
- // convert to lowercase
743
- if ($this->dom->lowercase) {
744
- $tag=strtolower($tag);
745
- $key=strtolower($key);
746
- }
747
- //elements that do NOT have the specified attribute
748
- if (isset($key[0]) && $key[0]==='!') {
749
- $key=substr($key, 1);
750
- $no_key=true;
751
- }
752
-
753
- $result[] = array($tag, $key, $val, $exp, $no_key);
754
- if (trim($m[7])===',') {
755
- $selectors[] = $result;
756
- $result = array();
757
- }
758
- }
759
- if (count($result)>0) {
760
- $selectors[] = $result;
761
- }
762
- return $selectors;
763
- }
764
-
765
- public function __get($name)
766
- {
767
- if (isset($this->attr[$name])) {
768
- return $this->convert_text($this->attr[$name]);
769
- }
770
- switch ($name) {
771
- case 'outertext': return $this->outertext();
772
- case 'innertext': return $this->innertext();
773
- case 'plaintext': return $this->text();
774
- case 'xmltext': return $this->xmltext();
775
- default: return array_key_exists($name, $this->attr);
776
- }
777
- }
778
-
779
- public function __set($name, $value)
780
- {
781
- switch ($name) {
782
- case 'outertext': return $this->_[WG_HDOM_INFO_OUTER] = $value;
783
- case 'innertext':
784
- if (isset($this->_[WG_HDOM_INFO_TEXT])) {
785
- return $this->_[WG_HDOM_INFO_TEXT] = $value;
786
- }
787
- return $this->_[WG_HDOM_INFO_INNER] = $value;
788
- }
789
- if (!isset($this->attr[$name])) {
790
- $this->_[WG_HDOM_INFO_SPACE][] = array(' ', '', '');
791
- $this->_[WG_HDOM_INFO_QUOTE][] = WG_HDOM_QUOTE_DOUBLE;
792
- }
793
- $this->attr[$name] = $value;
794
- }
795
-
796
- public function __isset($name)
797
- {
798
- switch ($name) {
799
- case 'outertext': return true;
800
- case 'innertext': return true;
801
- case 'plaintext': return true;
802
- }
803
- //no value attr: nowrap, checked selected...
804
- return (array_key_exists($name, $this->attr)) ? true : isset($this->attr[$name]);
805
- }
806
-
807
- public function __unset($name)
808
- {
809
- if (isset($this->attr[$name])) {
810
- unset($this->attr[$name]);
811
- }
812
- }
813
-
814
- // PaperG - Function to convert the text from one character set to another if the two sets are not the same.
815
- public function convert_text($text)
816
- {
817
- global $debugObject;
818
- if (is_object($debugObject)) {
819
- $debugObject->debugLogEntry(1);
820
- }
821
-
822
- $converted_text = $text;
823
-
824
- $sourceCharset = "";
825
- $targetCharset = "";
826
-
827
- if ($this->dom) {
828
- $sourceCharset = strtoupper($this->dom->_charset);
829
- $targetCharset = strtoupper($this->dom->_target_charset);
830
- }
831
- if (is_object($debugObject)) {
832
- $debugObject->debugLog(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);
833
- }
834
-
835
- if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0)) {
836
- // Check if the reported encoding could have been incorrect and the text is actually already UTF-8
837
- if ((strcasecmp($targetCharset, 'UTF-8') == 0) && ($this->is_utf8($text))) {
838
- $converted_text = $text;
839
- } else {
840
- $converted_text = iconv($sourceCharset, $targetCharset, $text);
841
- }
842
- }
843
-
844
- // Lets make sure that we don't have that silly BOM issue with any of the utf-8 text we output.
845
- if ($targetCharset == 'UTF-8') {
846
- if (substr($converted_text, 0, 3) == "\xef\xbb\xbf") {
847
- $converted_text = substr($converted_text, 3);
848
- }
849
- if (substr($converted_text, -3) == "\xef\xbb\xbf") {
850
- $converted_text = substr($converted_text, 0, -3);
851
- }
852
- }
853
-
854
- return $converted_text;
855
- }
856
-
857
- /**
858
- * Returns true if $string is valid UTF-8 and false otherwise.
859
- *
860
- * @param mixed $str String to be tested
861
- * @return boolean
862
- */
863
- public static function is_utf8($str)
864
- {
865
- $c=0;
866
- $b=0;
867
- $bits=0;
868
- $len=strlen($str);
869
- for ($i=0; $i<$len; $i++) {
870
- $c=ord($str[$i]);
871
- if ($c > 128) {
872
- if (($c >= 254)) {
873
- return false;
874
- } elseif ($c >= 252) {
875
- $bits=6;
876
- } elseif ($c >= 248) {
877
- $bits=5;
878
- } elseif ($c >= 240) {
879
- $bits=4;
880
- } elseif ($c >= 224) {
881
- $bits=3;
882
- } elseif ($c >= 192) {
883
- $bits=2;
884
- } else {
885
- return false;
886
- }
887
- if (($i+$bits) > $len) {
888
- return false;
889
- }
890
- while ($bits > 1) {
891
- $i++;
892
- $b=ord($str[$i]);
893
- if ($b < 128 || $b > 191) {
894
- return false;
895
- }
896
- $bits--;
897
- }
898
- }
899
- }
900
- return true;
901
- }
902
- /*
903
- function is_utf8($string)
904
- {
905
- //this is buggy
906
- return (utf8_encode(utf8_decode($string)) == $string);
907
- }
908
- */
909
-
910
- /**
911
- * Function to try a few tricks to determine the displayed size of an img on the page.
912
- * NOTE: This will ONLY work on an IMG tag. Returns FALSE on all other tag types.
913
- *
914
- * @author John Schlick
915
- * @version April 19 2012
916
- * @return array an array containing the 'height' and 'width' of the image on the page or -1 if we can't figure it out.
917
- */
918
- public function get_display_size()
919
- {
920
- global $debugObject;
921
-
922
- $width = -1;
923
- $height = -1;
924
-
925
- if ($this->tag !== 'img') {
926
- return false;
927
- }
928
-
929
- // See if there is aheight or width attribute in the tag itself.
930
- if (isset($this->attr['width'])) {
931
- $width = $this->attr['width'];
932
- }
933
-
934
- if (isset($this->attr['height'])) {
935
- $height = $this->attr['height'];
936
- }
937
-
938
- // Now look for an inline style.
939
- if (isset($this->attr['style'])) {
940
- // Thanks to user gnarf from stackoverflow for this regular expression.
941
- $attributes = array();
942
- preg_match_all("/([\w-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER);
943
- foreach ($matches as $match) {
944
- $attributes[$match[1]] = $match[2];
945
- }
946
-
947
- // If there is a width in the style attributes:
948
- if (isset($attributes['width']) && $width == -1) {
949
- // check that the last two characters are px (pixels)
950
- if (strtolower(substr($attributes['width'], -2)) == 'px') {
951
- $proposed_width = substr($attributes['width'], 0, -2);
952
- // Now make sure that it's an integer and not something stupid.
953
- if (filter_var($proposed_width, FILTER_VALIDATE_INT)) {
954
- $width = $proposed_width;
955
- }
956
- }
957
- }
958
-
959
- // If there is a width in the style attributes:
960
- if (isset($attributes['height']) && $height == -1) {
961
- // check that the last two characters are px (pixels)
962
- if (strtolower(substr($attributes['height'], -2)) == 'px') {
963
- $proposed_height = substr($attributes['height'], 0, -2);
964
- // Now make sure that it's an integer and not something stupid.
965
- if (filter_var($proposed_height, FILTER_VALIDATE_INT)) {
966
- $height = $proposed_height;
967
- }
968
- }
969
- }
970
- }
971
-
972
- // Future enhancement:
973
- // Look in the tag to see if there is a class or id specified that has a height or width attribute to it.
974
-
975
- // Far future enhancement
976
- // Look at all the parent tags of this image to see if they specify a class or id that has an img selector that specifies a height or width
977
- // Note that in this case, the class or id will have the img subselector for it to apply to the image.
978
-
979
- // ridiculously far future development
980
- // If the class or id is specified in a SEPARATE css file thats not on the page, go get it and do what we were just doing for the ones on the page.
981
-
982
- $result = array('height' => $height,
983
- 'width' => $width);
984
- return $result;
985
- }
986
-
987
- // camel naming conventions
988
- public function getAllAttributes()
989
- {
990
- return $this->attr;
991
- }
992
- public function getAttribute($name)
993
- {
994
- return $this->__get($name);
995
- }
996
- public function setAttribute($name, $value)
997
- {
998
- $this->__set($name, $value);
999
- }
1000
- public function hasAttribute($name)
1001
- {
1002
- return $this->__isset($name);
1003
- }
1004
- public function removeAttribute($name)
1005
- {
1006
- $this->__set($name, null);
1007
- }
1008
- public function getElementById($id)
1009
- {
1010
- return $this->find("#$id", 0);
1011
- }
1012
- public function getElementsById($id, $idx=null)
1013
- {
1014
- return $this->find("#$id", $idx);
1015
- }
1016
- public function getElementByTagName($name)
1017
- {
1018
- return $this->find($name, 0);
1019
- }
1020
- public function getElementsByTagName($name, $idx=null)
1021
- {
1022
- return $this->find($name, $idx);
1023
- }
1024
- public function parentNode()
1025
- {
1026
- return $this->parent();
1027
- }
1028
- public function childNodes($idx=-1)
1029
- {
1030
- return $this->children($idx);
1031
- }
1032
- public function firstChild()
1033
- {
1034
- return $this->first_child();
1035
- }
1036
- public function lastChild()
1037
- {
1038
- return $this->last_child();
1039
- }
1040
- public function nextSibling()
1041
- {
1042
- return $this->next_sibling();
1043
- }
1044
- public function previousSibling()
1045
- {
1046
- return $this->prev_sibling();
1047
- }
1048
- public function hasChildNodes()
1049
- {
1050
- return $this->has_child();
1051
- }
1052
- public function nodeName()
1053
- {
1054
- return $this->tag;
1055
- }
1056
- public function appendChild($node)
1057
- {
1058
- $node->parent($this);
1059
- return $node;
1060
- }
1061
- }
1062
-
1063
- /**
1064
- * simple html dom parser
1065
- * Paperg - in the find routine: allow us to specify that we want case insensitive testing of the value of the selector.
1066
- * Paperg - change $size from protected to public so we can easily access it
1067
- * Paperg - added ForceTagsClosed in the constructor which tells us whether we trust the html or not. Default is to NOT trust it.
1068
- *
1069
- * @package PlaceLocalInclude
1070
- */
1071
- class simple_html_dom
1072
- {
1073
- public $root = null;
1074
- public $nodes = array();
1075
- public $callback = null;
1076
- public $lowercase = false;
1077
- // Used to keep track of how large the text was when we started.
1078
- public $original_size;
1079
- public $size;
1080
- protected $pos;
1081
- protected $doc;
1082
- protected $char;
1083
- protected $cursor;
1084
- protected $parent;
1085
- protected $noise = array();
1086
- protected $token_blank = " \t\r\n";
1087
- protected $token_equal = ' =/>';
1088
- protected $token_slash = " />\r\n\t";
1089
- protected $token_attr = ' >';
1090
- // Note that this is referenced by a child node, and so it needs to be public for that node to see this information.
1091
- public $_charset = '';
1092
- public $_target_charset = '';
1093
- protected $WG_DEFAULT_BR_TEXT = "";
1094
- public $WG_DEFAULT_SPAN_TEXT = "";
1095
-
1096
- // use isset instead of in_array, performance boost about 30%...
1097
- protected $self_closing_tags = array('img'=>1, 'br'=>1, 'input'=>1, 'meta'=>1, 'link'=>1, 'hr'=>1, 'base'=>1, 'embed'=>1, 'spacer'=>1);
1098
- protected $block_tags = array('root'=>1, 'body'=>1, 'form'=>1, 'div'=>1, 'span'=>1, 'table'=>1);
1099
- // Known sourceforge issue #2977341
1100
- // B tags that are not closed cause us to return everything to the end of the document.
1101
- protected $optional_closing_tags = array(
1102
- 'tr'=>array('tr'=>1, 'td'=>1, 'th'=>1),
1103
- 'th'=>array('th'=>1),
1104
- 'td'=>array('td'=>1),
1105
- 'li'=>array('li'=>1),
1106
- 'dt'=>array('dt'=>1, 'dd'=>1),
1107
- 'dd'=>array('dd'=>1, 'dt'=>1),
1108
- 'dl'=>array('dd'=>1, 'dt'=>1),
1109
- 'p'=>array('p'=>1),
1110
- 'nobr'=>array('nobr'=>1),
1111
- 'b'=>array('b'=>1),
1112
- 'option'=>array('option'=>1),
1113
- 'source'=>array('source'=>1)
1114
- );
1115
-
1116
- public function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=WG_DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=WG_DEFAULT_BR_TEXT, $defaultSpanText=WG_DEFAULT_SPAN_TEXT)
1117
- {
1118
- if ($str) {
1119
- if (preg_match("/^http:\/\//i", $str) || is_file($str)) {
1120
- $this->load_file($str);
1121
- } else {
1122
- $this->load($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
1123
- }
1124
- }
1125
- // Forcing tags to be closed implies that we don't trust the html, but it can lead to parsing errors if we SHOULD trust the html.
1126
- if (!$forceTagsClosed) {
1127
- $this->optional_closing_array=array();
1128
- }
1129
- $this->_target_charset = $target_charset;
1130
- }
1131
-
1132
- public function __destruct()
1133
- {
1134
- $this->clear();
1135
- }
1136
-
1137
- // load html from string
1138
- public function load($str, $lowercase=true, $stripRN=true, $defaultBRText=WG_DEFAULT_BR_TEXT, $defaultSpanText=WG_DEFAULT_SPAN_TEXT)
1139
- {
1140
- global $debugObject;
1141
-
1142
- // prepare
1143
- $this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
1144
- // strip out comments
1145
- $this->remove_noise("'<!--(.*?)-->'is");
1146
- // strip out cdata
1147
- $this->remove_noise("'<!\[CDATA\[(.*?)\]\](>|&gt;)'is", true);
1148
- // Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037
1149
- // Script tags removal now preceeds style tag removal.
1150
- // strip out <script> tags
1151
- $this->remove_noise("'<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>'is");
1152
- $this->remove_noise("'<\s*script\s*>(.*?)<\s*/\s*script\s*>'is");
1153
- $this->remove_noise("'<\s*noscript\s*>(.*?)<\s*/\s*noscript\s*>'is");
1154
- // strip out <style> tags
1155
- $this->remove_noise("'<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>'is");
1156
- $this->remove_noise("'<\s*style\s*>(.*?)<\s*/\s*style\s*>'is");
1157
- // strip out preformatted tags
1158
- $this->remove_noise("'<\s*(?:code)[^>]*>(.*?)<\s*/\s*(?:code)\s*>'is");
1159
- // strip out server side scripts
1160
- $this->remove_noise("'(<\?)(.*?)(\?>)'s", true);
1161
- // strip smarty scripts
1162
- $this->remove_noise("'(\{\w)(.*?)(\})'s", true);
1163
-
1164
- // parsing
1165
- while ($this->parse());
1166
- // end
1167
- $this->root->_[WG_HDOM_INFO_END] = $this->cursor;
1168
- $this->parse_charset();
1169
-
1170
- // make load function chainable
1171
- return $this;
1172
- }
1173
-
1174
- // load html from file
1175
- public function load_file()
1176
- {
1177
- $args = func_get_args();
1178
- $this->load(call_user_func_array('file_get_contents', $args), true);
1179
- // Throw an error if we can't properly load the dom.
1180
- if (($error=error_get_last())!==null) {
1181
- $this->clear();
1182
- return false;
1183
- }
1184
- }
1185
-
1186
- // set callback function
1187
- public function set_callback($function_name)
1188
- {
1189
- $this->callback = $function_name;
1190
- }
1191
-
1192
- // remove callback function
1193
- public function remove_callback()
1194
- {
1195
- $this->callback = null;
1196
- }
1197
-
1198
- // save dom as string
1199
- public function save($filepath='')
1200
- {
1201
- $ret = $this->root->innertext();
1202
- if ($filepath!=='') {
1203
- file_put_contents($filepath, $ret, LOCK_EX);
1204
- }
1205
- return $ret;
1206
- }
1207
-
1208
- // find dom node by css selector
1209
- // Paperg - allow us to specify that we want case insensitive testing of the value of the selector.
1210
- public function find($selector, $idx=null, $lowercase=false)
1211
- {
1212
- return $this->root->find($selector, $idx, $lowercase);
1213
- }
1214
-
1215
- // clean up memory due to php5 circular references memory leak...
1216
- public function clear()
1217
- {
1218
- foreach ($this->nodes as $n) {
1219
- $n->clear();
1220
- $n = null;
1221
- }
1222
- // This add next line is documented in the sourceforge repository. 2977248 as a fix for ongoing memory leaks that occur even with the use of clear.
1223
- if (isset($this->children)) {
1224
- foreach ($this->children as $n) {
1225
- $n->clear();
1226
- $n = null;
1227
- }
1228
- }
1229
- if (isset($this->parent)) {
1230
- $this->parent->clear();
1231
- unset($this->parent);
1232
- }
1233
- if (isset($this->root)) {
1234
- $this->root->clear();
1235
- unset($this->root);
1236
- }
1237
- unset($this->doc);
1238
- unset($this->noise);
1239
- }
1240
-
1241
- public function dump($show_attr=true)
1242
- {
1243
- $this->root->dump($show_attr);
1244
- }
1245
-
1246
- // prepare HTML data and init everything
1247
- protected function prepare($str, $lowercase=true, $stripRN=true, $defaultBRText=WG_DEFAULT_BR_TEXT, $defaultSpanText=WG_DEFAULT_SPAN_TEXT)
1248
- {
1249
- $this->clear();
1250
-
1251
- // set the length of content before we do anything to it.
1252
- $this->size = strlen($str);
1253
- // Save the original size of the html that we got in. It might be useful to someone.
1254
- $this->original_size = $this->size;
1255
-
1256
- //before we save the string as the doc... strip out the \r \n's if we are told to.
1257
- if ($stripRN) {
1258
- $str = str_replace("\r", " ", $str);
1259
- $str = str_replace("\n", " ", $str);
1260
-
1261
- // set the length of content since we have changed it.
1262
- $this->size = strlen($str);
1263
- }
1264
-
1265
- $this->doc = $str;
1266
- $this->pos = 0;
1267
- $this->cursor = 1;
1268
- $this->noise = array();
1269
- $this->nodes = array();
1270
- $this->lowercase = $lowercase;
1271
- $this->WG_DEFAULT_BR_TEXT = $defaultBRText;
1272
- $this->WG_DEFAULT_SPAN_TEXT = $defaultSpanText;
1273
- $this->root = new simple_html_dom_node($this);
1274
- $this->root->tag = 'root';
1275
- $this->root->_[WG_HDOM_INFO_BEGIN] = -1;
1276
- $this->root->nodetype = WG_HDOM_TYPE_ROOT;
1277
- $this->parent = $this->root;
1278
- if ($this->size>0) {
1279
- $this->char = $this->doc[0];
1280
- }
1281
- }
1282
-
1283
- // parse html content
1284
- protected function parse()
1285
- {
1286
- if (($s = $this->copy_until_char('<'))==='') {
1287
- return $this->read_tag();
1288
- }
1289
-
1290
- // text
1291
- $node = new simple_html_dom_node($this);
1292
- ++$this->cursor;
1293
- $node->_[WG_HDOM_INFO_TEXT] = $s;
1294
- $this->link_nodes($node, false);
1295
- return true;
1296
- }
1297
-
1298
- // PAPERG - dkchou - added this to try to identify the character set of the page we have just parsed so we know better how to spit it out later.
1299
- // NOTE: IF you provide a routine called get_last_retrieve_url_contents_content_type which returns the CURLINFO_CONTENT_TYPE from the last curl_exec
1300
- // (or the content_type header from the last transfer), we will parse THAT, and if a charset is specified, we will use it over any other mechanism.
1301
- protected function parse_charset()
1302
- {
1303
- global $debugObject;
1304
-
1305
- $charset = null;
1306
-
1307
- if (function_exists('get_last_retrieve_url_contents_content_type')) {
1308
- $contentTypeHeader = get_last_retrieve_url_contents_content_type();
1309
- $success = preg_match('/charset=(.+)/', $contentTypeHeader, $matches);
1310
- if ($success) {
1311
- $charset = $matches[1];
1312
- if (is_object($debugObject)) {
1313
- $debugObject->debugLog(2, 'header content-type found charset of: ' . $charset);
1314
- }
1315
- }
1316
- }
1317
-
1318
- if (empty($charset)) {
1319
- $el = $this->root->find('meta[http-equiv=Content-Type]', 0);
1320
- if (!empty($el)) {
1321
- $fullvalue = $el->content;
1322
- if (is_object($debugObject)) {
1323
- $debugObject->debugLog(2, 'meta content-type tag found' . $fullvalue);
1324
- }
1325
-
1326
- if (!empty($fullvalue)) {
1327
- $success = preg_match('/charset=(.+)/', $fullvalue, $matches);
1328
- if ($success) {
1329
- $charset = $matches[1];
1330
- } else {
1331
- // If there is a meta tag, and they don't specify the character set, research says that it's typically ISO-8859-1
1332
- if (is_object($debugObject)) {
1333
- $debugObject->debugLog(2, 'meta content-type tag couldn\'t be parsed. using iso-8859 default.');
1334
- }
1335
- $charset = 'ISO-8859-1';
1336
- }
1337
- }
1338
- }
1339
- }
1340
-
1341
- // If we couldn't find a charset above, then lets try to detect one based on the text we got...
1342
- if (empty($charset)) {
1343
- // Have php try to detect the encoding from the text given to us.
1344
- if (function_exists('mb_detect_encoding')) {
1345
- $charset = mb_detect_encoding($this->root->plaintext . "ascii", $encoding_list = array( "UTF-8", "CP1252" ));
1346
- }
1347
- if (is_object($debugObject)) {
1348
- $debugObject->debugLog(2, 'mb_detect found: ' . $charset);
1349
- }
1350
-
1351
- // and if this doesn't work... then we need to just wrongheadedly assume it's UTF-8 so that we can move on - cause this will usually give us most of what we need...
1352
- if ($charset === false) {
1353
- if (is_object($debugObject)) {
1354
- $debugObject->debugLog(2, 'since mb_detect failed - using default of utf-8');
1355
- }
1356
- $charset = 'UTF-8';
1357
- }
1358
- }
1359
-
1360
- // Since CP1252 is a superset, if we get one of it's subsets, we want it instead.
1361
- if ((strtolower($charset) == strtolower('ISO-8859-1')) || (strtolower($charset) == strtolower('Latin1')) || (strtolower($charset) == strtolower('Latin-1'))) {
1362
- if (is_object($debugObject)) {
1363
- $debugObject->debugLog(2, 'replacing ' . $charset . ' with CP1252 as its a superset');
1364
- }
1365
- $charset = 'CP1252';
1366
- }
1367
-
1368
- if (is_object($debugObject)) {
1369
- $debugObject->debugLog(1, 'EXIT - ' . $charset);
1370
- }
1371
-
1372
- return $this->_charset = $charset;
1373
- }
1374
-
1375
- // read tag info
1376
- protected function read_tag()
1377
- {
1378
- if ($this->char!=='<') {
1379
- $this->root->_[WG_HDOM_INFO_END] = $this->cursor;
1380
- return false;
1381
- }
1382
- $begin_tag_pos = $this->pos;
1383
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1384
-
1385
- // end tag
1386
- if ($this->char==='/') {
1387
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1388
- // This represents the change in the simple_html_dom trunk from revision 180 to 181.
1389
- // $this->skip($this->token_blank_t);
1390
- $this->skip($this->token_blank);
1391
- $tag = $this->copy_until_char('>');
1392
-
1393
- // skip attributes in end tag
1394
- if (($pos = strpos($tag, ' '))!==false) {
1395
- $tag = substr($tag, 0, $pos);
1396
- }
1397
-
1398
- $parent_lower = strtolower($this->parent->tag);
1399
- $tag_lower = strtolower($tag);
1400
-
1401
- if ($parent_lower!==$tag_lower) {
1402
- if (isset($this->optional_closing_tags[$parent_lower]) && isset($this->block_tags[$tag_lower])) {
1403
- $this->parent->_[WG_HDOM_INFO_END] = 0;
1404
- $org_parent = $this->parent;
1405
-
1406
- while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower) {
1407
- $this->parent = $this->parent->parent;
1408
- }
1409
-
1410
- if (strtolower($this->parent->tag)!==$tag_lower) {
1411
- $this->parent = $org_parent; // restore origonal parent
1412
- if ($this->parent->parent) {
1413
- $this->parent = $this->parent->parent;
1414
- }
1415
- $this->parent->_[WG_HDOM_INFO_END] = $this->cursor;
1416
- return $this->as_text_node($tag);
1417
- }
1418
- } elseif (($this->parent->parent) && isset($this->block_tags[$tag_lower])) {
1419
- $this->parent->_[WG_HDOM_INFO_END] = 0;
1420
- $org_parent = $this->parent;
1421
-
1422
- while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower) {
1423
- $this->parent = $this->parent->parent;
1424
- }
1425
-
1426
- if (strtolower($this->parent->tag)!==$tag_lower) {
1427
- $this->parent = $org_parent; // restore origonal parent
1428
- $this->parent->_[WG_HDOM_INFO_END] = $this->cursor;
1429
- return $this->as_text_node($tag);
1430
- }
1431
- } elseif (($this->parent->parent) && strtolower($this->parent->parent->tag)===$tag_lower) {
1432
- $this->parent->_[WG_HDOM_INFO_END] = 0;
1433
- $this->parent = $this->parent->parent;
1434
- } else {
1435
- return $this->as_text_node($tag);
1436
- }
1437
- }
1438
-
1439
- $this->parent->_[WG_HDOM_INFO_END] = $this->cursor;
1440
- if ($this->parent->parent) {
1441
- $this->parent = $this->parent->parent;
1442
- }
1443
-
1444
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1445
- return true;
1446
- }
1447
-
1448
- $node = new simple_html_dom_node($this);
1449
- $node->_[WG_HDOM_INFO_BEGIN] = $this->cursor;
1450
- ++$this->cursor;
1451
- $tag = $this->copy_until($this->token_slash);
1452
- $node->tag_start = $begin_tag_pos;
1453
-
1454
- // doctype, cdata & comments...
1455
- if (isset($tag[0]) && $tag[0]==='!') {
1456
- $node->_[WG_HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until_char('>');
1457
-
1458
- if (isset($tag[2]) && $tag[1]==='-' && $tag[2]==='-') {
1459
- $node->nodetype = WG_HDOM_TYPE_COMMENT;
1460
- $node->tag = 'comment';
1461
- } else {
1462
- $node->nodetype = WG_HDOM_TYPE_UNKNOWN;
1463
- $node->tag = 'unknown';
1464
- }
1465
- if ($this->char==='>') {
1466
- $node->_[WG_HDOM_INFO_TEXT].='>';
1467
- }
1468
- $this->link_nodes($node, true);
1469
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1470
- return true;
1471
- }
1472
-
1473
- // text
1474
- if ($pos=strpos($tag, '<')!==false) {
1475
- $tag = '<' . substr($tag, 0, -1);
1476
- $node->_[WG_HDOM_INFO_TEXT] = $tag;
1477
- $this->link_nodes($node, false);
1478
- $this->char = $this->doc[--$this->pos]; // prev
1479
- return true;
1480
- }
1481
-
1482
- if (!preg_match("/^[\w-:]+$/", $tag)) {
1483
- $node->_[WG_HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until('<>');
1484
- if ($this->char==='<') {
1485
- $this->link_nodes($node, false);
1486
- return true;
1487
- }
1488
-
1489
- if ($this->char==='>') {
1490
- $node->_[WG_HDOM_INFO_TEXT].='>';
1491
- }
1492
- $this->link_nodes($node, false);
1493
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1494
- return true;
1495
- }
1496
-
1497
- // begin tag
1498
- $node->nodetype = WG_HDOM_TYPE_ELEMENT;
1499
- $tag_lower = strtolower($tag);
1500
- $node->tag = ($this->lowercase) ? $tag_lower : $tag;
1501
-
1502
- // handle optional closing tags
1503
- if (isset($this->optional_closing_tags[$tag_lower])) {
1504
- while (isset($this->optional_closing_tags[$tag_lower][strtolower($this->parent->tag)])) {
1505
- $this->parent->_[WG_HDOM_INFO_END] = 0;
1506
- $this->parent = $this->parent->parent;
1507
- }
1508
- $node->parent = $this->parent;
1509
- }
1510
-
1511
- $guard = 0; // prevent infinity loop
1512
- $space = array($this->copy_skip($this->token_blank), '', '');
1513
-
1514
- // attributes
1515
- do {
1516
- if ($this->char!==null && $space[0]==='') {
1517
- //break;
1518
- }
1519
- $name = $this->copy_until($this->token_equal);
1520
- if ($guard===$this->pos) {
1521
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1522
- continue;
1523
- }
1524
- $guard = $this->pos;
1525
-
1526
- // handle endless '<'
1527
- if ($this->pos>=$this->size-1 && $this->char!=='>') {
1528
- $node->nodetype = WG_HDOM_TYPE_TEXT;
1529
- $node->_[WG_HDOM_INFO_END] = 0;
1530
- $node->_[WG_HDOM_INFO_TEXT] = '<'.$tag . $space[0] . $name;
1531
- $node->tag = 'text';
1532
- $this->link_nodes($node, false);
1533
- return true;
1534
- }
1535
-
1536
- // handle mismatch '<'
1537
- if ($this->doc[$this->pos-1]=='<') {
1538
- $node->nodetype = WG_HDOM_TYPE_TEXT;
1539
- $node->tag = 'text';
1540
- $node->attr = array();
1541
- $node->_[WG_HDOM_INFO_END] = 0;
1542
- $node->_[WG_HDOM_INFO_TEXT] = substr($this->doc, $begin_tag_pos, $this->pos-$begin_tag_pos-1);
1543
- $this->pos -= 2;
1544
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1545
- $this->link_nodes($node, false);
1546
- return true;
1547
- }
1548
-
1549
- if ($name!=='/' && $name!=='') {
1550
- $space[1] = $this->copy_skip($this->token_blank);
1551
- $name = $this->restore_noise($name);
1552
- if ($this->lowercase) {
1553
- $name = strtolower($name);
1554
- }
1555
- if ($this->char==='=') {
1556
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1557
- $this->parse_attr($node, $name, $space);
1558
- } else {
1559
- //no value attr: nowrap, checked selected...
1560
- $node->_[WG_HDOM_INFO_QUOTE][] = WG_HDOM_QUOTE_NO;
1561
- $node->attr[$name] = true;
1562
- if ($this->char!='>') {
1563
- $this->char = $this->doc[--$this->pos];
1564
- } // prev
1565
- }
1566
- $node->_[WG_HDOM_INFO_SPACE][] = $space;
1567
- $space = array($this->copy_skip($this->token_blank), '', '');
1568
- } else {
1569
- break;
1570
- }
1571
- } while ($this->char!=='>' && $this->char!=='/');
1572
-
1573
- $this->link_nodes($node, true);
1574
- $node->_[WG_HDOM_INFO_ENDSPACE] = $space[0];
1575
-
1576
- // check self closing
1577
- if ($this->copy_until_char_escape('>')==='/') {
1578
- $node->_[WG_HDOM_INFO_ENDSPACE] .= '/';
1579
- $node->_[WG_HDOM_INFO_END] = 0;
1580
- } else {
1581
- // reset parent
1582
- if (!isset($this->self_closing_tags[strtolower($node->tag)])) {
1583
- $this->parent = $node;
1584
- }
1585
- }
1586
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1587
-
1588
- // If it's a BR tag, we need to set it's text to the default text.
1589
- // This way when we see it in plaintext, we can generate formatting that the user wants.
1590
- // since a br tag never has sub nodes, this works well.
1591
- if ($node->tag == "br") {
1592
- $node->_[WG_HDOM_INFO_INNER] = $this->WG_DEFAULT_BR_TEXT;
1593
- }
1594
-
1595
- return true;
1596
- }
1597
-
1598
- // parse attributes
1599
- protected function parse_attr($node, $name, &$space)
1600
- {
1601
- // Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037
1602
- // If the attribute is already defined inside a tag, only pay atetntion to the first one as opposed to the last one.
1603
- if (isset($node->attr[$name])) {
1604
- return;
1605
- }
1606
-
1607
- $space[2] = $this->copy_skip($this->token_blank);
1608
- switch ($this->char) {
1609
- case '"':
1610
- $node->_[WG_HDOM_INFO_QUOTE][] = WG_HDOM_QUOTE_DOUBLE;
1611
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1612
- $node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('"'));
1613
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1614
- break;
1615
- case '\'':
1616
- $node->_[WG_HDOM_INFO_QUOTE][] = WG_HDOM_QUOTE_SINGLE;
1617
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1618
- $node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('\''));
1619
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1620
- break;
1621
- default:
1622
- $node->_[WG_HDOM_INFO_QUOTE][] = WG_HDOM_QUOTE_NO;
1623
- $node->attr[$name] = $this->restore_noise($this->copy_until($this->token_attr));
1624
- }
1625
- // PaperG: Attributes should not have \r or \n in them, that counts as html whitespace.
1626
- $node->attr[$name] = str_replace("\r", "", $node->attr[$name]);
1627
- $node->attr[$name] = str_replace("\n", "", $node->attr[$name]);
1628
- // PaperG: If this is a "class" selector, lets get rid of the preceeding and trailing space since some people leave it in the multi class case.
1629
- if ($name == "class") {
1630
- $node->attr[$name] = trim($node->attr[$name]);
1631
- }
1632
- }
1633
-
1634
- // link node's parent
1635
- protected function link_nodes(&$node, $is_child)
1636
- {
1637
- $node->parent = $this->parent;
1638
- $this->parent->nodes[] = $node;
1639
- if ($is_child) {
1640
- $this->parent->children[] = $node;
1641
- }
1642
- }
1643
-
1644
- // as a text node
1645
- protected function as_text_node($tag)
1646
- {
1647
- $node = new simple_html_dom_node($this);
1648
- ++$this->cursor;
1649
- $node->_[WG_HDOM_INFO_TEXT] = '</' . $tag . '>';
1650
- $this->link_nodes($node, false);
1651
- $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1652
- return true;
1653
- }
1654
-
1655
- protected function skip($chars)
1656
- {
1657
- $this->pos += strspn($this->doc, $chars, $this->pos);
1658
- $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1659
- }
1660
-
1661
- protected function copy_skip($chars)
1662
- {
1663
- $pos = $this->pos;
1664
- $len = strspn($this->doc, $chars, $pos);
1665
- $this->pos += $len;
1666
- $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1667
- if ($len===0) {
1668
- return '';
1669
- }
1670
- return substr($this->doc, $pos, $len);
1671
- }
1672
-
1673
- protected function copy_until($chars)
1674
- {
1675
- $pos = $this->pos;
1676
- $len = strcspn($this->doc, $chars, $pos);
1677
- $this->pos += $len;
1678
- $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1679
- return substr($this->doc, $pos, $len);
1680
- }
1681
-
1682
- protected function copy_until_char($char)
1683
- {
1684
- if ($this->char===null) {
1685
- return '';
1686
- }
1687
-
1688
- if (($pos = strpos($this->doc, $char, $this->pos))===false) {
1689
- $ret = substr($this->doc, $this->pos, $this->size-$this->pos);
1690
- $this->char = null;
1691
- $this->pos = $this->size;
1692
- return $ret;
1693
- }
1694
-
1695
- if ($pos===$this->pos) {
1696
- return '';
1697
- }
1698
- $pos_old = $this->pos;
1699
- $this->char = $this->doc[$pos];
1700
- $this->pos = $pos;
1701
- return substr($this->doc, $pos_old, $pos-$pos_old);
1702
- }
1703
-
1704
- protected function copy_until_char_escape($char)
1705
- {
1706
- if ($this->char===null) {
1707
- return '';
1708
- }
1709
-
1710
- $start = $this->pos;
1711
- while (1) {
1712
- if (($pos = strpos($this->doc, $char, $start))===false) {
1713
- $ret = substr($this->doc, $this->pos, $this->size-$this->pos);
1714
- $this->char = null;
1715
- $this->pos = $this->size;
1716
- return $ret;
1717
- }
1718
-
1719
- if ($pos===$this->pos) {
1720
- return '';
1721
- }
1722
-
1723
- if ($this->doc[$pos-1]==='\\') {
1724
- $start = $pos+1;
1725
- continue;
1726
- }
1727
-
1728
- $pos_old = $this->pos;
1729
- $this->char = $this->doc[$pos];
1730
- $this->pos = $pos;
1731
- return substr($this->doc, $pos_old, $pos-$pos_old);
1732
- }
1733
- }
1734
-
1735
- // remove noise from html content
1736
- // save the noise in the $this->noise array.
1737
- protected function remove_noise($pattern, $remove_tag=false)
1738
- {
1739
- global $debugObject;
1740
- if (is_object($debugObject)) {
1741
- $debugObject->debugLogEntry(1);
1742
- }
1743
-
1744
- $count = preg_match_all($pattern, $this->doc, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE);
1745
-
1746
- for ($i=$count-1; $i>-1; --$i) {
1747
- $key = '___noise___'.sprintf('% 5d', count($this->noise)+1000);
1748
- if (is_object($debugObject)) {
1749
- $debugObject->debugLog(2, 'key is: ' . $key);
1750
- }
1751
- $idx = ($remove_tag) ? 0 : 1;
1752
- $this->noise[$key] = $matches[$i][$idx][0];
1753
- $this->doc = substr_replace($this->doc, $key, $matches[$i][$idx][1], strlen($matches[$i][$idx][0]));
1754
- }
1755
-
1756
- // reset the length of content
1757
- $this->size = strlen($this->doc);
1758
- if ($this->size>0) {
1759
- $this->char = $this->doc[0];
1760
- }
1761
- }
1762
-
1763
- // restore noise to html content
1764
- public function restore_noise($text)
1765
- {
1766
- global $debugObject;
1767
- if (is_object($debugObject)) {
1768
- $debugObject->debugLogEntry(1);
1769
- }
1770
-
1771
- while (($pos=strpos($text, '___noise___'))!==false) {
1772
- // Sometimes there is a broken piece of markup, and we don't GET the pos+11 etc... token which indicates a problem outside of us...
1773
- if (strlen($text) > $pos+15) {
1774
- $key = '___noise___'.$text[$pos+11].$text[$pos+12].$text[$pos+13].$text[$pos+14].$text[$pos+15];
1775
- if (is_object($debugObject)) {
1776
- $debugObject->debugLog(2, 'located key of: ' . $key);
1777
- }
1778
-
1779
- if (isset($this->noise[$key])) {
1780
- $text = substr($text, 0, $pos).$this->noise[$key].substr($text, $pos+16);
1781
- } else {
1782
- // do this to prevent an infinite loop.
1783
- $text = substr($text, 0, $pos).'UNDEFINED NOISE FOR KEY: '.$key . substr($text, $pos+16);
1784
- }
1785
- } else {
1786
- // There is no valid key being given back to us... We must get rid of the ___noise___ or we will have a problem.
1787
- $text = substr($text, 0, $pos).'NO NUMERIC NOISE KEY' . substr($text, $pos+11);
1788
- }
1789
- }
1790
- return $text;
1791
- }
1792
-
1793
- // Sometimes we NEED one of the noise elements.
1794
- public function search_noise($text)
1795
- {
1796
- global $debugObject;
1797
- if (is_object($debugObject)) {
1798
- $debugObject->debugLogEntry(1);
1799
- }
1800
-
1801
- foreach ($this->noise as $noiseElement) {
1802
- if (strpos($noiseElement, $text)!==false) {
1803
- return $noiseElement;
1804
- }
1805
- }
1806
- }
1807
- public function __toString()
1808
- {
1809
- return $this->root->innertext();
1810
- }
1811
-
1812
- public function __get($name)
1813
- {
1814
- switch ($name) {
1815
- case 'outertext':
1816
- return $this->root->innertext();
1817
- case 'innertext':
1818
- return $this->root->innertext();
1819
- case 'plaintext':
1820
- return $this->root->text();
1821
- case 'charset':
1822
- return $this->_charset;
1823
- case 'target_charset':
1824
- return $this->_target_charset;
1825
- }
1826
- }
1827
-
1828
- // camel naming conventions
1829
- public function childNodes($idx=-1)
1830
- {
1831
- return $this->root->childNodes($idx);
1832
- }
1833
- public function firstChild()
1834
- {
1835
- return $this->root->first_child();
1836
- }
1837
- public function lastChild()
1838
- {
1839
- return $this->root->last_child();
1840
- }
1841
- public function createElement($name, $value=null)
1842
- {
1843
- return @str_get_html("<$name>$value</$name>")->first_child();
1844
- }
1845
- public function createTextNode($value)
1846
- {
1847
- return @end(str_get_html($value)->nodes);
1848
- }
1849
- public function getElementById($id)
1850
- {
1851
- return $this->find("#$id", 0);
1852
- }
1853
- public function getElementsById($id, $idx=null)
1854
- {
1855
- return $this->find("#$id", $idx);
1856
- }
1857
- public function getElementByTagName($name)
1858
- {
1859
- return $this->find($name, 0);
1860
- }
1861
- public function getElementsByTagName($name, $idx=-1)
1862
- {
1863
- return $this->find($name, $idx);
1864
- }
1865
- public function loadFile()
1866
- {
1867
- $args = func_get_args();
1868
- $this->load_file($args);
1869
- }
1870
- }
1871
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SimpleHtmlDom;
4
+
5
+ /**
6
+ * Website: http://sourceforge.net/projects/simplehtmldom/
7
+ * Acknowledge: Jose Solorzano (https://sourceforge.net/projects/php-html/)
8
+ * Contributions by:
9
+ * Yousuke Kumakura (Attribute filters)
10
+ * Vadim Voituk (Negative indexes supports of "find" method)
11
+ * Antcs (Constructor with automatically load contents either text or file/url)
12
+ *
13
+ * all affected sections have comments starting with "PaperG"
14
+ *
15
+ * Paperg - Added case insensitive testing of the value of the selector.
16
+ * Paperg - Added tag_start for the starting index of tags - NOTE: This works but not accurately.
17
+ * This tag_start gets counted AFTER \r\n have been crushed out, and after the remove_noice calls so it will not reflect the REAL position of the tag in the source,
18
+ * it will almost always be smaller by some amount.
19
+ * We use this to determine how far into the file the tag in question is. This "percentage will never be accurate as the $dom->size is the "real" number of bytes the dom was created from.
20
+ * but for most purposes, it's a really good estimation.
21
+ * Paperg - Added the forceTagsClosed to the dom constructor. Forcing tags closed is great for malformed html, but it CAN lead to parsing errors.
22
+ * Allow the user to tell us how much they trust the html.
23
+ * Paperg add the text and plaintext to the selectors for the find syntax. plaintext implies text in the innertext of a node. text implies that the tag is a text node.
24
+ * This allows for us to find tags based on the text they contain.
25
+ * Create find_ancestor_tag to see if a tag is - at any level - inside of another specific tag.
26
+ * Paperg: added parse_charset so that we know about the character set of the source document.
27
+ * NOTE: If the user's system has a routine called get_last_retrieve_url_contents_content_type availalbe, we will assume it's returning the content-type header from the
28
+ * last transfer or curl_exec, and we will parse that and use it in preference to any other method of charset detection.
29
+ *
30
+ * Found infinite loop in the case of broken html in restore_noise. Rewrote to protect from that.
31
+ * PaperG (John Schlick) Added get_display_size for "IMG" tags.
32
+ *
33
+ * Licensed under The MIT License
34
+ * Redistributions of files must retain the above copyright notice.
35
+ *
36
+ * @author S.C. Chen <me578022@gmail.com>
37
+ * @author John Schlick
38
+ * @author Rus Carroll
39
+ * @version 1.5 ($Rev: 196 $)
40
+ * @package PlaceLocalInclude
41
+ * @subpackage simple_html_dom
42
+ */
43
+
44
+ /**
45
+ * All of the Defines for the classes below.
46
+ * @author S.C. Chen <me578022@gmail.com>
47
+ */
48
+ define('HDOM_TYPE_ELEMENT', 1);
49
+ define('HDOM_TYPE_COMMENT', 2);
50
+ define('HDOM_TYPE_TEXT', 3);
51
+ define('HDOM_TYPE_ENDTAG', 4);
52
+ define('HDOM_TYPE_ROOT', 5);
53
+ define('HDOM_TYPE_UNKNOWN', 6);
54
+ define('HDOM_QUOTE_DOUBLE', 0);
55
+ define('HDOM_QUOTE_SINGLE', 1);
56
+ define('HDOM_QUOTE_NO', 3);
57
+ define('HDOM_INFO_BEGIN', 0);
58
+ define('HDOM_INFO_END', 1);
59
+ define('HDOM_INFO_QUOTE', 2);
60
+ define('HDOM_INFO_SPACE', 3);
61
+ define('HDOM_INFO_TEXT', 4);
62
+ define('HDOM_INFO_INNER', 5);
63
+ define('HDOM_INFO_OUTER', 6);
64
+ define('HDOM_INFO_ENDSPACE', 7);
65
+ define('DEFAULT_TARGET_CHARSET', 'UTF-8');
66
+ define('DEFAULT_BR_TEXT', "\r\n");
67
+ define('DEFAULT_SPAN_TEXT', " ");
68
+ define('MAX_FILE_SIZE', 100000000);
69
+ // helper functions
70
+ // -----------------------------------------------------------------------------
71
+ // get html dom from file
72
+ // $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1.
73
+ function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
74
+ {
75
+ // We DO force the tags to be terminated.
76
+ $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
77
+ // For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done.
78
+ $contents = file_get_contents($url, $use_include_path, $context, $offset);
79
+ // Paperg - use our own mechanism for getting the contents as we want to control the timeout.
80
+ //$contents = retrieve_url_contents($url);
81
+ if (empty($contents) || strlen($contents) > MAX_FILE_SIZE) {
82
+ return false;
83
+ }
84
+ // The second parameter can force the selectors to all be lowercase.
85
+ $dom->load($contents, $lowercase, $stripRN);
86
+ return $dom;
87
+ }
88
+
89
+ // get html dom from string
90
+ function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
91
+ {
92
+ $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
93
+ if (empty($str) || strlen($str) > MAX_FILE_SIZE) {
94
+ $dom->clear();
95
+ return false;
96
+ }
97
+ $dom->load($str, $lowercase, $stripRN);
98
+ return $dom;
99
+ }
100
+
101
+ // dump html dom tree
102
+ function dump_html_tree($node, $show_attr=true, $deep=0)
103
+ {
104
+ $node->dump($node);
105
+ }
106
+
107
+
108
+ /**
109
+ * simple html dom node
110
+ * PaperG - added ability for "find" routine to lowercase the value of the selector.
111
+ * PaperG - added $tag_start to track the start position of the tag in the total byte index
112
+ *
113
+ * @package PlaceLocalInclude
114
+ */
115
+ class simple_html_dom_node
116
+ {
117
+ public $nodetype = HDOM_TYPE_TEXT;
118
+ public $tag = 'text';
119
+ public $attr = array();
120
+ public $children = array();
121
+ public $nodes = array();
122
+ public $parent = null;
123
+ // The "info" array - see HDOM_INFO_... for what each element contains.
124
+ public $_ = array();
125
+ public $tag_start = 0;
126
+ private $dom = null;
127
+
128
+ public function __construct($dom)
129
+ {
130
+ $this->dom = $dom;
131
+ $dom->nodes[] = $this;
132
+ }
133
+
134
+ public function __destruct()
135
+ {
136
+ $this->clear();
137
+ }
138
+
139
+ public function __toString()
140
+ {
141
+ return $this->outertext();
142
+ }
143
+
144
+ // clean up memory due to php5 circular references memory leak...
145
+ public function clear()
146
+ {
147
+ $this->dom = null;
148
+ $this->nodes = null;
149
+ $this->parent = null;
150
+ $this->children = null;
151
+ }
152
+
153
+ // dump node's tree
154
+ public function dump($show_attr=true, $deep=0)
155
+ {
156
+ $lead = str_repeat(' ', $deep);
157
+
158
+ echo $lead.$this->tag;
159
+ if ($show_attr && count($this->attr)>0) {
160
+ echo '(';
161
+ foreach ($this->attr as $k=>$v) {
162
+ echo "[$k]=>\"".$this->$k.'", ';
163
+ }
164
+ echo ')';
165
+ }
166
+ echo "\n";
167
+
168
+ if ($this->nodes) {
169
+ foreach ($this->nodes as $c) {
170
+ $c->dump($show_attr, $deep+1);
171
+ }
172
+ }
173
+ }
174
+
175
+
176
+ // Debugging function to dump a single dom node with a bunch of information about it.
177
+ public function dump_node($echo=true)
178
+ {
179
+ $string = $this->tag;
180
+ if (count($this->attr)>0) {
181
+ $string .= '(';
182
+ foreach ($this->attr as $k=>$v) {
183
+ $string .= "[$k]=>\"".$this->$k.'", ';
184
+ }
185
+ $string .= ')';
186
+ }
187
+ if (count($this->_)>0) {
188
+ $string .= ' $_ (';
189
+ foreach ($this->_ as $k=>$v) {
190
+ if (is_array($v)) {
191
+ $string .= "[$k]=>(";
192
+ foreach ($v as $k2=>$v2) {
193
+ $string .= "[$k2]=>\"".$v2.'", ';
194
+ }
195
+ $string .= ")";
196
+ } else {
197
+ $string .= "[$k]=>\"".$v.'", ';
198
+ }
199
+ }
200
+ $string .= ")";
201
+ }
202
+
203
+ if (isset($this->text)) {
204
+ $string .= " text: (" . $this->text . ")";
205
+ }
206
+
207
+ $string .= " HDOM_INNER_INFO: '";
208
+ if (isset($node->_[HDOM_INFO_INNER])) {
209
+ $string .= $node->_[HDOM_INFO_INNER] . "'";
210
+ } else {
211
+ $string .= ' NULL ';
212
+ }
213
+
214
+ $string .= " children: " . count($this->children);
215
+ $string .= " nodes: " . count($this->nodes);
216
+ $string .= " tag_start: " . $this->tag_start;
217
+ $string .= "\n";
218
+
219
+ if ($echo) {
220
+ echo $string;
221
+ return;
222
+ } else {
223
+ return $string;
224
+ }
225
+ }
226
+
227
+ // returns the parent of node
228
+ // If a node is passed in, it will reset the parent of the current node to that one.
229
+ public function parent($parent=null)
230
+ {
231
+ // I am SURE that this doesn't work properly.
232
+ // It fails to unset the current node from it's current parents nodes or children list first.
233
+ if ($parent !== null) {
234
+ $this->parent = $parent;
235
+ $this->parent->nodes[] = $this;
236
+ $this->parent->children[] = $this;
237
+ }
238
+
239
+ return $this->parent;
240
+ }
241
+
242
+ // verify that node has children
243
+ public function has_child()
244
+ {
245
+ return !empty($this->children);
246
+ }
247
+
248
+ // returns children of node
249
+ public function children($idx=-1)
250
+ {
251
+ if ($idx===-1) {
252
+ return $this->children;
253
+ }
254
+ if (isset($this->children[$idx])) {
255
+ return $this->children[$idx];
256
+ }
257
+ return null;
258
+ }
259
+
260
+ // returns the first child of node
261
+ public function first_child()
262
+ {
263
+ if (count($this->children)>0) {
264
+ return $this->children[0];
265
+ }
266
+ return null;
267
+ }
268
+
269
+ // returns the last child of node
270
+ public function last_child()
271
+ {
272
+ if (($count=count($this->children))>0) {
273
+ return $this->children[$count-1];
274
+ }
275
+ return null;
276
+ }
277
+
278
+ // returns the next sibling of node
279
+ public function next_sibling()
280
+ {
281
+ if ($this->parent===null) {
282
+ return null;
283
+ }
284
+
285
+ $idx = 0;
286
+ $count = count($this->parent->children);
287
+ while ($idx<$count && $this!==$this->parent->children[$idx]) {
288
+ ++$idx;
289
+ }
290
+ if (++$idx>=$count) {
291
+ return null;
292
+ }
293
+ return $this->parent->children[$idx];
294
+ }
295
+
296
+ // returns the previous sibling of node
297
+ public function prev_sibling()
298
+ {
299
+ if ($this->parent===null) {
300
+ return null;
301
+ }
302
+ $idx = 0;
303
+ $count = count($this->parent->children);
304
+ while ($idx<$count && $this!==$this->parent->children[$idx]) {
305
+ ++$idx;
306
+ }
307
+ if (--$idx<0) {
308
+ return null;
309
+ }
310
+ return $this->parent->children[$idx];
311
+ }
312
+
313
+ // function to locate a specific ancestor tag in the path to the root.
314
+ public function find_ancestor_tag($tag)
315
+ {
316
+ global $debugObject;
317
+ if (is_object($debugObject)) {
318
+ $debugObject->debugLogEntry(1);
319
+ }
320
+
321
+ // Start by including ourselves in the comparison.
322
+ $returnDom = $this;
323
+
324
+ while (!is_null($returnDom)) {
325
+ if (is_object($debugObject)) {
326
+ $debugObject->debugLog(2, "Current tag is: " . $returnDom->tag);
327
+ }
328
+
329
+ if ($returnDom->tag == $tag) {
330
+ break;
331
+ }
332
+ $returnDom = $returnDom->parent;
333
+ }
334
+ return $returnDom;
335
+ }
336
+
337
+ // get dom node's inner html
338
+ public function innertext()
339
+ {
340
+ if (isset($this->_[HDOM_INFO_INNER])) {
341
+ return $this->_[HDOM_INFO_INNER];
342
+ }
343
+ if (isset($this->_[HDOM_INFO_TEXT])) {
344
+ return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
345
+ }
346
+
347
+ $ret = '';
348
+ foreach ($this->nodes as $n) {
349
+ $ret .= $n->outertext();
350
+ }
351
+ return $ret;
352
+ }
353
+
354
+ // get dom node's outer text (with tag)
355
+ public function outertext()
356
+ {
357
+ global $debugObject;
358
+ if (is_object($debugObject)) {
359
+ $text = '';
360
+ if ($this->tag == 'text') {
361
+ if (!empty($this->text)) {
362
+ $text = " with text: " . $this->text;
363
+ }
364
+ }
365
+ $debugObject->debugLog(1, 'Innertext of tag: ' . $this->tag . $text);
366
+ }
367
+
368
+ if ($this->tag==='root') {
369
+ return $this->innertext();
370
+ }
371
+
372
+ // trigger callback
373
+ if ($this->dom && $this->dom->callback!==null) {
374
+ call_user_func_array($this->dom->callback, array($this));
375
+ }
376
+
377
+ if (isset($this->_[HDOM_INFO_OUTER])) {
378
+ return $this->_[HDOM_INFO_OUTER];
379
+ }
380
+ if (isset($this->_[HDOM_INFO_TEXT])) {
381
+ return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
382
+ }
383
+
384
+ // render begin tag
385
+ if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]) {
386
+ $ret = $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]->makeup();
387
+ } else {
388
+ $ret = "";
389
+ }
390
+
391
+ // render inner text
392
+ if (isset($this->_[HDOM_INFO_INNER])) {
393
+ // If it's a br tag... don't return the HDOM_INNER_INFO that we may or may not have added.
394
+ if ($this->tag != "br") {
395
+ $ret .= $this->_[HDOM_INFO_INNER];
396
+ }
397
+ } else {
398
+ if ($this->nodes) {
399
+ foreach ($this->nodes as $n) {
400
+ $ret .= $this->convert_text($n->outertext());
401
+ }
402
+ }
403
+ }
404
+
405
+ // render end tag
406
+ if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END]!=0) {
407
+ $ret .= '</'.$this->tag.'>';
408
+ }
409
+ return $ret;
410
+ }
411
+
412
+ // get dom node's plain text
413
+ public function text()
414
+ {
415
+ if (isset($this->_[HDOM_INFO_INNER])) {
416
+ return $this->_[HDOM_INFO_INNER];
417
+ }
418
+ switch ($this->nodetype) {
419
+ case HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
420
+ case HDOM_TYPE_COMMENT: return '';
421
+ case HDOM_TYPE_UNKNOWN: return '';
422
+ }
423
+ if (strcasecmp($this->tag, 'script')===0) {
424
+ return '';
425
+ }
426
+ if (strcasecmp($this->tag, 'style')===0) {
427
+ return '';
428
+ }
429
+
430
+ $ret = '';
431
+ // In rare cases, (always node type 1 or HDOM_TYPE_ELEMENT - observed for some span tags, and some p tags) $this->nodes is set to NULL.
432
+ // NOTE: This indicates that there is a problem where it's set to NULL without a clear happening.
433
+ // WHY is this happening?
434
+ if (!is_null($this->nodes)) {
435
+ foreach ($this->nodes as $n) {
436
+ $ret .= $this->convert_text($n->text());
437
+ }
438
+
439
+ // If this node is a span... add a space at the end of it so multiple spans don't run into each other. This is plaintext after all.
440
+ if ($this->tag == "span") {
441
+ $ret .= $this->dom->DEFAULT_SPAN_TEXT;
442
+ }
443
+ }
444
+ return $ret;
445
+ }
446
+
447
+ public function xmltext()
448
+ {
449
+ $ret = $this->innertext();
450
+ $ret = str_ireplace('<![CDATA[', '', $ret);
451
+ $ret = str_replace(']]>', '', $ret);
452
+ return $ret;
453
+ }
454
+
455
+ // build node's text with tag
456
+ public function makeup()
457
+ {
458
+ // text, comment, unknown
459
+ if (isset($this->_[HDOM_INFO_TEXT])) {
460
+ return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
461
+ }
462
+
463
+ $ret = '<'.$this->tag;
464
+ $i = -1;
465
+
466
+ foreach ($this->attr as $key=>$val) {
467
+ ++$i;
468
+
469
+ // skip removed attribute
470
+ if ($val===null || $val===false) {
471
+ continue;
472
+ }
473
+
474
+ $ret .= $this->_[HDOM_INFO_SPACE][$i][0];
475
+ //no value attr: nowrap, checked selected...
476
+ if ($val===true) {
477
+ $ret .= $key;
478
+ } else {
479
+ switch ($this->_[HDOM_INFO_QUOTE][$i]) {
480
+ case HDOM_QUOTE_DOUBLE: $quote = '"'; break;
481
+ case HDOM_QUOTE_SINGLE: $quote = '\''; break;
482
+ default: $quote = '';
483
+ }
484
+ $ret .= $key.$this->_[HDOM_INFO_SPACE][$i][1].'='.$this->_[HDOM_INFO_SPACE][$i][2].$quote.$val.$quote;
485
+ }
486
+ }
487
+ $ret = $this->dom->restore_noise($ret);
488
+ return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>';
489
+ }
490
+
491
+ // find elements by css selector
492
+ //PaperG - added ability for find to lowercase the value of the selector.
493
+ public function find($selector, $idx=null, $lowercase=false)
494
+ {
495
+ $selectors = $this->parse_selector($selector);
496
+ if (($count=count($selectors))===0) {
497
+ return array();
498
+ }
499
+ $found_keys = array();
500
+
501
+ // find each selector
502
+ for ($c=0; $c<$count; ++$c) {
503
+ // The change on the below line was documented on the sourceforge code tracker id 2788009
504
+ // used to be: if (($levle=count($selectors[0]))===0) return array();
505
+ if (($levle=count($selectors[$c]))===0) {
506
+ return array();
507
+ }
508
+ if (!isset($this->_[HDOM_INFO_BEGIN])) {
509
+ return array();
510
+ }
511
+
512
+ $head = array($this->_[HDOM_INFO_BEGIN]=>1);
513
+
514
+ // handle descendant selectors, no recursive!
515
+ for ($l=0; $l<$levle; ++$l) {
516
+ $ret = array();
517
+ foreach ($head as $k=>$v) {
518
+ $n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k];
519
+ //PaperG - Pass this optional parameter on to the seek function.
520
+ $n->seek($selectors[$c][$l], $ret, $lowercase);
521
+ }
522
+ $head = $ret;
523
+ }
524
+
525
+ foreach ($head as $k=>$v) {
526
+ if (!isset($found_keys[$k])) {
527
+ $found_keys[$k] = 1;
528
+ }
529
+ }
530
+ }
531
+
532
+ // sort keys
533
+ ksort($found_keys);
534
+
535
+ $found = array();
536
+ foreach ($found_keys as $k=>$v) {
537
+ $found[] = $this->dom->nodes[$k];
538
+ }
539
+
540
+ // return nth-element or array
541
+ if (is_null($idx)) {
542
+ return $found;
543
+ } elseif ($idx<0) {
544
+ $idx = count($found) + $idx;
545
+ }
546
+ return (isset($found[$idx])) ? $found[$idx] : null;
547
+ }
548
+
549
+ // seek for given conditions
550
+ // PaperG - added parameter to allow for case insensitive testing of the value of a selector.
551
+ protected function seek($selector, &$ret, $lowercase=false)
552
+ {
553
+ global $debugObject;
554
+ if (is_object($debugObject)) {
555
+ $debugObject->debugLogEntry(1);
556
+ }
557
+
558
+ list($tag, $key, $val, $exp, $no_key) = $selector;
559
+
560
+ // xpath index
561
+ if ($tag && $key && is_numeric($key)) {
562
+ $count = 0;
563
+ foreach ($this->children as $c) {
564
+ if ($tag==='*' || $tag===$c->tag) {
565
+ if (++$count==$key) {
566
+ $ret[$c->_[HDOM_INFO_BEGIN]] = 1;
567
+ return;
568
+ }
569
+ }
570
+ }
571
+ return;
572
+ }
573
+
574
+ $end = (!empty($this->_[HDOM_INFO_END])) ? $this->_[HDOM_INFO_END] : 0;
575
+ if ($end==0) {
576
+ $parent = $this->parent;
577
+ while (!isset($parent->_[HDOM_INFO_END]) && $parent!==null) {
578
+ $end -= 1;
579
+ $parent = $parent->parent;
580
+ }
581
+ $end += $parent->_[HDOM_INFO_END];
582
+ }
583
+
584
+ for ($i=$this->_[HDOM_INFO_BEGIN]+1; $i<$end; ++$i) {
585
+ $node = $this->dom->nodes[$i];
586
+
587
+ $pass = true;
588
+
589
+ if ($tag==='*' && !$key) {
590
+ if (in_array($node, $this->children, true)) {
591
+ $ret[$i] = 1;
592
+ }
593
+ continue;
594
+ }
595
+
596
+ // compare tag
597
+ if ($tag && $tag!=$node->tag && $tag!=='*') {
598
+ $pass=false;
599
+ }
600
+ // compare key
601
+ if ($pass && $key) {
602
+ if ($no_key) {
603
+ if (isset($node->attr[$key])) {
604
+ $pass=false;
605
+ }
606
+ } else {
607
+ if (($key != "plaintext") && !isset($node->attr[$key])) {
608
+ $pass=false;
609
+ }
610
+ }
611
+ }
612
+ // compare value
613
+ if ($pass && $key && $val && $val!=='*') {
614
+ // If they have told us that this is a "plaintext" search then we want the plaintext of the node - right?
615
+ if ($key == "plaintext") {
616
+ // $node->plaintext actually returns $node->text();
617
+ $nodeKeyValue = $node->text();
618
+ } else {
619
+ // this is a normal search, we want the value of that attribute of the tag.
620
+ $nodeKeyValue = $node->attr[$key];
621
+ }
622
+ if (is_object($debugObject)) {
623
+ $debugObject->debugLog(2, "testing node: " . $node->tag . " for attribute: " . $key . $exp . $val . " where nodes value is: " . $nodeKeyValue);
624
+ }
625
+
626
+ //PaperG - If lowercase is set, do a case insensitive test of the value of the selector.
627
+ if ($lowercase) {
628
+ $check = $this->match($exp, strtolower($val), strtolower($nodeKeyValue));
629
+ } else {
630
+ $check = $this->match($exp, $val, $nodeKeyValue);
631
+ }
632
+ if (is_object($debugObject)) {
633
+ $debugObject->debugLog(2, "after match: " . ($check ? "true" : "false"));
634
+ }
635
+
636
+ // handle multiple class
637
+ if (!$check && strcasecmp($key, 'class')===0) {
638
+ foreach (explode(' ', $node->attr[$key]) as $k) {
639
+ // Without this, there were cases where leading, trailing, or double spaces lead to our comparing blanks - bad form.
640
+ if (!empty($k)) {
641
+ if ($lowercase) {
642
+ $check = $this->match($exp, strtolower($val), strtolower($k));
643
+ } else {
644
+ $check = $this->match($exp, $val, $k);
645
+ }
646
+ if ($check) {
647
+ break;
648
+ }
649
+ }
650
+ }
651
+ }
652
+ if (!$check) {
653
+ $pass = false;
654
+ }
655
+ }
656
+ if ($pass) {
657
+ $ret[$i] = 1;
658
+ }
659
+ unset($node);
660
+ }
661
+ // It's passed by reference so this is actually what this function returns.
662
+ if (is_object($debugObject)) {
663
+ $debugObject->debugLog(1, "EXIT - ret: ", $ret);
664
+ }
665
+ }
666
+
667
+ protected function match($exp, $pattern, $value)
668
+ {
669
+ global $debugObject;
670
+ if (is_object($debugObject)) {
671
+ $debugObject->debugLogEntry(1);
672
+ }
673
+
674
+ switch ($exp) {
675
+ case '=':
676
+ return ($value===$pattern);
677
+ case '!=':
678
+ return ($value!==$pattern);
679
+ case '^=':
680
+ return preg_match("/^".preg_quote($pattern, '/')."/", $value);
681
+ case '$=':
682
+ return preg_match("/".preg_quote($pattern, '/')."$/", $value);
683
+ case '*=':
684
+ if ($pattern[0]=='/') {
685
+ return preg_match($pattern, $value);
686
+ }
687
+ return preg_match("/".$pattern."/i", $value);
688
+ }
689
+ return false;
690
+ }
691
+
692
+ protected function parse_selector($selector_string)
693
+ {
694
+ global $debugObject;
695
+ if (is_object($debugObject)) {
696
+ $debugObject->debugLogEntry(1);
697
+ }
698
+
699
+ // pattern of CSS selectors, modified from mootools
700
+ // Paperg: Add the colon to the attrbute, so that it properly finds <tag attr:ibute="something" > like google does.
701
+ // Note: if you try to look at this attribute, yo MUST use getAttribute since $dom->x:y will fail the php syntax check.
702
+ // Notice the \[ starting the attbute? and the @? following? This implies that an attribute can begin with an @ sign that is not captured.
703
+ // This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression.
704
+ // farther study is required to determine of this should be documented or removed.
705
+ // $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
706
+ $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
707
+ preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER);
708
+ if (is_object($debugObject)) {
709
+ $debugObject->debugLog(2, "Matches Array: ", $matches);
710
+ }
711
+
712
+ $selectors = array();
713
+ $result = array();
714
+ //print_r($matches);
715
+
716
+ foreach ($matches as $m) {
717
+ $m[0] = trim($m[0]);
718
+ if ($m[0]==='' || $m[0]==='/' || $m[0]==='//') {
719
+ continue;
720
+ }
721
+ // for browser generated xpath
722
+ if ($m[1]==='tbody') {
723
+ continue;
724
+ }
725
+
726
+ list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false);
727
+ if (!empty($m[2])) {
728
+ $key='id';
729
+ $val=$m[2];
730
+ }
731
+ if (!empty($m[3])) {
732
+ $key='class';
733
+ $val=$m[3];
734
+ }
735
+ if (!empty($m[4])) {
736
+ $key=$m[4];
737
+ }
738
+ if (!empty($m[5])) {
739
+ $exp=$m[5];
740
+ }
741
+ if (!empty($m[6])) {
742
+ $val=$m[6];
743
+ }
744
+
745
+ // convert to lowercase
746
+ if ($this->dom->lowercase) {
747
+ $tag=strtolower($tag);
748
+ $key=strtolower($key);
749
+ }
750
+ //elements that do NOT have the specified attribute
751
+ if (isset($key[0]) && $key[0]==='!') {
752
+ $key=substr($key, 1);
753
+ $no_key=true;
754
+ }
755
+
756
+ $result[] = array($tag, $key, $val, $exp, $no_key);
757
+ if (trim($m[7])===',') {
758
+ $selectors[] = $result;
759
+ $result = array();
760
+ }
761
+ }
762
+ if (count($result)>0) {
763
+ $selectors[] = $result;
764
+ }
765
+ return $selectors;
766
+ }
767
+
768
+ public function __get($name)
769
+ {
770
+ if (isset($this->attr[$name])) {
771
+ return $this->convert_text($this->attr[$name]);
772
+ }
773
+ switch ($name) {
774
+ case 'outertext': return $this->outertext();
775
+ case 'innertext': return $this->innertext();
776
+ case 'plaintext': return $this->text();
777
+ case 'xmltext': return $this->xmltext();
778
+ default: return array_key_exists($name, $this->attr);
779
+ }
780
+ }
781
+
782
+ public function __set($name, $value)
783
+ {
784
+ switch ($name) {
785
+ case 'outertext': return $this->_[HDOM_INFO_OUTER] = $value;
786
+ case 'innertext':
787
+ if (isset($this->_[HDOM_INFO_TEXT])) {
788
+ return $this->_[HDOM_INFO_TEXT] = $value;
789
+ }
790
+ return $this->_[HDOM_INFO_INNER] = $value;
791
+ }
792
+ if (!isset($this->attr[$name])) {
793
+ $this->_[HDOM_INFO_SPACE][] = array(' ', '', '');
794
+ $this->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE;
795
+ }
796
+ $this->attr[$name] = $value;
797
+ }
798
+
799
+ public function __isset($name)
800
+ {
801
+ switch ($name) {
802
+ case 'outertext': return true;
803
+ case 'innertext': return true;
804
+ case 'plaintext': return true;
805
+ }
806
+ //no value attr: nowrap, checked selected...
807
+ return (array_key_exists($name, $this->attr)) ? true : isset($this->attr[$name]);
808
+ }
809
+
810
+ public function __unset($name)
811
+ {
812
+ if (isset($this->attr[$name])) {
813
+ unset($this->attr[$name]);
814
+ }
815
+ }
816
+
817
+ // PaperG - Function to convert the text from one character set to another if the two sets are not the same.
818
+ public function convert_text($text)
819
+ {
820
+ global $debugObject;
821
+ if (is_object($debugObject)) {
822
+ $debugObject->debugLogEntry(1);
823
+ }
824
+
825
+ $converted_text = $text;
826
+
827
+ $sourceCharset = "";
828
+ $targetCharset = "";
829
+
830
+ if ($this->dom) {
831
+ $sourceCharset = strtoupper($this->dom->_charset);
832
+ $targetCharset = strtoupper($this->dom->_target_charset);
833
+ }
834
+ if (is_object($debugObject)) {
835
+ $debugObject->debugLog(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);
836
+ }
837
+
838
+ if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0)) {
839
+ // Check if the reported encoding could have been incorrect and the text is actually already UTF-8
840
+ if ((strcasecmp($targetCharset, 'UTF-8') == 0) && ($this->is_utf8($text))) {
841
+ $converted_text = $text;
842
+ } else {
843
+ $converted_text = iconv($sourceCharset, $targetCharset, $text);
844
+ }
845
+ }
846
+
847
+ // Lets make sure that we don't have that silly BOM issue with any of the utf-8 text we output.
848
+ if ($targetCharset == 'UTF-8') {
849
+ if (substr($converted_text, 0, 3) == "\xef\xbb\xbf") {
850
+ $converted_text = substr($converted_text, 3);
851
+ }
852
+ if (substr($converted_text, -3) == "\xef\xbb\xbf") {
853
+ $converted_text = substr($converted_text, 0, -3);
854
+ }
855
+ }
856
+
857
+ return $converted_text;
858
+ }
859
+
860
+ /**
861
+ * Returns true if $string is valid UTF-8 and false otherwise.
862
+ *
863
+ * @param mixed $str String to be tested
864
+ * @return boolean
865
+ */
866
+ public static function is_utf8($str)
867
+ {
868
+ $c=0;
869
+ $b=0;
870
+ $bits=0;
871
+ $len=strlen($str);
872
+ for ($i=0; $i<$len; $i++) {
873
+ $c=ord($str[$i]);
874
+ if ($c > 128) {
875
+ if (($c >= 254)) {
876
+ return false;
877
+ } elseif ($c >= 252) {
878
+ $bits=6;
879
+ } elseif ($c >= 248) {
880
+ $bits=5;
881
+ } elseif ($c >= 240) {
882
+ $bits=4;
883
+ } elseif ($c >= 224) {
884
+ $bits=3;
885
+ } elseif ($c >= 192) {
886
+ $bits=2;
887
+ } else {
888
+ return false;
889
+ }
890
+ if (($i+$bits) > $len) {
891
+ return false;
892
+ }
893
+ while ($bits > 1) {
894
+ $i++;
895
+ $b=ord($str[$i]);
896
+ if ($b < 128 || $b > 191) {
897
+ return false;
898
+ }
899
+ $bits--;
900
+ }
901
+ }
902
+ }
903
+ return true;
904
+ }
905
+ /*
906
+ function is_utf8($string)
907
+ {
908
+ //this is buggy
909
+ return (utf8_encode(utf8_decode($string)) == $string);
910
+ }
911
+ */
912
+
913
+ /**
914
+ * Function to try a few tricks to determine the displayed size of an img on the page.
915
+ * NOTE: This will ONLY work on an IMG tag. Returns FALSE on all other tag types.
916
+ *
917
+ * @author John Schlick
918
+ * @version April 19 2012
919
+ * @return array an array containing the 'height' and 'width' of the image on the page or -1 if we can't figure it out.
920
+ */
921
+ public function get_display_size()
922
+ {
923
+ global $debugObject;
924
+
925
+ $width = -1;
926
+ $height = -1;
927
+
928
+ if ($this->tag !== 'img') {
929
+ return false;
930
+ }
931
+
932
+ // See if there is aheight or width attribute in the tag itself.
933
+ if (isset($this->attr['width'])) {
934
+ $width = $this->attr['width'];
935
+ }
936
+
937
+ if (isset($this->attr['height'])) {
938
+ $height = $this->attr['height'];
939
+ }
940
+
941
+ // Now look for an inline style.
942
+ if (isset($this->attr['style'])) {
943
+ // Thanks to user gnarf from stackoverflow for this regular expression.
944
+ $attributes = array();
945
+ preg_match_all("/([\w-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER);
946
+ foreach ($matches as $match) {
947
+ $attributes[$match[1]] = $match[2];
948
+ }
949
+
950
+ // If there is a width in the style attributes:
951
+ if (isset($attributes['width']) && $width == -1) {
952
+ // check that the last two characters are px (pixels)
953
+ if (strtolower(substr($attributes['width'], -2)) == 'px') {
954
+ $proposed_width = substr($attributes['width'], 0, -2);
955
+ // Now make sure that it's an integer and not something stupid.
956
+ if (filter_var($proposed_width, FILTER_VALIDATE_INT)) {
957
+ $width = $proposed_width;
958
+ }
959
+ }
960
+ }
961
+
962
+ // If there is a width in the style attributes:
963
+ if (isset($attributes['height']) && $height == -1) {
964
+ // check that the last two characters are px (pixels)
965
+ if (strtolower(substr($attributes['height'], -2)) == 'px') {
966
+ $proposed_height = substr($attributes['height'], 0, -2);
967
+ // Now make sure that it's an integer and not something stupid.
968
+ if (filter_var($proposed_height, FILTER_VALIDATE_INT)) {
969
+ $height = $proposed_height;
970
+ }
971
+ }
972
+ }
973
+ }
974
+
975
+ // Future enhancement:
976
+ // Look in the tag to see if there is a class or id specified that has a height or width attribute to it.
977
+
978
+ // Far future enhancement
979
+ // Look at all the parent tags of this image to see if they specify a class or id that has an img selector that specifies a height or width
980
+ // Note that in this case, the class or id will have the img subselector for it to apply to the image.
981
+
982
+ // ridiculously far future development
983
+ // If the class or id is specified in a SEPARATE css file thats not on the page, go get it and do what we were just doing for the ones on the page.
984
+
985
+ $result = array('height' => $height,
986
+ 'width' => $width);
987
+ return $result;
988
+ }
989
+
990
+ // camel naming conventions
991
+ public function getAllAttributes()
992
+ {
993
+ return $this->attr;
994
+ }
995
+ public function getAttribute($name)
996
+ {
997
+ return $this->__get($name);
998
+ }
999
+ public function setAttribute($name, $value)
1000
+ {
1001
+ $this->__set($name, $value);
1002
+ }
1003
+ public function hasAttribute($name)
1004
+ {
1005
+ return $this->__isset($name);
1006
+ }
1007
+ public function removeAttribute($name)
1008
+ {
1009
+ $this->__set($name, null);
1010
+ }
1011
+ public function getElementById($id)
1012
+ {
1013
+ return $this->find("#$id", 0);
1014
+ }
1015
+ public function getElementsById($id, $idx=null)
1016
+ {
1017
+ return $this->find("#$id", $idx);
1018
+ }
1019
+ public function getElementByTagName($name)
1020
+ {
1021
+ return $this->find($name, 0);
1022
+ }
1023
+ public function getElementsByTagName($name, $idx=null)
1024
+ {
1025
+ return $this->find($name, $idx);
1026
+ }
1027
+ public function parentNode()
1028
+ {
1029
+ return $this->parent();
1030
+ }
1031
+ public function childNodes($idx=-1)
1032
+ {
1033
+ return $this->children($idx);
1034
+ }
1035
+ public function firstChild()
1036
+ {
1037
+ return $this->first_child();
1038
+ }
1039
+ public function lastChild()
1040
+ {
1041
+ return $this->last_child();
1042
+ }
1043
+ public function nextSibling()
1044
+ {
1045
+ return $this->next_sibling();
1046
+ }
1047
+ public function previousSibling()
1048
+ {
1049
+ return $this->prev_sibling();
1050
+ }
1051
+ public function hasChildNodes()
1052
+ {
1053
+ return $this->has_child();
1054
+ }
1055
+ public function nodeName()
1056
+ {
1057
+ return $this->tag;
1058
+ }
1059
+ public function appendChild($node)
1060
+ {
1061
+ $node->parent($this);
1062
+ return $node;
1063
+ }
1064
+ function hasAncestorAttribute($attribute)
1065
+ {
1066
+ $currentNode = $this;
1067
+
1068
+ if (isset($this->$attribute)) {
1069
+ return true;
1070
+ }
1071
+
1072
+ while ($currentNode->parent() && $currentNode->parent()->tag != 'html') {
1073
+ if (isset($currentNode->parent()->$attribute)) {
1074
+ return true;
1075
+ } else {
1076
+ $currentNode = $currentNode->parent();
1077
+ }
1078
+ }
1079
+ return false;
1080
+ }
1081
+ }
1082
+
1083
+ /**
1084
+ * simple html dom parser
1085
+ * Paperg - in the find routine: allow us to specify that we want case insensitive testing of the value of the selector.
1086
+ * Paperg - change $size from protected to public so we can easily access it
1087
+ * Paperg - added ForceTagsClosed in the constructor which tells us whether we trust the html or not. Default is to NOT trust it.
1088
+ *
1089
+ * @package PlaceLocalInclude
1090
+ */
1091
+ class simple_html_dom
1092
+ {
1093
+ public $root = null;
1094
+ public $nodes = array();
1095
+ public $callback = null;
1096
+ public $lowercase = false;
1097
+ // Used to keep track of how large the text was when we started.
1098
+ public $original_size;
1099
+ public $size;
1100
+ protected $pos;
1101
+ protected $doc;
1102
+ protected $char;
1103
+ protected $cursor;
1104
+ protected $parent;
1105
+ protected $noise = array();
1106
+ protected $token_blank = " \t\r\n";
1107
+ protected $token_equal = ' =/>';
1108
+ protected $token_slash = " />\r\n\t";
1109
+ protected $token_attr = ' >';
1110
+ // Note that this is referenced by a child node, and so it needs to be public for that node to see this information.
1111
+ public $_charset = '';
1112
+ public $_target_charset = '';
1113
+ protected $DEFAULT_BR_TEXT = "";
1114
+ public $DEFAULT_SPAN_TEXT = "";
1115
+
1116
+ // use isset instead of in_array, performance boost about 30%...
1117
+ protected $self_closing_tags = array('img'=>1, 'br'=>1, 'input'=>1, 'meta'=>1, 'link'=>1, 'hr'=>1, 'base'=>1, 'embed'=>1, 'spacer'=>1);
1118
+ protected $block_tags = array('root'=>1, 'body'=>1, 'form'=>1, 'div'=>1, 'span'=>1, 'table'=>1);
1119
+ // Known sourceforge issue #2977341
1120
+ // B tags that are not closed cause us to return everything to the end of the document.
1121
+ protected $optional_closing_tags = array(
1122
+ 'tr'=>array('tr'=>1, 'td'=>1, 'th'=>1),
1123
+ 'th'=>array('th'=>1),
1124
+ 'td'=>array('td'=>1),
1125
+ 'li'=>array('li'=>1),
1126
+ 'dt'=>array('dt'=>1, 'dd'=>1),
1127
+ 'dd'=>array('dd'=>1, 'dt'=>1),
1128
+ 'dl'=>array('dd'=>1, 'dt'=>1),
1129
+ 'p'=>array('p'=>1),
1130
+ 'nobr'=>array('nobr'=>1),
1131
+ 'b'=>array('b'=>1),
1132
+ 'option'=>array('option'=>1),
1133
+ 'source'=>array('source'=>1)
1134
+ );
1135
+
1136
+ public function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
1137
+ {
1138
+ if ($str) {
1139
+ if (preg_match("/^http:\/\//i", $str) || is_file($str)) {
1140
+ $this->load_file($str);
1141
+ } else {
1142
+ $this->load($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
1143
+ }
1144
+ }
1145
+ // Forcing tags to be closed implies that we don't trust the html, but it can lead to parsing errors if we SHOULD trust the html.
1146
+ if (!$forceTagsClosed) {
1147
+ $this->optional_closing_array=array();
1148
+ }
1149
+ $this->_target_charset = $target_charset;
1150
+ }
1151
+
1152
+ public function __destruct()
1153
+ {
1154
+ $this->clear();
1155
+ }
1156
+
1157
+ // load html from string
1158
+ public function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
1159
+ {
1160
+ global $debugObject;
1161
+
1162
+ // prepare
1163
+ $this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
1164
+ // strip out comments
1165
+ $this->remove_noise("'<!--(.*?)-->'is");
1166
+ // strip out cdata
1167
+ $this->remove_noise("'<!\[CDATA\[(.*?)\]\](>|&gt;)'is", true);
1168
+ // Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037
1169
+ // Script tags removal now preceeds style tag removal.
1170
+ // strip out <script> tags
1171
+ $this->remove_noise("'<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>'is");
1172
+ $this->remove_noise("'<\s*script\s*>(.*?)<\s*/\s*script\s*>'is");
1173
+ $this->remove_noise("'<\s*noscript\s*>(.*?)<\s*/\s*noscript\s*>'is");
1174
+ // strip out <style> tags
1175
+ $this->remove_noise("'<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>'is");
1176
+ $this->remove_noise("'<\s*style\s*>(.*?)<\s*/\s*style\s*>'is");
1177
+ // strip out preformatted tags
1178
+ $this->remove_noise("'<\s*(?:code)[^>]*>(.*?)<\s*/\s*(?:code)\s*>'is");
1179
+ // strip out server side scripts
1180
+ $this->remove_noise("'(<\?)(.*?)(\?>)'s", true);
1181
+ // strip smarty scripts
1182
+ $this->remove_noise("'(\{\w)(.*?)(\})'s", true);
1183
+
1184
+ // parsing
1185
+ while ($this->parse());
1186
+ // end
1187
+ $this->root->_[HDOM_INFO_END] = $this->cursor;
1188
+ $this->parse_charset();
1189
+
1190
+ // make load function chainable
1191
+ return $this;
1192
+ }
1193
+
1194
+ // load html from file
1195
+ public function load_file()
1196
+ {
1197
+ $args = func_get_args();
1198
+ $this->load(call_user_func_array('file_get_contents', $args), true);
1199
+ // Throw an error if we can't properly load the dom.
1200
+ if (($error=error_get_last())!==null) {
1201
+ $this->clear();
1202
+ return false;
1203
+ }
1204
+ }
1205
+
1206
+ // set callback function
1207
+ public function set_callback($function_name)
1208
+ {
1209
+ $this->callback = $function_name;
1210
+ }
1211
+
1212
+ // remove callback function
1213
+ public function remove_callback()
1214
+ {
1215
+ $this->callback = null;
1216
+ }
1217
+
1218
+ // save dom as string
1219
+ public function save($filepath='')
1220
+ {
1221
+ $ret = $this->root->innertext();
1222
+ if ($filepath!=='') {
1223
+ file_put_contents($filepath, $ret, LOCK_EX);
1224
+ }
1225
+ return $ret;
1226
+ }
1227
+
1228
+ // find dom node by css selector
1229
+ // Paperg - allow us to specify that we want case insensitive testing of the value of the selector.
1230
+ public function find($selector, $idx=null, $lowercase=false)
1231
+ {
1232
+ return $this->root->find($selector, $idx, $lowercase);
1233
+ }
1234
+
1235
+ // clean up memory due to php5 circular references memory leak...
1236
+ public function clear()
1237
+ {
1238
+ foreach ($this->nodes as $n) {
1239
+ $n->clear();
1240
+ $n = null;
1241
+ }
1242
+ // This add next line is documented in the sourceforge repository. 2977248 as a fix for ongoing memory leaks that occur even with the use of clear.
1243
+ if (isset($this->children)) {
1244
+ foreach ($this->children as $n) {
1245
+ $n->clear();
1246
+ $n = null;
1247
+ }
1248
+ }
1249
+ if (isset($this->parent)) {
1250
+ $this->parent->clear();
1251
+ unset($this->parent);
1252
+ }
1253
+ if (isset($this->root)) {
1254
+ $this->root->clear();
1255
+ unset($this->root);
1256
+ }
1257
+ unset($this->doc);
1258
+ unset($this->noise);
1259
+ }
1260
+
1261
+ public function dump($show_attr=true)
1262
+ {
1263
+ $this->root->dump($show_attr);
1264
+ }
1265
+
1266
+ // prepare HTML data and init everything
1267
+ protected function prepare($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
1268
+ {
1269
+ $this->clear();
1270
+
1271
+ // set the length of content before we do anything to it.
1272
+ $this->size = strlen($str);
1273
+ // Save the original size of the html that we got in. It might be useful to someone.
1274
+ $this->original_size = $this->size;
1275
+
1276
+ //before we save the string as the doc... strip out the \r \n's if we are told to.
1277
+ if ($stripRN) {
1278
+ $str = str_replace("\r", " ", $str);
1279
+ $str = str_replace("\n", " ", $str);
1280
+
1281
+ // set the length of content since we have changed it.
1282
+ $this->size = strlen($str);
1283
+ }
1284
+
1285
+ $this->doc = $str;
1286
+ $this->pos = 0;
1287
+ $this->cursor = 1;
1288
+ $this->noise = array();
1289
+ $this->nodes = array();
1290
+ $this->lowercase = $lowercase;
1291
+ $this->DEFAULT_BR_TEXT = $defaultBRText;
1292
+ $this->DEFAULT_SPAN_TEXT = $defaultSpanText;
1293
+ $this->root = new simple_html_dom_node($this);
1294
+ $this->root->tag = 'root';
1295
+ $this->root->_[HDOM_INFO_BEGIN] = -1;
1296
+ $this->root->nodetype = HDOM_TYPE_ROOT;
1297
+ $this->parent = $this->root;
1298
+ if ($this->size>0) {
1299
+ $this->char = $this->doc[0];
1300
+ }
1301
+ }
1302
+
1303
+ // parse html content
1304
+ protected function parse()
1305
+ {
1306
+ if (($s = $this->copy_until_char('<'))==='') {
1307
+ return $this->read_tag();
1308
+ }
1309
+
1310
+ // text
1311
+ $node = new simple_html_dom_node($this);
1312
+ ++$this->cursor;
1313
+ $node->_[HDOM_INFO_TEXT] = $s;
1314
+ $this->link_nodes($node, false);
1315
+ return true;
1316
+ }
1317
+
1318
+ // PAPERG - dkchou - added this to try to identify the character set of the page we have just parsed so we know better how to spit it out later.
1319
+ // NOTE: IF you provide a routine called get_last_retrieve_url_contents_content_type which returns the CURLINFO_CONTENT_TYPE from the last curl_exec
1320
+ // (or the content_type header from the last transfer), we will parse THAT, and if a charset is specified, we will use it over any other mechanism.
1321
+ protected function parse_charset()
1322
+ {
1323
+ global $debugObject;
1324
+
1325
+ $charset = null;
1326
+
1327
+ if (function_exists('get_last_retrieve_url_contents_content_type')) {
1328
+ $contentTypeHeader = get_last_retrieve_url_contents_content_type();
1329
+ $success = preg_match('/charset=(.+)/', $contentTypeHeader, $matches);
1330
+ if ($success) {
1331
+ $charset = $matches[1];
1332
+ if (is_object($debugObject)) {
1333
+ $debugObject->debugLog(2, 'header content-type found charset of: ' . $charset);
1334
+ }
1335
+ }
1336
+ }
1337
+
1338
+ if (empty($charset)) {
1339
+ $el = $this->root->find('meta[http-equiv=Content-Type]', 0);
1340
+ if (!empty($el)) {
1341
+ $fullvalue = $el->content;
1342
+ if (is_object($debugObject)) {
1343
+ $debugObject->debugLog(2, 'meta content-type tag found' . $fullvalue);
1344
+ }
1345
+
1346
+ if (!empty($fullvalue)) {
1347
+ $success = preg_match('/charset=(.+)/', $fullvalue, $matches);
1348
+ if ($success) {
1349
+ $charset = $matches[1];
1350
+ } else {
1351
+ // If there is a meta tag, and they don't specify the character set, research says that it's typically ISO-8859-1
1352
+ if (is_object($debugObject)) {
1353
+ $debugObject->debugLog(2, 'meta content-type tag couldn\'t be parsed. using iso-8859 default.');
1354
+ }
1355
+ $charset = 'ISO-8859-1';
1356
+ }
1357
+ }
1358
+ }
1359
+ }
1360
+
1361
+ // If we couldn't find a charset above, then lets try to detect one based on the text we got...
1362
+ if (empty($charset)) {
1363
+ // Have php try to detect the encoding from the text given to us.
1364
+ if (function_exists('mb_detect_encoding')) {
1365
+ $charset = mb_detect_encoding($this->root->plaintext . "ascii", $encoding_list = array( "UTF-8", "CP1252" ));
1366
+ }
1367
+ if (is_object($debugObject)) {
1368
+ $debugObject->debugLog(2, 'mb_detect found: ' . $charset);
1369
+ }
1370
+
1371
+ // and if this doesn't work... then we need to just wrongheadedly assume it's UTF-8 so that we can move on - cause this will usually give us most of what we need...
1372
+ if ($charset === false) {
1373
+ if (is_object($debugObject)) {
1374
+ $debugObject->debugLog(2, 'since mb_detect failed - using default of utf-8');
1375
+ }
1376
+ $charset = 'UTF-8';
1377
+ }
1378
+ }
1379
+
1380
+ // Since CP1252 is a superset, if we get one of it's subsets, we want it instead.
1381
+ if ((strtolower($charset) == strtolower('ISO-8859-1')) || (strtolower($charset) == strtolower('Latin1')) || (strtolower($charset) == strtolower('Latin-1'))) {
1382
+ if (is_object($debugObject)) {
1383
+ $debugObject->debugLog(2, 'replacing ' . $charset . ' with CP1252 as its a superset');
1384
+ }
1385
+ $charset = 'CP1252';
1386
+ }
1387
+
1388
+ if (is_object($debugObject)) {
1389
+ $debugObject->debugLog(1, 'EXIT - ' . $charset);
1390
+ }
1391
+
1392
+ return $this->_charset = $charset;
1393
+ }
1394
+
1395
+ // read tag info
1396
+ protected function read_tag()
1397
+ {
1398
+ if ($this->char!=='<') {
1399
+ $this->root->_[HDOM_INFO_END] = $this->cursor;
1400
+ return false;
1401
+ }
1402
+ $begin_tag_pos = $this->pos;
1403
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1404
+
1405
+ // end tag
1406
+ if ($this->char==='/') {
1407
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1408
+ // This represents the change in the simple_html_dom trunk from revision 180 to 181.
1409
+ // $this->skip($this->token_blank_t);
1410
+ $this->skip($this->token_blank);
1411
+ $tag = $this->copy_until_char('>');
1412
+
1413
+ // skip attributes in end tag
1414
+ if (($pos = strpos($tag, ' '))!==false) {
1415
+ $tag = substr($tag, 0, $pos);
1416
+ }
1417
+
1418
+ $parent_lower = strtolower($this->parent->tag);
1419
+ $tag_lower = strtolower($tag);
1420
+
1421
+ if ($parent_lower!==$tag_lower) {
1422
+ if (isset($this->optional_closing_tags[$parent_lower]) && isset($this->block_tags[$tag_lower])) {
1423
+ $this->parent->_[HDOM_INFO_END] = 0;
1424
+ $org_parent = $this->parent;
1425
+
1426
+ while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower) {
1427
+ $this->parent = $this->parent->parent;
1428
+ }
1429
+
1430
+ if (strtolower($this->parent->tag)!==$tag_lower) {
1431
+ $this->parent = $org_parent; // restore origonal parent
1432
+ if ($this->parent->parent) {
1433
+ $this->parent = $this->parent->parent;
1434
+ }
1435
+ $this->parent->_[HDOM_INFO_END] = $this->cursor;
1436
+ return $this->as_text_node($tag);
1437
+ }
1438
+ } elseif (($this->parent->parent) && isset($this->block_tags[$tag_lower])) {
1439
+ $this->parent->_[HDOM_INFO_END] = 0;
1440
+ $org_parent = $this->parent;
1441
+
1442
+ while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower) {
1443
+ $this->parent = $this->parent->parent;
1444
+ }
1445
+
1446
+ if (strtolower($this->parent->tag)!==$tag_lower) {
1447
+ $this->parent = $org_parent; // restore origonal parent
1448
+ $this->parent->_[HDOM_INFO_END] = $this->cursor;
1449
+ return $this->as_text_node($tag);
1450
+ }
1451
+ } elseif (($this->parent->parent) && strtolower($this->parent->parent->tag)===$tag_lower) {
1452
+ $this->parent->_[HDOM_INFO_END] = 0;
1453
+ $this->parent = $this->parent->parent;
1454
+ } else {
1455
+ return $this->as_text_node($tag);
1456
+ }
1457
+ }
1458
+
1459
+ $this->parent->_[HDOM_INFO_END] = $this->cursor;
1460
+ if ($this->parent->parent) {
1461
+ $this->parent = $this->parent->parent;
1462
+ }
1463
+
1464
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1465
+ return true;
1466
+ }
1467
+
1468
+ $node = new simple_html_dom_node($this);
1469
+ $node->_[HDOM_INFO_BEGIN] = $this->cursor;
1470
+ ++$this->cursor;
1471
+ $tag = $this->copy_until($this->token_slash);
1472
+ $node->tag_start = $begin_tag_pos;
1473
+
1474
+ // doctype, cdata & comments...
1475
+ if (isset($tag[0]) && $tag[0]==='!') {
1476
+ $node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until_char('>');
1477
+
1478
+ if (isset($tag[2]) && $tag[1]==='-' && $tag[2]==='-') {
1479
+ $node->nodetype = HDOM_TYPE_COMMENT;
1480
+ $node->tag = 'comment';
1481
+ } else {
1482
+ $node->nodetype = HDOM_TYPE_UNKNOWN;
1483
+ $node->tag = 'unknown';
1484
+ }
1485
+ if ($this->char==='>') {
1486
+ $node->_[HDOM_INFO_TEXT].='>';
1487
+ }
1488
+ $this->link_nodes($node, true);
1489
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1490
+ return true;
1491
+ }
1492
+
1493
+ // text
1494
+ if ($pos=strpos($tag, '<')!==false) {
1495
+ $tag = '<' . substr($tag, 0, -1);
1496
+ $node->_[HDOM_INFO_TEXT] = $tag;
1497
+ $this->link_nodes($node, false);
1498
+ $this->char = $this->doc[--$this->pos]; // prev
1499
+ return true;
1500
+ }
1501
+
1502
+ if (!preg_match("/^[\w-:]+$/", $tag)) {
1503
+ $node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until('<>');
1504
+ if ($this->char==='<') {
1505
+ $this->link_nodes($node, false);
1506
+ return true;
1507
+ }
1508
+
1509
+ if ($this->char==='>') {
1510
+ $node->_[HDOM_INFO_TEXT].='>';
1511
+ }
1512
+ $this->link_nodes($node, false);
1513
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1514
+ return true;
1515
+ }
1516
+
1517
+ // begin tag
1518
+ $node->nodetype = HDOM_TYPE_ELEMENT;
1519
+ $tag_lower = strtolower($tag);
1520
+ $node->tag = ($this->lowercase) ? $tag_lower : $tag;
1521
+
1522
+ // handle optional closing tags
1523
+ if (isset($this->optional_closing_tags[$tag_lower])) {
1524
+ while (isset($this->optional_closing_tags[$tag_lower][strtolower($this->parent->tag)])) {
1525
+ $this->parent->_[HDOM_INFO_END] = 0;
1526
+ $this->parent = $this->parent->parent;
1527
+ }
1528
+ $node->parent = $this->parent;
1529
+ }
1530
+
1531
+ $guard = 0; // prevent infinity loop
1532
+ $space = array($this->copy_skip($this->token_blank), '', '');
1533
+
1534
+ // attributes
1535
+ do {
1536
+ if ($this->char!==null && $space[0]==='') {
1537
+ //break;
1538
+ }
1539
+ $name = $this->copy_until($this->token_equal);
1540
+ if ($guard===$this->pos) {
1541
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1542
+ continue;
1543
+ }
1544
+ $guard = $this->pos;
1545
+
1546
+ // handle endless '<'
1547
+ if ($this->pos>=$this->size-1 && $this->char!=='>') {
1548
+ $node->nodetype = HDOM_TYPE_TEXT;
1549
+ $node->_[HDOM_INFO_END] = 0;
1550
+ $node->_[HDOM_INFO_TEXT] = '<'.$tag . $space[0] . $name;
1551
+ $node->tag = 'text';
1552
+ $this->link_nodes($node, false);
1553
+ return true;
1554
+ }
1555
+
1556
+ // handle mismatch '<'
1557
+ if ($this->doc[$this->pos-1]=='<') {
1558
+ $node->nodetype = HDOM_TYPE_TEXT;
1559
+ $node->tag = 'text';
1560
+ $node->attr = array();
1561
+ $node->_[HDOM_INFO_END] = 0;
1562
+ $node->_[HDOM_INFO_TEXT] = substr($this->doc, $begin_tag_pos, $this->pos-$begin_tag_pos-1);
1563
+ $this->pos -= 2;
1564
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1565
+ $this->link_nodes($node, false);
1566
+ return true;
1567
+ }
1568
+
1569
+ if ($name!=='/' && $name!=='') {
1570
+ $space[1] = $this->copy_skip($this->token_blank);
1571
+ $name = $this->restore_noise($name);
1572
+ if ($this->lowercase) {
1573
+ $name = strtolower($name);
1574
+ }
1575
+ if ($this->char==='=') {
1576
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1577
+ $this->parse_attr($node, $name, $space);
1578
+ } else {
1579
+ //no value attr: nowrap, checked selected...
1580
+ $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO;
1581
+ $node->attr[$name] = true;
1582
+ if ($this->char!='>') {
1583
+ $this->char = $this->doc[--$this->pos];
1584
+ } // prev
1585
+ }
1586
+ $node->_[HDOM_INFO_SPACE][] = $space;
1587
+ $space = array($this->copy_skip($this->token_blank), '', '');
1588
+ } else {
1589
+ break;
1590
+ }
1591
+ } while ($this->char!=='>' && $this->char!=='/');
1592
+
1593
+ $this->link_nodes($node, true);
1594
+ $node->_[HDOM_INFO_ENDSPACE] = $space[0];
1595
+
1596
+ // check self closing
1597
+ if ($this->copy_until_char_escape('>')==='/') {
1598
+ $node->_[HDOM_INFO_ENDSPACE] .= '/';
1599
+ $node->_[HDOM_INFO_END] = 0;
1600
+ } else {
1601
+ // reset parent
1602
+ if (!isset($this->self_closing_tags[strtolower($node->tag)])) {
1603
+ $this->parent = $node;
1604
+ }
1605
+ }
1606
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1607
+
1608
+ // If it's a BR tag, we need to set it's text to the default text.
1609
+ // This way when we see it in plaintext, we can generate formatting that the user wants.
1610
+ // since a br tag never has sub nodes, this works well.
1611
+ if ($node->tag == "br") {
1612
+ $node->_[HDOM_INFO_INNER] = $this->DEFAULT_BR_TEXT;
1613
+ }
1614
+
1615
+ return true;
1616
+ }
1617
+
1618
+ // parse attributes
1619
+ protected function parse_attr($node, $name, &$space)
1620
+ {
1621
+ // Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037
1622
+ // If the attribute is already defined inside a tag, only pay atetntion to the first one as opposed to the last one.
1623
+ if (isset($node->attr[$name])) {
1624
+ return;
1625
+ }
1626
+
1627
+ $space[2] = $this->copy_skip($this->token_blank);
1628
+ switch ($this->char) {
1629
+ case '"':
1630
+ $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE;
1631
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1632
+ $node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('"'));
1633
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1634
+ break;
1635
+ case '\'':
1636
+ $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_SINGLE;
1637
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1638
+ $node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('\''));
1639
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1640
+ break;
1641
+ default:
1642
+ $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO;
1643
+ $node->attr[$name] = $this->restore_noise($this->copy_until($this->token_attr));
1644
+ }
1645
+ // PaperG: Attributes should not have \r or \n in them, that counts as html whitespace.
1646
+ $node->attr[$name] = str_replace("\r", "", $node->attr[$name]);
1647
+ $node->attr[$name] = str_replace("\n", "", $node->attr[$name]);
1648
+ // PaperG: If this is a "class" selector, lets get rid of the preceeding and trailing space since some people leave it in the multi class case.
1649
+ if ($name == "class") {
1650
+ $node->attr[$name] = trim($node->attr[$name]);
1651
+ }
1652
+ }
1653
+
1654
+ // link node's parent
1655
+ protected function link_nodes(&$node, $is_child)
1656
+ {
1657
+ $node->parent = $this->parent;
1658
+ $this->parent->nodes[] = $node;
1659
+ if ($is_child) {
1660
+ $this->parent->children[] = $node;
1661
+ }
1662
+ }
1663
+
1664
+ // as a text node
1665
+ protected function as_text_node($tag)
1666
+ {
1667
+ $node = new simple_html_dom_node($this);
1668
+ ++$this->cursor;
1669
+ $node->_[HDOM_INFO_TEXT] = '</' . $tag . '>';
1670
+ $this->link_nodes($node, false);
1671
+ $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1672
+ return true;
1673
+ }
1674
+
1675
+ protected function skip($chars)
1676
+ {
1677
+ $this->pos += strspn($this->doc, $chars, $this->pos);
1678
+ $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1679
+ }
1680
+
1681
+ protected function copy_skip($chars)
1682
+ {
1683
+ $pos = $this->pos;
1684
+ $len = strspn($this->doc, $chars, $pos);
1685
+ $this->pos += $len;
1686
+ $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1687
+ if ($len===0) {
1688
+ return '';
1689
+ }
1690
+ return substr($this->doc, $pos, $len);
1691
+ }
1692
+
1693
+ protected function copy_until($chars)
1694
+ {
1695
+ $pos = $this->pos;
1696
+ $len = strcspn($this->doc, $chars, $pos);
1697
+ $this->pos += $len;
1698
+ $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1699
+ return substr($this->doc, $pos, $len);
1700
+ }
1701
+
1702
+ protected function copy_until_char($char)
1703
+ {
1704
+ if ($this->char===null) {
1705
+ return '';
1706
+ }
1707
+
1708
+ if (($pos = strpos($this->doc, $char, $this->pos))===false) {
1709
+ $ret = substr($this->doc, $this->pos, $this->size-$this->pos);
1710
+ $this->char = null;
1711
+ $this->pos = $this->size;
1712
+ return $ret;
1713
+ }
1714
+
1715
+ if ($pos===$this->pos) {
1716
+ return '';
1717
+ }
1718
+ $pos_old = $this->pos;
1719
+ $this->char = $this->doc[$pos];
1720
+ $this->pos = $pos;
1721
+ return substr($this->doc, $pos_old, $pos-$pos_old);
1722
+ }
1723
+
1724
+ protected function copy_until_char_escape($char)
1725
+ {
1726
+ if ($this->char===null) {
1727
+ return '';
1728
+ }
1729
+
1730
+ $start = $this->pos;
1731
+ while (1) {
1732
+ if (($pos = strpos($this->doc, $char, $start))===false) {
1733
+ $ret = substr($this->doc, $this->pos, $this->size-$this->pos);
1734
+ $this->char = null;
1735
+ $this->pos = $this->size;
1736
+ return $ret;
1737
+ }
1738
+
1739
+ if ($pos===$this->pos) {
1740
+ return '';
1741
+ }
1742
+
1743
+ if ($this->doc[$pos-1]==='\\') {
1744
+ $start = $pos+1;
1745
+ continue;
1746
+ }
1747
+
1748
+ $pos_old = $this->pos;
1749
+ $this->char = $this->doc[$pos];
1750
+ $this->pos = $pos;
1751
+ return substr($this->doc, $pos_old, $pos-$pos_old);
1752
+ }
1753
+ }
1754
+
1755
+ // remove noise from html content
1756
+ // save the noise in the $this->noise array.
1757
+ protected function remove_noise($pattern, $remove_tag=false)
1758
+ {
1759
+ global $debugObject;
1760
+ if (is_object($debugObject)) {
1761
+ $debugObject->debugLogEntry(1);
1762
+ }
1763
+
1764
+ $count = preg_match_all($pattern, $this->doc, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE);
1765
+
1766
+ for ($i=$count-1; $i>-1; --$i) {
1767
+ $key = '___noise___'.sprintf('% 5d', count($this->noise)+1000);
1768
+ if (is_object($debugObject)) {
1769
+ $debugObject->debugLog(2, 'key is: ' . $key);
1770
+ }
1771
+ $idx = ($remove_tag) ? 0 : 1;
1772
+ $this->noise[$key] = $matches[$i][$idx][0];
1773
+ $this->doc = substr_replace($this->doc, $key, $matches[$i][$idx][1], strlen($matches[$i][$idx][0]));
1774
+ }
1775
+
1776
+ // reset the length of content
1777
+ $this->size = strlen($this->doc);
1778
+ if ($this->size>0) {
1779
+ $this->char = $this->doc[0];
1780
+ }
1781
+ }
1782
+
1783
+ // restore noise to html content
1784
+ public function restore_noise($text)
1785
+ {
1786
+ global $debugObject;
1787
+ if (is_object($debugObject)) {
1788
+ $debugObject->debugLogEntry(1);
1789
+ }
1790
+
1791
+ while (($pos=strpos($text, '___noise___'))!==false) {
1792
+ // Sometimes there is a broken piece of markup, and we don't GET the pos+11 etc... token which indicates a problem outside of us...
1793
+ if (strlen($text) > $pos+15) {
1794
+ $key = '___noise___'.$text[$pos+11].$text[$pos+12].$text[$pos+13].$text[$pos+14].$text[$pos+15];
1795
+ if (is_object($debugObject)) {
1796
+ $debugObject->debugLog(2, 'located key of: ' . $key);
1797
+ }
1798
+
1799
+ if (isset($this->noise[$key])) {
1800
+ $text = substr($text, 0, $pos).$this->noise[$key].substr($text, $pos+16);
1801
+ } else {
1802
+ // do this to prevent an infinite loop.
1803
+ $text = substr($text, 0, $pos).'UNDEFINED NOISE FOR KEY: '.$key . substr($text, $pos+16);
1804
+ }
1805
+ } else {
1806
+ // There is no valid key being given back to us... We must get rid of the ___noise___ or we will have a problem.
1807
+ $text = substr($text, 0, $pos).'NO NUMERIC NOISE KEY' . substr($text, $pos+11);
1808
+ }
1809
+ }
1810
+ return $text;
1811
+ }
1812
+
1813
+ // Sometimes we NEED one of the noise elements.
1814
+ public function search_noise($text)
1815
+ {
1816
+ global $debugObject;
1817
+ if (is_object($debugObject)) {
1818
+ $debugObject->debugLogEntry(1);
1819
+ }
1820
+
1821
+ foreach ($this->noise as $noiseElement) {
1822
+ if (strpos($noiseElement, $text)!==false) {
1823
+ return $noiseElement;
1824
+ }
1825
+ }
1826
+ }
1827
+ public function __toString()
1828
+ {
1829
+ return $this->root->innertext();
1830
+ }
1831
+
1832
+ public function __get($name)
1833
+ {
1834
+ switch ($name) {
1835
+ case 'outertext':
1836
+ return $this->root->innertext();
1837
+ case 'innertext':
1838
+ return $this->root->innertext();
1839
+ case 'plaintext':
1840
+ return $this->root->text();
1841
+ case 'charset':
1842
+ return $this->_charset;
1843
+ case 'target_charset':
1844
+ return $this->_target_charset;
1845
+ }
1846
+ }
1847
+
1848
+ // camel naming conventions
1849
+ public function childNodes($idx=-1)
1850
+ {
1851
+ return $this->root->childNodes($idx);
1852
+ }
1853
+ public function firstChild()
1854
+ {
1855
+ return $this->root->first_child();
1856
+ }
1857
+ public function lastChild()
1858
+ {
1859
+ return $this->root->last_child();
1860
+ }
1861
+ public function createElement($name, $value=null)
1862
+ {
1863
+ return @str_get_html("<$name>$value</$name>")->first_child();
1864
+ }
1865
+ public function createTextNode($value)
1866
+ {
1867
+ return @end(str_get_html($value)->nodes);
1868
+ }
1869
+ public function getElementById($id)
1870
+ {
1871
+ return $this->find("#$id", 0);
1872
+ }
1873
+ public function getElementsById($id, $idx=null)
1874
+ {
1875
+ return $this->find("#$id", $idx);
1876
+ }
1877
+ public function getElementByTagName($name)
1878
+ {
1879
+ return $this->find($name, 0);
1880
+ }
1881
+ public function getElementsByTagName($name, $idx=-1)
1882
+ {
1883
+ return $this->find($name, $idx);
1884
+ }
1885
+ public function loadFile()
1886
+ {
1887
+ $args = func_get_args();
1888
+ $this->load_file($args);
1889
+ }
1890
+ }
1891
+
1892
+ ?>
vendor/weglot/weglot-php/.codeclimate.yml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ version: "2"
2
+ checks:
3
+ method-complexity:
4
+ config:
5
+ threshold: 10
vendor/weglot/weglot-php/.editorconfig ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ indent_size = 4
6
+ indent_style = space
7
+ insert_final_newline = true
8
+ trim_trailing_whitespace = true
vendor/weglot/weglot-php/.env.dist ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ ###> redis ###
2
+ REDIS_SCHEME=tcp
3
+ REDIS_HOST=127.0.0.1
4
+ REDIS_PORT=6379
5
+ ###< redis ###
6
+
7
+ ###> weglot ###
8
+ WG_API_KEY=%%YOUR_WEGLOT_API_KEY%%
9
+ ###< redis ###
vendor/weglot/weglot-php/.github/ISSUE_TEMPLATE.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- This form is for bug reports and feature requests ONLY! -->
2
+
3
+ **Is this a BUG REPORT or FEATURE REQUEST?**:
4
+
5
+ **What happened**:
6
+
7
+ **What you expected to happen**:
8
+
9
+ **How to reproduce it (some code is appreciated)**:
10
+
11
+ **Anything else we need to know?**:
12
+
13
+ **Environment**:
14
+ - Library version
15
+ - PHP version
vendor/weglot/weglot-php/.github/PULL_REQUEST_TEMPLATE.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- Thanks for sending a pull request! If this is your first time, read our contributor guidelines -->
2
+
3
+ **What this PR does / why we need it**:
4
+
5
+ **Which issue(s) this PR fixes**:
6
+ <!-- We suggest to use issue number with tag: #XX -->
7
+ - Fixes #
8
+
9
+ **Special notes for your reviewer**:
10
+
11
+ **How you would summarize your PR ? (for changelog)**:
vendor/weglot/weglot-php/.gitignore ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ##> ide-config ##
2
+ .idea/
3
+ .vscode/
4
+ ##< ide-config ##
5
+
6
+ ##> composer ##
7
+ vendor/
8
+ composer.phar
9
+ composer.lock
10
+ ##< composer ##
11
+
12
+ ##> php-cs-fixer ##
13
+ .php_cs.cache
14
+ ##< php-cs-fixer ##
15
+
16
+ ##> phpmetrics ##
17
+ phpmetrics/
18
+ ##< phpmetrics ##
19
+
20
+ ##> dotenv ##
21
+ .env
22
+ ##< dotenv
vendor/weglot/weglot-php/.php_cs ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $finder = PhpCsFixer\Finder::create()
4
+ ->files()
5
+ ->in(__DIR__)
6
+ ->exclude('vendor')
7
+ ->notName("*.txt")
8
+ ->name('*.php')
9
+ ->ignoreDotFiles(true)
10
+ ->ignoreVCS(true);
11
+ ;
12
+
13
+ return PhpCsFixer\Config::create()
14
+ ->setRules([
15
+ '@PSR1' => true,
16
+ '@PSR2' => true,
17
+ 'array_syntax' => ['syntax' => 'short'],
18
+ 'no_alternative_syntax' => true
19
+ ])
20
+ ->setFinder($finder);
vendor/weglot/weglot-php/.travis.yml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ language: php
2
+
3
+ services:
4
+ - redis-server
5
+
6
+ notifications:
7
+ email:
8
+ on_failure: change
9
+
10
+ env:
11
+ global:
12
+ - COMPOSER_UP="composer update --no-progress --no-suggest --ansi --prefer-dist"
13
+ - TEST_COMMAND="./vendor/bin/codecept run unit --no-interaction"
14
+ - TEST_FLAGS=""
15
+ - DEPENDENCIES="cache/predis-adapter"
16
+
17
+ matrix:
18
+ fast_finish: true
19
+ include:
20
+ - php: 5.4
21
+ env: TEST_FLAGS="-g client -g parser -g util" DEPENDENCIES="" prefer="low"
22
+ - php: 5.4
23
+ env: TEST_FLAGS="-g client -g parser -g util" DEPENDENCIES=""
24
+ - php: 5.5
25
+ env: TEST_FLAGS="-g client -g parser -g util" DEPENDENCIES=""
26
+ - php: 5.6
27
+ - php: 7.0
28
+ - php: 7.1
29
+ - php: 7.2
30
+ env: COVERAGE=true TEST_FLAGS="--coverage --coverage-xml"
31
+
32
+ install:
33
+ - |
34
+ if [[ $prefer = low ]]; then
35
+ $COMPOSER_UP --prefer-lowest --prefer-stable
36
+ else
37
+ $COMPOSER_UP
38
+ fi
39
+ - if ! [ -z "$DEPENDENCIES" ]; then composer require ${DEPENDENCIES}; fi;
40
+
41
+ before_script:
42
+ - cp .env.dist .env
43
+ - sed -i "8s/.*/WG_API_KEY=$WG_API_KEY/" .env
44
+ - |
45
+ if [[ $COVERAGE = true ]]; then
46
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
47
+ chmod +x ./cc-test-reporter
48
+ ./cc-test-reporter before-build
49
+ fi
50
+
51
+ script:
52
+ - composer validate --strict --no-check-lock
53
+ - $TEST_COMMAND $TEST_FLAGS
54
+
55
+ after_script:
56
+ - |
57
+ if [[ $COVERAGE = true ]]; then
58
+ mv tests/_output/coverage.xml clover.xml
59
+ ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
60
+ fi
61
+
62
+ cache:
63
+ directories:
64
+ - $HOME/.composer/cache
vendor/weglot/weglot-php/CHANGELOG.md ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.5.9] - 2018-07-19
10
+ ### Changed
11
+ - Cleaning tags html entities before rendering
12
+ - Fix URL and infinite loop bug
13
+
14
+ ## [0.5.8] - 2018-06-26
15
+ ### Changed
16
+ - Simplify code and fix all ignore nodes related problems
17
+ ### Fixed
18
+ - Forgot noscript & code in Text checker
19
+
20
+ ## [0.5.7] - 2018-06-12
21
+ ### Changed
22
+ - Client.HttpClient: Using new header system (Weglot-Context)
23
+ - Client.Profile: Setting ignoredNodes behavior as default one
24
+ ### Fixed
25
+ - Parser: fixes some checkers (Check.Placeholder / Check.Text) & fixing AbstractDomChecker in checkers list
26
+ - Parser.ignoredNodes: Fixing replacement method to allow more content (class or other attributes) in skipped tags
27
+
28
+ ## [0.5.6] - 2018-06-08
29
+ ### Fixed
30
+ - Factory.Translate: fixing wrong assignation
31
+
32
+ ## [0.5.5] - 2018-06-08
33
+ ### Fixed
34
+ - Factory.Translate: fixing issue where PHP can returns an array not in same order as the keys are
35
+
36
+ ## [0.5.4] - 2018-06-05
37
+ ### Fixed
38
+ - Util.Url: missing getDefault function
39
+
40
+ ## [0.5.3] - 2018-06-05
41
+ ### Added
42
+ - Util.Url: adding query managment
43
+ ### Changed
44
+ - Better exceptions for Translate endpoint
45
+ - Improving Util.Url structure
46
+ - Better travis tests (with low deps for PHP 5.4)
47
+ ### Fixed
48
+ - Unit tests where break due to no trailing slash
49
+
50
+ ## [0.5.2] - 2018-05-31
51
+ ### Fixed
52
+ - Util.Url: nested Url prefix was in baseUrl
53
+
54
+ ## [0.5.1] - 2018-05-28
55
+ ### Fixed
56
+ - Util.Url: Adding Port managment
57
+
58
+ ## [0.5.0] - 2018-05-28
59
+ ### Added
60
+ - Util.Url: `getForLanguage($code)` function to get given language url base on current `Url` instance
61
+ - Api.Languages: adding data for RTL (right to left) languages and access in API objects
62
+ ### Changed
63
+ - Util.Url: Local caching for `currentRequestAllUrls()` function
64
+ - Updating `composer.json`
65
+
66
+ ## [0.4.2] - 2018-05-21
67
+ ### Fixed
68
+ - Util.Url: handling case where prefix path has trailing slash
69
+ ### Added
70
+ - Tests: Unit tests for Util.Url to check when prefix path as trailing slash
71
+
72
+ ## [0.4.1] - 2018-05-15
73
+ ### Fixed
74
+ - Util.Url: fixing error when path is also host root
75
+
76
+ ## [0.4.0] - 2018-05-15
77
+ ### Added
78
+ - Util.Url: implementing Url utility class ! with all unit tests needed
79
+ - Tests: adding unit tests for Util\JsonLd class
80
+
81
+ ## [0.3.1] - 2018-05-11
82
+ ### Changed
83
+ - Translate: when response if not array, we throw an ApiError
84
+ ### Fixed
85
+ - Parser: if simple_html_dom can't parse the HTML, we return raw HTML with no modifications
86
+
87
+ ## [0.3] - 2018-05-07
88
+ ### Added
89
+ - Client: Adding bundled CA cert for cURL
90
+ ### Changed
91
+ - Travis: Improving script (cleaner / easier to understand)
92
+ - Client: Guzzle removed in favor of cURL implementation
93
+
94
+ ## [0.2.2] - 2018-05-07
95
+ ### Fixed
96
+ - Translate/Cache: Cached words aren't unique anymore (before, only one pair could work)
97
+
98
+ ## [0.2.1] - 2018-04-30
99
+ ### Fixed
100
+ - Parser: Excluding php tags from text checker
101
+
102
+ ## [0.2] - 2018-04-26
103
+ ### Added
104
+ - Util to fetch Site contents through `Site::get`
105
+ - cURL & OpenSSL versions inside user-agent for debugging purposes
106
+
107
+ ### Changed
108
+ - Parser: excludeBlocks formatter is started only if we have excludeBlocks
109
+ - Parser: adding DomCheckerProvider to Parser. Like that people can add their own Checkers
110
+ - README: updated getting started to use Parser example, and adding documentation
111
+ - Caching: Improving granularity, we use cache on Endpoints to be able to cache words by words and not the full request
112
+ - Travis-CI: PHP 5.5 is no more in failures but don't run all caching tests
113
+ - CodeClimate: improving maintainability
114
+
115
+ ## [0.1.2] - 2018-04-19
116
+ ### Fixed
117
+ - \#7 : Parser - dynamic tooltip hover a link
118
+
119
+ ## [0.1.1] - 2018-04-18
120
+ ### Fixed
121
+ - ServerConfigProvider behavior changed: we do not load $_SERVER in __construct, it can disturb symfony service loading
122
+
123
+ ## [0.1] - 2018-04-16
124
+ ### Added
125
+ - CodeClimate configuration
126
+ - Travis configuration
127
+ - Manage API versions (through Profile class)
128
+ - Error abstraction
129
+ - Unit testing
130
+
131
+ ### Changed
132
+ - Refactoring for `Parser`
133
+ - Languages endpoint: now giving full list
134
+
135
+ ## [0.1-beta.2] - 2018-04-12
136
+ ### Added
137
+ - examples & descriptions:
138
+ - cached-client-translate
139
+ - parsing-web-page
140
+ - simple-client-languages
141
+ - simple-client-status
142
+ - simple-client-translate
143
+ - adding README, LICENCE, CODE_OF_CONDUCT, CONTRIBUTING and github templates
144
+
145
+ ## [0.1-beta.1] - 2018-04-11
146
+ ### Added
147
+ - first Client version
148
+ - first endpoints:
149
+ - Translate Endpoint
150
+ - Status Endpoint
151
+ - Languages Endpoint
152
+ - client Caching through PSR-6
153
+ - importing old Parser with some refactoring
vendor/weglot/weglot-php/CODE_OF_CONDUCT.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ education, socio-economic status, nationality, personal appearance, race,
10
+ religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at [support@weglot.com](mailto:support@weglot.com). All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
vendor/weglot/weglot-php/CONTRIBUTING.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Contributing
2
+
3
+ :+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
4
+
5
+ The following is a set of guidelines for contributing to Weglot and its packages, which are hosted in the [Weglot Organization](https://github.com/weglot) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
6
+
7
+ ### Opening an issue
8
+
9
+ Each repository provides a template for issues. First, we need to know if it's a bug report or a feature report.
10
+ Then what you expected to happen, a clear description of the problem you're facing, steps to reproduce and environment details: the client and language version are a big help.
11
+
12
+ ### Submitting a pull request
13
+
14
+ Keep your changes as focused as possible. If there are multiple changes you'd like to make,
15
+ please consider submitting them as separate pull requests unless they are related to each other.
16
+
17
+ Here are a few tips to increase the likelihood of being merged:
18
+
19
+ * Fill in [the required template](PULL_REQUEST_TEMPLATE.md)
20
+ * Do not include issue numbers in the PR title
21
+ * Include screenshots and animated GIFs in your pull request whenever possible.
22
+ * Follow our [code styleguide](#styleguides).
23
+ * Document new code based on PHPDoc.
24
+ * Write tests.
25
+ * Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
26
+
27
+ ### Styleguides
28
+
29
+ Generally, we follow the style guidelines as suggested by the official language.
30
+ However, we ask that you conform to the styles that already exist in the library.
31
+ If you wish to deviate, please explain your reasoning.
32
+
33
+ - [PSR1 Basic Coding Standard](https://www.php-fig.org/psr/psr-1/)
34
+ - [PSR2 Coding Style Guide](https://www.php-fig.org/psr/psr-2/)
35
+ - Forcing array with short syntax: `[]`
36
+ - Replace control structure alternative syntax to use braces.
37
+
38
+ Please run your code through:
39
+ [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)
40
+
41
+ We provide configuration for this tool through [`.php_cs`](./.php_cs) file.
42
+
43
+ ### Security issues
44
+ If you find any security risk in the project, please open an issue or contact us at `support@weglot.com` regarding the impact.
45
+
46
+ ### API Breaking changes
47
+ We care deeply about backward compatibility for our API clients libraries.
48
+ If it's necessary, we're ready to break backward compatibility,
49
+ but this should be pretty rare.
50
+
51
+ If you want to make a change that will break the backward compatibility of the API,
52
+ open an issue first to discuss it with the maintainers.
53
+
54
+ ## Resources
55
+ - [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/)
56
+ - [Using Pull Requests](https://help.github.com/articles/using-pull-requests/)
57
+ - [GitHub Help](https://help.github.com)
vendor/weglot/weglot-php/LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Weglot
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
vendor/weglot/weglot-php/README.md ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- logo -->
2
+ <img src="https://cdn.weglot.com/logo/logo-hor.png" height="40" />
3
+
4
+ # PHP library
5
+
6
+ <!-- tags -->
7
+ [![WeglotSlack](https://weglot-community.now.sh/badge.svg)](https://weglot-community.now.sh/)
8
+ [![Latest Stable Version](https://poser.pugx.org/weglot/weglot-php/v/stable)](https://packagist.org/packages/weglot/weglot-php)
9
+ [![BuildStatus](https://travis-ci.com/weglot/weglot-php.svg?branch=develop)](https://travis-ci.com/weglot/weglot-php)
10
+ [![Code Climate](https://codeclimate.com/github/weglot/weglot-php/badges/gpa.svg)](https://codeclimate.com/github/weglot/weglot-php)
11
+ [![License](https://poser.pugx.org/weglot/weglot-php/license)](https://packagist.org/packages/weglot/weglot-php)
12
+
13
+ ## Overview
14
+ This library allows you to quickly and easily use the Weglot API via PHP. It handle all communication with Weglot API and gives you a [fully functional Parser](#getting-started) to handle HTML pages easily.
15
+
16
+ ## Requirements
17
+ - PHP version 5.4 and later
18
+ - Weglot API Key, starting at [free level](https://dashboard.weglot.com/register?origin=9)
19
+
20
+ ## Installation
21
+ You can install the library via [Composer](https://getcomposer.org/). Run the following command:
22
+
23
+ ```bash
24
+ composer require weglot/weglot-php
25
+ ```
26
+
27
+ To use the library, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):
28
+
29
+ ```php
30
+ require_once __DIR__. '/vendor/autoload.php';
31
+ ```
32
+
33
+ ## Getting Started
34
+
35
+ Simple usage of `Parser`:
36
+
37
+ ```php
38
+ // Url to parse
39
+ $url = 'https://foo.bar/baz';
40
+
41
+ // Config with $_SERVER variables
42
+ $config = new ServerConfigProvider();
43
+
44
+ // Fetching url content
45
+ $content = '...';
46
+
47
+ // Client
48
+ $client = new Client(getenv('WG_API_KEY'));
49
+ $parser = new Parser($client, $config);
50
+
51
+ // Run the Parser
52
+ $translatedContent = $parser->translate($content, 'en', 'de');
53
+ ```
54
+
55
+ For more details, check at [corresponding example](./examples/parsing-web-page/run.php) or at [documentation](https://weglot.github.io/documentation/#parser).
56
+
57
+ ## Examples
58
+
59
+ For more usage examples, such as: other endpoints, caching, parsing.
60
+
61
+ You can take a look at: [examples](./examples) folder. You'll find a short README with details about each example.
62
+
63
+ ## Reference
64
+
65
+ ### Client
66
+
67
+ The Client is all the classes related with communication with the Weglot API
68
+
69
+ #### Client & Profile
70
+
71
+ `Weglot\Client\Client` is the main class of this library.
72
+ Basically it manage requests, and that's all.
73
+
74
+ With this class we have `Weglot\Client\Profile` which represent particularities based on API Key length.
75
+ Today we have 2 types of API Keys:
76
+ - 35-char API Keys: Normal API Keys with no custom functions enabled.
77
+ - 36-char API Keys: Adding `ignoredNodes` behavior, basically we skip some tags from being parsed as sentences (such as `strong`, `em`, ...) to make bigger sentences.
78
+
79
+ #### API
80
+
81
+ Includes all the objects to talk with the API (as input or output).
82
+ - `Weglot\Client\Api\WordEntry`: Define a single sentence within an API Object
83
+ - `Weglot\Client\Api\WordCollection`: Define multiple `WordEntry`
84
+ - `Weglot\Client\Api\LanguageEntry`: Define a single language within an API Object
85
+ - `Weglot\Client\Api\LanguageCollection`: Define multiple `LanguageEntry`
86
+ - `Weglot\Client\Api\TranslateEntry`: Define a translate interface to use as input/output of `/translate` endpoint
87
+
88
+ Here is some quick example of using some of theses:
89
+ ```php
90
+ // creating some WordEntry objects
91
+ $firstWord = new WordEntry('This is a blue car', WordType::TEXT);
92
+ $secondWord = new WordEntry('This is a black car', WordType::TEXT);
93
+
94
+ // then create our TranslateEntry object to use later with /translate
95
+ $translateEntry = new TranslateEntry([
96
+ 'language_from' => 'en',
97
+ 'language_to' => 'de',
98
+ 'title' => 'Weglot | Translate your website - Multilingual for WordPress, Shopify, ...',
99
+ 'request_url' => 'https://weglot.com/',
100
+ 'bot' => BotType::HUMAN
101
+ ]);
102
+ $translateEntry->getInputWords()->addMany([$firstWord, $secondWord]);
103
+ ```
104
+
105
+ Like you just saw, you can find quick Enums to set API-related data easier, like theses:
106
+ - `Weglot\Client\Api\Enum\WordType`: Used to provide context over where the text we wish to translate comes from.
107
+ - `Weglot\Client\Api\Enum\BotType`: Used to define the source of a request.
108
+
109
+ #### Caching
110
+
111
+ We manage Cache with one main interface: `Weglot\Client\Caching\CacheInterface` it use [PSR-6 RFC](https://www.php-fig.org/psr/psr-6/) internally.
112
+
113
+ We added one implementation of this interface within the `Weglot\Client\Caching\Cache` class which takes a PSR-6 `CacheItemPoolInterface` as store.
114
+ You can set this one from a Client method as following:
115
+ ```php
116
+ $client = new Client('wg_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
117
+ $client->setCacheItemPool($myCacheItemPool);
118
+ ```
119
+ The given `$myCacheItemPool` can be any PSR-6 compliant object. I suggest to consult [php-cache](http://www.php-cache.com/en/latest/#cache-pool-implementations) cache pool implementations that should contains the library you need to plug your cache.
120
+
121
+ #### Endpoint
122
+
123
+ Here are the class to talk with API endpoints. Today we have 3 of them:
124
+ - `Weglot\Client\Endpoint\Translate`: Used to make requests with the `/translate` endpoint
125
+ - `Weglot\Client\Endpoint\Status`: Used to make requests with the `/status` endpoint
126
+ - `Weglot\Client\Endpoint\Languages`: Which is used to get all languages-related data from a "fake" API
127
+
128
+ Following our example from API Objects, here is how to use `Translate` class:
129
+ ```php
130
+ $client = new Client('wg_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
131
+ $translateEntry = new TranslateEntry(...); // Check API part for more details about this one
132
+
133
+ $translate = new Translate($translateEntry, $client);
134
+ $translated = $translate->handle();
135
+ ```
136
+ Following this example, the `$translated` object will contain a `TranslateEntry` object with all data returned from the API.
137
+ You can find [a full working example here](./examples/simple-client-translate/)
138
+
139
+ #### Factory
140
+
141
+ Theses are classes used between the endpoints classes and the returned API object.
142
+ It handles all conversion from the API that return JSON to the well formated API object.
143
+
144
+ No example here since it's only used internally.
145
+
146
+ #### HttpClient
147
+
148
+ Another internal set of classes.
149
+
150
+ Theses are composed by a simple interface to manage requests: `Weglot\Client\HttpClient`
151
+ And an implementation with cURL as the HTTP provider: `Weglot\Client\CurlClient` (this class is actually heavily inspired by Stripe's CurlClient)
152
+
153
+ ### Parser
154
+
155
+ The Parser is a big part in our developer kits.
156
+
157
+ It's used to match sentences to translate from DOM and to make clean API objects to send them after through the Client.
158
+
159
+ There is no documentation for the Parser at the moment since we plan a heavy rework in next month on it, we'll make sure there is one after this rework.
160
+
161
+ ### Util
162
+
163
+ There is some short classes to manage simple utilities such as:
164
+
165
+ #### Weglot\Util\JsonLd
166
+ Manage all actions related to recover & storing data in JsonLd structures
167
+
168
+ #### Weglot\Util\Server
169
+ All $_SERVER related utilities
170
+
171
+ ```php
172
+ $fullUrl = Server::fullUrl($_SERVER);
173
+ // will return the current url seen by $_SERVER, for example: https://weglot.com/es/pricing
174
+ ```
175
+
176
+ #### Weglot\Util\Site
177
+ Used to get contents from a distant website
178
+
179
+ #### Weglot\Util\Text
180
+ All classic Text utilities such as `contains()`
181
+
182
+ #### Weglot\Util\Url
183
+
184
+ And we've `Weglot\Util\Url` which is one of the cornerstone of url managment in our library. By fetching current url and Weglot configuration, it can serve several purposes:
185
+ - Know which language we have on the current url
186
+ - Generate urls for other languages
187
+ - Know if current url is translable or not (based on excludedUrls)
188
+ - Get all translated urls based on current url
189
+ - Generate hreflang tags based on all translated urls
190
+
191
+ Here is some quick examples:
192
+ ```php
193
+ $url = new Url('https://weglot.com/es/pricing', 'en', ['fr', 'es', 'de']);
194
+
195
+ $currentLang = $url->detectCurrentLanguage();
196
+ // $currentLang will contain 'es'
197
+
198
+ $frUrl = $url->getForLanguage('fr');
199
+ // $frUrl will contain 'https://weglot.com/fr/pricing'
200
+
201
+ $translable = $url->isTranslable();
202
+ // $translable will contain true since we have no excluded urls
203
+
204
+ $url->setExcludedUrls(['/pricing']);
205
+ $translable = $url->isTranslable();
206
+ // $translable will contain false since we added `/pricing` to the excluded urls
207
+
208
+ $urls = $url->currentRequestAllUrls();
209
+ /**
210
+ * $urls will contain following array:
211
+ * Array(
212
+ * 'en' => 'https://weglot.com/pricing',
213
+ * 'fr' => 'https://weglot.com/fr/pricing',
214
+ * 'es' => 'https://weglot.com/es/pricing',
215
+ * 'de' => 'https://weglot.com/de/pricing'
216
+ * );
217
+ */
218
+
219
+ $hreflang = $url->generateHrefLangsTags()
220
+ /**
221
+ * $hreflang will contain following string:
222
+ * <link rel="alternate" href="https://weglot.com/pricing" hreflang="en"/>
223
+ * <link rel="alternate" href="https://weglot.com/fr/pricing" hreflang="fr"/>
224
+ * <link rel="alternate" href="https://weglot.com/es/pricing" hreflang="es"/>
225
+ * <link rel="alternate" href="https://weglot.com/de/pricing" hreflang="de"/>
226
+ */
227
+ ```
228
+
229
+ ## About
230
+ `weglot-php` is guided and supported by the Weglot Developer Team.
231
+
232
+ `weglot-php` is maintained and funded by Weglot SAS.
233
+ The names and logos for `weglot-php` are trademarks of Weglot SAS.
234
+
235
+ ## License
236
+ [The MIT License (MIT)](LICENSE.txt)
vendor/weglot/weglot-php/codeception.yml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ paths:
2
+ tests: tests
3
+ output: tests/_output
4
+ data: tests/_data
5
+ support: tests/_support
6
+ envs: tests/_envs
7
+ coverage:
8
+ enabled: true
9
+ include:
10
+ - src/*
11
+ actor_suffix: Tester
12
+ extensions:
13
+ enabled:
14
+ - Codeception\Extension\RunFailed
15
+ params:
16
+ - .env
vendor/weglot/weglot-php/composer.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "weglot/weglot-php",
3
+ "description": "PHP library for the Weglot API",
4
+ "homepage": "https://weglot.com/",
5
+ "type": "library",
6
+ "license": "MIT",
7
+ "authors": [
8
+ {
9
+ "name": "Baptiste Leduc",
10
+ "email": "baptiste@weglot.com",
11
+ "homepage": "https://baptiste-leduc.now.sh/",
12
+ "role": "Developer"
13
+ },
14
+ {
15
+ "name": "Thomas Deneulin",
16
+ "email": "thomas@weglot.com",
17
+ "role": "Review"
18
+ }
19
+ ],
20
+ "support": {
21
+ "email": "support@weglot.com",
22
+ "source": "https://github.com/weglot/weglot-php",
23
+ "docs": "https://weglot.github.io/weglot-documentation/"
24
+ },
25
+ "keywords": [
26
+ "php",
27
+ "weglot",
28
+ "weglot-library",
29
+ "translate",
30
+ "translation",
31
+ "translator",
32
+ "localization",
33
+ "languages",
34
+ "i18n"
35
+ ],
36
+ "require": {
37
+ "php": ">=5.4",
38
+ "weglot/simplehtmldom": "^0.3",
39
+ "psr/cache": "^1.0"
40
+ },
41
+ "autoload": {
42
+ "psr-4": {
43
+ "Weglot\\": "src/"
44
+ }
45
+ },
46
+ "require-dev": {
47
+ "vlucas/phpdotenv": "^2.4",
48
+ "codeception/codeception": "^2.4"
49
+ }
50
+ }
vendor/weglot/weglot-php/data/ca-certificates.crt ADDED
@@ -0,0 +1,3338 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ##
2
+ ## Bundle of CA Root Certificates
3
+ ##
4
+ ## Certificate data from Mozilla as of: Wed Mar 7 04:12:06 2018 GMT
5
+ ##
6
+ ## This is a bundle of X.509 certificates of public Certificate Authorities
7
+ ## (CA). These were automatically extracted from Mozilla's root certificates
8
+ ## file (certdata.txt). This file can be found in the mozilla source tree:
9
+ ## https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt
10
+ ##
11
+ ## It contains the certificates in PEM format and therefore
12
+ ## can be directly used with curl / libcurl / php_curl, or with
13
+ ## an Apache+mod_ssl webserver for SSL client authentication.
14
+ ## Just configure this file as the SSLCACertificateFile.
15
+ ##
16
+ ## Conversion done with mk-ca-bundle.pl version 1.27.
17
+ ## SHA256: 704f02707ec6b4c4a7597a8c6039b020def11e64f3ef0605a9c3543d48038a57
18
+ ##
19
+
20
+
21
+ GlobalSign Root CA
22
+ ==================
23
+ -----BEGIN CERTIFICATE-----
24
+ MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx
25
+ GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds
26
+ b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV
27
+ BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD
28
+ VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa
29
+ DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc
30
+ THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb
31
+ Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP
32
+ c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX
33
+ gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV
34
+ HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF
35
+ AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj
36
+ Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG
37
+ j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH
38
+ hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC
39
+ X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
40
+ -----END CERTIFICATE-----
41
+
42
+ GlobalSign Root CA - R2
43
+ =======================
44
+ -----BEGIN CERTIFICATE-----
45
+ MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv
46
+ YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh
47
+ bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT
48
+ aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln
49
+ bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6
50
+ ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp
51
+ s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN
52
+ S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL
53
+ TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C
54
+ ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E
55
+ FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i
56
+ YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN
57
+ BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp
58
+ 9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu
59
+ 01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7
60
+ 9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7
61
+ TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==
62
+ -----END CERTIFICATE-----
63
+
64
+ Verisign Class 3 Public Primary Certification Authority - G3
65
+ ============================================================
66
+ -----BEGIN CERTIFICATE-----
67
+ MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
68
+ UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
69
+ cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
70
+ IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh
71
+ dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw
72
+ CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
73
+ dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv
74
+ cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg
75
+ Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
76
+ ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1
77
+ EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc
78
+ cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw
79
+ EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj
80
+ 055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
81
+ ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f
82
+ j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC
83
+ /Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0
84
+ xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa
85
+ t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
86
+ -----END CERTIFICATE-----
87
+
88
+ Entrust.net Premium 2048 Secure Server CA
89
+ =========================================
90
+ -----BEGIN CERTIFICATE-----
91
+ MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u
92
+ ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp
93
+ bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV
94
+ BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx
95
+ NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3
96
+ d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl
97
+ MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u
98
+ ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
99
+ MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL
100
+ Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr
101
+ hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW
102
+ nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi
103
+ VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E
104
+ BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ
105
+ KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy
106
+ T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf
107
+ zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT
108
+ J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e
109
+ nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE=
110
+ -----END CERTIFICATE-----
111
+
112
+ Baltimore CyberTrust Root
113
+ =========================
114
+ -----BEGIN CERTIFICATE-----
115
+ MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE
116
+ ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li
117
+ ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC
118
+ SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs
119
+ dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME
120
+ uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB
121
+ UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C
122
+ G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9
123
+ XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr
124
+ l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI
125
+ VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB
126
+ BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh
127
+ cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5
128
+ hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa
129
+ Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H
130
+ RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
131
+ -----END CERTIFICATE-----
132
+
133
+ AddTrust External Root
134
+ ======================
135
+ -----BEGIN CERTIFICATE-----
136
+ MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
137
+ QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD
138
+ VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw
139
+ NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU
140
+ cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg
141
+ Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821
142
+ +iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw
143
+ Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo
144
+ aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy
145
+ 2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7
146
+ 7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P
147
+ BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL
148
+ VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk
149
+ VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB
150
+ IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl
151
+ j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
152
+ 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355
153
+ e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u
154
+ G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
155
+ -----END CERTIFICATE-----
156
+
157
+ Entrust Root Certification Authority
158
+ ====================================
159
+ -----BEGIN CERTIFICATE-----
160
+ MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV
161
+ BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw
162
+ b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG
163
+ A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0
164
+ MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu
165
+ MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu
166
+ Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v
167
+ dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
168
+ ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz
169
+ A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww
170
+ Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68
171
+ j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN
172
+ rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw
173
+ DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1
174
+ MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH
175
+ hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA
176
+ A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM
177
+ Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa
178
+ v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS
179
+ W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0
180
+ tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8
181
+ -----END CERTIFICATE-----
182
+
183
+ GeoTrust Global CA
184
+ ==================
185
+ -----BEGIN CERTIFICATE-----
186
+ MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK
187
+ Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw
188
+ MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j
189
+ LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
190
+ CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo
191
+ BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet
192
+ 8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc
193
+ T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU
194
+ vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD
195
+ AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk
196
+ DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q
197
+ zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4
198
+ d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2
199
+ mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p
200
+ XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm
201
+ Mw==
202
+ -----END CERTIFICATE-----
203
+
204
+ GeoTrust Universal CA
205
+ =====================
206
+ -----BEGIN CERTIFICATE-----
207
+ MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN
208
+ R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1
209
+ MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu
210
+ Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP
211
+ ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t
212
+ JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e
213
+ RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs
214
+ 7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d
215
+ 8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V
216
+ qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga
217
+ Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB
218
+ Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu
219
+ KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08
220
+ ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0
221
+ XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB
222
+ hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc
223
+ aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2
224
+ qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL
225
+ oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK
226
+ xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF
227
+ KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2
228
+ DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK
229
+ xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU
230
+ p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI
231
+ P/rmMuGNG2+k5o7Y+SlIis5z/iw=
232
+ -----END CERTIFICATE-----
233
+
234
+ GeoTrust Universal CA 2
235
+ =======================
236
+ -----BEGIN CERTIFICATE-----
237
+ MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN
238
+ R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0
239
+ MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg
240
+ SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA
241
+ A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0
242
+ DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17
243
+ j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q
244
+ JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a
245
+ QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2
246
+ WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP
247
+ 20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn
248
+ ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC
249
+ SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG
250
+ 8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2
251
+ +/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E
252
+ BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z
253
+ dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ
254
+ 4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+
255
+ mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq
256
+ A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg
257
+ Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP
258
+ pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d
259
+ FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp
260
+ gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm
261
+ X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS
262
+ -----END CERTIFICATE-----
263
+
264
+ Visa eCommerce Root
265
+ ===================
266
+ -----BEGIN CERTIFICATE-----
267
+ MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG
268
+ EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug
269
+ QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2
270
+ WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm
271
+ VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv
272
+ bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL
273
+ F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b
274
+ RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0
275
+ TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI
276
+ /k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs
277
+ GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG
278
+ MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc
279
+ CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW
280
+ YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz
281
+ zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu
282
+ YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt
283
+ 398znM/jra6O1I7mT1GvFpLgXPYHDw==
284
+ -----END CERTIFICATE-----
285
+
286
+ Comodo AAA Services root
287
+ ========================
288
+ -----BEGIN CERTIFICATE-----
289
+ MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS
290
+ R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg
291
+ TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw
292
+ MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl
293
+ c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV
294
+ BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
295
+ ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG
296
+ C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs
297
+ i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW
298
+ Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH
299
+ Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK
300
+ Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f
301
+ BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl
302
+ cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz
303
+ LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm
304
+ 7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz
305
+ Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z
306
+ 8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C
307
+ 12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
308
+ -----END CERTIFICATE-----
309
+
310
+ QuoVadis Root CA
311
+ ================
312
+ -----BEGIN CERTIFICATE-----
313
+ MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE
314
+ ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
315
+ eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz
316
+ MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp
317
+ cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD
318
+ EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF
319
+ AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk
320
+ J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL
321
+ F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL
322
+ YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen
323
+ AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w
324
+ PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y
325
+ ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7
326
+ MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj
327
+ YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs
328
+ ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh
329
+ Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW
330
+ Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu
331
+ BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw
332
+ FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0
333
+ aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6
334
+ tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo
335
+ fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul
336
+ LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x
337
+ gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi
338
+ 5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi
339
+ 5nrQNiOKSnQ2+Q==
340
+ -----END CERTIFICATE-----
341
+
342
+ QuoVadis Root CA 2
343
+ ==================
344
+ -----BEGIN CERTIFICATE-----
345
+ MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT
346
+ EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx
347
+ ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
348
+ aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC
349
+ DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6
350
+ XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk
351
+ lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB
352
+ lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy
353
+ lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt
354
+ 66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn
355
+ wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh
356
+ D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy
357
+ BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie
358
+ J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud
359
+ DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU
360
+ a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT
361
+ ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv
362
+ Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3
363
+ UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm
364
+ VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK
365
+ +JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW
366
+ IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1
367
+ WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X
368
+ f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II
369
+ 4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8
370
+ VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u
371
+ -----END CERTIFICATE-----
372
+
373
+ QuoVadis Root CA 3
374
+ ==================
375
+ -----BEGIN CERTIFICATE-----
376
+ MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT
377
+ EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx
378
+ OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
379
+ aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC
380
+ DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg
381
+ DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij
382
+ KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K
383
+ DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv
384
+ BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp
385
+ p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8
386
+ nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX
387
+ MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM
388
+ Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz
389
+ uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT
390
+ BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj
391
+ YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0
392
+ aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB
393
+ BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD
394
+ VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4
395
+ ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE
396
+ AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV
397
+ qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s
398
+ hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z
399
+ POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2
400
+ Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp
401
+ 8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC
402
+ bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu
403
+ g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p
404
+ vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr
405
+ qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto=
406
+ -----END CERTIFICATE-----
407
+
408
+ Security Communication Root CA
409
+ ==============================
410
+ -----BEGIN CERTIFICATE-----
411
+ MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP
412
+ U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw
413
+ HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP
414
+ U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw
415
+ ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw
416
+ 8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM
417
+ DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX
418
+ 5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd
419
+ DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2
420
+ JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw
421
+ DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g
422
+ 0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a
423
+ mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ
424
+ s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ
425
+ 6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi
426
+ FL39vmwLAw==
427
+ -----END CERTIFICATE-----
428
+
429
+ Sonera Class 2 Root CA
430
+ ======================
431
+ -----BEGIN CERTIFICATE-----
432
+ MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG
433
+ U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw
434
+ NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh
435
+ IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3
436
+ /Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT
437
+ dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG
438
+ f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P
439
+ tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH
440
+ nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT
441
+ XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt
442
+ 0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI
443
+ cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph
444
+ Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx
445
+ EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH
446
+ llpwrN9M
447
+ -----END CERTIFICATE-----
448
+
449
+ XRamp Global CA Root
450
+ ====================
451
+ -----BEGIN CERTIFICATE-----
452
+ MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE
453
+ BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj
454
+ dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB
455
+ dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx
456
+ HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg
457
+ U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp
458
+ dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu
459
+ IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx
460
+ foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE
461
+ zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs
462
+ AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry
463
+ xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud
464
+ EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap
465
+ oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC
466
+ AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc
467
+ /Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt
468
+ qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n
469
+ nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz
470
+ 8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw=
471
+ -----END CERTIFICATE-----
472
+
473
+ Go Daddy Class 2 CA
474
+ ===================
475
+ -----BEGIN CERTIFICATE-----
476
+ MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY
477
+ VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp
478
+ ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG
479
+ A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g
480
+ RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD
481
+ ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv
482
+ 2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32
483
+ qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j
484
+ YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY
485
+ vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O
486
+ BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o
487
+ atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu
488
+ MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG
489
+ A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim
490
+ PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt
491
+ I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
492
+ HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI
493
+ Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b
494
+ vZ8=
495
+ -----END CERTIFICATE-----
496
+
497
+ Starfield Class 2 CA
498
+ ====================
499
+ -----BEGIN CERTIFICATE-----
500
+ MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc
501
+ U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg
502
+ Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo
503
+ MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG
504
+ A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG
505
+ SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY
506
+ bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ
507
+ JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm
508
+ epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN
509
+ F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF
510
+ MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f
511
+ hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo
512
+ bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g
513
+ QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs
514
+ afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM
515
+ PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl
516
+ xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD
517
+ KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3
518
+ QBFGmh95DmK/D5fs4C8fF5Q=
519
+ -----END CERTIFICATE-----
520
+
521
+ Taiwan GRCA
522
+ ===========
523
+ -----BEGIN CERTIFICATE-----
524
+ MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG
525
+ EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X
526
+ DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv
527
+ dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD
528
+ ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN
529
+ w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5
530
+ BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O
531
+ 1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO
532
+ htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov
533
+ J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7
534
+ Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t
535
+ B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB
536
+ O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8
537
+ lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV
538
+ HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2
539
+ 09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ
540
+ TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj
541
+ Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2
542
+ Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU
543
+ D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz
544
+ DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk
545
+ Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk
546
+ 7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ
547
+ CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy
548
+ +fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS
549
+ -----END CERTIFICATE-----
550
+
551
+ DigiCert Assured ID Root CA
552
+ ===========================
553
+ -----BEGIN CERTIFICATE-----
554
+ MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG
555
+ EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw
556
+ IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx
557
+ MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL
558
+ ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew
559
+ ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO
560
+ 9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy
561
+ UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW
562
+ /lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy
563
+ oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf
564
+ GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF
565
+ 66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq
566
+ hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc
567
+ EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn
568
+ SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i
569
+ 8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe
570
+ +o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==
571
+ -----END CERTIFICATE-----
572
+
573
+ DigiCert Global Root CA
574
+ =======================
575
+ -----BEGIN CERTIFICATE-----
576
+ MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG
577
+ EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw
578
+ HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw
579
+ MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3
580
+ dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq
581
+ hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn
582
+ TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5
583
+ BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H
584
+ 4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y
585
+ 7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB
586
+ o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm
587
+ 8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF
588
+ BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr
589
+ EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt
590
+ tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886
591
+ UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
592
+ CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
593
+ -----END CERTIFICATE-----
594
+
595
+ DigiCert High Assurance EV Root CA
596
+ ==================================
597
+ -----BEGIN CERTIFICATE-----
598
+ MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG
599
+ EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw
600
+ KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw
601
+ MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ
602
+ MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu
603
+ Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t
604
+ Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS
605
+ OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3
606
+ MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ
607
+ NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe
608
+ h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB
609
+ Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY
610
+ JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ
611
+ V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp
612
+ myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK
613
+ mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
614
+ vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K
615
+ -----END CERTIFICATE-----
616
+
617
+ Certplus Class 2 Primary CA
618
+ ===========================
619
+ -----BEGIN CERTIFICATE-----
620
+ MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE
621
+ BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN
622
+ OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy
623
+ dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP
624
+ ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR
625
+ 5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ
626
+ Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO
627
+ YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e
628
+ e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME
629
+ CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ
630
+ YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t
631
+ L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD
632
+ P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R
633
+ TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+
634
+ 7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW
635
+ //1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7
636
+ l7+ijrRU
637
+ -----END CERTIFICATE-----
638
+
639
+ DST Root CA X3
640
+ ==============
641
+ -----BEGIN CERTIFICATE-----
642
+ MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK
643
+ ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X
644
+ DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1
645
+ cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD
646
+ ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT
647
+ rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9
648
+ UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy
649
+ xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d
650
+ utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T
651
+ AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ
652
+ MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug
653
+ dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE
654
+ GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw
655
+ RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS
656
+ fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
657
+ -----END CERTIFICATE-----
658
+
659
+ SwissSign Gold CA - G2
660
+ ======================
661
+ -----BEGIN CERTIFICATE-----
662
+ MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw
663
+ EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN
664
+ MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp
665
+ c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B
666
+ AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq
667
+ t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C
668
+ jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg
669
+ vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF
670
+ ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR
671
+ AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend
672
+ jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO
673
+ peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR
674
+ 7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi
675
+ GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw
676
+ AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64
677
+ OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov
678
+ L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm
679
+ 5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr
680
+ 44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf
681
+ Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m
682
+ Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp
683
+ mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk
684
+ vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf
685
+ KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br
686
+ NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj
687
+ viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ
688
+ -----END CERTIFICATE-----
689
+
690
+ SwissSign Silver CA - G2
691
+ ========================
692
+ -----BEGIN CERTIFICATE-----
693
+ MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT
694
+ BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X
695
+ DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3
696
+ aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG
697
+ 9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644
698
+ N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm
699
+ +/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH
700
+ 6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu
701
+ MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h
702
+ qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5
703
+ FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs
704
+ ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc
705
+ celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X
706
+ CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/
707
+ BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB
708
+ tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0
709
+ cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P
710
+ 4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F
711
+ kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L
712
+ 3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx
713
+ /uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa
714
+ DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP
715
+ e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu
716
+ WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ
717
+ DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub
718
+ DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u
719
+ -----END CERTIFICATE-----
720
+
721
+ GeoTrust Primary Certification Authority
722
+ ========================================
723
+ -----BEGIN CERTIFICATE-----
724
+ MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG
725
+ EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD
726
+ ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx
727
+ CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ
728
+ cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
729
+ CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN
730
+ b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9
731
+ nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge
732
+ RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt
733
+ tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD
734
+ AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI
735
+ hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K
736
+ Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN
737
+ NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa
738
+ Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG
739
+ 1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk=
740
+ -----END CERTIFICATE-----
741
+
742
+ thawte Primary Root CA
743
+ ======================
744
+ -----BEGIN CERTIFICATE-----
745
+ MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE
746
+ BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2
747
+ aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv
748
+ cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3
749
+ MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg
750
+ SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv
751
+ KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT
752
+ FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs
753
+ oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ
754
+ 1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc
755
+ q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K
756
+ aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p
757
+ afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD
758
+ VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF
759
+ AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE
760
+ uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX
761
+ xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89
762
+ jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH
763
+ z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA==
764
+ -----END CERTIFICATE-----
765
+
766
+ VeriSign Class 3 Public Primary Certification Authority - G5
767
+ ============================================================
768
+ -----BEGIN CERTIFICATE-----
769
+ MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE
770
+ BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
771
+ ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
772
+ IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp
773
+ ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB
774
+ yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
775
+ biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh
776
+ dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt
777
+ YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
778
+ ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz
779
+ j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD
780
+ Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/
781
+ Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r
782
+ fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/
783
+ BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv
784
+ Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy
785
+ aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG
786
+ SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+
787
+ X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE
788
+ KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC
789
+ Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE
790
+ ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq
791
+ -----END CERTIFICATE-----
792
+
793
+ SecureTrust CA
794
+ ==============
795
+ -----BEGIN CERTIFICATE-----
796
+ MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG
797
+ EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy
798
+ dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe
799
+ BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC
800
+ ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX
801
+ OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t
802
+ DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH
803
+ GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b
804
+ 01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH
805
+ ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/
806
+ BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj
807
+ aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ
808
+ KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu
809
+ SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf
810
+ mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ
811
+ nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR
812
+ 3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE=
813
+ -----END CERTIFICATE-----
814
+
815
+ Secure Global CA
816
+ ================
817
+ -----BEGIN CERTIFICATE-----
818
+ MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG
819
+ EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH
820
+ bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg
821
+ MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg
822
+ Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx
823
+ YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ
824
+ bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g
825
+ 8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV
826
+ HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi
827
+ 0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud
828
+ EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn
829
+ oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA
830
+ MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+
831
+ OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn
832
+ CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5
833
+ 3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc
834
+ f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW
835
+ -----END CERTIFICATE-----
836
+
837
+ COMODO Certification Authority
838
+ ==============================
839
+ -----BEGIN CERTIFICATE-----
840
+ MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE
841
+ BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG
842
+ A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1
843
+ dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb
844
+ MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD
845
+ T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5
846
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH
847
+ +7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww
848
+ xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV
849
+ 4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA
850
+ 1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI
851
+ rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E
852
+ BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k
853
+ b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC
854
+ AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP
855
+ OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/
856
+ RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc
857
+ IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN
858
+ +8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ==
859
+ -----END CERTIFICATE-----
860
+
861
+ Network Solutions Certificate Authority
862
+ =======================================
863
+ -----BEGIN CERTIFICATE-----
864
+ MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG
865
+ EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr
866
+ IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx
867
+ MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu
868
+ MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G
869
+ CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx
870
+ jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT
871
+ aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT
872
+ crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc
873
+ /Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB
874
+ AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP
875
+ BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv
876
+ bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA
877
+ A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q
878
+ 4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/
879
+ GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv
880
+ wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD
881
+ ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey
882
+ -----END CERTIFICATE-----
883
+
884
+ COMODO ECC Certification Authority
885
+ ==================================
886
+ -----BEGIN CERTIFICATE-----
887
+ MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC
888
+ R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE
889
+ ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB
890
+ dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix
891
+ GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR
892
+ Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo
893
+ b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X
894
+ 4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni
895
+ wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E
896
+ BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG
897
+ FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA
898
+ U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=
899
+ -----END CERTIFICATE-----
900
+
901
+ OISTE WISeKey Global Root GA CA
902
+ ===============================
903
+ -----BEGIN CERTIFICATE-----
904
+ MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE
905
+ BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG
906
+ A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH
907
+ bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD
908
+ VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw
909
+ IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5
910
+ IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9
911
+ Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg
912
+ Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD
913
+ d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ
914
+ /yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R
915
+ LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw
916
+ AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ
917
+ KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm
918
+ MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4
919
+ +vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa
920
+ hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY
921
+ okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0=
922
+ -----END CERTIFICATE-----
923
+
924
+ Certigna
925
+ ========
926
+ -----BEGIN CERTIFICATE-----
927
+ MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw
928
+ EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3
929
+ MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI
930
+ Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q
931
+ XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH
932
+ GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p
933
+ ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg
934
+ DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf
935
+ Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ
936
+ tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ
937
+ BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J
938
+ SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA
939
+ hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+
940
+ ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu
941
+ PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY
942
+ 1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw
943
+ WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg==
944
+ -----END CERTIFICATE-----
945
+
946
+ Deutsche Telekom Root CA 2
947
+ ==========================
948
+ -----BEGIN CERTIFICATE-----
949
+ MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT
950
+ RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG
951
+ A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5
952
+ MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G
953
+ A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS
954
+ b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5
955
+ bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI
956
+ KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY
957
+ AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK
958
+ Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV
959
+ jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV
960
+ HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr
961
+ E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy
962
+ zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8
963
+ rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G
964
+ dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU
965
+ Cm26OWMohpLzGITY+9HPBVZkVw==
966
+ -----END CERTIFICATE-----
967
+
968
+ Cybertrust Global Root
969
+ ======================
970
+ -----BEGIN CERTIFICATE-----
971
+ MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li
972
+ ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4
973
+ MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD
974
+ ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
975
+ +Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW
976
+ 0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL
977
+ AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin
978
+ 89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT
979
+ 8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP
980
+ BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2
981
+ MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G
982
+ A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO
983
+ lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi
984
+ 5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2
985
+ hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T
986
+ X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW
987
+ WL1WMRJOEcgh4LMRkWXbtKaIOM5V
988
+ -----END CERTIFICATE-----
989
+
990
+ ePKI Root Certification Authority
991
+ =================================
992
+ -----BEGIN CERTIFICATE-----
993
+ MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG
994
+ EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg
995
+ Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx
996
+ MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq
997
+ MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B
998
+ AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs
999
+ IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi
1000
+ lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv
1001
+ qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX
1002
+ 12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O
1003
+ WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+
1004
+ ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao
1005
+ lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/
1006
+ vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi
1007
+ Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi
1008
+ MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH
1009
+ ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0
1010
+ 1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq
1011
+ KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV
1012
+ xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP
1013
+ NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r
1014
+ GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE
1015
+ xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx
1016
+ gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy
1017
+ sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD
1018
+ BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw=
1019
+ -----END CERTIFICATE-----
1020
+
1021
+ certSIGN ROOT CA
1022
+ ================
1023
+ -----BEGIN CERTIFICATE-----
1024
+ MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD
1025
+ VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa
1026
+ Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE
1027
+ CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I
1028
+ JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH
1029
+ rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2
1030
+ ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD
1031
+ 0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943
1032
+ AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B
1033
+ Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB
1034
+ AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8
1035
+ SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0
1036
+ x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt
1037
+ vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz
1038
+ TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD
1039
+ -----END CERTIFICATE-----
1040
+
1041
+ GeoTrust Primary Certification Authority - G3
1042
+ =============================================
1043
+ -----BEGIN CERTIFICATE-----
1044
+ MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE
1045
+ BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0
1046
+ IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy
1047
+ eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz
1048
+ NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo
1049
+ YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT
1050
+ LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI
1051
+ hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j
1052
+ K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE
1053
+ c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C
1054
+ IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu
1055
+ dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC
1056
+ MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr
1057
+ 2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9
1058
+ cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE
1059
+ Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD
1060
+ AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s
1061
+ t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt
1062
+ -----END CERTIFICATE-----
1063
+
1064
+ thawte Primary Root CA - G2
1065
+ ===========================
1066
+ -----BEGIN CERTIFICATE-----
1067
+ MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC
1068
+ VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu
1069
+ IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg
1070
+ Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV
1071
+ MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG
1072
+ b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt
1073
+ IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS
1074
+ LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5
1075
+ 8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU
1076
+ mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN
1077
+ G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K
1078
+ rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg==
1079
+ -----END CERTIFICATE-----
1080
+
1081
+ thawte Primary Root CA - G3
1082
+ ===========================
1083
+ -----BEGIN CERTIFICATE-----
1084
+ MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE
1085
+ BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2
1086
+ aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv
1087
+ c