@aquera/nile-elements 1.9.5 → 1.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (565) hide show
  1. package/README.md +9 -0
  2. package/dist/index-178e1e57.cjs.js +2 -0
  3. package/dist/index-178e1e57.cjs.js.map +1 -0
  4. package/dist/index-1faa963c.esm.js +1 -0
  5. package/dist/index-249de90a.esm.js +1 -0
  6. package/dist/index-353172ed.esm.js +1 -0
  7. package/dist/index-6f3fa4ab.esm.js +1 -0
  8. package/dist/index-89c520e9.cjs.js +5 -0
  9. package/dist/index-89c520e9.cjs.js.map +1 -0
  10. package/dist/index-920675c4.esm.js +1 -0
  11. package/dist/index-b387a9f4.cjs.js +2 -0
  12. package/dist/index-b387a9f4.cjs.js.map +1 -0
  13. package/dist/index-cc1385e0.cjs.js +2 -0
  14. package/dist/index-cc1385e0.cjs.js.map +1 -0
  15. package/dist/index-dedc38a6.esm.js +1 -0
  16. package/dist/index-df196058.cjs.js +2 -0
  17. package/dist/index-df196058.cjs.js.map +1 -0
  18. package/dist/index-f956f56d.cjs.js +7 -0
  19. package/dist/index-f956f56d.cjs.js.map +1 -0
  20. package/dist/index.cjs.js +1 -1
  21. package/dist/index.esm.js +1 -1
  22. package/dist/index.js +3802 -664
  23. package/dist/internal/glyph.cjs.js +2 -0
  24. package/dist/internal/glyph.cjs.js.map +1 -0
  25. package/dist/internal/glyph.esm.js +5 -0
  26. package/dist/nile-auto-complete/index.cjs.js +1 -1
  27. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  28. package/dist/nile-auto-complete/portal-manager.cjs.js +1 -1
  29. package/dist/nile-auto-complete/portal-utils.cjs.js +1 -1
  30. package/dist/nile-chip/nile-chip.css.cjs.js +1 -1
  31. package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
  32. package/dist/nile-chip/nile-chip.css.esm.js +8 -1
  33. package/dist/nile-code-editor/extensionSetup.cjs.js +7 -7
  34. package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
  35. package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
  36. package/dist/nile-code-editor/index.cjs.js +1 -1
  37. package/dist/nile-code-editor/index.esm.js +1 -1
  38. package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
  39. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  40. package/dist/nile-code-editor/nile-code-editor.esm.js +4 -4
  41. package/dist/nile-color-picker/index.cjs.js +1 -1
  42. package/dist/nile-color-picker/nile-color-picker.cjs.js +1 -1
  43. package/dist/nile-combobox/index.cjs.js +1 -1
  44. package/dist/nile-combobox/index.esm.js +1 -1
  45. package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
  46. package/dist/nile-combobox/nile-combobox.esm.js +1 -1
  47. package/dist/nile-combobox/portal-manager.cjs.js +1 -1
  48. package/dist/nile-context-menu/index.cjs.js +1 -1
  49. package/dist/nile-context-menu/nile-context-menu.cjs.js +1 -1
  50. package/dist/nile-context-submenu/index.cjs.js +1 -1
  51. package/dist/nile-context-submenu/nile-context-submenu.cjs.js +1 -1
  52. package/dist/nile-detail/index.cjs.js +1 -1
  53. package/dist/nile-detail/index.esm.js +1 -1
  54. package/dist/nile-detail/nile-detail.cjs.js +1 -1
  55. package/dist/nile-detail/nile-detail.esm.js +1 -1
  56. package/dist/nile-dropdown/index.cjs.js +1 -1
  57. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  58. package/dist/nile-dropdown/portal-manager.cjs.js +1 -1
  59. package/dist/nile-file-upload/index.cjs.js +1 -1
  60. package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
  61. package/dist/nile-file-upload/nile-file-upload.template.cjs.js +1 -1
  62. package/dist/nile-floating-panel/index.cjs.js +1 -1
  63. package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
  64. package/dist/nile-hero/nile-hero.cjs.js +1 -1
  65. package/dist/nile-hero/nile-hero.cjs.js.map +1 -1
  66. package/dist/nile-hero/nile-hero.css.cjs.js +1 -1
  67. package/dist/nile-hero/nile-hero.css.cjs.js.map +1 -1
  68. package/dist/nile-hero/nile-hero.css.esm.js +14 -14
  69. package/dist/nile-hero/nile-hero.esm.js +1 -1
  70. package/dist/nile-hero-header/nile-hero-header.cjs.js +1 -1
  71. package/dist/nile-hero-header/nile-hero-header.cjs.js.map +1 -1
  72. package/dist/nile-hero-header/nile-hero-header.css.cjs.js +1 -1
  73. package/dist/nile-hero-header/nile-hero-header.css.cjs.js.map +1 -1
  74. package/dist/nile-hero-header/nile-hero-header.css.esm.js +11 -11
  75. package/dist/nile-hero-header/nile-hero-header.esm.js +3 -3
  76. package/dist/nile-lite-tooltip/index.cjs.js +1 -1
  77. package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
  78. package/dist/nile-markdown-editor/index.cjs.js +1 -1
  79. package/dist/nile-markdown-editor/nile-markdown-editor.cjs.js +1 -1
  80. package/dist/nile-popover/index.cjs.js +1 -1
  81. package/dist/nile-popover/nile-popover.cjs.js +1 -1
  82. package/dist/nile-popover/portal-manager.cjs.js +1 -1
  83. package/dist/nile-popup/index.cjs.js +1 -1
  84. package/dist/nile-popup/nile-popup.cjs.js +1 -1
  85. package/dist/nile-rich-text-editor/index.cjs.js +1 -1
  86. package/dist/nile-rich-text-editor/index.esm.js +1 -1
  87. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +1 -1
  88. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +1 -1
  89. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +1 -1
  90. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +1 -1
  91. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +70 -0
  92. package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +1 -1
  93. package/dist/nile-rich-text-editor/nile-rte-image.cjs.js +3 -0
  94. package/dist/nile-rich-text-editor/nile-rte-image.cjs.js.map +1 -0
  95. package/dist/nile-rich-text-editor/nile-rte-image.esm.js +96 -0
  96. package/dist/nile-select/index.cjs.js +1 -1
  97. package/dist/nile-select/nile-select.cjs.js +1 -1
  98. package/dist/nile-select/portal-manager.cjs.js +1 -1
  99. package/dist/nile-side-bar-action/index.cjs.js +1 -1
  100. package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js +1 -1
  101. package/dist/nile-side-bar-action/portal-manager.cjs.js +1 -1
  102. package/dist/nile-tooltip/index.cjs.js +1 -1
  103. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  104. package/dist/nile-virtual-select/index.cjs.js +1 -1
  105. package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
  106. package/dist/nile-virtual-select/portal-manager.cjs.js +1 -1
  107. package/dist/nile-virtual-select/renderer.cjs.js +1 -1
  108. package/dist/nile-wysiwyg-editor/emoji.cjs.js +2 -0
  109. package/dist/nile-wysiwyg-editor/emoji.cjs.js.map +1 -0
  110. package/dist/nile-wysiwyg-editor/emoji.esm.js +1 -0
  111. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +2 -0
  112. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js.map +1 -0
  113. package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -0
  114. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +2 -0
  115. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js.map +1 -0
  116. package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -0
  117. package/dist/nile-wysiwyg-editor/engine/export.cjs.js +2 -0
  118. package/dist/nile-wysiwyg-editor/engine/export.cjs.js.map +1 -0
  119. package/dist/nile-wysiwyg-editor/engine/export.esm.js +1 -0
  120. package/dist/nile-wysiwyg-editor/engine/index.cjs.js +2 -0
  121. package/dist/nile-wysiwyg-editor/engine/index.cjs.js.map +1 -0
  122. package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -0
  123. package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +2 -0
  124. package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js.map +1 -0
  125. package/dist/nile-wysiwyg-editor/engine/inputrules.esm.js +1 -0
  126. package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +2 -0
  127. package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js.map +1 -0
  128. package/dist/nile-wysiwyg-editor/engine/keymap.esm.js +1 -0
  129. package/dist/nile-wysiwyg-editor/engine/markdown-parse.cjs.js +2 -0
  130. package/dist/nile-wysiwyg-editor/engine/markdown-parse.cjs.js.map +1 -0
  131. package/dist/nile-wysiwyg-editor/engine/markdown-parse.esm.js +1 -0
  132. package/dist/nile-wysiwyg-editor/engine/markdown.cjs.js +2 -0
  133. package/dist/nile-wysiwyg-editor/engine/markdown.cjs.js.map +1 -0
  134. package/dist/nile-wysiwyg-editor/engine/markdown.esm.js +1 -0
  135. package/dist/nile-wysiwyg-editor/engine/office-paste.cjs.js +2 -0
  136. package/dist/nile-wysiwyg-editor/engine/office-paste.cjs.js.map +1 -0
  137. package/dist/nile-wysiwyg-editor/engine/office-paste.esm.js +1 -0
  138. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +2 -0
  139. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -0
  140. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -0
  141. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +2 -0
  142. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js.map +1 -0
  143. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.esm.js +1 -0
  144. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +2 -0
  145. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js.map +1 -0
  146. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.esm.js +1 -0
  147. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +2 -0
  148. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js.map +1 -0
  149. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.esm.js +1 -0
  150. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js +2 -0
  151. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js.map +1 -0
  152. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.esm.js +1 -0
  153. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js +2 -0
  154. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js.map +1 -0
  155. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.esm.js +1 -0
  156. package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +2 -0
  157. package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js.map +1 -0
  158. package/dist/nile-wysiwyg-editor/engine/plugins/image.esm.js +1 -0
  159. package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js +2 -0
  160. package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js.map +1 -0
  161. package/dist/nile-wysiwyg-editor/engine/plugins/link.esm.js +1 -0
  162. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js +2 -0
  163. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js.map +1 -0
  164. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.esm.js +1 -0
  165. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js +2 -0
  166. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js.map +1 -0
  167. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.esm.js +1 -0
  168. package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js +2 -0
  169. package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js.map +1 -0
  170. package/dist/nile-wysiwyg-editor/engine/plugins/paste.esm.js +1 -0
  171. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +2 -0
  172. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js.map +1 -0
  173. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.esm.js +1 -0
  174. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js +2 -0
  175. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js.map +1 -0
  176. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.esm.js +1 -0
  177. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +2 -0
  178. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js.map +1 -0
  179. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.esm.js +1 -0
  180. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +2 -0
  181. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js.map +1 -0
  182. package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -0
  183. package/dist/nile-wysiwyg-editor/engine/plugins/task-list.cjs.js +2 -0
  184. package/dist/nile-wysiwyg-editor/engine/plugins/task-list.cjs.js.map +1 -0
  185. package/dist/nile-wysiwyg-editor/engine/plugins/task-list.esm.js +1 -0
  186. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +2 -0
  187. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js.map +1 -0
  188. package/dist/nile-wysiwyg-editor/engine/sanitize.esm.js +1 -0
  189. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +2 -0
  190. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js.map +1 -0
  191. package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -0
  192. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +2 -0
  193. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js.map +1 -0
  194. package/dist/nile-wysiwyg-editor/engine/selection-state.esm.js +1 -0
  195. package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js +2 -0
  196. package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js.map +1 -0
  197. package/dist/nile-wysiwyg-editor/engine/serializer.esm.js +1 -0
  198. package/dist/nile-wysiwyg-editor/index.cjs.js +2 -0
  199. package/dist/nile-wysiwyg-editor/index.cjs.js.map +1 -0
  200. package/dist/nile-wysiwyg-editor/index.esm.js +1 -0
  201. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +2 -0
  202. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -0
  203. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +2 -0
  204. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -0
  205. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +780 -0
  206. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +97 -0
  207. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +2 -0
  208. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js.map +1 -0
  209. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.esm.js +1 -0
  210. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +2 -0
  211. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js.map +1 -0
  212. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js +2 -0
  213. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js.map +1 -0
  214. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.esm.js +244 -0
  215. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.esm.js +137 -0
  216. package/dist/nile-wysiwyg-editor/types.cjs.js +2 -0
  217. package/dist/nile-wysiwyg-editor/types.cjs.js.map +1 -0
  218. package/dist/nile-wysiwyg-editor/types.esm.js +1 -0
  219. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js +2 -0
  220. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js.map +1 -0
  221. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.esm.js +97 -0
  222. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +2 -0
  223. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -0
  224. package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +67 -0
  225. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +2 -0
  226. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js.map +1 -0
  227. package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +65 -0
  228. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js +2 -0
  229. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js.map +1 -0
  230. package/dist/nile-wysiwyg-editor/ui/embed-menu.esm.js +64 -0
  231. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +2 -0
  232. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js.map +1 -0
  233. package/dist/nile-wysiwyg-editor/ui/embed-panel.esm.js +68 -0
  234. package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js +2 -0
  235. package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js.map +1 -0
  236. package/dist/nile-wysiwyg-editor/ui/emoji-picker.esm.js +96 -0
  237. package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js +2 -0
  238. package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js.map +1 -0
  239. package/dist/nile-wysiwyg-editor/ui/find-replace.esm.js +112 -0
  240. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js +2 -0
  241. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js.map +1 -0
  242. package/dist/nile-wysiwyg-editor/ui/image-menu.esm.js +64 -0
  243. package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js +2 -0
  244. package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js.map +1 -0
  245. package/dist/nile-wysiwyg-editor/ui/image-panel.esm.js +171 -0
  246. package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js +2 -0
  247. package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js.map +1 -0
  248. package/dist/nile-wysiwyg-editor/ui/insert-menu.esm.js +90 -0
  249. package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js +2 -0
  250. package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js.map +1 -0
  251. package/dist/nile-wysiwyg-editor/ui/link-editor.esm.js +114 -0
  252. package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js +2 -0
  253. package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js.map +1 -0
  254. package/dist/nile-wysiwyg-editor/ui/markdown-panel.esm.js +80 -0
  255. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js +2 -0
  256. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js.map +1 -0
  257. package/dist/nile-wysiwyg-editor/ui/math-panel.esm.js +92 -0
  258. package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js +2 -0
  259. package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js.map +1 -0
  260. package/dist/nile-wysiwyg-editor/ui/shortcut-help.esm.js +147 -0
  261. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +2 -0
  262. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js.map +1 -0
  263. package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +79 -0
  264. package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js +2 -0
  265. package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js.map +1 -0
  266. package/dist/nile-wysiwyg-editor/ui/special-chars.esm.js +96 -0
  267. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js +2 -0
  268. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js.map +1 -0
  269. package/dist/nile-wysiwyg-editor/ui/suggest-list.esm.js +67 -0
  270. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js +2 -0
  271. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js.map +1 -0
  272. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.esm.js +100 -0
  273. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +2 -0
  274. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -0
  275. package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +58 -0
  276. package/dist/src/index.d.ts +24 -0
  277. package/dist/src/index.js +19 -0
  278. package/dist/src/index.js.map +1 -1
  279. package/dist/src/internal/glyph.d.ts +6 -0
  280. package/dist/src/internal/glyph.js +13 -0
  281. package/dist/src/internal/glyph.js.map +1 -0
  282. package/dist/src/nile-chip/nile-chip.css.js +8 -1
  283. package/dist/src/nile-chip/nile-chip.css.js.map +1 -1
  284. package/dist/src/nile-code-editor/nile-code-editor.js +3 -3
  285. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  286. package/dist/src/nile-hero/nile-hero.css.js +12 -12
  287. package/dist/src/nile-hero/nile-hero.css.js.map +1 -1
  288. package/dist/src/nile-hero/nile-hero.js +1 -1
  289. package/dist/src/nile-hero/nile-hero.js.map +1 -1
  290. package/dist/src/nile-hero-header/nile-hero-header.css.js +9 -9
  291. package/dist/src/nile-hero-header/nile-hero-header.css.js.map +1 -1
  292. package/dist/src/nile-hero-header/nile-hero-header.js +1 -1
  293. package/dist/src/nile-hero-header/nile-hero-header.js.map +1 -1
  294. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js +70 -0
  295. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +1 -1
  296. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.d.ts +3 -0
  297. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +81 -3
  298. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +1 -1
  299. package/dist/src/nile-rich-text-editor/nile-rte-image.d.ts +87 -0
  300. package/dist/src/nile-rich-text-editor/nile-rte-image.js +1073 -0
  301. package/dist/src/nile-rich-text-editor/nile-rte-image.js.map +1 -0
  302. package/dist/src/nile-wysiwyg-editor/emoji.d.ts +5 -0
  303. package/dist/src/nile-wysiwyg-editor/emoji.js +138 -0
  304. package/dist/src/nile-wysiwyg-editor/emoji.js.map +1 -0
  305. package/dist/src/nile-wysiwyg-editor/engine/commands.d.ts +69 -0
  306. package/dist/src/nile-wysiwyg-editor/engine/commands.js +863 -0
  307. package/dist/src/nile-wysiwyg-editor/engine/commands.js.map +1 -0
  308. package/dist/src/nile-wysiwyg-editor/engine/create-state.d.ts +35 -0
  309. package/dist/src/nile-wysiwyg-editor/engine/create-state.js +67 -0
  310. package/dist/src/nile-wysiwyg-editor/engine/create-state.js.map +1 -0
  311. package/dist/src/nile-wysiwyg-editor/engine/export.d.ts +38 -0
  312. package/dist/src/nile-wysiwyg-editor/engine/export.js +208 -0
  313. package/dist/src/nile-wysiwyg-editor/engine/export.js.map +1 -0
  314. package/dist/src/nile-wysiwyg-editor/engine/export.test.d.ts +1 -0
  315. package/dist/src/nile-wysiwyg-editor/engine/export.test.js +96 -0
  316. package/dist/src/nile-wysiwyg-editor/engine/export.test.js.map +1 -0
  317. package/dist/src/nile-wysiwyg-editor/engine/index.d.ts +37 -0
  318. package/dist/src/nile-wysiwyg-editor/engine/index.js +29 -0
  319. package/dist/src/nile-wysiwyg-editor/engine/index.js.map +1 -0
  320. package/dist/src/nile-wysiwyg-editor/engine/inputrules.d.ts +12 -0
  321. package/dist/src/nile-wysiwyg-editor/engine/inputrules.js +144 -0
  322. package/dist/src/nile-wysiwyg-editor/engine/inputrules.js.map +1 -0
  323. package/dist/src/nile-wysiwyg-editor/engine/keymap.d.ts +15 -0
  324. package/dist/src/nile-wysiwyg-editor/engine/keymap.js +94 -0
  325. package/dist/src/nile-wysiwyg-editor/engine/keymap.js.map +1 -0
  326. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.d.ts +22 -0
  327. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.js +287 -0
  328. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.js.map +1 -0
  329. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.d.ts +1 -0
  330. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.js +106 -0
  331. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.js.map +1 -0
  332. package/dist/src/nile-wysiwyg-editor/engine/markdown.d.ts +10 -0
  333. package/dist/src/nile-wysiwyg-editor/engine/markdown.js +162 -0
  334. package/dist/src/nile-wysiwyg-editor/engine/markdown.js.map +1 -0
  335. package/dist/src/nile-wysiwyg-editor/engine/office-paste.d.ts +13 -0
  336. package/dist/src/nile-wysiwyg-editor/engine/office-paste.js +182 -0
  337. package/dist/src/nile-wysiwyg-editor/engine/office-paste.js.map +1 -0
  338. package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.d.ts +10 -0
  339. package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.js +165 -0
  340. package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.js.map +1 -0
  341. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.d.ts +17 -0
  342. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js +69 -0
  343. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js.map +1 -0
  344. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.d.ts +17 -0
  345. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js +96 -0
  346. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js.map +1 -0
  347. package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.d.ts +26 -0
  348. package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.js +123 -0
  349. package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.js.map +1 -0
  350. package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.d.ts +28 -0
  351. package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.js +72 -0
  352. package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.js.map +1 -0
  353. package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.d.ts +41 -0
  354. package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js +176 -0
  355. package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js.map +1 -0
  356. package/dist/src/nile-wysiwyg-editor/engine/plugins/image.d.ts +15 -0
  357. package/dist/src/nile-wysiwyg-editor/engine/plugins/image.js +64 -0
  358. package/dist/src/nile-wysiwyg-editor/engine/plugins/image.js.map +1 -0
  359. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.d.ts +11 -0
  360. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js +42 -0
  361. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js.map +1 -0
  362. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.d.ts +18 -0
  363. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js +46 -0
  364. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js.map +1 -0
  365. package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.d.ts +7 -0
  366. package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.js +26 -0
  367. package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.js.map +1 -0
  368. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.d.ts +31 -0
  369. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js +55 -0
  370. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js.map +1 -0
  371. package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.d.ts +7 -0
  372. package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.js +25 -0
  373. package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.js.map +1 -0
  374. package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.d.ts +10 -0
  375. package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.js +48 -0
  376. package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.js.map +1 -0
  377. package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.d.ts +29 -0
  378. package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.js +87 -0
  379. package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.js.map +1 -0
  380. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.d.ts +8 -0
  381. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js +11 -0
  382. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js.map +1 -0
  383. package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.d.ts +16 -0
  384. package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.js +49 -0
  385. package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.js.map +1 -0
  386. package/dist/src/nile-wysiwyg-editor/engine/pm.test.d.ts +1 -0
  387. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js +883 -0
  388. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js.map +1 -0
  389. package/dist/src/nile-wysiwyg-editor/engine/productivity.test.d.ts +1 -0
  390. package/dist/src/nile-wysiwyg-editor/engine/productivity.test.js +129 -0
  391. package/dist/src/nile-wysiwyg-editor/engine/productivity.test.js.map +1 -0
  392. package/dist/src/nile-wysiwyg-editor/engine/sanitize.d.ts +13 -0
  393. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js +155 -0
  394. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js.map +1 -0
  395. package/dist/src/nile-wysiwyg-editor/engine/schema.d.ts +20 -0
  396. package/dist/src/nile-wysiwyg-editor/engine/schema.js +823 -0
  397. package/dist/src/nile-wysiwyg-editor/engine/schema.js.map +1 -0
  398. package/dist/src/nile-wysiwyg-editor/engine/selection-state.d.ts +70 -0
  399. package/dist/src/nile-wysiwyg-editor/engine/selection-state.js +138 -0
  400. package/dist/src/nile-wysiwyg-editor/engine/selection-state.js.map +1 -0
  401. package/dist/src/nile-wysiwyg-editor/engine/serializer.d.ts +18 -0
  402. package/dist/src/nile-wysiwyg-editor/engine/serializer.js +63 -0
  403. package/dist/src/nile-wysiwyg-editor/engine/serializer.js.map +1 -0
  404. package/dist/src/nile-wysiwyg-editor/index.d.ts +3 -0
  405. package/dist/src/nile-wysiwyg-editor/index.js +3 -0
  406. package/dist/src/nile-wysiwyg-editor/index.js.map +1 -0
  407. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.d.ts +1 -0
  408. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +782 -0
  409. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -0
  410. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +364 -0
  411. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +2038 -0
  412. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -0
  413. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.d.ts +1 -0
  414. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +636 -0
  415. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -0
  416. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.d.ts +1 -0
  417. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js +2 -0
  418. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js.map +1 -0
  419. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.d.ts +6 -0
  420. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js +251 -0
  421. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js.map +1 -0
  422. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.d.ts +41 -0
  423. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js +700 -0
  424. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js.map +1 -0
  425. package/dist/src/nile-wysiwyg-editor/types.d.ts +49 -0
  426. package/dist/src/nile-wysiwyg-editor/types.js +8 -0
  427. package/dist/src/nile-wysiwyg-editor/types.js.map +1 -0
  428. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.d.ts +20 -0
  429. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js +159 -0
  430. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js.map +1 -0
  431. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.d.ts +21 -0
  432. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +125 -0
  433. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -0
  434. package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.d.ts +18 -0
  435. package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js +107 -0
  436. package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js.map +1 -0
  437. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.d.ts +19 -0
  438. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js +123 -0
  439. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js.map +1 -0
  440. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.d.ts +27 -0
  441. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +146 -0
  442. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -0
  443. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.d.ts +21 -0
  444. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js +154 -0
  445. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js.map +1 -0
  446. package/dist/src/nile-wysiwyg-editor/ui/find-replace.d.ts +26 -0
  447. package/dist/src/nile-wysiwyg-editor/ui/find-replace.js +178 -0
  448. package/dist/src/nile-wysiwyg-editor/ui/find-replace.js.map +1 -0
  449. package/dist/src/nile-wysiwyg-editor/ui/image-menu.d.ts +18 -0
  450. package/dist/src/nile-wysiwyg-editor/ui/image-menu.js +129 -0
  451. package/dist/src/nile-wysiwyg-editor/ui/image-menu.js.map +1 -0
  452. package/dist/src/nile-wysiwyg-editor/ui/image-panel.d.ts +56 -0
  453. package/dist/src/nile-wysiwyg-editor/ui/image-panel.js +349 -0
  454. package/dist/src/nile-wysiwyg-editor/ui/image-panel.js.map +1 -0
  455. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.d.ts +25 -0
  456. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js +142 -0
  457. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js.map +1 -0
  458. package/dist/src/nile-wysiwyg-editor/ui/link-editor.d.ts +30 -0
  459. package/dist/src/nile-wysiwyg-editor/ui/link-editor.js +189 -0
  460. package/dist/src/nile-wysiwyg-editor/ui/link-editor.js.map +1 -0
  461. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.d.ts +24 -0
  462. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js +144 -0
  463. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js.map +1 -0
  464. package/dist/src/nile-wysiwyg-editor/ui/math-panel.d.ts +31 -0
  465. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +172 -0
  466. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -0
  467. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.d.ts +30 -0
  468. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js +296 -0
  469. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js.map +1 -0
  470. package/dist/src/nile-wysiwyg-editor/ui/source-view.d.ts +19 -0
  471. package/dist/src/nile-wysiwyg-editor/ui/source-view.js +120 -0
  472. package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -0
  473. package/dist/src/nile-wysiwyg-editor/ui/special-chars.d.ts +20 -0
  474. package/dist/src/nile-wysiwyg-editor/ui/special-chars.js +199 -0
  475. package/dist/src/nile-wysiwyg-editor/ui/special-chars.js.map +1 -0
  476. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.d.ts +31 -0
  477. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +133 -0
  478. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -0
  479. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.d.ts +23 -0
  480. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +177 -0
  481. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -0
  482. package/dist/src/nile-wysiwyg-editor/ui/table-menu.d.ts +16 -0
  483. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +101 -0
  484. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -0
  485. package/dist/src/version.js +1 -1
  486. package/dist/src/version.js.map +1 -1
  487. package/dist/tsconfig.tsbuildinfo +1 -1
  488. package/package.json +18 -2
  489. package/src/index.ts +57 -1
  490. package/src/internal/glyph.ts +13 -0
  491. package/src/nile-chip/nile-chip.css.ts +8 -1
  492. package/src/nile-code-editor/nile-code-editor.ts +3 -3
  493. package/src/nile-hero/nile-hero.css.ts +12 -12
  494. package/src/nile-hero/nile-hero.ts +1 -1
  495. package/src/nile-hero-header/nile-hero-header.css.ts +9 -9
  496. package/src/nile-hero-header/nile-hero-header.ts +1 -1
  497. package/src/nile-rich-text-editor/nile-rich-text-editor.css.ts +70 -0
  498. package/src/nile-rich-text-editor/nile-rich-text-editor.ts +89 -3
  499. package/src/nile-rich-text-editor/nile-rte-image.ts +1132 -0
  500. package/src/nile-wysiwyg-editor/emoji.ts +137 -0
  501. package/src/nile-wysiwyg-editor/engine/commands.ts +1035 -0
  502. package/src/nile-wysiwyg-editor/engine/create-state.ts +117 -0
  503. package/src/nile-wysiwyg-editor/engine/export.test.ts +113 -0
  504. package/src/nile-wysiwyg-editor/engine/export.ts +242 -0
  505. package/src/nile-wysiwyg-editor/engine/index.ts +69 -0
  506. package/src/nile-wysiwyg-editor/engine/inputrules.ts +169 -0
  507. package/src/nile-wysiwyg-editor/engine/keymap.ts +146 -0
  508. package/src/nile-wysiwyg-editor/engine/markdown-parse.test.ts +148 -0
  509. package/src/nile-wysiwyg-editor/engine/markdown-parse.ts +337 -0
  510. package/src/nile-wysiwyg-editor/engine/markdown.ts +165 -0
  511. package/src/nile-wysiwyg-editor/engine/office-paste.ts +199 -0
  512. package/src/nile-wysiwyg-editor/engine/plugins/code-highlight.ts +173 -0
  513. package/src/nile-wysiwyg-editor/engine/plugins/embed-view.ts +85 -0
  514. package/src/nile-wysiwyg-editor/engine/plugins/embeds.ts +99 -0
  515. package/src/nile-wysiwyg-editor/engine/plugins/find-replace.ts +155 -0
  516. package/src/nile-wysiwyg-editor/engine/plugins/format-painter.ts +80 -0
  517. package/src/nile-wysiwyg-editor/engine/plugins/image-view.ts +220 -0
  518. package/src/nile-wysiwyg-editor/engine/plugins/image.ts +80 -0
  519. package/src/nile-wysiwyg-editor/engine/plugins/link.ts +42 -0
  520. package/src/nile-wysiwyg-editor/engine/plugins/math-view.ts +56 -0
  521. package/src/nile-wysiwyg-editor/engine/plugins/max-length.ts +24 -0
  522. package/src/nile-wysiwyg-editor/engine/plugins/paste.ts +74 -0
  523. package/src/nile-wysiwyg-editor/engine/plugins/placeholder.ts +24 -0
  524. package/src/nile-wysiwyg-editor/engine/plugins/single-line.ts +47 -0
  525. package/src/nile-wysiwyg-editor/engine/plugins/suggestions.ts +110 -0
  526. package/src/nile-wysiwyg-editor/engine/plugins/tables.ts +12 -0
  527. package/src/nile-wysiwyg-editor/engine/plugins/task-list.ts +65 -0
  528. package/src/nile-wysiwyg-editor/engine/pm.test.ts +1088 -0
  529. package/src/nile-wysiwyg-editor/engine/productivity.test.ts +163 -0
  530. package/src/nile-wysiwyg-editor/engine/sanitize.ts +156 -0
  531. package/src/nile-wysiwyg-editor/engine/schema.ts +859 -0
  532. package/src/nile-wysiwyg-editor/engine/selection-state.ts +210 -0
  533. package/src/nile-wysiwyg-editor/engine/serializer.ts +78 -0
  534. package/src/nile-wysiwyg-editor/index.ts +3 -0
  535. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +782 -0
  536. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +750 -0
  537. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +2155 -0
  538. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.ts +1 -0
  539. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.ts +251 -0
  540. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.ts +772 -0
  541. package/src/nile-wysiwyg-editor/types.ts +83 -0
  542. package/src/nile-wysiwyg-editor/ui/bookmark-panel.ts +155 -0
  543. package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +135 -0
  544. package/src/nile-wysiwyg-editor/ui/code-block-menu.ts +105 -0
  545. package/src/nile-wysiwyg-editor/ui/embed-menu.ts +133 -0
  546. package/src/nile-wysiwyg-editor/ui/embed-panel.ts +143 -0
  547. package/src/nile-wysiwyg-editor/ui/emoji-picker.ts +152 -0
  548. package/src/nile-wysiwyg-editor/ui/find-replace.ts +174 -0
  549. package/src/nile-wysiwyg-editor/ui/image-menu.ts +140 -0
  550. package/src/nile-wysiwyg-editor/ui/image-panel.ts +337 -0
  551. package/src/nile-wysiwyg-editor/ui/insert-menu.ts +142 -0
  552. package/src/nile-wysiwyg-editor/ui/link-editor.ts +180 -0
  553. package/src/nile-wysiwyg-editor/ui/markdown-panel.ts +143 -0
  554. package/src/nile-wysiwyg-editor/ui/math-panel.ts +169 -0
  555. package/src/nile-wysiwyg-editor/ui/shortcut-help.ts +311 -0
  556. package/src/nile-wysiwyg-editor/ui/source-view.ts +119 -0
  557. package/src/nile-wysiwyg-editor/ui/special-chars.ts +209 -0
  558. package/src/nile-wysiwyg-editor/ui/suggest-list.ts +138 -0
  559. package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +173 -0
  560. package/src/nile-wysiwyg-editor/ui/table-menu.ts +109 -0
  561. package/vscode-html-custom-data.json +491 -1
  562. package/web-dev-server.config.mjs +6 -2
  563. package/dist/index-5fef1a0d.esm.js +0 -1
  564. package/dist/index-8f38fae3.cjs.js +0 -2
  565. package/dist/index-8f38fae3.cjs.js.map +0 -1
@@ -1,2 +1,2 @@
1
- System.register(["../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,o,n,h,a,l,r,p;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[function(_floatingUiDom001CjsJs){t=_floatingUiDom001CjsJs.c;i=_floatingUiDom001CjsJs.o;s=_floatingUiDom001CjsJs.s;e=_floatingUiDom001CjsJs.f;o=_floatingUiDom001CjsJs.a;n=_floatingUiDom001CjsJs.p;h=_floatingUiDom001CjsJs.b;},function(_portalUtilsCjsJs){a=_portalUtilsCjsJs.P;l=_portalUtilsCjsJs.a;r=_portalUtilsCjsJs.b;}],execute:function execute(){_export("P",p=/*#__PURE__*/function(){function p(t){_classCallCheck(this,p);this.portalContainer=null,this.originalListboxParent=null,this.measuredPopupHeight=null,this.clonedListbox=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom",this.currentMiddlewareData=null,this.component=t;}return _createClass(p,[{key:"createPortalAppendContainer",value:function createPortalAppendContainer(){var t=document.createElement("div");return t.style.position="absolute",t.style.zIndex="9999",t.style.pointerEvents="none",t.className="nile-select-portal-append",t;}},{key:"positionPortalAppend",value:function positionPortalAppend(){this.portalContainer&&this.component.popup&&(this.measurePopupHeight(),this.computeFloatingUIPosition());}},{key:"measurePopupHeight",value:function measurePopupHeight(){!this.measuredPopupHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPopupHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="");}},{key:"computeFloatingUIPosition",value:function(){var _computeFloatingUIPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var t,i,_yield$this$calculate,_s,_e,_o,_n;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(this.portalContainer){_context2.next=2;break;}return _context2.abrupt("return");case 2:t=this.component.combobox||this.component,i=this.portalContainer;_context2.prev=3;_context2.next=6;return this.calculateFloatingUIPosition(t,i);case 6:_yield$this$calculate=_context2.sent;_s=_yield$this$calculate.x;_e=_yield$this$calculate.y;_o=_yield$this$calculate.placement;_n=_yield$this$calculate.middlewareData;this.applyFloatingUIPosition(i,t,_s,_e,_o,_n);_context2.next=17;break;case 14:_context2.prev=14;_context2.t0=_context2["catch"](3);console.warn("Floating UI positioning failed, falling back to simple positioning:",_context2.t0),this.fallbackPositioning();case 17:case"end":return _context2.stop();}},_callee,this,[[3,14]]);}));function computeFloatingUIPosition(){return _computeFloatingUIPosition.apply(this,arguments);}return computeFloatingUIPosition;}()},{key:"calculateFloatingUIPosition",value:function(){var _calculateFloatingUIPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(i,s){var e,o,n;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:e=a.findBoundaryElements(i),o=a.getOptimalPlacement(i),n=this.createFloatingUIMiddleware(e);_context3.next=3;return t(i,s,{placement:o,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()});case 3:return _context3.abrupt("return",_context3.sent);case 4:case"end":return _context3.stop();}},_callee2,this);}));function calculateFloatingUIPosition(_x,_x2){return _calculateFloatingUIPosition.apply(this,arguments);}return calculateFloatingUIPosition;}()},{key:"createFloatingUIMiddleware",value:function createFloatingUIMiddleware(t){return[i(4),s({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:t}),e({fallbackPlacements:["bottom","top","bottom-start","top-start","bottom-end","top-end"],fallbackStrategy:"bestFit",padding:10,boundary:t}),o({padding:10,crossAxis:!0,boundary:t})];}},{key:"handleSizeMiddleware",value:function handleSizeMiddleware(_ref){var t=_ref.availableWidth,i=_ref.availableHeight,s=_ref.elements,e=_ref.rects;var o=a.calculateOptimalHeight(e.reference,window.innerHeight,this.currentPlacement);s.floating.style.maxWidth="".concat(t,"px"),s.floating.style.maxHeight="".concat(o,"px"),s.floating.style.setProperty("--auto-size-available-width","".concat(t,"px")),s.floating.style.setProperty("--auto-size-available-height","".concat(o,"px"));}},{key:"createCustomPlatform",value:function createCustomPlatform(){return n;}},{key:"applyFloatingUIPosition",value:function applyFloatingUIPosition(t,i,s,e,o,n){Object.assign(t.style,{left:"".concat(s,"px"),top:"".concat(e,"px"),position:"fixed",pointerEvents:"auto"}),this.currentPlacement=o,this.currentMiddlewareData=n,a.applyCollisionData(t,n,o);var h=o.split("-")[0];t.className="nile-select-portal-append select__listbox--".concat(h);var l=i.getBoundingClientRect();t.style.width="".concat(l.width,"px");}},{key:"fallbackPositioning",value:function fallbackPositioning(){if(!this.portalContainer)return;var t=(this.component.combobox||this.component).getBoundingClientRect(),i=window.innerHeight;this.measuredPopupHeight;var s=i-t.bottom,e=t.top;var o,n,h;e>s?(h=Math.max(e-20,100),o=Math.max(t.top-h-4,10),n="top"):(h=Math.max(s-20,100),o=t.bottom+4,n="bottom"),this.portalContainer.style.left="".concat(t.left,"px"),this.portalContainer.style.top="".concat(o,"px"),this.portalContainer.style.width="".concat(t.width,"px"),this.portalContainer.style.maxHeight="".concat(h,"px"),this.portalContainer.style.pointerEvents="auto",this.portalContainer.className="nile-select-portal-append select__listbox--".concat(n),this.calculateAndSetAutoSizeProperties(t,o,n);}},{key:"calculateAndSetAutoSizeProperties",value:function calculateAndSetAutoSizeProperties(t,i,s){if(!this.portalContainer)return;var e=window.innerHeight,o=window.innerWidth;var n;n="top"===s?t.top-10:e-t.bottom-10;var h=Math.min(t.width,o-t.left-10);this.portalContainer.style.setProperty("--auto-size-available-height","".concat(Math.max(n,100),"px")),this.portalContainer.style.setProperty("--auto-size-available-width","".concat(Math.max(h,200),"px"));}},{key:"updatePortalAppendPosition",value:function updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend();}},{key:"handleWindowResize",value:function handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend();}},{key:"setupAutoUpdatePositioning",value:function setupAutoUpdatePositioning(){var _this=this;this.portalContainer&&this.component&&(this.cleanupAutoUpdatePositioning(),this.cleanupAutoUpdate=h(this.component,this.portalContainer,function(){_this.computeFloatingUIPosition();},{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0}));}},{key:"cleanupAutoUpdatePositioning",value:function cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null);}},{key:"injectStylesToDocument",value:function injectStylesToDocument(){if(!this.portalContainer)return;var t=a.generateStyleId();if(document.getElementById(t))return;var i=this.component.constructor.styles;if(!i)return;var s=document.createElement("style");s.id=t,s.textContent=a.extractStylesAsCSS(i),document.head.appendChild(s),this.portalContainer.t=t;}},{key:"adoptStylesToPortalAppend",value:function adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument();}},{key:"setupPortalAppend",value:function setupPortalAppend(){var _this2=this;this.component.portal&&this.component.updateComplete.then(function(){setTimeout(function(){var _this2$component$shad;var t=(_this2$component$shad=_this2.component.shadowRoot)===null||_this2$component$shad===void 0?void 0:_this2$component$shad.querySelector("#listbox");t&&(_this2.originalListboxParent=t.parentElement,_this2.clonedListbox=_this2.createPortalListbox(),_this2.portalContainer=_this2.createPortalAppendContainer(),_this2.portalContainer.appendChild(_this2.clonedListbox),document.body.appendChild(_this2.portalContainer),_this2.adoptStylesToPortalAppend(),_this2.clonedListbox.style.display="",_this2.positionPortalAppend(),_this2.setupPortalEventListeners(),_this2.updatePortalContent(),setTimeout(function(){_this2.updateFooterState();},50),_this2.setupAutoUpdatePositioning(),window.addEventListener("resize",_this2.handleWindowResize.bind(_this2)));},10);});}},{key:"createPortalListbox",value:function createPortalListbox(){return l.createPortalListbox(this.component);}},{key:"setupPortalEventListeners",value:function setupPortalEventListeners(){r.setupPortalEventListeners(this.clonedListbox,this.component);}},{key:"updatePortalContent",value:function updatePortalContent(){this.clonedListbox&&(l.updateClonedOptions(this.clonedListbox,this.component),this.updateFooterState());}},{key:"updateFooterState",value:function updateFooterState(){var _this$clonedListbox;var t=(_this$clonedListbox=this.clonedListbox)===null||_this$clonedListbox===void 0?void 0:_this$clonedListbox.querySelector(".select__footer");if(!t||!this.component.multiple)return;var i=t.querySelector("nile-checkbox");i&&(i.disabled=0===this.component.selectedOptions.length,i.checked=this.component.showSelected);var s=t.querySelector(".select__clear");if(0===this.component.selectedOptions.length)s&&s.remove();else if(!s){var _i=document.createElement("span");_i.className="select__clear",_i.textContent="Clear All",_i.style.cursor="pointer",t.appendChild(_i);}}},{key:"cleanupPortalAppend",value:function cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){var _t=this.portalContainer.t;if(_t){var _i2=document.getElementById(_t);_i2&&_i2.remove();}this.portalContainer.parentNode.removeChild(this.portalContainer);}window.removeEventListener("resize",this.handleWindowResize.bind(this)),this.portalContainer=null,this.originalListboxParent=null,this.clonedListbox=null,this.measuredPopupHeight=null,this.currentPlacement="bottom",this.currentMiddlewareData=null;}},{key:"portalContainerElement",get:function get(){return this.portalContainer;}},{key:"resetMeasuredHeight",value:function resetMeasuredHeight(){this.measuredPopupHeight=null;}},{key:"updatePortalOptions",value:function updatePortalOptions(){this.portalContainer&&this.clonedListbox&&(this.updatePortalContent(),this.forceReposition());}},{key:"forceReposition",value:function forceReposition(){this.portalContainer&&this.computeFloatingUIPosition();}},{key:"getCurrentPlacement",value:function getCurrentPlacement(){return this.currentPlacement;}},{key:"getCurrentMiddlewareData",value:function getCurrentMiddlewareData(){return this.currentMiddlewareData;}},{key:"isUsingFloatingUI",value:function isUsingFloatingUI(){return null!==this.cleanupAutoUpdate;}},{key:"updatePositioningConfig",value:function updatePositioningConfig(t){this.forceReposition();}},{key:"handleViewportChange",value:function handleViewportChange(){this.portalContainer&&(this.resetMeasuredHeight(),this.forceReposition());}},{key:"isPositioningOptimal",value:function isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;var t=(this.component.combobox||this.component).getBoundingClientRect(),i=window.innerHeight-t.bottom,s=t.top,e=this.currentPlacement.startsWith("top"),o=this.currentPlacement.startsWith("bottom");return!(e&&i>s)&&!(o&&s>i);}}]);}());}};});
1
+ System.register(["../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,o,n,h,a,l,r,p;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[function(_floatingUiDom002CjsJs){t=_floatingUiDom002CjsJs.c;i=_floatingUiDom002CjsJs.o;s=_floatingUiDom002CjsJs.s;e=_floatingUiDom002CjsJs.f;o=_floatingUiDom002CjsJs.a;n=_floatingUiDom002CjsJs.p;h=_floatingUiDom002CjsJs.b;},function(_portalUtilsCjsJs){a=_portalUtilsCjsJs.P;l=_portalUtilsCjsJs.a;r=_portalUtilsCjsJs.b;}],execute:function execute(){_export("P",p=/*#__PURE__*/function(){function p(t){_classCallCheck(this,p);this.portalContainer=null,this.originalListboxParent=null,this.measuredPopupHeight=null,this.clonedListbox=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom",this.currentMiddlewareData=null,this.component=t;}return _createClass(p,[{key:"createPortalAppendContainer",value:function createPortalAppendContainer(){var t=document.createElement("div");return t.style.position="absolute",t.style.zIndex="9999",t.style.pointerEvents="none",t.className="nile-select-portal-append",t;}},{key:"positionPortalAppend",value:function positionPortalAppend(){this.portalContainer&&this.component.popup&&(this.measurePopupHeight(),this.computeFloatingUIPosition());}},{key:"measurePopupHeight",value:function measurePopupHeight(){!this.measuredPopupHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPopupHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="");}},{key:"computeFloatingUIPosition",value:function(){var _computeFloatingUIPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var t,i,_yield$this$calculate,_s,_e,_o,_n;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(this.portalContainer){_context2.next=2;break;}return _context2.abrupt("return");case 2:t=this.component.combobox||this.component,i=this.portalContainer;_context2.prev=3;_context2.next=6;return this.calculateFloatingUIPosition(t,i);case 6:_yield$this$calculate=_context2.sent;_s=_yield$this$calculate.x;_e=_yield$this$calculate.y;_o=_yield$this$calculate.placement;_n=_yield$this$calculate.middlewareData;this.applyFloatingUIPosition(i,t,_s,_e,_o,_n);_context2.next=17;break;case 14:_context2.prev=14;_context2.t0=_context2["catch"](3);console.warn("Floating UI positioning failed, falling back to simple positioning:",_context2.t0),this.fallbackPositioning();case 17:case"end":return _context2.stop();}},_callee,this,[[3,14]]);}));function computeFloatingUIPosition(){return _computeFloatingUIPosition.apply(this,arguments);}return computeFloatingUIPosition;}()},{key:"calculateFloatingUIPosition",value:function(){var _calculateFloatingUIPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(i,s){var e,o,n;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:e=a.findBoundaryElements(i),o=a.getOptimalPlacement(i),n=this.createFloatingUIMiddleware(e);_context3.next=3;return t(i,s,{placement:o,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()});case 3:return _context3.abrupt("return",_context3.sent);case 4:case"end":return _context3.stop();}},_callee2,this);}));function calculateFloatingUIPosition(_x,_x2){return _calculateFloatingUIPosition.apply(this,arguments);}return calculateFloatingUIPosition;}()},{key:"createFloatingUIMiddleware",value:function createFloatingUIMiddleware(t){return[i(4),s({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:t}),e({fallbackPlacements:["bottom","top","bottom-start","top-start","bottom-end","top-end"],fallbackStrategy:"bestFit",padding:10,boundary:t}),o({padding:10,crossAxis:!0,boundary:t})];}},{key:"handleSizeMiddleware",value:function handleSizeMiddleware(_ref){var t=_ref.availableWidth,i=_ref.availableHeight,s=_ref.elements,e=_ref.rects;var o=a.calculateOptimalHeight(e.reference,window.innerHeight,this.currentPlacement);s.floating.style.maxWidth="".concat(t,"px"),s.floating.style.maxHeight="".concat(o,"px"),s.floating.style.setProperty("--auto-size-available-width","".concat(t,"px")),s.floating.style.setProperty("--auto-size-available-height","".concat(o,"px"));}},{key:"createCustomPlatform",value:function createCustomPlatform(){return n;}},{key:"applyFloatingUIPosition",value:function applyFloatingUIPosition(t,i,s,e,o,n){Object.assign(t.style,{left:"".concat(s,"px"),top:"".concat(e,"px"),position:"fixed",pointerEvents:"auto"}),this.currentPlacement=o,this.currentMiddlewareData=n,a.applyCollisionData(t,n,o);var h=o.split("-")[0];t.className="nile-select-portal-append select__listbox--".concat(h);var l=i.getBoundingClientRect();t.style.width="".concat(l.width,"px");}},{key:"fallbackPositioning",value:function fallbackPositioning(){if(!this.portalContainer)return;var t=(this.component.combobox||this.component).getBoundingClientRect(),i=window.innerHeight;this.measuredPopupHeight;var s=i-t.bottom,e=t.top;var o,n,h;e>s?(h=Math.max(e-20,100),o=Math.max(t.top-h-4,10),n="top"):(h=Math.max(s-20,100),o=t.bottom+4,n="bottom"),this.portalContainer.style.left="".concat(t.left,"px"),this.portalContainer.style.top="".concat(o,"px"),this.portalContainer.style.width="".concat(t.width,"px"),this.portalContainer.style.maxHeight="".concat(h,"px"),this.portalContainer.style.pointerEvents="auto",this.portalContainer.className="nile-select-portal-append select__listbox--".concat(n),this.calculateAndSetAutoSizeProperties(t,o,n);}},{key:"calculateAndSetAutoSizeProperties",value:function calculateAndSetAutoSizeProperties(t,i,s){if(!this.portalContainer)return;var e=window.innerHeight,o=window.innerWidth;var n;n="top"===s?t.top-10:e-t.bottom-10;var h=Math.min(t.width,o-t.left-10);this.portalContainer.style.setProperty("--auto-size-available-height","".concat(Math.max(n,100),"px")),this.portalContainer.style.setProperty("--auto-size-available-width","".concat(Math.max(h,200),"px"));}},{key:"updatePortalAppendPosition",value:function updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend();}},{key:"handleWindowResize",value:function handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend();}},{key:"setupAutoUpdatePositioning",value:function setupAutoUpdatePositioning(){var _this=this;this.portalContainer&&this.component&&(this.cleanupAutoUpdatePositioning(),this.cleanupAutoUpdate=h(this.component,this.portalContainer,function(){_this.computeFloatingUIPosition();},{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0}));}},{key:"cleanupAutoUpdatePositioning",value:function cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null);}},{key:"injectStylesToDocument",value:function injectStylesToDocument(){if(!this.portalContainer)return;var t=a.generateStyleId();if(document.getElementById(t))return;var i=this.component.constructor.styles;if(!i)return;var s=document.createElement("style");s.id=t,s.textContent=a.extractStylesAsCSS(i),document.head.appendChild(s),this.portalContainer.t=t;}},{key:"adoptStylesToPortalAppend",value:function adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument();}},{key:"setupPortalAppend",value:function setupPortalAppend(){var _this2=this;this.component.portal&&this.component.updateComplete.then(function(){setTimeout(function(){var _this2$component$shad;var t=(_this2$component$shad=_this2.component.shadowRoot)===null||_this2$component$shad===void 0?void 0:_this2$component$shad.querySelector("#listbox");t&&(_this2.originalListboxParent=t.parentElement,_this2.clonedListbox=_this2.createPortalListbox(),_this2.portalContainer=_this2.createPortalAppendContainer(),_this2.portalContainer.appendChild(_this2.clonedListbox),document.body.appendChild(_this2.portalContainer),_this2.adoptStylesToPortalAppend(),_this2.clonedListbox.style.display="",_this2.positionPortalAppend(),_this2.setupPortalEventListeners(),_this2.updatePortalContent(),setTimeout(function(){_this2.updateFooterState();},50),_this2.setupAutoUpdatePositioning(),window.addEventListener("resize",_this2.handleWindowResize.bind(_this2)));},10);});}},{key:"createPortalListbox",value:function createPortalListbox(){return l.createPortalListbox(this.component);}},{key:"setupPortalEventListeners",value:function setupPortalEventListeners(){r.setupPortalEventListeners(this.clonedListbox,this.component);}},{key:"updatePortalContent",value:function updatePortalContent(){this.clonedListbox&&(l.updateClonedOptions(this.clonedListbox,this.component),this.updateFooterState());}},{key:"updateFooterState",value:function updateFooterState(){var _this$clonedListbox;var t=(_this$clonedListbox=this.clonedListbox)===null||_this$clonedListbox===void 0?void 0:_this$clonedListbox.querySelector(".select__footer");if(!t||!this.component.multiple)return;var i=t.querySelector("nile-checkbox");i&&(i.disabled=0===this.component.selectedOptions.length,i.checked=this.component.showSelected);var s=t.querySelector(".select__clear");if(0===this.component.selectedOptions.length)s&&s.remove();else if(!s){var _i=document.createElement("span");_i.className="select__clear",_i.textContent="Clear All",_i.style.cursor="pointer",t.appendChild(_i);}}},{key:"cleanupPortalAppend",value:function cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){var _t=this.portalContainer.t;if(_t){var _i2=document.getElementById(_t);_i2&&_i2.remove();}this.portalContainer.parentNode.removeChild(this.portalContainer);}window.removeEventListener("resize",this.handleWindowResize.bind(this)),this.portalContainer=null,this.originalListboxParent=null,this.clonedListbox=null,this.measuredPopupHeight=null,this.currentPlacement="bottom",this.currentMiddlewareData=null;}},{key:"portalContainerElement",get:function get(){return this.portalContainer;}},{key:"resetMeasuredHeight",value:function resetMeasuredHeight(){this.measuredPopupHeight=null;}},{key:"updatePortalOptions",value:function updatePortalOptions(){this.portalContainer&&this.clonedListbox&&(this.updatePortalContent(),this.forceReposition());}},{key:"forceReposition",value:function forceReposition(){this.portalContainer&&this.computeFloatingUIPosition();}},{key:"getCurrentPlacement",value:function getCurrentPlacement(){return this.currentPlacement;}},{key:"getCurrentMiddlewareData",value:function getCurrentMiddlewareData(){return this.currentMiddlewareData;}},{key:"isUsingFloatingUI",value:function isUsingFloatingUI(){return null!==this.cleanupAutoUpdate;}},{key:"updatePositioningConfig",value:function updatePositioningConfig(t){this.forceReposition();}},{key:"handleViewportChange",value:function handleViewportChange(){this.portalContainer&&(this.resetMeasuredHeight(),this.forceReposition());}},{key:"isPositioningOptimal",value:function isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;var t=(this.component.combobox||this.component).getBoundingClientRect(),i=window.innerHeight-t.bottom,s=t.top,e=this.currentPlacement.startsWith("top"),o=this.currentPlacement.startsWith("bottom");return!(e&&i>s)&&!(o&&s>i);}}]);}());}};});
2
2
  //# sourceMappingURL=portal-manager.cjs.js.map
@@ -1,2 +1,2 @@
1
- System.register(["./nile-side-bar-action.cjs.js","tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-side-bar-action.css.cjs.js","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/tabbable.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../nile-popup/nile-popup.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js","./portal-manager.cjs.js","./portal-utils.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileSideBarActionCjsJs){_export("NileSideBarAction",_nileSideBarActionCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_litDirectivesClassMapJs){},function(_nileSideBarActionCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(_internalAnimateCjsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalTabbableCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){},function(_nilePopupNilePopupCjsJs){},function(_floatingUiDom001CjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_portalManagerCjsJs){},function(_portalUtilsCjsJs){}],execute:function execute(){}};});
1
+ System.register(["./nile-side-bar-action.cjs.js","tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-side-bar-action.css.cjs.js","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/tabbable.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../nile-popup/nile-popup.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js","./portal-manager.cjs.js","./portal-utils.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileSideBarActionCjsJs){_export("NileSideBarAction",_nileSideBarActionCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_litDirectivesClassMapJs){},function(_nileSideBarActionCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(_internalAnimateCjsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalTabbableCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){},function(_nilePopupNilePopupCjsJs){},function(_floatingUiDom002CjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_portalManagerCjsJs){},function(_portalUtilsCjsJs){}],execute:function execute(){}};});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-side-bar-action.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/tabbable.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../nile-popup/nile-popup.cjs.js","./portal-manager.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js","./portal-utils.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,o,n,h,a,r,l,d,p,c,m,u,w,_templateObject,f;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;e=_litDecoratorsJs.property;o=_litDecoratorsJs.customElement;},function(_litDirectivesClassMapJs){n=_litDirectivesClassMapJs.classMap;},function(_nileSideBarActionCssCjsJs){h=_nileSideBarActionCssCjsJs.s;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;},function(_internalAnimateCjsJs){r=_internalAnimateCjsJs.s;l=_internalAnimateCjsJs.a;},function(_utilitiesAnimationRegistryCjsJs){d=_utilitiesAnimationRegistryCjsJs.s;p=_utilitiesAnimationRegistryCjsJs.g;},function(_internalTabbableCjsJs){c=_internalTabbableCjsJs.g;},function(_internalEventCjsJs){m=_internalEventCjsJs.w;},function(_internalWatchCjsJs){u=_internalWatchCjsJs.w;},function(_nilePopupNilePopupCjsJs){},function(_portalManagerCjsJs){w=_portalManagerCjsJs.D;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(_floatingUiDom001CjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_portalUtilsCjsJs){}],execute:function execute(){_export("N",f=/*#__PURE__*/function(_a){function f(){var _this;_classCallCheck(this,f);_this=_callSuper(this,f,arguments),_this.open=!1,_this.placement="bottom-start",_this.disabled=!1,_this.stayOpenOnSelect=!1,_this.distance=0,_this.skidding=0,_this.hoist=!1,_this.portal=!1,_this.portalManager=null,_this.triggerDropdown="click";return _this;}_inherits(f,_a);return _createClass(f,[{key:"connectedCallback",value:function connectedCallback(){var _this2=this;_superPropGet(f,"connectedCallback",this,3)([]),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame(function(){_this2.portal&&!_this2.portalManager&&(_this2.portalManager=new w(_this2));});}},{key:"firstUpdated",value:function firstUpdated(){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){var _t=this.trigger;_t&&(_t.addEventListener("mouseenter",this.handleTriggerMouseEnter),_t.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave));}this.open&&(this.addOpenListeners(),this.popup.active=!0);}},{key:"handleTriggerMouseEnter",value:function handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show();}},{key:"handleTriggerMouseLeave",value:function handleTriggerMouseLeave(){var _this3=this;clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this3.hide();},200);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(f,"disconnectedCallback",this,3)([]),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null);}},{key:"focusOnTrigger",value:function focusOnTrigger(){var t=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(t===null||t===void 0?void 0:t.focus)&&t.focus();}},{key:"getMenu",value:function getMenu(){return this.panel.assignedElements({flatten:!0}).find(function(t){return"nile-menu"===t.tagName.toLowerCase();});}},{key:"handleKeyDown",value:function handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide(),this.focusOnTrigger());}},{key:"handleDocumentKeyDown",value:function handleDocumentKeyDown(t){var _this4=this;if("Escape"===t.key&&this.open)return t.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===t.key&&setTimeout(function(){var _this4$containingElem,_document$activeEleme,_this4$portalManager;var t=((_this4$containingElem=_this4.containingElement)===null||_this4$containingElem===void 0?void 0:_this4$containingElem.getRootNode())instanceof ShadowRoot?(_document$activeEleme=document.activeElement)===null||_document$activeEleme===void 0||(_document$activeEleme=_document$activeEleme.shadowRoot)===null||_document$activeEleme===void 0?void 0:_document$activeEleme.activeElement:document.activeElement,i=_this4.containingElement&&(t===null||t===void 0?void 0:t.closest(_this4.containingElement.tagName.toLowerCase()))===_this4.containingElement,s=_this4.portal&&((_this4$portalManager=_this4.portalManager)===null||_this4$portalManager===void 0?void 0:_this4$portalManager.portalContainerElement)&&(t===_this4.portalManager.portalContainerElement||(t===null||t===void 0?void 0:t.closest(".nile-dropdown-portal-append"))===_this4.portalManager.portalContainerElement);i||s||_this4.hide();});}},{key:"handleDocumentMouseDown",value:function handleDocumentMouseDown(t){var _this$portalManager;var i=t.composedPath(),s=this.containingElement&&i.includes(this.containingElement),e=this.portal&&((_this$portalManager=this.portalManager)===null||_this$portalManager===void 0?void 0:_this$portalManager.portalContainerElement)&&i.includes(this.portalManager.portalContainerElement);s||e||this.hide();}},{key:"handlePanelSelect",value:function handlePanelSelect(t){var i=t.target;this.stayOpenOnSelect||"nile-menu"!==i.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger());}},{key:"handleTriggerClick",value:function handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger());}},{key:"handleTriggerKeyDown",value:function handleTriggerKeyDown(t){var i=this.getMenu();if(i){var _s=i.getAllItems(),_e=_s[0],_o=_s[_s.length-1];["ArrowDown","ArrowUp","Home","End"].includes(t.key)&&(t.preventDefault(),this.open||this.show(),_s.length>0&&this.updateComplete.then(function(){"ArrowDown"!==t.key&&"Home"!==t.key||(i.setCurrentItem(_e),_e.focus()),"ArrowUp"!==t.key&&"End"!==t.key||(i.setCurrentItem(_o),_o.focus());}));}}},{key:"handleTriggerKeyUp",value:function handleTriggerKeyUp(t){" "===t.key&&t.preventDefault();}},{key:"handleTriggerSlotChange",value:function handleTriggerSlotChange(){this.updateAccessibleTrigger();}},{key:"updateAccessibleTrigger",value:function updateAccessibleTrigger(){var t=this.trigger.assignedElements({flatten:!0}).find(function(t){return c(t).start;});var i;if(t){switch(t.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":i=t.button;break;default:i=t;}i.setAttribute("aria-haspopup","true"),i.setAttribute("aria-expanded",this.open?"true":"false");}}},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(this.open){_context2.next=2;break;}return _context2.abrupt("return",(this.open=!0,m(this,"nile-after-show")));case 2:case"end":return _context2.stop();}},_callee,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!this.open){_context3.next=2;break;}return _context3.abrupt("return",(this.open=!1,m(this,"nile-after-hide")));case 2:case"end":return _context3.stop();}},_callee2,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"reposition",value:function reposition(){this.popup.reposition();}},{key:"addOpenListeners",value:function addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"removeOpenListeners",value:function removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"updated",value:function updated(t){_superPropGet(f,"updated",this,3)([t]),t.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new w(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null));}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _p,_t2,_i,_p2,_t3,_i2;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!this.disabled){_context4.next=4;break;}this.open=!1;_context4.next=30;break;case 4:if(!(this.updateAccessibleTrigger(),this.open)){_context4.next=18;break;}this.emit("nile-show");this.addOpenListeners();this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new w(this),this.portalManager.setupPortalAppend());_context4.next=10;return r(this);case 10:if(this.portal){_context4.next=15;break;}this.panel.hidden=!1,this.popup.active=!0;_p=p(this,"dropdown.show",{dir:""}),_t2=_p.keyframes,_i=_p.options;_context4.next=15;return l(this.popup.popup,_t2,_i);case 15:this.emit("nile-after-show");_context4.next=30;break;case 18:this.emit("nile-hide");this.removeOpenListeners();this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend();_context4.next=23;return r(this);case 23:if(this.portal){_context4.next=29;break;}_p2=p(this,"dropdown.hide",{dir:""}),_t3=_p2.keyframes,_i2=_p2.options;_context4.next=27;return l(this.popup.popup,_t3,_i2);case 27:this.panel.hidden=!0;this.popup.active=!1;case 29:this.emit("nile-after-hide");case 30:case"end":return _context4.stop();}},_callee3,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popup\n part=\"base\"\n id=\"sidebar-action-dropdown\"\n placement=","\n distance=","\n skidding=","\n strategy=","\n sync=","\n flip\n shift\n auto-size=\"both\"\n auto-size-padding=\"10\"\n class=","\n >\n <slot\n name=\"trigger\"\n slot=\"anchor\"\n part=\"trigger\"\n class=\"dropdown__trigger\"\n @click=","\n @keydown=","\n @keyup=","\n @slotchange=","\n ></slot>\n\n <slot\n part=\"panel\"\n class=\"dropdown__panel\"\n aria-hidden=","\n aria-labelledby=\"sidebar-action-dropdown\"\n style=","\n ></slot>\n </nile-popup>\n "])),this.placement,this.distance,this.skidding,this.hoist?"fixed":"absolute",this.sync,n({dropdown:!0,"dropdown--open":this.open}),this.handleTriggerClick,this.handleTriggerKeyDown,this.handleTriggerKeyUp,this.handleTriggerSlotChange,this.open?"false":"true",this.portal&&this.portalManager?"display: none;":"");}}]);}(a));f.styles=[h],t([s(".dropdown")],f.prototype,"popup",void 0),t([s(".dropdown__trigger")],f.prototype,"trigger",void 0),t([s(".dropdown__panel")],f.prototype,"panel",void 0),t([e({type:Boolean,reflect:!0})],f.prototype,"open",void 0),t([e({reflect:!0})],f.prototype,"placement",void 0),t([e({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),t([e({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],f.prototype,"stayOpenOnSelect",void 0),t([e({attribute:!1})],f.prototype,"containingElement",void 0),t([e({type:Number})],f.prototype,"distance",void 0),t([e({type:Number})],f.prototype,"skidding",void 0),t([e()],f.prototype,"sync",void 0),t([e({type:Boolean})],f.prototype,"hoist",void 0),t([e({type:Boolean,reflect:!0})],f.prototype,"portal",void 0),t([e({reflect:!0})],f.prototype,"triggerDropdown",void 0),t([u("open",{waitUntilFirstUpdate:!0})],f.prototype,"handleOpenChange",null),_export("N",f=t([o("nile-side-bar-action")],f)),d("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),d("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-side-bar-action.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/tabbable.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../nile-popup/nile-popup.cjs.js","./portal-manager.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js","./portal-utils.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,o,n,h,a,r,l,d,p,c,m,u,w,_templateObject,f;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;e=_litDecoratorsJs.property;o=_litDecoratorsJs.customElement;},function(_litDirectivesClassMapJs){n=_litDirectivesClassMapJs.classMap;},function(_nileSideBarActionCssCjsJs){h=_nileSideBarActionCssCjsJs.s;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;},function(_internalAnimateCjsJs){r=_internalAnimateCjsJs.s;l=_internalAnimateCjsJs.a;},function(_utilitiesAnimationRegistryCjsJs){d=_utilitiesAnimationRegistryCjsJs.s;p=_utilitiesAnimationRegistryCjsJs.g;},function(_internalTabbableCjsJs){c=_internalTabbableCjsJs.g;},function(_internalEventCjsJs){m=_internalEventCjsJs.w;},function(_internalWatchCjsJs){u=_internalWatchCjsJs.w;},function(_nilePopupNilePopupCjsJs){},function(_portalManagerCjsJs){w=_portalManagerCjsJs.D;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(_floatingUiDom002CjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_portalUtilsCjsJs){}],execute:function execute(){_export("N",f=/*#__PURE__*/function(_a){function f(){var _this;_classCallCheck(this,f);_this=_callSuper(this,f,arguments),_this.open=!1,_this.placement="bottom-start",_this.disabled=!1,_this.stayOpenOnSelect=!1,_this.distance=0,_this.skidding=0,_this.hoist=!1,_this.portal=!1,_this.portalManager=null,_this.triggerDropdown="click";return _this;}_inherits(f,_a);return _createClass(f,[{key:"connectedCallback",value:function connectedCallback(){var _this2=this;_superPropGet(f,"connectedCallback",this,3)([]),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame(function(){_this2.portal&&!_this2.portalManager&&(_this2.portalManager=new w(_this2));});}},{key:"firstUpdated",value:function firstUpdated(){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){var _t=this.trigger;_t&&(_t.addEventListener("mouseenter",this.handleTriggerMouseEnter),_t.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave));}this.open&&(this.addOpenListeners(),this.popup.active=!0);}},{key:"handleTriggerMouseEnter",value:function handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show();}},{key:"handleTriggerMouseLeave",value:function handleTriggerMouseLeave(){var _this3=this;clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this3.hide();},200);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(f,"disconnectedCallback",this,3)([]),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null);}},{key:"focusOnTrigger",value:function focusOnTrigger(){var t=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(t===null||t===void 0?void 0:t.focus)&&t.focus();}},{key:"getMenu",value:function getMenu(){return this.panel.assignedElements({flatten:!0}).find(function(t){return"nile-menu"===t.tagName.toLowerCase();});}},{key:"handleKeyDown",value:function handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide(),this.focusOnTrigger());}},{key:"handleDocumentKeyDown",value:function handleDocumentKeyDown(t){var _this4=this;if("Escape"===t.key&&this.open)return t.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===t.key&&setTimeout(function(){var _this4$containingElem,_document$activeEleme,_this4$portalManager;var t=((_this4$containingElem=_this4.containingElement)===null||_this4$containingElem===void 0?void 0:_this4$containingElem.getRootNode())instanceof ShadowRoot?(_document$activeEleme=document.activeElement)===null||_document$activeEleme===void 0||(_document$activeEleme=_document$activeEleme.shadowRoot)===null||_document$activeEleme===void 0?void 0:_document$activeEleme.activeElement:document.activeElement,i=_this4.containingElement&&(t===null||t===void 0?void 0:t.closest(_this4.containingElement.tagName.toLowerCase()))===_this4.containingElement,s=_this4.portal&&((_this4$portalManager=_this4.portalManager)===null||_this4$portalManager===void 0?void 0:_this4$portalManager.portalContainerElement)&&(t===_this4.portalManager.portalContainerElement||(t===null||t===void 0?void 0:t.closest(".nile-dropdown-portal-append"))===_this4.portalManager.portalContainerElement);i||s||_this4.hide();});}},{key:"handleDocumentMouseDown",value:function handleDocumentMouseDown(t){var _this$portalManager;var i=t.composedPath(),s=this.containingElement&&i.includes(this.containingElement),e=this.portal&&((_this$portalManager=this.portalManager)===null||_this$portalManager===void 0?void 0:_this$portalManager.portalContainerElement)&&i.includes(this.portalManager.portalContainerElement);s||e||this.hide();}},{key:"handlePanelSelect",value:function handlePanelSelect(t){var i=t.target;this.stayOpenOnSelect||"nile-menu"!==i.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger());}},{key:"handleTriggerClick",value:function handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger());}},{key:"handleTriggerKeyDown",value:function handleTriggerKeyDown(t){var i=this.getMenu();if(i){var _s=i.getAllItems(),_e=_s[0],_o=_s[_s.length-1];["ArrowDown","ArrowUp","Home","End"].includes(t.key)&&(t.preventDefault(),this.open||this.show(),_s.length>0&&this.updateComplete.then(function(){"ArrowDown"!==t.key&&"Home"!==t.key||(i.setCurrentItem(_e),_e.focus()),"ArrowUp"!==t.key&&"End"!==t.key||(i.setCurrentItem(_o),_o.focus());}));}}},{key:"handleTriggerKeyUp",value:function handleTriggerKeyUp(t){" "===t.key&&t.preventDefault();}},{key:"handleTriggerSlotChange",value:function handleTriggerSlotChange(){this.updateAccessibleTrigger();}},{key:"updateAccessibleTrigger",value:function updateAccessibleTrigger(){var t=this.trigger.assignedElements({flatten:!0}).find(function(t){return c(t).start;});var i;if(t){switch(t.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":i=t.button;break;default:i=t;}i.setAttribute("aria-haspopup","true"),i.setAttribute("aria-expanded",this.open?"true":"false");}}},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(this.open){_context2.next=2;break;}return _context2.abrupt("return",(this.open=!0,m(this,"nile-after-show")));case 2:case"end":return _context2.stop();}},_callee,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!this.open){_context3.next=2;break;}return _context3.abrupt("return",(this.open=!1,m(this,"nile-after-hide")));case 2:case"end":return _context3.stop();}},_callee2,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"reposition",value:function reposition(){this.popup.reposition();}},{key:"addOpenListeners",value:function addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"removeOpenListeners",value:function removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"updated",value:function updated(t){_superPropGet(f,"updated",this,3)([t]),t.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new w(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null));}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _p,_t2,_i,_p2,_t3,_i2;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!this.disabled){_context4.next=4;break;}this.open=!1;_context4.next=30;break;case 4:if(!(this.updateAccessibleTrigger(),this.open)){_context4.next=18;break;}this.emit("nile-show");this.addOpenListeners();this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new w(this),this.portalManager.setupPortalAppend());_context4.next=10;return r(this);case 10:if(this.portal){_context4.next=15;break;}this.panel.hidden=!1,this.popup.active=!0;_p=p(this,"dropdown.show",{dir:""}),_t2=_p.keyframes,_i=_p.options;_context4.next=15;return l(this.popup.popup,_t2,_i);case 15:this.emit("nile-after-show");_context4.next=30;break;case 18:this.emit("nile-hide");this.removeOpenListeners();this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend();_context4.next=23;return r(this);case 23:if(this.portal){_context4.next=29;break;}_p2=p(this,"dropdown.hide",{dir:""}),_t3=_p2.keyframes,_i2=_p2.options;_context4.next=27;return l(this.popup.popup,_t3,_i2);case 27:this.panel.hidden=!0;this.popup.active=!1;case 29:this.emit("nile-after-hide");case 30:case"end":return _context4.stop();}},_callee3,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popup\n part=\"base\"\n id=\"sidebar-action-dropdown\"\n placement=","\n distance=","\n skidding=","\n strategy=","\n sync=","\n flip\n shift\n auto-size=\"both\"\n auto-size-padding=\"10\"\n class=","\n >\n <slot\n name=\"trigger\"\n slot=\"anchor\"\n part=\"trigger\"\n class=\"dropdown__trigger\"\n @click=","\n @keydown=","\n @keyup=","\n @slotchange=","\n ></slot>\n\n <slot\n part=\"panel\"\n class=\"dropdown__panel\"\n aria-hidden=","\n aria-labelledby=\"sidebar-action-dropdown\"\n style=","\n ></slot>\n </nile-popup>\n "])),this.placement,this.distance,this.skidding,this.hoist?"fixed":"absolute",this.sync,n({dropdown:!0,"dropdown--open":this.open}),this.handleTriggerClick,this.handleTriggerKeyDown,this.handleTriggerKeyUp,this.handleTriggerSlotChange,this.open?"false":"true",this.portal&&this.portalManager?"display: none;":"");}}]);}(a));f.styles=[h],t([s(".dropdown")],f.prototype,"popup",void 0),t([s(".dropdown__trigger")],f.prototype,"trigger",void 0),t([s(".dropdown__panel")],f.prototype,"panel",void 0),t([e({type:Boolean,reflect:!0})],f.prototype,"open",void 0),t([e({reflect:!0})],f.prototype,"placement",void 0),t([e({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),t([e({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],f.prototype,"stayOpenOnSelect",void 0),t([e({attribute:!1})],f.prototype,"containingElement",void 0),t([e({type:Number})],f.prototype,"distance",void 0),t([e({type:Number})],f.prototype,"skidding",void 0),t([e()],f.prototype,"sync",void 0),t([e({type:Boolean})],f.prototype,"hoist",void 0),t([e({type:Boolean,reflect:!0})],f.prototype,"portal",void 0),t([e({reflect:!0})],f.prototype,"triggerDropdown",void 0),t([u("open",{waitUntilFirstUpdate:!0})],f.prototype,"handleOpenChange",null),_export("N",f=t([o("nile-side-bar-action")],f)),d("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),d("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});}};});
2
2
  //# sourceMappingURL=nile-side-bar-action.cjs.js.map
@@ -1,2 +1,2 @@
1
- System.register(["../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js"],function(_export,_context){"use strict";var t,i,s,o,e,h,a,n,l,r,p;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[function(_floatingUiDom001CjsJs){t=_floatingUiDom001CjsJs.c;i=_floatingUiDom001CjsJs.o;s=_floatingUiDom001CjsJs.s;o=_floatingUiDom001CjsJs.f;e=_floatingUiDom001CjsJs.a;h=_floatingUiDom001CjsJs.p;a=_floatingUiDom001CjsJs.b;},function(_portalUtilsCjsJs){n=_portalUtilsCjsJs.P;l=_portalUtilsCjsJs.a;r=_portalUtilsCjsJs.b;}],execute:function execute(){_export("D",p=/*#__PURE__*/function(){function p(t){_classCallCheck(this,p);this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=t;}return _createClass(p,[{key:"createPortalAppendContainer",value:function createPortalAppendContainer(){var t=document.createElement("div");return t.style.position="absolute",t.style.zIndex="9999",t.style.pointerEvents="none",t.style.width="auto",t.style.maxWidth="none",t.style.minWidth="auto",t.className="nile-dropdown-portal-append",t;}},{key:"positionPortalAppend",value:function positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition());}},{key:"measurePanelHeight",value:function measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="");}},{key:"computeFloatingUIPosition",value:function(){var _computeFloatingUIPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _this$component$shado,_this$component$query;var t,i,_yield$this$calculate,_s,_o,_e,_h;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(this.portalContainer){_context2.next=2;break;}return _context2.abrupt("return");case 2:t=((_this$component$shado=this.component.shadowRoot)===null||_this$component$shado===void 0||(_this$component$shado=_this$component$shado.querySelector('[slot="anchor"]'))===null||_this$component$shado===void 0?void 0:_this$component$shado.assignedElements({flatten:!0})[0])||((_this$component$query=this.component.querySelector('[slot="trigger"]'))===null||_this$component$query===void 0?void 0:_this$component$query.assignedElements({flatten:!0})[0])||this.component,i=this.portalContainer;_context2.prev=3;_context2.next=6;return this.calculateFloatingUIPosition(t,i);case 6:_yield$this$calculate=_context2.sent;_s=_yield$this$calculate.x;_o=_yield$this$calculate.y;_e=_yield$this$calculate.placement;_h=_yield$this$calculate.middlewareData;this.applyFloatingUIPosition(i,t,_s,_o,_e,_h);_context2.next=17;break;case 14:_context2.prev=14;_context2.t0=_context2["catch"](3);console.warn("Floating UI positioning failed, falling back to simple positioning:",_context2.t0),this.fallbackPositioning();case 17:case"end":return _context2.stop();}},_callee,this,[[3,14]]);}));function computeFloatingUIPosition(){return _computeFloatingUIPosition.apply(this,arguments);}return computeFloatingUIPosition;}()},{key:"calculateFloatingUIPosition",value:function(){var _calculateFloatingUIPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(i,s){var o,e,h;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:o=n.findBoundaryElements(i),e=this.getInitialPlacement(),h=this.createFloatingUIMiddleware(o);_context3.next=3;return t(i,s,{placement:e,strategy:"fixed",middleware:h,platform:this.createCustomPlatform()});case 3:return _context3.abrupt("return",_context3.sent);case 4:case"end":return _context3.stop();}},_callee2,this);}));function calculateFloatingUIPosition(_x,_x2){return _calculateFloatingUIPosition.apply(this,arguments);}return calculateFloatingUIPosition;}()},{key:"getInitialPlacement",value:function getInitialPlacement(){return this.component.placement||"bottom-start";}},{key:"createFloatingUIMiddleware",value:function createFloatingUIMiddleware(t){var h=[i(this.component.distance||0)];return this.component.sync&&h.push(s({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:t})),h.push(o({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:t})),h.push(e({padding:10,crossAxis:!0,boundary:t})),h;}},{key:"handleSizeMiddleware",value:function handleSizeMiddleware(_ref){var t=_ref.availableWidth,i=_ref.availableHeight,s=_ref.elements,o=_ref.rects;var e=n.calculateOptimalHeight(o.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(s.floating.style.width="".concat(o.reference.width,"px")),"height"!==this.component.sync&&"both"!==this.component.sync||(s.floating.style.height="".concat(o.reference.height,"px")),s.floating.style.maxHeight="".concat(e,"px"),s.floating.style.setProperty("--auto-size-available-width","".concat(t,"px")),s.floating.style.setProperty("--auto-size-available-height","".concat(e,"px"));}},{key:"getFallbackPlacements",value:function getFallbackPlacements(){var t=this.component.placement||"bottom-start",i=[];return t.startsWith("top")?i.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):t.startsWith("bottom")?i.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):t.startsWith("left")?i.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):t.startsWith("right")&&i.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),i;}},{key:"createCustomPlatform",value:function createCustomPlatform(){return h;}},{key:"applyFloatingUIPosition",value:function applyFloatingUIPosition(t,i,s,o,e,h){var a=i.getBoundingClientRect();Object.assign(t.style,{left:"".concat(s,"px"),top:"".concat(o,"px"),position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(t.style.width="".concat(a.width,"px")),this.currentPlacement=e,this.currentMiddlewareData=h,n.applyCollisionData(t,h,e);var l=e.split("-")[0];t.className="nile-dropdown-portal-append dropdown--open dropdown__panel--".concat(l);}},{key:"fallbackPositioning",value:function fallbackPositioning(){var _this$component$shado2,_this$component$query2;if(!this.portalContainer)return;var t=(((_this$component$shado2=this.component.shadowRoot)===null||_this$component$shado2===void 0||(_this$component$shado2=_this$component$shado2.querySelector('[slot="anchor"]'))===null||_this$component$shado2===void 0?void 0:_this$component$shado2.assignedElements({flatten:!0})[0])||((_this$component$query2=this.component.querySelector('[slot="trigger"]'))===null||_this$component$query2===void 0?void 0:_this$component$query2.assignedElements({flatten:!0})[0])||this.component).getBoundingClientRect(),i=window.innerHeight,s=window.innerWidth,o=i-t.bottom,e=t.top,h=s-t.right,a=t.left;var n,l,r,_p=t.left;var d=this.component.placement||"bottom-start";d.startsWith("bottom")?(r=Math.max(o-20,100),n=t.bottom+(this.component.distance||0),l="bottom"):d.startsWith("top")?(r=Math.max(e-20,100),n=Math.max(t.top-r-(this.component.distance||0),10),l="top"):d.startsWith("right")?(r=Math.max(Math.min(h,o,e)-20,100),n=t.top,_p=t.right+(this.component.distance||0),l="right"):(r=Math.max(Math.min(a,o,e)-20,100),n=t.top,_p=Math.max(t.left-200-(this.component.distance||0),10),l="left"),this.portalContainer.style.left="".concat(_p,"px"),this.portalContainer.style.top="".concat(n,"px"),this.portalContainer.style.maxHeight="".concat(r,"px"),this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width="".concat(t.width,"px")),this.portalContainer.className="nile-dropdown-portal-append dropdown__panel--".concat(l),this.calculateAndSetAutoSizeProperties(t,n,l);}},{key:"calculateAndSetAutoSizeProperties",value:function calculateAndSetAutoSizeProperties(t,i,s){if(!this.portalContainer)return;var o=window.innerHeight,e=window.innerWidth;var h,a=e-t.left-10;"top"===s?h=t.top-10:"bottom"===s?h=o-t.bottom-10:"left"===s?(h=Math.min(o-t.top,t.bottom),a=t.left-10):(h=Math.min(o-t.top,t.bottom),a=e-t.right-10),this.portalContainer.style.setProperty("--auto-size-available-height","".concat(Math.max(h,100),"px")),this.portalContainer.style.setProperty("--auto-size-available-width","".concat(Math.max(a,200),"px"));}},{key:"updatePortalAppendPosition",value:function updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend();}},{key:"handleWindowResize",value:function handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend();}},{key:"setupAutoUpdatePositioning",value:function setupAutoUpdatePositioning(){var _this$component$shado3,_this$component$query3,_this=this;if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();var t=((_this$component$shado3=this.component.shadowRoot)===null||_this$component$shado3===void 0||(_this$component$shado3=_this$component$shado3.querySelector('[slot="anchor"]'))===null||_this$component$shado3===void 0?void 0:_this$component$shado3.assignedElements({flatten:!0})[0])||((_this$component$query3=this.component.querySelector('[slot="trigger"]'))===null||_this$component$query3===void 0?void 0:_this$component$query3.assignedElements({flatten:!0})[0])||this.component;this.cleanupAutoUpdate=a(t,this.portalContainer,function(){_this.computeFloatingUIPosition();},{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0});}},{key:"cleanupAutoUpdatePositioning",value:function cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null);}},{key:"injectStylesToDocument",value:function injectStylesToDocument(){if(!this.portalContainer)return;var t=n.generateStyleId();if(document.getElementById(t))return;var i=this.component.constructor.styles;if(!i)return;var s=document.createElement("style");s.id=t,s.textContent=n.extractStylesAsCSS(i),document.head.appendChild(s),this.portalContainer.t=t;}},{key:"adoptStylesToPortalAppend",value:function adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument();}},{key:"setupPortalAppend",value:function setupPortalAppend(){var _this2=this;this.component.portal&&this.component.updateComplete.then(function(){setTimeout(function(){_this2.component.open&&(_this2.clonedPanel=_this2.createPortalPanel(),_this2.portalContainer=_this2.createPortalAppendContainer(),_this2.portalContainer.appendChild(_this2.clonedPanel),document.body.appendChild(_this2.portalContainer),_this2.adoptStylesToPortalAppend(),_this2.clonedPanel.style.display="",_this2.positionPortalAppend(),_this2.setupPortalEventListeners(),_this2.setupAutoUpdatePositioning(),_this2.boundHandleWindowResize=_this2.handleWindowResize.bind(_this2),window.addEventListener("resize",_this2.boundHandleWindowResize));},10);});}},{key:"createPortalPanel",value:function createPortalPanel(){return l.createPortalPanel(this.component);}},{key:"setupPortalEventListeners",value:function setupPortalEventListeners(){r.setupPortalEventListeners(this.clonedPanel,this.component);}},{key:"cleanupPortalAppend",value:function cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){var _t=this.portalContainer.t;if(_t){var _i=document.getElementById(_t);_i&&_i.remove();}this.portalContainer.parentNode.removeChild(this.portalContainer);}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null;}},{key:"portalContainerElement",get:function get(){return this.portalContainer;}},{key:"resetMeasuredHeight",value:function resetMeasuredHeight(){this.measuredPanelHeight=null;}},{key:"forceReposition",value:function forceReposition(){this.portalContainer&&this.computeFloatingUIPosition();}},{key:"getCurrentPlacement",value:function getCurrentPlacement(){return this.currentPlacement;}},{key:"getCurrentMiddlewareData",value:function getCurrentMiddlewareData(){return this.currentMiddlewareData;}},{key:"isUsingFloatingUI",value:function isUsingFloatingUI(){return null!==this.cleanupAutoUpdate;}},{key:"isPositioningOptimal",value:function isPositioningOptimal(){var _this$component$shado4,_this$component$query4;if(!this.portalContainer||!this.currentMiddlewareData)return!0;var t=(((_this$component$shado4=this.component.shadowRoot)===null||_this$component$shado4===void 0||(_this$component$shado4=_this$component$shado4.querySelector('[slot="anchor"]'))===null||_this$component$shado4===void 0?void 0:_this$component$shado4.assignedElements({flatten:!0})[0])||((_this$component$query4=this.component.querySelector('[slot="trigger"]'))===null||_this$component$query4===void 0?void 0:_this$component$query4.assignedElements({flatten:!0})[0])||this.component).getBoundingClientRect(),i=window.innerHeight-t.bottom,s=t.top,o=this.currentPlacement.startsWith("top"),e=this.currentPlacement.startsWith("bottom");return!(o&&i>s)&&!(e&&s>i);}},{key:"updatePortalPanel",value:function updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(l.updatePortalPanel(this.clonedPanel,this.component),this.forceReposition());}}]);}());}};});
1
+ System.register(["../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js"],function(_export,_context){"use strict";var t,i,s,o,e,h,a,n,l,r,p;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[function(_floatingUiDom002CjsJs){t=_floatingUiDom002CjsJs.c;i=_floatingUiDom002CjsJs.o;s=_floatingUiDom002CjsJs.s;o=_floatingUiDom002CjsJs.f;e=_floatingUiDom002CjsJs.a;h=_floatingUiDom002CjsJs.p;a=_floatingUiDom002CjsJs.b;},function(_portalUtilsCjsJs){n=_portalUtilsCjsJs.P;l=_portalUtilsCjsJs.a;r=_portalUtilsCjsJs.b;}],execute:function execute(){_export("D",p=/*#__PURE__*/function(){function p(t){_classCallCheck(this,p);this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=t;}return _createClass(p,[{key:"createPortalAppendContainer",value:function createPortalAppendContainer(){var t=document.createElement("div");return t.style.position="absolute",t.style.zIndex="9999",t.style.pointerEvents="none",t.style.width="auto",t.style.maxWidth="none",t.style.minWidth="auto",t.className="nile-dropdown-portal-append",t;}},{key:"positionPortalAppend",value:function positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition());}},{key:"measurePanelHeight",value:function measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="");}},{key:"computeFloatingUIPosition",value:function(){var _computeFloatingUIPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _this$component$shado,_this$component$query;var t,i,_yield$this$calculate,_s,_o,_e,_h;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(this.portalContainer){_context2.next=2;break;}return _context2.abrupt("return");case 2:t=((_this$component$shado=this.component.shadowRoot)===null||_this$component$shado===void 0||(_this$component$shado=_this$component$shado.querySelector('[slot="anchor"]'))===null||_this$component$shado===void 0?void 0:_this$component$shado.assignedElements({flatten:!0})[0])||((_this$component$query=this.component.querySelector('[slot="trigger"]'))===null||_this$component$query===void 0?void 0:_this$component$query.assignedElements({flatten:!0})[0])||this.component,i=this.portalContainer;_context2.prev=3;_context2.next=6;return this.calculateFloatingUIPosition(t,i);case 6:_yield$this$calculate=_context2.sent;_s=_yield$this$calculate.x;_o=_yield$this$calculate.y;_e=_yield$this$calculate.placement;_h=_yield$this$calculate.middlewareData;this.applyFloatingUIPosition(i,t,_s,_o,_e,_h);_context2.next=17;break;case 14:_context2.prev=14;_context2.t0=_context2["catch"](3);console.warn("Floating UI positioning failed, falling back to simple positioning:",_context2.t0),this.fallbackPositioning();case 17:case"end":return _context2.stop();}},_callee,this,[[3,14]]);}));function computeFloatingUIPosition(){return _computeFloatingUIPosition.apply(this,arguments);}return computeFloatingUIPosition;}()},{key:"calculateFloatingUIPosition",value:function(){var _calculateFloatingUIPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(i,s){var o,e,h;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:o=n.findBoundaryElements(i),e=this.getInitialPlacement(),h=this.createFloatingUIMiddleware(o);_context3.next=3;return t(i,s,{placement:e,strategy:"fixed",middleware:h,platform:this.createCustomPlatform()});case 3:return _context3.abrupt("return",_context3.sent);case 4:case"end":return _context3.stop();}},_callee2,this);}));function calculateFloatingUIPosition(_x,_x2){return _calculateFloatingUIPosition.apply(this,arguments);}return calculateFloatingUIPosition;}()},{key:"getInitialPlacement",value:function getInitialPlacement(){return this.component.placement||"bottom-start";}},{key:"createFloatingUIMiddleware",value:function createFloatingUIMiddleware(t){var h=[i(this.component.distance||0)];return this.component.sync&&h.push(s({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:t})),h.push(o({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:t})),h.push(e({padding:10,crossAxis:!0,boundary:t})),h;}},{key:"handleSizeMiddleware",value:function handleSizeMiddleware(_ref){var t=_ref.availableWidth,i=_ref.availableHeight,s=_ref.elements,o=_ref.rects;var e=n.calculateOptimalHeight(o.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(s.floating.style.width="".concat(o.reference.width,"px")),"height"!==this.component.sync&&"both"!==this.component.sync||(s.floating.style.height="".concat(o.reference.height,"px")),s.floating.style.maxHeight="".concat(e,"px"),s.floating.style.setProperty("--auto-size-available-width","".concat(t,"px")),s.floating.style.setProperty("--auto-size-available-height","".concat(e,"px"));}},{key:"getFallbackPlacements",value:function getFallbackPlacements(){var t=this.component.placement||"bottom-start",i=[];return t.startsWith("top")?i.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):t.startsWith("bottom")?i.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):t.startsWith("left")?i.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):t.startsWith("right")&&i.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),i;}},{key:"createCustomPlatform",value:function createCustomPlatform(){return h;}},{key:"applyFloatingUIPosition",value:function applyFloatingUIPosition(t,i,s,o,e,h){var a=i.getBoundingClientRect();Object.assign(t.style,{left:"".concat(s,"px"),top:"".concat(o,"px"),position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(t.style.width="".concat(a.width,"px")),this.currentPlacement=e,this.currentMiddlewareData=h,n.applyCollisionData(t,h,e);var l=e.split("-")[0];t.className="nile-dropdown-portal-append dropdown--open dropdown__panel--".concat(l);}},{key:"fallbackPositioning",value:function fallbackPositioning(){var _this$component$shado2,_this$component$query2;if(!this.portalContainer)return;var t=(((_this$component$shado2=this.component.shadowRoot)===null||_this$component$shado2===void 0||(_this$component$shado2=_this$component$shado2.querySelector('[slot="anchor"]'))===null||_this$component$shado2===void 0?void 0:_this$component$shado2.assignedElements({flatten:!0})[0])||((_this$component$query2=this.component.querySelector('[slot="trigger"]'))===null||_this$component$query2===void 0?void 0:_this$component$query2.assignedElements({flatten:!0})[0])||this.component).getBoundingClientRect(),i=window.innerHeight,s=window.innerWidth,o=i-t.bottom,e=t.top,h=s-t.right,a=t.left;var n,l,r,_p=t.left;var d=this.component.placement||"bottom-start";d.startsWith("bottom")?(r=Math.max(o-20,100),n=t.bottom+(this.component.distance||0),l="bottom"):d.startsWith("top")?(r=Math.max(e-20,100),n=Math.max(t.top-r-(this.component.distance||0),10),l="top"):d.startsWith("right")?(r=Math.max(Math.min(h,o,e)-20,100),n=t.top,_p=t.right+(this.component.distance||0),l="right"):(r=Math.max(Math.min(a,o,e)-20,100),n=t.top,_p=Math.max(t.left-200-(this.component.distance||0),10),l="left"),this.portalContainer.style.left="".concat(_p,"px"),this.portalContainer.style.top="".concat(n,"px"),this.portalContainer.style.maxHeight="".concat(r,"px"),this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width="".concat(t.width,"px")),this.portalContainer.className="nile-dropdown-portal-append dropdown__panel--".concat(l),this.calculateAndSetAutoSizeProperties(t,n,l);}},{key:"calculateAndSetAutoSizeProperties",value:function calculateAndSetAutoSizeProperties(t,i,s){if(!this.portalContainer)return;var o=window.innerHeight,e=window.innerWidth;var h,a=e-t.left-10;"top"===s?h=t.top-10:"bottom"===s?h=o-t.bottom-10:"left"===s?(h=Math.min(o-t.top,t.bottom),a=t.left-10):(h=Math.min(o-t.top,t.bottom),a=e-t.right-10),this.portalContainer.style.setProperty("--auto-size-available-height","".concat(Math.max(h,100),"px")),this.portalContainer.style.setProperty("--auto-size-available-width","".concat(Math.max(a,200),"px"));}},{key:"updatePortalAppendPosition",value:function updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend();}},{key:"handleWindowResize",value:function handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend();}},{key:"setupAutoUpdatePositioning",value:function setupAutoUpdatePositioning(){var _this$component$shado3,_this$component$query3,_this=this;if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();var t=((_this$component$shado3=this.component.shadowRoot)===null||_this$component$shado3===void 0||(_this$component$shado3=_this$component$shado3.querySelector('[slot="anchor"]'))===null||_this$component$shado3===void 0?void 0:_this$component$shado3.assignedElements({flatten:!0})[0])||((_this$component$query3=this.component.querySelector('[slot="trigger"]'))===null||_this$component$query3===void 0?void 0:_this$component$query3.assignedElements({flatten:!0})[0])||this.component;this.cleanupAutoUpdate=a(t,this.portalContainer,function(){_this.computeFloatingUIPosition();},{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0});}},{key:"cleanupAutoUpdatePositioning",value:function cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null);}},{key:"injectStylesToDocument",value:function injectStylesToDocument(){if(!this.portalContainer)return;var t=n.generateStyleId();if(document.getElementById(t))return;var i=this.component.constructor.styles;if(!i)return;var s=document.createElement("style");s.id=t,s.textContent=n.extractStylesAsCSS(i),document.head.appendChild(s),this.portalContainer.t=t;}},{key:"adoptStylesToPortalAppend",value:function adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument();}},{key:"setupPortalAppend",value:function setupPortalAppend(){var _this2=this;this.component.portal&&this.component.updateComplete.then(function(){setTimeout(function(){_this2.component.open&&(_this2.clonedPanel=_this2.createPortalPanel(),_this2.portalContainer=_this2.createPortalAppendContainer(),_this2.portalContainer.appendChild(_this2.clonedPanel),document.body.appendChild(_this2.portalContainer),_this2.adoptStylesToPortalAppend(),_this2.clonedPanel.style.display="",_this2.positionPortalAppend(),_this2.setupPortalEventListeners(),_this2.setupAutoUpdatePositioning(),_this2.boundHandleWindowResize=_this2.handleWindowResize.bind(_this2),window.addEventListener("resize",_this2.boundHandleWindowResize));},10);});}},{key:"createPortalPanel",value:function createPortalPanel(){return l.createPortalPanel(this.component);}},{key:"setupPortalEventListeners",value:function setupPortalEventListeners(){r.setupPortalEventListeners(this.clonedPanel,this.component);}},{key:"cleanupPortalAppend",value:function cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){var _t=this.portalContainer.t;if(_t){var _i=document.getElementById(_t);_i&&_i.remove();}this.portalContainer.parentNode.removeChild(this.portalContainer);}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null;}},{key:"portalContainerElement",get:function get(){return this.portalContainer;}},{key:"resetMeasuredHeight",value:function resetMeasuredHeight(){this.measuredPanelHeight=null;}},{key:"forceReposition",value:function forceReposition(){this.portalContainer&&this.computeFloatingUIPosition();}},{key:"getCurrentPlacement",value:function getCurrentPlacement(){return this.currentPlacement;}},{key:"getCurrentMiddlewareData",value:function getCurrentMiddlewareData(){return this.currentMiddlewareData;}},{key:"isUsingFloatingUI",value:function isUsingFloatingUI(){return null!==this.cleanupAutoUpdate;}},{key:"isPositioningOptimal",value:function isPositioningOptimal(){var _this$component$shado4,_this$component$query4;if(!this.portalContainer||!this.currentMiddlewareData)return!0;var t=(((_this$component$shado4=this.component.shadowRoot)===null||_this$component$shado4===void 0||(_this$component$shado4=_this$component$shado4.querySelector('[slot="anchor"]'))===null||_this$component$shado4===void 0?void 0:_this$component$shado4.assignedElements({flatten:!0})[0])||((_this$component$query4=this.component.querySelector('[slot="trigger"]'))===null||_this$component$query4===void 0?void 0:_this$component$query4.assignedElements({flatten:!0})[0])||this.component).getBoundingClientRect(),i=window.innerHeight-t.bottom,s=t.top,o=this.currentPlacement.startsWith("top"),e=this.currentPlacement.startsWith("bottom");return!(o&&i>s)&&!(e&&s>i);}},{key:"updatePortalPanel",value:function updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(l.updatePortalPanel(this.clonedPanel,this.component),this.forceReposition());}}]);}());}};});
2
2
  //# sourceMappingURL=portal-manager.cjs.js.map
@@ -1,2 +1,2 @@
1
- System.register(["./nile-tooltip.cjs.js","tslib","./nile-tooltip.css.cjs.js","lit","../nile-popup/nile-popup.cjs.js","../floating-ui.dom-007bbe96.cjs.js","lit/directives/class-map.js","lit/decorators.js","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js","../nile-popup/nile-popup.css.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTooltipCjsJs){_export("NileTooltip",_nileTooltipCjsJs.N);},function(_tslib){},function(_nileTooltipCssCjsJs){},function(_lit){},function(_nilePopupNilePopupCjsJs){},function(_floatingUiDom001CjsJs){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_internalAnimateCjsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){},function(_utilitiesVisibilityManagerCjsJs){}],execute:function execute(){}};});
1
+ System.register(["./nile-tooltip.cjs.js","tslib","./nile-tooltip.css.cjs.js","lit","../nile-popup/nile-popup.cjs.js","../floating-ui.dom-007bbe96.cjs.js","lit/directives/class-map.js","lit/decorators.js","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js","../nile-popup/nile-popup.css.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTooltipCjsJs){_export("NileTooltip",_nileTooltipCjsJs.N);},function(_tslib){},function(_nileTooltipCssCjsJs){},function(_lit){},function(_nilePopupNilePopupCjsJs){},function(_floatingUiDom002CjsJs){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_internalAnimateCjsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){},function(_utilitiesVisibilityManagerCjsJs){}],execute:function execute(){}};});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","./nile-tooltip.css.cjs.js","../nile-popup/nile-popup.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","lit/decorators.js","../utilities/animation-registry.cjs.js","lit","../internal/event.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../utilities/visibility-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var i,t,s,e,o,h,a,n,l,r,p,c,d,u,m,f,_templateObject,y;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){i=_tslib.__decorate;},function(_nileTooltipCssCjsJs){t=_nileTooltipCssCjsJs.s;},function(_nilePopupNilePopupCjsJs){},function(_internalAnimateCjsJs){s=_internalAnimateCjsJs.c;e=_internalAnimateCjsJs.s;o=_internalAnimateCjsJs.a;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){a=_litDecoratorsJs.query;n=_litDecoratorsJs.property;l=_litDecoratorsJs.customElement;},function(_utilitiesAnimationRegistryCjsJs){r=_utilitiesAnimationRegistryCjsJs.s;p=_utilitiesAnimationRegistryCjsJs.g;},function(_lit){c=_lit.html;},function(_internalEventCjsJs){d=_internalEventCjsJs.w;},function(_internalWatchCjsJs){u=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){m=_internalNileElementCjsJs.N;},function(_utilitiesVisibilityManagerCjsJs){f=_utilitiesVisibilityManagerCjsJs.V;},function(_floatingUiDom001CjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",y=/*#__PURE__*/function(_m){function y(){var _this;_classCallCheck(this,y);_this=_callSuper(this,y,arguments),_this.content="",_this.size="small",_this.placement="top",_this.disabled=!1,_this.distance=8,_this.open=!1,_this.skidding=0,_this.trigger="hover focus",_this.hoist=!1,_this.enableVisibilityEffect=!1,_this.enableTabClose=!1;return _this;}_inherits(y,_m);return _createClass(y,[{key:"connectedCallback",value:function connectedCallback(){var _this2=this;_superPropGet(y,"connectedCallback",this,3)([]),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),this.updateComplete.then(function(){_this2.addEventListener("blur",_this2.handleBlur,!0),_this2.addEventListener("focus",_this2.handleFocus,!0),_this2.addEventListener("click",_this2.handleClick),_this2.addEventListener("keydown",_this2.handleKeyDown),_this2.addEventListener("mouseover",_this2.handleMouseOver),_this2.addEventListener("mouseout",_this2.handleMouseOut);});}},{key:"firstUpdated",value:function firstUpdated(){var _this3=this;this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition());var i=this.renderRoot.querySelector("slot:not([name])"),t=i===null||i===void 0?void 0:i.assignedElements({flatten:!0})[0];this.visibilityManager=new f({host:this,target:t||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:function isOpen(){return _this3.open;},onAnchorOutOfView:function onAnchorOutOfView(){_this3.hide(),_this3.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"});},onDocumentHidden:function onDocumentHidden(){_this3.hide(),_this3.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"});},emit:function emit(i,t){return _this3.emit("nile-".concat(i),t);}});}},{key:"disconnectedCallback",value:function disconnectedCallback(){var _this$visibilityManag;_superPropGet(y,"disconnectedCallback",this,3)([]),(_this$visibilityManag=this.visibilityManager)!==null&&_this$visibilityManag!==void 0&&_this$visibilityManag.cleanup(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut);}},{key:"handleBlur",value:function handleBlur(){this.hasTrigger("focus")&&this.hide();}},{key:"handleClick",value:function handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show());}},{key:"handleFocus",value:function handleFocus(){this.hasTrigger("focus")&&this.show();}},{key:"handleKeyDown",value:function handleKeyDown(i){this.open&&"Escape"===i.key&&(i.stopPropagation(),this.hide());}},{key:"handleMouseOver",value:function handleMouseOver(){var _this4=this;if(this.hasTrigger("hover")){var _i=s(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this4.show();},_i);}}},{key:"handleMouseOut",value:function handleMouseOut(){var _this5=this;if(this.hasTrigger("hover")){var _i2=s(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this5.hide();},_i2);}}},{key:"hasTrigger",value:function hasTrigger(i){return this.trigger.split(" ").includes(i);}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _this$visibilityManag2,_p,_i3,_t,_this$visibilityManag3,_p2,_i4,_t2;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!this.open){_context2.next=14;break;}if(!((_this$visibilityManag2=this.visibilityManager)!==null&&_this$visibilityManag2!==void 0&&_this$visibilityManag2.setup(),this.disabled)){_context2.next=3;break;}return _context2.abrupt("return");case 3:this.emit("nile-show");_context2.next=6;return e(this.body);case 6:this.body.hidden=!1;this.popup.active=!0;_p=p(this,"tooltip.show",{dir:""}),_i3=_p.keyframes,_t=_p.options;_context2.next=11;return o(this.popup.popup,_i3,_t);case 11:this.emit("nile-after-show");_context2.next=24;break;case 14:(_this$visibilityManag3=this.visibilityManager)!==null&&_this$visibilityManag3!==void 0&&_this$visibilityManag3.cleanup();this.emit("nile-hide");_context2.next=18;return e(this.body);case 18:_p2=p(this,"tooltip.hide",{dir:""}),_i4=_p2.keyframes,_t2=_p2.options;_context2.next=21;return o(this.popup.popup,_i4,_t2);case 21:this.popup.active=!1;this.body.hidden=!0;this.emit("nile-after-hide");case 24:case"end":return _context2.stop();}},_callee,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"handleOptionsChange",value:function(){var _handleOptionsChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.t0=this.hasUpdated;if(!_context3.t0){_context3.next=5;break;}_context3.next=4;return this.updateComplete;case 4:this.popup.reposition();case 5:case"end":return _context3.stop();}},_callee2,this);}));function handleOptionsChange(){return _handleOptionsChange.apply(this,arguments);}return handleOptionsChange;}()},{key:"handleDisabledChange",value:function handleDisabledChange(){this.disabled&&this.open&&this.hide();}},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _this$content;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!(!this.open&&(_this$content=this.content)!==null&&_this$content!==void 0&&_this$content.trim().length)){_context4.next=2;break;}return _context4.abrupt("return",(this.open=!0,d(this,"nile-after-show")));case 2:case"end":return _context4.stop();}},_callee3,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!this.open){_context5.next=2;break;}return _context5.abrupt("return",(this.open=!1,d(this,"nile-after-hide")));case 2:case"end":return _context5.stop();}},_callee4,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"render",value:function render(){return c(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popup\n part=\"base\"\n exportparts=\"\n popup:base__popup,\n arrow:base__arrow\n \"\n class=","\n placement=","\n distance=","\n skidding=","\n strategy=","\n flip\n shift\n arrow\n >\n <slot slot=\"anchor\" aria-describedby=\"tooltip\"></slot>\n\n <slot\n name=\"content\"\n part=\"body\"\n id=\"tooltip\"\n class=","\n role=\"tooltip\"\n aria-live=","\n >\n ","\n </slot>\n </nile-popup>\n "])),h({tooltip:!0,"tooltip--open":this.open}),this.placement,this.distance,this.skidding,this.hoist?"fixed":"absolute",h({tooltip__body:!0,"tooltip__body--large":"large"===this.size}),this.open?"polite":"off",this.content);}}],[{key:"styles",get:function get(){return[t];}}]);}(m));i([a("slot:not([name])")],y.prototype,"defaultSlot",void 0),i([a(".tooltip__body")],y.prototype,"body",void 0),i([a("nile-popup")],y.prototype,"popup",void 0),i([n({type:String,reflect:!0})],y.prototype,"content",void 0),i([n({reflect:!0})],y.prototype,"size",void 0),i([n()],y.prototype,"placement",void 0),i([n({type:Boolean,reflect:!0})],y.prototype,"disabled",void 0),i([n({type:Number})],y.prototype,"distance",void 0),i([n({type:Boolean,reflect:!0})],y.prototype,"open",void 0),i([n({type:Number})],y.prototype,"skidding",void 0),i([n()],y.prototype,"trigger",void 0),i([n({type:Boolean})],y.prototype,"hoist",void 0),i([n({type:Boolean,reflect:!0})],y.prototype,"enableVisibilityEffect",void 0),i([n({type:Boolean,reflect:!0})],y.prototype,"enableTabClose",void 0),i([u("open",{waitUntilFirstUpdate:!0})],y.prototype,"handleOpenChange",null),i([u(["content","distance","hoist","placement","skidding"])],y.prototype,"handleOptionsChange",null),i([u("disabled")],y.prototype,"handleDisabledChange",null),_export("N",y=i([l("nile-tooltip")],y)),r("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),r("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","./nile-tooltip.css.cjs.js","../nile-popup/nile-popup.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","lit/decorators.js","../utilities/animation-registry.cjs.js","lit","../internal/event.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../utilities/visibility-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var i,t,s,e,o,h,a,n,l,r,p,c,d,u,m,f,_templateObject,y;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){i=_tslib.__decorate;},function(_nileTooltipCssCjsJs){t=_nileTooltipCssCjsJs.s;},function(_nilePopupNilePopupCjsJs){},function(_internalAnimateCjsJs){s=_internalAnimateCjsJs.c;e=_internalAnimateCjsJs.s;o=_internalAnimateCjsJs.a;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){a=_litDecoratorsJs.query;n=_litDecoratorsJs.property;l=_litDecoratorsJs.customElement;},function(_utilitiesAnimationRegistryCjsJs){r=_utilitiesAnimationRegistryCjsJs.s;p=_utilitiesAnimationRegistryCjsJs.g;},function(_lit){c=_lit.html;},function(_internalEventCjsJs){d=_internalEventCjsJs.w;},function(_internalWatchCjsJs){u=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){m=_internalNileElementCjsJs.N;},function(_utilitiesVisibilityManagerCjsJs){f=_utilitiesVisibilityManagerCjsJs.V;},function(_floatingUiDom002CjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",y=/*#__PURE__*/function(_m){function y(){var _this;_classCallCheck(this,y);_this=_callSuper(this,y,arguments),_this.content="",_this.size="small",_this.placement="top",_this.disabled=!1,_this.distance=8,_this.open=!1,_this.skidding=0,_this.trigger="hover focus",_this.hoist=!1,_this.enableVisibilityEffect=!1,_this.enableTabClose=!1;return _this;}_inherits(y,_m);return _createClass(y,[{key:"connectedCallback",value:function connectedCallback(){var _this2=this;_superPropGet(y,"connectedCallback",this,3)([]),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),this.updateComplete.then(function(){_this2.addEventListener("blur",_this2.handleBlur,!0),_this2.addEventListener("focus",_this2.handleFocus,!0),_this2.addEventListener("click",_this2.handleClick),_this2.addEventListener("keydown",_this2.handleKeyDown),_this2.addEventListener("mouseover",_this2.handleMouseOver),_this2.addEventListener("mouseout",_this2.handleMouseOut);});}},{key:"firstUpdated",value:function firstUpdated(){var _this3=this;this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition());var i=this.renderRoot.querySelector("slot:not([name])"),t=i===null||i===void 0?void 0:i.assignedElements({flatten:!0})[0];this.visibilityManager=new f({host:this,target:t||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:function isOpen(){return _this3.open;},onAnchorOutOfView:function onAnchorOutOfView(){_this3.hide(),_this3.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"});},onDocumentHidden:function onDocumentHidden(){_this3.hide(),_this3.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"});},emit:function emit(i,t){return _this3.emit("nile-".concat(i),t);}});}},{key:"disconnectedCallback",value:function disconnectedCallback(){var _this$visibilityManag;_superPropGet(y,"disconnectedCallback",this,3)([]),(_this$visibilityManag=this.visibilityManager)!==null&&_this$visibilityManag!==void 0&&_this$visibilityManag.cleanup(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut);}},{key:"handleBlur",value:function handleBlur(){this.hasTrigger("focus")&&this.hide();}},{key:"handleClick",value:function handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show());}},{key:"handleFocus",value:function handleFocus(){this.hasTrigger("focus")&&this.show();}},{key:"handleKeyDown",value:function handleKeyDown(i){this.open&&"Escape"===i.key&&(i.stopPropagation(),this.hide());}},{key:"handleMouseOver",value:function handleMouseOver(){var _this4=this;if(this.hasTrigger("hover")){var _i=s(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this4.show();},_i);}}},{key:"handleMouseOut",value:function handleMouseOut(){var _this5=this;if(this.hasTrigger("hover")){var _i2=s(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this5.hide();},_i2);}}},{key:"hasTrigger",value:function hasTrigger(i){return this.trigger.split(" ").includes(i);}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _this$visibilityManag2,_p,_i3,_t,_this$visibilityManag3,_p2,_i4,_t2;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!this.open){_context2.next=14;break;}if(!((_this$visibilityManag2=this.visibilityManager)!==null&&_this$visibilityManag2!==void 0&&_this$visibilityManag2.setup(),this.disabled)){_context2.next=3;break;}return _context2.abrupt("return");case 3:this.emit("nile-show");_context2.next=6;return e(this.body);case 6:this.body.hidden=!1;this.popup.active=!0;_p=p(this,"tooltip.show",{dir:""}),_i3=_p.keyframes,_t=_p.options;_context2.next=11;return o(this.popup.popup,_i3,_t);case 11:this.emit("nile-after-show");_context2.next=24;break;case 14:(_this$visibilityManag3=this.visibilityManager)!==null&&_this$visibilityManag3!==void 0&&_this$visibilityManag3.cleanup();this.emit("nile-hide");_context2.next=18;return e(this.body);case 18:_p2=p(this,"tooltip.hide",{dir:""}),_i4=_p2.keyframes,_t2=_p2.options;_context2.next=21;return o(this.popup.popup,_i4,_t2);case 21:this.popup.active=!1;this.body.hidden=!0;this.emit("nile-after-hide");case 24:case"end":return _context2.stop();}},_callee,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"handleOptionsChange",value:function(){var _handleOptionsChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.t0=this.hasUpdated;if(!_context3.t0){_context3.next=5;break;}_context3.next=4;return this.updateComplete;case 4:this.popup.reposition();case 5:case"end":return _context3.stop();}},_callee2,this);}));function handleOptionsChange(){return _handleOptionsChange.apply(this,arguments);}return handleOptionsChange;}()},{key:"handleDisabledChange",value:function handleDisabledChange(){this.disabled&&this.open&&this.hide();}},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _this$content;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!(!this.open&&(_this$content=this.content)!==null&&_this$content!==void 0&&_this$content.trim().length)){_context4.next=2;break;}return _context4.abrupt("return",(this.open=!0,d(this,"nile-after-show")));case 2:case"end":return _context4.stop();}},_callee3,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!this.open){_context5.next=2;break;}return _context5.abrupt("return",(this.open=!1,d(this,"nile-after-hide")));case 2:case"end":return _context5.stop();}},_callee4,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"render",value:function render(){return c(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popup\n part=\"base\"\n exportparts=\"\n popup:base__popup,\n arrow:base__arrow\n \"\n class=","\n placement=","\n distance=","\n skidding=","\n strategy=","\n flip\n shift\n arrow\n >\n <slot slot=\"anchor\" aria-describedby=\"tooltip\"></slot>\n\n <slot\n name=\"content\"\n part=\"body\"\n id=\"tooltip\"\n class=","\n role=\"tooltip\"\n aria-live=","\n >\n ","\n </slot>\n </nile-popup>\n "])),h({tooltip:!0,"tooltip--open":this.open}),this.placement,this.distance,this.skidding,this.hoist?"fixed":"absolute",h({tooltip__body:!0,"tooltip__body--large":"large"===this.size}),this.open?"polite":"off",this.content);}}],[{key:"styles",get:function get(){return[t];}}]);}(m));i([a("slot:not([name])")],y.prototype,"defaultSlot",void 0),i([a(".tooltip__body")],y.prototype,"body",void 0),i([a("nile-popup")],y.prototype,"popup",void 0),i([n({type:String,reflect:!0})],y.prototype,"content",void 0),i([n({reflect:!0})],y.prototype,"size",void 0),i([n()],y.prototype,"placement",void 0),i([n({type:Boolean,reflect:!0})],y.prototype,"disabled",void 0),i([n({type:Number})],y.prototype,"distance",void 0),i([n({type:Boolean,reflect:!0})],y.prototype,"open",void 0),i([n({type:Number})],y.prototype,"skidding",void 0),i([n()],y.prototype,"trigger",void 0),i([n({type:Boolean})],y.prototype,"hoist",void 0),i([n({type:Boolean,reflect:!0})],y.prototype,"enableVisibilityEffect",void 0),i([n({type:Boolean,reflect:!0})],y.prototype,"enableTabClose",void 0),i([u("open",{waitUntilFirstUpdate:!0})],y.prototype,"handleOpenChange",null),i([u(["content","distance","hoist","placement","skidding"])],y.prototype,"handleOptionsChange",null),i([u("disabled")],y.prototype,"handleDisabledChange",null),_export("N",y=i([l("nile-tooltip")],y)),r("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),r("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});}};});
2
2
  //# sourceMappingURL=nile-tooltip.cjs.js.map