@ptcwebops/ptcw-design 6.3.0 → 6.3.1

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 (379) hide show
  1. package/dist/cjs/event-jumbotron-example.cjs.entry.js +1750 -0
  2. package/dist/cjs/icon-asset_6.cjs.entry.js +347 -0
  3. package/dist/cjs/list-item.cjs.entry.js +48 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/ptc-breadcrumb.cjs.entry.js +47 -0
  6. package/dist/cjs/ptc-button.cjs.entry.js +87 -0
  7. package/dist/cjs/ptc-card-bottom_2.cjs.entry.js +156 -0
  8. package/dist/cjs/ptc-card-content.cjs.entry.js +76 -0
  9. package/dist/cjs/ptc-close-icon_2.cjs.entry.js +252 -0
  10. package/dist/cjs/ptc-img.cjs.entry.js +133 -0
  11. package/dist/cjs/ptc-jumbotron.cjs.entry.js +1 -1
  12. package/dist/cjs/ptc-link.cjs.entry.js +87 -0
  13. package/dist/cjs/ptc-para.cjs.entry.js +127 -0
  14. package/dist/cjs/ptc-pricing-tabs.cjs.entry.js +1 -1
  15. package/dist/cjs/ptc-scroll-button.cjs.entry.js +136 -0
  16. package/dist/cjs/ptc-spacer.cjs.entry.js +38 -0
  17. package/dist/cjs/ptc-title.cjs.entry.js +152 -0
  18. package/dist/cjs/ptcw-design.cjs.js +1 -1
  19. package/dist/collection/components/ptc-jumbotron/ptc-jumbotron.css +7 -0
  20. package/dist/collection/components/ptc-pricing-tabs/ptc-pricing-tabs.css +7 -0
  21. package/dist/collection/components/subnav/ptc-nav-slider/ptc-nav-slider.css +3 -3
  22. package/dist/custom-elements/index.js +3 -3
  23. package/dist/esm/academic-form-test.entry.js +1 -1
  24. package/dist/esm/author-listing-example.entry.js +1 -1
  25. package/dist/esm/blog-detail-content_2.entry.js +2 -2
  26. package/dist/esm/blog-detail-layout.entry.js +2 -2
  27. package/dist/esm/blogs-search-section.entry.js +2 -2
  28. package/dist/esm/bundle-example.entry.js +1 -1
  29. package/dist/esm/bundle-jumbotron-example.entry.js +1 -1
  30. package/dist/esm/dropdown-item.entry.js +1 -1
  31. package/dist/esm/dynamic-box-bundle.entry.js +1 -1
  32. package/dist/esm/embedded-form.entry.js +1 -1
  33. package/dist/esm/event-jumbotron-example.entry.js +1746 -0
  34. package/dist/esm/event-podcast-slider-example.entry.js +1 -1
  35. package/dist/esm/featured-events-slider-example.entry.js +1 -1
  36. package/dist/esm/featured-list.entry.js +1 -1
  37. package/dist/esm/fl-tab-content_3.entry.js +1 -1
  38. package/dist/esm/footer-form.entry.js +1 -1
  39. package/dist/esm/homepage-clickable-tab.entry.js +1 -1
  40. package/dist/esm/homepage-jumbotron.entry.js +2 -2
  41. package/dist/esm/homepage-toggled-content.entry.js +2 -2
  42. package/dist/esm/icon-asset_6.entry.js +338 -0
  43. package/dist/esm/{index-c83db688.js → index-0bf594c4.js} +1 -1
  44. package/dist/esm/innovator-toggle-container.entry.js +1 -1
  45. package/dist/esm/jumbotron-sub-menu.entry.js +1 -1
  46. package/dist/esm/jumbotron-sub-mune.entry.js +1 -1
  47. package/dist/esm/list-item.entry.js +44 -0
  48. package/dist/esm/loader.js +3 -3
  49. package/dist/esm/max-width-container.entry.js +1 -1
  50. package/dist/esm/most-popular-news.entry.js +2 -2
  51. package/dist/esm/my-component.entry.js +2 -2
  52. package/dist/esm/news-search-result.entry.js +1 -1
  53. package/dist/esm/ptc-accordion-item.entry.js +2 -2
  54. package/dist/esm/ptc-accordion.entry.js +1 -1
  55. package/dist/esm/ptc-announcement.entry.js +1 -1
  56. package/dist/esm/ptc-back-to-top.entry.js +1 -1
  57. package/dist/esm/ptc-background-video.entry.js +2 -2
  58. package/dist/esm/ptc-badge.entry.js +1 -1
  59. package/dist/esm/ptc-bio-card.entry.js +1 -1
  60. package/dist/esm/ptc-breadcrumb.entry.js +43 -0
  61. package/dist/esm/ptc-brightcov-video.entry.js +1 -1
  62. package/dist/esm/ptc-button.entry.js +83 -0
  63. package/dist/esm/ptc-card-bottom_2.entry.js +151 -0
  64. package/dist/esm/ptc-card-content.entry.js +72 -0
  65. package/dist/esm/ptc-card_2.entry.js +1 -1
  66. package/dist/esm/ptc-case-studies-slider.entry.js +1 -1
  67. package/dist/esm/ptc-checkbox-group.entry.js +1 -1
  68. package/dist/esm/ptc-checkbox.entry.js +1 -1
  69. package/dist/esm/ptc-close-icon_2.entry.js +247 -0
  70. package/dist/esm/ptc-collapse-list.entry.js +2 -2
  71. package/dist/esm/ptc-container.entry.js +1 -1
  72. package/dist/esm/ptc-countdown.entry.js +1 -1
  73. package/dist/esm/ptc-data-lookup.entry.js +1 -1
  74. package/dist/esm/ptc-date.entry.js +1 -1
  75. package/dist/esm/ptc-dropdown.entry.js +1 -1
  76. package/dist/esm/ptc-dynamic-card.entry.js +1 -1
  77. package/dist/esm/ptc-ellipsis-dropdown.entry.js +1 -1
  78. package/dist/esm/ptc-embedded-quiz.entry.js +1 -1
  79. package/dist/esm/ptc-featured-list.entry.js +1 -1
  80. package/dist/esm/ptc-filter-dropdown_4.entry.js +1 -1
  81. package/dist/esm/ptc-filter-level-theater.entry.js +1 -1
  82. package/dist/esm/ptc-filter-tag_2.entry.js +1 -1
  83. package/dist/esm/ptc-footer.entry.js +1 -1
  84. package/dist/esm/ptc-form-checkbox_2.entry.js +2 -2
  85. package/dist/esm/ptc-form-radio-button.entry.js +1 -1
  86. package/dist/esm/ptc-form-radio-group.entry.js +1 -1
  87. package/dist/esm/ptc-form.entry.js +1 -1
  88. package/dist/esm/ptc-hero-footer-cta.entry.js +1 -1
  89. package/dist/esm/ptc-hero.entry.js +1 -1
  90. package/dist/esm/ptc-homepage-image-feature.entry.js +2 -2
  91. package/dist/esm/ptc-homepage-video-background.entry.js +2 -2
  92. package/dist/esm/ptc-icon-card.entry.js +2 -2
  93. package/dist/esm/ptc-icon-component.entry.js +1 -1
  94. package/dist/esm/ptc-icon-list.entry.js +1 -1
  95. package/dist/esm/ptc-icon-minimize.entry.js +1 -1
  96. package/dist/esm/ptc-image-download-strip.entry.js +1 -1
  97. package/dist/esm/ptc-img.entry.js +129 -0
  98. package/dist/esm/ptc-info-tile.entry.js +1 -1
  99. package/dist/esm/ptc-inline-cta.entry.js +1 -1
  100. package/dist/esm/ptc-jumbotron.entry.js +2 -2
  101. package/dist/esm/ptc-link.entry.js +83 -0
  102. package/dist/esm/ptc-list.entry.js +1 -1
  103. package/dist/esm/ptc-media-card.entry.js +2 -2
  104. package/dist/esm/ptc-minimized-nav.entry.js +1 -1
  105. package/dist/esm/ptc-mobile-select.entry.js +1 -1
  106. package/dist/esm/ptc-modal-quiz.entry.js +1 -1
  107. package/dist/esm/ptc-multi-select_2.entry.js +2 -2
  108. package/dist/esm/ptc-nav-card.entry.js +1 -1
  109. package/dist/esm/ptc-nav-pills.entry.js +1 -1
  110. package/dist/esm/ptc-nav-skip-to-content.entry.js +1 -1
  111. package/dist/esm/ptc-nav-tile.entry.js +1 -1
  112. package/dist/esm/ptc-news.entry.js +1 -1
  113. package/dist/esm/ptc-office-location-card.entry.js +1 -1
  114. package/dist/esm/ptc-office-locations.entry.js +1 -1
  115. package/dist/esm/ptc-overlay.entry.js +1 -1
  116. package/dist/esm/ptc-para.entry.js +123 -0
  117. package/dist/esm/ptc-picture.entry.js +1 -1
  118. package/dist/esm/ptc-podcast-card.entry.js +1 -1
  119. package/dist/esm/ptc-preferance-center-form.entry.js +1 -1
  120. package/dist/esm/ptc-previous-url.entry.js +1 -1
  121. package/dist/esm/ptc-pricing-add-on-card.entry.js +1 -1
  122. package/dist/esm/ptc-pricing-add-on-section.entry.js +1 -1
  123. package/dist/esm/ptc-pricing-block.entry.js +1 -1
  124. package/dist/esm/ptc-pricing-packaging-table.entry.js +2 -2
  125. package/dist/esm/ptc-pricing-tabs.entry.js +3 -3
  126. package/dist/esm/ptc-product-card.entry.js +1 -1
  127. package/dist/esm/ptc-product-category.entry.js +1 -1
  128. package/dist/esm/ptc-product-dropdown.entry.js +1 -1
  129. package/dist/esm/ptc-product-highlight-card.entry.js +1 -1
  130. package/dist/esm/ptc-product-list.entry.js +1 -1
  131. package/dist/esm/ptc-product-sidebar.entry.js +1 -1
  132. package/dist/esm/ptc-progress-bar.entry.js +1 -1
  133. package/dist/esm/ptc-quantity-counter.entry.js +1 -1
  134. package/dist/esm/ptc-quote.entry.js +1 -1
  135. package/dist/esm/ptc-readmore-char.entry.js +1 -1
  136. package/dist/esm/ptc-readmore-new.entry.js +1 -1
  137. package/dist/esm/ptc-readmore-v3.entry.js +1 -1
  138. package/dist/esm/ptc-readmore.entry.js +1 -1
  139. package/dist/esm/ptc-related-card-rail.entry.js +1 -1
  140. package/dist/esm/ptc-responsive-wrapper.entry.js +1 -1
  141. package/dist/esm/ptc-scroll-button.entry.js +132 -0
  142. package/dist/esm/ptc-search-field.entry.js +1 -1
  143. package/dist/esm/ptc-seo-title.entry.js +1 -1
  144. package/dist/esm/ptc-shopping-cart.entry.js +1 -1
  145. package/dist/esm/ptc-showcase-card.entry.js +1 -1
  146. package/dist/esm/ptc-skeleton.entry.js +1 -1
  147. package/dist/esm/ptc-slit-card.entry.js +1 -1
  148. package/dist/esm/ptc-social-icons-footer.entry.js +2 -2
  149. package/dist/esm/ptc-social-icons.entry.js +1 -1
  150. package/dist/esm/ptc-spacer.entry.js +34 -0
  151. package/dist/esm/ptc-span.entry.js +1 -1
  152. package/dist/esm/ptc-square-card.entry.js +1 -1
  153. package/dist/esm/ptc-sticky-icons.entry.js +1 -1
  154. package/dist/esm/ptc-sticky-title.entry.js +1 -1
  155. package/dist/esm/ptc-subnav-card.entry.js +1 -1
  156. package/dist/esm/ptc-svg-btn.entry.js +1 -1
  157. package/dist/esm/ptc-tab-list.entry.js +1 -1
  158. package/dist/esm/ptc-tab.entry.js +1 -1
  159. package/dist/esm/ptc-tabs.entry.js +1 -1
  160. package/dist/esm/ptc-text-copy-with-background.entry.js +1 -1
  161. package/dist/esm/ptc-theater-video-modal.entry.js +1 -1
  162. package/dist/esm/ptc-title.entry.js +148 -0
  163. package/dist/esm/ptc-tooltip-v2.entry.js +1 -1
  164. package/dist/esm/ptc-tooltip-v3.entry.js +1 -1
  165. package/dist/esm/ptc-tooltip.entry.js +1 -1
  166. package/dist/esm/ptc-two-column-media.entry.js +1 -1
  167. package/dist/esm/ptc-value-led-card.entry.js +1 -1
  168. package/dist/esm/ptc-value-led-content-highlight.entry.js +1 -1
  169. package/dist/esm/ptc-value-led-content.entry.js +1 -1
  170. package/dist/esm/ptc-value-led-intro.entry.js +1 -1
  171. package/dist/esm/ptc-value-led-layout.entry.js +1 -1
  172. package/dist/esm/ptc-value-led-speed-bump.entry.js +1 -1
  173. package/dist/esm/ptc-value-prop-card.entry.js +1 -1
  174. package/dist/esm/ptc-video-embed.entry.js +1 -1
  175. package/dist/esm/ptc-white-paper.entry.js +1 -1
  176. package/dist/esm/ptcw-design.js +3 -3
  177. package/dist/esm/sequential-bundle-example.entry.js +1 -1
  178. package/dist/esm/sequential-bundle.entry.js +1 -1
  179. package/dist/esm/tab-content.entry.js +1 -1
  180. package/dist/esm/tab-header.entry.js +1 -1
  181. package/dist/esm/{utils-ff65c75b.js → utils-63eab4bd.js} +1 -1
  182. package/dist/ptcw-design/{p-d089dc37.entry.js → p-00ccc051.entry.js} +1 -1
  183. package/dist/ptcw-design/{p-03a917f8.entry.js → p-02f0460b.entry.js} +1 -1
  184. package/dist/ptcw-design/p-05b950aa.entry.js +1 -0
  185. package/dist/ptcw-design/p-07b1afd5.entry.js +1 -0
  186. package/dist/ptcw-design/{p-a412ff0a.entry.js → p-09def480.entry.js} +1 -1
  187. package/dist/ptcw-design/{p-9e2fd13c.entry.js → p-0a558a22.entry.js} +1 -1
  188. package/dist/ptcw-design/{p-9ac99185.entry.js → p-0abb6e77.entry.js} +1 -1
  189. package/dist/ptcw-design/{p-71360e29.entry.js → p-0b182300.entry.js} +1 -1
  190. package/dist/ptcw-design/{p-e235bf27.entry.js → p-0bb3ea9a.entry.js} +1 -1
  191. package/dist/ptcw-design/{p-c37a3bd2.entry.js → p-0cc79610.entry.js} +1 -1
  192. package/dist/ptcw-design/{p-fb8584e4.entry.js → p-0ed4609e.entry.js} +1 -1
  193. package/dist/ptcw-design/p-11eb4dd1.entry.js +1 -0
  194. package/dist/ptcw-design/{p-04ff81ef.entry.js → p-135191ce.entry.js} +1 -1
  195. package/dist/ptcw-design/{p-99b45d23.entry.js → p-139ca5d2.entry.js} +1 -1
  196. package/dist/ptcw-design/{p-e4000363.entry.js → p-14565e90.entry.js} +1 -1
  197. package/dist/ptcw-design/{p-27e47c25.entry.js → p-14c77b5e.entry.js} +1 -1
  198. package/dist/ptcw-design/{p-7d29a418.entry.js → p-183ba1ca.entry.js} +1 -1
  199. package/dist/ptcw-design/{p-8521fdd4.entry.js → p-1948b914.entry.js} +1 -1
  200. package/dist/ptcw-design/{p-85f32bf5.entry.js → p-1ab6201b.entry.js} +1 -1
  201. package/dist/ptcw-design/{p-99daf693.entry.js → p-1acd3617.entry.js} +1 -1
  202. package/dist/ptcw-design/{p-d3ac3758.entry.js → p-1b2ff400.entry.js} +1 -1
  203. package/dist/ptcw-design/{p-464d8e22.entry.js → p-1d48bad3.entry.js} +1 -1
  204. package/dist/ptcw-design/{p-46f67bec.entry.js → p-1e9f25fc.entry.js} +1 -1
  205. package/dist/ptcw-design/{p-6b32020a.entry.js → p-1ec32cbc.entry.js} +1 -1
  206. package/dist/ptcw-design/p-202b0d92.entry.js +1 -0
  207. package/dist/ptcw-design/{p-bf8fbba7.entry.js → p-208ec7f3.entry.js} +1 -1
  208. package/dist/ptcw-design/p-212cdacd.entry.js +1 -0
  209. package/dist/ptcw-design/{p-8c49d736.entry.js → p-212d0145.entry.js} +1 -1
  210. package/dist/ptcw-design/{p-f9256e3d.entry.js → p-235149b5.entry.js} +1 -1
  211. package/dist/ptcw-design/{p-9b26ea67.entry.js → p-290012e3.entry.js} +1 -1
  212. package/dist/ptcw-design/p-29223a86.entry.js +1 -0
  213. package/dist/ptcw-design/{p-9b0df204.entry.js → p-298d02ab.entry.js} +1 -1
  214. package/dist/ptcw-design/p-29ae44dd.entry.js +1 -0
  215. package/dist/ptcw-design/{p-e90fbbad.entry.js → p-2a3735a5.entry.js} +1 -1
  216. package/dist/ptcw-design/{p-18ac526f.entry.js → p-2ab0f25c.entry.js} +1 -1
  217. package/dist/ptcw-design/{p-eddadb5a.entry.js → p-2db8ed95.entry.js} +1 -1
  218. package/dist/ptcw-design/{p-21fa5abe.entry.js → p-2fd01953.entry.js} +1 -1
  219. package/dist/ptcw-design/p-36c42aae.entry.js +1 -0
  220. package/dist/ptcw-design/p-3717a6e1.entry.js +1 -0
  221. package/dist/ptcw-design/{p-dc8c0a06.entry.js → p-37899461.entry.js} +1 -1
  222. package/dist/ptcw-design/{p-6e8ed2ee.entry.js → p-379fcc72.entry.js} +1 -1
  223. package/dist/ptcw-design/p-39255f59.entry.js +1 -0
  224. package/dist/ptcw-design/p-39ec04d4.entry.js +1 -0
  225. package/dist/ptcw-design/{p-cfa6996d.entry.js → p-3a50e95a.entry.js} +1 -1
  226. package/dist/ptcw-design/p-3ae14b03.entry.js +1 -0
  227. package/dist/ptcw-design/{p-867a808f.entry.js → p-3b6c2a79.entry.js} +1 -1
  228. package/dist/ptcw-design/{p-f61a3476.entry.js → p-3b967df1.entry.js} +1 -1
  229. package/dist/ptcw-design/{p-8533988f.entry.js → p-3c52fabe.entry.js} +1 -1
  230. package/dist/ptcw-design/{p-58e91cb8.entry.js → p-3c72e82d.entry.js} +1 -1
  231. package/dist/ptcw-design/{p-76d98c5a.entry.js → p-3e13b735.entry.js} +1 -1
  232. package/dist/ptcw-design/{p-fe907670.entry.js → p-4335d7f3.entry.js} +1 -1
  233. package/dist/ptcw-design/{p-c6a0dd99.entry.js → p-43756439.entry.js} +1 -1
  234. package/dist/ptcw-design/{p-9f194554.entry.js → p-483e20af.entry.js} +1 -1
  235. package/dist/ptcw-design/{p-ee534211.entry.js → p-4b23b4c3.entry.js} +1 -1
  236. package/dist/ptcw-design/{p-73a853fc.entry.js → p-4ee29b78.entry.js} +1 -1
  237. package/dist/ptcw-design/{p-d2f37084.entry.js → p-4f523245.entry.js} +1 -1
  238. package/dist/ptcw-design/{p-1ca8a5bf.entry.js → p-520542e2.entry.js} +1 -1
  239. package/dist/ptcw-design/{p-51a45b13.entry.js → p-53d15f85.entry.js} +1 -1
  240. package/dist/ptcw-design/p-53d88f2b.entry.js +1 -0
  241. package/dist/ptcw-design/{p-d9abe7e8.entry.js → p-5429a6c0.entry.js} +1 -1
  242. package/dist/ptcw-design/{p-2c2f895a.entry.js → p-54891548.entry.js} +1 -1
  243. package/dist/ptcw-design/p-57b28b2b.entry.js +1 -0
  244. package/dist/ptcw-design/{p-f731fc96.entry.js → p-5da98805.entry.js} +1 -1
  245. package/dist/ptcw-design/{p-61d28206.entry.js → p-5fb671ee.entry.js} +1 -1
  246. package/dist/ptcw-design/{p-808ec62a.entry.js → p-610b5620.entry.js} +1 -1
  247. package/dist/ptcw-design/{p-c631608f.entry.js → p-61a5012d.entry.js} +1 -1
  248. package/dist/ptcw-design/{p-acdd9a1d.entry.js → p-647dee4f.entry.js} +1 -1
  249. package/dist/ptcw-design/p-67a32576.entry.js +1 -0
  250. package/dist/ptcw-design/{p-1b257420.entry.js → p-685f2375.entry.js} +1 -1
  251. package/dist/ptcw-design/{p-593b8eff.entry.js → p-69ef15d4.entry.js} +1 -1
  252. package/dist/ptcw-design/{p-7a9611b4.entry.js → p-6a561285.entry.js} +1 -1
  253. package/dist/ptcw-design/{p-4d8f6f46.entry.js → p-6b7d2579.entry.js} +1 -1
  254. package/dist/ptcw-design/{p-38b782e8.entry.js → p-6d0f7580.entry.js} +1 -1
  255. package/dist/ptcw-design/{p-9de963f8.entry.js → p-6d628113.entry.js} +1 -1
  256. package/dist/ptcw-design/{p-b209c116.entry.js → p-6f8858c3.entry.js} +1 -1
  257. package/dist/ptcw-design/p-72681e91.entry.js +1 -0
  258. package/dist/ptcw-design/{p-8e8c7a3a.entry.js → p-73e5243f.entry.js} +1 -1
  259. package/dist/ptcw-design/{p-04aae3f5.entry.js → p-74a845fd.entry.js} +1 -1
  260. package/dist/ptcw-design/{p-bee09dd0.entry.js → p-753dff04.entry.js} +1 -1
  261. package/dist/ptcw-design/{p-d74ccb19.entry.js → p-75d8b6ec.entry.js} +1 -1
  262. package/dist/ptcw-design/{p-99ee8a0e.entry.js → p-761f71c4.entry.js} +1 -1
  263. package/dist/ptcw-design/{p-8038bf31.entry.js → p-779c3f21.entry.js} +1 -1
  264. package/dist/ptcw-design/{p-8872161f.js → p-77b1221e.js} +1 -1
  265. package/dist/ptcw-design/{p-282b7d4e.entry.js → p-78252282.entry.js} +1 -1
  266. package/dist/ptcw-design/{p-3738a01f.entry.js → p-794eebdb.entry.js} +1 -1
  267. package/dist/ptcw-design/{p-b436f56d.entry.js → p-79762cf6.entry.js} +1 -1
  268. package/dist/ptcw-design/{p-081e969d.entry.js → p-7b75091d.entry.js} +1 -1
  269. package/dist/ptcw-design/{p-4b192f5e.entry.js → p-7e19be10.entry.js} +1 -1
  270. package/dist/ptcw-design/p-7e3985cc.entry.js +1 -0
  271. package/dist/ptcw-design/{p-3c3a7b54.entry.js → p-7edef9ed.entry.js} +1 -1
  272. package/dist/ptcw-design/{p-7cc9255e.entry.js → p-7fada7ae.entry.js} +1 -1
  273. package/dist/ptcw-design/{p-5980d65d.entry.js → p-807ad5c4.entry.js} +1 -1
  274. package/dist/ptcw-design/{p-931650bb.entry.js → p-80c56c81.entry.js} +1 -1
  275. package/dist/ptcw-design/p-815a1a62.entry.js +1 -0
  276. package/dist/ptcw-design/{p-da82dc93.entry.js → p-81700a7e.entry.js} +1 -1
  277. package/dist/ptcw-design/{p-48815ee0.entry.js → p-88379d69.entry.js} +1 -1
  278. package/dist/ptcw-design/p-88ff7bc5.entry.js +1 -0
  279. package/dist/ptcw-design/{p-e3f8e5d5.entry.js → p-8b37d3ac.entry.js} +1 -1
  280. package/dist/ptcw-design/{p-9a335b5b.entry.js → p-8eb36507.entry.js} +1 -1
  281. package/dist/ptcw-design/{p-ac75c7ad.js → p-944c5be8.js} +1 -1
  282. package/dist/ptcw-design/p-973b06d1.entry.js +1 -0
  283. package/dist/ptcw-design/p-99e41dc4.entry.js +1 -0
  284. package/dist/ptcw-design/{p-bfacfe67.entry.js → p-9a28ded2.entry.js} +1 -1
  285. package/dist/ptcw-design/p-9ae901e2.entry.js +1 -0
  286. package/dist/ptcw-design/{p-c95f423e.entry.js → p-9b354870.entry.js} +1 -1
  287. package/dist/ptcw-design/{p-5db7f70b.entry.js → p-9d32f1bc.entry.js} +1 -1
  288. package/dist/ptcw-design/p-9d8a9a72.entry.js +1 -0
  289. package/dist/ptcw-design/{p-3ee2a531.entry.js → p-9dde477c.entry.js} +1 -1
  290. package/dist/ptcw-design/{p-257a68df.entry.js → p-a22d7ae8.entry.js} +1 -1
  291. package/dist/ptcw-design/{p-3872fce7.entry.js → p-a2710bbf.entry.js} +1 -1
  292. package/dist/ptcw-design/{p-8191928d.entry.js → p-a974f98f.entry.js} +1 -1
  293. package/dist/ptcw-design/{p-d20cf3c5.entry.js → p-aaf8fb04.entry.js} +1 -1
  294. package/dist/ptcw-design/{p-a25578e9.entry.js → p-ac78409e.entry.js} +1 -1
  295. package/dist/ptcw-design/{p-00e21489.entry.js → p-ad4f4f33.entry.js} +1 -1
  296. package/dist/ptcw-design/{p-dc85c302.entry.js → p-afbe8e2c.entry.js} +1 -1
  297. package/dist/ptcw-design/{p-aea09a70.entry.js → p-b293a0b1.entry.js} +1 -1
  298. package/dist/ptcw-design/{p-ad821a01.entry.js → p-b29e43cf.entry.js} +1 -1
  299. package/dist/ptcw-design/{p-0e5932f0.entry.js → p-b3b63f67.entry.js} +1 -1
  300. package/dist/ptcw-design/{p-e0b873d0.entry.js → p-b4015d90.entry.js} +1 -1
  301. package/dist/ptcw-design/p-b4f05597.entry.js +1 -0
  302. package/dist/ptcw-design/{p-a7cb3851.entry.js → p-be00fb74.entry.js} +1 -1
  303. package/dist/ptcw-design/{p-89ba3dfd.entry.js → p-bf2f9183.entry.js} +1 -1
  304. package/dist/ptcw-design/{p-dbbe35bf.entry.js → p-bf439f9b.entry.js} +1 -1
  305. package/dist/ptcw-design/{p-38a56ed6.entry.js → p-c05e326f.entry.js} +1 -1
  306. package/dist/ptcw-design/{p-ffb0ff97.entry.js → p-c415ab42.entry.js} +1 -1
  307. package/dist/ptcw-design/{p-aac082cf.entry.js → p-c5417010.entry.js} +1 -1
  308. package/dist/ptcw-design/{p-97b9f41b.entry.js → p-c5886b7b.entry.js} +1 -1
  309. package/dist/ptcw-design/{p-04f0b1ba.entry.js → p-c9a73ad1.entry.js} +1 -1
  310. package/dist/ptcw-design/{p-5946d7c9.entry.js → p-cab0274c.entry.js} +1 -1
  311. package/dist/ptcw-design/p-cadbf4a0.entry.js +1 -0
  312. package/dist/ptcw-design/{p-6d3326da.entry.js → p-cbc6661e.entry.js} +1 -1
  313. package/dist/ptcw-design/{p-1a6759a4.entry.js → p-d113403b.entry.js} +1 -1
  314. package/dist/ptcw-design/{p-e3bf092e.entry.js → p-d1f57070.entry.js} +1 -1
  315. package/dist/ptcw-design/{p-72825cf6.entry.js → p-d21cf742.entry.js} +1 -1
  316. package/dist/ptcw-design/{p-260ecfef.entry.js → p-d9ec506c.entry.js} +1 -1
  317. package/dist/ptcw-design/{p-a0bf3dd2.entry.js → p-dadbab48.entry.js} +1 -1
  318. package/dist/ptcw-design/{p-c5f42895.entry.js → p-dd38bf84.entry.js} +1 -1
  319. package/dist/ptcw-design/{p-a37c5209.entry.js → p-e2e33ddb.entry.js} +1 -1
  320. package/dist/ptcw-design/{p-a791c53a.entry.js → p-e6cb2dce.entry.js} +1 -1
  321. package/dist/ptcw-design/{p-fdee2cdc.entry.js → p-e6ebc832.entry.js} +1 -1
  322. package/dist/ptcw-design/{p-89177041.entry.js → p-e75dff95.entry.js} +1 -1
  323. package/dist/ptcw-design/{p-95187918.entry.js → p-e77d2204.entry.js} +1 -1
  324. package/dist/ptcw-design/{p-c68d31c6.entry.js → p-e87a4ff8.entry.js} +1 -1
  325. package/dist/ptcw-design/{p-0a9ee6c2.entry.js → p-e8b51e7d.entry.js} +1 -1
  326. package/dist/ptcw-design/{p-a5c2584e.entry.js → p-eafe37b0.entry.js} +1 -1
  327. package/dist/ptcw-design/p-ec22d0b8.entry.js +1 -0
  328. package/dist/ptcw-design/{p-7a1db471.entry.js → p-ecfc8211.entry.js} +1 -1
  329. package/dist/ptcw-design/{p-a58698ca.entry.js → p-edcad0f1.entry.js} +1 -1
  330. package/dist/ptcw-design/{p-27a4ee73.entry.js → p-eef5d58b.entry.js} +1 -1
  331. package/dist/ptcw-design/{p-da02913d.entry.js → p-f05be87f.entry.js} +1 -1
  332. package/dist/ptcw-design/{p-2b32297b.entry.js → p-f093f6f8.entry.js} +1 -1
  333. package/dist/ptcw-design/{p-15758793.entry.js → p-f31e17d9.entry.js} +1 -1
  334. package/dist/ptcw-design/{p-4f93c631.entry.js → p-f77c7c78.entry.js} +1 -1
  335. package/dist/ptcw-design/p-f983f6cc.entry.js +1 -0
  336. package/dist/ptcw-design/p-fd5b7db1.entry.js +1 -0
  337. package/dist/ptcw-design/p-ff0910d6.entry.js +11 -0
  338. package/dist/ptcw-design/p-ffd5c822.entry.js +1 -0
  339. package/dist/ptcw-design/ptcw-design.css +1 -1
  340. package/dist/ptcw-design/ptcw-design.esm.js +1 -1
  341. package/package.json +1 -1
  342. package/readme.md +1 -1
  343. package/dist/cjs/event-jumbotron-example_15.cjs.entry.js +0 -3012
  344. package/dist/cjs/ptc-card-bottom.cjs.entry.js +0 -67
  345. package/dist/cjs/ptc-nav-link.cjs.entry.js +0 -48
  346. package/dist/cjs/ptc-nav-slider.cjs.entry.js +0 -106
  347. package/dist/cjs/ptc-nav-submenu.cjs.entry.js +0 -51
  348. package/dist/cjs/ptc-sticky-section.cjs.entry.js +0 -70
  349. package/dist/cjs/ptc-subnav.cjs.entry.js +0 -37
  350. package/dist/esm/event-jumbotron-example_15.entry.js +0 -2994
  351. package/dist/esm/ptc-card-bottom.entry.js +0 -63
  352. package/dist/esm/ptc-nav-link.entry.js +0 -44
  353. package/dist/esm/ptc-nav-slider.entry.js +0 -102
  354. package/dist/esm/ptc-nav-submenu.entry.js +0 -47
  355. package/dist/esm/ptc-sticky-section.entry.js +0 -66
  356. package/dist/esm/ptc-subnav.entry.js +0 -33
  357. package/dist/ptcw-design/p-0a214a22.entry.js +0 -1
  358. package/dist/ptcw-design/p-2c6fc745.entry.js +0 -1
  359. package/dist/ptcw-design/p-36007a57.entry.js +0 -1
  360. package/dist/ptcw-design/p-3ddb6c50.entry.js +0 -1
  361. package/dist/ptcw-design/p-4a7505ba.entry.js +0 -1
  362. package/dist/ptcw-design/p-4cee12b8.entry.js +0 -1
  363. package/dist/ptcw-design/p-6e921844.entry.js +0 -11
  364. package/dist/ptcw-design/p-77cad16c.entry.js +0 -1
  365. package/dist/ptcw-design/p-8c692bd6.entry.js +0 -1
  366. package/dist/ptcw-design/p-97eb1025.entry.js +0 -1
  367. package/dist/ptcw-design/p-9d3a7f36.entry.js +0 -1
  368. package/dist/ptcw-design/p-9df7489b.entry.js +0 -1
  369. package/dist/ptcw-design/p-9fe0c27d.entry.js +0 -1
  370. package/dist/ptcw-design/p-a4f65d28.entry.js +0 -1
  371. package/dist/ptcw-design/p-a54c6da5.entry.js +0 -1
  372. package/dist/ptcw-design/p-ae970a60.entry.js +0 -1
  373. package/dist/ptcw-design/p-b50f71dd.entry.js +0 -1
  374. package/dist/ptcw-design/p-c66b8926.entry.js +0 -1
  375. package/dist/ptcw-design/p-c89030e4.entry.js +0 -1
  376. package/dist/ptcw-design/p-d10cb999.entry.js +0 -1
  377. package/dist/ptcw-design/p-d2cc0297.entry.js +0 -1
  378. package/dist/ptcw-design/p-f5c97ab2.entry.js +0 -1
  379. package/dist/ptcw-design/p-fd7e5935.entry.js +0 -1
@@ -0,0 +1,1750 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-63ddc79c.js');
6
+
7
+ /*!
8
+ * tabbable 6.2.0
9
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
10
+ */
11
+ // NOTE: separate `:not()` selectors has broader browser support than the newer
12
+ // `:not([inert], [inert] *)` (Feb 2023)
13
+ // CAREFUL: JSDom does not support `:not([inert] *)` as a selector; using it causes
14
+ // the entire query to fail, resulting in no nodes found, which will break a lot
15
+ // of things... so we have to rely on JS to identify nodes inside an inert container
16
+ var candidateSelectors = ['input:not([inert])', 'select:not([inert])', 'textarea:not([inert])', 'a[href]:not([inert])', 'button:not([inert])', '[tabindex]:not(slot):not([inert])', 'audio[controls]:not([inert])', 'video[controls]:not([inert])', '[contenteditable]:not([contenteditable="false"]):not([inert])', 'details>summary:first-of-type:not([inert])', 'details:not([inert])'];
17
+ var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
18
+ var NoElement = typeof Element === 'undefined';
19
+ var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
20
+ var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
21
+ var _element$getRootNode;
22
+ return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);
23
+ } : function (element) {
24
+ return element === null || element === void 0 ? void 0 : element.ownerDocument;
25
+ };
26
+
27
+ /**
28
+ * Determines if a node is inert or in an inert ancestor.
29
+ * @param {Element} [node]
30
+ * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to
31
+ * see if any of them are inert. If false, only `node` itself is considered.
32
+ * @returns {boolean} True if inert itself or by way of being in an inert ancestor.
33
+ * False if `node` is falsy.
34
+ */
35
+ var isInert = function isInert(node, lookUp) {
36
+ var _node$getAttribute;
37
+ if (lookUp === void 0) {
38
+ lookUp = true;
39
+ }
40
+ // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`
41
+ // JS API property; we have to check the attribute, which can either be empty or 'true';
42
+ // if it's `null` (not specified) or 'false', it's an active element
43
+ var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');
44
+ var inert = inertAtt === '' || inertAtt === 'true';
45
+
46
+ // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`
47
+ // if it weren't for `matches()` not being a function on shadow roots; the following
48
+ // code works for any kind of node
49
+ // CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)`
50
+ // so it likely would not support `:is([inert] *)` either...
51
+ var result = inert || lookUp && node && isInert(node.parentNode); // recursive
52
+
53
+ return result;
54
+ };
55
+
56
+ /**
57
+ * Determines if a node's content is editable.
58
+ * @param {Element} [node]
59
+ * @returns True if it's content-editable; false if it's not or `node` is falsy.
60
+ */
61
+ var isContentEditable = function isContentEditable(node) {
62
+ var _node$getAttribute2;
63
+ // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have
64
+ // to use the attribute directly to check for this, which can either be empty or 'true';
65
+ // if it's `null` (not specified) or 'false', it's a non-editable element
66
+ var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');
67
+ return attValue === '' || attValue === 'true';
68
+ };
69
+
70
+ /**
71
+ * @param {Element} el container to check in
72
+ * @param {boolean} includeContainer add container to check
73
+ * @param {(node: Element) => boolean} filter filter candidates
74
+ * @returns {Element[]}
75
+ */
76
+ var getCandidates = function getCandidates(el, includeContainer, filter) {
77
+ // even if `includeContainer=false`, we still have to check it for inertness because
78
+ // if it's inert, all its children are inert
79
+ if (isInert(el)) {
80
+ return [];
81
+ }
82
+ var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
83
+ if (includeContainer && matches.call(el, candidateSelector)) {
84
+ candidates.unshift(el);
85
+ }
86
+ candidates = candidates.filter(filter);
87
+ return candidates;
88
+ };
89
+
90
+ /**
91
+ * @callback GetShadowRoot
92
+ * @param {Element} element to check for shadow root
93
+ * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
94
+ */
95
+
96
+ /**
97
+ * @callback ShadowRootFilter
98
+ * @param {Element} shadowHostNode the element which contains shadow content
99
+ * @returns {boolean} true if a shadow root could potentially contain valid candidates.
100
+ */
101
+
102
+ /**
103
+ * @typedef {Object} CandidateScope
104
+ * @property {Element} scopeParent contains inner candidates
105
+ * @property {Element[]} candidates list of candidates found in the scope parent
106
+ */
107
+
108
+ /**
109
+ * @typedef {Object} IterativeOptions
110
+ * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
111
+ * if a function, implies shadow support is enabled and either returns the shadow root of an element
112
+ * or a boolean stating if it has an undisclosed shadow root
113
+ * @property {(node: Element) => boolean} filter filter candidates
114
+ * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list
115
+ * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;
116
+ */
117
+
118
+ /**
119
+ * @param {Element[]} elements list of element containers to match candidates from
120
+ * @param {boolean} includeContainer add container list to check
121
+ * @param {IterativeOptions} options
122
+ * @returns {Array.<Element|CandidateScope>}
123
+ */
124
+ var getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
125
+ var candidates = [];
126
+ var elementsToCheck = Array.from(elements);
127
+ while (elementsToCheck.length) {
128
+ var element = elementsToCheck.shift();
129
+ if (isInert(element, false)) {
130
+ // no need to look up since we're drilling down
131
+ // anything inside this container will also be inert
132
+ continue;
133
+ }
134
+ if (element.tagName === 'SLOT') {
135
+ // add shadow dom slot scope (slot itself cannot be focusable)
136
+ var assigned = element.assignedElements();
137
+ var content = assigned.length ? assigned : element.children;
138
+ var nestedCandidates = getCandidatesIteratively(content, true, options);
139
+ if (options.flatten) {
140
+ candidates.push.apply(candidates, nestedCandidates);
141
+ } else {
142
+ candidates.push({
143
+ scopeParent: element,
144
+ candidates: nestedCandidates
145
+ });
146
+ }
147
+ } else {
148
+ // check candidate element
149
+ var validCandidate = matches.call(element, candidateSelector);
150
+ if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
151
+ candidates.push(element);
152
+ }
153
+
154
+ // iterate over shadow content if possible
155
+ var shadowRoot = element.shadowRoot ||
156
+ // check for an undisclosed shadow
157
+ typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);
158
+
159
+ // no inert look up because we're already drilling down and checking for inertness
160
+ // on the way down, so all containers to this root node should have already been
161
+ // vetted as non-inert
162
+ var validShadowRoot = !isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
163
+ if (shadowRoot && validShadowRoot) {
164
+ // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
165
+ // shadow exists, so look at light dom children as fallback BUT create a scope for any
166
+ // child candidates found because they're likely slotted elements (elements that are
167
+ // children of the web component element (which has the shadow), in the light dom, but
168
+ // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
169
+ // _after_ we return from this recursive call
170
+ var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
171
+ if (options.flatten) {
172
+ candidates.push.apply(candidates, _nestedCandidates);
173
+ } else {
174
+ candidates.push({
175
+ scopeParent: element,
176
+ candidates: _nestedCandidates
177
+ });
178
+ }
179
+ } else {
180
+ // there's not shadow so just dig into the element's (light dom) children
181
+ // __without__ giving the element special scope treatment
182
+ elementsToCheck.unshift.apply(elementsToCheck, element.children);
183
+ }
184
+ }
185
+ }
186
+ return candidates;
187
+ };
188
+
189
+ /**
190
+ * @private
191
+ * Determines if the node has an explicitly specified `tabindex` attribute.
192
+ * @param {HTMLElement} node
193
+ * @returns {boolean} True if so; false if not.
194
+ */
195
+ var hasTabIndex = function hasTabIndex(node) {
196
+ return !isNaN(parseInt(node.getAttribute('tabindex'), 10));
197
+ };
198
+
199
+ /**
200
+ * Determine the tab index of a given node.
201
+ * @param {HTMLElement} node
202
+ * @returns {number} Tab order (negative, 0, or positive number).
203
+ * @throws {Error} If `node` is falsy.
204
+ */
205
+ var getTabIndex = function getTabIndex(node) {
206
+ if (!node) {
207
+ throw new Error('No node provided');
208
+ }
209
+ if (node.tabIndex < 0) {
210
+ // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
211
+ // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
212
+ // yet they are still part of the regular tab order; in FF, they get a default
213
+ // `tabIndex` of 0; since Chrome still puts those elements in the regular tab
214
+ // order, consider their tab index to be 0.
215
+ // Also browsers do not return `tabIndex` correctly for contentEditable nodes;
216
+ // so if they don't have a tabindex attribute specifically set, assume it's 0.
217
+ if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
218
+ return 0;
219
+ }
220
+ }
221
+ return node.tabIndex;
222
+ };
223
+
224
+ /**
225
+ * Determine the tab index of a given node __for sort order purposes__.
226
+ * @param {HTMLElement} node
227
+ * @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,
228
+ * has tabIndex -1, but needs to be sorted by document order in order for its content to be
229
+ * inserted into the correct sort position.
230
+ * @returns {number} Tab order (negative, 0, or positive number).
231
+ */
232
+ var getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {
233
+ var tabIndex = getTabIndex(node);
234
+ if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
235
+ return 0;
236
+ }
237
+ return tabIndex;
238
+ };
239
+ var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
240
+ return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
241
+ };
242
+ var isInput = function isInput(node) {
243
+ return node.tagName === 'INPUT';
244
+ };
245
+ var isHiddenInput = function isHiddenInput(node) {
246
+ return isInput(node) && node.type === 'hidden';
247
+ };
248
+ var isDetailsWithSummary = function isDetailsWithSummary(node) {
249
+ var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
250
+ return child.tagName === 'SUMMARY';
251
+ });
252
+ return r;
253
+ };
254
+ var getCheckedRadio = function getCheckedRadio(nodes, form) {
255
+ for (var i = 0; i < nodes.length; i++) {
256
+ if (nodes[i].checked && nodes[i].form === form) {
257
+ return nodes[i];
258
+ }
259
+ }
260
+ };
261
+ var isTabbableRadio = function isTabbableRadio(node) {
262
+ if (!node.name) {
263
+ return true;
264
+ }
265
+ var radioScope = node.form || getRootNode(node);
266
+ var queryRadios = function queryRadios(name) {
267
+ return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
268
+ };
269
+ var radioSet;
270
+ if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
271
+ radioSet = queryRadios(window.CSS.escape(node.name));
272
+ } else {
273
+ try {
274
+ radioSet = queryRadios(node.name);
275
+ } catch (err) {
276
+ // eslint-disable-next-line no-console
277
+ console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);
278
+ return false;
279
+ }
280
+ }
281
+ var checked = getCheckedRadio(radioSet, node.form);
282
+ return !checked || checked === node;
283
+ };
284
+ var isRadio = function isRadio(node) {
285
+ return isInput(node) && node.type === 'radio';
286
+ };
287
+ var isNonTabbableRadio = function isNonTabbableRadio(node) {
288
+ return isRadio(node) && !isTabbableRadio(node);
289
+ };
290
+
291
+ // determines if a node is ultimately attached to the window's document
292
+ var isNodeAttached = function isNodeAttached(node) {
293
+ var _nodeRoot;
294
+ // The root node is the shadow root if the node is in a shadow DOM; some document otherwise
295
+ // (but NOT _the_ document; see second 'If' comment below for more).
296
+ // If rootNode is shadow root, it'll have a host, which is the element to which the shadow
297
+ // is attached, and the one we need to check if it's in the document or not (because the
298
+ // shadow, and all nodes it contains, is never considered in the document since shadows
299
+ // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,
300
+ // is hidden, or is not in the document itself but is detached, it will affect the shadow's
301
+ // visibility, including all the nodes it contains). The host could be any normal node,
302
+ // or a custom element (i.e. web component). Either way, that's the one that is considered
303
+ // part of the document, not the shadow root, nor any of its children (i.e. the node being
304
+ // tested).
305
+ // To further complicate things, we have to look all the way up until we find a shadow HOST
306
+ // that is attached (or find none) because the node might be in nested shadows...
307
+ // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the
308
+ // document (per the docs) and while it's a Document-type object, that document does not
309
+ // appear to be the same as the node's `ownerDocument` for some reason, so it's safer
310
+ // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,
311
+ // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when
312
+ // node is actually detached.
313
+ // NOTE: If `nodeRootHost` or `node` happens to be the `document` itself (which is possible
314
+ // if a tabbable/focusable node was quickly added to the DOM, focused, and then removed
315
+ // from the DOM as in https://github.com/focus-trap/focus-trap-react/issues/905), then
316
+ // `ownerDocument` will be `null`, hence the optional chaining on it.
317
+ var nodeRoot = node && getRootNode(node);
318
+ var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;
319
+
320
+ // in some cases, a detached node will return itself as the root instead of a document or
321
+ // shadow root object, in which case, we shouldn't try to look further up the host chain
322
+ var attached = false;
323
+ if (nodeRoot && nodeRoot !== node) {
324
+ var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;
325
+ attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));
326
+ while (!attached && nodeRootHost) {
327
+ var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;
328
+ // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,
329
+ // which means we need to get the host's host and check if that parent host is contained
330
+ // in (i.e. attached to) the document
331
+ nodeRoot = getRootNode(nodeRootHost);
332
+ nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;
333
+ attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));
334
+ }
335
+ }
336
+ return attached;
337
+ };
338
+ var isZeroArea = function isZeroArea(node) {
339
+ var _node$getBoundingClie = node.getBoundingClientRect(),
340
+ width = _node$getBoundingClie.width,
341
+ height = _node$getBoundingClie.height;
342
+ return width === 0 && height === 0;
343
+ };
344
+ var isHidden = function isHidden(node, _ref) {
345
+ var displayCheck = _ref.displayCheck,
346
+ getShadowRoot = _ref.getShadowRoot;
347
+ // NOTE: visibility will be `undefined` if node is detached from the document
348
+ // (see notes about this further down), which means we will consider it visible
349
+ // (this is legacy behavior from a very long way back)
350
+ // NOTE: we check this regardless of `displayCheck="none"` because this is a
351
+ // _visibility_ check, not a _display_ check
352
+ if (getComputedStyle(node).visibility === 'hidden') {
353
+ return true;
354
+ }
355
+ var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
356
+ var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
357
+ if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
358
+ return true;
359
+ }
360
+ if (!displayCheck || displayCheck === 'full' || displayCheck === 'legacy-full') {
361
+ if (typeof getShadowRoot === 'function') {
362
+ // figure out if we should consider the node to be in an undisclosed shadow and use the
363
+ // 'non-zero-area' fallback
364
+ var originalNode = node;
365
+ while (node) {
366
+ var parentElement = node.parentElement;
367
+ var rootNode = getRootNode(node);
368
+ if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
369
+ ) {
370
+ // node has an undisclosed shadow which means we can only treat it as a black box, so we
371
+ // fall back to a non-zero-area test
372
+ return isZeroArea(node);
373
+ } else if (node.assignedSlot) {
374
+ // iterate up slot
375
+ node = node.assignedSlot;
376
+ } else if (!parentElement && rootNode !== node.ownerDocument) {
377
+ // cross shadow boundary
378
+ node = rootNode.host;
379
+ } else {
380
+ // iterate up normal dom
381
+ node = parentElement;
382
+ }
383
+ }
384
+ node = originalNode;
385
+ }
386
+ // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
387
+ // (i.e. it does not also presume that all nodes might have undisclosed shadows); or
388
+ // it might be a falsy value, which means shadow DOM support is disabled
389
+
390
+ // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)
391
+ // now we can just test to see if it would normally be visible or not, provided it's
392
+ // attached to the main document.
393
+ // NOTE: We must consider case where node is inside a shadow DOM and given directly to
394
+ // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.
395
+
396
+ if (isNodeAttached(node)) {
397
+ // this works wherever the node is: if there's at least one client rect, it's
398
+ // somehow displayed; it also covers the CSS 'display: contents' case where the
399
+ // node itself is hidden in place of its contents; and there's no need to search
400
+ // up the hierarchy either
401
+ return !node.getClientRects().length;
402
+ }
403
+
404
+ // Else, the node isn't attached to the document, which means the `getClientRects()`
405
+ // API will __always__ return zero rects (this can happen, for example, if React
406
+ // is used to render nodes onto a detached tree, as confirmed in this thread:
407
+ // https://github.com/facebook/react/issues/9117#issuecomment-284228870)
408
+ //
409
+ // It also means that even window.getComputedStyle(node).display will return `undefined`
410
+ // because styles are only computed for nodes that are in the document.
411
+ //
412
+ // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable
413
+ // somehow. Though it was never stated officially, anyone who has ever used tabbable
414
+ // APIs on nodes in detached containers has actually implicitly used tabbable in what
415
+ // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck="none"` mode -- essentially
416
+ // considering __everything__ to be visible because of the innability to determine styles.
417
+ //
418
+ // v6.0.0: As of this major release, the default 'full' option __no longer treats detached
419
+ // nodes as visible with the 'none' fallback.__
420
+ if (displayCheck !== 'legacy-full') {
421
+ return true; // hidden
422
+ }
423
+ // else, fallback to 'none' mode and consider the node visible
424
+ } else if (displayCheck === 'non-zero-area') {
425
+ // NOTE: Even though this tests that the node's client rect is non-zero to determine
426
+ // whether it's displayed, and that a detached node will __always__ have a zero-area
427
+ // client rect, we don't special-case for whether the node is attached or not. In
428
+ // this mode, we do want to consider nodes that have a zero area to be hidden at all
429
+ // times, and that includes attached or not.
430
+ return isZeroArea(node);
431
+ }
432
+
433
+ // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume
434
+ // it's visible
435
+ return false;
436
+ };
437
+
438
+ // form fields (nested) inside a disabled fieldset are not focusable/tabbable
439
+ // unless they are in the _first_ <legend> element of the top-most disabled
440
+ // fieldset
441
+ var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
442
+ if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
443
+ var parentNode = node.parentElement;
444
+ // check if `node` is contained in a disabled <fieldset>
445
+ while (parentNode) {
446
+ if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
447
+ // look for the first <legend> among the children of the disabled <fieldset>
448
+ for (var i = 0; i < parentNode.children.length; i++) {
449
+ var child = parentNode.children.item(i);
450
+ // when the first <legend> (in document order) is found
451
+ if (child.tagName === 'LEGEND') {
452
+ // if its parent <fieldset> is not nested in another disabled <fieldset>,
453
+ // return whether `node` is a descendant of its first <legend>
454
+ return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);
455
+ }
456
+ }
457
+ // the disabled <fieldset> containing `node` has no <legend>
458
+ return true;
459
+ }
460
+ parentNode = parentNode.parentElement;
461
+ }
462
+ }
463
+
464
+ // else, node's tabbable/focusable state should not be affected by a fieldset's
465
+ // enabled/disabled state
466
+ return false;
467
+ };
468
+ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
469
+ if (node.disabled ||
470
+ // we must do an inert look up to filter out any elements inside an inert ancestor
471
+ // because we're limited in the type of selectors we can use in JSDom (see related
472
+ // note related to `candidateSelectors`)
473
+ isInert(node) || isHiddenInput(node) || isHidden(node, options) ||
474
+ // For a details element with a summary, the summary element gets the focus
475
+ isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
476
+ return false;
477
+ }
478
+ return true;
479
+ };
480
+ var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
481
+ if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
482
+ return false;
483
+ }
484
+ return true;
485
+ };
486
+ var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {
487
+ var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
488
+ if (isNaN(tabIndex) || tabIndex >= 0) {
489
+ return true;
490
+ }
491
+ // If a custom element has an explicit negative tabindex,
492
+ // browsers will not allow tab targeting said element's children.
493
+ return false;
494
+ };
495
+
496
+ /**
497
+ * @param {Array.<Element|CandidateScope>} candidates
498
+ * @returns Element[]
499
+ */
500
+ var sortByOrder = function sortByOrder(candidates) {
501
+ var regularTabbables = [];
502
+ var orderedTabbables = [];
503
+ candidates.forEach(function (item, i) {
504
+ var isScope = !!item.scopeParent;
505
+ var element = isScope ? item.scopeParent : item;
506
+ var candidateTabindex = getSortOrderTabIndex(element, isScope);
507
+ var elements = isScope ? sortByOrder(item.candidates) : element;
508
+ if (candidateTabindex === 0) {
509
+ isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
510
+ } else {
511
+ orderedTabbables.push({
512
+ documentOrder: i,
513
+ tabIndex: candidateTabindex,
514
+ item: item,
515
+ isScope: isScope,
516
+ content: elements
517
+ });
518
+ }
519
+ });
520
+ return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {
521
+ sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
522
+ return acc;
523
+ }, []).concat(regularTabbables);
524
+ };
525
+ var tabbable = function tabbable(container, options) {
526
+ options = options || {};
527
+ var candidates;
528
+ if (options.getShadowRoot) {
529
+ candidates = getCandidatesIteratively([container], options.includeContainer, {
530
+ filter: isNodeMatchingSelectorTabbable.bind(null, options),
531
+ flatten: false,
532
+ getShadowRoot: options.getShadowRoot,
533
+ shadowRootFilter: isValidShadowRootTabbable
534
+ });
535
+ } else {
536
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
537
+ }
538
+ return sortByOrder(candidates);
539
+ };
540
+ var focusable = function focusable(container, options) {
541
+ options = options || {};
542
+ var candidates;
543
+ if (options.getShadowRoot) {
544
+ candidates = getCandidatesIteratively([container], options.includeContainer, {
545
+ filter: isNodeMatchingSelectorFocusable.bind(null, options),
546
+ flatten: true,
547
+ getShadowRoot: options.getShadowRoot
548
+ });
549
+ } else {
550
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
551
+ }
552
+ return candidates;
553
+ };
554
+ var isTabbable = function isTabbable(node, options) {
555
+ options = options || {};
556
+ if (!node) {
557
+ throw new Error('No node provided');
558
+ }
559
+ if (matches.call(node, candidateSelector) === false) {
560
+ return false;
561
+ }
562
+ return isNodeMatchingSelectorTabbable(options, node);
563
+ };
564
+ var focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');
565
+ var isFocusable = function isFocusable(node, options) {
566
+ options = options || {};
567
+ if (!node) {
568
+ throw new Error('No node provided');
569
+ }
570
+ if (matches.call(node, focusableCandidateSelector) === false) {
571
+ return false;
572
+ }
573
+ return isNodeMatchingSelectorFocusable(options, node);
574
+ };
575
+
576
+ /*!
577
+ * focus-trap 7.6.4
578
+ * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
579
+ */
580
+
581
+ function _arrayLikeToArray(r, a) {
582
+ (null == a || a > r.length) && (a = r.length);
583
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
584
+ return n;
585
+ }
586
+ function _arrayWithoutHoles(r) {
587
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
588
+ }
589
+ function _defineProperty(e, r, t) {
590
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
591
+ value: t,
592
+ enumerable: true,
593
+ configurable: true,
594
+ writable: true
595
+ }) : e[r] = t, e;
596
+ }
597
+ function _iterableToArray(r) {
598
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
599
+ }
600
+ function _nonIterableSpread() {
601
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
602
+ }
603
+ function ownKeys(e, r) {
604
+ var t = Object.keys(e);
605
+ if (Object.getOwnPropertySymbols) {
606
+ var o = Object.getOwnPropertySymbols(e);
607
+ r && (o = o.filter(function (r) {
608
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
609
+ })), t.push.apply(t, o);
610
+ }
611
+ return t;
612
+ }
613
+ function _objectSpread2(e) {
614
+ for (var r = 1; r < arguments.length; r++) {
615
+ var t = null != arguments[r] ? arguments[r] : {};
616
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
617
+ _defineProperty(e, r, t[r]);
618
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
619
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
620
+ });
621
+ }
622
+ return e;
623
+ }
624
+ function _toConsumableArray(r) {
625
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
626
+ }
627
+ function _toPrimitive(t, r) {
628
+ if ("object" != typeof t || !t) return t;
629
+ var e = t[Symbol.toPrimitive];
630
+ if (undefined !== e) {
631
+ var i = e.call(t, r || "default");
632
+ if ("object" != typeof i) return i;
633
+ throw new TypeError("@@toPrimitive must return a primitive value.");
634
+ }
635
+ return ("string" === r ? String : Number)(t);
636
+ }
637
+ function _toPropertyKey(t) {
638
+ var i = _toPrimitive(t, "string");
639
+ return "symbol" == typeof i ? i : i + "";
640
+ }
641
+ function _unsupportedIterableToArray(r, a) {
642
+ if (r) {
643
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
644
+ var t = {}.toString.call(r).slice(8, -1);
645
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : undefined;
646
+ }
647
+ }
648
+
649
+ var activeFocusTraps = {
650
+ activateTrap: function activateTrap(trapStack, trap) {
651
+ if (trapStack.length > 0) {
652
+ var activeTrap = trapStack[trapStack.length - 1];
653
+ if (activeTrap !== trap) {
654
+ activeTrap._setPausedState(true);
655
+ }
656
+ }
657
+ var trapIndex = trapStack.indexOf(trap);
658
+ if (trapIndex === -1) {
659
+ trapStack.push(trap);
660
+ } else {
661
+ // move this existing trap to the front of the queue
662
+ trapStack.splice(trapIndex, 1);
663
+ trapStack.push(trap);
664
+ }
665
+ },
666
+ deactivateTrap: function deactivateTrap(trapStack, trap) {
667
+ var trapIndex = trapStack.indexOf(trap);
668
+ if (trapIndex !== -1) {
669
+ trapStack.splice(trapIndex, 1);
670
+ }
671
+ if (trapStack.length > 0 && !trapStack[trapStack.length - 1]._isManuallyPaused()) {
672
+ trapStack[trapStack.length - 1]._setPausedState(false);
673
+ }
674
+ }
675
+ };
676
+ var isSelectableInput = function isSelectableInput(node) {
677
+ return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
678
+ };
679
+ var isEscapeEvent = function isEscapeEvent(e) {
680
+ return (e === null || e === undefined ? undefined : e.key) === 'Escape' || (e === null || e === undefined ? undefined : e.key) === 'Esc' || (e === null || e === undefined ? undefined : e.keyCode) === 27;
681
+ };
682
+ var isTabEvent = function isTabEvent(e) {
683
+ return (e === null || e === undefined ? undefined : e.key) === 'Tab' || (e === null || e === undefined ? undefined : e.keyCode) === 9;
684
+ };
685
+
686
+ // checks for TAB by default
687
+ var isKeyForward = function isKeyForward(e) {
688
+ return isTabEvent(e) && !e.shiftKey;
689
+ };
690
+
691
+ // checks for SHIFT+TAB by default
692
+ var isKeyBackward = function isKeyBackward(e) {
693
+ return isTabEvent(e) && e.shiftKey;
694
+ };
695
+ var delay = function delay(fn) {
696
+ return setTimeout(fn, 0);
697
+ };
698
+
699
+ /**
700
+ * Get an option's value when it could be a plain value, or a handler that provides
701
+ * the value.
702
+ * @param {*} value Option's value to check.
703
+ * @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.
704
+ * @returns {*} The `value`, or the handler's returned value.
705
+ */
706
+ var valueOrHandler = function valueOrHandler(value) {
707
+ for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
708
+ params[_key - 1] = arguments[_key];
709
+ }
710
+ return typeof value === 'function' ? value.apply(undefined, params) : value;
711
+ };
712
+ var getActualTarget = function getActualTarget(event) {
713
+ // NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
714
+ // shadow host. However, event.target.composedPath() will be an array of
715
+ // nodes "clicked" from inner-most (the actual element inside the shadow) to
716
+ // outer-most (the host HTML document). If we have access to composedPath(),
717
+ // then use its first element; otherwise, fall back to event.target (and
718
+ // this only works for an _open_ shadow DOM; otherwise,
719
+ // composedPath()[0] === event.target always).
720
+ return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;
721
+ };
722
+
723
+ // NOTE: this must be _outside_ `createFocusTrap()` to make sure all traps in this
724
+ // current instance use the same stack if `userOptions.trapStack` isn't specified
725
+ var internalTrapStack = [];
726
+ var createFocusTrap = function createFocusTrap(elements, userOptions) {
727
+ // SSR: a live trap shouldn't be created in this type of environment so this
728
+ // should be safe code to execute if the `document` option isn't specified
729
+ var doc = (userOptions === null || userOptions === undefined ? undefined : userOptions.document) || document;
730
+ var trapStack = (userOptions === null || userOptions === undefined ? undefined : userOptions.trapStack) || internalTrapStack;
731
+ var config = _objectSpread2({
732
+ returnFocusOnDeactivate: true,
733
+ escapeDeactivates: true,
734
+ delayInitialFocus: true,
735
+ isKeyForward: isKeyForward,
736
+ isKeyBackward: isKeyBackward
737
+ }, userOptions);
738
+ var state = {
739
+ // containers given to createFocusTrap()
740
+ // @type {Array<HTMLElement>}
741
+ containers: [],
742
+ // list of objects identifying tabbable nodes in `containers` in the trap
743
+ // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
744
+ // is active, but the trap should never get to a state where there isn't at least one group
745
+ // with at least one tabbable node in it (that would lead to an error condition that would
746
+ // result in an error being thrown)
747
+ // @type {Array<{
748
+ // container: HTMLElement,
749
+ // tabbableNodes: Array<HTMLElement>, // empty if none
750
+ // focusableNodes: Array<HTMLElement>, // empty if none
751
+ // posTabIndexesFound: boolean,
752
+ // firstTabbableNode: HTMLElement|undefined,
753
+ // lastTabbableNode: HTMLElement|undefined,
754
+ // firstDomTabbableNode: HTMLElement|undefined,
755
+ // lastDomTabbableNode: HTMLElement|undefined,
756
+ // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
757
+ // }>}
758
+ containerGroups: [],
759
+ // same order/length as `containers` list
760
+
761
+ // references to objects in `containerGroups`, but only those that actually have
762
+ // tabbable nodes in them
763
+ // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
764
+ // the same length
765
+ tabbableGroups: [],
766
+ nodeFocusedBeforeActivation: null,
767
+ mostRecentlyFocusedNode: null,
768
+ active: false,
769
+ paused: false,
770
+ manuallyPaused: false,
771
+ // timer ID for when delayInitialFocus is true and initial focus in this trap
772
+ // has been delayed during activation
773
+ delayInitialFocusTimer: undefined,
774
+ // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
775
+ recentNavEvent: undefined
776
+ };
777
+ var trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later
778
+
779
+ /**
780
+ * Gets a configuration option value.
781
+ * @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,
782
+ * value will be taken from this object. Otherwise, value will be taken from base configuration.
783
+ * @param {string} optionName Name of the option whose value is sought.
784
+ * @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
785
+ * IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
786
+ */
787
+ var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
788
+ return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
789
+ };
790
+
791
+ /**
792
+ * Finds the index of the container that contains the element.
793
+ * @param {HTMLElement} element
794
+ * @param {Event} [event] If available, and `element` isn't directly found in any container,
795
+ * the event's composed path is used to see if includes any known trap containers in the
796
+ * case where the element is inside a Shadow DOM.
797
+ * @returns {number} Index of the container in either `state.containers` or
798
+ * `state.containerGroups` (the order/length of these lists are the same); -1
799
+ * if the element isn't found.
800
+ */
801
+ var findContainerIndex = function findContainerIndex(element, event) {
802
+ var composedPath = typeof (event === null || event === undefined ? undefined : event.composedPath) === 'function' ? event.composedPath() : undefined;
803
+ // NOTE: search `containerGroups` because it's possible a group contains no tabbable
804
+ // nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
805
+ // and we still need to find the element in there
806
+ return state.containerGroups.findIndex(function (_ref) {
807
+ var container = _ref.container,
808
+ tabbableNodes = _ref.tabbableNodes;
809
+ return container.contains(element) || (// fall back to explicit tabbable search which will take into consideration any
810
+ // web components if the `tabbableOptions.getShadowRoot` option was used for
811
+ // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
812
+ // look inside web components even if open)
813
+ composedPath === null || composedPath === undefined ? undefined : composedPath.includes(container)) || tabbableNodes.find(function (node) {
814
+ return node === element;
815
+ });
816
+ });
817
+ };
818
+
819
+ /**
820
+ * Gets the node for the given option, which is expected to be an option that
821
+ * can be either a DOM node, a string that is a selector to get a node, `false`
822
+ * (if a node is explicitly NOT given), or a function that returns any of these
823
+ * values.
824
+ * @param {string} optionName
825
+ * @param {Object} options
826
+ * @param {boolean} [options.hasFallback] True if the option could be a selector string
827
+ * and the option allows for a fallback scenario in the case where the selector is
828
+ * valid but does not match a node (i.e. the queried node doesn't exist in the DOM).
829
+ * @param {Array} [options.params] Params to pass to the option if it's a function.
830
+ * @returns {undefined | null | false | HTMLElement | SVGElement} Returns
831
+ * `undefined` if the option is not specified; `null` if the option didn't resolve
832
+ * to a node but `options.hasFallback=true`, `false` if the option resolved to `false`
833
+ * (node explicitly not given); otherwise, the resolved DOM node.
834
+ * @throws {Error} If the option is set, not `false`, and is not, or does not
835
+ * resolve to a node, unless the option is a selector string and `options.hasFallback=true`.
836
+ */
837
+ var getNodeForOption = function getNodeForOption(optionName) {
838
+ var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
839
+ _ref2$hasFallback = _ref2.hasFallback,
840
+ hasFallback = _ref2$hasFallback === undefined ? false : _ref2$hasFallback,
841
+ _ref2$params = _ref2.params,
842
+ params = _ref2$params === undefined ? [] : _ref2$params;
843
+ var optionValue = config[optionName];
844
+ if (typeof optionValue === 'function') {
845
+ optionValue = optionValue.apply(undefined, _toConsumableArray(params));
846
+ }
847
+ if (optionValue === true) {
848
+ optionValue = undefined; // use default value
849
+ }
850
+ if (!optionValue) {
851
+ if (optionValue === undefined || optionValue === false) {
852
+ return optionValue;
853
+ }
854
+ // else, empty string (invalid), null (invalid), 0 (invalid)
855
+
856
+ throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
857
+ }
858
+ var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
859
+
860
+ if (typeof optionValue === 'string') {
861
+ try {
862
+ node = doc.querySelector(optionValue); // resolve to node, or null if fails
863
+ } catch (err) {
864
+ throw new Error("`".concat(optionName, "` appears to be an invalid selector; error=\"").concat(err.message, "\""));
865
+ }
866
+ if (!node) {
867
+ if (!hasFallback) {
868
+ throw new Error("`".concat(optionName, "` as selector refers to no known node"));
869
+ }
870
+ // else, `node` MUST be `null` because that's what `Document.querySelector()` returns
871
+ // if the selector is valid but doesn't match anything
872
+ }
873
+ }
874
+ return node;
875
+ };
876
+ var getInitialFocusNode = function getInitialFocusNode() {
877
+ var node = getNodeForOption('initialFocus', {
878
+ hasFallback: true
879
+ });
880
+
881
+ // false explicitly indicates we want no initialFocus at all
882
+ if (node === false) {
883
+ return false;
884
+ }
885
+ if (node === undefined || node && !isFocusable(node, config.tabbableOptions)) {
886
+ // option not specified nor focusable: use fallback options
887
+ if (findContainerIndex(doc.activeElement) >= 0) {
888
+ node = doc.activeElement;
889
+ } else {
890
+ var firstTabbableGroup = state.tabbableGroups[0];
891
+ var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
892
+
893
+ // NOTE: `fallbackFocus` option function cannot return `false` (not supported)
894
+ node = firstTabbableNode || getNodeForOption('fallbackFocus');
895
+ }
896
+ } else if (node === null) {
897
+ // option is a VALID selector string that doesn't yield a node: use the `fallbackFocus`
898
+ // option instead of the default behavior when the option isn't specified at all
899
+ node = getNodeForOption('fallbackFocus');
900
+ }
901
+ if (!node) {
902
+ throw new Error('Your focus-trap needs to have at least one focusable element');
903
+ }
904
+ return node;
905
+ };
906
+ var updateTabbableNodes = function updateTabbableNodes() {
907
+ state.containerGroups = state.containers.map(function (container) {
908
+ var tabbableNodes = tabbable(container, config.tabbableOptions);
909
+
910
+ // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
911
+ // are a superset of tabbable nodes since nodes with negative `tabindex` attributes
912
+ // are focusable but not tabbable
913
+ var focusableNodes = focusable(container, config.tabbableOptions);
914
+ var firstTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[0] : undefined;
915
+ var lastTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : undefined;
916
+ var firstDomTabbableNode = focusableNodes.find(function (node) {
917
+ return isTabbable(node);
918
+ });
919
+ var lastDomTabbableNode = focusableNodes.slice().reverse().find(function (node) {
920
+ return isTabbable(node);
921
+ });
922
+ var posTabIndexesFound = !!tabbableNodes.find(function (node) {
923
+ return getTabIndex(node) > 0;
924
+ });
925
+ return {
926
+ container: container,
927
+ tabbableNodes: tabbableNodes,
928
+ focusableNodes: focusableNodes,
929
+ /** True if at least one node with positive `tabindex` was found in this container. */
930
+ posTabIndexesFound: posTabIndexesFound,
931
+ /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
932
+ firstTabbableNode: firstTabbableNode,
933
+ /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
934
+ lastTabbableNode: lastTabbableNode,
935
+ // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
936
+ // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
937
+ // because that API doesn't work with Shadow DOM as well as it should (@see
938
+ // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
939
+ // to address an edge case related to positive tabindex support, this seems like a much easier,
940
+ // "close enough most of the time" alternative for positive tabindexes which should generally
941
+ // be avoided anyway...
942
+ /** First tabbable node in container, __DOM__ order; `undefined` if none. */
943
+ firstDomTabbableNode: firstDomTabbableNode,
944
+ /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
945
+ lastDomTabbableNode: lastDomTabbableNode,
946
+ /**
947
+ * Finds the __tabbable__ node that follows the given node in the specified direction,
948
+ * in this container, if any.
949
+ * @param {HTMLElement} node
950
+ * @param {boolean} [forward] True if going in forward tab order; false if going
951
+ * in reverse.
952
+ * @returns {HTMLElement|undefined} The next tabbable node, if any.
953
+ */
954
+ nextTabbableNode: function nextTabbableNode(node) {
955
+ var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
956
+ var nodeIdx = tabbableNodes.indexOf(node);
957
+ if (nodeIdx < 0) {
958
+ // either not tabbable nor focusable, or was focused but not tabbable (negative tabindex):
959
+ // since `node` should at least have been focusable, we assume that's the case and mimic
960
+ // what browsers do, which is set focus to the next node in __document position order__,
961
+ // regardless of positive tabindexes, if any -- and for reasons explained in the NOTE
962
+ // above related to `firstDomTabbable` and `lastDomTabbable` properties, we fall back to
963
+ // basic DOM order
964
+ if (forward) {
965
+ return focusableNodes.slice(focusableNodes.indexOf(node) + 1).find(function (el) {
966
+ return isTabbable(el);
967
+ });
968
+ }
969
+ return focusableNodes.slice(0, focusableNodes.indexOf(node)).reverse().find(function (el) {
970
+ return isTabbable(el);
971
+ });
972
+ }
973
+ return tabbableNodes[nodeIdx + (forward ? 1 : -1)];
974
+ }
975
+ };
976
+ });
977
+ state.tabbableGroups = state.containerGroups.filter(function (group) {
978
+ return group.tabbableNodes.length > 0;
979
+ });
980
+
981
+ // throw if no groups have tabbable nodes and we don't have a fallback focus node either
982
+ if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
983
+ ) {
984
+ throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
985
+ }
986
+
987
+ // NOTE: Positive tabindexes are only properly supported in single-container traps because
988
+ // doing it across multiple containers where tabindexes could be all over the place
989
+ // would require Tabbable to support multiple containers, would require additional
990
+ // specialized Shadow DOM support, and would require Tabbable's multi-container support
991
+ // to look at those containers in document position order rather than user-provided
992
+ // order (as they are treated in Focus-trap, for legacy reasons). See discussion on
993
+ // https://github.com/focus-trap/focus-trap/issues/375 for more details.
994
+ if (state.containerGroups.find(function (g) {
995
+ return g.posTabIndexesFound;
996
+ }) && state.containerGroups.length > 1) {
997
+ throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
998
+ }
999
+ };
1000
+
1001
+ /**
1002
+ * Gets the current activeElement. If it's a web-component and has open shadow-root
1003
+ * it will recursively search inside shadow roots for the "true" activeElement.
1004
+ *
1005
+ * @param {Document | ShadowRoot} el
1006
+ *
1007
+ * @returns {HTMLElement} The element that currently has the focus
1008
+ **/
1009
+ var _getActiveElement = function getActiveElement(el) {
1010
+ var activeElement = el.activeElement;
1011
+ if (!activeElement) {
1012
+ return;
1013
+ }
1014
+ if (activeElement.shadowRoot && activeElement.shadowRoot.activeElement !== null) {
1015
+ return _getActiveElement(activeElement.shadowRoot);
1016
+ }
1017
+ return activeElement;
1018
+ };
1019
+ var _tryFocus = function tryFocus(node) {
1020
+ if (node === false) {
1021
+ return;
1022
+ }
1023
+ if (node === _getActiveElement(document)) {
1024
+ return;
1025
+ }
1026
+ if (!node || !node.focus) {
1027
+ _tryFocus(getInitialFocusNode());
1028
+ return;
1029
+ }
1030
+ node.focus({
1031
+ preventScroll: !!config.preventScroll
1032
+ });
1033
+ // NOTE: focus() API does not trigger focusIn event so set MRU node manually
1034
+ state.mostRecentlyFocusedNode = node;
1035
+ if (isSelectableInput(node)) {
1036
+ node.select();
1037
+ }
1038
+ };
1039
+ var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {
1040
+ var node = getNodeForOption('setReturnFocus', {
1041
+ params: [previousActiveElement]
1042
+ });
1043
+ return node ? node : node === false ? false : previousActiveElement;
1044
+ };
1045
+
1046
+ /**
1047
+ * Finds the next node (in either direction) where focus should move according to a
1048
+ * keyboard focus-in event.
1049
+ * @param {Object} params
1050
+ * @param {Node} [params.target] Known target __from which__ to navigate, if any.
1051
+ * @param {KeyboardEvent|FocusEvent} [params.event] Event to use if `target` isn't known (event
1052
+ * will be used to determine the `target`). Ignored if `target` is specified.
1053
+ * @param {boolean} [params.isBackward] True if focus should move backward.
1054
+ * @returns {Node|undefined} The next node, or `undefined` if a next node couldn't be
1055
+ * determined given the current state of the trap.
1056
+ */
1057
+ var findNextNavNode = function findNextNavNode(_ref3) {
1058
+ var target = _ref3.target,
1059
+ event = _ref3.event,
1060
+ _ref3$isBackward = _ref3.isBackward,
1061
+ isBackward = _ref3$isBackward === undefined ? false : _ref3$isBackward;
1062
+ target = target || getActualTarget(event);
1063
+ updateTabbableNodes();
1064
+ var destinationNode = null;
1065
+ if (state.tabbableGroups.length > 0) {
1066
+ // make sure the target is actually contained in a group
1067
+ // NOTE: the target may also be the container itself if it's focusable
1068
+ // with tabIndex='-1' and was given initial focus
1069
+ var containerIndex = findContainerIndex(target, event);
1070
+ var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
1071
+ if (containerIndex < 0) {
1072
+ // target not found in any group: quite possible focus has escaped the trap,
1073
+ // so bring it back into...
1074
+ if (isBackward) {
1075
+ // ...the last node in the last group
1076
+ destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
1077
+ } else {
1078
+ // ...the first node in the first group
1079
+ destinationNode = state.tabbableGroups[0].firstTabbableNode;
1080
+ }
1081
+ } else if (isBackward) {
1082
+ // REVERSE
1083
+
1084
+ // is the target the first tabbable node in a group?
1085
+ var startOfGroupIndex = state.tabbableGroups.findIndex(function (_ref4) {
1086
+ var firstTabbableNode = _ref4.firstTabbableNode;
1087
+ return target === firstTabbableNode;
1088
+ });
1089
+ if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
1090
+ // an exception case where the target is either the container itself, or
1091
+ // a non-tabbable node that was given focus (i.e. tabindex is negative
1092
+ // and user clicked on it or node was programmatically given focus)
1093
+ // and is not followed by any other tabbable node, in which
1094
+ // case, we should handle shift+tab as if focus were on the container's
1095
+ // first tabbable node, and go to the last tabbable node of the LAST group
1096
+ startOfGroupIndex = containerIndex;
1097
+ }
1098
+ if (startOfGroupIndex >= 0) {
1099
+ // YES: then shift+tab should go to the last tabbable node in the
1100
+ // previous group (and wrap around to the last tabbable node of
1101
+ // the LAST group if it's the first tabbable node of the FIRST group)
1102
+ var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
1103
+ var destinationGroup = state.tabbableGroups[destinationGroupIndex];
1104
+ destinationNode = getTabIndex(target) >= 0 ? destinationGroup.lastTabbableNode : destinationGroup.lastDomTabbableNode;
1105
+ } else if (!isTabEvent(event)) {
1106
+ // user must have customized the nav keys so we have to move focus manually _within_
1107
+ // the active group: do this based on the order determined by tabbable()
1108
+ destinationNode = containerGroup.nextTabbableNode(target, false);
1109
+ }
1110
+ } else {
1111
+ // FORWARD
1112
+
1113
+ // is the target the last tabbable node in a group?
1114
+ var lastOfGroupIndex = state.tabbableGroups.findIndex(function (_ref5) {
1115
+ var lastTabbableNode = _ref5.lastTabbableNode;
1116
+ return target === lastTabbableNode;
1117
+ });
1118
+ if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
1119
+ // an exception case where the target is the container itself, or
1120
+ // a non-tabbable node that was given focus (i.e. tabindex is negative
1121
+ // and user clicked on it or node was programmatically given focus)
1122
+ // and is not followed by any other tabbable node, in which
1123
+ // case, we should handle tab as if focus were on the container's
1124
+ // last tabbable node, and go to the first tabbable node of the FIRST group
1125
+ lastOfGroupIndex = containerIndex;
1126
+ }
1127
+ if (lastOfGroupIndex >= 0) {
1128
+ // YES: then tab should go to the first tabbable node in the next
1129
+ // group (and wrap around to the first tabbable node of the FIRST
1130
+ // group if it's the last tabbable node of the LAST group)
1131
+ var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
1132
+ var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
1133
+ destinationNode = getTabIndex(target) >= 0 ? _destinationGroup.firstTabbableNode : _destinationGroup.firstDomTabbableNode;
1134
+ } else if (!isTabEvent(event)) {
1135
+ // user must have customized the nav keys so we have to move focus manually _within_
1136
+ // the active group: do this based on the order determined by tabbable()
1137
+ destinationNode = containerGroup.nextTabbableNode(target);
1138
+ }
1139
+ }
1140
+ } else {
1141
+ // no groups available
1142
+ // NOTE: the fallbackFocus option does not support returning false to opt-out
1143
+ destinationNode = getNodeForOption('fallbackFocus');
1144
+ }
1145
+ return destinationNode;
1146
+ };
1147
+
1148
+ // This needs to be done on mousedown and touchstart instead of click
1149
+ // so that it precedes the focus event.
1150
+ var checkPointerDown = function checkPointerDown(e) {
1151
+ var target = getActualTarget(e);
1152
+ if (findContainerIndex(target, e) >= 0) {
1153
+ // allow the click since it ocurred inside the trap
1154
+ return;
1155
+ }
1156
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
1157
+ // immediately deactivate the trap
1158
+ trap.deactivate({
1159
+ // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
1160
+ // which will result in the outside click setting focus to the node
1161
+ // that was clicked (and if not focusable, to "nothing"); by setting
1162
+ // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
1163
+ // on activation (or the configured `setReturnFocus` node), whether the
1164
+ // outside click was on a focusable node or not
1165
+ returnFocus: config.returnFocusOnDeactivate
1166
+ });
1167
+ return;
1168
+ }
1169
+
1170
+ // This is needed for mobile devices.
1171
+ // (If we'll only let `click` events through,
1172
+ // then on mobile they will be blocked anyways if `touchstart` is blocked.)
1173
+ if (valueOrHandler(config.allowOutsideClick, e)) {
1174
+ // allow the click outside the trap to take place
1175
+ return;
1176
+ }
1177
+
1178
+ // otherwise, prevent the click
1179
+ e.preventDefault();
1180
+ };
1181
+
1182
+ // In case focus escapes the trap for some strange reason, pull it back in.
1183
+ // NOTE: the focusIn event is NOT cancelable, so if focus escapes, it may cause unexpected
1184
+ // scrolling if the node that got focused was out of view; there's nothing we can do to
1185
+ // prevent that from happening by the time we discover that focus escaped
1186
+ var checkFocusIn = function checkFocusIn(event) {
1187
+ var target = getActualTarget(event);
1188
+ var targetContained = findContainerIndex(target, event) >= 0;
1189
+
1190
+ // In Firefox when you Tab out of an iframe the Document is briefly focused.
1191
+ if (targetContained || target instanceof Document) {
1192
+ if (targetContained) {
1193
+ state.mostRecentlyFocusedNode = target;
1194
+ }
1195
+ } else {
1196
+ // escaped! pull it back in to where it just left
1197
+ event.stopImmediatePropagation();
1198
+
1199
+ // focus will escape if the MRU node had a positive tab index and user tried to nav forward;
1200
+ // it will also escape if the MRU node had a 0 tab index and user tried to nav backward
1201
+ // toward a node with a positive tab index
1202
+ var nextNode; // next node to focus, if we find one
1203
+ var navAcrossContainers = true;
1204
+ if (state.mostRecentlyFocusedNode) {
1205
+ if (getTabIndex(state.mostRecentlyFocusedNode) > 0) {
1206
+ // MRU container index must be >=0 otherwise we wouldn't have it as an MRU node...
1207
+ var mruContainerIdx = findContainerIndex(state.mostRecentlyFocusedNode);
1208
+ // there MAY not be any tabbable nodes in the container if there are at least 2 containers
1209
+ // and the MRU node is focusable but not tabbable (focus-trap requires at least 1 container
1210
+ // with at least one tabbable node in order to function, so this could be the other container
1211
+ // with nothing tabbable in it)
1212
+ var tabbableNodes = state.containerGroups[mruContainerIdx].tabbableNodes;
1213
+ if (tabbableNodes.length > 0) {
1214
+ // MRU tab index MAY not be found if the MRU node is focusable but not tabbable
1215
+ var mruTabIdx = tabbableNodes.findIndex(function (node) {
1216
+ return node === state.mostRecentlyFocusedNode;
1217
+ });
1218
+ if (mruTabIdx >= 0) {
1219
+ if (config.isKeyForward(state.recentNavEvent)) {
1220
+ if (mruTabIdx + 1 < tabbableNodes.length) {
1221
+ nextNode = tabbableNodes[mruTabIdx + 1];
1222
+ navAcrossContainers = false;
1223
+ }
1224
+ // else, don't wrap within the container as focus should move to next/previous
1225
+ // container
1226
+ } else {
1227
+ if (mruTabIdx - 1 >= 0) {
1228
+ nextNode = tabbableNodes[mruTabIdx - 1];
1229
+ navAcrossContainers = false;
1230
+ }
1231
+ // else, don't wrap within the container as focus should move to next/previous
1232
+ // container
1233
+ }
1234
+ // else, don't find in container order without considering direction too
1235
+ }
1236
+ }
1237
+ // else, no tabbable nodes in that container (which means we must have at least one other
1238
+ // container with at least one tabbable node in it, otherwise focus-trap would've thrown
1239
+ // an error the last time updateTabbableNodes() was run): find next node among all known
1240
+ // containers
1241
+ } else {
1242
+ // check to see if there's at least one tabbable node with a positive tab index inside
1243
+ // the trap because focus seems to escape when navigating backward from a tabbable node
1244
+ // with tabindex=0 when this is the case (instead of wrapping to the tabbable node with
1245
+ // the greatest positive tab index like it should)
1246
+ if (!state.containerGroups.some(function (g) {
1247
+ return g.tabbableNodes.some(function (n) {
1248
+ return getTabIndex(n) > 0;
1249
+ });
1250
+ })) {
1251
+ // no containers with tabbable nodes with positive tab indexes which means the focus
1252
+ // escaped for some other reason and we should just execute the fallback to the
1253
+ // MRU node or initial focus node, if any
1254
+ navAcrossContainers = false;
1255
+ }
1256
+ }
1257
+ } else {
1258
+ // no MRU node means we're likely in some initial condition when the trap has just
1259
+ // been activated and initial focus hasn't been given yet, in which case we should
1260
+ // fall through to trying to focus the initial focus node, which is what should
1261
+ // happen below at this point in the logic
1262
+ navAcrossContainers = false;
1263
+ }
1264
+ if (navAcrossContainers) {
1265
+ nextNode = findNextNavNode({
1266
+ // move FROM the MRU node, not event-related node (which will be the node that is
1267
+ // outside the trap causing the focus escape we're trying to fix)
1268
+ target: state.mostRecentlyFocusedNode,
1269
+ isBackward: config.isKeyBackward(state.recentNavEvent)
1270
+ });
1271
+ }
1272
+ if (nextNode) {
1273
+ _tryFocus(nextNode);
1274
+ } else {
1275
+ _tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
1276
+ }
1277
+ }
1278
+ state.recentNavEvent = undefined; // clear
1279
+ };
1280
+
1281
+ // Hijack key nav events on the first and last focusable nodes of the trap,
1282
+ // in order to prevent focus from escaping. If it escapes for even a
1283
+ // moment it can end up scrolling the page and causing confusion so we
1284
+ // kind of need to capture the action at the keydown phase.
1285
+ var checkKeyNav = function checkKeyNav(event) {
1286
+ var isBackward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1287
+ state.recentNavEvent = event;
1288
+ var destinationNode = findNextNavNode({
1289
+ event: event,
1290
+ isBackward: isBackward
1291
+ });
1292
+ if (destinationNode) {
1293
+ if (isTabEvent(event)) {
1294
+ // since tab natively moves focus, we wouldn't have a destination node unless we
1295
+ // were on the edge of a container and had to move to the next/previous edge, in
1296
+ // which case we want to prevent default to keep the browser from moving focus
1297
+ // to where it normally would
1298
+ event.preventDefault();
1299
+ }
1300
+ _tryFocus(destinationNode);
1301
+ }
1302
+ // else, let the browser take care of [shift+]tab and move the focus
1303
+ };
1304
+ var checkTabKey = function checkTabKey(event) {
1305
+ if (config.isKeyForward(event) || config.isKeyBackward(event)) {
1306
+ checkKeyNav(event, config.isKeyBackward(event));
1307
+ }
1308
+ };
1309
+
1310
+ // we use a different event phase for the Escape key to allow canceling the event and checking for this in escapeDeactivates
1311
+ var checkEscapeKey = function checkEscapeKey(event) {
1312
+ if (isEscapeEvent(event) && valueOrHandler(config.escapeDeactivates, event) !== false) {
1313
+ event.preventDefault();
1314
+ trap.deactivate();
1315
+ }
1316
+ };
1317
+ var checkClick = function checkClick(e) {
1318
+ var target = getActualTarget(e);
1319
+ if (findContainerIndex(target, e) >= 0) {
1320
+ return;
1321
+ }
1322
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
1323
+ return;
1324
+ }
1325
+ if (valueOrHandler(config.allowOutsideClick, e)) {
1326
+ return;
1327
+ }
1328
+ e.preventDefault();
1329
+ e.stopImmediatePropagation();
1330
+ };
1331
+
1332
+ //
1333
+ // EVENT LISTENERS
1334
+ //
1335
+
1336
+ var addListeners = function addListeners() {
1337
+ if (!state.active) {
1338
+ return;
1339
+ }
1340
+
1341
+ // There can be only one listening focus trap at a time
1342
+ activeFocusTraps.activateTrap(trapStack, trap);
1343
+
1344
+ // Delay ensures that the focused element doesn't capture the event
1345
+ // that caused the focus trap activation.
1346
+ state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function () {
1347
+ _tryFocus(getInitialFocusNode());
1348
+ }) : _tryFocus(getInitialFocusNode());
1349
+ doc.addEventListener('focusin', checkFocusIn, true);
1350
+ doc.addEventListener('mousedown', checkPointerDown, {
1351
+ capture: true,
1352
+ passive: false
1353
+ });
1354
+ doc.addEventListener('touchstart', checkPointerDown, {
1355
+ capture: true,
1356
+ passive: false
1357
+ });
1358
+ doc.addEventListener('click', checkClick, {
1359
+ capture: true,
1360
+ passive: false
1361
+ });
1362
+ doc.addEventListener('keydown', checkTabKey, {
1363
+ capture: true,
1364
+ passive: false
1365
+ });
1366
+ doc.addEventListener('keydown', checkEscapeKey);
1367
+ return trap;
1368
+ };
1369
+ var removeListeners = function removeListeners() {
1370
+ if (!state.active) {
1371
+ return;
1372
+ }
1373
+ doc.removeEventListener('focusin', checkFocusIn, true);
1374
+ doc.removeEventListener('mousedown', checkPointerDown, true);
1375
+ doc.removeEventListener('touchstart', checkPointerDown, true);
1376
+ doc.removeEventListener('click', checkClick, true);
1377
+ doc.removeEventListener('keydown', checkTabKey, true);
1378
+ doc.removeEventListener('keydown', checkEscapeKey);
1379
+ return trap;
1380
+ };
1381
+
1382
+ //
1383
+ // MUTATION OBSERVER
1384
+ //
1385
+
1386
+ var checkDomRemoval = function checkDomRemoval(mutations) {
1387
+ var isFocusedNodeRemoved = mutations.some(function (mutation) {
1388
+ var removedNodes = Array.from(mutation.removedNodes);
1389
+ return removedNodes.some(function (node) {
1390
+ return node === state.mostRecentlyFocusedNode;
1391
+ });
1392
+ });
1393
+
1394
+ // If the currently focused is removed then browsers will move focus to the
1395
+ // <body> element. If this happens, try to move focus back into the trap.
1396
+ if (isFocusedNodeRemoved) {
1397
+ _tryFocus(getInitialFocusNode());
1398
+ }
1399
+ };
1400
+
1401
+ // Use MutationObserver - if supported - to detect if focused node is removed
1402
+ // from the DOM.
1403
+ var mutationObserver = typeof window !== 'undefined' && 'MutationObserver' in window ? new MutationObserver(checkDomRemoval) : undefined;
1404
+ var updateObservedNodes = function updateObservedNodes() {
1405
+ if (!mutationObserver) {
1406
+ return;
1407
+ }
1408
+ mutationObserver.disconnect();
1409
+ if (state.active && !state.paused) {
1410
+ state.containers.map(function (container) {
1411
+ mutationObserver.observe(container, {
1412
+ subtree: true,
1413
+ childList: true
1414
+ });
1415
+ });
1416
+ }
1417
+ };
1418
+
1419
+ //
1420
+ // TRAP DEFINITION
1421
+ //
1422
+
1423
+ trap = {
1424
+ get active() {
1425
+ return state.active;
1426
+ },
1427
+ get paused() {
1428
+ return state.paused;
1429
+ },
1430
+ activate: function activate(activateOptions) {
1431
+ if (state.active) {
1432
+ return this;
1433
+ }
1434
+ var onActivate = getOption(activateOptions, 'onActivate');
1435
+ var onPostActivate = getOption(activateOptions, 'onPostActivate');
1436
+ var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');
1437
+ if (!checkCanFocusTrap) {
1438
+ updateTabbableNodes();
1439
+ }
1440
+ state.active = true;
1441
+ state.paused = false;
1442
+ state.nodeFocusedBeforeActivation = doc.activeElement;
1443
+ onActivate === null || onActivate === undefined || onActivate();
1444
+ var finishActivation = function finishActivation() {
1445
+ if (checkCanFocusTrap) {
1446
+ updateTabbableNodes();
1447
+ }
1448
+ addListeners();
1449
+ updateObservedNodes();
1450
+ onPostActivate === null || onPostActivate === undefined || onPostActivate();
1451
+ };
1452
+ if (checkCanFocusTrap) {
1453
+ checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
1454
+ return this;
1455
+ }
1456
+ finishActivation();
1457
+ return this;
1458
+ },
1459
+ deactivate: function deactivate(deactivateOptions) {
1460
+ if (!state.active) {
1461
+ return this;
1462
+ }
1463
+ var options = _objectSpread2({
1464
+ onDeactivate: config.onDeactivate,
1465
+ onPostDeactivate: config.onPostDeactivate,
1466
+ checkCanReturnFocus: config.checkCanReturnFocus
1467
+ }, deactivateOptions);
1468
+ clearTimeout(state.delayInitialFocusTimer); // noop if undefined
1469
+ state.delayInitialFocusTimer = undefined;
1470
+ removeListeners();
1471
+ state.active = false;
1472
+ state.paused = false;
1473
+ updateObservedNodes();
1474
+ activeFocusTraps.deactivateTrap(trapStack, trap);
1475
+ var onDeactivate = getOption(options, 'onDeactivate');
1476
+ var onPostDeactivate = getOption(options, 'onPostDeactivate');
1477
+ var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
1478
+ var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
1479
+ onDeactivate === null || onDeactivate === undefined || onDeactivate();
1480
+ var finishDeactivation = function finishDeactivation() {
1481
+ delay(function () {
1482
+ if (returnFocus) {
1483
+ _tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
1484
+ }
1485
+ onPostDeactivate === null || onPostDeactivate === undefined || onPostDeactivate();
1486
+ });
1487
+ };
1488
+ if (returnFocus && checkCanReturnFocus) {
1489
+ checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
1490
+ return this;
1491
+ }
1492
+ finishDeactivation();
1493
+ return this;
1494
+ },
1495
+ pause: function pause(pauseOptions) {
1496
+ if (!state.active) {
1497
+ return this;
1498
+ }
1499
+ state.manuallyPaused = true;
1500
+ return this._setPausedState(true, pauseOptions);
1501
+ },
1502
+ unpause: function unpause(unpauseOptions) {
1503
+ if (!state.active) {
1504
+ return this;
1505
+ }
1506
+ state.manuallyPaused = false;
1507
+ if (trapStack[trapStack.length - 1] !== this) {
1508
+ return this;
1509
+ }
1510
+ return this._setPausedState(false, unpauseOptions);
1511
+ },
1512
+ updateContainerElements: function updateContainerElements(containerElements) {
1513
+ var elementsAsArray = [].concat(containerElements).filter(Boolean);
1514
+ state.containers = elementsAsArray.map(function (element) {
1515
+ return typeof element === 'string' ? doc.querySelector(element) : element;
1516
+ });
1517
+ if (state.active) {
1518
+ updateTabbableNodes();
1519
+ }
1520
+ updateObservedNodes();
1521
+ return this;
1522
+ }
1523
+ };
1524
+ Object.defineProperties(trap, {
1525
+ _isManuallyPaused: {
1526
+ value: function value() {
1527
+ return state.manuallyPaused;
1528
+ }
1529
+ },
1530
+ _setPausedState: {
1531
+ value: function value(paused, options) {
1532
+ if (state.paused === paused) {
1533
+ return this;
1534
+ }
1535
+ state.paused = paused;
1536
+ if (paused) {
1537
+ var onPause = getOption(options, 'onPause');
1538
+ var onPostPause = getOption(options, 'onPostPause');
1539
+ onPause === null || onPause === undefined || onPause();
1540
+ removeListeners();
1541
+ updateObservedNodes();
1542
+ onPostPause === null || onPostPause === undefined || onPostPause();
1543
+ } else {
1544
+ var onUnpause = getOption(options, 'onUnpause');
1545
+ var onPostUnpause = getOption(options, 'onPostUnpause');
1546
+ onUnpause === null || onUnpause === undefined || onUnpause();
1547
+ updateTabbableNodes();
1548
+ addListeners();
1549
+ updateObservedNodes();
1550
+ onPostUnpause === null || onPostUnpause === undefined || onPostUnpause();
1551
+ }
1552
+ return this;
1553
+ }
1554
+ }
1555
+ });
1556
+
1557
+ // initialize container elements
1558
+ trap.updateContainerElements(elements);
1559
+ return trap;
1560
+ };
1561
+
1562
+ const eventJumbotronExampleCss = "h1.sc-event-jumbotron-example,h2.sc-event-jumbotron-example,h3.sc-event-jumbotron-example,h4.sc-event-jumbotron-example,h5.sc-event-jumbotron-example,h6.sc-event-jumbotron-example,p.sc-event-jumbotron-example,ul.sc-event-jumbotron-example,li.sc-event-jumbotron-example,ptc-subnav.sc-event-jumbotron-example,ptc-tab-list.sc-event-jumbotron-example,ptc-link.sc-event-jumbotron-example,ptc-square-card.sc-event-jumbotron-example,.hyphenate-text.sc-event-jumbotron-example,ptc-footer.sc-event-jumbotron-example{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1.sc-event-jumbotron-example,h2.sc-event-jumbotron-example,h3.sc-event-jumbotron-example,h4.sc-event-jumbotron-example,h5.sc-event-jumbotron-example,h6.sc-event-jumbotron-example,p.sc-event-jumbotron-example,ul.sc-event-jumbotron-example,li.sc-event-jumbotron-example,ptc-subnav.sc-event-jumbotron-example,ptc-tab-list.sc-event-jumbotron-example,ptc-link.sc-event-jumbotron-example,ptc-square-card.sc-event-jumbotron-example,.hyphenate-text.sc-event-jumbotron-example,ptc-footer.sc-event-jumbotron-example{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}.sc-event-jumbotron-example-h{display:block;position:relative}.event-jumbotron.sc-event-jumbotron-example{margin-bottom:3rem;width:100%}.white-placeholder.sc-event-jumbotron-example{position:absolute;height:130px;width:100%;background-color:#F3f3f3;bottom:0px}.jumbotron-cards-wrapper.sc-event-jumbotron-example{z-index:1;position:relative;display:flex;flex-direction:column}.jumbotron-cards.sc-event-jumbotron-example{display:flex;gap:24px;overflow-x:auto;padding:0 24px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;cursor:grab}.jumbotron-cards.sc-event-jumbotron-example::-webkit-scrollbar{display:none}.jumbotron-cards.dragging.sc-event-jumbotron-example{cursor:grabbing}.card.sc-event-jumbotron-example{flex:1 0 auto;width:250px;height:414px;background:transparent;border-radius:var(--ptc-border-radius-standard);display:flex;justify-content:center;align-items:center;text-align:center;flex-direction:column;padding:24px;position:relative}.card.sc-event-jumbotron-example::after{content:\"\";position:absolute;top:0;left:0;bottom:0;right:0;box-shadow:0 2px 8px rgba(0, 0, 0, 0.1);z-index:-1;border-radius:var(--ptc-border-radius-standard)}.card.sc-event-jumbotron-example:focus-visible{border-radius:var(--ptc-border-radius-standard);outline:5px solid var(--keyboard-nav-outline)}.card.sc-event-jumbotron-example ptc-img.sc-event-jumbotron-example::after{content:\"\";top:0px;left:0px;position:absolute;width:100%;height:100%;border-radius:var(--ptc-border-radius-standard);background:linear-gradient(0deg, black 0%, black 100%);opacity:0.7;transition:opacity var(--ptc-transition-slow) ease-in-out;border:none;outline:1px solid rgba(255, 255, 255, 0.1);outline-offset:-1px}.card.sc-event-jumbotron-example:hover ptc-img.sc-event-jumbotron-example::after{opacity:0.8}.card.sc-event-jumbotron-example:focus ptc-img.sc-event-jumbotron-example::after,.card.sc-event-jumbotron-example:active ptc-img.sc-event-jumbotron-example::after{opacity:0.85}.text-wrapper.sc-event-jumbotron-example{align-self:flex-start;text-align:left}.card-title.sc-event-jumbotron-example{color:var(--color-white);font-family:var(--ptc-font-latin);font-size:var(--ptc-font-size-x-large);font-weight:var(--ptc-font-weight-extrabold);line-height:var(--ptc-line-height-densest);position:relative;z-index:2;margin-top:0;margin-bottom:var(--ptc-element-spacing-06)}.card-title.sc-event-jumbotron-example span.sc-event-jumbotron-example{font-weight:var(--ptc-font-weight-medium);display:inline-block}.cta-all.sc-event-jumbotron-example{margin-right:var(--ptc-element-spacing-05)}.panel.sc-event-jumbotron-example{display:none;visibility:hidden}@media only screen and (min-width: 768px){.card-title.sc-event-jumbotron-example{font-size:var(--ptc-font-size-xx-large)}.card-title.sc-event-jumbotron-example span.sc-event-jumbotron-example{font-size:var(--ptc-font-size-xx-large)}}@media only screen and (min-width: 992px){.card-title.sc-event-jumbotron-example{font-size:var(--ptc-font-size-x-large)}.card-title.sc-event-jumbotron-example span.sc-event-jumbotron-example{font-size:var(--ptc-font-size-x-large)}.cta-group.sc-event-jumbotron-example{margin-bottom:88px}.jumbotron-cards.sc-event-jumbotron-example{overflow-x:visible;justify-content:space-between;cursor:auto;transition:transform 0.3s ease-in-out;width:100%;padding-left:0px;padding-right:0px}.card.sc-event-jumbotron-example{width:auto;height:530px;padding:var(--ptc-element-spacing-06);cursor:pointer;flex:1}.card.hidden.sc-event-jumbotron-example{opacity:0;pointer-events:none}.card.active.sc-event-jumbotron-example{min-height:530px;border-top-right-radius:0px;border-bottom-right-radius:0px;box-shadow:var(--ptc-shadow-x-large);height:auto}.card.active.sc-event-jumbotron-example ptc-img.sc-event-jumbotron-example::after{border-top-right-radius:0px;border-bottom-right-radius:0px}.card.active.sc-event-jumbotron-example:hover ptc-img.sc-event-jumbotron-example::after{opacity:0.7}.card.active.sc-event-jumbotron-example:focus ptc-img.sc-event-jumbotron-example::after,.card.active.sc-event-jumbotron-example:active ptc-img.sc-event-jumbotron-example::after{opacity:0.7}.panel.sc-event-jumbotron-example{visibility:hidden;opacity:0;position:absolute;top:0;left:0;min-height:530px;padding:40px;background:var(--color-white);border-radius:var(--ptc-border-radius-standard);box-shadow:0 2px 8px rgba(0, 0, 0, 0.1);transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;z-index:10}.panel.visible.sc-event-jumbotron-example{visibility:visible;opacity:1;border-top-left-radius:0px;border-bottom-left-radius:0px;box-shadow:var(--ptc-shadow-x-large);height:auto}.close-panel.sc-event-jumbotron-example{position:absolute;top:0px;right:0px;background:var(--color-white);border:none;text-align:center;cursor:pointer;padding:0px;margin:5px}.hide-scrollbar.sc-event-jumbotron-example{margin-left:-40px;margin-right:-40px}}@media only screen and (min-width: 1200px){.card-title.sc-event-jumbotron-example{font-size:var(--ptc-font-size-xx-large)}.card-title.sc-event-jumbotron-example span.sc-event-jumbotron-example{font-size:var(--ptc-font-size-xx-large)}.jumbotron-cards.sc-event-jumbotron-example{padding:0;gap:32px}}@media only screen and (min-width: 1440px){.jumbotron-cards.sc-event-jumbotron-example{gap:40px}}";
1563
+
1564
+ const EventJumbotronExample = class {
1565
+ constructor(hostRef) {
1566
+ index.registerInstance(this, hostRef);
1567
+ this.startX = 0;
1568
+ this.scrollLeft = 0;
1569
+ this.updateContainerClass = () => {
1570
+ if (this.isDesktop) {
1571
+ this.sliderWrapper.classList.add('ptc-container', 'u-paddingRight-flush', 'u-paddingLeft-flush');
1572
+ this.disableDragging();
1573
+ }
1574
+ else {
1575
+ this.sliderWrapper.classList.remove('ptc-container', 'u-paddingRight-flush', 'u-paddingLeft-flush');
1576
+ this.enableDragging();
1577
+ }
1578
+ };
1579
+ this.startDragging = (e) => {
1580
+ this.isMouseDown = true;
1581
+ this.isDragging = false;
1582
+ this.startX = e.pageX;
1583
+ this.scrollLeft = this.slider.scrollLeft;
1584
+ };
1585
+ this.performDragging = (e) => {
1586
+ if (!this.isMouseDown)
1587
+ return;
1588
+ const x = e.pageX - this.slider.offsetLeft;
1589
+ const walk = x - this.startX;
1590
+ this.isDragging = Math.abs(walk) > 5;
1591
+ this.slider.scrollLeft = this.scrollLeft - walk;
1592
+ };
1593
+ this.stopDragging = () => {
1594
+ this.isMouseDown = false;
1595
+ };
1596
+ this.closeActiveModal = () => {
1597
+ document.querySelectorAll('ptc-modal').forEach(modal => {
1598
+ if (modal.show)
1599
+ modal.show = false;
1600
+ });
1601
+ };
1602
+ this.cards = [];
1603
+ this.modalBtnCloseText = 'Close';
1604
+ this.activePanel = null;
1605
+ this.activeCard = null;
1606
+ this.isDragging = false;
1607
+ this.isMouseDown = false;
1608
+ this.isDesktop = window.innerWidth >= 992;
1609
+ this.openedWithKeyboard = false;
1610
+ }
1611
+ onScreenStatusChange() {
1612
+ !this.isDesktop && this.closeActiveModal();
1613
+ }
1614
+ handleCardClick(cardIndex) {
1615
+ const card = this.slider.children[cardIndex];
1616
+ const panelID = `panel-${cardIndex}`;
1617
+ //const cardID = `card-${cardIndex}`
1618
+ const panel = document.getElementById(panelID);
1619
+ if (this.isDesktop && panel) {
1620
+ this.showPanel(card, panel);
1621
+ if (this.openedWithKeyboard) {
1622
+ setTimeout(() => {
1623
+ this.trap = createFocusTrap(panel, {
1624
+ escapeDeactivates: true,
1625
+ clickOutsideDeactivates: true,
1626
+ onActivate: () => {
1627
+ if (!this.openedWithKeyboard) {
1628
+ this.trap.pause(); // Prevent focus trapping when opened by mouse
1629
+ }
1630
+ },
1631
+ onDeactivate: () => {
1632
+ this.closePanel(panelID);
1633
+ this.trap.deactivate();
1634
+ },
1635
+ tabbableOptions: {
1636
+ getShadowRoot: true,
1637
+ },
1638
+ });
1639
+ this.trap.activate();
1640
+ }, 500);
1641
+ }
1642
+ else {
1643
+ if (this.trap) {
1644
+ this.trap.deactivate();
1645
+ }
1646
+ }
1647
+ }
1648
+ else if (!this.isDesktop) {
1649
+ if (!this.isDragging) {
1650
+ const modal = document.getElementById(`modal-${cardIndex}`);
1651
+ console.log('open: ' + modal.id);
1652
+ modal.show = true;
1653
+ }
1654
+ }
1655
+ }
1656
+ showPanel(card, panel) {
1657
+ if (this.activePanel)
1658
+ return;
1659
+ this.slider.style.transform = `translateX(-${card.offsetLeft}px)`;
1660
+ Array.from(this.slider.children).forEach(c => {
1661
+ if (c !== card)
1662
+ c.classList.add('hidden');
1663
+ });
1664
+ panel.style.display = 'block';
1665
+ panel.style.width = `calc(100% - ${card.getBoundingClientRect().width}px`;
1666
+ card.style.height = `${panel.getBoundingClientRect().height}px`;
1667
+ this.arrowButtons = document.querySelectorAll('ptc-scroll-button');
1668
+ setTimeout(() => {
1669
+ panel.style.transform = `translateX(${card.offsetWidth}px)`;
1670
+ panel.classList.add('visible');
1671
+ card.classList.add('active');
1672
+ this.arrowButtons.forEach(button => button.initVisibility());
1673
+ this.activePanel = panel.id;
1674
+ this.activeCard = card.id;
1675
+ }, 100);
1676
+ }
1677
+ closePanel(panelId) {
1678
+ const panel = document.getElementById(panelId);
1679
+ if (panel) {
1680
+ panel.classList.remove('visible');
1681
+ panel.addEventListener('transitionend', () => {
1682
+ if (!panel.classList.contains('visible')) {
1683
+ panel.style.display = 'none';
1684
+ }
1685
+ }, { once: true });
1686
+ }
1687
+ this.activePanel = null;
1688
+ this.slider.style.transform = 'translateX(0)';
1689
+ Array.from(this.slider.children).forEach(card => {
1690
+ card.style.cssText = '';
1691
+ });
1692
+ setTimeout(() => {
1693
+ Array.from(this.slider.children).forEach(card => {
1694
+ card.classList.remove('hidden', 'active');
1695
+ });
1696
+ }, 300);
1697
+ if (this.trap) {
1698
+ this.trap.deactivate();
1699
+ }
1700
+ }
1701
+ enableDragging() {
1702
+ this.slider.addEventListener('mousedown', this.startDragging);
1703
+ this.slider.addEventListener('mousemove', this.performDragging);
1704
+ ['mouseup', 'mouseleave'].forEach(event => this.slider.addEventListener(event, this.stopDragging));
1705
+ }
1706
+ disableDragging() {
1707
+ this.slider.removeEventListener('mousedown', this.startDragging);
1708
+ this.slider.removeEventListener('mousemove', this.performDragging);
1709
+ ['mouseup', 'mouseleave'].forEach(event => this.slider.removeEventListener(event, this.stopDragging));
1710
+ }
1711
+ componentDidLoad() {
1712
+ // const cardOverlays = document.querySelectorAll('overlay');
1713
+ this.sliderWrapper = document.querySelector('.jumbotron-cards-wrapper');
1714
+ this.slider = document.querySelector('.jumbotron-cards');
1715
+ this.updateContainerClass();
1716
+ window.addEventListener('resize', () => {
1717
+ this.isDesktop = window.innerWidth >= 992;
1718
+ this.updateContainerClass();
1719
+ this.activePanel && this.activeCard && this.closePanel(this.activePanel);
1720
+ });
1721
+ document.addEventListener('keydown', event => {
1722
+ if (event.key === 'Tab' || event.key === 'Enter' || event.key === ' ') {
1723
+ this.openedWithKeyboard = true;
1724
+ console.log('keyboard status: ' + this.openedWithKeyboard);
1725
+ }
1726
+ });
1727
+ document.addEventListener('mousedown', () => {
1728
+ this.openedWithKeyboard = false;
1729
+ });
1730
+ // cardOverlays.forEach( (ele=> {(ele as HTMLPtcOverlayElement).setOverlayColorValue('linear-gradient(0deg, rgba(0, 0, 0, 0.70) 0%, rgba(0, 0, 0, 0.70) 100%)')}))
1731
+ }
1732
+ render() {
1733
+ const modalContentSlots = Array.from(this.el.querySelectorAll('template'));
1734
+ return [
1735
+ index.h("div", { class: {
1736
+ 'event-jumbotron': true,
1737
+ 'ptc-container': this.isDesktop,
1738
+ } }, index.h("div", { class: "jumbotron-cards-wrapper" }, index.h("div", { class: "jumbotron-cards" }, this.cards.map((card, index$1) => (index.h("div", { id: `card-${index$1}`, class: "card", onClick: () => this.handleCardClick(index$1), "data-panel": `panel-${index$1}`, onKeyPress: () => this.handleCardClick(index$1), tabindex: "0" }, index.h("ptc-img", { "border-radius": "radius-standard", "image-type": "smart-bg", "img-url": card.cardBg, "load-mode": "lazy-bg", styles: `ptc-img{position: absolute; width: 100%; height: 100%; z-index: 0} ${this.activePanel && 'ptc-img div{border-top-right-radius:0px !important;border-bottom-right-radius:0px !important;'}` }), index.h("div", { class: "text-wrapper" }, index.h("h3", { class: "card-title" }, card.title, " ", index.h("span", null, card.description)), !this.activePanel && [index.h("div", { innerHTML: card.panelContent })]))))), this.cards.map((_, index$1) => (index.h("div", { id: `panel-${index$1}`, class: "panel" }, index.h("button", { tabindex: "-1", class: "close-panel", onClick: () => this.closePanel(`panel-${index$1}`), "aria-label": "Close panel" }, index.h("ptc-close-icon", null)), index.h("slot", { name: `panel-content-${index$1}` })))), !this.isDesktop &&
1739
+ this.cards.map((_, index$1) => (index.h("ptc-modal", { id: `modal-${index$1}`, show: false, "close-on-blur": true, "modal-type": "event-listing", "custom-class": "event-mobile-modal", headerOnlyText1: this.cards[index$1].title, headerOnlyText2: this.cards[index$1].description, headerOnlyBg: this.cards[index$1].cardBg, bottomCloseBtn: this.modalBtnCloseText }, index.h("div", { innerHTML: modalContentSlots[index$1].innerHTML })))))),
1740
+ index.h("div", { class: "white-placeholder" }),
1741
+ ];
1742
+ }
1743
+ get el() { return index.getElement(this); }
1744
+ static get watchers() { return {
1745
+ "isDesktop": ["onScreenStatusChange"]
1746
+ }; }
1747
+ };
1748
+ EventJumbotronExample.style = eventJumbotronExampleCss;
1749
+
1750
+ exports.event_jumbotron_example = EventJumbotronExample;