j1-template 2020.0.13 → 2020.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (511) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/blocks/footer/boxes/about_box.proc +2 -2
  3. data/_includes/themes/j1/blocks/footer/boxes/links_box.proc +2 -2
  4. data/_includes/themes/j1/blocks/footer/boxes/news_box.proc +3 -3
  5. data/_includes/themes/j1/layouts/content_generator_page.html +23 -23
  6. data/_includes/themes/j1/layouts/content_generator_post.html +4 -2
  7. data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +2 -2
  8. data/_includes/themes/j1/procedures/global/create_word_cloud.proc +5 -2
  9. data/_includes/themes/j1/procedures/layouts/content_writer.proc +8 -9
  10. data/_includes/themes/j1/procedures/layouts/module_writer.proc +3 -13
  11. data/_includes/themes/j1/procedures/posts/collate_timeline.proc +10 -10
  12. data/_layouts/blog_archive.html +3 -3
  13. data/_layouts/default.html +60 -54
  14. data/_layouts/home.html +1 -1
  15. data/_layouts/page.html +2 -2
  16. data/_layouts/post.html +3 -3
  17. data/apps/public/cc/cc.yml +0 -2
  18. data/apps/public/cc/index.adoc +1 -5
  19. data/assets/data/authclient.html +35 -24
  20. data/assets/data/banner.html +4 -4
  21. data/assets/data/{cookie_consent.html → cookiebar.html} +76 -50
  22. data/assets/data/footer.html +1 -3
  23. data/assets/data/gallery_customizer.html +5 -5
  24. data/assets/data/jupyter/notebooks/_html/template.full.head.html +10 -10
  25. data/assets/data/jupyter/notebooks/_html/visualisation.html +11 -11
  26. data/assets/data/jupyter/notebooks/html/template.html +7 -7
  27. data/assets/data/jupyter/notebooks/html/visualisation.ok.html +12 -12
  28. data/assets/data/jupyter/notebooks/visualisation.ipynb +1 -1
  29. data/assets/data/menu.html +1 -1
  30. data/assets/data/mmenu.html +3 -3
  31. data/assets/data/mmenu_sidebar.html +1 -1
  32. data/assets/data/mmenu_toc.html +1 -1
  33. data/assets/data/panel.html +30 -31
  34. data/assets/data/quicklinks.html +23 -17
  35. data/assets/data/search.json +88 -84
  36. data/assets/data/ssm.html +1 -1
  37. data/assets/data/twa_v1.json +6978 -6980
  38. data/assets/themes/j1/adapter/js/algolia.js +16 -14
  39. data/assets/themes/j1/adapter/js/attic.js +25 -33
  40. data/assets/themes/j1/adapter/js/back2top.js +233 -0
  41. data/assets/themes/j1/adapter/js/carousel.js +15 -11
  42. data/assets/themes/j1/adapter/js/clipboard.js +20 -17
  43. data/assets/themes/j1/adapter/js/cookiebar.js +205 -0
  44. data/assets/themes/j1/adapter/js/framer.js +27 -19
  45. data/assets/themes/j1/adapter/js/gallery_customizer.js +220 -248
  46. data/assets/themes/j1/adapter/js/j1.js +304 -158
  47. data/assets/themes/j1/adapter/js/jf_gallery.js +21 -20
  48. data/assets/themes/j1/adapter/js/lightbox.js +9 -8
  49. data/assets/themes/j1/adapter/js/logger.js +3 -4
  50. data/assets/themes/j1/adapter/js/mdb.js +27 -30
  51. data/assets/themes/j1/adapter/js/mmenu.js +49 -51
  52. data/assets/themes/j1/adapter/js/navigator.js +167 -130
  53. data/assets/themes/j1/adapter/js/searcher.js +18 -12
  54. data/assets/themes/j1/adapter/js/ssm.js +83 -99
  55. data/assets/themes/j1/adapter/js/themer.js +74 -79
  56. data/assets/themes/j1/adapter/js/toccer.js +47 -15
  57. data/assets/themes/j1/core/css/animate.css +2382 -0
  58. data/assets/themes/j1/core/css/animate.min.css +7 -0
  59. data/assets/themes/j1/core/css/fontawesome.css +4415 -0
  60. data/assets/themes/j1/core/css/fontawesome.min.css +1 -0
  61. data/assets/themes/j1/core/css/iconify-icons.css +4106 -0
  62. data/assets/themes/j1/core/css/iconify-icons.min.css +1 -0
  63. data/assets/themes/j1/core/css/material-design-icons.css +14532 -0
  64. data/assets/themes/j1/core/css/material-design-icons.min.css +1 -0
  65. data/assets/themes/j1/core/css/theme_extensions.css +406 -1567
  66. data/assets/themes/j1/core/css/theme_extensions.min.css +1 -1
  67. data/assets/themes/j1/core/css/twemoji.css +9485 -0
  68. data/assets/themes/j1/core/css/twemoji.min.css +1 -0
  69. data/assets/themes/j1/core/css/uno.css +563 -1642
  70. data/assets/themes/j1/core/css/uno.min.css +1 -1
  71. data/assets/themes/j1/core/css/vendor.css +884 -33281
  72. data/assets/themes/j1/core/css/vendor.min.css +2 -9
  73. data/assets/themes/j1/core/js/template.js +26 -347
  74. data/assets/themes/j1/core/js/template.js.map +1 -1
  75. data/assets/themes/j1/core/js/template.min.js +1 -1
  76. data/assets/themes/j1/modules/backstretch/js/backstretch.js +1695 -0
  77. data/assets/themes/j1/modules/backstretch/js/backstretch.min.js +21 -0
  78. data/assets/themes/j1/modules/backstretch/js/backstretch.min.js.org +1 -0
  79. data/assets/themes/j1/modules/bmd/css/bootstrap-material-design.css +12177 -0
  80. data/assets/themes/j1/modules/bmd/css/bootstrap-material-design.min.css +8 -0
  81. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js +6930 -0
  82. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js.map +1 -0
  83. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.min.js +1 -0
  84. data/assets/themes/j1/modules/bootstrap/css/bootstrap.css +10278 -0
  85. data/assets/themes/j1/modules/bootstrap/css/bootstrap.css.map +1 -0
  86. data/assets/themes/j1/modules/bootstrap/css/bootstrap.min.css +7 -0
  87. data/assets/themes/j1/modules/bootstrap/css/bootstrap.min.css.map +1 -0
  88. data/assets/themes/j1/modules/bootstrap/js/bootstrap.js +4420 -0
  89. data/assets/themes/j1/modules/bootstrap/js/bootstrap.js.map +1 -0
  90. data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js +7 -0
  91. data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js.map +1 -0
  92. data/assets/themes/j1/{extensions → modules}/bsDatepicker/css/datepicker.css +1 -1
  93. data/assets/themes/j1/{extensions → modules}/bsDatepicker/css/theme/uno.css +1 -1
  94. data/assets/themes/j1/{extensions → modules}/bsDatepicker/js/datepicker.js +1 -1
  95. data/assets/themes/j1/{extensions → modules}/bsDatepicker/less/datepicker.less +0 -0
  96. data/assets/themes/j1/{extensions → modules}/bsThemeSwitcher/js/switcher.js +20 -10
  97. data/assets/themes/j1/{extensions → modules}/bsThemeSwitcher/js/switcher.min.js +1 -1
  98. data/assets/themes/j1/{extensions → modules}/carousel/css/carousel.css +1 -1
  99. data/assets/themes/j1/{extensions → modules}/carousel/css/carousel.min.css +1 -1
  100. data/assets/themes/j1/{extensions → modules}/carousel/css/carousel_transitions.css +1 -1
  101. data/assets/themes/j1/{extensions → modules}/carousel/css/carousel_transitions.min.css +1 -1
  102. data/assets/themes/j1/{extensions → modules}/carousel/css/theme/uno.css +1 -1
  103. data/assets/themes/j1/{extensions → modules}/carousel/css/theme/uno.min.css +1 -1
  104. data/assets/themes/j1/{extensions → modules}/carousel/images/ajax-loader.gif +0 -0
  105. data/assets/themes/j1/{extensions → modules}/carousel/images/grabbing.png +0 -0
  106. data/assets/themes/j1/{extensions → modules}/carousel/images/owl-logo.png +0 -0
  107. data/assets/themes/j1/{extensions → modules}/carousel/images/owl.video.play.png +0 -0
  108. data/assets/themes/j1/{extensions → modules}/carousel/js/carousel.js +0 -0
  109. data/assets/themes/j1/{extensions → modules}/carousel/js/carousel.min.js +0 -0
  110. data/assets/themes/j1/{extensions → modules}/clipboard/LICENSE +0 -0
  111. data/assets/themes/j1/{extensions → modules}/clipboard/css/theme/uno.css +1 -1
  112. data/assets/themes/j1/{extensions → modules}/clipboard/css/theme/uno.min.css +1 -1
  113. data/assets/themes/j1/{extensions → modules}/clipboard/js/clipboard.js +0 -0
  114. data/assets/themes/j1/{extensions → modules}/clipboard/js/clipboard.min.js +0 -0
  115. data/assets/themes/j1/{extensions → modules}/iconifyAPI/js/iconify.min.js +0 -0
  116. data/assets/themes/j1/{extensions → modules}/iframeResizer/LICENSE +0 -0
  117. data/assets/themes/j1/{extensions → modules}/iframeResizer/examples/frame.absolute.html +2 -5
  118. data/assets/themes/j1/{extensions → modules}/iframeResizer/examples/frame.content.html +17 -44
  119. data/assets/themes/j1/{extensions → modules}/iframeResizer/examples/frame.hover.html +2 -5
  120. data/assets/themes/j1/{extensions → modules}/iframeResizer/examples/frame.nested.html +5 -7
  121. data/assets/themes/j1/{extensions → modules}/iframeResizer/examples/frame.textarea.html +1 -1
  122. data/assets/themes/j1/{extensions → modules}/iframeResizer/examples/frame.tolerance.html +3 -5
  123. data/assets/themes/j1/{extensions → modules}/iframeResizer/examples/index.html +4 -3
  124. data/assets/themes/j1/{extensions → modules}/iframeResizer/examples/two.html +4 -3
  125. data/assets/themes/j1/{extensions → modules}/iframeResizer/js/client/iframeResizer.contentWindow.js +0 -0
  126. data/assets/themes/j1/{extensions → modules}/iframeResizer/js/client/iframeResizer.contentWindow.map +0 -0
  127. data/assets/themes/j1/{extensions → modules}/iframeResizer/js/client/iframeResizer.contentWindow.min.js +0 -0
  128. data/assets/themes/j1/{extensions → modules}/iframeResizer/js/iframeResizer.js +0 -0
  129. data/assets/themes/j1/{extensions → modules}/iframeResizer/js/iframeResizer.map +0 -0
  130. data/assets/themes/j1/{extensions → modules}/iframeResizer/js/iframeResizer.min.js +0 -0
  131. data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.js +468 -0
  132. data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.min.js +6 -0
  133. data/assets/themes/j1/{extensions → modules}/jqMouseWheel/README.md +0 -0
  134. data/assets/themes/j1/{extensions → modules}/jqMouseWheel/js/jquery.mousewheel.js +0 -0
  135. data/assets/themes/j1/{extensions → modules}/jqMouseWheel/js/jquery.mousewheel.min.js +0 -0
  136. data/assets/themes/j1/modules/jquery/js/jquery.js +10869 -0
  137. data/assets/themes/j1/modules/jquery/js/jquery.min.js +2 -0
  138. data/assets/themes/j1/{extensions → modules}/justifiedGallery/LICENSE +0 -0
  139. data/assets/themes/j1/{extensions → modules}/justifiedGallery/README.md +0 -0
  140. data/assets/themes/j1/{extensions → modules}/justifiedGallery/_versions/v3.7.0/css/justifiedGallery.css +0 -0
  141. data/assets/themes/j1/{extensions → modules}/justifiedGallery/_versions/v3.7.0/css/justifiedGallery.min.css +0 -0
  142. data/assets/themes/j1/{extensions/justifiedGallery/_versions/v4.0.0 → modules/justifiedGallery/_versions/v3.7.0}/css/theme/uno.css +1 -1
  143. data/assets/themes/j1/{extensions → modules}/justifiedGallery/_versions/v3.7.0/js/justifiedGallery.3.7.0.js +0 -0
  144. data/assets/themes/j1/{extensions → modules}/justifiedGallery/_versions/v3.7.0/js/justifiedGallery.js +0 -0
  145. data/assets/themes/j1/{extensions → modules}/justifiedGallery/_versions/v3.7.0/js/justifiedGallery.min.js +0 -0
  146. data/assets/themes/j1/{extensions → modules}/justifiedGallery/_versions/v3.7.0/less/.csslintrc +0 -0
  147. data/assets/themes/j1/{extensions → modules}/justifiedGallery/_versions/v3.7.0/less/justifiedGallery.less +0 -0
  148. data/assets/themes/j1/{extensions → modules}/justifiedGallery/_versions/v4.0.0/css/justifiedGallery.css +0 -0
  149. data/assets/themes/j1/{extensions → modules}/justifiedGallery/_versions/v4.0.0/css/justifiedGallery.min.css +0 -0
  150. data/assets/themes/j1/{extensions/justifiedGallery/_versions/v3.7.0 → modules/justifiedGallery/_versions/v4.0.0}/css/theme/uno.css +1 -1
  151. data/assets/themes/j1/{extensions → modules}/justifiedGallery/_versions/v4.0.0/js/jquery.justifiedGallery.js +0 -0
  152. data/assets/themes/j1/{extensions → modules}/justifiedGallery/_versions/v4.0.0/js/jquery.justifiedGallery.min.js +0 -0
  153. data/assets/themes/j1/{extensions → modules}/justifiedGallery/css/justifiedGallery.css +0 -0
  154. data/assets/themes/j1/{extensions → modules}/justifiedGallery/css/justifiedGallery.min.css +0 -0
  155. data/assets/themes/j1/{extensions → modules}/justifiedGallery/css/theme/uno.css +1 -1
  156. data/assets/themes/j1/{extensions → modules}/justifiedGallery/css/theme/uno.min.css +1 -1
  157. data/assets/themes/j1/{extensions → modules}/justifiedGallery/js/justifiedGallery.js +0 -0
  158. data/assets/themes/j1/{extensions → modules}/justifiedGallery/js/justifiedGallery.min.js +0 -0
  159. data/assets/themes/j1/{extensions → modules}/lightGallery/css/core/lg-fb-comment-box.css +0 -0
  160. data/assets/themes/j1/{extensions → modules}/lightGallery/css/core/lg-fb-comment-box.min.css +0 -0
  161. data/assets/themes/j1/{extensions → modules}/lightGallery/css/core/lg-transitions.css +0 -0
  162. data/assets/themes/j1/{extensions → modules}/lightGallery/css/core/lg-transitions.min.css +0 -0
  163. data/assets/themes/j1/{extensions → modules}/lightGallery/css/core/lightgallery.css +0 -0
  164. data/assets/themes/j1/{extensions → modules}/lightGallery/css/core/lightgallery.min.css +0 -0
  165. data/assets/themes/j1/{extensions → modules}/lightGallery/css/fonts/lg.eot +0 -0
  166. data/assets/themes/j1/{extensions → modules}/lightGallery/css/fonts/lg.svg +0 -0
  167. data/assets/themes/j1/{extensions → modules}/lightGallery/css/fonts/lg.ttf +0 -0
  168. data/assets/themes/j1/{extensions → modules}/lightGallery/css/fonts/lg.woff +0 -0
  169. data/assets/themes/j1/{extensions → modules}/lightGallery/css/img/loading.gif +0 -0
  170. data/assets/themes/j1/{extensions → modules}/lightGallery/css/img/video-play.png +0 -0
  171. data/assets/themes/j1/{extensions → modules}/lightGallery/css/img/vimeo-play.png +0 -0
  172. data/assets/themes/j1/{extensions → modules}/lightGallery/css/img/youtube-play.png +0 -0
  173. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/animation-w.png +0 -0
  174. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/customize-w.png +0 -0
  175. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/dynamic-w.png +0 -0
  176. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/facebook-icon.svg +0 -0
  177. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/googleplus-icon.svg +0 -0
  178. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/html5-w.png +0 -0
  179. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/linked-in.png +0 -0
  180. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/module-w.png +0 -0
  181. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/play-button.png +0 -0
  182. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/responsive-w.png +0 -0
  183. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/thumb-w.png +0 -0
  184. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/touch-w.png +0 -0
  185. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/twitter-icon.svg +0 -0
  186. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/twitter.png +0 -0
  187. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/video1-w.png +0 -0
  188. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/zoom-w.png +0 -0
  189. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/icons/zoom.png +0 -0
  190. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/uno.css +1 -1
  191. data/assets/themes/j1/{extensions → modules}/lightGallery/css/themes/uno.min.css +1 -1
  192. data/assets/themes/j1/{extensions → modules}/lightGallery/js/core/lightgallery.js +0 -0
  193. data/assets/themes/j1/{extensions → modules}/lightGallery/js/core/lightgallery.min.js +0 -0
  194. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/j1/j1-video.js +0 -0
  195. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/j1/j1-video.min.js +0 -0
  196. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-autoplay.js +0 -0
  197. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-autoplay.min.js +0 -0
  198. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-fullscreen.js +0 -0
  199. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-fullscreen.min.js +0 -0
  200. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-hash.js +0 -0
  201. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-hash.min.js +0 -0
  202. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-pager.js +0 -0
  203. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-pager.min.js +0 -0
  204. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-share.js +0 -0
  205. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-share.min.js +0 -0
  206. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-thumbnail.js +0 -0
  207. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-thumbnail.min.js +0 -0
  208. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-video.js +0 -0
  209. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-video.min.js +0 -0
  210. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-zoom.js +0 -0
  211. data/assets/themes/j1/{extensions → modules}/lightGallery/js/modules/lg-zoom.min.js +0 -0
  212. data/assets/themes/j1/{extensions → modules}/lightbox/LICENSE +0 -0
  213. data/assets/themes/j1/{extensions → modules}/lightbox/css/lightbox.css +1 -1
  214. data/assets/themes/j1/{extensions → modules}/lightbox/css/lightbox.min.css +1 -1
  215. data/assets/themes/j1/{extensions → modules}/lightbox/css/theme/uno.css +1 -1
  216. data/assets/themes/j1/{extensions → modules}/lightbox/css/theme/uno.min.css +1 -1
  217. data/assets/themes/j1/{extensions → modules}/lightbox/images/close.png +0 -0
  218. data/assets/themes/j1/{extensions → modules}/lightbox/images/loading.gif +0 -0
  219. data/assets/themes/j1/{extensions → modules}/lightbox/images/next.png +0 -0
  220. data/assets/themes/j1/{extensions → modules}/lightbox/images/prev.png +0 -0
  221. data/assets/themes/j1/{extensions → modules}/lightbox/js/lightbox.js +0 -0
  222. data/assets/themes/j1/{extensions → modules}/lightbox/js/lightbox.min.js +0 -0
  223. data/assets/themes/j1/{extensions → modules}/mmenuLight/css/mmenu.css +1 -1
  224. data/assets/themes/j1/{extensions → modules}/mmenuLight/css/mmenu.min.css +0 -0
  225. data/assets/themes/j1/{extensions/mmenuLight/css/theme/uno.min.css → modules/mmenuLight/css/theme/uno.css} +21 -12
  226. data/assets/themes/j1/{extensions/mmenuLight/css/theme/uno.css → modules/mmenuLight/css/theme/uno.min.css} +2 -2
  227. data/assets/themes/j1/modules/mmenuLight/js/mmenu.js +563 -0
  228. data/assets/themes/j1/{extensions/mmenuLight/js/mmenu.js → modules/mmenuLight/js/mmenu.min.js} +1 -1
  229. data/assets/themes/j1/{extensions → modules}/noUISlider/LICENSE +0 -0
  230. data/assets/themes/j1/{extensions → modules}/noUISlider/css/nouislider.css +0 -0
  231. data/assets/themes/j1/{extensions → modules}/noUISlider/css/nouislider.min.css +0 -0
  232. data/assets/themes/j1/{extensions → modules}/noUISlider/js/nouislider.js +0 -0
  233. data/assets/themes/j1/{extensions → modules}/noUISlider/js/nouislider.min.js +0 -0
  234. data/assets/themes/j1/modules/polyfills/js/msie.js +140 -0
  235. data/assets/themes/j1/modules/popper/js/popper.js +2623 -0
  236. data/assets/themes/j1/modules/popper/js/popper.js.map +1 -0
  237. data/assets/themes/j1/modules/popper/js/popper.min.js +4 -0
  238. data/assets/themes/j1/modules/popper/js/popper.min.js.map +1 -0
  239. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.dark/theme.css +0 -0
  240. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.light/theme.css +0 -0
  241. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.monokai.dark/theme.css +0 -0
  242. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.monokai.light/theme.css +0 -0
  243. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.monokai/theme.css +0 -0
  244. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.solarized.dark/theme.css +0 -0
  245. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.solarized.light/theme.css +0 -0
  246. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.solarized/theme.css +0 -0
  247. data/assets/themes/j1/{extensions → modules}/rouge/css/base16/theme.css +0 -0
  248. data/assets/themes/j1/{extensions → modules}/rouge/css/colorful/theme.css +0 -0
  249. data/assets/themes/j1/{extensions → modules}/rouge/css/github/theme.css +0 -0
  250. data/assets/themes/j1/{extensions → modules}/rouge/css/gruvbox.dark/theme.css +0 -0
  251. data/assets/themes/j1/{extensions → modules}/rouge/css/gruvbox.light/theme.css +0 -0
  252. data/assets/themes/j1/{extensions → modules}/rouge/css/gruvbox/theme.css +0 -0
  253. data/assets/themes/j1/{extensions → modules}/rouge/css/igorpro/theme.css +0 -0
  254. data/assets/themes/j1/{extensions → modules}/rouge/css/molokai/theme.css +0 -0
  255. data/assets/themes/j1/{extensions → modules}/rouge/css/monokai.sublime/theme.css +0 -0
  256. data/assets/themes/j1/{extensions → modules}/rouge/css/monokai/theme.css +0 -0
  257. data/assets/themes/j1/{extensions → modules}/rouge/css/pastie/theme.css +0 -0
  258. data/assets/themes/j1/{extensions → modules}/rouge/css/thankful_eyes/theme.css +0 -0
  259. data/assets/themes/j1/{extensions → modules}/rouge/css/tulip/theme.css +0 -0
  260. data/assets/themes/j1/modules/tocbot/css/theme/uno.css +89 -0
  261. data/assets/themes/j1/modules/tocbot/css/theme/uno.min.css +89 -0
  262. data/assets/themes/j1/modules/tocbot/css/tocbot.css +75 -0
  263. data/assets/themes/j1/modules/tocbot/css/tocbot.min.css +19 -0
  264. data/assets/themes/j1/modules/tocbot/js/tocbot.js +19 -0
  265. data/assets/themes/j1/modules/tocbot/js/tocbot.min.js +19 -0
  266. data/assets/themes/j1/{extensions → modules}/twemoji/js/LICENSE +0 -0
  267. data/assets/themes/j1/{extensions → modules}/twemoji/js/picker/LICENSE +0 -0
  268. data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.js +275 -0
  269. data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.min.js +275 -0
  270. data/assets/themes/j1/{extensions → modules}/twemoji/js/twemoji.js +0 -1
  271. data/assets/themes/j1/modules/twemoji/js/twemoji.min.js +25 -0
  272. data/assets/themes/j1/modules/util/js/js.cookie.js +163 -0
  273. data/assets/themes/j1/modules/util/js/lite-url.js +203 -0
  274. data/assets/themes/j1/modules/util/js/lite-url.min.js +7 -0
  275. data/assets/themes/j1/modules/util/js/log4javascript.js +264 -0
  276. data/assets/themes/j1/modules/util/js/platform.js +1260 -0
  277. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/city.css +0 -0
  278. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/city.min.css +0 -0
  279. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/fantasy.css +0 -0
  280. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/fantasy.min.css +0 -0
  281. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/forest.css +0 -0
  282. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/forest.min.css +0 -0
  283. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/sea.css +0 -0
  284. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/sea.min.css +0 -0
  285. data/assets/themes/j1/{extensions → modules}/videojs/css/video-js.css +0 -0
  286. data/assets/themes/j1/{extensions → modules}/videojs/css/video-js.min.css +0 -0
  287. data/assets/themes/j1/{extensions → modules}/videojs/js/video.js +0 -0
  288. data/assets/themes/j1/{extensions → modules}/videojs/js/video.min.js +0 -0
  289. data/assets/themes/j1/{extensions → modules}/vimeo/froogaloop/js/froogaloop2.min.js +0 -0
  290. data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.js +0 -0
  291. data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.js.map +0 -0
  292. data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.min.js +0 -0
  293. data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.min.js.map +0 -0
  294. data/lib/j1/version.rb +3 -3
  295. data/lib/j1_app/j1_auth_manager/views/auth_manager_ui.erb +391 -389
  296. data/lib/starter_web/Gemfile +20 -13
  297. data/lib/starter_web/_config.yml +2 -2
  298. data/lib/starter_web/_data/apps/carousel.yml +6 -7
  299. data/lib/starter_web/_data/apps/defaults/carousel.yml +2 -3
  300. data/lib/starter_web/_data/apps/defaults/gallery_customizer.yml +1 -2
  301. data/lib/starter_web/_data/apps/defaults/justified_gallery.yml +1 -2
  302. data/lib/starter_web/_data/apps/defaults/light_gallery.yml +1 -2
  303. data/lib/starter_web/_data/apps/defaults/lightbox.yml +1 -2
  304. data/lib/starter_web/_data/apps/gallery_customizer.yml +1 -2
  305. data/lib/starter_web/_data/apps/justified_gallery.yml +4 -5
  306. data/lib/starter_web/_data/apps/light_gallery.yml +1 -2
  307. data/lib/starter_web/_data/apps/lightbox.yml +1 -2
  308. data/lib/starter_web/_data/blocks/banner.yml +3 -4
  309. data/lib/starter_web/_data/blocks/defaults/banner.yml +3 -4
  310. data/lib/starter_web/_data/blocks/defaults/footer.yml +1 -2
  311. data/lib/starter_web/_data/blocks/defaults/panel.yml +3 -4
  312. data/lib/starter_web/_data/blocks/footer.yml +1 -2
  313. data/lib/starter_web/_data/blocks/panel.yml +14 -15
  314. data/lib/starter_web/_data/builder/blog_navigator.yml +1 -2
  315. data/lib/starter_web/_data/layouts/app.yml +1 -2
  316. data/lib/starter_web/_data/layouts/blog_archive.yml +1 -2
  317. data/lib/starter_web/_data/layouts/collection.yml +1 -2
  318. data/lib/starter_web/_data/layouts/home.yml +5 -6
  319. data/lib/starter_web/_data/layouts/post.yml +1 -2
  320. data/lib/starter_web/_data/layouts/raw.yml +1 -2
  321. data/lib/starter_web/_data/modules/advertising.yml +0 -1
  322. data/lib/starter_web/_data/modules/attics.yml +0 -1
  323. data/lib/starter_web/_data/modules/authentication.yml +0 -1
  324. data/lib/starter_web/_data/modules/{cookie_consent.yml → back2top.yml} +7 -13
  325. data/lib/starter_web/_data/modules/cookiebar.yml +2 -2
  326. data/lib/starter_web/_data/modules/defaults/attics.yml +5 -3
  327. data/lib/starter_web/_data/modules/defaults/authentication.yml +8 -10
  328. data/lib/starter_web/_data/modules/defaults/back2top.yml +146 -0
  329. data/lib/starter_web/_data/modules/defaults/cookiebar.yml +101 -50
  330. data/lib/starter_web/_data/modules/defaults/framer.yml +1 -3
  331. data/lib/starter_web/_data/modules/defaults/jekyll_search.yml +4 -2
  332. data/lib/starter_web/_data/modules/defaults/log4javascript.yml +4 -5
  333. data/lib/starter_web/_data/modules/defaults/log4r.yml +1 -2
  334. data/lib/starter_web/_data/modules/defaults/navigator.yml +16 -14
  335. data/lib/starter_web/_data/modules/defaults/stickybits.yml +1 -2
  336. data/lib/starter_web/_data/modules/defaults/themer.yml +1 -2
  337. data/lib/starter_web/_data/modules/defaults/toccer.yml +1 -2
  338. data/lib/starter_web/_data/modules/framer.yml +1 -2
  339. data/lib/starter_web/_data/modules/log4javascript.yml +4 -5
  340. data/lib/starter_web/_data/modules/log4r.yml +1 -2
  341. data/lib/starter_web/_data/modules/navigator_menu.yml +6 -7
  342. data/lib/starter_web/_data/modules/themer.yml +9 -9
  343. data/lib/starter_web/_data/modules/toccer.yml +1 -1
  344. data/lib/starter_web/_data/resources.yml +267 -170
  345. data/lib/starter_web/_data/template_settings.yml +11 -10
  346. data/lib/starter_web/_data/utilities/util_srv.yml +1 -1
  347. data/lib/starter_web/_plugins/asciidoctor-extensions/banner.rb +43 -0
  348. data/lib/starter_web/_plugins/asciidoctor-extensions/panel.rb +43 -0
  349. data/lib/starter_web/_plugins/{asciidoctor-extensions/lorem-inline.rb → lorem-inline.rb} +0 -0
  350. data/lib/starter_web/assets/images/modules/attics/aditya-joshi-1920x1280.jpg +0 -0
  351. data/lib/starter_web/assets/images/modules/attics/admin-dashboard-bootstrap-1280x600.jpg +0 -0
  352. data/lib/starter_web/assets/images/modules/attics/alex-holyoake-1920x1280.jpg +0 -0
  353. data/lib/starter_web/assets/images/modules/attics/anaya-katlego-1920x1280.jpg +0 -0
  354. data/lib/starter_web/assets/images/modules/attics/antonella-lombardi-1920x1280.jpg +0 -0
  355. data/lib/starter_web/assets/images/modules/attics/antonino-visalli-1920x1280.jpg +0 -0
  356. data/lib/starter_web/assets/images/modules/attics/banner/library-1920x800-bw.jpg +0 -0
  357. data/lib/starter_web/assets/images/modules/attics/banner/signpost-1920x800-bw.jpg +0 -0
  358. data/lib/starter_web/assets/images/modules/attics/banner/water-journal-1280x600.jpg +0 -0
  359. data/lib/starter_web/assets/images/modules/attics/banner/write-1280x600-bw.jpg +0 -0
  360. data/lib/starter_web/assets/images/modules/attics/brandon-mowinkel-1920x1280.jpg +0 -0
  361. data/lib/starter_web/assets/images/modules/attics/building-blocks-1920x1280-bw.jpg +0 -0
  362. data/lib/starter_web/assets/images/modules/attics/cookies-1920x1200-bw.jpg +0 -0
  363. data/lib/starter_web/assets/images/modules/attics/daniel-jensen-1920x1280.jpg +0 -0
  364. data/lib/starter_web/assets/images/modules/attics/giammarco-boscaro-1920x1280.jpg +0 -0
  365. data/lib/starter_web/assets/images/modules/attics/go-up-1920x1280-bw.jpg +0 -0
  366. data/lib/starter_web/assets/images/modules/attics/ian-schneider-1920x1280.jpg +0 -0
  367. data/lib/starter_web/assets/images/modules/attics/ideas-start-here-1920x1280-bw.jpg +0 -0
  368. data/lib/starter_web/assets/images/modules/attics/jason-rosewell-1920x1280.jpg +0 -0
  369. data/lib/starter_web/assets/images/modules/attics/jessica-ruscello-1920x1280.jpg +0 -0
  370. data/lib/starter_web/assets/images/modules/attics/lianhao-1920x1280.jpg +0 -0
  371. data/lib/starter_web/assets/images/modules/attics/library-1920x1280-bw.jpg +0 -0
  372. data/lib/starter_web/assets/images/modules/attics/mae-mue-1920x1280-v.jpg +0 -0
  373. data/lib/starter_web/assets/images/modules/attics/mae-mue-1920x1280.jpg +0 -0
  374. data/lib/starter_web/assets/images/modules/attics/matthaeus-1920x1280.jpg +0 -0
  375. data/lib/starter_web/assets/images/modules/attics/nousnou-iwasaki-1920x1280.jpg +0 -0
  376. data/lib/starter_web/assets/images/modules/attics/premium-1920x1280-bw.jpg +0 -0
  377. data/lib/starter_web/assets/images/modules/attics/robert-v-ruggiero-1920x1280.jpg +0 -0
  378. data/lib/starter_web/assets/images/modules/attics/romain-vignes-1920x1280.jpg +0 -0
  379. data/lib/starter_web/assets/images/modules/attics/runner-1920x1200-bw.jpg +0 -0
  380. data/lib/starter_web/assets/images/modules/attics/spider-web-1920x1200-bw.jpg +0 -0
  381. data/lib/starter_web/assets/images/modules/attics/the-place-1920x1280-bw.jpg +0 -0
  382. data/lib/starter_web/assets/images/modules/attics/welcome-1920x1280-bw.jpg +0 -0
  383. data/lib/starter_web/assets/images/modules/carousel/cats/cat-1.jpg +0 -0
  384. data/lib/starter_web/assets/images/modules/carousel/cats/cat-2.jpg +0 -0
  385. data/lib/starter_web/assets/images/modules/carousel/cats/cat-3.jpg +0 -0
  386. data/lib/starter_web/assets/images/modules/carousel/cats/cat-4.jpg +0 -0
  387. data/lib/starter_web/assets/images/modules/carousel/cats/cat-5.jpg +0 -0
  388. data/lib/starter_web/assets/images/modules/carousel/cats/cat-6.jpg +0 -0
  389. data/lib/starter_web/assets/images/modules/carousel/cats/cat-7.jpg +0 -0
  390. data/lib/starter_web/assets/images/modules/carousel/cats/cat-8.jpg +0 -0
  391. data/lib/starter_web/assets/images/modules/carousel/mega_cities/andreas-brucker_b.jpg +0 -0
  392. data/lib/starter_web/assets/images/modules/carousel/mega_cities/denys-nevozhai-1_b.jpg +0 -0
  393. data/lib/starter_web/assets/images/modules/carousel/mega_cities/denys-nevozhai-2_b.jpg +0 -0
  394. data/lib/starter_web/assets/images/modules/carousel/mega_cities/luca-bravo_b.jpg +0 -0
  395. data/lib/starter_web/assets/images/modules/carousel/mega_cities/thomas-tucker_b.jpg +0 -0
  396. data/lib/starter_web/assets/images/modules/gallery/mega_cities/andreas-brucker_b.jpg +0 -0
  397. data/lib/starter_web/assets/images/modules/gallery/mega_cities/banter-snaps_b.jpg +0 -0
  398. data/lib/starter_web/assets/images/modules/gallery/mega_cities/denys-nevozhai-1_b.jpg +0 -0
  399. data/lib/starter_web/assets/images/modules/gallery/mega_cities/denys-nevozhai-2-bw.jpg +0 -0
  400. data/lib/starter_web/assets/images/modules/gallery/mega_cities/denys-nevozhai-2_b.jpg +0 -0
  401. data/lib/starter_web/assets/images/modules/gallery/mega_cities/emmad-mazhari_b.jpg +0 -0
  402. data/lib/starter_web/assets/images/modules/gallery/mega_cities/ethan-brooke_b.jpg +0 -0
  403. data/lib/starter_web/assets/images/modules/gallery/mega_cities/federico-rizzarelli_b.jpg +0 -0
  404. data/lib/starter_web/assets/images/modules/gallery/mega_cities/gints-gailis_b.jpg +0 -0
  405. data/lib/starter_web/assets/images/modules/gallery/mega_cities/johan-mouchet_b.jpg +0 -0
  406. data/lib/starter_web/assets/images/modules/gallery/mega_cities/luca-bravo_b.jpg +0 -0
  407. data/lib/starter_web/assets/images/modules/gallery/mega_cities/oskars-sylwan_b.jpg +0 -0
  408. data/lib/starter_web/assets/images/modules/gallery/mega_cities/steven-diaz_b.jpg +0 -0
  409. data/lib/starter_web/assets/images/modules/gallery/mega_cities/thomas-tucker-bw.jpg +0 -0
  410. data/lib/starter_web/assets/images/modules/gallery/mega_cities/thomas-tucker_b.jpg +0 -0
  411. data/lib/starter_web/assets/images/modules/lightbox/close.png +0 -0
  412. data/lib/starter_web/assets/images/modules/lightbox/loading.gif +0 -0
  413. data/lib/starter_web/assets/images/modules/lightbox/next.png +0 -0
  414. data/lib/starter_web/assets/images/modules/lightbox/prev.png +0 -0
  415. data/lib/starter_web/assets/images/pages/material/apple-touch-icon.png +0 -0
  416. data/lib/starter_web/assets/images/pages/roundtrip/100_present_images/lightbox-image-1.jpg +0 -0
  417. data/lib/starter_web/assets/images/pages/roundtrip/100_present_images/lightbox-image-2.jpg +0 -0
  418. data/lib/starter_web/assets/images/pages/roundtrip/100_present_images/lightbox-image-3.jpg +0 -0
  419. data/lib/starter_web/assets/images/pages/roundtrip/bootstrap-1920x1000-bw.jpg +0 -0
  420. data/lib/starter_web/assets/images/pages/roundtrip/cards-1920x1280-bw.jpg +0 -0
  421. data/lib/starter_web/assets/images/pages/roundtrip/emojies-1920x1280-bw.jpg +0 -0
  422. data/lib/starter_web/assets/images/pages/roundtrip/icon-fonts-1920x1280-bw.jpg +0 -0
  423. data/lib/starter_web/assets/images/pages/roundtrip/images-1920x1280-bw.jpg +0 -0
  424. data/lib/starter_web/assets/images/pages/roundtrip/puzzle-1920x1280-bw.jpg +0 -0
  425. data/lib/starter_web/assets/images/pages/roundtrip/tables-1920x1280-bw.jpg +0 -0
  426. data/lib/starter_web/assets/images/pages/roundtrip/themes-1920x1280-bw.jpg +0 -0
  427. data/lib/starter_web/assets/images/pages/roundtrip/typography-1920x1280-bw.jpg +0 -0
  428. data/lib/starter_web/assets/videos/gallery/adriana-lima-poster.jpg +0 -0
  429. data/lib/starter_web/assets/videos/gallery/kick-it-old-school-poster.jpg +0 -0
  430. data/lib/starter_web/assets/videos/gallery/video1-poster.jpg +0 -0
  431. data/lib/starter_web/assets/videos/gallery/video2-poster.jpg +0 -0
  432. data/lib/starter_web/assets/videos/gallery/video2-thumb.jpg +0 -0
  433. data/lib/starter_web/assets/videos/headers/still/underground-broadway.jpg +0 -0
  434. data/lib/starter_web/assets/videos/headers/still/victoria-oskolovich-on-vimeo.jpg +0 -0
  435. data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1-template.adoc.erb +3 -4
  436. data/lib/starter_web/collections/posts/public/featured/_posts/2018-05-01-confusion-about-base-url.adoc +1 -1
  437. data/lib/starter_web/collections/posts/public/featured/_posts/2019-05-01-top-open-source-static-site-generators.adoc +17 -17
  438. data/lib/starter_web/collections/posts/public/featured/_posts/2019-06-01-about-cookies.adoc +36 -40
  439. data/lib/starter_web/collections/posts/public/series/_posts/2018-11-01-docker-using-shared-folders.adoc +4 -6
  440. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +1 -3
  441. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +3 -3
  442. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-26-columbia-river.adoc +4 -4
  443. data/lib/starter_web/index.html +3 -5
  444. data/lib/starter_web/package.json +11 -11
  445. data/lib/starter_web/pages/{public → protected}/site_search.adoc +2 -2
  446. data/lib/starter_web/pages/public/blog/navigator/archive.html +24 -18
  447. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +39 -34
  448. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +43 -30
  449. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +29 -29
  450. data/lib/starter_web/pages/public/blog/navigator/index.html +2 -2
  451. data/lib/starter_web/pages/public/learn/examples/floating_div.adoc +1 -1
  452. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/100_meet_and_greet_jekyll.adoc +1 -0
  453. data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour.1.asciidoc +1 -2
  454. data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour.adoc +1 -2
  455. data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour_api.adoc +16 -18
  456. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/attributes.asciidoc +3 -3
  457. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_bottom_info.asciidoc +5 -2
  458. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_bottom_left_warning.asciidoc +2 -2
  459. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_bottom_right_danger.asciidoc +2 -2
  460. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_central_success.asciidoc +2 -2
  461. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_full_height_left_info.asciidoc +2 -2
  462. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_full_height_right_success.asciidoc +2 -2
  463. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_top_info.asciidoc +3 -3
  464. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_top_left_info.asciidoc +2 -2
  465. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_top_right_success.asciidoc +2 -2
  466. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/419_advanced_modals_demo.asciidoc +337 -0
  467. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +2 -2
  468. data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +15 -12
  469. data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +2 -2
  470. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +1 -1
  471. data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +10 -37
  472. data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +2 -2
  473. data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +20 -22
  474. data/lib/starter_web/pages/public/{previewer/mdb_preview → learn/roundtrip/510_mdb_preview}/000_includes/attributes.asciidoc +0 -0
  475. data/lib/starter_web/pages/public/{previewer/mdb_preview → learn/roundtrip/510_mdb_preview}/000_includes/documents/100_buttons.asciidoc +0 -0
  476. data/lib/starter_web/pages/public/{previewer/mdb_preview → learn/roundtrip/510_mdb_preview}/mdb_previewer.adoc +0 -0
  477. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/attributes.asciidoc +1 -1
  478. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_bottom_info.asciidoc +1 -1
  479. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_bottom_left_warning.asciidoc +1 -1
  480. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_bottom_right_danger.asciidoc +1 -1
  481. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_central_success.asciidoc +1 -1
  482. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_full_height_left_info.asciidoc +1 -1
  483. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_full_height_right_success.asciidoc +1 -1
  484. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_top_info.asciidoc +1 -1
  485. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_top_left_info.asciidoc +1 -1
  486. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_top_right_success.asciidoc +1 -1
  487. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/419_advanced_modals_html.asciidoc +5 -5
  488. data/lib/starter_web/pages/public/learn/whats_up.adoc +1 -2
  489. data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +1 -1
  490. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +2 -2
  491. data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +215 -179
  492. data/lib/starter_web/pages/public/previewer/iframer.adoc +3 -2
  493. data/lib/starter_web/pages/public/previewer/justified_gallery.html +1 -1
  494. data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +2 -2
  495. data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +1 -1
  496. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  497. data/lib/starter_web/utilsrv/package.json +1 -1
  498. metadata +256 -204
  499. data/assets/themes/j1/adapter/js/cookie_consent.js +0 -286
  500. data/assets/themes/j1/core/css/custom.scss +0 -28
  501. data/assets/themes/j1/core/css/globals.css +0 -14523
  502. data/assets/themes/j1/core/css/globals.min.css +0 -1
  503. data/assets/themes/j1/core/css/uno.scss +0 -28
  504. data/assets/themes/j1/core/css/vendor.scss +0 -28
  505. data/assets/themes/j1/extensions/twemoji/js/picker/twemoji-picker.js +0 -21
  506. data/assets/themes/j1/extensions/twemoji/js/picker/twemoji-picker.min.js +0 -21
  507. data/assets/themes/j1/extensions/twemoji/js/twemoji.min.js +0 -25
  508. data/lib/starter_web/assets/videos/headers/still/underground-broadway.png +0 -0
  509. data/lib/starter_web/assets/videos/headers/still/victoria-oskolovich-on-vimeo.png +0 -0
  510. data/lib/starter_web/pages/public/clear_button.adoc +0 -121
  511. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/419_advanced_modals_html.asciidoc +0 -928
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  # -----------------------------------------------------------------------------
3
- # ~/assets/themes/j1/extensions/mmenu_light/js/mmenu.js
3
+ # ~/assets/themes/j1/modules/mmenu_light/js/mmenu.js
4
4
  # Mobile Menu v3.0.5 implementation for J1 Template
5
5
  #
6
6
  # Product/Info:
@@ -0,0 +1,140 @@
1
+ /*
2
+ # -----------------------------------------------------------------------------
3
+ # ~/assets/themes/j1/modules/polyfills/js/msie.js
4
+ # Provides JavaScript Polyfills for Internet Explorer 10 and 11
5
+ #
6
+ # Product/Info:
7
+ # http://jekyll.one
8
+ #
9
+ # Copyright (C) 2020 Juergen Adams
10
+ # Copyright (C) 2005–2020 Mozilla and Contributors
11
+ #
12
+ # J1 Template is licensed under MIT License.
13
+ # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE
14
+ # -----------------------------------------------------------------------------
15
+ */
16
+
17
+ /*!
18
+ * MS Polyfills
19
+ * Copyright (C) 2005–2020 Mozilla and Contributors
20
+ * Licensed under MIT License.
21
+ */
22
+
23
+ // Source: https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach
24
+ if (window.NodeList && !NodeList.prototype.forEach) {
25
+ NodeList.prototype.forEach = function(callback, thisArg) {
26
+ thisArg = thisArg || window;
27
+ for (var i = 0; i < this.length; i++) {
28
+ callback.call(thisArg, this[i], i, this);
29
+ }
30
+ };
31
+ }
32
+
33
+ // Source: https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
34
+ if (!Element.prototype.matches) {
35
+ Element.prototype.matches =
36
+ Element.prototype.matchesSelector ||
37
+ Element.prototype.mozMatchesSelector ||
38
+ Element.prototype.msMatchesSelector ||
39
+ Element.prototype.oMatchesSelector ||
40
+ Element.prototype.webkitMatchesSelector ||
41
+ function(s) {
42
+ var matches = (
43
+ this.document || this.ownerDocument
44
+ ).querySelectorAll(s),
45
+ i = matches.length;
46
+ while (--i >= 0 && matches.item(i) !== this) {}
47
+ return i > -1;
48
+ };
49
+ }
50
+
51
+ // Source: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
52
+ if (!Element.prototype.matches) {
53
+ Element.prototype.matches =
54
+ Element.prototype.msMatchesSelector ||
55
+ Element.prototype.webkitMatchesSelector;
56
+ }
57
+
58
+ if (!Element.prototype.closest) {
59
+ Element.prototype.closest = function(s) {
60
+ var el = this;
61
+
62
+ do {
63
+ if (el.matches(s)) return el;
64
+ el = el.parentElement || el.parentNode;
65
+ } while (el !== null && el.nodeType === 1);
66
+ return null;
67
+ };
68
+ }
69
+
70
+ // from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
71
+ (function(arr) {
72
+ arr.forEach(function(item) {
73
+ if (item.hasOwnProperty('after')) {
74
+ return;
75
+ }
76
+ Object.defineProperty(item, 'after', {
77
+ configurable: true,
78
+ enumerable: true,
79
+ writable: true,
80
+ value: function after() {
81
+ var argArr = Array.prototype.slice.call(arguments),
82
+ docFrag = document.createDocumentFragment();
83
+
84
+ argArr.forEach(function(argItem) {
85
+ var isNode = argItem instanceof Node;
86
+ docFrag.appendChild(
87
+ isNode
88
+ ? argItem
89
+ : document.createTextNode(String(argItem))
90
+ );
91
+ });
92
+
93
+ this.parentNode.insertBefore(docFrag, this.nextSibling);
94
+ }
95
+ });
96
+ });
97
+ })([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
98
+
99
+ // Source: https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md
100
+ (function(arr) {
101
+ arr.forEach(function(item) {
102
+ if (item.hasOwnProperty('append')) {
103
+ return;
104
+ }
105
+ Object.defineProperty(item, 'append', {
106
+ configurable: true,
107
+ enumerable: true,
108
+ writable: true,
109
+ value: function append() {
110
+ var argArr = Array.prototype.slice.call(arguments),
111
+ docFrag = document.createDocumentFragment();
112
+
113
+ argArr.forEach(function(argItem) {
114
+ var isNode = argItem instanceof Node;
115
+ docFrag.appendChild(
116
+ isNode
117
+ ? argItem
118
+ : document.createTextNode(String(argItem))
119
+ );
120
+ });
121
+
122
+ this.appendChild(docFrag);
123
+ }
124
+ });
125
+ });
126
+ })([Element.prototype, Document.prototype, DocumentFragment.prototype]);
127
+
128
+ // from: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
129
+ (function() {
130
+ if (typeof window.Event === 'function') return false;
131
+
132
+ function Event(event, params) {
133
+ params = params || { bubbles: false, cancelable: false };
134
+ var evt = document.createEvent('Event');
135
+ evt.initEvent(event, params.bubbles, params.cancelable);
136
+ return evt;
137
+ }
138
+
139
+ window.Event = Event;
140
+ })();
@@ -0,0 +1,2623 @@
1
+ /**!
2
+ * @fileOverview Kickass library to create and place poppers near their reference elements.
3
+ * @version 1.16.1
4
+ * @license
5
+ * Copyright (c) 2016 Federico Zivolo and contributors
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ (function (global, factory) {
26
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
27
+ typeof define === 'function' && define.amd ? define(factory) :
28
+ (global.Popper = factory());
29
+ }(this, (function () { 'use strict';
30
+
31
+ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
32
+
33
+ var timeoutDuration = function () {
34
+ var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
35
+ for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
36
+ if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
37
+ return 1;
38
+ }
39
+ }
40
+ return 0;
41
+ }();
42
+
43
+ function microtaskDebounce(fn) {
44
+ var called = false;
45
+ return function () {
46
+ if (called) {
47
+ return;
48
+ }
49
+ called = true;
50
+ window.Promise.resolve().then(function () {
51
+ called = false;
52
+ fn();
53
+ });
54
+ };
55
+ }
56
+
57
+ function taskDebounce(fn) {
58
+ var scheduled = false;
59
+ return function () {
60
+ if (!scheduled) {
61
+ scheduled = true;
62
+ setTimeout(function () {
63
+ scheduled = false;
64
+ fn();
65
+ }, timeoutDuration);
66
+ }
67
+ };
68
+ }
69
+
70
+ var supportsMicroTasks = isBrowser && window.Promise;
71
+
72
+ /**
73
+ * Create a debounced version of a method, that's asynchronously deferred
74
+ * but called in the minimum time possible.
75
+ *
76
+ * @method
77
+ * @memberof Popper.Utils
78
+ * @argument {Function} fn
79
+ * @returns {Function}
80
+ */
81
+ var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
82
+
83
+ /**
84
+ * Check if the given variable is a function
85
+ * @method
86
+ * @memberof Popper.Utils
87
+ * @argument {Any} functionToCheck - variable to check
88
+ * @returns {Boolean} answer to: is a function?
89
+ */
90
+ function isFunction(functionToCheck) {
91
+ var getType = {};
92
+ return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
93
+ }
94
+
95
+ /**
96
+ * Get CSS computed property of the given element
97
+ * @method
98
+ * @memberof Popper.Utils
99
+ * @argument {Eement} element
100
+ * @argument {String} property
101
+ */
102
+ function getStyleComputedProperty(element, property) {
103
+ if (element.nodeType !== 1) {
104
+ return [];
105
+ }
106
+ // NOTE: 1 DOM access here
107
+ var window = element.ownerDocument.defaultView;
108
+ var css = window.getComputedStyle(element, null);
109
+ return property ? css[property] : css;
110
+ }
111
+
112
+ /**
113
+ * Returns the parentNode or the host of the element
114
+ * @method
115
+ * @memberof Popper.Utils
116
+ * @argument {Element} element
117
+ * @returns {Element} parent
118
+ */
119
+ function getParentNode(element) {
120
+ if (element.nodeName === 'HTML') {
121
+ return element;
122
+ }
123
+ return element.parentNode || element.host;
124
+ }
125
+
126
+ /**
127
+ * Returns the scrolling parent of the given element
128
+ * @method
129
+ * @memberof Popper.Utils
130
+ * @argument {Element} element
131
+ * @returns {Element} scroll parent
132
+ */
133
+ function getScrollParent(element) {
134
+ // Return body, `getScroll` will take care to get the correct `scrollTop` from it
135
+ if (!element) {
136
+ return document.body;
137
+ }
138
+
139
+ switch (element.nodeName) {
140
+ case 'HTML':
141
+ case 'BODY':
142
+ return element.ownerDocument.body;
143
+ case '#document':
144
+ return element.body;
145
+ }
146
+
147
+ // Firefox want us to check `-x` and `-y` variations as well
148
+
149
+ var _getStyleComputedProp = getStyleComputedProperty(element),
150
+ overflow = _getStyleComputedProp.overflow,
151
+ overflowX = _getStyleComputedProp.overflowX,
152
+ overflowY = _getStyleComputedProp.overflowY;
153
+
154
+ if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
155
+ return element;
156
+ }
157
+
158
+ return getScrollParent(getParentNode(element));
159
+ }
160
+
161
+ /**
162
+ * Returns the reference node of the reference object, or the reference object itself.
163
+ * @method
164
+ * @memberof Popper.Utils
165
+ * @param {Element|Object} reference - the reference element (the popper will be relative to this)
166
+ * @returns {Element} parent
167
+ */
168
+ function getReferenceNode(reference) {
169
+ return reference && reference.referenceNode ? reference.referenceNode : reference;
170
+ }
171
+
172
+ var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
173
+ var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
174
+
175
+ /**
176
+ * Determines if the browser is Internet Explorer
177
+ * @method
178
+ * @memberof Popper.Utils
179
+ * @param {Number} version to check
180
+ * @returns {Boolean} isIE
181
+ */
182
+ function isIE(version) {
183
+ if (version === 11) {
184
+ return isIE11;
185
+ }
186
+ if (version === 10) {
187
+ return isIE10;
188
+ }
189
+ return isIE11 || isIE10;
190
+ }
191
+
192
+ /**
193
+ * Returns the offset parent of the given element
194
+ * @method
195
+ * @memberof Popper.Utils
196
+ * @argument {Element} element
197
+ * @returns {Element} offset parent
198
+ */
199
+ function getOffsetParent(element) {
200
+ if (!element) {
201
+ return document.documentElement;
202
+ }
203
+
204
+ var noOffsetParent = isIE(10) ? document.body : null;
205
+
206
+ // NOTE: 1 DOM access here
207
+ var offsetParent = element.offsetParent || null;
208
+ // Skip hidden elements which don't have an offsetParent
209
+ while (offsetParent === noOffsetParent && element.nextElementSibling) {
210
+ offsetParent = (element = element.nextElementSibling).offsetParent;
211
+ }
212
+
213
+ var nodeName = offsetParent && offsetParent.nodeName;
214
+
215
+ if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
216
+ return element ? element.ownerDocument.documentElement : document.documentElement;
217
+ }
218
+
219
+ // .offsetParent will return the closest TH, TD or TABLE in case
220
+ // no offsetParent is present, I hate this job...
221
+ if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
222
+ return getOffsetParent(offsetParent);
223
+ }
224
+
225
+ return offsetParent;
226
+ }
227
+
228
+ function isOffsetContainer(element) {
229
+ var nodeName = element.nodeName;
230
+
231
+ if (nodeName === 'BODY') {
232
+ return false;
233
+ }
234
+ return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
235
+ }
236
+
237
+ /**
238
+ * Finds the root node (document, shadowDOM root) of the given element
239
+ * @method
240
+ * @memberof Popper.Utils
241
+ * @argument {Element} node
242
+ * @returns {Element} root node
243
+ */
244
+ function getRoot(node) {
245
+ if (node.parentNode !== null) {
246
+ return getRoot(node.parentNode);
247
+ }
248
+
249
+ return node;
250
+ }
251
+
252
+ /**
253
+ * Finds the offset parent common to the two provided nodes
254
+ * @method
255
+ * @memberof Popper.Utils
256
+ * @argument {Element} element1
257
+ * @argument {Element} element2
258
+ * @returns {Element} common offset parent
259
+ */
260
+ function findCommonOffsetParent(element1, element2) {
261
+ // This check is needed to avoid errors in case one of the elements isn't defined for any reason
262
+ if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
263
+ return document.documentElement;
264
+ }
265
+
266
+ // Here we make sure to give as "start" the element that comes first in the DOM
267
+ var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
268
+ var start = order ? element1 : element2;
269
+ var end = order ? element2 : element1;
270
+
271
+ // Get common ancestor container
272
+ var range = document.createRange();
273
+ range.setStart(start, 0);
274
+ range.setEnd(end, 0);
275
+ var commonAncestorContainer = range.commonAncestorContainer;
276
+
277
+ // Both nodes are inside #document
278
+
279
+ if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
280
+ if (isOffsetContainer(commonAncestorContainer)) {
281
+ return commonAncestorContainer;
282
+ }
283
+
284
+ return getOffsetParent(commonAncestorContainer);
285
+ }
286
+
287
+ // one of the nodes is inside shadowDOM, find which one
288
+ var element1root = getRoot(element1);
289
+ if (element1root.host) {
290
+ return findCommonOffsetParent(element1root.host, element2);
291
+ } else {
292
+ return findCommonOffsetParent(element1, getRoot(element2).host);
293
+ }
294
+ }
295
+
296
+ /**
297
+ * Gets the scroll value of the given element in the given side (top and left)
298
+ * @method
299
+ * @memberof Popper.Utils
300
+ * @argument {Element} element
301
+ * @argument {String} side `top` or `left`
302
+ * @returns {number} amount of scrolled pixels
303
+ */
304
+ function getScroll(element) {
305
+ var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
306
+
307
+ var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
308
+ var nodeName = element.nodeName;
309
+
310
+ if (nodeName === 'BODY' || nodeName === 'HTML') {
311
+ var html = element.ownerDocument.documentElement;
312
+ var scrollingElement = element.ownerDocument.scrollingElement || html;
313
+ return scrollingElement[upperSide];
314
+ }
315
+
316
+ return element[upperSide];
317
+ }
318
+
319
+ /*
320
+ * Sum or subtract the element scroll values (left and top) from a given rect object
321
+ * @method
322
+ * @memberof Popper.Utils
323
+ * @param {Object} rect - Rect object you want to change
324
+ * @param {HTMLElement} element - The element from the function reads the scroll values
325
+ * @param {Boolean} subtract - set to true if you want to subtract the scroll values
326
+ * @return {Object} rect - The modifier rect object
327
+ */
328
+ function includeScroll(rect, element) {
329
+ var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
330
+
331
+ var scrollTop = getScroll(element, 'top');
332
+ var scrollLeft = getScroll(element, 'left');
333
+ var modifier = subtract ? -1 : 1;
334
+ rect.top += scrollTop * modifier;
335
+ rect.bottom += scrollTop * modifier;
336
+ rect.left += scrollLeft * modifier;
337
+ rect.right += scrollLeft * modifier;
338
+ return rect;
339
+ }
340
+
341
+ /*
342
+ * Helper to detect borders of a given element
343
+ * @method
344
+ * @memberof Popper.Utils
345
+ * @param {CSSStyleDeclaration} styles
346
+ * Result of `getStyleComputedProperty` on the given element
347
+ * @param {String} axis - `x` or `y`
348
+ * @return {number} borders - The borders size of the given axis
349
+ */
350
+
351
+ function getBordersSize(styles, axis) {
352
+ var sideA = axis === 'x' ? 'Left' : 'Top';
353
+ var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
354
+
355
+ return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
356
+ }
357
+
358
+ function getSize(axis, body, html, computedStyle) {
359
+ return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
360
+ }
361
+
362
+ function getWindowSizes(document) {
363
+ var body = document.body;
364
+ var html = document.documentElement;
365
+ var computedStyle = isIE(10) && getComputedStyle(html);
366
+
367
+ return {
368
+ height: getSize('Height', body, html, computedStyle),
369
+ width: getSize('Width', body, html, computedStyle)
370
+ };
371
+ }
372
+
373
+ var classCallCheck = function (instance, Constructor) {
374
+ if (!(instance instanceof Constructor)) {
375
+ throw new TypeError("Cannot call a class as a function");
376
+ }
377
+ };
378
+
379
+ var createClass = function () {
380
+ function defineProperties(target, props) {
381
+ for (var i = 0; i < props.length; i++) {
382
+ var descriptor = props[i];
383
+ descriptor.enumerable = descriptor.enumerable || false;
384
+ descriptor.configurable = true;
385
+ if ("value" in descriptor) descriptor.writable = true;
386
+ Object.defineProperty(target, descriptor.key, descriptor);
387
+ }
388
+ }
389
+
390
+ return function (Constructor, protoProps, staticProps) {
391
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
392
+ if (staticProps) defineProperties(Constructor, staticProps);
393
+ return Constructor;
394
+ };
395
+ }();
396
+
397
+
398
+
399
+
400
+
401
+ var defineProperty = function (obj, key, value) {
402
+ if (key in obj) {
403
+ Object.defineProperty(obj, key, {
404
+ value: value,
405
+ enumerable: true,
406
+ configurable: true,
407
+ writable: true
408
+ });
409
+ } else {
410
+ obj[key] = value;
411
+ }
412
+
413
+ return obj;
414
+ };
415
+
416
+ var _extends = Object.assign || function (target) {
417
+ for (var i = 1; i < arguments.length; i++) {
418
+ var source = arguments[i];
419
+
420
+ for (var key in source) {
421
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
422
+ target[key] = source[key];
423
+ }
424
+ }
425
+ }
426
+
427
+ return target;
428
+ };
429
+
430
+ /**
431
+ * Given element offsets, generate an output similar to getBoundingClientRect
432
+ * @method
433
+ * @memberof Popper.Utils
434
+ * @argument {Object} offsets
435
+ * @returns {Object} ClientRect like output
436
+ */
437
+ function getClientRect(offsets) {
438
+ return _extends({}, offsets, {
439
+ right: offsets.left + offsets.width,
440
+ bottom: offsets.top + offsets.height
441
+ });
442
+ }
443
+
444
+ /**
445
+ * Get bounding client rect of given element
446
+ * @method
447
+ * @memberof Popper.Utils
448
+ * @param {HTMLElement} element
449
+ * @return {Object} client rect
450
+ */
451
+ function getBoundingClientRect(element) {
452
+ var rect = {};
453
+
454
+ // IE10 10 FIX: Please, don't ask, the element isn't
455
+ // considered in DOM in some circumstances...
456
+ // This isn't reproducible in IE10 compatibility mode of IE11
457
+ try {
458
+ if (isIE(10)) {
459
+ rect = element.getBoundingClientRect();
460
+ var scrollTop = getScroll(element, 'top');
461
+ var scrollLeft = getScroll(element, 'left');
462
+ rect.top += scrollTop;
463
+ rect.left += scrollLeft;
464
+ rect.bottom += scrollTop;
465
+ rect.right += scrollLeft;
466
+ } else {
467
+ rect = element.getBoundingClientRect();
468
+ }
469
+ } catch (e) {}
470
+
471
+ var result = {
472
+ left: rect.left,
473
+ top: rect.top,
474
+ width: rect.right - rect.left,
475
+ height: rect.bottom - rect.top
476
+ };
477
+
478
+ // subtract scrollbar size from sizes
479
+ var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
480
+ var width = sizes.width || element.clientWidth || result.width;
481
+ var height = sizes.height || element.clientHeight || result.height;
482
+
483
+ var horizScrollbar = element.offsetWidth - width;
484
+ var vertScrollbar = element.offsetHeight - height;
485
+
486
+ // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
487
+ // we make this check conditional for performance reasons
488
+ if (horizScrollbar || vertScrollbar) {
489
+ var styles = getStyleComputedProperty(element);
490
+ horizScrollbar -= getBordersSize(styles, 'x');
491
+ vertScrollbar -= getBordersSize(styles, 'y');
492
+
493
+ result.width -= horizScrollbar;
494
+ result.height -= vertScrollbar;
495
+ }
496
+
497
+ return getClientRect(result);
498
+ }
499
+
500
+ function getOffsetRectRelativeToArbitraryNode(children, parent) {
501
+ var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
502
+
503
+ var isIE10 = isIE(10);
504
+ var isHTML = parent.nodeName === 'HTML';
505
+ var childrenRect = getBoundingClientRect(children);
506
+ var parentRect = getBoundingClientRect(parent);
507
+ var scrollParent = getScrollParent(children);
508
+
509
+ var styles = getStyleComputedProperty(parent);
510
+ var borderTopWidth = parseFloat(styles.borderTopWidth);
511
+ var borderLeftWidth = parseFloat(styles.borderLeftWidth);
512
+
513
+ // In cases where the parent is fixed, we must ignore negative scroll in offset calc
514
+ if (fixedPosition && isHTML) {
515
+ parentRect.top = Math.max(parentRect.top, 0);
516
+ parentRect.left = Math.max(parentRect.left, 0);
517
+ }
518
+ var offsets = getClientRect({
519
+ top: childrenRect.top - parentRect.top - borderTopWidth,
520
+ left: childrenRect.left - parentRect.left - borderLeftWidth,
521
+ width: childrenRect.width,
522
+ height: childrenRect.height
523
+ });
524
+ offsets.marginTop = 0;
525
+ offsets.marginLeft = 0;
526
+
527
+ // Subtract margins of documentElement in case it's being used as parent
528
+ // we do this only on HTML because it's the only element that behaves
529
+ // differently when margins are applied to it. The margins are included in
530
+ // the box of the documentElement, in the other cases not.
531
+ if (!isIE10 && isHTML) {
532
+ var marginTop = parseFloat(styles.marginTop);
533
+ var marginLeft = parseFloat(styles.marginLeft);
534
+
535
+ offsets.top -= borderTopWidth - marginTop;
536
+ offsets.bottom -= borderTopWidth - marginTop;
537
+ offsets.left -= borderLeftWidth - marginLeft;
538
+ offsets.right -= borderLeftWidth - marginLeft;
539
+
540
+ // Attach marginTop and marginLeft because in some circumstances we may need them
541
+ offsets.marginTop = marginTop;
542
+ offsets.marginLeft = marginLeft;
543
+ }
544
+
545
+ if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
546
+ offsets = includeScroll(offsets, parent);
547
+ }
548
+
549
+ return offsets;
550
+ }
551
+
552
+ function getViewportOffsetRectRelativeToArtbitraryNode(element) {
553
+ var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
554
+
555
+ var html = element.ownerDocument.documentElement;
556
+ var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
557
+ var width = Math.max(html.clientWidth, window.innerWidth || 0);
558
+ var height = Math.max(html.clientHeight, window.innerHeight || 0);
559
+
560
+ var scrollTop = !excludeScroll ? getScroll(html) : 0;
561
+ var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
562
+
563
+ var offset = {
564
+ top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
565
+ left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
566
+ width: width,
567
+ height: height
568
+ };
569
+
570
+ return getClientRect(offset);
571
+ }
572
+
573
+ /**
574
+ * Check if the given element is fixed or is inside a fixed parent
575
+ * @method
576
+ * @memberof Popper.Utils
577
+ * @argument {Element} element
578
+ * @argument {Element} customContainer
579
+ * @returns {Boolean} answer to "isFixed?"
580
+ */
581
+ function isFixed(element) {
582
+ var nodeName = element.nodeName;
583
+ if (nodeName === 'BODY' || nodeName === 'HTML') {
584
+ return false;
585
+ }
586
+ if (getStyleComputedProperty(element, 'position') === 'fixed') {
587
+ return true;
588
+ }
589
+ var parentNode = getParentNode(element);
590
+ if (!parentNode) {
591
+ return false;
592
+ }
593
+ return isFixed(parentNode);
594
+ }
595
+
596
+ /**
597
+ * Finds the first parent of an element that has a transformed property defined
598
+ * @method
599
+ * @memberof Popper.Utils
600
+ * @argument {Element} element
601
+ * @returns {Element} first transformed parent or documentElement
602
+ */
603
+
604
+ function getFixedPositionOffsetParent(element) {
605
+ // This check is needed to avoid errors in case one of the elements isn't defined for any reason
606
+ if (!element || !element.parentElement || isIE()) {
607
+ return document.documentElement;
608
+ }
609
+ var el = element.parentElement;
610
+ while (el && getStyleComputedProperty(el, 'transform') === 'none') {
611
+ el = el.parentElement;
612
+ }
613
+ return el || document.documentElement;
614
+ }
615
+
616
+ /**
617
+ * Computed the boundaries limits and return them
618
+ * @method
619
+ * @memberof Popper.Utils
620
+ * @param {HTMLElement} popper
621
+ * @param {HTMLElement} reference
622
+ * @param {number} padding
623
+ * @param {HTMLElement} boundariesElement - Element used to define the boundaries
624
+ * @param {Boolean} fixedPosition - Is in fixed position mode
625
+ * @returns {Object} Coordinates of the boundaries
626
+ */
627
+ function getBoundaries(popper, reference, padding, boundariesElement) {
628
+ var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
629
+
630
+ // NOTE: 1 DOM access here
631
+
632
+ var boundaries = { top: 0, left: 0 };
633
+ var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
634
+
635
+ // Handle viewport case
636
+ if (boundariesElement === 'viewport') {
637
+ boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
638
+ } else {
639
+ // Handle other cases based on DOM element used as boundaries
640
+ var boundariesNode = void 0;
641
+ if (boundariesElement === 'scrollParent') {
642
+ boundariesNode = getScrollParent(getParentNode(reference));
643
+ if (boundariesNode.nodeName === 'BODY') {
644
+ boundariesNode = popper.ownerDocument.documentElement;
645
+ }
646
+ } else if (boundariesElement === 'window') {
647
+ boundariesNode = popper.ownerDocument.documentElement;
648
+ } else {
649
+ boundariesNode = boundariesElement;
650
+ }
651
+
652
+ var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
653
+
654
+ // In case of HTML, we need a different computation
655
+ if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
656
+ var _getWindowSizes = getWindowSizes(popper.ownerDocument),
657
+ height = _getWindowSizes.height,
658
+ width = _getWindowSizes.width;
659
+
660
+ boundaries.top += offsets.top - offsets.marginTop;
661
+ boundaries.bottom = height + offsets.top;
662
+ boundaries.left += offsets.left - offsets.marginLeft;
663
+ boundaries.right = width + offsets.left;
664
+ } else {
665
+ // for all the other DOM elements, this one is good
666
+ boundaries = offsets;
667
+ }
668
+ }
669
+
670
+ // Add paddings
671
+ padding = padding || 0;
672
+ var isPaddingNumber = typeof padding === 'number';
673
+ boundaries.left += isPaddingNumber ? padding : padding.left || 0;
674
+ boundaries.top += isPaddingNumber ? padding : padding.top || 0;
675
+ boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
676
+ boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
677
+
678
+ return boundaries;
679
+ }
680
+
681
+ function getArea(_ref) {
682
+ var width = _ref.width,
683
+ height = _ref.height;
684
+
685
+ return width * height;
686
+ }
687
+
688
+ /**
689
+ * Utility used to transform the `auto` placement to the placement with more
690
+ * available space.
691
+ * @method
692
+ * @memberof Popper.Utils
693
+ * @argument {Object} data - The data object generated by update method
694
+ * @argument {Object} options - Modifiers configuration and options
695
+ * @returns {Object} The data object, properly modified
696
+ */
697
+ function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
698
+ var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
699
+
700
+ if (placement.indexOf('auto') === -1) {
701
+ return placement;
702
+ }
703
+
704
+ var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
705
+
706
+ var rects = {
707
+ top: {
708
+ width: boundaries.width,
709
+ height: refRect.top - boundaries.top
710
+ },
711
+ right: {
712
+ width: boundaries.right - refRect.right,
713
+ height: boundaries.height
714
+ },
715
+ bottom: {
716
+ width: boundaries.width,
717
+ height: boundaries.bottom - refRect.bottom
718
+ },
719
+ left: {
720
+ width: refRect.left - boundaries.left,
721
+ height: boundaries.height
722
+ }
723
+ };
724
+
725
+ var sortedAreas = Object.keys(rects).map(function (key) {
726
+ return _extends({
727
+ key: key
728
+ }, rects[key], {
729
+ area: getArea(rects[key])
730
+ });
731
+ }).sort(function (a, b) {
732
+ return b.area - a.area;
733
+ });
734
+
735
+ var filteredAreas = sortedAreas.filter(function (_ref2) {
736
+ var width = _ref2.width,
737
+ height = _ref2.height;
738
+ return width >= popper.clientWidth && height >= popper.clientHeight;
739
+ });
740
+
741
+ var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
742
+
743
+ var variation = placement.split('-')[1];
744
+
745
+ return computedPlacement + (variation ? '-' + variation : '');
746
+ }
747
+
748
+ /**
749
+ * Get offsets to the reference element
750
+ * @method
751
+ * @memberof Popper.Utils
752
+ * @param {Object} state
753
+ * @param {Element} popper - the popper element
754
+ * @param {Element} reference - the reference element (the popper will be relative to this)
755
+ * @param {Element} fixedPosition - is in fixed position mode
756
+ * @returns {Object} An object containing the offsets which will be applied to the popper
757
+ */
758
+ function getReferenceOffsets(state, popper, reference) {
759
+ var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
760
+
761
+ var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
762
+ return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
763
+ }
764
+
765
+ /**
766
+ * Get the outer sizes of the given element (offset size + margins)
767
+ * @method
768
+ * @memberof Popper.Utils
769
+ * @argument {Element} element
770
+ * @returns {Object} object containing width and height properties
771
+ */
772
+ function getOuterSizes(element) {
773
+ var window = element.ownerDocument.defaultView;
774
+ var styles = window.getComputedStyle(element);
775
+ var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
776
+ var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
777
+ var result = {
778
+ width: element.offsetWidth + y,
779
+ height: element.offsetHeight + x
780
+ };
781
+ return result;
782
+ }
783
+
784
+ /**
785
+ * Get the opposite placement of the given one
786
+ * @method
787
+ * @memberof Popper.Utils
788
+ * @argument {String} placement
789
+ * @returns {String} flipped placement
790
+ */
791
+ function getOppositePlacement(placement) {
792
+ var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
793
+ return placement.replace(/left|right|bottom|top/g, function (matched) {
794
+ return hash[matched];
795
+ });
796
+ }
797
+
798
+ /**
799
+ * Get offsets to the popper
800
+ * @method
801
+ * @memberof Popper.Utils
802
+ * @param {Object} position - CSS position the Popper will get applied
803
+ * @param {HTMLElement} popper - the popper element
804
+ * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
805
+ * @param {String} placement - one of the valid placement options
806
+ * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
807
+ */
808
+ function getPopperOffsets(popper, referenceOffsets, placement) {
809
+ placement = placement.split('-')[0];
810
+
811
+ // Get popper node sizes
812
+ var popperRect = getOuterSizes(popper);
813
+
814
+ // Add position, width and height to our offsets object
815
+ var popperOffsets = {
816
+ width: popperRect.width,
817
+ height: popperRect.height
818
+ };
819
+
820
+ // depending by the popper placement we have to compute its offsets slightly differently
821
+ var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
822
+ var mainSide = isHoriz ? 'top' : 'left';
823
+ var secondarySide = isHoriz ? 'left' : 'top';
824
+ var measurement = isHoriz ? 'height' : 'width';
825
+ var secondaryMeasurement = !isHoriz ? 'height' : 'width';
826
+
827
+ popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
828
+ if (placement === secondarySide) {
829
+ popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
830
+ } else {
831
+ popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
832
+ }
833
+
834
+ return popperOffsets;
835
+ }
836
+
837
+ /**
838
+ * Mimics the `find` method of Array
839
+ * @method
840
+ * @memberof Popper.Utils
841
+ * @argument {Array} arr
842
+ * @argument prop
843
+ * @argument value
844
+ * @returns index or -1
845
+ */
846
+ function find(arr, check) {
847
+ // use native find if supported
848
+ if (Array.prototype.find) {
849
+ return arr.find(check);
850
+ }
851
+
852
+ // use `filter` to obtain the same behavior of `find`
853
+ return arr.filter(check)[0];
854
+ }
855
+
856
+ /**
857
+ * Return the index of the matching object
858
+ * @method
859
+ * @memberof Popper.Utils
860
+ * @argument {Array} arr
861
+ * @argument prop
862
+ * @argument value
863
+ * @returns index or -1
864
+ */
865
+ function findIndex(arr, prop, value) {
866
+ // use native findIndex if supported
867
+ if (Array.prototype.findIndex) {
868
+ return arr.findIndex(function (cur) {
869
+ return cur[prop] === value;
870
+ });
871
+ }
872
+
873
+ // use `find` + `indexOf` if `findIndex` isn't supported
874
+ var match = find(arr, function (obj) {
875
+ return obj[prop] === value;
876
+ });
877
+ return arr.indexOf(match);
878
+ }
879
+
880
+ /**
881
+ * Loop trough the list of modifiers and run them in order,
882
+ * each of them will then edit the data object.
883
+ * @method
884
+ * @memberof Popper.Utils
885
+ * @param {dataObject} data
886
+ * @param {Array} modifiers
887
+ * @param {String} ends - Optional modifier name used as stopper
888
+ * @returns {dataObject}
889
+ */
890
+ function runModifiers(modifiers, data, ends) {
891
+ var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
892
+
893
+ modifiersToRun.forEach(function (modifier) {
894
+ if (modifier['function']) {
895
+ // eslint-disable-line dot-notation
896
+ console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
897
+ }
898
+ var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
899
+ if (modifier.enabled && isFunction(fn)) {
900
+ // Add properties to offsets to make them a complete clientRect object
901
+ // we do this before each modifier to make sure the previous one doesn't
902
+ // mess with these values
903
+ data.offsets.popper = getClientRect(data.offsets.popper);
904
+ data.offsets.reference = getClientRect(data.offsets.reference);
905
+
906
+ data = fn(data, modifier);
907
+ }
908
+ });
909
+
910
+ return data;
911
+ }
912
+
913
+ /**
914
+ * Updates the position of the popper, computing the new offsets and applying
915
+ * the new style.<br />
916
+ * Prefer `scheduleUpdate` over `update` because of performance reasons.
917
+ * @method
918
+ * @memberof Popper
919
+ */
920
+ function update() {
921
+ // if popper is destroyed, don't perform any further update
922
+ if (this.state.isDestroyed) {
923
+ return;
924
+ }
925
+
926
+ var data = {
927
+ instance: this,
928
+ styles: {},
929
+ arrowStyles: {},
930
+ attributes: {},
931
+ flipped: false,
932
+ offsets: {}
933
+ };
934
+
935
+ // compute reference element offsets
936
+ data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
937
+
938
+ // compute auto placement, store placement inside the data object,
939
+ // modifiers will be able to edit `placement` if needed
940
+ // and refer to originalPlacement to know the original value
941
+ data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
942
+
943
+ // store the computed placement inside `originalPlacement`
944
+ data.originalPlacement = data.placement;
945
+
946
+ data.positionFixed = this.options.positionFixed;
947
+
948
+ // compute the popper offsets
949
+ data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
950
+
951
+ data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
952
+
953
+ // run the modifiers
954
+ data = runModifiers(this.modifiers, data);
955
+
956
+ // the first `update` will call `onCreate` callback
957
+ // the other ones will call `onUpdate` callback
958
+ if (!this.state.isCreated) {
959
+ this.state.isCreated = true;
960
+ this.options.onCreate(data);
961
+ } else {
962
+ this.options.onUpdate(data);
963
+ }
964
+ }
965
+
966
+ /**
967
+ * Helper used to know if the given modifier is enabled.
968
+ * @method
969
+ * @memberof Popper.Utils
970
+ * @returns {Boolean}
971
+ */
972
+ function isModifierEnabled(modifiers, modifierName) {
973
+ return modifiers.some(function (_ref) {
974
+ var name = _ref.name,
975
+ enabled = _ref.enabled;
976
+ return enabled && name === modifierName;
977
+ });
978
+ }
979
+
980
+ /**
981
+ * Get the prefixed supported property name
982
+ * @method
983
+ * @memberof Popper.Utils
984
+ * @argument {String} property (camelCase)
985
+ * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
986
+ */
987
+ function getSupportedPropertyName(property) {
988
+ var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
989
+ var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
990
+
991
+ for (var i = 0; i < prefixes.length; i++) {
992
+ var prefix = prefixes[i];
993
+ var toCheck = prefix ? '' + prefix + upperProp : property;
994
+ if (typeof document.body.style[toCheck] !== 'undefined') {
995
+ return toCheck;
996
+ }
997
+ }
998
+ return null;
999
+ }
1000
+
1001
+ /**
1002
+ * Destroys the popper.
1003
+ * @method
1004
+ * @memberof Popper
1005
+ */
1006
+ function destroy() {
1007
+ this.state.isDestroyed = true;
1008
+
1009
+ // touch DOM only if `applyStyle` modifier is enabled
1010
+ if (isModifierEnabled(this.modifiers, 'applyStyle')) {
1011
+ this.popper.removeAttribute('x-placement');
1012
+ this.popper.style.position = '';
1013
+ this.popper.style.top = '';
1014
+ this.popper.style.left = '';
1015
+ this.popper.style.right = '';
1016
+ this.popper.style.bottom = '';
1017
+ this.popper.style.willChange = '';
1018
+ this.popper.style[getSupportedPropertyName('transform')] = '';
1019
+ }
1020
+
1021
+ this.disableEventListeners();
1022
+
1023
+ // remove the popper if user explicitly asked for the deletion on destroy
1024
+ // do not use `remove` because IE11 doesn't support it
1025
+ if (this.options.removeOnDestroy) {
1026
+ this.popper.parentNode.removeChild(this.popper);
1027
+ }
1028
+ return this;
1029
+ }
1030
+
1031
+ /**
1032
+ * Get the window associated with the element
1033
+ * @argument {Element} element
1034
+ * @returns {Window}
1035
+ */
1036
+ function getWindow(element) {
1037
+ var ownerDocument = element.ownerDocument;
1038
+ return ownerDocument ? ownerDocument.defaultView : window;
1039
+ }
1040
+
1041
+ function attachToScrollParents(scrollParent, event, callback, scrollParents) {
1042
+ var isBody = scrollParent.nodeName === 'BODY';
1043
+ var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
1044
+ target.addEventListener(event, callback, { passive: true });
1045
+
1046
+ if (!isBody) {
1047
+ attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
1048
+ }
1049
+ scrollParents.push(target);
1050
+ }
1051
+
1052
+ /**
1053
+ * Setup needed event listeners used to update the popper position
1054
+ * @method
1055
+ * @memberof Popper.Utils
1056
+ * @private
1057
+ */
1058
+ function setupEventListeners(reference, options, state, updateBound) {
1059
+ // Resize event listener on window
1060
+ state.updateBound = updateBound;
1061
+ getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
1062
+
1063
+ // Scroll event listener on scroll parents
1064
+ var scrollElement = getScrollParent(reference);
1065
+ attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
1066
+ state.scrollElement = scrollElement;
1067
+ state.eventsEnabled = true;
1068
+
1069
+ return state;
1070
+ }
1071
+
1072
+ /**
1073
+ * It will add resize/scroll events and start recalculating
1074
+ * position of the popper element when they are triggered.
1075
+ * @method
1076
+ * @memberof Popper
1077
+ */
1078
+ function enableEventListeners() {
1079
+ if (!this.state.eventsEnabled) {
1080
+ this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
1081
+ }
1082
+ }
1083
+
1084
+ /**
1085
+ * Remove event listeners used to update the popper position
1086
+ * @method
1087
+ * @memberof Popper.Utils
1088
+ * @private
1089
+ */
1090
+ function removeEventListeners(reference, state) {
1091
+ // Remove resize event listener on window
1092
+ getWindow(reference).removeEventListener('resize', state.updateBound);
1093
+
1094
+ // Remove scroll event listener on scroll parents
1095
+ state.scrollParents.forEach(function (target) {
1096
+ target.removeEventListener('scroll', state.updateBound);
1097
+ });
1098
+
1099
+ // Reset state
1100
+ state.updateBound = null;
1101
+ state.scrollParents = [];
1102
+ state.scrollElement = null;
1103
+ state.eventsEnabled = false;
1104
+ return state;
1105
+ }
1106
+
1107
+ /**
1108
+ * It will remove resize/scroll events and won't recalculate popper position
1109
+ * when they are triggered. It also won't trigger `onUpdate` callback anymore,
1110
+ * unless you call `update` method manually.
1111
+ * @method
1112
+ * @memberof Popper
1113
+ */
1114
+ function disableEventListeners() {
1115
+ if (this.state.eventsEnabled) {
1116
+ cancelAnimationFrame(this.scheduleUpdate);
1117
+ this.state = removeEventListeners(this.reference, this.state);
1118
+ }
1119
+ }
1120
+
1121
+ /**
1122
+ * Tells if a given input is a number
1123
+ * @method
1124
+ * @memberof Popper.Utils
1125
+ * @param {*} input to check
1126
+ * @return {Boolean}
1127
+ */
1128
+ function isNumeric(n) {
1129
+ return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
1130
+ }
1131
+
1132
+ /**
1133
+ * Set the style to the given popper
1134
+ * @method
1135
+ * @memberof Popper.Utils
1136
+ * @argument {Element} element - Element to apply the style to
1137
+ * @argument {Object} styles
1138
+ * Object with a list of properties and values which will be applied to the element
1139
+ */
1140
+ function setStyles(element, styles) {
1141
+ Object.keys(styles).forEach(function (prop) {
1142
+ var unit = '';
1143
+ // add unit if the value is numeric and is one of the following
1144
+ if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
1145
+ unit = 'px';
1146
+ }
1147
+ element.style[prop] = styles[prop] + unit;
1148
+ });
1149
+ }
1150
+
1151
+ /**
1152
+ * Set the attributes to the given popper
1153
+ * @method
1154
+ * @memberof Popper.Utils
1155
+ * @argument {Element} element - Element to apply the attributes to
1156
+ * @argument {Object} styles
1157
+ * Object with a list of properties and values which will be applied to the element
1158
+ */
1159
+ function setAttributes(element, attributes) {
1160
+ Object.keys(attributes).forEach(function (prop) {
1161
+ var value = attributes[prop];
1162
+ if (value !== false) {
1163
+ element.setAttribute(prop, attributes[prop]);
1164
+ } else {
1165
+ element.removeAttribute(prop);
1166
+ }
1167
+ });
1168
+ }
1169
+
1170
+ /**
1171
+ * @function
1172
+ * @memberof Modifiers
1173
+ * @argument {Object} data - The data object generated by `update` method
1174
+ * @argument {Object} data.styles - List of style properties - values to apply to popper element
1175
+ * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
1176
+ * @argument {Object} options - Modifiers configuration and options
1177
+ * @returns {Object} The same data object
1178
+ */
1179
+ function applyStyle(data) {
1180
+ // any property present in `data.styles` will be applied to the popper,
1181
+ // in this way we can make the 3rd party modifiers add custom styles to it
1182
+ // Be aware, modifiers could override the properties defined in the previous
1183
+ // lines of this modifier!
1184
+ setStyles(data.instance.popper, data.styles);
1185
+
1186
+ // any property present in `data.attributes` will be applied to the popper,
1187
+ // they will be set as HTML attributes of the element
1188
+ setAttributes(data.instance.popper, data.attributes);
1189
+
1190
+ // if arrowElement is defined and arrowStyles has some properties
1191
+ if (data.arrowElement && Object.keys(data.arrowStyles).length) {
1192
+ setStyles(data.arrowElement, data.arrowStyles);
1193
+ }
1194
+
1195
+ return data;
1196
+ }
1197
+
1198
+ /**
1199
+ * Set the x-placement attribute before everything else because it could be used
1200
+ * to add margins to the popper margins needs to be calculated to get the
1201
+ * correct popper offsets.
1202
+ * @method
1203
+ * @memberof Popper.modifiers
1204
+ * @param {HTMLElement} reference - The reference element used to position the popper
1205
+ * @param {HTMLElement} popper - The HTML element used as popper
1206
+ * @param {Object} options - Popper.js options
1207
+ */
1208
+ function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
1209
+ // compute reference element offsets
1210
+ var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
1211
+
1212
+ // compute auto placement, store placement inside the data object,
1213
+ // modifiers will be able to edit `placement` if needed
1214
+ // and refer to originalPlacement to know the original value
1215
+ var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
1216
+
1217
+ popper.setAttribute('x-placement', placement);
1218
+
1219
+ // Apply `position` to popper before anything else because
1220
+ // without the position applied we can't guarantee correct computations
1221
+ setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
1222
+
1223
+ return options;
1224
+ }
1225
+
1226
+ /**
1227
+ * @function
1228
+ * @memberof Popper.Utils
1229
+ * @argument {Object} data - The data object generated by `update` method
1230
+ * @argument {Boolean} shouldRound - If the offsets should be rounded at all
1231
+ * @returns {Object} The popper's position offsets rounded
1232
+ *
1233
+ * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
1234
+ * good as it can be within reason.
1235
+ * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
1236
+ *
1237
+ * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
1238
+ * as well on High DPI screens).
1239
+ *
1240
+ * Firefox prefers no rounding for positioning and does not have blurriness on
1241
+ * high DPI screens.
1242
+ *
1243
+ * Only horizontal placement and left/right values need to be considered.
1244
+ */
1245
+ function getRoundedOffsets(data, shouldRound) {
1246
+ var _data$offsets = data.offsets,
1247
+ popper = _data$offsets.popper,
1248
+ reference = _data$offsets.reference;
1249
+ var round = Math.round,
1250
+ floor = Math.floor;
1251
+
1252
+ var noRound = function noRound(v) {
1253
+ return v;
1254
+ };
1255
+
1256
+ var referenceWidth = round(reference.width);
1257
+ var popperWidth = round(popper.width);
1258
+
1259
+ var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
1260
+ var isVariation = data.placement.indexOf('-') !== -1;
1261
+ var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
1262
+ var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
1263
+
1264
+ var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
1265
+ var verticalToInteger = !shouldRound ? noRound : round;
1266
+
1267
+ return {
1268
+ left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
1269
+ top: verticalToInteger(popper.top),
1270
+ bottom: verticalToInteger(popper.bottom),
1271
+ right: horizontalToInteger(popper.right)
1272
+ };
1273
+ }
1274
+
1275
+ var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
1276
+
1277
+ /**
1278
+ * @function
1279
+ * @memberof Modifiers
1280
+ * @argument {Object} data - The data object generated by `update` method
1281
+ * @argument {Object} options - Modifiers configuration and options
1282
+ * @returns {Object} The data object, properly modified
1283
+ */
1284
+ function computeStyle(data, options) {
1285
+ var x = options.x,
1286
+ y = options.y;
1287
+ var popper = data.offsets.popper;
1288
+
1289
+ // Remove this legacy support in Popper.js v2
1290
+
1291
+ var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
1292
+ return modifier.name === 'applyStyle';
1293
+ }).gpuAcceleration;
1294
+ if (legacyGpuAccelerationOption !== undefined) {
1295
+ console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
1296
+ }
1297
+ var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
1298
+
1299
+ var offsetParent = getOffsetParent(data.instance.popper);
1300
+ var offsetParentRect = getBoundingClientRect(offsetParent);
1301
+
1302
+ // Styles
1303
+ var styles = {
1304
+ position: popper.position
1305
+ };
1306
+
1307
+ var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
1308
+
1309
+ var sideA = x === 'bottom' ? 'top' : 'bottom';
1310
+ var sideB = y === 'right' ? 'left' : 'right';
1311
+
1312
+ // if gpuAcceleration is set to `true` and transform is supported,
1313
+ // we use `translate3d` to apply the position to the popper we
1314
+ // automatically use the supported prefixed version if needed
1315
+ var prefixedProperty = getSupportedPropertyName('transform');
1316
+
1317
+ // now, let's make a step back and look at this code closely (wtf?)
1318
+ // If the content of the popper grows once it's been positioned, it
1319
+ // may happen that the popper gets misplaced because of the new content
1320
+ // overflowing its reference element
1321
+ // To avoid this problem, we provide two options (x and y), which allow
1322
+ // the consumer to define the offset origin.
1323
+ // If we position a popper on top of a reference element, we can set
1324
+ // `x` to `top` to make the popper grow towards its top instead of
1325
+ // its bottom.
1326
+ var left = void 0,
1327
+ top = void 0;
1328
+ if (sideA === 'bottom') {
1329
+ // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
1330
+ // and not the bottom of the html element
1331
+ if (offsetParent.nodeName === 'HTML') {
1332
+ top = -offsetParent.clientHeight + offsets.bottom;
1333
+ } else {
1334
+ top = -offsetParentRect.height + offsets.bottom;
1335
+ }
1336
+ } else {
1337
+ top = offsets.top;
1338
+ }
1339
+ if (sideB === 'right') {
1340
+ if (offsetParent.nodeName === 'HTML') {
1341
+ left = -offsetParent.clientWidth + offsets.right;
1342
+ } else {
1343
+ left = -offsetParentRect.width + offsets.right;
1344
+ }
1345
+ } else {
1346
+ left = offsets.left;
1347
+ }
1348
+ if (gpuAcceleration && prefixedProperty) {
1349
+ styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
1350
+ styles[sideA] = 0;
1351
+ styles[sideB] = 0;
1352
+ styles.willChange = 'transform';
1353
+ } else {
1354
+ // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
1355
+ var invertTop = sideA === 'bottom' ? -1 : 1;
1356
+ var invertLeft = sideB === 'right' ? -1 : 1;
1357
+ styles[sideA] = top * invertTop;
1358
+ styles[sideB] = left * invertLeft;
1359
+ styles.willChange = sideA + ', ' + sideB;
1360
+ }
1361
+
1362
+ // Attributes
1363
+ var attributes = {
1364
+ 'x-placement': data.placement
1365
+ };
1366
+
1367
+ // Update `data` attributes, styles and arrowStyles
1368
+ data.attributes = _extends({}, attributes, data.attributes);
1369
+ data.styles = _extends({}, styles, data.styles);
1370
+ data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
1371
+
1372
+ return data;
1373
+ }
1374
+
1375
+ /**
1376
+ * Helper used to know if the given modifier depends from another one.<br />
1377
+ * It checks if the needed modifier is listed and enabled.
1378
+ * @method
1379
+ * @memberof Popper.Utils
1380
+ * @param {Array} modifiers - list of modifiers
1381
+ * @param {String} requestingName - name of requesting modifier
1382
+ * @param {String} requestedName - name of requested modifier
1383
+ * @returns {Boolean}
1384
+ */
1385
+ function isModifierRequired(modifiers, requestingName, requestedName) {
1386
+ var requesting = find(modifiers, function (_ref) {
1387
+ var name = _ref.name;
1388
+ return name === requestingName;
1389
+ });
1390
+
1391
+ var isRequired = !!requesting && modifiers.some(function (modifier) {
1392
+ return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
1393
+ });
1394
+
1395
+ if (!isRequired) {
1396
+ var _requesting = '`' + requestingName + '`';
1397
+ var requested = '`' + requestedName + '`';
1398
+ console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
1399
+ }
1400
+ return isRequired;
1401
+ }
1402
+
1403
+ /**
1404
+ * @function
1405
+ * @memberof Modifiers
1406
+ * @argument {Object} data - The data object generated by update method
1407
+ * @argument {Object} options - Modifiers configuration and options
1408
+ * @returns {Object} The data object, properly modified
1409
+ */
1410
+ function arrow(data, options) {
1411
+ var _data$offsets$arrow;
1412
+
1413
+ // arrow depends on keepTogether in order to work
1414
+ if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
1415
+ return data;
1416
+ }
1417
+
1418
+ var arrowElement = options.element;
1419
+
1420
+ // if arrowElement is a string, suppose it's a CSS selector
1421
+ if (typeof arrowElement === 'string') {
1422
+ arrowElement = data.instance.popper.querySelector(arrowElement);
1423
+
1424
+ // if arrowElement is not found, don't run the modifier
1425
+ if (!arrowElement) {
1426
+ return data;
1427
+ }
1428
+ } else {
1429
+ // if the arrowElement isn't a query selector we must check that the
1430
+ // provided DOM node is child of its popper node
1431
+ if (!data.instance.popper.contains(arrowElement)) {
1432
+ console.warn('WARNING: `arrow.element` must be child of its popper element!');
1433
+ return data;
1434
+ }
1435
+ }
1436
+
1437
+ var placement = data.placement.split('-')[0];
1438
+ var _data$offsets = data.offsets,
1439
+ popper = _data$offsets.popper,
1440
+ reference = _data$offsets.reference;
1441
+
1442
+ var isVertical = ['left', 'right'].indexOf(placement) !== -1;
1443
+
1444
+ var len = isVertical ? 'height' : 'width';
1445
+ var sideCapitalized = isVertical ? 'Top' : 'Left';
1446
+ var side = sideCapitalized.toLowerCase();
1447
+ var altSide = isVertical ? 'left' : 'top';
1448
+ var opSide = isVertical ? 'bottom' : 'right';
1449
+ var arrowElementSize = getOuterSizes(arrowElement)[len];
1450
+
1451
+ //
1452
+ // extends keepTogether behavior making sure the popper and its
1453
+ // reference have enough pixels in conjunction
1454
+ //
1455
+
1456
+ // top/left side
1457
+ if (reference[opSide] - arrowElementSize < popper[side]) {
1458
+ data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
1459
+ }
1460
+ // bottom/right side
1461
+ if (reference[side] + arrowElementSize > popper[opSide]) {
1462
+ data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
1463
+ }
1464
+ data.offsets.popper = getClientRect(data.offsets.popper);
1465
+
1466
+ // compute center of the popper
1467
+ var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
1468
+
1469
+ // Compute the sideValue using the updated popper offsets
1470
+ // take popper margin in account because we don't have this info available
1471
+ var css = getStyleComputedProperty(data.instance.popper);
1472
+ var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
1473
+ var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
1474
+ var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
1475
+
1476
+ // prevent arrowElement from being placed not contiguously to its popper
1477
+ sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
1478
+
1479
+ data.arrowElement = arrowElement;
1480
+ data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
1481
+
1482
+ return data;
1483
+ }
1484
+
1485
+ /**
1486
+ * Get the opposite placement variation of the given one
1487
+ * @method
1488
+ * @memberof Popper.Utils
1489
+ * @argument {String} placement variation
1490
+ * @returns {String} flipped placement variation
1491
+ */
1492
+ function getOppositeVariation(variation) {
1493
+ if (variation === 'end') {
1494
+ return 'start';
1495
+ } else if (variation === 'start') {
1496
+ return 'end';
1497
+ }
1498
+ return variation;
1499
+ }
1500
+
1501
+ /**
1502
+ * List of accepted placements to use as values of the `placement` option.<br />
1503
+ * Valid placements are:
1504
+ * - `auto`
1505
+ * - `top`
1506
+ * - `right`
1507
+ * - `bottom`
1508
+ * - `left`
1509
+ *
1510
+ * Each placement can have a variation from this list:
1511
+ * - `-start`
1512
+ * - `-end`
1513
+ *
1514
+ * Variations are interpreted easily if you think of them as the left to right
1515
+ * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
1516
+ * is right.<br />
1517
+ * Vertically (`left` and `right`), `start` is top and `end` is bottom.
1518
+ *
1519
+ * Some valid examples are:
1520
+ * - `top-end` (on top of reference, right aligned)
1521
+ * - `right-start` (on right of reference, top aligned)
1522
+ * - `bottom` (on bottom, centered)
1523
+ * - `auto-end` (on the side with more space available, alignment depends by placement)
1524
+ *
1525
+ * @static
1526
+ * @type {Array}
1527
+ * @enum {String}
1528
+ * @readonly
1529
+ * @method placements
1530
+ * @memberof Popper
1531
+ */
1532
+ var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
1533
+
1534
+ // Get rid of `auto` `auto-start` and `auto-end`
1535
+ var validPlacements = placements.slice(3);
1536
+
1537
+ /**
1538
+ * Given an initial placement, returns all the subsequent placements
1539
+ * clockwise (or counter-clockwise).
1540
+ *
1541
+ * @method
1542
+ * @memberof Popper.Utils
1543
+ * @argument {String} placement - A valid placement (it accepts variations)
1544
+ * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
1545
+ * @returns {Array} placements including their variations
1546
+ */
1547
+ function clockwise(placement) {
1548
+ var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1549
+
1550
+ var index = validPlacements.indexOf(placement);
1551
+ var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
1552
+ return counter ? arr.reverse() : arr;
1553
+ }
1554
+
1555
+ var BEHAVIORS = {
1556
+ FLIP: 'flip',
1557
+ CLOCKWISE: 'clockwise',
1558
+ COUNTERCLOCKWISE: 'counterclockwise'
1559
+ };
1560
+
1561
+ /**
1562
+ * @function
1563
+ * @memberof Modifiers
1564
+ * @argument {Object} data - The data object generated by update method
1565
+ * @argument {Object} options - Modifiers configuration and options
1566
+ * @returns {Object} The data object, properly modified
1567
+ */
1568
+ function flip(data, options) {
1569
+ // if `inner` modifier is enabled, we can't use the `flip` modifier
1570
+ if (isModifierEnabled(data.instance.modifiers, 'inner')) {
1571
+ return data;
1572
+ }
1573
+
1574
+ if (data.flipped && data.placement === data.originalPlacement) {
1575
+ // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
1576
+ return data;
1577
+ }
1578
+
1579
+ var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
1580
+
1581
+ var placement = data.placement.split('-')[0];
1582
+ var placementOpposite = getOppositePlacement(placement);
1583
+ var variation = data.placement.split('-')[1] || '';
1584
+
1585
+ var flipOrder = [];
1586
+
1587
+ switch (options.behavior) {
1588
+ case BEHAVIORS.FLIP:
1589
+ flipOrder = [placement, placementOpposite];
1590
+ break;
1591
+ case BEHAVIORS.CLOCKWISE:
1592
+ flipOrder = clockwise(placement);
1593
+ break;
1594
+ case BEHAVIORS.COUNTERCLOCKWISE:
1595
+ flipOrder = clockwise(placement, true);
1596
+ break;
1597
+ default:
1598
+ flipOrder = options.behavior;
1599
+ }
1600
+
1601
+ flipOrder.forEach(function (step, index) {
1602
+ if (placement !== step || flipOrder.length === index + 1) {
1603
+ return data;
1604
+ }
1605
+
1606
+ placement = data.placement.split('-')[0];
1607
+ placementOpposite = getOppositePlacement(placement);
1608
+
1609
+ var popperOffsets = data.offsets.popper;
1610
+ var refOffsets = data.offsets.reference;
1611
+
1612
+ // using floor because the reference offsets may contain decimals we are not going to consider here
1613
+ var floor = Math.floor;
1614
+ var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
1615
+
1616
+ var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
1617
+ var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
1618
+ var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
1619
+ var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
1620
+
1621
+ var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
1622
+
1623
+ // flip the variation if required
1624
+ var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
1625
+
1626
+ // flips variation if reference element overflows boundaries
1627
+ var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
1628
+
1629
+ // flips variation if popper content overflows boundaries
1630
+ var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
1631
+
1632
+ var flippedVariation = flippedVariationByRef || flippedVariationByContent;
1633
+
1634
+ if (overlapsRef || overflowsBoundaries || flippedVariation) {
1635
+ // this boolean to detect any flip loop
1636
+ data.flipped = true;
1637
+
1638
+ if (overlapsRef || overflowsBoundaries) {
1639
+ placement = flipOrder[index + 1];
1640
+ }
1641
+
1642
+ if (flippedVariation) {
1643
+ variation = getOppositeVariation(variation);
1644
+ }
1645
+
1646
+ data.placement = placement + (variation ? '-' + variation : '');
1647
+
1648
+ // this object contains `position`, we want to preserve it along with
1649
+ // any additional property we may add in the future
1650
+ data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
1651
+
1652
+ data = runModifiers(data.instance.modifiers, data, 'flip');
1653
+ }
1654
+ });
1655
+ return data;
1656
+ }
1657
+
1658
+ /**
1659
+ * @function
1660
+ * @memberof Modifiers
1661
+ * @argument {Object} data - The data object generated by update method
1662
+ * @argument {Object} options - Modifiers configuration and options
1663
+ * @returns {Object} The data object, properly modified
1664
+ */
1665
+ function keepTogether(data) {
1666
+ var _data$offsets = data.offsets,
1667
+ popper = _data$offsets.popper,
1668
+ reference = _data$offsets.reference;
1669
+
1670
+ var placement = data.placement.split('-')[0];
1671
+ var floor = Math.floor;
1672
+ var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
1673
+ var side = isVertical ? 'right' : 'bottom';
1674
+ var opSide = isVertical ? 'left' : 'top';
1675
+ var measurement = isVertical ? 'width' : 'height';
1676
+
1677
+ if (popper[side] < floor(reference[opSide])) {
1678
+ data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
1679
+ }
1680
+ if (popper[opSide] > floor(reference[side])) {
1681
+ data.offsets.popper[opSide] = floor(reference[side]);
1682
+ }
1683
+
1684
+ return data;
1685
+ }
1686
+
1687
+ /**
1688
+ * Converts a string containing value + unit into a px value number
1689
+ * @function
1690
+ * @memberof {modifiers~offset}
1691
+ * @private
1692
+ * @argument {String} str - Value + unit string
1693
+ * @argument {String} measurement - `height` or `width`
1694
+ * @argument {Object} popperOffsets
1695
+ * @argument {Object} referenceOffsets
1696
+ * @returns {Number|String}
1697
+ * Value in pixels, or original string if no values were extracted
1698
+ */
1699
+ function toValue(str, measurement, popperOffsets, referenceOffsets) {
1700
+ // separate value from unit
1701
+ var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
1702
+ var value = +split[1];
1703
+ var unit = split[2];
1704
+
1705
+ // If it's not a number it's an operator, I guess
1706
+ if (!value) {
1707
+ return str;
1708
+ }
1709
+
1710
+ if (unit.indexOf('%') === 0) {
1711
+ var element = void 0;
1712
+ switch (unit) {
1713
+ case '%p':
1714
+ element = popperOffsets;
1715
+ break;
1716
+ case '%':
1717
+ case '%r':
1718
+ default:
1719
+ element = referenceOffsets;
1720
+ }
1721
+
1722
+ var rect = getClientRect(element);
1723
+ return rect[measurement] / 100 * value;
1724
+ } else if (unit === 'vh' || unit === 'vw') {
1725
+ // if is a vh or vw, we calculate the size based on the viewport
1726
+ var size = void 0;
1727
+ if (unit === 'vh') {
1728
+ size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
1729
+ } else {
1730
+ size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
1731
+ }
1732
+ return size / 100 * value;
1733
+ } else {
1734
+ // if is an explicit pixel unit, we get rid of the unit and keep the value
1735
+ // if is an implicit unit, it's px, and we return just the value
1736
+ return value;
1737
+ }
1738
+ }
1739
+
1740
+ /**
1741
+ * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
1742
+ * @function
1743
+ * @memberof {modifiers~offset}
1744
+ * @private
1745
+ * @argument {String} offset
1746
+ * @argument {Object} popperOffsets
1747
+ * @argument {Object} referenceOffsets
1748
+ * @argument {String} basePlacement
1749
+ * @returns {Array} a two cells array with x and y offsets in numbers
1750
+ */
1751
+ function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
1752
+ var offsets = [0, 0];
1753
+
1754
+ // Use height if placement is left or right and index is 0 otherwise use width
1755
+ // in this way the first offset will use an axis and the second one
1756
+ // will use the other one
1757
+ var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
1758
+
1759
+ // Split the offset string to obtain a list of values and operands
1760
+ // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
1761
+ var fragments = offset.split(/(\+|\-)/).map(function (frag) {
1762
+ return frag.trim();
1763
+ });
1764
+
1765
+ // Detect if the offset string contains a pair of values or a single one
1766
+ // they could be separated by comma or space
1767
+ var divider = fragments.indexOf(find(fragments, function (frag) {
1768
+ return frag.search(/,|\s/) !== -1;
1769
+ }));
1770
+
1771
+ if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
1772
+ console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
1773
+ }
1774
+
1775
+ // If divider is found, we divide the list of values and operands to divide
1776
+ // them by ofset X and Y.
1777
+ var splitRegex = /\s*,\s*|\s+/;
1778
+ var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
1779
+
1780
+ // Convert the values with units to absolute pixels to allow our computations
1781
+ ops = ops.map(function (op, index) {
1782
+ // Most of the units rely on the orientation of the popper
1783
+ var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
1784
+ var mergeWithPrevious = false;
1785
+ return op
1786
+ // This aggregates any `+` or `-` sign that aren't considered operators
1787
+ // e.g.: 10 + +5 => [10, +, +5]
1788
+ .reduce(function (a, b) {
1789
+ if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
1790
+ a[a.length - 1] = b;
1791
+ mergeWithPrevious = true;
1792
+ return a;
1793
+ } else if (mergeWithPrevious) {
1794
+ a[a.length - 1] += b;
1795
+ mergeWithPrevious = false;
1796
+ return a;
1797
+ } else {
1798
+ return a.concat(b);
1799
+ }
1800
+ }, [])
1801
+ // Here we convert the string values into number values (in px)
1802
+ .map(function (str) {
1803
+ return toValue(str, measurement, popperOffsets, referenceOffsets);
1804
+ });
1805
+ });
1806
+
1807
+ // Loop trough the offsets arrays and execute the operations
1808
+ ops.forEach(function (op, index) {
1809
+ op.forEach(function (frag, index2) {
1810
+ if (isNumeric(frag)) {
1811
+ offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
1812
+ }
1813
+ });
1814
+ });
1815
+ return offsets;
1816
+ }
1817
+
1818
+ /**
1819
+ * @function
1820
+ * @memberof Modifiers
1821
+ * @argument {Object} data - The data object generated by update method
1822
+ * @argument {Object} options - Modifiers configuration and options
1823
+ * @argument {Number|String} options.offset=0
1824
+ * The offset value as described in the modifier description
1825
+ * @returns {Object} The data object, properly modified
1826
+ */
1827
+ function offset(data, _ref) {
1828
+ var offset = _ref.offset;
1829
+ var placement = data.placement,
1830
+ _data$offsets = data.offsets,
1831
+ popper = _data$offsets.popper,
1832
+ reference = _data$offsets.reference;
1833
+
1834
+ var basePlacement = placement.split('-')[0];
1835
+
1836
+ var offsets = void 0;
1837
+ if (isNumeric(+offset)) {
1838
+ offsets = [+offset, 0];
1839
+ } else {
1840
+ offsets = parseOffset(offset, popper, reference, basePlacement);
1841
+ }
1842
+
1843
+ if (basePlacement === 'left') {
1844
+ popper.top += offsets[0];
1845
+ popper.left -= offsets[1];
1846
+ } else if (basePlacement === 'right') {
1847
+ popper.top += offsets[0];
1848
+ popper.left += offsets[1];
1849
+ } else if (basePlacement === 'top') {
1850
+ popper.left += offsets[0];
1851
+ popper.top -= offsets[1];
1852
+ } else if (basePlacement === 'bottom') {
1853
+ popper.left += offsets[0];
1854
+ popper.top += offsets[1];
1855
+ }
1856
+
1857
+ data.popper = popper;
1858
+ return data;
1859
+ }
1860
+
1861
+ /**
1862
+ * @function
1863
+ * @memberof Modifiers
1864
+ * @argument {Object} data - The data object generated by `update` method
1865
+ * @argument {Object} options - Modifiers configuration and options
1866
+ * @returns {Object} The data object, properly modified
1867
+ */
1868
+ function preventOverflow(data, options) {
1869
+ var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
1870
+
1871
+ // If offsetParent is the reference element, we really want to
1872
+ // go one step up and use the next offsetParent as reference to
1873
+ // avoid to make this modifier completely useless and look like broken
1874
+ if (data.instance.reference === boundariesElement) {
1875
+ boundariesElement = getOffsetParent(boundariesElement);
1876
+ }
1877
+
1878
+ // NOTE: DOM access here
1879
+ // resets the popper's position so that the document size can be calculated excluding
1880
+ // the size of the popper element itself
1881
+ var transformProp = getSupportedPropertyName('transform');
1882
+ var popperStyles = data.instance.popper.style; // assignment to help minification
1883
+ var top = popperStyles.top,
1884
+ left = popperStyles.left,
1885
+ transform = popperStyles[transformProp];
1886
+
1887
+ popperStyles.top = '';
1888
+ popperStyles.left = '';
1889
+ popperStyles[transformProp] = '';
1890
+
1891
+ var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
1892
+
1893
+ // NOTE: DOM access here
1894
+ // restores the original style properties after the offsets have been computed
1895
+ popperStyles.top = top;
1896
+ popperStyles.left = left;
1897
+ popperStyles[transformProp] = transform;
1898
+
1899
+ options.boundaries = boundaries;
1900
+
1901
+ var order = options.priority;
1902
+ var popper = data.offsets.popper;
1903
+
1904
+ var check = {
1905
+ primary: function primary(placement) {
1906
+ var value = popper[placement];
1907
+ if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
1908
+ value = Math.max(popper[placement], boundaries[placement]);
1909
+ }
1910
+ return defineProperty({}, placement, value);
1911
+ },
1912
+ secondary: function secondary(placement) {
1913
+ var mainSide = placement === 'right' ? 'left' : 'top';
1914
+ var value = popper[mainSide];
1915
+ if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
1916
+ value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
1917
+ }
1918
+ return defineProperty({}, mainSide, value);
1919
+ }
1920
+ };
1921
+
1922
+ order.forEach(function (placement) {
1923
+ var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
1924
+ popper = _extends({}, popper, check[side](placement));
1925
+ });
1926
+
1927
+ data.offsets.popper = popper;
1928
+
1929
+ return data;
1930
+ }
1931
+
1932
+ /**
1933
+ * @function
1934
+ * @memberof Modifiers
1935
+ * @argument {Object} data - The data object generated by `update` method
1936
+ * @argument {Object} options - Modifiers configuration and options
1937
+ * @returns {Object} The data object, properly modified
1938
+ */
1939
+ function shift(data) {
1940
+ var placement = data.placement;
1941
+ var basePlacement = placement.split('-')[0];
1942
+ var shiftvariation = placement.split('-')[1];
1943
+
1944
+ // if shift shiftvariation is specified, run the modifier
1945
+ if (shiftvariation) {
1946
+ var _data$offsets = data.offsets,
1947
+ reference = _data$offsets.reference,
1948
+ popper = _data$offsets.popper;
1949
+
1950
+ var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
1951
+ var side = isVertical ? 'left' : 'top';
1952
+ var measurement = isVertical ? 'width' : 'height';
1953
+
1954
+ var shiftOffsets = {
1955
+ start: defineProperty({}, side, reference[side]),
1956
+ end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
1957
+ };
1958
+
1959
+ data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
1960
+ }
1961
+
1962
+ return data;
1963
+ }
1964
+
1965
+ /**
1966
+ * @function
1967
+ * @memberof Modifiers
1968
+ * @argument {Object} data - The data object generated by update method
1969
+ * @argument {Object} options - Modifiers configuration and options
1970
+ * @returns {Object} The data object, properly modified
1971
+ */
1972
+ function hide(data) {
1973
+ if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
1974
+ return data;
1975
+ }
1976
+
1977
+ var refRect = data.offsets.reference;
1978
+ var bound = find(data.instance.modifiers, function (modifier) {
1979
+ return modifier.name === 'preventOverflow';
1980
+ }).boundaries;
1981
+
1982
+ if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
1983
+ // Avoid unnecessary DOM access if visibility hasn't changed
1984
+ if (data.hide === true) {
1985
+ return data;
1986
+ }
1987
+
1988
+ data.hide = true;
1989
+ data.attributes['x-out-of-boundaries'] = '';
1990
+ } else {
1991
+ // Avoid unnecessary DOM access if visibility hasn't changed
1992
+ if (data.hide === false) {
1993
+ return data;
1994
+ }
1995
+
1996
+ data.hide = false;
1997
+ data.attributes['x-out-of-boundaries'] = false;
1998
+ }
1999
+
2000
+ return data;
2001
+ }
2002
+
2003
+ /**
2004
+ * @function
2005
+ * @memberof Modifiers
2006
+ * @argument {Object} data - The data object generated by `update` method
2007
+ * @argument {Object} options - Modifiers configuration and options
2008
+ * @returns {Object} The data object, properly modified
2009
+ */
2010
+ function inner(data) {
2011
+ var placement = data.placement;
2012
+ var basePlacement = placement.split('-')[0];
2013
+ var _data$offsets = data.offsets,
2014
+ popper = _data$offsets.popper,
2015
+ reference = _data$offsets.reference;
2016
+
2017
+ var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
2018
+
2019
+ var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
2020
+
2021
+ popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
2022
+
2023
+ data.placement = getOppositePlacement(placement);
2024
+ data.offsets.popper = getClientRect(popper);
2025
+
2026
+ return data;
2027
+ }
2028
+
2029
+ /**
2030
+ * Modifier function, each modifier can have a function of this type assigned
2031
+ * to its `fn` property.<br />
2032
+ * These functions will be called on each update, this means that you must
2033
+ * make sure they are performant enough to avoid performance bottlenecks.
2034
+ *
2035
+ * @function ModifierFn
2036
+ * @argument {dataObject} data - The data object generated by `update` method
2037
+ * @argument {Object} options - Modifiers configuration and options
2038
+ * @returns {dataObject} The data object, properly modified
2039
+ */
2040
+
2041
+ /**
2042
+ * Modifiers are plugins used to alter the behavior of your poppers.<br />
2043
+ * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
2044
+ * needed by the library.
2045
+ *
2046
+ * Usually you don't want to override the `order`, `fn` and `onLoad` props.
2047
+ * All the other properties are configurations that could be tweaked.
2048
+ * @namespace modifiers
2049
+ */
2050
+ var modifiers = {
2051
+ /**
2052
+ * Modifier used to shift the popper on the start or end of its reference
2053
+ * element.<br />
2054
+ * It will read the variation of the `placement` property.<br />
2055
+ * It can be one either `-end` or `-start`.
2056
+ * @memberof modifiers
2057
+ * @inner
2058
+ */
2059
+ shift: {
2060
+ /** @prop {number} order=100 - Index used to define the order of execution */
2061
+ order: 100,
2062
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2063
+ enabled: true,
2064
+ /** @prop {ModifierFn} */
2065
+ fn: shift
2066
+ },
2067
+
2068
+ /**
2069
+ * The `offset` modifier can shift your popper on both its axis.
2070
+ *
2071
+ * It accepts the following units:
2072
+ * - `px` or unit-less, interpreted as pixels
2073
+ * - `%` or `%r`, percentage relative to the length of the reference element
2074
+ * - `%p`, percentage relative to the length of the popper element
2075
+ * - `vw`, CSS viewport width unit
2076
+ * - `vh`, CSS viewport height unit
2077
+ *
2078
+ * For length is intended the main axis relative to the placement of the popper.<br />
2079
+ * This means that if the placement is `top` or `bottom`, the length will be the
2080
+ * `width`. In case of `left` or `right`, it will be the `height`.
2081
+ *
2082
+ * You can provide a single value (as `Number` or `String`), or a pair of values
2083
+ * as `String` divided by a comma or one (or more) white spaces.<br />
2084
+ * The latter is a deprecated method because it leads to confusion and will be
2085
+ * removed in v2.<br />
2086
+ * Additionally, it accepts additions and subtractions between different units.
2087
+ * Note that multiplications and divisions aren't supported.
2088
+ *
2089
+ * Valid examples are:
2090
+ * ```
2091
+ * 10
2092
+ * '10%'
2093
+ * '10, 10'
2094
+ * '10%, 10'
2095
+ * '10 + 10%'
2096
+ * '10 - 5vh + 3%'
2097
+ * '-10px + 5vh, 5px - 6%'
2098
+ * ```
2099
+ * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
2100
+ * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
2101
+ * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
2102
+ *
2103
+ * @memberof modifiers
2104
+ * @inner
2105
+ */
2106
+ offset: {
2107
+ /** @prop {number} order=200 - Index used to define the order of execution */
2108
+ order: 200,
2109
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2110
+ enabled: true,
2111
+ /** @prop {ModifierFn} */
2112
+ fn: offset,
2113
+ /** @prop {Number|String} offset=0
2114
+ * The offset value as described in the modifier description
2115
+ */
2116
+ offset: 0
2117
+ },
2118
+
2119
+ /**
2120
+ * Modifier used to prevent the popper from being positioned outside the boundary.
2121
+ *
2122
+ * A scenario exists where the reference itself is not within the boundaries.<br />
2123
+ * We can say it has "escaped the boundaries" — or just "escaped".<br />
2124
+ * In this case we need to decide whether the popper should either:
2125
+ *
2126
+ * - detach from the reference and remain "trapped" in the boundaries, or
2127
+ * - if it should ignore the boundary and "escape with its reference"
2128
+ *
2129
+ * When `escapeWithReference` is set to`true` and reference is completely
2130
+ * outside its boundaries, the popper will overflow (or completely leave)
2131
+ * the boundaries in order to remain attached to the edge of the reference.
2132
+ *
2133
+ * @memberof modifiers
2134
+ * @inner
2135
+ */
2136
+ preventOverflow: {
2137
+ /** @prop {number} order=300 - Index used to define the order of execution */
2138
+ order: 300,
2139
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2140
+ enabled: true,
2141
+ /** @prop {ModifierFn} */
2142
+ fn: preventOverflow,
2143
+ /**
2144
+ * @prop {Array} [priority=['left','right','top','bottom']]
2145
+ * Popper will try to prevent overflow following these priorities by default,
2146
+ * then, it could overflow on the left and on top of the `boundariesElement`
2147
+ */
2148
+ priority: ['left', 'right', 'top', 'bottom'],
2149
+ /**
2150
+ * @prop {number} padding=5
2151
+ * Amount of pixel used to define a minimum distance between the boundaries
2152
+ * and the popper. This makes sure the popper always has a little padding
2153
+ * between the edges of its container
2154
+ */
2155
+ padding: 5,
2156
+ /**
2157
+ * @prop {String|HTMLElement} boundariesElement='scrollParent'
2158
+ * Boundaries used by the modifier. Can be `scrollParent`, `window`,
2159
+ * `viewport` or any DOM element.
2160
+ */
2161
+ boundariesElement: 'scrollParent'
2162
+ },
2163
+
2164
+ /**
2165
+ * Modifier used to make sure the reference and its popper stay near each other
2166
+ * without leaving any gap between the two. Especially useful when the arrow is
2167
+ * enabled and you want to ensure that it points to its reference element.
2168
+ * It cares only about the first axis. You can still have poppers with margin
2169
+ * between the popper and its reference element.
2170
+ * @memberof modifiers
2171
+ * @inner
2172
+ */
2173
+ keepTogether: {
2174
+ /** @prop {number} order=400 - Index used to define the order of execution */
2175
+ order: 400,
2176
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2177
+ enabled: true,
2178
+ /** @prop {ModifierFn} */
2179
+ fn: keepTogether
2180
+ },
2181
+
2182
+ /**
2183
+ * This modifier is used to move the `arrowElement` of the popper to make
2184
+ * sure it is positioned between the reference element and its popper element.
2185
+ * It will read the outer size of the `arrowElement` node to detect how many
2186
+ * pixels of conjunction are needed.
2187
+ *
2188
+ * It has no effect if no `arrowElement` is provided.
2189
+ * @memberof modifiers
2190
+ * @inner
2191
+ */
2192
+ arrow: {
2193
+ /** @prop {number} order=500 - Index used to define the order of execution */
2194
+ order: 500,
2195
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2196
+ enabled: true,
2197
+ /** @prop {ModifierFn} */
2198
+ fn: arrow,
2199
+ /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
2200
+ element: '[x-arrow]'
2201
+ },
2202
+
2203
+ /**
2204
+ * Modifier used to flip the popper's placement when it starts to overlap its
2205
+ * reference element.
2206
+ *
2207
+ * Requires the `preventOverflow` modifier before it in order to work.
2208
+ *
2209
+ * **NOTE:** this modifier will interrupt the current update cycle and will
2210
+ * restart it if it detects the need to flip the placement.
2211
+ * @memberof modifiers
2212
+ * @inner
2213
+ */
2214
+ flip: {
2215
+ /** @prop {number} order=600 - Index used to define the order of execution */
2216
+ order: 600,
2217
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2218
+ enabled: true,
2219
+ /** @prop {ModifierFn} */
2220
+ fn: flip,
2221
+ /**
2222
+ * @prop {String|Array} behavior='flip'
2223
+ * The behavior used to change the popper's placement. It can be one of
2224
+ * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
2225
+ * placements (with optional variations)
2226
+ */
2227
+ behavior: 'flip',
2228
+ /**
2229
+ * @prop {number} padding=5
2230
+ * The popper will flip if it hits the edges of the `boundariesElement`
2231
+ */
2232
+ padding: 5,
2233
+ /**
2234
+ * @prop {String|HTMLElement} boundariesElement='viewport'
2235
+ * The element which will define the boundaries of the popper position.
2236
+ * The popper will never be placed outside of the defined boundaries
2237
+ * (except if `keepTogether` is enabled)
2238
+ */
2239
+ boundariesElement: 'viewport',
2240
+ /**
2241
+ * @prop {Boolean} flipVariations=false
2242
+ * The popper will switch placement variation between `-start` and `-end` when
2243
+ * the reference element overlaps its boundaries.
2244
+ *
2245
+ * The original placement should have a set variation.
2246
+ */
2247
+ flipVariations: false,
2248
+ /**
2249
+ * @prop {Boolean} flipVariationsByContent=false
2250
+ * The popper will switch placement variation between `-start` and `-end` when
2251
+ * the popper element overlaps its reference boundaries.
2252
+ *
2253
+ * The original placement should have a set variation.
2254
+ */
2255
+ flipVariationsByContent: false
2256
+ },
2257
+
2258
+ /**
2259
+ * Modifier used to make the popper flow toward the inner of the reference element.
2260
+ * By default, when this modifier is disabled, the popper will be placed outside
2261
+ * the reference element.
2262
+ * @memberof modifiers
2263
+ * @inner
2264
+ */
2265
+ inner: {
2266
+ /** @prop {number} order=700 - Index used to define the order of execution */
2267
+ order: 700,
2268
+ /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
2269
+ enabled: false,
2270
+ /** @prop {ModifierFn} */
2271
+ fn: inner
2272
+ },
2273
+
2274
+ /**
2275
+ * Modifier used to hide the popper when its reference element is outside of the
2276
+ * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
2277
+ * be used to hide with a CSS selector the popper when its reference is
2278
+ * out of boundaries.
2279
+ *
2280
+ * Requires the `preventOverflow` modifier before it in order to work.
2281
+ * @memberof modifiers
2282
+ * @inner
2283
+ */
2284
+ hide: {
2285
+ /** @prop {number} order=800 - Index used to define the order of execution */
2286
+ order: 800,
2287
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2288
+ enabled: true,
2289
+ /** @prop {ModifierFn} */
2290
+ fn: hide
2291
+ },
2292
+
2293
+ /**
2294
+ * Computes the style that will be applied to the popper element to gets
2295
+ * properly positioned.
2296
+ *
2297
+ * Note that this modifier will not touch the DOM, it just prepares the styles
2298
+ * so that `applyStyle` modifier can apply it. This separation is useful
2299
+ * in case you need to replace `applyStyle` with a custom implementation.
2300
+ *
2301
+ * This modifier has `850` as `order` value to maintain backward compatibility
2302
+ * with previous versions of Popper.js. Expect the modifiers ordering method
2303
+ * to change in future major versions of the library.
2304
+ *
2305
+ * @memberof modifiers
2306
+ * @inner
2307
+ */
2308
+ computeStyle: {
2309
+ /** @prop {number} order=850 - Index used to define the order of execution */
2310
+ order: 850,
2311
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2312
+ enabled: true,
2313
+ /** @prop {ModifierFn} */
2314
+ fn: computeStyle,
2315
+ /**
2316
+ * @prop {Boolean} gpuAcceleration=true
2317
+ * If true, it uses the CSS 3D transformation to position the popper.
2318
+ * Otherwise, it will use the `top` and `left` properties
2319
+ */
2320
+ gpuAcceleration: true,
2321
+ /**
2322
+ * @prop {string} [x='bottom']
2323
+ * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
2324
+ * Change this if your popper should grow in a direction different from `bottom`
2325
+ */
2326
+ x: 'bottom',
2327
+ /**
2328
+ * @prop {string} [x='left']
2329
+ * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
2330
+ * Change this if your popper should grow in a direction different from `right`
2331
+ */
2332
+ y: 'right'
2333
+ },
2334
+
2335
+ /**
2336
+ * Applies the computed styles to the popper element.
2337
+ *
2338
+ * All the DOM manipulations are limited to this modifier. This is useful in case
2339
+ * you want to integrate Popper.js inside a framework or view library and you
2340
+ * want to delegate all the DOM manipulations to it.
2341
+ *
2342
+ * Note that if you disable this modifier, you must make sure the popper element
2343
+ * has its position set to `absolute` before Popper.js can do its work!
2344
+ *
2345
+ * Just disable this modifier and define your own to achieve the desired effect.
2346
+ *
2347
+ * @memberof modifiers
2348
+ * @inner
2349
+ */
2350
+ applyStyle: {
2351
+ /** @prop {number} order=900 - Index used to define the order of execution */
2352
+ order: 900,
2353
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2354
+ enabled: true,
2355
+ /** @prop {ModifierFn} */
2356
+ fn: applyStyle,
2357
+ /** @prop {Function} */
2358
+ onLoad: applyStyleOnLoad,
2359
+ /**
2360
+ * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
2361
+ * @prop {Boolean} gpuAcceleration=true
2362
+ * If true, it uses the CSS 3D transformation to position the popper.
2363
+ * Otherwise, it will use the `top` and `left` properties
2364
+ */
2365
+ gpuAcceleration: undefined
2366
+ }
2367
+ };
2368
+
2369
+ /**
2370
+ * The `dataObject` is an object containing all the information used by Popper.js.
2371
+ * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
2372
+ * @name dataObject
2373
+ * @property {Object} data.instance The Popper.js instance
2374
+ * @property {String} data.placement Placement applied to popper
2375
+ * @property {String} data.originalPlacement Placement originally defined on init
2376
+ * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
2377
+ * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
2378
+ * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
2379
+ * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
2380
+ * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
2381
+ * @property {Object} data.boundaries Offsets of the popper boundaries
2382
+ * @property {Object} data.offsets The measurements of popper, reference and arrow elements
2383
+ * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
2384
+ * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
2385
+ * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
2386
+ */
2387
+
2388
+ /**
2389
+ * Default options provided to Popper.js constructor.<br />
2390
+ * These can be overridden using the `options` argument of Popper.js.<br />
2391
+ * To override an option, simply pass an object with the same
2392
+ * structure of the `options` object, as the 3rd argument. For example:
2393
+ * ```
2394
+ * new Popper(ref, pop, {
2395
+ * modifiers: {
2396
+ * preventOverflow: { enabled: false }
2397
+ * }
2398
+ * })
2399
+ * ```
2400
+ * @type {Object}
2401
+ * @static
2402
+ * @memberof Popper
2403
+ */
2404
+ var Defaults = {
2405
+ /**
2406
+ * Popper's placement.
2407
+ * @prop {Popper.placements} placement='bottom'
2408
+ */
2409
+ placement: 'bottom',
2410
+
2411
+ /**
2412
+ * Set this to true if you want popper to position it self in 'fixed' mode
2413
+ * @prop {Boolean} positionFixed=false
2414
+ */
2415
+ positionFixed: false,
2416
+
2417
+ /**
2418
+ * Whether events (resize, scroll) are initially enabled.
2419
+ * @prop {Boolean} eventsEnabled=true
2420
+ */
2421
+ eventsEnabled: true,
2422
+
2423
+ /**
2424
+ * Set to true if you want to automatically remove the popper when
2425
+ * you call the `destroy` method.
2426
+ * @prop {Boolean} removeOnDestroy=false
2427
+ */
2428
+ removeOnDestroy: false,
2429
+
2430
+ /**
2431
+ * Callback called when the popper is created.<br />
2432
+ * By default, it is set to no-op.<br />
2433
+ * Access Popper.js instance with `data.instance`.
2434
+ * @prop {onCreate}
2435
+ */
2436
+ onCreate: function onCreate() {},
2437
+
2438
+ /**
2439
+ * Callback called when the popper is updated. This callback is not called
2440
+ * on the initialization/creation of the popper, but only on subsequent
2441
+ * updates.<br />
2442
+ * By default, it is set to no-op.<br />
2443
+ * Access Popper.js instance with `data.instance`.
2444
+ * @prop {onUpdate}
2445
+ */
2446
+ onUpdate: function onUpdate() {},
2447
+
2448
+ /**
2449
+ * List of modifiers used to modify the offsets before they are applied to the popper.
2450
+ * They provide most of the functionalities of Popper.js.
2451
+ * @prop {modifiers}
2452
+ */
2453
+ modifiers: modifiers
2454
+ };
2455
+
2456
+ /**
2457
+ * @callback onCreate
2458
+ * @param {dataObject} data
2459
+ */
2460
+
2461
+ /**
2462
+ * @callback onUpdate
2463
+ * @param {dataObject} data
2464
+ */
2465
+
2466
+ // Utils
2467
+ // Methods
2468
+ var Popper = function () {
2469
+ /**
2470
+ * Creates a new Popper.js instance.
2471
+ * @class Popper
2472
+ * @param {Element|referenceObject} reference - The reference element used to position the popper
2473
+ * @param {Element} popper - The HTML / XML element used as the popper
2474
+ * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
2475
+ * @return {Object} instance - The generated Popper.js instance
2476
+ */
2477
+ function Popper(reference, popper) {
2478
+ var _this = this;
2479
+
2480
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2481
+ classCallCheck(this, Popper);
2482
+
2483
+ this.scheduleUpdate = function () {
2484
+ return requestAnimationFrame(_this.update);
2485
+ };
2486
+
2487
+ // make update() debounced, so that it only runs at most once-per-tick
2488
+ this.update = debounce(this.update.bind(this));
2489
+
2490
+ // with {} we create a new object with the options inside it
2491
+ this.options = _extends({}, Popper.Defaults, options);
2492
+
2493
+ // init state
2494
+ this.state = {
2495
+ isDestroyed: false,
2496
+ isCreated: false,
2497
+ scrollParents: []
2498
+ };
2499
+
2500
+ // get reference and popper elements (allow jQuery wrappers)
2501
+ this.reference = reference && reference.jquery ? reference[0] : reference;
2502
+ this.popper = popper && popper.jquery ? popper[0] : popper;
2503
+
2504
+ // Deep merge modifiers options
2505
+ this.options.modifiers = {};
2506
+ Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
2507
+ _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
2508
+ });
2509
+
2510
+ // Refactoring modifiers' list (Object => Array)
2511
+ this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
2512
+ return _extends({
2513
+ name: name
2514
+ }, _this.options.modifiers[name]);
2515
+ })
2516
+ // sort the modifiers by order
2517
+ .sort(function (a, b) {
2518
+ return a.order - b.order;
2519
+ });
2520
+
2521
+ // modifiers have the ability to execute arbitrary code when Popper.js get inited
2522
+ // such code is executed in the same order of its modifier
2523
+ // they could add new properties to their options configuration
2524
+ // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
2525
+ this.modifiers.forEach(function (modifierOptions) {
2526
+ if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
2527
+ modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
2528
+ }
2529
+ });
2530
+
2531
+ // fire the first update to position the popper in the right place
2532
+ this.update();
2533
+
2534
+ var eventsEnabled = this.options.eventsEnabled;
2535
+ if (eventsEnabled) {
2536
+ // setup event listeners, they will take care of update the position in specific situations
2537
+ this.enableEventListeners();
2538
+ }
2539
+
2540
+ this.state.eventsEnabled = eventsEnabled;
2541
+ }
2542
+
2543
+ // We can't use class properties because they don't get listed in the
2544
+ // class prototype and break stuff like Sinon stubs
2545
+
2546
+
2547
+ createClass(Popper, [{
2548
+ key: 'update',
2549
+ value: function update$$1() {
2550
+ return update.call(this);
2551
+ }
2552
+ }, {
2553
+ key: 'destroy',
2554
+ value: function destroy$$1() {
2555
+ return destroy.call(this);
2556
+ }
2557
+ }, {
2558
+ key: 'enableEventListeners',
2559
+ value: function enableEventListeners$$1() {
2560
+ return enableEventListeners.call(this);
2561
+ }
2562
+ }, {
2563
+ key: 'disableEventListeners',
2564
+ value: function disableEventListeners$$1() {
2565
+ return disableEventListeners.call(this);
2566
+ }
2567
+
2568
+ /**
2569
+ * Schedules an update. It will run on the next UI update available.
2570
+ * @method scheduleUpdate
2571
+ * @memberof Popper
2572
+ */
2573
+
2574
+
2575
+ /**
2576
+ * Collection of utilities useful when writing custom modifiers.
2577
+ * Starting from version 1.7, this method is available only if you
2578
+ * include `popper-utils.js` before `popper.js`.
2579
+ *
2580
+ * **DEPRECATION**: This way to access PopperUtils is deprecated
2581
+ * and will be removed in v2! Use the PopperUtils module directly instead.
2582
+ * Due to the high instability of the methods contained in Utils, we can't
2583
+ * guarantee them to follow semver. Use them at your own risk!
2584
+ * @static
2585
+ * @private
2586
+ * @type {Object}
2587
+ * @deprecated since version 1.8
2588
+ * @member Utils
2589
+ * @memberof Popper
2590
+ */
2591
+
2592
+ }]);
2593
+ return Popper;
2594
+ }();
2595
+
2596
+ /**
2597
+ * The `referenceObject` is an object that provides an interface compatible with Popper.js
2598
+ * and lets you use it as replacement of a real DOM node.<br />
2599
+ * You can use this method to position a popper relatively to a set of coordinates
2600
+ * in case you don't have a DOM node to use as reference.
2601
+ *
2602
+ * ```
2603
+ * new Popper(referenceObject, popperNode);
2604
+ * ```
2605
+ *
2606
+ * NB: This feature isn't supported in Internet Explorer 10.
2607
+ * @name referenceObject
2608
+ * @property {Function} data.getBoundingClientRect
2609
+ * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
2610
+ * @property {number} data.clientWidth
2611
+ * An ES6 getter that will return the width of the virtual reference element.
2612
+ * @property {number} data.clientHeight
2613
+ * An ES6 getter that will return the height of the virtual reference element.
2614
+ */
2615
+
2616
+
2617
+ Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
2618
+ Popper.placements = placements;
2619
+ Popper.Defaults = Defaults;
2620
+
2621
+ return Popper;
2622
+
2623
+ })));