rubyfox-server 2.16.3.2 → 2.17.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rubyfox/server/data/config/admin/admintool.xml +0 -0
  3. data/lib/rubyfox/server/data/config/admin/descriptors/config_room.txt +0 -0
  4. data/lib/rubyfox/server/data/config/admin/descriptors/config_server.txt +0 -0
  5. data/lib/rubyfox/server/data/config/admin/descriptors/config_zone.txt +0 -0
  6. data/lib/rubyfox/server/data/config/admin/descriptors/runtime_game.txt +0 -0
  7. data/lib/rubyfox/server/data/config/admin/descriptors/runtime_mmo.txt +0 -0
  8. data/lib/rubyfox/server/data/config/admin/descriptors/runtime_room.txt +0 -0
  9. data/lib/rubyfox/server/data/config/admin/descriptors/runtime_user.txt +0 -0
  10. data/lib/rubyfox/server/data/config/admin/descriptors/runtime_zone.txt +0 -0
  11. data/lib/rubyfox/server/data/config/admin/gmc/gmc.py +0 -0
  12. data/lib/rubyfox/server/data/config/admin/icons/Analytics.png +0 -0
  13. data/lib/rubyfox/server/data/config/admin/icons/Analytics.svg +0 -0
  14. data/lib/rubyfox/server/data/config/admin/icons/BanManager.png +0 -0
  15. data/lib/rubyfox/server/data/config/admin/icons/BanManager.svg +0 -0
  16. data/lib/rubyfox/server/data/config/admin/icons/BlueBoxMonitor.png +0 -0
  17. data/lib/rubyfox/server/data/config/admin/icons/BlueBoxMonitor.svg +0 -0
  18. data/lib/rubyfox/server/data/config/admin/icons/Console.png +0 -0
  19. data/lib/rubyfox/server/data/config/admin/icons/Console.svg +0 -0
  20. data/lib/rubyfox/server/data/config/admin/icons/Dashboard.png +0 -0
  21. data/lib/rubyfox/server/data/config/admin/icons/Dashboard.svg +0 -0
  22. data/lib/rubyfox/server/data/config/admin/icons/ExtensionManager.png +0 -0
  23. data/lib/rubyfox/server/data/config/admin/icons/ExtensionManager.svg +0 -0
  24. data/lib/rubyfox/server/data/config/admin/icons/LicenseManager.png +0 -0
  25. data/lib/rubyfox/server/data/config/admin/icons/LicenseManager.svg +0 -0
  26. data/lib/rubyfox/server/data/config/admin/icons/LogViewer.png +0 -0
  27. data/lib/rubyfox/server/data/config/admin/icons/LogViewer.svg +0 -0
  28. data/lib/rubyfox/server/data/config/admin/icons/ServerConfigurator.png +0 -0
  29. data/lib/rubyfox/server/data/config/admin/icons/ServerConfigurator.svg +0 -0
  30. data/lib/rubyfox/server/data/config/admin/icons/ServletManager.png +0 -0
  31. data/lib/rubyfox/server/data/config/admin/icons/ServletManager.svg +0 -0
  32. data/lib/rubyfox/server/data/config/admin/icons/ZoneConfigurator.png +0 -0
  33. data/lib/rubyfox/server/data/config/admin/icons/ZoneConfigurator.svg +0 -0
  34. data/lib/rubyfox/server/data/config/admin/icons/ZoneMonitor.png +0 -0
  35. data/lib/rubyfox/server/data/config/admin/icons/ZoneMonitor.svg +0 -0
  36. data/lib/rubyfox/server/data/config/logParser.properties +17 -28
  37. data/lib/rubyfox/server/data/lib/BlueBox.war +0 -0
  38. data/lib/rubyfox/server/data/lib/apache-tomcat/NOTICE +1 -1
  39. data/lib/rubyfox/server/data/lib/apache-tomcat/README.md +2 -0
  40. data/lib/rubyfox/server/data/lib/apache-tomcat/RELEASE-NOTES +2 -2
  41. data/lib/rubyfox/server/data/lib/apache-tomcat/bin/bootstrap.jar +0 -0
  42. data/lib/rubyfox/server/data/lib/apache-tomcat/bin/catalina.bat +2 -0
  43. data/lib/rubyfox/server/data/lib/apache-tomcat/bin/catalina.sh +2 -0
  44. data/lib/rubyfox/server/data/lib/apache-tomcat/bin/commons-daemon-native.tar.gz +0 -0
  45. data/lib/rubyfox/server/data/lib/apache-tomcat/bin/commons-daemon.jar +0 -0
  46. data/lib/rubyfox/server/data/lib/apache-tomcat/bin/tomcat-juli.jar +0 -0
  47. data/lib/rubyfox/server/data/lib/apache-tomcat/bin/tomcat-native.tar.gz +0 -0
  48. data/lib/rubyfox/server/data/lib/apache-tomcat/conf/catalina.policy +6 -1
  49. data/lib/rubyfox/server/data/lib/apache-tomcat/conf/catalina.properties +1 -0
  50. data/lib/rubyfox/server/data/lib/apache-tomcat/conf/keystore.jks +0 -0
  51. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/annotations-api.jar +0 -0
  52. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina-ant.jar +0 -0
  53. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina-ha.jar +0 -0
  54. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina-ssi.jar +0 -0
  55. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina-storeconfig.jar +0 -0
  56. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina-tribes.jar +0 -0
  57. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina.jar +0 -0
  58. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/ecj-4.20.jar +0 -0
  59. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/el-api.jar +0 -0
  60. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/jasper-el.jar +0 -0
  61. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/jasper.jar +0 -0
  62. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/jaspic-api.jar +0 -0
  63. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/jsp-api.jar +0 -0
  64. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/servlet-api.jar +0 -0
  65. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-api.jar +0 -0
  66. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-coyote.jar +0 -0
  67. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-dbcp.jar +0 -0
  68. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-cs.jar +0 -0
  69. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-de.jar +0 -0
  70. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-es.jar +0 -0
  71. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-fr.jar +0 -0
  72. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-ja.jar +0 -0
  73. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-ko.jar +0 -0
  74. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-pt-BR.jar +0 -0
  75. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-ru.jar +0 -0
  76. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-zh-CN.jar +0 -0
  77. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-jdbc.jar +0 -0
  78. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-jni.jar +0 -0
  79. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-util-scan.jar +0 -0
  80. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-util.jar +0 -0
  81. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-websocket.jar +0 -0
  82. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/websocket-api.jar +0 -0
  83. data/lib/rubyfox/server/data/lib/commons-compress-1.19.jar +0 -0
  84. data/lib/rubyfox/server/data/lib/sfs2x.jar +0 -0
  85. data/lib/rubyfox/server/data/sfs2x-service +294 -159
  86. data/lib/rubyfox/server/data/sfs2x.sh +1 -1
  87. data/lib/rubyfox/server/data/www/BlueBox.war +0 -0
  88. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/_changes-to-default-themes_.txt +0 -0
  89. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/bootstrap.min.css +0 -0
  90. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/custom-bootstrap.min.css +0 -0
  91. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/css/all.min.css +0 -0
  92. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-brands-400.eot +0 -0
  93. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-brands-400.svg +0 -0
  94. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-brands-400.ttf +0 -0
  95. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-brands-400.woff +0 -0
  96. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
  97. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-regular-400.eot +0 -0
  98. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-regular-400.svg +0 -0
  99. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-regular-400.ttf +0 -0
  100. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-regular-400.woff +0 -0
  101. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
  102. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-solid-900.eot +0 -0
  103. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-solid-900.svg +0 -0
  104. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-solid-900.ttf +0 -0
  105. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-solid-900.woff +0 -0
  106. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
  107. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/fonts.css +0 -0
  108. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/jquery.scrolling-tabs.min.css +0 -0
  109. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/kendo.custom-bootstrap-v4.css +0 -0
  110. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/reset.css +0 -0
  111. data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/style.css +0 -0
  112. data/lib/rubyfox/server/data/www/ROOT/admin/assets/data/countries.geo.json +0 -0
  113. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/FreeMono.otf +0 -0
  114. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/FreeMono.ttf +0 -0
  115. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/FreeMono.woff +0 -0
  116. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/FreeMono.woff2 +0 -0
  117. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-300.ttf +0 -0
  118. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-300.woff +0 -0
  119. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-300.woff2 +0 -0
  120. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-300italic.ttf +0 -0
  121. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-300italic.woff +0 -0
  122. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-300italic.woff2 +0 -0
  123. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-600.ttf +0 -0
  124. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-600.woff +0 -0
  125. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-600.woff2 +0 -0
  126. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-600italic.ttf +0 -0
  127. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-600italic.woff +0 -0
  128. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-600italic.woff2 +0 -0
  129. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-700.ttf +0 -0
  130. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-700.woff +0 -0
  131. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-700.woff2 +0 -0
  132. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-700italic.ttf +0 -0
  133. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-700italic.woff +0 -0
  134. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-700italic.woff2 +0 -0
  135. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-800.ttf +0 -0
  136. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-800.woff +0 -0
  137. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-800.woff2 +0 -0
  138. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-800italic.ttf +0 -0
  139. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-800italic.woff +0 -0
  140. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-800italic.woff2 +0 -0
  141. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-italic.ttf +0 -0
  142. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-italic.woff +0 -0
  143. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-italic.woff2 +0 -0
  144. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-regular.ttf +0 -0
  145. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-regular.woff +0 -0
  146. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/open-sans-v15-cyrillic_greek_cyrillic-ext_vietnamese_latin_latin-ext_greek-ext-regular.woff2 +0 -0
  147. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/roboto-condensed-v16-latin-300.ttf +0 -0
  148. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/roboto-condensed-v16-latin-300.woff +0 -0
  149. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/roboto-condensed-v16-latin-300.woff2 +0 -0
  150. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/roboto-condensed-v16-latin-700.ttf +0 -0
  151. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/roboto-condensed-v16-latin-700.woff +0 -0
  152. data/lib/rubyfox/server/data/www/ROOT/admin/assets/fonts/roboto-condensed-v16-latin-700.woff2 +0 -0
  153. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/analytics-adv/compare.png +0 -0
  154. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/analytics-adv/demographicsChart.png +0 -0
  155. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/analytics-adv/demographicsCompare.png +0 -0
  156. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/analytics-adv/demographicsFilter.png +0 -0
  157. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/analytics-adv/demographicsMap.png +0 -0
  158. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/analytics-adv/demographicsTable.png +0 -0
  159. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/analytics-adv/technologyChart.png +0 -0
  160. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/analytics-adv/technologyCompare.png +0 -0
  161. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/analytics-adv/technologyFilter.png +0 -0
  162. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/analytics-adv/technologyTable.png +0 -0
  163. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/apple-touch-icon-180x180.png +0 -0
  164. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/favicon-16x16.png +0 -0
  165. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/favicon-32x32.png +0 -0
  166. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/favicon-64x64.png +0 -0
  167. data/lib/rubyfox/server/data/www/ROOT/admin/assets/images/logo.png +0 -0
  168. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/application.bundle.js +4 -3
  169. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-0.bundle.js +0 -0
  170. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-1.bundle.js +96 -4
  171. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-10.bundle.js +0 -0
  172. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-11.bundle.js +0 -0
  173. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-12.bundle.js +0 -0
  174. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-12~module-13~module-9.bundle.js +15 -2
  175. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-13.bundle.js +0 -0
  176. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-3.bundle.js +0 -0
  177. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-4.bundle.js +0 -0
  178. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-5.bundle.js +0 -0
  179. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-6.bundle.js +0 -0
  180. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-7.bundle.js +0 -0
  181. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-8.bundle.js +0 -0
  182. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-9.bundle.js +0 -0
  183. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/vendors~module-0.bundle.js +0 -0
  184. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/vendors~module-0~module-1~module-13~module-4~module-5~module-7~module-8.bundle.js +0 -0
  185. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/vendors~module-1.bundle.js +983 -0
  186. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/vendors~module-9.bundle.js +0 -0
  187. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/libs/bootstrap.min.js +0 -0
  188. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/libs/jquery-3.3.1.min.js +0 -0
  189. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/libs/jquery.scrolling-tabs.min.js +0 -0
  190. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/libs/js.cookie.min.js +0 -0
  191. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/libs/kendo.all.min.js +0 -0
  192. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/libs/popper.min.js +0 -0
  193. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/libs/sfs2x-api-1.7.15.js +0 -0
  194. data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/libs/versions-readme.txt +0 -0
  195. data/lib/rubyfox/server/data/www/ROOT/admin/index.html +0 -0
  196. data/lib/rubyfox/server/data/www/ROOT/admin/manifest.json +0 -0
  197. data/lib/rubyfox/server/data/www/ROOT/admin/modules/analytics.html +0 -0
  198. data/lib/rubyfox/server/data/www/ROOT/admin/modules/ban-manager.html +6 -0
  199. data/lib/rubyfox/server/data/www/ROOT/admin/modules/blue-box-monitor.html +0 -0
  200. data/lib/rubyfox/server/data/www/ROOT/admin/modules/console.html +0 -0
  201. data/lib/rubyfox/server/data/www/ROOT/admin/modules/dashboard.html +0 -0
  202. data/lib/rubyfox/server/data/www/ROOT/admin/modules/extension-manager.html +0 -0
  203. data/lib/rubyfox/server/data/www/ROOT/admin/modules/license-manager.html +0 -0
  204. data/lib/rubyfox/server/data/www/ROOT/admin/modules/log-viewer.html +0 -0
  205. data/lib/rubyfox/server/data/www/ROOT/admin/modules/server-configurator.html +0 -0
  206. data/lib/rubyfox/server/data/www/ROOT/admin/modules/servlet-manager.html +0 -0
  207. data/lib/rubyfox/server/data/www/ROOT/admin/modules/template.html +0 -0
  208. data/lib/rubyfox/server/data/www/ROOT/admin/modules/zone-configurator.html +0 -0
  209. data/lib/rubyfox/server/data/www/ROOT/admin/modules/zone-monitor.html +0 -0
  210. data/lib/rubyfox/server/version.rb +1 -1
  211. metadata +4 -3
  212. data/lib/rubyfox/server/data/lib/apache-tomcat/lib/ecj-4.17.jar +0 -0
@@ -0,0 +1,983 @@
1
+ /*! (c) gotoAndPlay | All rights reserved */
2
+ (window["webpackJsonpapplication"] = window["webpackJsonpapplication"] || []).push([["vendors~module-1"],{
3
+
4
+ /***/ "./node_modules/clipboard/dist/clipboard.js":
5
+ /*!**************************************************!*\
6
+ !*** ./node_modules/clipboard/dist/clipboard.js ***!
7
+ \**************************************************/
8
+ /*! no static exports found */
9
+ /***/ (function(module, exports, __webpack_require__) {
10
+
11
+ /*!
12
+ * clipboard.js v2.0.6
13
+ * https://clipboardjs.com/
14
+ *
15
+ * Licensed MIT © Zeno Rocha
16
+ */
17
+ (function webpackUniversalModuleDefinition(root, factory) {
18
+ if(true)
19
+ module.exports = factory();
20
+ else {}
21
+ })(this, function() {
22
+ return /******/ (function(modules) { // webpackBootstrap
23
+ /******/ // The module cache
24
+ /******/ var installedModules = {};
25
+ /******/
26
+ /******/ // The require function
27
+ /******/ function __webpack_require__(moduleId) {
28
+ /******/
29
+ /******/ // Check if module is in cache
30
+ /******/ if(installedModules[moduleId]) {
31
+ /******/ return installedModules[moduleId].exports;
32
+ /******/ }
33
+ /******/ // Create a new module (and put it into the cache)
34
+ /******/ var module = installedModules[moduleId] = {
35
+ /******/ i: moduleId,
36
+ /******/ l: false,
37
+ /******/ exports: {}
38
+ /******/ };
39
+ /******/
40
+ /******/ // Execute the module function
41
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
42
+ /******/
43
+ /******/ // Flag the module as loaded
44
+ /******/ module.l = true;
45
+ /******/
46
+ /******/ // Return the exports of the module
47
+ /******/ return module.exports;
48
+ /******/ }
49
+ /******/
50
+ /******/
51
+ /******/ // expose the modules object (__webpack_modules__)
52
+ /******/ __webpack_require__.m = modules;
53
+ /******/
54
+ /******/ // expose the module cache
55
+ /******/ __webpack_require__.c = installedModules;
56
+ /******/
57
+ /******/ // define getter function for harmony exports
58
+ /******/ __webpack_require__.d = function(exports, name, getter) {
59
+ /******/ if(!__webpack_require__.o(exports, name)) {
60
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
61
+ /******/ }
62
+ /******/ };
63
+ /******/
64
+ /******/ // define __esModule on exports
65
+ /******/ __webpack_require__.r = function(exports) {
66
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
67
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
68
+ /******/ }
69
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
70
+ /******/ };
71
+ /******/
72
+ /******/ // create a fake namespace object
73
+ /******/ // mode & 1: value is a module id, require it
74
+ /******/ // mode & 2: merge all properties of value into the ns
75
+ /******/ // mode & 4: return value when already ns object
76
+ /******/ // mode & 8|1: behave like require
77
+ /******/ __webpack_require__.t = function(value, mode) {
78
+ /******/ if(mode & 1) value = __webpack_require__(value);
79
+ /******/ if(mode & 8) return value;
80
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
81
+ /******/ var ns = Object.create(null);
82
+ /******/ __webpack_require__.r(ns);
83
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
84
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
85
+ /******/ return ns;
86
+ /******/ };
87
+ /******/
88
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
89
+ /******/ __webpack_require__.n = function(module) {
90
+ /******/ var getter = module && module.__esModule ?
91
+ /******/ function getDefault() { return module['default']; } :
92
+ /******/ function getModuleExports() { return module; };
93
+ /******/ __webpack_require__.d(getter, 'a', getter);
94
+ /******/ return getter;
95
+ /******/ };
96
+ /******/
97
+ /******/ // Object.prototype.hasOwnProperty.call
98
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
99
+ /******/
100
+ /******/ // __webpack_public_path__
101
+ /******/ __webpack_require__.p = "";
102
+ /******/
103
+ /******/
104
+ /******/ // Load entry module and return exports
105
+ /******/ return __webpack_require__(__webpack_require__.s = 6);
106
+ /******/ })
107
+ /************************************************************************/
108
+ /******/ ([
109
+ /* 0 */
110
+ /***/ (function(module, exports) {
111
+
112
+ function select(element) {
113
+ var selectedText;
114
+
115
+ if (element.nodeName === 'SELECT') {
116
+ element.focus();
117
+
118
+ selectedText = element.value;
119
+ }
120
+ else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
121
+ var isReadOnly = element.hasAttribute('readonly');
122
+
123
+ if (!isReadOnly) {
124
+ element.setAttribute('readonly', '');
125
+ }
126
+
127
+ element.select();
128
+ element.setSelectionRange(0, element.value.length);
129
+
130
+ if (!isReadOnly) {
131
+ element.removeAttribute('readonly');
132
+ }
133
+
134
+ selectedText = element.value;
135
+ }
136
+ else {
137
+ if (element.hasAttribute('contenteditable')) {
138
+ element.focus();
139
+ }
140
+
141
+ var selection = window.getSelection();
142
+ var range = document.createRange();
143
+
144
+ range.selectNodeContents(element);
145
+ selection.removeAllRanges();
146
+ selection.addRange(range);
147
+
148
+ selectedText = selection.toString();
149
+ }
150
+
151
+ return selectedText;
152
+ }
153
+
154
+ module.exports = select;
155
+
156
+
157
+ /***/ }),
158
+ /* 1 */
159
+ /***/ (function(module, exports) {
160
+
161
+ function E () {
162
+ // Keep this empty so it's easier to inherit from
163
+ // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
164
+ }
165
+
166
+ E.prototype = {
167
+ on: function (name, callback, ctx) {
168
+ var e = this.e || (this.e = {});
169
+
170
+ (e[name] || (e[name] = [])).push({
171
+ fn: callback,
172
+ ctx: ctx
173
+ });
174
+
175
+ return this;
176
+ },
177
+
178
+ once: function (name, callback, ctx) {
179
+ var self = this;
180
+ function listener () {
181
+ self.off(name, listener);
182
+ callback.apply(ctx, arguments);
183
+ };
184
+
185
+ listener._ = callback
186
+ return this.on(name, listener, ctx);
187
+ },
188
+
189
+ emit: function (name) {
190
+ var data = [].slice.call(arguments, 1);
191
+ var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
192
+ var i = 0;
193
+ var len = evtArr.length;
194
+
195
+ for (i; i < len; i++) {
196
+ evtArr[i].fn.apply(evtArr[i].ctx, data);
197
+ }
198
+
199
+ return this;
200
+ },
201
+
202
+ off: function (name, callback) {
203
+ var e = this.e || (this.e = {});
204
+ var evts = e[name];
205
+ var liveEvents = [];
206
+
207
+ if (evts && callback) {
208
+ for (var i = 0, len = evts.length; i < len; i++) {
209
+ if (evts[i].fn !== callback && evts[i].fn._ !== callback)
210
+ liveEvents.push(evts[i]);
211
+ }
212
+ }
213
+
214
+ // Remove event from queue to prevent memory leak
215
+ // Suggested by https://github.com/lazd
216
+ // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
217
+
218
+ (liveEvents.length)
219
+ ? e[name] = liveEvents
220
+ : delete e[name];
221
+
222
+ return this;
223
+ }
224
+ };
225
+
226
+ module.exports = E;
227
+ module.exports.TinyEmitter = E;
228
+
229
+
230
+ /***/ }),
231
+ /* 2 */
232
+ /***/ (function(module, exports, __webpack_require__) {
233
+
234
+ var is = __webpack_require__(3);
235
+ var delegate = __webpack_require__(4);
236
+
237
+ /**
238
+ * Validates all params and calls the right
239
+ * listener function based on its target type.
240
+ *
241
+ * @param {String|HTMLElement|HTMLCollection|NodeList} target
242
+ * @param {String} type
243
+ * @param {Function} callback
244
+ * @return {Object}
245
+ */
246
+ function listen(target, type, callback) {
247
+ if (!target && !type && !callback) {
248
+ throw new Error('Missing required arguments');
249
+ }
250
+
251
+ if (!is.string(type)) {
252
+ throw new TypeError('Second argument must be a String');
253
+ }
254
+
255
+ if (!is.fn(callback)) {
256
+ throw new TypeError('Third argument must be a Function');
257
+ }
258
+
259
+ if (is.node(target)) {
260
+ return listenNode(target, type, callback);
261
+ }
262
+ else if (is.nodeList(target)) {
263
+ return listenNodeList(target, type, callback);
264
+ }
265
+ else if (is.string(target)) {
266
+ return listenSelector(target, type, callback);
267
+ }
268
+ else {
269
+ throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
270
+ }
271
+ }
272
+
273
+ /**
274
+ * Adds an event listener to a HTML element
275
+ * and returns a remove listener function.
276
+ *
277
+ * @param {HTMLElement} node
278
+ * @param {String} type
279
+ * @param {Function} callback
280
+ * @return {Object}
281
+ */
282
+ function listenNode(node, type, callback) {
283
+ node.addEventListener(type, callback);
284
+
285
+ return {
286
+ destroy: function() {
287
+ node.removeEventListener(type, callback);
288
+ }
289
+ }
290
+ }
291
+
292
+ /**
293
+ * Add an event listener to a list of HTML elements
294
+ * and returns a remove listener function.
295
+ *
296
+ * @param {NodeList|HTMLCollection} nodeList
297
+ * @param {String} type
298
+ * @param {Function} callback
299
+ * @return {Object}
300
+ */
301
+ function listenNodeList(nodeList, type, callback) {
302
+ Array.prototype.forEach.call(nodeList, function(node) {
303
+ node.addEventListener(type, callback);
304
+ });
305
+
306
+ return {
307
+ destroy: function() {
308
+ Array.prototype.forEach.call(nodeList, function(node) {
309
+ node.removeEventListener(type, callback);
310
+ });
311
+ }
312
+ }
313
+ }
314
+
315
+ /**
316
+ * Add an event listener to a selector
317
+ * and returns a remove listener function.
318
+ *
319
+ * @param {String} selector
320
+ * @param {String} type
321
+ * @param {Function} callback
322
+ * @return {Object}
323
+ */
324
+ function listenSelector(selector, type, callback) {
325
+ return delegate(document.body, selector, type, callback);
326
+ }
327
+
328
+ module.exports = listen;
329
+
330
+
331
+ /***/ }),
332
+ /* 3 */
333
+ /***/ (function(module, exports) {
334
+
335
+ /**
336
+ * Check if argument is a HTML element.
337
+ *
338
+ * @param {Object} value
339
+ * @return {Boolean}
340
+ */
341
+ exports.node = function(value) {
342
+ return value !== undefined
343
+ && value instanceof HTMLElement
344
+ && value.nodeType === 1;
345
+ };
346
+
347
+ /**
348
+ * Check if argument is a list of HTML elements.
349
+ *
350
+ * @param {Object} value
351
+ * @return {Boolean}
352
+ */
353
+ exports.nodeList = function(value) {
354
+ var type = Object.prototype.toString.call(value);
355
+
356
+ return value !== undefined
357
+ && (type === '[object NodeList]' || type === '[object HTMLCollection]')
358
+ && ('length' in value)
359
+ && (value.length === 0 || exports.node(value[0]));
360
+ };
361
+
362
+ /**
363
+ * Check if argument is a string.
364
+ *
365
+ * @param {Object} value
366
+ * @return {Boolean}
367
+ */
368
+ exports.string = function(value) {
369
+ return typeof value === 'string'
370
+ || value instanceof String;
371
+ };
372
+
373
+ /**
374
+ * Check if argument is a function.
375
+ *
376
+ * @param {Object} value
377
+ * @return {Boolean}
378
+ */
379
+ exports.fn = function(value) {
380
+ var type = Object.prototype.toString.call(value);
381
+
382
+ return type === '[object Function]';
383
+ };
384
+
385
+
386
+ /***/ }),
387
+ /* 4 */
388
+ /***/ (function(module, exports, __webpack_require__) {
389
+
390
+ var closest = __webpack_require__(5);
391
+
392
+ /**
393
+ * Delegates event to a selector.
394
+ *
395
+ * @param {Element} element
396
+ * @param {String} selector
397
+ * @param {String} type
398
+ * @param {Function} callback
399
+ * @param {Boolean} useCapture
400
+ * @return {Object}
401
+ */
402
+ function _delegate(element, selector, type, callback, useCapture) {
403
+ var listenerFn = listener.apply(this, arguments);
404
+
405
+ element.addEventListener(type, listenerFn, useCapture);
406
+
407
+ return {
408
+ destroy: function() {
409
+ element.removeEventListener(type, listenerFn, useCapture);
410
+ }
411
+ }
412
+ }
413
+
414
+ /**
415
+ * Delegates event to a selector.
416
+ *
417
+ * @param {Element|String|Array} [elements]
418
+ * @param {String} selector
419
+ * @param {String} type
420
+ * @param {Function} callback
421
+ * @param {Boolean} useCapture
422
+ * @return {Object}
423
+ */
424
+ function delegate(elements, selector, type, callback, useCapture) {
425
+ // Handle the regular Element usage
426
+ if (typeof elements.addEventListener === 'function') {
427
+ return _delegate.apply(null, arguments);
428
+ }
429
+
430
+ // Handle Element-less usage, it defaults to global delegation
431
+ if (typeof type === 'function') {
432
+ // Use `document` as the first parameter, then apply arguments
433
+ // This is a short way to .unshift `arguments` without running into deoptimizations
434
+ return _delegate.bind(null, document).apply(null, arguments);
435
+ }
436
+
437
+ // Handle Selector-based usage
438
+ if (typeof elements === 'string') {
439
+ elements = document.querySelectorAll(elements);
440
+ }
441
+
442
+ // Handle Array-like based usage
443
+ return Array.prototype.map.call(elements, function (element) {
444
+ return _delegate(element, selector, type, callback, useCapture);
445
+ });
446
+ }
447
+
448
+ /**
449
+ * Finds closest match and invokes callback.
450
+ *
451
+ * @param {Element} element
452
+ * @param {String} selector
453
+ * @param {String} type
454
+ * @param {Function} callback
455
+ * @return {Function}
456
+ */
457
+ function listener(element, selector, type, callback) {
458
+ return function(e) {
459
+ e.delegateTarget = closest(e.target, selector);
460
+
461
+ if (e.delegateTarget) {
462
+ callback.call(element, e);
463
+ }
464
+ }
465
+ }
466
+
467
+ module.exports = delegate;
468
+
469
+
470
+ /***/ }),
471
+ /* 5 */
472
+ /***/ (function(module, exports) {
473
+
474
+ var DOCUMENT_NODE_TYPE = 9;
475
+
476
+ /**
477
+ * A polyfill for Element.matches()
478
+ */
479
+ if (typeof Element !== 'undefined' && !Element.prototype.matches) {
480
+ var proto = Element.prototype;
481
+
482
+ proto.matches = proto.matchesSelector ||
483
+ proto.mozMatchesSelector ||
484
+ proto.msMatchesSelector ||
485
+ proto.oMatchesSelector ||
486
+ proto.webkitMatchesSelector;
487
+ }
488
+
489
+ /**
490
+ * Finds the closest parent that matches a selector.
491
+ *
492
+ * @param {Element} element
493
+ * @param {String} selector
494
+ * @return {Function}
495
+ */
496
+ function closest (element, selector) {
497
+ while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
498
+ if (typeof element.matches === 'function' &&
499
+ element.matches(selector)) {
500
+ return element;
501
+ }
502
+ element = element.parentNode;
503
+ }
504
+ }
505
+
506
+ module.exports = closest;
507
+
508
+
509
+ /***/ }),
510
+ /* 6 */
511
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
512
+
513
+ "use strict";
514
+ __webpack_require__.r(__webpack_exports__);
515
+
516
+ // EXTERNAL MODULE: ./node_modules/select/src/select.js
517
+ var src_select = __webpack_require__(0);
518
+ var select_default = /*#__PURE__*/__webpack_require__.n(src_select);
519
+
520
+ // CONCATENATED MODULE: ./src/clipboard-action.js
521
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
522
+
523
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
524
+
525
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
526
+
527
+
528
+
529
+ /**
530
+ * Inner class which performs selection from either `text` or `target`
531
+ * properties and then executes copy or cut operations.
532
+ */
533
+
534
+ var clipboard_action_ClipboardAction = function () {
535
+ /**
536
+ * @param {Object} options
537
+ */
538
+ function ClipboardAction(options) {
539
+ _classCallCheck(this, ClipboardAction);
540
+
541
+ this.resolveOptions(options);
542
+ this.initSelection();
543
+ }
544
+
545
+ /**
546
+ * Defines base properties passed from constructor.
547
+ * @param {Object} options
548
+ */
549
+
550
+
551
+ _createClass(ClipboardAction, [{
552
+ key: 'resolveOptions',
553
+ value: function resolveOptions() {
554
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
555
+
556
+ this.action = options.action;
557
+ this.container = options.container;
558
+ this.emitter = options.emitter;
559
+ this.target = options.target;
560
+ this.text = options.text;
561
+ this.trigger = options.trigger;
562
+
563
+ this.selectedText = '';
564
+ }
565
+
566
+ /**
567
+ * Decides which selection strategy is going to be applied based
568
+ * on the existence of `text` and `target` properties.
569
+ */
570
+
571
+ }, {
572
+ key: 'initSelection',
573
+ value: function initSelection() {
574
+ if (this.text) {
575
+ this.selectFake();
576
+ } else if (this.target) {
577
+ this.selectTarget();
578
+ }
579
+ }
580
+
581
+ /**
582
+ * Creates a fake textarea element, sets its value from `text` property,
583
+ * and makes a selection on it.
584
+ */
585
+
586
+ }, {
587
+ key: 'selectFake',
588
+ value: function selectFake() {
589
+ var _this = this;
590
+
591
+ var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
592
+
593
+ this.removeFake();
594
+
595
+ this.fakeHandlerCallback = function () {
596
+ return _this.removeFake();
597
+ };
598
+ this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true;
599
+
600
+ this.fakeElem = document.createElement('textarea');
601
+ // Prevent zooming on iOS
602
+ this.fakeElem.style.fontSize = '12pt';
603
+ // Reset box model
604
+ this.fakeElem.style.border = '0';
605
+ this.fakeElem.style.padding = '0';
606
+ this.fakeElem.style.margin = '0';
607
+ // Move element out of screen horizontally
608
+ this.fakeElem.style.position = 'absolute';
609
+ this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
610
+ // Move element to the same position vertically
611
+ var yPosition = window.pageYOffset || document.documentElement.scrollTop;
612
+ this.fakeElem.style.top = yPosition + 'px';
613
+
614
+ this.fakeElem.setAttribute('readonly', '');
615
+ this.fakeElem.value = this.text;
616
+
617
+ this.container.appendChild(this.fakeElem);
618
+
619
+ this.selectedText = select_default()(this.fakeElem);
620
+ this.copyText();
621
+ }
622
+
623
+ /**
624
+ * Only removes the fake element after another click event, that way
625
+ * a user can hit `Ctrl+C` to copy because selection still exists.
626
+ */
627
+
628
+ }, {
629
+ key: 'removeFake',
630
+ value: function removeFake() {
631
+ if (this.fakeHandler) {
632
+ this.container.removeEventListener('click', this.fakeHandlerCallback);
633
+ this.fakeHandler = null;
634
+ this.fakeHandlerCallback = null;
635
+ }
636
+
637
+ if (this.fakeElem) {
638
+ this.container.removeChild(this.fakeElem);
639
+ this.fakeElem = null;
640
+ }
641
+ }
642
+
643
+ /**
644
+ * Selects the content from element passed on `target` property.
645
+ */
646
+
647
+ }, {
648
+ key: 'selectTarget',
649
+ value: function selectTarget() {
650
+ this.selectedText = select_default()(this.target);
651
+ this.copyText();
652
+ }
653
+
654
+ /**
655
+ * Executes the copy operation based on the current selection.
656
+ */
657
+
658
+ }, {
659
+ key: 'copyText',
660
+ value: function copyText() {
661
+ var succeeded = void 0;
662
+
663
+ try {
664
+ succeeded = document.execCommand(this.action);
665
+ } catch (err) {
666
+ succeeded = false;
667
+ }
668
+
669
+ this.handleResult(succeeded);
670
+ }
671
+
672
+ /**
673
+ * Fires an event based on the copy operation result.
674
+ * @param {Boolean} succeeded
675
+ */
676
+
677
+ }, {
678
+ key: 'handleResult',
679
+ value: function handleResult(succeeded) {
680
+ this.emitter.emit(succeeded ? 'success' : 'error', {
681
+ action: this.action,
682
+ text: this.selectedText,
683
+ trigger: this.trigger,
684
+ clearSelection: this.clearSelection.bind(this)
685
+ });
686
+ }
687
+
688
+ /**
689
+ * Moves focus away from `target` and back to the trigger, removes current selection.
690
+ */
691
+
692
+ }, {
693
+ key: 'clearSelection',
694
+ value: function clearSelection() {
695
+ if (this.trigger) {
696
+ this.trigger.focus();
697
+ }
698
+ document.activeElement.blur();
699
+ window.getSelection().removeAllRanges();
700
+ }
701
+
702
+ /**
703
+ * Sets the `action` to be performed which can be either 'copy' or 'cut'.
704
+ * @param {String} action
705
+ */
706
+
707
+ }, {
708
+ key: 'destroy',
709
+
710
+
711
+ /**
712
+ * Destroy lifecycle.
713
+ */
714
+ value: function destroy() {
715
+ this.removeFake();
716
+ }
717
+ }, {
718
+ key: 'action',
719
+ set: function set() {
720
+ var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
721
+
722
+ this._action = action;
723
+
724
+ if (this._action !== 'copy' && this._action !== 'cut') {
725
+ throw new Error('Invalid "action" value, use either "copy" or "cut"');
726
+ }
727
+ }
728
+
729
+ /**
730
+ * Gets the `action` property.
731
+ * @return {String}
732
+ */
733
+ ,
734
+ get: function get() {
735
+ return this._action;
736
+ }
737
+
738
+ /**
739
+ * Sets the `target` property using an element
740
+ * that will be have its content copied.
741
+ * @param {Element} target
742
+ */
743
+
744
+ }, {
745
+ key: 'target',
746
+ set: function set(target) {
747
+ if (target !== undefined) {
748
+ if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
749
+ if (this.action === 'copy' && target.hasAttribute('disabled')) {
750
+ throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
751
+ }
752
+
753
+ if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
754
+ throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
755
+ }
756
+
757
+ this._target = target;
758
+ } else {
759
+ throw new Error('Invalid "target" value, use a valid Element');
760
+ }
761
+ }
762
+ }
763
+
764
+ /**
765
+ * Gets the `target` property.
766
+ * @return {String|HTMLElement}
767
+ */
768
+ ,
769
+ get: function get() {
770
+ return this._target;
771
+ }
772
+ }]);
773
+
774
+ return ClipboardAction;
775
+ }();
776
+
777
+ /* harmony default export */ var clipboard_action = (clipboard_action_ClipboardAction);
778
+ // EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js
779
+ var tiny_emitter = __webpack_require__(1);
780
+ var tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);
781
+
782
+ // EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js
783
+ var listen = __webpack_require__(2);
784
+ var listen_default = /*#__PURE__*/__webpack_require__.n(listen);
785
+
786
+ // CONCATENATED MODULE: ./src/clipboard.js
787
+ var clipboard_typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
788
+
789
+ var clipboard_createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
790
+
791
+ function clipboard_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
792
+
793
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
794
+
795
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
796
+
797
+
798
+
799
+
800
+
801
+ /**
802
+ * Base class which takes one or more elements, adds event listeners to them,
803
+ * and instantiates a new `ClipboardAction` on each click.
804
+ */
805
+
806
+ var clipboard_Clipboard = function (_Emitter) {
807
+ _inherits(Clipboard, _Emitter);
808
+
809
+ /**
810
+ * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
811
+ * @param {Object} options
812
+ */
813
+ function Clipboard(trigger, options) {
814
+ clipboard_classCallCheck(this, Clipboard);
815
+
816
+ var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
817
+
818
+ _this.resolveOptions(options);
819
+ _this.listenClick(trigger);
820
+ return _this;
821
+ }
822
+
823
+ /**
824
+ * Defines if attributes would be resolved using internal setter functions
825
+ * or custom functions that were passed in the constructor.
826
+ * @param {Object} options
827
+ */
828
+
829
+
830
+ clipboard_createClass(Clipboard, [{
831
+ key: 'resolveOptions',
832
+ value: function resolveOptions() {
833
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
834
+
835
+ this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
836
+ this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
837
+ this.text = typeof options.text === 'function' ? options.text : this.defaultText;
838
+ this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;
839
+ }
840
+
841
+ /**
842
+ * Adds a click event listener to the passed trigger.
843
+ * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
844
+ */
845
+
846
+ }, {
847
+ key: 'listenClick',
848
+ value: function listenClick(trigger) {
849
+ var _this2 = this;
850
+
851
+ this.listener = listen_default()(trigger, 'click', function (e) {
852
+ return _this2.onClick(e);
853
+ });
854
+ }
855
+
856
+ /**
857
+ * Defines a new `ClipboardAction` on each click event.
858
+ * @param {Event} e
859
+ */
860
+
861
+ }, {
862
+ key: 'onClick',
863
+ value: function onClick(e) {
864
+ var trigger = e.delegateTarget || e.currentTarget;
865
+
866
+ if (this.clipboardAction) {
867
+ this.clipboardAction = null;
868
+ }
869
+
870
+ this.clipboardAction = new clipboard_action({
871
+ action: this.action(trigger),
872
+ target: this.target(trigger),
873
+ text: this.text(trigger),
874
+ container: this.container,
875
+ trigger: trigger,
876
+ emitter: this
877
+ });
878
+ }
879
+
880
+ /**
881
+ * Default `action` lookup function.
882
+ * @param {Element} trigger
883
+ */
884
+
885
+ }, {
886
+ key: 'defaultAction',
887
+ value: function defaultAction(trigger) {
888
+ return getAttributeValue('action', trigger);
889
+ }
890
+
891
+ /**
892
+ * Default `target` lookup function.
893
+ * @param {Element} trigger
894
+ */
895
+
896
+ }, {
897
+ key: 'defaultTarget',
898
+ value: function defaultTarget(trigger) {
899
+ var selector = getAttributeValue('target', trigger);
900
+
901
+ if (selector) {
902
+ return document.querySelector(selector);
903
+ }
904
+ }
905
+
906
+ /**
907
+ * Returns the support of the given action, or all actions if no action is
908
+ * given.
909
+ * @param {String} [action]
910
+ */
911
+
912
+ }, {
913
+ key: 'defaultText',
914
+
915
+
916
+ /**
917
+ * Default `text` lookup function.
918
+ * @param {Element} trigger
919
+ */
920
+ value: function defaultText(trigger) {
921
+ return getAttributeValue('text', trigger);
922
+ }
923
+
924
+ /**
925
+ * Destroy lifecycle.
926
+ */
927
+
928
+ }, {
929
+ key: 'destroy',
930
+ value: function destroy() {
931
+ this.listener.destroy();
932
+
933
+ if (this.clipboardAction) {
934
+ this.clipboardAction.destroy();
935
+ this.clipboardAction = null;
936
+ }
937
+ }
938
+ }], [{
939
+ key: 'isSupported',
940
+ value: function isSupported() {
941
+ var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
942
+
943
+ var actions = typeof action === 'string' ? [action] : action;
944
+ var support = !!document.queryCommandSupported;
945
+
946
+ actions.forEach(function (action) {
947
+ support = support && !!document.queryCommandSupported(action);
948
+ });
949
+
950
+ return support;
951
+ }
952
+ }]);
953
+
954
+ return Clipboard;
955
+ }(tiny_emitter_default.a);
956
+
957
+ /**
958
+ * Helper function to retrieve attribute value.
959
+ * @param {String} suffix
960
+ * @param {Element} element
961
+ */
962
+
963
+
964
+ function getAttributeValue(suffix, element) {
965
+ var attribute = 'data-clipboard-' + suffix;
966
+
967
+ if (!element.hasAttribute(attribute)) {
968
+ return;
969
+ }
970
+
971
+ return element.getAttribute(attribute);
972
+ }
973
+
974
+ /* harmony default export */ var clipboard = __webpack_exports__["default"] = (clipboard_Clipboard);
975
+
976
+ /***/ })
977
+ /******/ ])["default"];
978
+ });
979
+
980
+ /***/ })
981
+
982
+ }]);
983
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXRzL2pzL2NvcmUvbW9kdWxlcy92ZW5kb3Jzfm1vZHVsZS0xLmJ1bmRsZS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2FwcGxpY2F0aW9uLy4vbm9kZV9tb2R1bGVzL2NsaXBib2FyZC9kaXN0L2NsaXBib2FyZC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKiFcbiAqIGNsaXBib2FyZC5qcyB2Mi4wLjZcbiAqIGh0dHBzOi8vY2xpcGJvYXJkanMuY29tL1xuICogXG4gKiBMaWNlbnNlZCBNSVQgwqkgWmVubyBSb2NoYVxuICovXG4oZnVuY3Rpb24gd2VicGFja1VuaXZlcnNhbE1vZHVsZURlZmluaXRpb24ocm9vdCwgZmFjdG9yeSkge1xuXHRpZih0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIG1vZHVsZSA9PT0gJ29iamVjdCcpXG5cdFx0bW9kdWxlLmV4cG9ydHMgPSBmYWN0b3J5KCk7XG5cdGVsc2UgaWYodHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kKVxuXHRcdGRlZmluZShbXSwgZmFjdG9yeSk7XG5cdGVsc2UgaWYodHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnKVxuXHRcdGV4cG9ydHNbXCJDbGlwYm9hcmRKU1wiXSA9IGZhY3RvcnkoKTtcblx0ZWxzZVxuXHRcdHJvb3RbXCJDbGlwYm9hcmRKU1wiXSA9IGZhY3RvcnkoKTtcbn0pKHRoaXMsIGZ1bmN0aW9uKCkge1xucmV0dXJuIC8qKioqKiovIChmdW5jdGlvbihtb2R1bGVzKSB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HRpb25zLnRhcmdldCA6IHRoaXMuZGVmYXVsdFRhcmdldDtcbiAgICAgICAgICAgIHRoaXMudGV4dCA9IHR5cGVvZiBvcHRpb25zLnRleHQgPT09ICdmdW5jdGlvbicgPyBvcHRpb25zLnRleHQgOiB0aGlzLmRlZmF1bHRUZXh0O1xuICAgICAgICAgICAgdGhpcy5jb250YWluZXIgPSBjbGlwYm9hcmRfdHlwZW9mKG9wdGlvbnMuY29udGFpbmVyKSA9PT0gJ29iamVjdCcgPyBvcHRpb25zLmNvbnRhaW5lciA6IGRvY3VtZW50LmJvZHk7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogQWRkcyBhIGNsaWNrIGV2ZW50IGxpc3RlbmVyIHRvIHRoZSBwYXNzZWQgdHJpZ2dlci5cbiAgICAgICAgICogQHBhcmFtIHtTdHJpbmd8SFRNTEVsZW1lbnR8SFRNTENvbGxlY3Rpb258Tm9kZUxpc3R9IHRyaWdnZXJcbiAgICAgICAgICovXG5cbiAgICB9LCB7XG4gICAgICAgIGtleTogJ2xpc3RlbkNsaWNrJyxcbiAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIGxpc3RlbkNsaWNrKHRyaWdnZXIpIHtcbiAgICAgICAgICAgIHZhciBfdGhpczIgPSB0aGlzO1xuXG4gICAgICAgICAgICB0aGlzLmxpc3RlbmVyID0gbGlzdGVuX2RlZmF1bHQoKSh0cmlnZ2VyLCAnY2xpY2snLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBfdGhpczIub25DbGljayhlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIERlZmluZXMgYSBuZXcgYENsaXBib2FyZEFjdGlvbmAgb24gZWFjaCBjbGljayBldmVudC5cbiAgICAgICAgICogQHBhcmFtIHtFdmVudH0gZVxuICAgICAgICAgKi9cblxuICAgIH0sIHtcbiAgICAgICAga2V5OiAnb25DbGljaycsXG4gICAgICAgIHZhbHVlOiBmdW5jdGlvbiBvbkNsaWNrKGUpIHtcbiAgICAgICAgICAgIHZhciB0cmlnZ2VyID0gZS5kZWxlZ2F0ZVRhcmdldCB8fCBlLmN1cnJlbnRUYXJnZXQ7XG5cbiAgICAgICAgICAgIGlmICh0aGlzLmNsaXBib2FyZEFjdGlvbikge1xuICAgICAgICAgICAgICAgIHRoaXMuY2xpcGJvYXJkQWN0aW9uID0gbnVsbDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5jbGlwYm9hcmRBY3Rpb24gPSBuZXcgY2xpcGJvYXJkX2FjdGlvbih7XG4gICAgICAgICAgICAgICAgYWN0aW9uOiB0aGlzLmFjdGlvbih0cmlnZ2VyKSxcbiAgICAgICAgICAgICAgICB0YXJnZXQ6IHRoaXMudGFyZ2V0KHRyaWdnZXIpLFxuICAgICAgICAgICAgICAgIHRleHQ6IHRoaXMudGV4dCh0cmlnZ2VyKSxcbiAgICAgICAgICAgICAgICBjb250YWluZXI6IHRoaXMuY29udGFpbmVyLFxuICAgICAgICAgICAgICAgIHRyaWdnZXI6IHRyaWdnZXIsXG4gICAgICAgICAgICAgICAgZW1pdHRlcjogdGhpc1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogRGVmYXVsdCBgYWN0aW9uYCBsb29rdXAgZnVuY3Rpb24uXG4gICAgICAgICAqIEBwYXJhbSB7RWxlbWVudH0gdHJpZ2dlclxuICAgICAgICAgKi9cblxuICAgIH0sIHtcbiAgICAgICAga2V5OiAnZGVmYXVsdEFjdGlvbicsXG4gICAgICAgIHZhbHVlOiBmdW5jdGlvbiBkZWZhdWx0QWN0aW9uKHRyaWdnZXIpIHtcbiAgICAgICAgICAgIHJldHVybiBnZXRBdHRyaWJ1dGVWYWx1ZSgnYWN0aW9uJywgdHJpZ2dlcik7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogRGVmYX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