govuk_publishing_components 68.2.0 → 69.0.0

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 (357) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +44 -17
  3. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +98 -139
  4. data/app/assets/javascripts/govuk_publishing_components/components/option-select.js +26 -16
  5. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +12 -11
  6. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +3 -1
  7. data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +14 -11
  8. data/app/assets/stylesheets/component_guide/application.scss +7 -7
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_add-another.scss +2 -2
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_app-promo-banner.scss +1 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +5 -5
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +1 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +1 -1
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +1 -1
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +6 -5
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_character-count.scss +1 -1
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +1 -1
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +2 -2
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +1 -1
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +1 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_date-input.scss +1 -1
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_details.scss +1 -1
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +6 -6
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_error-message.scss +1 -1
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +8 -8
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_fieldset.scss +1 -1
  30. data/app/assets/stylesheets/govuk_publishing_components/components/_figure.scss +1 -1
  31. data/app/assets/stylesheets/govuk_publishing_components/components/_file-upload.scss +1 -1
  32. data/app/assets/stylesheets/govuk_publishing_components/components/_hint.scss +1 -1
  33. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +6 -7
  34. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
  35. data/app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss +1 -1
  36. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +1 -1
  37. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +1 -1
  38. data/app/assets/stylesheets/govuk_publishing_components/components/_label.scss +1 -1
  39. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +1 -1
  40. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +1 -1
  41. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +1 -1
  42. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +15 -11
  43. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +1 -1
  44. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +3 -3
  45. data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +1 -1
  46. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +2 -2
  47. data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +3 -3
  48. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +1 -7
  49. data/app/assets/stylesheets/govuk_publishing_components/components/_pagination.scss +1 -1
  50. data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +1 -1
  51. data/app/assets/stylesheets/govuk_publishing_components/components/_password-input.scss +1 -1
  52. data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +1 -1
  53. data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +2 -2
  54. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +1 -1
  55. data/app/assets/stylesheets/govuk_publishing_components/components/_search-with-autocomplete.scss +1 -1
  56. data/app/assets/stylesheets/govuk_publishing_components/components/_select-with-search.scss +1 -1
  57. data/app/assets/stylesheets/govuk_publishing_components/components/_select.scss +1 -1
  58. data/app/assets/stylesheets/govuk_publishing_components/components/_service-navigation.scss +1 -1
  59. data/app/assets/stylesheets/govuk_publishing_components/components/_skip-link.scss +1 -1
  60. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +2 -2
  61. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -1
  62. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +3 -3
  63. data/app/assets/stylesheets/govuk_publishing_components/components/_sub-navigation-menu.scss +1 -1
  64. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +1 -1
  65. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +1 -1
  66. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-banner.scss +1 -1
  67. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-card.scss +1 -1
  68. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-list.scss +1 -1
  69. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +1 -1
  70. data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +1 -1
  71. data/app/assets/stylesheets/govuk_publishing_components/components/_tag.scss +1 -1
  72. data/app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss +1 -1
  73. data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +1 -1
  74. data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
  75. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +7 -7
  76. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -1
  77. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +1 -1
  78. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +9 -8
  79. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +2 -2
  80. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +1 -1
  81. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +1 -1
  82. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_form-download.scss +1 -1
  83. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +2 -2
  84. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +1 -1
  85. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +1 -1
  86. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +1 -1
  87. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
  88. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +1 -1
  89. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +2 -2
  90. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +3 -2
  91. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +2 -2
  92. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +5 -4
  93. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_index.scss +0 -1
  94. data/app/views/govuk_publishing_components/components/_date_input.html.erb +16 -10
  95. data/app/views/govuk_publishing_components/components/_metadata.html.erb +81 -74
  96. data/app/views/govuk_publishing_components/components/_option_select.html.erb +9 -20
  97. data/app/views/govuk_publishing_components/components/docs/date_input.yml +23 -0
  98. data/lib/govuk_publishing_components/version.rb +1 -1
  99. data/node_modules/choices.js/README.md +1 -1
  100. data/node_modules/choices.js/package.json +5 -9
  101. data/node_modules/choices.js/public/assets/scripts/choices.js +32 -23
  102. data/node_modules/choices.js/public/assets/scripts/choices.min.js +2 -2
  103. data/node_modules/choices.js/public/assets/scripts/choices.mjs +32 -23
  104. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.js +31 -22
  105. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.min.js +2 -2
  106. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.mjs +31 -22
  107. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.js +30 -21
  108. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.min.js +2 -2
  109. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.mjs +30 -21
  110. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.js +30 -21
  111. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.min.js +2 -2
  112. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.mjs +30 -21
  113. data/node_modules/choices.js/public/types/src/scripts/choices.d.ts +3 -3
  114. data/node_modules/choices.js/public/types/src/scripts/interfaces/templates.d.ts +1 -1
  115. data/node_modules/choices.js/src/scripts/choices.ts +30 -25
  116. data/node_modules/choices.js/src/scripts/components/dropdown.ts +7 -3
  117. data/node_modules/choices.js/src/scripts/interfaces/templates.ts +1 -1
  118. data/node_modules/choices.js/src/scripts/templates.ts +8 -3
  119. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +1 -1
  120. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +1 -1
  121. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  122. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss +4 -1
  123. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss.map +1 -1
  124. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +3 -1
  125. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +1 -1
  126. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss +4 -1
  127. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss.map +1 -1
  128. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +7 -3
  129. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss.map +1 -1
  130. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss +4 -1
  131. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss.map +1 -1
  132. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +8 -4
  133. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss.map +1 -1
  134. data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss +4 -1
  135. data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss.map +1 -1
  136. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +3 -1
  137. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss.map +1 -1
  138. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss +4 -1
  139. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss.map +1 -1
  140. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +2 -0
  141. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +1 -1
  142. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss +4 -1
  143. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss.map +1 -1
  144. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +10 -6
  145. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss.map +1 -1
  146. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss +4 -1
  147. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss.map +1 -1
  148. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +2 -0
  149. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss.map +1 -1
  150. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss +4 -1
  151. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss.map +1 -1
  152. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +2 -0
  153. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss.map +1 -1
  154. data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss +4 -1
  155. data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss.map +1 -1
  156. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +3 -1
  157. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss.map +1 -1
  158. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss +4 -1
  159. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss.map +1 -1
  160. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +2 -0
  161. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss.map +1 -1
  162. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss +4 -1
  163. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss.map +1 -1
  164. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +3 -1
  165. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss.map +1 -1
  166. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss +4 -1
  167. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss.map +1 -1
  168. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +3 -1
  169. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss.map +1 -1
  170. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss +4 -1
  171. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss.map +1 -1
  172. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss +3 -1
  173. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss.map +1 -1
  174. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss +4 -1
  175. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss.map +1 -1
  176. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +4 -1
  177. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
  178. data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss +4 -1
  179. data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss.map +1 -1
  180. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +2 -0
  181. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
  182. data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss +4 -1
  183. data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss.map +1 -1
  184. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +2 -0
  185. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
  186. data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss +4 -1
  187. data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss.map +1 -1
  188. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +2 -0
  189. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss.map +1 -1
  190. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +2 -0
  191. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +1 -1
  192. data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss +4 -1
  193. data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss.map +1 -1
  194. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +5 -1
  195. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss.map +1 -1
  196. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss +4 -1
  197. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss.map +1 -1
  198. data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss +3 -1
  199. data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss.map +1 -1
  200. data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss +4 -1
  201. data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss.map +1 -1
  202. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +6 -2
  203. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +1 -1
  204. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss +4 -1
  205. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss.map +1 -1
  206. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +2 -0
  207. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +1 -1
  208. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss +4 -1
  209. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss.map +1 -1
  210. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +3 -1
  211. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +1 -1
  212. data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss +4 -1
  213. data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss.map +1 -1
  214. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -0
  215. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss.map +1 -1
  216. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss +4 -1
  217. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss.map +1 -1
  218. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +3 -1
  219. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +1 -1
  220. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss +4 -1
  221. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss.map +1 -1
  222. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +14 -10
  223. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
  224. data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss +4 -1
  225. data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss.map +1 -1
  226. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +2 -0
  227. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +1 -1
  228. data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss +4 -1
  229. data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss.map +1 -1
  230. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +5 -1
  231. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +1 -1
  232. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss +4 -1
  233. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss.map +1 -1
  234. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +7 -3
  235. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +1 -1
  236. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss +4 -1
  237. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss.map +1 -1
  238. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +15 -2
  239. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
  240. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss +4 -1
  241. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss.map +1 -1
  242. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +4 -1
  243. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +1 -1
  244. data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss +4 -1
  245. data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss.map +1 -1
  246. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +5 -2
  247. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss.map +1 -1
  248. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss +4 -1
  249. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss.map +1 -1
  250. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +4 -1
  251. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss.map +1 -1
  252. data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss +4 -1
  253. data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss.map +1 -1
  254. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +6 -2
  255. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss.map +1 -1
  256. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss +4 -1
  257. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss.map +1 -1
  258. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +2 -0
  259. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +1 -1
  260. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss +4 -1
  261. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss.map +1 -1
  262. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +3 -1
  263. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +1 -1
  264. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss +4 -1
  265. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss.map +1 -1
  266. data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss +4 -0
  267. data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss.map +1 -1
  268. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +4 -0
  269. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss.map +1 -1
  270. data/node_modules/govuk-frontend/dist/govuk/core/_links.scss +8 -0
  271. data/node_modules/govuk-frontend/dist/govuk/core/_links.scss.map +1 -1
  272. data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +10 -1
  273. data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss.map +1 -1
  274. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +5 -0
  275. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss.map +1 -1
  276. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +14 -13
  277. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map +1 -1
  278. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +1 -1
  279. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +5 -0
  280. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss.map +1 -1
  281. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  282. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  283. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  284. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +38 -70
  285. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -1
  286. data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss +2 -0
  287. data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss.map +1 -1
  288. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +1 -1
  289. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +1 -1
  290. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +3 -2
  291. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss.map +1 -1
  292. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +4 -4
  293. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +1 -1
  294. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +17 -15
  295. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss.map +1 -1
  296. data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss +2 -2
  297. data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss.map +1 -1
  298. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +19 -13
  299. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss.map +1 -1
  300. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +48 -26
  301. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +1 -1
  302. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +13 -11
  303. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss.map +1 -1
  304. data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss +4 -2
  305. data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss.map +1 -1
  306. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +10 -9
  307. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss.map +1 -1
  308. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +2 -0
  309. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss.map +1 -1
  310. data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss +3 -0
  311. data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss.map +1 -1
  312. data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss +5 -1
  313. data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss.map +1 -1
  314. data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss +2 -0
  315. data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss.map +1 -1
  316. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +7 -2
  317. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss.map +1 -1
  318. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +3 -0
  319. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss.map +1 -1
  320. data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss +18 -0
  321. data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss.map +1 -1
  322. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +28 -4
  323. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss.map +1 -1
  324. data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss +3 -2
  325. data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss.map +1 -1
  326. data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss +8 -16
  327. data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss.map +1 -1
  328. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss +4 -1
  329. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss.map +1 -1
  330. data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss +15 -2
  331. data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss.map +1 -1
  332. data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss +3 -2
  333. data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss.map +1 -1
  334. data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss +13 -5
  335. data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss.map +1 -1
  336. data/node_modules/govuk-frontend/dist/govuk/tools/_if.scss +24 -0
  337. data/node_modules/govuk-frontend/dist/govuk/tools/_if.scss.map +1 -0
  338. data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss +13 -5
  339. data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss.map +1 -1
  340. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +1 -0
  341. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss.map +1 -1
  342. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +5 -3
  343. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss.map +1 -1
  344. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +4 -2
  345. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss.map +1 -1
  346. data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss +3 -0
  347. data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss.map +1 -1
  348. data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss +1 -0
  349. data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss.map +1 -1
  350. data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss +3 -0
  351. data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss.map +1 -1
  352. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +3 -1
  353. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss.map +1 -1
  354. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
  355. data/node_modules/govuk-frontend/package.json +7 -7
  356. metadata +4 -3
  357. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss +0 -145
@@ -1,2 +1,2 @@
1
- /*! choices.js v11.2.3 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Choices=t()}(this,(function(){"use strict";var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};function t(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var n,s="ADD_CHOICE",o="REMOVE_CHOICE",r="FILTER_CHOICES",a="ACTIVATE_CHOICES",c="CLEAR_CHOICES",l="ADD_GROUP",h="ADD_ITEM",d="REMOVE_ITEM",u="HIGHLIGHT_ITEM",p="search",m="removeItem",f="highlightItem",v=["fuseOptions","classNames"],_="select-one",g="select-multiple",y=function(e){return{type:s,choice:e}},b=function(e){return{type:h,item:e}},E=function(e){return{type:d,item:e}},C=function(e,t){return{type:u,item:e,highlighted:t}},S=function(e){return Array.from({length:e},(function(){return Math.floor(36*Math.random()+0).toString(36)})).join("")},w=function(e,t,i){return void 0===i&&(i=1),i>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop},I=function(e){if("string"!=typeof e){if(null==e)return"";if("object"==typeof e){if("raw"in e)return I(e.raw);if("trusted"in e)return e.trusted}return e}return e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;")},A=(n=document.createElement("div"),function(e){n.innerHTML=e.trim();for(var t=n.children[0];n.firstChild;)n.removeChild(n.firstChild);return t}),T=function(e){return"function"==typeof e?e():e},O=function(e){if("string"==typeof e)return e;if("object"==typeof e){if("trusted"in e)return e.trusted;if("raw"in e)return e.raw}return""},x=function(e){if("string"==typeof e)return e;if("object"==typeof e){if("escaped"in e)return e.escaped;if("trusted"in e)return e.trusted}return""},L=function(e,t){return{id:e.id,highlighted:e.highlighted,labelClass:e.labelClass,labelDescription:O(e.labelDescription),customProperties:e.customProperties,disabled:e.disabled,active:e.active,label:e.label,placeholder:e.placeholder,value:e.value,groupValue:e.group?e.group.label:void 0,element:e.element,keyCode:t}},N=function(e,t,i){return"function"==typeof e?e(I(t),O(t),i):e},D=function(e,t){return e?x(t):I(t)},P=function(e,t,i){e.innerHTML=D(t,i)},F=function(e,t){return e.rank-t.rank},k=function(e){return Array.isArray(e)?e:[e]},M=function(e){return e&&Array.isArray(e)?e.map((function(e){return".".concat(e)})).join(""):".".concat(e)},K=function(e,t){var i;(i=e.classList).add.apply(i,k(t))},j=function(e,t){var i;(i=e.classList).remove.apply(i,k(t))},V=function(e){if(void 0!==e)try{return JSON.parse(e)}catch(t){return e}return{}},B=function(){function e(e){var t=e.type,i=e.classNames;this.element=e.element,this.classNames=i,this.type=t,this.isActive=!1}return e.prototype.show=function(){return K(this.element,this.classNames.activeState),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},e.prototype.hide=function(){return j(this.element,this.classNames.activeState),this.element.setAttribute("aria-expanded","false"),this.isActive=!1,this},e}(),H=function(){function e(e){var t=e.type,i=e.classNames,n=e.position;this.element=e.element,this.classNames=i,this.type=t,this.position=n,this.isOpen=!1,this.isFlipped=!1,this.isDisabled=!1,this.isLoading=!1}return e.prototype.shouldFlip=function(e,t){var i=!1;return"auto"===this.position?i=this.element.getBoundingClientRect().top-t>=0&&!window.matchMedia("(min-height: ".concat(e+1,"px)")).matches:"top"===this.position&&(i=!0),i},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype.open=function(e,t){K(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e,t)&&(K(this.element,this.classNames.flippedState),this.isFlipped=!0)},e.prototype.close=function(){j(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(j(this.element,this.classNames.flippedState),this.isFlipped=!1)},e.prototype.addFocusState=function(){K(this.element,this.classNames.focusState)},e.prototype.removeFocusState=function(){j(this.element,this.classNames.focusState)},e.prototype.addInvalidState=function(){K(this.element,this.classNames.invalidState)},e.prototype.removeInvalidState=function(){j(this.element,this.classNames.invalidState)},e.prototype.enable=function(){j(this.element,this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===_&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},e.prototype.disable=function(){K(this.element,this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===_&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},e.prototype.wrap=function(e){var t=this.element,i=e.parentNode;i&&(e.nextSibling?i.insertBefore(t,e.nextSibling):i.appendChild(t)),t.appendChild(e)},e.prototype.unwrap=function(e){var t=this.element,i=t.parentNode;i&&(i.insertBefore(e,t),i.removeChild(t))},e.prototype.addLoadingState=function(){K(this.element,this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},e.prototype.removeLoadingState=function(){j(this.element,this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},e}(),R=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,s=e.preventPaste;this.element=t,this.type=i,this.classNames=n,this.preventPaste=s,this.isFocussed=this.element.isEqualNode(document.activeElement),this.isDisabled=t.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return Object.defineProperty(e.prototype,"placeholder",{set:function(e){this.element.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.addEventListeners=function(){var e=this.element;e.addEventListener("paste",this._onPaste),e.addEventListener("input",this._onInput,{passive:!0}),e.addEventListener("focus",this._onFocus,{passive:!0}),e.addEventListener("blur",this._onBlur,{passive:!0})},e.prototype.removeEventListeners=function(){var e=this.element;e.removeEventListener("input",this._onInput),e.removeEventListener("paste",this._onPaste),e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur)},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.blur=function(){this.isFocussed&&this.element.blur()},e.prototype.clear=function(e){return void 0===e&&(e=!0),this.element.value="",e&&this.setWidth(),this},e.prototype.setWidth=function(){var e=this.element,t=e.value,i=e.placeholder,n=0,s=0;if(t||i){var o=document.createElement("span");o.style.position="absolute",o.style.visibility="hidden",o.style.whiteSpace="pre",o.style.height="auto",o.style.width="auto",o.style.minWidth="1ch",K(o,Array.from(e.classList)),e.after(o);var r=parseFloat(getComputedStyle(o).width);Number.isNaN(r)?(n=i.length,s=t.length):(i&&(o.innerText=i,n=parseFloat(getComputedStyle(o).width)/r),t&&(o.innerText=t,s=parseFloat(getComputedStyle(o).width)/r)),o.remove()}e.style.minWidth="".concat(Math.ceil(n)+1,"ch"),e.style.width="".concat(Math.ceil(s)+1,"ch")},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype._onInput=function(){this.type!==_&&this.setWidth()},e.prototype._onPaste=function(e){this.preventPaste&&e.preventDefault()},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}(),q=function(){function e(e){this.element=e.element,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return e.prototype.prepend=function(e){var t=this.element.firstElementChild;t?this.element.insertBefore(e,t):this.element.append(e)},e.prototype.scrollToTop=function(){this.element.scrollTop=0},e.prototype.scrollToChildElement=function(e,t){var i=this;if(e){var n=t>0?this.element.scrollTop+(e.offsetTop+e.offsetHeight)-(this.element.scrollTop+this.element.offsetHeight):e.offsetTop;requestAnimationFrame((function(){i._animateScroll(n,t)}))}},e.prototype._scrollDown=function(e,t,i){var n=(i-e)/t;this.element.scrollTop=e+(n>1?n:1)},e.prototype._scrollUp=function(e,t,i){var n=(e-i)/t;this.element.scrollTop=e-(n>1?n:1)},e.prototype._animateScroll=function(e,t){var i=this,n=this.element.scrollTop,s=!1;t>0?(this._scrollDown(n,4,e),n<e&&(s=!0)):(this._scrollUp(n,4,e),n>e&&(s=!0)),s&&requestAnimationFrame((function(){i._animateScroll(e,t)}))},e}(),U=function(){function e(e){var t=e.classNames;this.element=e.element,this.classNames=t,this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){var e=this.element;K(e,this.classNames.input),e.hidden=!0,e.tabIndex=-1;var t=e.getAttribute("style");t&&e.setAttribute("data-choice-orig-style",t),e.setAttribute("data-choice","active")},e.prototype.reveal=function(){var e=this.element;j(e,this.classNames.input),e.hidden=!1,e.removeAttribute("tabindex");var t=e.getAttribute("data-choice-orig-style");t?(e.removeAttribute("data-choice-orig-style"),e.setAttribute("style",t)):e.removeAttribute("style"),e.removeAttribute("data-choice")},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){var i;void 0===(i=t||{})&&(i=null),this.element.dispatchEvent(new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}))},e}(),G=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i}(U),W=function(e,t){return void 0===t&&(t=!0),void 0===e?t:!!e},X=function(e){if("string"==typeof e&&(e=e.split(" ").filter((function(e){return e.length}))),Array.isArray(e)&&e.length)return e},J=function(e,t,i){if(void 0===i&&(i=!0),"string"==typeof e){var n=I(e);return J({value:e,label:i||n===e?e:{escaped:n,raw:e},selected:!0},!1)}var s=e;if("choices"in s){if(!t)throw new TypeError("optGroup is not allowed");var o=s,r=o.choices.map((function(e){return J(e,!1)}));return{id:0,label:O(o.label)||o.value,active:!!r.length,disabled:!!o.disabled,choices:r}}var a=s;return{id:0,group:null,score:0,rank:0,value:a.value,label:a.label||a.value,active:W(a.active),selected:W(a.selected,!1),disabled:W(a.disabled,!1),placeholder:W(a.placeholder,!1),highlighted:!1,labelClass:X(a.labelClass),labelDescription:a.labelDescription,customProperties:a.customProperties}},z=function(e){return"SELECT"===e.tagName},Q=function(e){function i(t){var i=t.template,n=t.extractPlaceholder,s=e.call(this,{element:t.element,classNames:t.classNames})||this;return s.template=i,s.extractPlaceholder=n,s}return t(i,e),Object.defineProperty(i.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),i.prototype.addOptions=function(e){var t=this,i=document.createDocumentFragment();e.forEach((function(e){var n=e;if(!n.element){var s=t.template(n);i.appendChild(s),n.element=s}})),this.element.appendChild(i)},i.prototype.optionsAsChoices=function(){var e=this,t=[];return this.element.querySelectorAll(":scope > option, :scope > optgroup").forEach((function(i){!function(e){return"OPTION"===e.tagName}(i)?function(e){return"OPTGROUP"===e.tagName}(i)&&t.push(e._optgroupToChoice(i)):t.push(e._optionToChoice(i))})),t},i.prototype._optionToChoice=function(e){return!e.hasAttribute("value")&&e.hasAttribute("placeholder")&&(e.setAttribute("value",""),e.value=""),{id:0,group:null,score:0,rank:0,value:e.value,label:e.label,element:e,active:!0,selected:this.extractPlaceholder?e.selected:e.hasAttribute("selected"),disabled:e.disabled,highlighted:!1,placeholder:this.extractPlaceholder&&(!e.value||e.hasAttribute("placeholder")),labelClass:void 0!==e.dataset.labelClass?X(e.dataset.labelClass):void 0,labelDescription:void 0!==e.dataset.labelDescription?{trusted:e.dataset.labelDescription}:void 0,customProperties:V(e.dataset.customProperties)}},i.prototype._optgroupToChoice=function(e){var t=this,i=e.querySelectorAll("option"),n=Array.from(i).map((function(e){return t._optionToChoice(e)}));return{id:0,label:e.label||"",element:e,active:!!n.length,disabled:e.disabled,choices:n}},i}(U),Y={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,closeDropdownOnSelect:"auto",singleModeForMultiSelect:!1,addChoices:!1,addItems:!0,addItemFilter:function(e){return!!e&&""!==e},removeItems:!0,removeItemButton:!1,removeItemButtonAlignLeft:!1,editItems:!1,allowHTML:!1,allowHtmlUserInput:!1,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchDisabledChoices:!1,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:function(e,t){var i=e.label,n=t.label,s=void 0===n?t.value:n;return O(void 0===i?e.value:i).localeCompare(O(s),[],{sensitivity:"base",ignorePunctuation:!0,numeric:!0})},shadowRoot:null,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",searchRenderSelectedChoices:!0,loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add <b>"'.concat(e,'"</b>')},removeItemIconText:function(){return"Remove item"},removeItemLabelText:function(e,t,i){return"Remove item: ".concat(i?I(i.label):e)},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:{containerOuter:["choices"],containerInner:["choices__inner"],input:["choices__input"],inputCloned:["choices__input--cloned"],list:["choices__list"],listItems:["choices__list--multiple"],listSingle:["choices__list--single"],listDropdown:["choices__list--dropdown"],item:["choices__item"],itemSelectable:["choices__item--selectable"],itemDisabled:["choices__item--disabled"],itemChoice:["choices__item--choice"],description:["choices__description"],placeholder:["choices__placeholder"],group:["choices__group"],groupHeading:["choices__heading"],button:["choices__button"],activeState:["is-active"],focusState:["is-focused"],openState:["is-open"],disabledState:["is-disabled"],highlightedState:["is-highlighted"],selectedState:["is-selected"],flippedState:["is-flipped"],loadingState:["is-loading"],invalidState:["is-invalid"],notice:["choices__notice"],addChoice:["choices__item--selectable","add-choice"],noResults:["has-no-results"],noChoices:["has-no-choices"]},appendGroupInSearch:!1},Z=function(e){var t=e.itemEl;t&&(t.remove(),e.itemEl=void 0)},$={groups:function(e,t){var i=e,n=!0;switch(t.type){case l:i.push(t.group);break;case c:i=[];break;default:n=!1}return{state:i,update:n}},items:function(e,t,i){var n=e,s=!0;switch(t.type){case h:t.item.selected=!0,(r=t.item.element)&&(r.selected=!0,r.setAttribute("selected","")),n.push(t.item);break;case d:var r;if(t.item.selected=!1,r=t.item.element){r.selected=!1,r.removeAttribute("selected");var a=r.parentElement;a&&z(a)&&a.type===_&&(a.value="")}Z(t.item),n=n.filter((function(e){return e.id!==t.item.id}));break;case o:Z(t.choice),n=n.filter((function(e){return e.id!==t.choice.id}));break;case u:var c=t.highlighted,l=n.find((function(e){return e.id===t.item.id}));l&&l.highlighted!==c&&(l.highlighted=c,i&&function(e,t,i){var n=e.itemEl;n&&(j(n,i),K(n,t))}(l,c?i.classNames.highlightedState:i.classNames.selectedState,c?i.classNames.selectedState:i.classNames.highlightedState));break;default:s=!1}return{state:n,update:s}},choices:function(e,t,i){var n=e,l=!0;switch(t.type){case s:n.push(t.choice);break;case o:t.choice.choiceEl=void 0,t.choice.group&&(t.choice.group.choices=t.choice.group.choices.filter((function(e){return e.id!==t.choice.id}))),n=n.filter((function(e){return e.id!==t.choice.id}));break;case h:case d:t.item.choiceEl=void 0;break;case r:var u=[];t.results.forEach((function(e){u[e.item.id]=e})),n.forEach((function(e){var t=u[e.id];void 0!==t?(e.score=t.score,e.rank=t.rank,e.active=!0):(e.score=0,e.rank=0,e.active=!1),i&&i.appendGroupInSearch&&(e.choiceEl=void 0)}));break;case a:n.forEach((function(e){e.active=t.active,i&&i.appendGroupInSearch&&(e.choiceEl=void 0)}));break;case c:n=[];break;default:l=!1}return{state:n,update:l}}},ee=function(){function e(e){this._state=this.defaultState,this._listeners=[],this._txn=0,this._context=e}return Object.defineProperty(e.prototype,"defaultState",{get:function(){return{groups:[],items:[],choices:[]}},enumerable:!1,configurable:!0}),e.prototype.changeSet=function(e){return{groups:e,items:e,choices:e}},e.prototype.reset=function(){this._state=this.defaultState;var e=this.changeSet(!0);this._txn?this._changeSet=e:this._listeners.forEach((function(t){return t(e)}))},e.prototype.subscribe=function(e){return this._listeners.push(e),this},e.prototype.dispatch=function(e){var t=this,i=this._state,n=!1,s=this._changeSet||this.changeSet(!1);Object.keys($).forEach((function(o){var r=$[o](i[o],e,t._context);r.update&&(n=!0,s[o]=!0,i[o]=r.state)})),n&&(this._txn?this._changeSet=s:this._listeners.forEach((function(e){return e(s)})))},e.prototype.withTxn=function(e){this._txn++;try{e()}finally{if(this._txn=Math.max(0,this._txn-1),!this._txn){var t=this._changeSet;t&&(this._changeSet=void 0,this._listeners.forEach((function(e){return e(t)})))}}},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this.state.items},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightedActiveItems",{get:function(){return this.items.filter((function(e){return e.active&&e.highlighted}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"choices",{get:function(){return this.state.choices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeChoices",{get:function(){return this.choices.filter((function(e){return e.active}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"searchableChoices",{get:function(){var e=this._context;return this.choices.filter((function(t){return!t.placeholder&&(e.searchDisabledChoices||!t.disabled)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groups",{get:function(){return this.state.groups},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeGroups",{get:function(){var e=this;return this.state.groups.filter((function(t){var i=t.active&&!t.disabled,n=e.state.choices.some((function(e){return e.active&&!e.disabled}));return i&&n}),[])},enumerable:!1,configurable:!0}),e.prototype.inTxn=function(){return this._txn>0},e.prototype.getChoiceById=function(e){return this.activeChoices.find((function(t){return t.id===e}))},e.prototype.getGroupById=function(e){return this.groups.find((function(t){return t.id===e}))},e}(),te="no-choices",ie="no-results",ne="add-choice";function se(e,t){if(0===e.length)return 0;for(var i=[0],n=1;n<e.length;n++){for(var s=i[n-1];s>0&&e.charAt(n)!==e.charAt(s);)s=i[s-1];e.charAt(n)===e.charAt(s)&&s++,i.push(s)}var o=0;for(n=0;n<t.length;n++){for(;o>0&&t.charAt(n)!==e.charAt(o);)o=i[o-1];if(t.charAt(n)===e.charAt(o)&&++o===e.length)return n-(o-1)}return-1}var oe=function(){function e(e){this._haystack=[],this._fields=e.searchFields}return e.prototype.index=function(e){this._haystack=e},e.prototype.reset=function(){this._haystack=[]},e.prototype.isEmptyIndex=function(){return!this._haystack.length},e.prototype.search=function(e){var t=this._fields;if(!t||!t.length||!e)return[];for(var i=e.toLowerCase(),n=[],s=0,o=0,r=this._haystack.length;o<r;o++)for(var a=this._haystack[o],c=0,l=this._fields.length;c<l;c++){var h=this._fields[c];if(h in a&&-1!==se(i,a[h].toLowerCase())){n.push({item:a,score:s,rank:s+1}),s++;break}}return n},e}(),re=function(e,t,i){var n=e.dataset,s=t.customProperties,o=t.labelClass,r=t.labelDescription;o&&(n.labelClass=k(o).join(" ")),r&&(n.labelDescription=O(r)),i&&s&&("string"==typeof s?n.customProperties=s:"object"!=typeof s||function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(s)||(n.customProperties=JSON.stringify(s)))},ae=function(e,t,i){var n=t&&e.querySelector("label[for='".concat(t,"']")),s=n&&n.innerText;s&&i.setAttribute("aria-label",s)},ce={containerOuter:function(e,t,i,n,s,o,r){var a=e.classNames.containerOuter,c=document.createElement("div");return K(c,a),c.dataset.type=o,t&&(c.dir=t),n&&(c.tabIndex=0),i&&(c.setAttribute("role",s?"combobox":"listbox"),s?c.setAttribute("aria-autocomplete","list"):r||ae(this._docRoot,this.passedElement.element.id,c),c.setAttribute("aria-haspopup","true"),c.setAttribute("aria-expanded","false")),r&&c.setAttribute("aria-labelledby",r),c},containerInner:function(e){var t=e.classNames.containerInner,i=document.createElement("div");return K(i,t),i},itemList:function(e,t){var i=e.searchEnabled,n=e.classNames,s=n.list,o=n.listSingle,r=n.listItems,a=document.createElement("div");return K(a,s),K(a,t?o:r),this._isSelectElement&&i&&a.setAttribute("role","listbox"),a},placeholder:function(e,t){var i=e.allowHTML,n=e.classNames.placeholder,s=document.createElement("div");return K(s,n),P(s,i,t),s},item:function(e,t,i){var n=e.allowHTML,s=e.removeItemButtonAlignLeft,o=e.removeItemIconText,r=e.removeItemLabelText,a=e.classNames,c=a.item,l=a.button,h=a.highlightedState,d=a.itemSelectable,u=a.placeholder,p=O(t.value),m=document.createElement("div");if(K(m,c),t.labelClass){var f=document.createElement("span");P(f,n,t.label),K(f,t.labelClass),m.appendChild(f)}else P(m,n,t.label);if(m.dataset.item="",m.dataset.id=t.id,m.dataset.value=p,re(m,t,!0),(t.disabled||this.containerOuter.isDisabled)&&m.setAttribute("aria-disabled","true"),this._isSelectElement&&(m.setAttribute("aria-selected","true"),m.setAttribute("role","option")),t.placeholder&&(K(m,u),m.dataset.placeholder=""),K(m,t.highlighted?h:d),i){t.disabled&&j(m,d),m.dataset.deletable="";var v=document.createElement("button");v.type="button",K(v,l);var _=L(t);P(v,!0,N(o,t.value,_));var g=N(r,t.value,_);g&&v.setAttribute("aria-label",g),v.dataset.button="",s?m.insertAdjacentElement("afterbegin",v):m.appendChild(v)}return m},choiceList:function(e,t){var i=e.classNames.list,n=document.createElement("div");return K(n,i),t||n.setAttribute("aria-multiselectable","true"),n.setAttribute("role","listbox"),n},choiceGroup:function(e,t){var i=e.allowHTML,n=e.classNames,s=n.group,o=n.groupHeading,r=n.itemDisabled,a=t.id,c=t.label,l=t.disabled,h=O(c),d=document.createElement("div");K(d,s),l&&K(d,r),d.setAttribute("role","group"),d.dataset.group="",d.dataset.id=a,d.dataset.value=h,l&&d.setAttribute("aria-disabled","true");var u=document.createElement("div");return K(u,o),P(u,i,c||""),d.appendChild(u),d},choice:function(e,t,i,n){var s=e.allowHTML,o=e.classNames,r=o.item,a=o.itemChoice,c=o.itemSelectable,l=o.selectedState,h=o.itemDisabled,d=o.description,u=o.placeholder,p=t.label,m=O(t.value),f=document.createElement("div");f.id=t.elementId,K(f,r),K(f,a),n&&"string"==typeof p&&(p=D(s,p),p={trusted:p+=" (".concat(n,")")});var v=f;if(t.labelClass){var _=document.createElement("span");P(_,s,p),K(_,t.labelClass),v=_,f.appendChild(_)}else P(f,s,p);if(t.labelDescription){var g="".concat(t.elementId,"-description");v.setAttribute("aria-describedby",g);var y=document.createElement("span");P(y,s,t.labelDescription),y.id=g,K(y,d),f.appendChild(y)}return t.selected&&K(f,l),t.placeholder&&K(f,u),f.setAttribute("role",t.group?"treeitem":"option"),f.dataset.choice="",f.dataset.id=t.id,f.dataset.value=m,i&&(f.dataset.selectText=i),t.group&&(f.dataset.groupId="".concat(t.group.id)),re(f,t,!1),t.disabled?(K(f,h),f.dataset.choiceDisabled="",f.setAttribute("aria-disabled","true")):(K(f,c),f.dataset.choiceSelectable="",f.setAttribute("aria-selected",t.selected?"true":"false")),f},input:function(e,t){var i=e.classNames,n=i.input,s=i.inputCloned,o=e.labelId,r=document.createElement("input");return r.type="search",K(r,n),K(r,s),r.autocomplete="off",r.autocapitalize="off",r.spellcheck=!1,r.setAttribute("aria-autocomplete","list"),t?r.setAttribute("aria-label",t):o||ae(this._docRoot,this.passedElement.element.id,r),r},dropdown:function(e){var t=e.classNames,i=t.list,n=t.listDropdown,s=document.createElement("div");return K(s,i),K(s,n),s.setAttribute("aria-expanded","false"),s},notice:function(e,t,i){var n=e.classNames,s=n.item,o=n.itemChoice,r=n.addChoice,a=n.noResults,c=n.noChoices,l=n.notice;void 0===i&&(i="");var h=document.createElement("div");switch(P(h,!0,t),K(h,s),K(h,o),K(h,l),i){case ne:K(h,r);break;case ie:K(h,a);break;case te:K(h,c)}return i===ne&&(h.dataset.choiceSelectable="",h.dataset.choice=""),h},option:function(e){var t=O(e.label),i=new Option(t,e.value,!1,e.selected);return re(i,e,!0),i.disabled=e.disabled,e.selected&&i.setAttribute("selected",""),i}},le="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,he={},de=function(e){if(e)return e.dataset.id?parseInt(e.dataset.id,10):void 0},ue="[data-choice-selectable]";return function(){function e(t,n){void 0===t&&(t="[data-choice]"),void 0===n&&(n={});var s=this;this.initialisedOK=void 0,this._hasNonChoicePlaceholder=!1,this._lastAddedChoiceId=0,this._lastAddedGroupId=0;var o=e.defaults;this.config=i(i(i({},o.allOptions),o.options),n),v.forEach((function(e){s.config[e]=i(i(i({},o.allOptions[e]),o.options[e]),n[e])}));var r=this.config;r.silent||this._validateConfig();var a=r.shadowRoot||document.documentElement;this._docRoot=a;var c="string"==typeof t?a.querySelector(t):t;if(!c||"object"!=typeof c||"INPUT"!==c.tagName&&!z(c)){if(!c&&"string"==typeof t)throw TypeError("Selector ".concat(t," failed to find an element"));throw TypeError("Expected one of the following types text|select-one|select-multiple")}var l=c.type,h="text"===l;(h||1!==r.maxItemCount)&&(r.singleModeForMultiSelect=!1),r.singleModeForMultiSelect&&(l=g);var d=l===_,u=l===g,p=d||u;if(this._elementType=l,this._isTextElement=h,this._isSelectOneElement=d,this._isSelectMultipleElement=u,this._isSelectElement=d||u,this._canAddUserChoices=h&&r.addItems||p&&r.addChoices,"boolean"!=typeof r.renderSelectedChoices&&(r.renderSelectedChoices="always"===r.renderSelectedChoices||d),r.closeDropdownOnSelect="auto"===r.closeDropdownOnSelect?h||d||r.singleModeForMultiSelect:W(r.closeDropdownOnSelect),r.placeholder&&(r.placeholderValue?this._hasNonChoicePlaceholder=!0:c.dataset.placeholder&&(this._hasNonChoicePlaceholder=!0,r.placeholderValue=c.dataset.placeholder)),n.addItemFilter&&"function"!=typeof n.addItemFilter){var m=n.addItemFilter instanceof RegExp?n.addItemFilter:new RegExp(n.addItemFilter);r.addItemFilter=m.test.bind(m)}if(this.passedElement=this._isTextElement?new G({element:c,classNames:r.classNames}):new Q({element:c,classNames:r.classNames,template:function(e){return s._templates.option(e)},extractPlaceholder:r.placeholder&&!this._hasNonChoicePlaceholder}),this.initialised=!1,this._store=new ee(r),this._currentValue="",r.searchEnabled=!h&&r.searchEnabled,this._canSearch=r.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=function(e){var t=e.id||e.name&&"".concat(e.name,"-").concat(S(2))||S(4);return t=t.replace(/(:|\.|\[|\]|,)/g,""),"".concat("choices-","-").concat(t)}(c),this._direction=c.dir,!this._direction){var f=window.getComputedStyle(c).direction;f!==window.getComputedStyle(document.documentElement).direction&&(this._direction=f)}if(this._idNames={itemChoice:"item-choice"},this._templates=o.templates,this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onInput=this._onInput.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onSelectKey=this._onSelectKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),this._onChange=this._onChange.bind(this),this._onInvalid=this._onInvalid.bind(this),this.passedElement.isActive)return r.silent||console.warn("Trying to initialise Choices on element already initialised",{element:t}),this.initialised=!0,void(this.initialisedOK=!1);this.init(),this._initialItems=this._store.items.map((function(e){return e.value}))}return Object.defineProperty(e,"defaults",{get:function(){return Object.preventExtensions({get options(){return he},get allOptions(){return Y},get templates(){return ce}})},enumerable:!1,configurable:!0}),e.prototype.init=function(){if(!this.initialised&&void 0===this.initialisedOK){this._searcher=new oe(this.config),this._loadChoices(),this._createTemplates(),this._createElements(),this._createStructure(),this._isTextElement&&!this.config.addItems||this.passedElement.element.hasAttribute("disabled")||this.passedElement.element.closest("fieldset:disabled")?this.disable():(this.enable(),this._addEventListeners()),this._initStore(),this.initialised=!0,this.initialisedOK=!0;var e=this.config.callbackOnInit;"function"==typeof e&&e.call(this)}},e.prototype.destroy=function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this._store._listeners=[],this.clearStore(!1),this._stopSearch(),this._templates=e.defaults.templates,this.initialised=!1,this.initialisedOK=void 0)},e.prototype.enable=function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this},e.prototype.disable=function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this},e.prototype.highlightItem=function(e,t){if(void 0===t&&(t=!0),!e||!e.id)return this;var i=this._store.items.find((function(t){return t.id===e.id}));return!i||i.highlighted||(this._store.dispatch(C(i,!0)),t&&this.passedElement.triggerEvent(f,L(i))),this},e.prototype.unhighlightItem=function(e,t){if(void 0===t&&(t=!0),!e||!e.id)return this;var i=this._store.items.find((function(t){return t.id===e.id}));return i&&i.highlighted?(this._store.dispatch(C(i,!1)),t&&this.passedElement.triggerEvent("unhighlightItem",L(i)),this):this},e.prototype.highlightAll=function(){var e=this;return this._store.withTxn((function(){e._store.items.forEach((function(t){t.highlighted||(e._store.dispatch(C(t,!0)),e.passedElement.triggerEvent(f,L(t)))}))})),this},e.prototype.unhighlightAll=function(){var e=this;return this._store.withTxn((function(){e._store.items.forEach((function(t){t.highlighted&&(e._store.dispatch(C(t,!1)),e.passedElement.triggerEvent(f,L(t)))}))})),this},e.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.withTxn((function(){t._store.items.filter((function(t){return t.value===e})).forEach((function(e){return t._removeItem(e)}))})),this},e.prototype.removeActiveItems=function(e){var t=this;return this._store.withTxn((function(){t._store.items.filter((function(t){return t.id!==e})).forEach((function(e){return t._removeItem(e)}))})),this},e.prototype.removeHighlightedItems=function(e){var t=this;return void 0===e&&(e=!1),this._store.withTxn((function(){t._store.highlightedActiveItems.forEach((function(i){t._removeItem(i),e&&t._triggerChange(i.value)}))})),this},e.prototype.showDropdown=function(e){var t=this;return this.dropdown.isActive||(void 0===e&&(e=!this._canSearch),requestAnimationFrame((function(){t.dropdown.show();var i=t.dropdown.element.getBoundingClientRect();t.containerOuter.open(i.bottom,i.height),e||t.input.focus(),t.passedElement.triggerEvent("showDropdown");var n=t.choiceList.element.querySelector(M(t.config.classNames.selectedState));null===n||w(n,t.choiceList.element)||(t.choiceList.element.scrollTop=n.offsetTop)}))),this},e.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(this._removeHighlightedChoices(),requestAnimationFrame((function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent("hideDropdown")})),this):this},e.prototype.getValue=function(e){var t=this._store.items.map((function(t){return e?t.value:L(t)}));return this._isSelectOneElement||this.config.singleModeForMultiSelect?t[0]:t},e.prototype.setValue=function(e){var t=this;return this.initialisedOK?(this._store.withTxn((function(){e.forEach((function(e){e&&t._addChoice(J(e,!1))}))})),this._searcher.reset(),this):(this._warnChoicesInitFailed("setValue"),this)},e.prototype.setChoiceByValue=function(e){var t=this;return this.initialisedOK?(this._isTextElement||(this._store.withTxn((function(){(Array.isArray(e)?e:[e]).forEach((function(e){return t._findAndSelectChoiceByValue(e)})),t.unhighlightAll()})),this._searcher.reset()),this):(this._warnChoicesInitFailed("setChoiceByValue"),this)},e.prototype.setChoices=function(e,t,n,s,o,r){var a=this;if(void 0===e&&(e=[]),void 0===t&&(t="value"),void 0===n&&(n="label"),void 0===s&&(s=!1),void 0===o&&(o=!0),void 0===r&&(r=!1),!this.initialisedOK)return this._warnChoicesInitFailed("setChoices"),this;if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof t||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if("function"==typeof e){var c=e(this);if("function"==typeof Promise&&c instanceof Promise)return new Promise((function(e){return requestAnimationFrame(e)})).then((function(){return a._handleLoadingState(!0)})).then((function(){return c})).then((function(e){return a.setChoices(e,t,n,s,o,r)})).catch((function(e){a.config.silent||console.error(e)})).then((function(){return a._handleLoadingState(!1)})).then((function(){return a}));if(!Array.isArray(c))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof c));e=c}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._store.withTxn((function(){o&&(a._isSearching=!1),s&&a.clearChoices(!0,r);var c="value"===t,l="label"===n;e.forEach((function(e){if("choices"in e){var s=e;l||(s=i(i({},s),{label:s[n]})),a._addGroup(J(s,!0))}else{var o=e;l&&c||(o=i(i({},o),{value:o[t],label:o[n]}));var r=J(o,!1);a._addChoice(r),r.placeholder&&!a._hasNonChoicePlaceholder&&(a._placeholderValue=x(r.label))}})),a.unhighlightAll()})),this.dropdown.isActive&&this._canAddUserChoices&&this._canCreateItem(this.input.value),this._searcher.reset(),this},e.prototype.refresh=function(e,t,i){var n=this;return void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===i&&(i=!1),this._isSelectElement?(this._store.withTxn((function(){var s=n.passedElement.optionsAsChoices(),o={};i||n._store.items.forEach((function(e){e.id&&e.active&&e.selected&&(o[e.value]=!0)})),n.clearStore(!1);var r=function(e){i?n._store.dispatch(E(e)):o[e.value]&&(e.selected=!0)};s.forEach((function(e){"choices"in e?e.choices.forEach(r):r(e)})),n._addPredefinedChoices(s,t,e),n._isSearching&&n._searchChoices(n.input.value)})),this):(this.config.silent||console.warn("refresh method can only be used on choices backed by a <select> element"),this)},e.prototype.removeChoice=function(e){var t=this._store.choices.find((function(t){return t.value===e}));return t?(this._clearNotice(),this._store.dispatch(function(e){return{type:o,choice:e}}(t)),this._searcher.reset(),t.selected&&this.passedElement.triggerEvent(m,L(t)),this):this},e.prototype.clearChoices=function(e,t){var i=this;return void 0===e&&(e=!0),void 0===t&&(t=!1),e&&(t?this.passedElement.element.replaceChildren(""):this.passedElement.element.querySelectorAll(":not([selected])").forEach((function(e){e.remove()}))),this.itemList.element.replaceChildren(""),this.choiceList.element.replaceChildren(""),this._clearNotice(),this._store.withTxn((function(){var e=t?[]:i._store.items;i._store.reset(),e.forEach((function(e){i._store.dispatch(y(e)),i._store.dispatch(b(e))}))})),this._searcher.reset(),this},e.prototype.clearStore=function(e){return void 0===e&&(e=!0),this.clearChoices(e,!0),this._stopSearch(),this._lastAddedChoiceId=0,this._lastAddedGroupId=0,this},e.prototype.clearInput=function(){return this.input.clear(!this._isSelectOneElement),this._stopSearch(),this},e.prototype._validateConfig=function(){var e,t,i,n=this.config,s=(e=Y,t=Object.keys(n).sort(),i=Object.keys(e).sort(),t.filter((function(e){return i.indexOf(e)<0})));s.length&&console.warn("Unknown config option(s) passed",s.join(", ")),n.allowHTML&&n.allowHtmlUserInput&&(n.addItems&&console.warn("Warning: allowHTML/allowHtmlUserInput/addItems all being true is strongly not recommended and may lead to XSS attacks"),n.addChoices&&console.warn("Warning: allowHTML/allowHtmlUserInput/addChoices all being true is strongly not recommended and may lead to XSS attacks"))},e.prototype._render=function(e){void 0===e&&(e={choices:!0,groups:!0,items:!0}),this._store.inTxn()||(this._isSelectElement&&(e.choices||e.groups)&&this._renderChoices(),e.items&&this._renderItems())},e.prototype._renderChoices=function(){var e=this;if(this._canAddItems()){var t=this.config,i=this._isSearching,n=this._store,s=n.activeGroups,o=n.activeChoices,r=i?t.searchResultLimit:t.renderChoiceLimit;if(this._isSelectElement){var a=o.filter((function(e){return!e.element}));a.length&&this.passedElement.addOptions(a)}var c=document.createDocumentFragment(),l=function(e){return e.filter((function(e){return!e.placeholder&&(i?(t.searchRenderSelectedChoices||!e.selected)&&!!e.rank:t.renderSelectedChoices||!e.selected)}))},h=t.appendGroupInSearch&&i,d=!1,u=null,p=function(n,s){i?n.sort(F):t.shouldSort&&n.sort(t.sorter);var o=n.length;o=!s&&r>0&&o>r?r:o,o--,n.every((function(n,s){var r=n.choiceEl||e._templates.choice(t,n,t.itemSelectText,h&&n.group?n.group.label:void 0);return n.choiceEl=r,c.appendChild(r),i||!n.selected?d=!0:u||(u=r),s<o}))};o.length&&(t.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),this._hasNonChoicePlaceholder||i||!this._isSelectOneElement||p(o.filter((function(e){return e.placeholder&&!e.group})),!1),s.length&&!i?(t.shouldSort&&s.sort(t.sorter),p(o.filter((function(e){return!e.placeholder&&!e.group})),!1),s.forEach((function(t){var i=l(t.choices);if(i.length){if(t.label){var n=t.groupEl||e._templates.choiceGroup(e.config,t);t.groupEl=n,n.remove(),c.appendChild(n)}p(i,!0)}}))):p(l(o),!1)),d||!i&&c.children.length&&t.renderSelectedChoices||(this._notice||(this._notice={text:T(i?t.noResultsText:t.noChoicesText),type:i?ie:te}),c.replaceChildren("")),this._renderNotice(c),this.choiceList.element.replaceChildren(c),this._highlightChoice(u)}},e.prototype._renderItems=function(){var e=this,t=this._store.items||[],i=this.itemList.element,n=this.config,s=document.createDocumentFragment(),o=function(e){return i.querySelector('[data-item][data-id="'.concat(e.id,'"]'))},r=function(t){var i=t.itemEl;i&&i.parentElement||(i=o(t)||e._templates.item(n,t,n.removeItemButton),t.itemEl=i,s.appendChild(i))};t.forEach(r);var a=!!s.childNodes.length;if(this._isSelectOneElement){var c=i.children.length;if(a||c>1){var l=i.querySelector(M(n.classNames.placeholder));l&&l.remove()}else a||c||!this._placeholderValue||(a=!0,r(J({selected:!0,value:"",label:this._placeholderValue,placeholder:!0},!1)))}a&&(i.append(s),n.shouldSortItems&&!this._isSelectOneElement&&(t.sort(n.sorter),t.forEach((function(e){var t=o(e);t&&(t.remove(),s.append(t))})),i.append(s))),this._isTextElement&&(this.passedElement.value=t.map((function(e){return e.value})).join(n.delimiter))},e.prototype._displayNotice=function(e,t,i){void 0===i&&(i=!0);var n=this._notice;n&&(n.type===t&&n.text===e||n.type===ne&&(t===ie||t===te))?i&&this.showDropdown(!0):(this._clearNotice(),this._notice=e?{text:e,type:t}:void 0,this._renderNotice(),i&&e&&this.showDropdown(!0))},e.prototype._clearNotice=function(){if(this._notice){var e=this.choiceList.element.querySelector(M(this.config.classNames.notice));e&&e.remove(),this._notice=void 0}},e.prototype._renderNotice=function(e){var t=this._notice;if(t){var i=this._templates.notice(this.config,t.text,t.type);e?e.append(i):this.choiceList.prepend(i)}},e.prototype._getChoiceForOutput=function(e,t){return L(e,t)},e.prototype._triggerChange=function(e){null!=e&&this.passedElement.triggerEvent("change",{value:e})},e.prototype._handleButtonAction=function(e){var t=this,i=this._store.items;if(i.length&&this.config.removeItems&&this.config.removeItemButton){var n=e&&de(e.closest("[data-id]")),s=n&&i.find((function(e){return e.id===n}));s&&this._store.withTxn((function(){if(t._removeItem(s),t._triggerChange(s.value),t._isSelectOneElement&&!t._hasNonChoicePlaceholder){var e=(t.config.shouldSort?t._store.choices.reverse():t._store.choices).find((function(e){return e.placeholder}));e&&(t._addItem(e),t.unhighlightAll(),e.value&&t._triggerChange(e.value))}}))}},e.prototype._handleItemAction=function(e,t){var i=this;void 0===t&&(t=!1);var n=this._store.items;if(n.length&&this.config.removeItems&&!this._isSelectOneElement){var s=de(e);s&&(n.forEach((function(e){e.id!==s||e.highlighted?!t&&e.highlighted&&i.unhighlightItem(e):i.highlightItem(e)})),this.input.focus())}},e.prototype._handleChoiceAction=function(e){var t=this,i=de(e),n=i&&this._store.getChoiceById(i);if(!n||n.disabled)return!1;var s=this.dropdown.isActive;if(!n.selected){if(!this._canAddItems())return!0;this._store.withTxn((function(){t._addItem(n,!0,!0),t.clearInput(),t.unhighlightAll()})),this._triggerChange(n.value)}return s&&this.config.closeDropdownOnSelect&&(this.hideDropdown(!0),this.containerOuter.element.focus()),!0},e.prototype._handleBackspace=function(e){var t=this.config;if(t.removeItems&&e.length){var i=e[e.length-1],n=e.some((function(e){return e.highlighted}));t.editItems&&!n&&i?(this.input.value=i.value,this.input.setWidth(),this._removeItem(i),this._triggerChange(i.value)):(n||this.highlightItem(i,!1),this.removeHighlightedItems(!0))}},e.prototype._loadChoices=function(){var e,t=this,i=this.config;if(this._isTextElement){if(this._presetChoices=i.items.map((function(e){return J(e,!1)})),this.passedElement.value){var n=this.passedElement.value.split(i.delimiter).map((function(e){return J(e,!1,t.config.allowHtmlUserInput)}));this._presetChoices=this._presetChoices.concat(n)}this._presetChoices.forEach((function(e){e.selected=!0}))}else if(this._isSelectElement){this._presetChoices=i.choices.map((function(e){return J(e,!0)}));var s=this.passedElement.optionsAsChoices();s&&(e=this._presetChoices).push.apply(e,s)}},e.prototype._handleLoadingState=function(e){void 0===e&&(e=!0);var t=this.itemList.element;e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t.replaceChildren(this._templates.placeholder(this.config,this.config.loadingText)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?(t.replaceChildren(""),this._render()):this.input.placeholder=this._placeholderValue||"")},e.prototype._handleSearch=function(e){if(this.input.isFocussed)if(null!=e&&e.length>=this.config.searchFloor){var t=this.config.searchChoices?this._searchChoices(e):0;null!==t&&this.passedElement.triggerEvent(p,{value:e,resultCount:t})}else this._store.choices.some((function(e){return!e.active}))&&this._stopSearch()},e.prototype._canAddItems=function(){var e=this.config,t=e.maxItemCount,i=e.maxItemText;return!e.singleModeForMultiSelect&&t>0&&t<=this._store.items.length?(this.choiceList.element.replaceChildren(""),this._notice=void 0,this._displayNotice("function"==typeof i?i(t):i,ne,!1),!1):(this._notice&&this._notice.type===ne&&this._clearNotice(),!0)},e.prototype._canCreateItem=function(e){var t=this.config,i=!0,n="";if(i&&"function"==typeof t.addItemFilter&&!t.addItemFilter(e)&&(i=!1,n=N(t.customAddItemText,e,void 0)),i&&this._store.choices.find((function(i){return t.valueComparer(i.value,e)}))){if(this._isSelectElement)return this._displayNotice("",ne),!1;t.duplicateItemsAllowed||(i=!1,n=N(t.uniqueItemText,e,void 0))}return i&&(n=N(t.addItemText,e,void 0)),n&&this._displayNotice(n,ne),i},e.prototype._searchChoices=function(e){var t=e.trim().replace(/\s{2,}/," ");if(!t.length||t===this._currentValue)return null;var i=this._searcher;i.isEmptyIndex()&&i.index(this._store.searchableChoices);var n=i.search(t);this._currentValue=t,this._highlightPosition=0,this._isSearching=!0;var s=this._notice;return(s&&s.type)!==ne&&(n.length?this._clearNotice():this._displayNotice(T(this.config.noResultsText),ie)),this._store.dispatch(function(e){return{type:r,results:e}}(n)),n.length},e.prototype._stopSearch=function(){this._isSearching&&(this._currentValue="",this._isSearching=!1,this._clearNotice(),this._store.dispatch({type:a,active:!0}),this.passedElement.triggerEvent(p,{value:"",resultCount:0}))},e.prototype._addEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,i=this.input.element,n=this.passedElement.element;e.addEventListener("touchend",this._onTouchEnd,!0),t.addEventListener("keydown",this._onKeyDown,!0),t.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(t.addEventListener("focus",this._onFocus,{passive:!0}),t.addEventListener("blur",this._onBlur,{passive:!0})),i.addEventListener("keyup",this._onKeyUp,{passive:!0}),i.addEventListener("input",this._onInput,{passive:!0}),i.addEventListener("focus",this._onFocus,{passive:!0}),i.addEventListener("blur",this._onBlur,{passive:!0}),i.form&&i.form.addEventListener("reset",this._onFormReset,{passive:!0}),n.hasAttribute("required")&&(n.addEventListener("change",this._onChange,{passive:!0}),n.addEventListener("invalid",this._onInvalid,{passive:!0})),this.input.addEventListeners()},e.prototype._removeEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,i=this.input.element,n=this.passedElement.element;e.removeEventListener("touchend",this._onTouchEnd,!0),t.removeEventListener("keydown",this._onKeyDown,!0),t.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(t.removeEventListener("focus",this._onFocus),t.removeEventListener("blur",this._onBlur)),i.removeEventListener("keyup",this._onKeyUp),i.removeEventListener("input",this._onInput),i.removeEventListener("focus",this._onFocus),i.removeEventListener("blur",this._onBlur),i.form&&i.form.removeEventListener("reset",this._onFormReset),n.hasAttribute("required")&&(n.removeEventListener("change",this._onChange),n.removeEventListener("invalid",this._onInvalid)),this.input.removeEventListeners()},e.prototype._onKeyDown=function(e){var t=e.keyCode,i=this.dropdown.isActive,n=1===e.key.length||2===e.key.length&&e.key.charCodeAt(0)>=55296||"Unidentified"===e.key;switch(this._isTextElement||i||27===t||9===t||16===t||(this.showDropdown(),!this.input.isFocussed&&n&&(this.input.value+=e.key," "===e.key&&e.preventDefault())),t){case 65:return this._onSelectKey(e,this.itemList.element.hasChildNodes());case 13:return this._onEnterKey(e,i);case 27:return this._onEscapeKey(e,i);case 38:case 33:case 40:case 34:return this._onDirectionKey(e,i);case 8:case 46:return this._onDeleteKey(e,this._store.items,this.input.isFocussed)}},e.prototype._onKeyUp=function(){this._canSearch=this.config.searchEnabled},e.prototype._onInput=function(){var e=this.input.value;e?this._canAddItems()&&(this._canSearch&&this._handleSearch(e),this._canAddUserChoices&&(this._canCreateItem(e),this._isSelectElement&&(this._highlightPosition=0,this._highlightChoice()))):this._isTextElement?this.hideDropdown(!0):this._stopSearch()},e.prototype._onSelectKey=function(e,t){(e.ctrlKey||e.metaKey)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e,t){var i=this,n=this.input.value,s=e.target;if(e.preventDefault(),s&&s.hasAttribute("data-button"))this._handleButtonAction(s);else if(t){var o=this.dropdown.element.querySelector(M(this.config.classNames.highlightedState));if(!o||!this._handleChoiceAction(o))if(s&&n){if(this._canAddItems()){var r=!1;this._store.withTxn((function(){if(!(r=i._findAndSelectChoiceByValue(n,!0))){if(!i._canAddUserChoices)return;if(!i._canCreateItem(n))return;i._addChoice(J(n,!1,i.config.allowHtmlUserInput),!0,!0),r=!0}i.clearInput(),i.unhighlightAll()})),r&&(this._triggerChange(n),this.config.closeDropdownOnSelect&&this.hideDropdown(!0))}}else this.hideDropdown(!0)}else(this._isSelectElement||this._notice)&&this.showDropdown()},e.prototype._onEscapeKey=function(e,t){t&&(e.stopPropagation(),this.hideDropdown(!0),this._stopSearch(),this.containerOuter.element.focus())},e.prototype._onDirectionKey=function(e,t){var i=e.keyCode;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var n=40===i||34===i?1:-1,s=void 0;if(e.metaKey||34===i||33===i)s=this.dropdown.element.querySelector(n>0?"".concat(ue,":last-of-type"):ue);else{var o=this.dropdown.element.querySelector(M(this.config.classNames.highlightedState));s=o?function(e,t,i){void 0===i&&(i=1);for(var n="".concat(i>0?"next":"previous","ElementSibling"),s=e[n];s;){if(s.matches(t))return s;s=s[n]}return null}(o,ue,n):this.dropdown.element.querySelector(ue)}s&&(w(s,this.choiceList.element,n)||this.choiceList.scrollToChildElement(s,n),this._highlightChoice(s)),e.preventDefault()}},e.prototype._onDeleteKey=function(e,t,i){this._isSelectOneElement||e.target.value||!i||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()),this._wasTap=!0},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof Element){if(le&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild;this._isScrollingOnIe="ltr"===this._direction?e.offsetX>=i.offsetWidth:e.offsetX<i.offsetLeft}if(t!==this.input.element){var n=t.closest("[data-button],[data-item],[data-choice]");n instanceof HTMLElement&&("button"in n.dataset?this._handleButtonAction(n):"item"in n.dataset?this._handleItemAction(n,e.shiftKey):"choice"in n.dataset&&this._handleChoiceAction(n)),e.preventDefault()}}},e.prototype._onMouseOver=function(e){var t=e.target;t instanceof HTMLElement&&"choice"in t.dataset&&this._highlightChoice(t)},e.prototype._onClick=function(e){var t=e.target,i=this.containerOuter;i.element.contains(t)?this.dropdown.isActive||i.isDisabled?this._isSelectOneElement&&t!==this.input.element&&!this.dropdown.element.contains(t)&&this.hideDropdown():this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(this.showDropdown(),i.element.focus()):(i.removeFocusState(),this.hideDropdown(!0),this.unhighlightAll())},e.prototype._onFocus=function(e){var t=e.target,i=this.containerOuter;if(t&&i.element.contains(t)){var n=t===this.input.element;this._isTextElement?n&&i.addFocusState():this._isSelectMultipleElement?n&&(this.showDropdown(!0),i.addFocusState()):(i.addFocusState(),n&&this.showDropdown(!0))}},e.prototype._onBlur=function(e){var t=e.target,i=this.containerOuter;t&&i.element.contains(t)&&!this._isScrollingOnIe?t===this.input.element?(i.removeFocusState(),this.hideDropdown(!0),(this._isTextElement||this._isSelectMultipleElement)&&this.unhighlightAll()):t===this.containerOuter.element&&(i.removeFocusState(),this.config.searchEnabled||this.hideDropdown(!0)):(this._isScrollingOnIe=!1,this.input.element.focus())},e.prototype._onFormReset=function(){var e=this;this._store.withTxn((function(){e.clearInput(),e.hideDropdown(),e.refresh(!1,!1,!0),e._initialItems.length&&e.setChoiceByValue(e._initialItems)}))},e.prototype._onChange=function(e){e.target.checkValidity()&&this.containerOuter.removeInvalidState()},e.prototype._onInvalid=function(){this.containerOuter.addInvalidState()},e.prototype._removeHighlightedChoices=function(){var e=this.config.classNames.highlightedState;Array.from(this.dropdown.element.querySelectorAll(M(e))).forEach((function(t){j(t,e),t.setAttribute("aria-selected","false")}))},e.prototype._highlightChoice=function(e){void 0===e&&(e=null);var t=Array.from(this.dropdown.element.querySelectorAll(ue));if(t.length){var i=e,n=this.config.classNames.highlightedState;this._removeHighlightedChoices(),i?this._highlightPosition=t.indexOf(i):(i=t.length>this._highlightPosition?t[this._highlightPosition]:t[t.length-1])||(i=t[0]),K(i,n),i.setAttribute("aria-selected","true"),this.passedElement.triggerEvent("highlightChoice",{el:i}),this.dropdown.isActive&&(this.input.setActiveDescendant(i.id),this.containerOuter.setActiveDescendant(i.id))}},e.prototype._addItem=function(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!e.id)throw new TypeError("item.id must be set before _addItem is called for a choice/item");if((this.config.singleModeForMultiSelect||this._isSelectOneElement)&&this.removeActiveItems(e.id),this._store.dispatch(b(e)),t){var n=L(e);this.passedElement.triggerEvent("addItem",n),i&&this.passedElement.triggerEvent("choice",n)}},e.prototype._removeItem=function(e){if(e.id){this._store.dispatch(E(e));var t=this._notice;t&&t.type===te&&this._clearNotice(),this.passedElement.triggerEvent(m,L(e))}},e.prototype._addChoice=function(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),e.id)throw new TypeError("Can not re-add a choice which has already been added");var n=this.config;if(n.duplicateItemsAllowed||!this._store.choices.find((function(t){return n.valueComparer(t.value,e.value)}))){this._lastAddedChoiceId++,e.id=this._lastAddedChoiceId,e.elementId="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(e.id);var s=n.prependValue,o=n.appendValue;s&&(e.value=s+e.value),o&&(e.value+=o.toString()),(s||o)&&e.element&&(e.element.value=e.value),this._clearNotice(),this._store.dispatch(y(e)),e.selected&&this._addItem(e,t,i)}},e.prototype._addGroup=function(e,t){var i=this;if(void 0===t&&(t=!0),e.id)throw new TypeError("Can not re-add a group which has already been added");this._store.dispatch(function(e){return{type:l,group:e}}(e)),e.choices&&(this._lastAddedGroupId++,e.id=this._lastAddedGroupId,e.choices.forEach((function(n){n.group=e,e.disabled&&(n.disabled=!0),i._addChoice(n,t)})))},e.prototype._createTemplates=function(){var e=this,t=this.config.callbackOnCreateTemplates,i={};"function"==typeof t&&(i=t.call(this,A,D,k));var n={};Object.keys(this._templates).forEach((function(t){n[t]=t in i?i[t].bind(e):e._templates[t].bind(e)})),this._templates=n},e.prototype._createElements=function(){var e=this._templates,t=this.config,i=this._isSelectOneElement,n=t.position,s=t.classNames,o=this._elementType;this.containerOuter=new H({element:e.containerOuter(t,this._direction,this._isSelectElement,i,t.searchEnabled,o,t.labelId),classNames:s,type:o,position:n}),this.containerInner=new H({element:e.containerInner(t),classNames:s,type:o,position:n}),this.input=new R({element:e.input(t,this._placeholderValue),classNames:s,type:o,preventPaste:!t.paste}),this.choiceList=new q({element:e.choiceList(t,i)}),this.itemList=new q({element:e.itemList(t,i)}),this.dropdown=new B({element:e.dropdown(t),classNames:s,type:o})},e.prototype._createStructure=function(){var e=this,t=e.containerInner,i=e.containerOuter,n=e.passedElement,s=this.dropdown.element;n.conceal(),t.wrap(n.element),i.wrap(t.element),i.element.appendChild(t.element),i.element.appendChild(s),t.element.appendChild(this.itemList.element),s.appendChild(this.choiceList.element),this._isSelectOneElement?(this.input.placeholder=this.config.searchPlaceholderValue||"",this.config.searchEnabled&&s.insertBefore(this.input.element,s.firstChild)):(this._isSelectMultipleElement&&!this.config.searchEnabled||t.element.appendChild(this.input.element),this._placeholderValue&&(this.input.placeholder=this._placeholderValue),this.input.setWidth()),this._highlightPosition=0,this._isSearching=!1},e.prototype._initStore=function(){var e=this;this._store.subscribe(this._render).withTxn((function(){e._addPredefinedChoices(e._presetChoices,e._isSelectOneElement&&!e._hasNonChoicePlaceholder,!1)})),(!this._store.choices.length||this._isSelectOneElement&&this._hasNonChoicePlaceholder)&&this._render()},e.prototype._addPredefinedChoices=function(e,t,i){var n=this;void 0===t&&(t=!1),void 0===i&&(i=!0),t&&-1===e.findIndex((function(e){return e.selected}))&&e.some((function(e){return!e.disabled&&!("choices"in e)&&(e.selected=!0,!0)})),e.forEach((function(e){"choices"in e?n._isSelectElement&&n._addGroup(e,i):n._addChoice(e,i)}))},e.prototype._findAndSelectChoiceByValue=function(e,t){var i=this;void 0===t&&(t=!1);var n=this._store.choices.find((function(t){return i.config.valueComparer(t.value,e)}));return!(!n||n.disabled||n.selected||(this._addItem(n,!0,t),0))},e.prototype._generatePlaceholderValue=function(){var e=this.config;if(!e.placeholder)return null;if(this._hasNonChoicePlaceholder)return e.placeholderValue;if(this._isSelectElement){var t=this.passedElement.placeholderOption;return t?t.text:null}return null},e.prototype._warnChoicesInitFailed=function(e){if(!this.config.silent){if(!this.initialised)throw new TypeError("".concat(e," called on a non-initialised instance of Choices"));if(!this.initialisedOK)throw new TypeError("".concat(e," called for an element which has multiple instances of Choices initialised on it"))}},e.version="11.2.3",e}()}));
1
+ /*! choices.js v11.2.4 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Choices=t()}(this,(function(){"use strict";var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};function t(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var n,s="ADD_CHOICE",o="REMOVE_CHOICE",r="FILTER_CHOICES",a="ACTIVATE_CHOICES",c="CLEAR_CHOICES",l="ADD_GROUP",h="ADD_ITEM",d="REMOVE_ITEM",u="HIGHLIGHT_ITEM",p="search",m="removeItem",f="highlightItem",v=["fuseOptions","classNames"],_="text",g="select-one",y="select-multiple",b=function(e){return{type:s,choice:e}},E=function(e){return{type:h,item:e}},C=function(e){return{type:d,item:e}},S=function(e,t){return{type:u,item:e,highlighted:t}},w=function(e){return Array.from({length:e},(function(){return Math.floor(36*Math.random()+0).toString(36)})).join("")},I=function(e,t,i){return void 0===i&&(i=1),i>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop},A=function(e){if("string"!=typeof e){if(null==e)return"";if("object"==typeof e){if("raw"in e)return A(e.raw);if("trusted"in e)return e.trusted}return e}return e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;")},T=(n=document.createElement("div"),function(e){n.innerHTML=e.trim();for(var t=n.children[0];n.firstChild;)n.removeChild(n.firstChild);return t}),O=function(e){return"function"==typeof e?e():e},x=function(e){if("string"==typeof e)return e;if("object"==typeof e){if("trusted"in e)return e.trusted;if("raw"in e)return e.raw}return""},L=function(e){if("string"==typeof e)return e;if("object"==typeof e){if("escaped"in e)return e.escaped;if("trusted"in e)return e.trusted}return""},N=function(e,t){return{id:e.id,highlighted:e.highlighted,labelClass:e.labelClass,labelDescription:x(e.labelDescription),customProperties:e.customProperties,disabled:e.disabled,active:e.active,label:e.label,placeholder:e.placeholder,value:e.value,groupValue:e.group?e.group.label:void 0,element:e.element,keyCode:t}},D=function(e,t,i){return"function"==typeof e?e(A(t),x(t),i):e},P=function(e,t){return e?L(t):A(t)},F=function(e,t,i){e.innerHTML=P(t,i)},k=function(e,t){return e.rank-t.rank},M=function(e){return Array.isArray(e)?e:[e]},K=function(e){return e&&Array.isArray(e)?e.map((function(e){return".".concat(e)})).join(""):".".concat(e)},j=function(e,t){var i;(i=e.classList).add.apply(i,M(t))},V=function(e,t){var i;(i=e.classList).remove.apply(i,M(t))},B=function(e){if(void 0!==e)try{return JSON.parse(e)}catch(t){return e}return{}},H=function(){function e(e){var t=e.type,i=e.classNames;this.element=e.element,this.classNames=i,this.type=t,this.isActive=!1}return e.prototype.show=function(){return j(this.element,this.classNames.activeState),this.type!==_&&this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},e.prototype.hide=function(){return V(this.element,this.classNames.activeState),this.type!==_&&this.element.setAttribute("aria-expanded","false"),this.isActive=!1,this},e}(),R=function(){function e(e){var t=e.type,i=e.classNames,n=e.position;this.element=e.element,this.classNames=i,this.type=t,this.position=n,this.isOpen=!1,this.isFlipped=!1,this.isDisabled=!1,this.isLoading=!1}return e.prototype.shouldFlip=function(e,t){var i=!1;return"auto"===this.position?i=this.element.getBoundingClientRect().top-t>=0&&!window.matchMedia("(min-height: ".concat(e+1,"px)")).matches:"top"===this.position&&(i=!0),i},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype.open=function(e,t){j(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e,t)&&(j(this.element,this.classNames.flippedState),this.isFlipped=!0)},e.prototype.close=function(){V(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(V(this.element,this.classNames.flippedState),this.isFlipped=!1)},e.prototype.addFocusState=function(){j(this.element,this.classNames.focusState)},e.prototype.removeFocusState=function(){V(this.element,this.classNames.focusState)},e.prototype.addInvalidState=function(){j(this.element,this.classNames.invalidState)},e.prototype.removeInvalidState=function(){V(this.element,this.classNames.invalidState)},e.prototype.enable=function(){V(this.element,this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===g&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},e.prototype.disable=function(){j(this.element,this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===g&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},e.prototype.wrap=function(e){var t=this.element,i=e.parentNode;i&&(e.nextSibling?i.insertBefore(t,e.nextSibling):i.appendChild(t)),t.appendChild(e)},e.prototype.unwrap=function(e){var t=this.element,i=t.parentNode;i&&(i.insertBefore(e,t),i.removeChild(t))},e.prototype.addLoadingState=function(){j(this.element,this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},e.prototype.removeLoadingState=function(){V(this.element,this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},e}(),q=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,s=e.preventPaste;this.element=t,this.type=i,this.classNames=n,this.preventPaste=s,this.isFocussed=this.element.isEqualNode(document.activeElement),this.isDisabled=t.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return Object.defineProperty(e.prototype,"placeholder",{set:function(e){this.element.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.addEventListeners=function(){var e=this.element;e.addEventListener("paste",this._onPaste),e.addEventListener("input",this._onInput,{passive:!0}),e.addEventListener("focus",this._onFocus,{passive:!0}),e.addEventListener("blur",this._onBlur,{passive:!0})},e.prototype.removeEventListeners=function(){var e=this.element;e.removeEventListener("input",this._onInput),e.removeEventListener("paste",this._onPaste),e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur)},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.blur=function(){this.isFocussed&&this.element.blur()},e.prototype.clear=function(e){return void 0===e&&(e=!0),this.element.value="",e&&this.setWidth(),this},e.prototype.setWidth=function(){var e=this.element,t=e.value,i=e.placeholder,n=0,s=0;if(t||i){var o=document.createElement("span");o.style.position="absolute",o.style.visibility="hidden",o.style.whiteSpace="pre",o.style.height="auto",o.style.width="auto",o.style.minWidth="1ch",j(o,Array.from(e.classList)),e.after(o);var r=parseFloat(getComputedStyle(o).width);Number.isNaN(r)?(n=i.length,s=t.length):(i&&(o.innerText=i,n=parseFloat(getComputedStyle(o).width)/r),t&&(o.innerText=t,s=parseFloat(getComputedStyle(o).width)/r)),o.remove()}e.style.minWidth="".concat(Math.ceil(n)+1,"ch"),e.style.width="".concat(Math.ceil(s)+1,"ch")},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype._onInput=function(){this.type!==g&&this.setWidth()},e.prototype._onPaste=function(e){this.preventPaste&&e.preventDefault()},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}(),U=function(){function e(e){this.element=e.element,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return e.prototype.prepend=function(e){var t=this.element.firstElementChild;t?this.element.insertBefore(e,t):this.element.append(e)},e.prototype.scrollToTop=function(){this.element.scrollTop=0},e.prototype.scrollToChildElement=function(e,t){var i=this;if(e){var n=t>0?this.element.scrollTop+(e.offsetTop+e.offsetHeight)-(this.element.scrollTop+this.element.offsetHeight):e.offsetTop;requestAnimationFrame((function(){i._animateScroll(n,t)}))}},e.prototype._scrollDown=function(e,t,i){var n=(i-e)/t;this.element.scrollTop=e+(n>1?n:1)},e.prototype._scrollUp=function(e,t,i){var n=(e-i)/t;this.element.scrollTop=e-(n>1?n:1)},e.prototype._animateScroll=function(e,t){var i=this,n=this.element.scrollTop,s=!1;t>0?(this._scrollDown(n,4,e),n<e&&(s=!0)):(this._scrollUp(n,4,e),n>e&&(s=!0)),s&&requestAnimationFrame((function(){i._animateScroll(e,t)}))},e}(),G=function(){function e(e){var t=e.classNames;this.element=e.element,this.classNames=t,this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){var e=this.element;j(e,this.classNames.input),e.hidden=!0,e.tabIndex=-1;var t=e.getAttribute("style");t&&e.setAttribute("data-choice-orig-style",t),e.setAttribute("data-choice","active")},e.prototype.reveal=function(){var e=this.element;V(e,this.classNames.input),e.hidden=!1,e.removeAttribute("tabindex");var t=e.getAttribute("data-choice-orig-style");t?(e.removeAttribute("data-choice-orig-style"),e.setAttribute("style",t)):e.removeAttribute("style"),e.removeAttribute("data-choice")},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){var i;void 0===(i=t||{})&&(i=null),this.element.dispatchEvent(new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}))},e}(),W=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i}(G),X=function(e,t){return void 0===t&&(t=!0),void 0===e?t:!!e},J=function(e){if("string"==typeof e&&(e=e.split(" ").filter((function(e){return e.length}))),Array.isArray(e)&&e.length)return e},z=function(e,t,i){if(void 0===i&&(i=!0),"string"==typeof e){var n=A(e);return z({value:e,label:i||n===e?e:{escaped:n,raw:e},selected:!0},!1)}var s=e;if("choices"in s){if(!t)throw new TypeError("optGroup is not allowed");var o=s,r=o.choices.map((function(e){return z(e,!1)}));return{id:0,label:x(o.label)||o.value,active:!!r.length,disabled:!!o.disabled,choices:r}}var a=s;return{id:0,group:null,score:0,rank:0,value:a.value,label:a.label||a.value,active:X(a.active),selected:X(a.selected,!1),disabled:X(a.disabled,!1),placeholder:X(a.placeholder,!1),highlighted:!1,labelClass:J(a.labelClass),labelDescription:a.labelDescription,customProperties:a.customProperties}},Q=function(e){return"SELECT"===e.tagName},Y=function(e){function i(t){var i=t.template,n=t.extractPlaceholder,s=e.call(this,{element:t.element,classNames:t.classNames})||this;return s.template=i,s.extractPlaceholder=n,s}return t(i,e),Object.defineProperty(i.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),i.prototype.addOptions=function(e){var t=this,i=document.createDocumentFragment();e.forEach((function(e){var n=e;if(!n.element){var s=t.template(n);i.appendChild(s),n.element=s}})),this.element.appendChild(i)},i.prototype.optionsAsChoices=function(){var e=this,t=[];return this.element.querySelectorAll(":scope > option, :scope > optgroup").forEach((function(i){!function(e){return"OPTION"===e.tagName}(i)?function(e){return"OPTGROUP"===e.tagName}(i)&&t.push(e._optgroupToChoice(i)):t.push(e._optionToChoice(i))})),t},i.prototype._optionToChoice=function(e){return!e.hasAttribute("value")&&e.hasAttribute("placeholder")&&(e.setAttribute("value",""),e.value=""),{id:0,group:null,score:0,rank:0,value:e.value,label:e.label,element:e,active:!0,selected:this.extractPlaceholder?e.selected:e.hasAttribute("selected"),disabled:e.disabled,highlighted:!1,placeholder:this.extractPlaceholder&&(!e.value||e.hasAttribute("placeholder")),labelClass:void 0!==e.dataset.labelClass?J(e.dataset.labelClass):void 0,labelDescription:void 0!==e.dataset.labelDescription?{trusted:e.dataset.labelDescription}:void 0,customProperties:B(e.dataset.customProperties)}},i.prototype._optgroupToChoice=function(e){var t=this,i=e.querySelectorAll("option"),n=Array.from(i).map((function(e){return t._optionToChoice(e)}));return{id:0,label:e.label||"",element:e,active:!!n.length,disabled:e.disabled,choices:n}},i}(G),Z={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,closeDropdownOnSelect:"auto",singleModeForMultiSelect:!1,addChoices:!1,addItems:!0,addItemFilter:function(e){return!!e&&""!==e},removeItems:!0,removeItemButton:!1,removeItemButtonAlignLeft:!1,editItems:!1,allowHTML:!1,allowHtmlUserInput:!1,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchDisabledChoices:!1,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:function(e,t){var i=e.label,n=t.label,s=void 0===n?t.value:n;return x(void 0===i?e.value:i).localeCompare(x(s),[],{sensitivity:"base",ignorePunctuation:!0,numeric:!0})},shadowRoot:null,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",searchRenderSelectedChoices:!0,loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add <b>"'.concat(e,'"</b>')},removeItemIconText:function(){return"Remove item"},removeItemLabelText:function(e,t,i){return"Remove item: ".concat(i?A(i.label):e)},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:{containerOuter:["choices"],containerInner:["choices__inner"],input:["choices__input"],inputCloned:["choices__input--cloned"],list:["choices__list"],listItems:["choices__list--multiple"],listSingle:["choices__list--single"],listDropdown:["choices__list--dropdown"],item:["choices__item"],itemSelectable:["choices__item--selectable"],itemDisabled:["choices__item--disabled"],itemChoice:["choices__item--choice"],description:["choices__description"],placeholder:["choices__placeholder"],group:["choices__group"],groupHeading:["choices__heading"],button:["choices__button"],activeState:["is-active"],focusState:["is-focused"],openState:["is-open"],disabledState:["is-disabled"],highlightedState:["is-highlighted"],selectedState:["is-selected"],flippedState:["is-flipped"],loadingState:["is-loading"],invalidState:["is-invalid"],notice:["choices__notice"],addChoice:["choices__item--selectable","add-choice"],noResults:["has-no-results"],noChoices:["has-no-choices"]},appendGroupInSearch:!1},$=function(e){var t=e.itemEl;t&&(t.remove(),e.itemEl=void 0)},ee={groups:function(e,t){var i=e,n=!0;switch(t.type){case l:i.push(t.group);break;case c:i=[];break;default:n=!1}return{state:i,update:n}},items:function(e,t,i){var n=e,s=!0;switch(t.type){case h:t.item.selected=!0,(r=t.item.element)&&(r.selected=!0,r.setAttribute("selected","")),n.push(t.item);break;case d:var r;if(t.item.selected=!1,r=t.item.element){r.selected=!1,r.removeAttribute("selected");var a=r.parentElement;a&&Q(a)&&a.type===g&&(a.value="")}$(t.item),n=n.filter((function(e){return e.id!==t.item.id}));break;case o:$(t.choice),n=n.filter((function(e){return e.id!==t.choice.id}));break;case u:var c=t.highlighted,l=n.find((function(e){return e.id===t.item.id}));l&&l.highlighted!==c&&(l.highlighted=c,i&&function(e,t,i){var n=e.itemEl;n&&(V(n,i),j(n,t))}(l,c?i.classNames.highlightedState:i.classNames.selectedState,c?i.classNames.selectedState:i.classNames.highlightedState));break;default:s=!1}return{state:n,update:s}},choices:function(e,t,i){var n=e,l=!0;switch(t.type){case s:n.push(t.choice);break;case o:t.choice.choiceEl=void 0,t.choice.group&&(t.choice.group.choices=t.choice.group.choices.filter((function(e){return e.id!==t.choice.id}))),n=n.filter((function(e){return e.id!==t.choice.id}));break;case h:case d:t.item.choiceEl=void 0;break;case r:var u=[];t.results.forEach((function(e){u[e.item.id]=e})),n.forEach((function(e){var t=u[e.id];void 0!==t?(e.score=t.score,e.rank=t.rank,e.active=!0):(e.score=0,e.rank=0,e.active=!1),i&&i.appendGroupInSearch&&(e.choiceEl=void 0)}));break;case a:n.forEach((function(e){e.active=t.active,i&&i.appendGroupInSearch&&(e.choiceEl=void 0)}));break;case c:n=[];break;default:l=!1}return{state:n,update:l}}},te=function(){function e(e){this._state=this.defaultState,this._listeners=[],this._txn=0,this._context=e}return Object.defineProperty(e.prototype,"defaultState",{get:function(){return{groups:[],items:[],choices:[]}},enumerable:!1,configurable:!0}),e.prototype.changeSet=function(e){return{groups:e,items:e,choices:e}},e.prototype.reset=function(){this._state=this.defaultState;var e=this.changeSet(!0);this._txn?this._changeSet=e:this._listeners.forEach((function(t){return t(e)}))},e.prototype.subscribe=function(e){return this._listeners.push(e),this},e.prototype.dispatch=function(e){var t=this,i=this._state,n=!1,s=this._changeSet||this.changeSet(!1);Object.keys(ee).forEach((function(o){var r=ee[o](i[o],e,t._context);r.update&&(n=!0,s[o]=!0,i[o]=r.state)})),n&&(this._txn?this._changeSet=s:this._listeners.forEach((function(e){return e(s)})))},e.prototype.withTxn=function(e){this._txn++;try{e()}finally{if(this._txn=Math.max(0,this._txn-1),!this._txn){var t=this._changeSet;t&&(this._changeSet=void 0,this._listeners.forEach((function(e){return e(t)})))}}},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this.state.items},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightedActiveItems",{get:function(){return this.items.filter((function(e){return e.active&&e.highlighted}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"choices",{get:function(){return this.state.choices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeChoices",{get:function(){return this.choices.filter((function(e){return e.active}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"searchableChoices",{get:function(){var e=this._context;return this.choices.filter((function(t){return!t.placeholder&&(e.searchDisabledChoices||!t.disabled)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groups",{get:function(){return this.state.groups},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeGroups",{get:function(){var e=this;return this.state.groups.filter((function(t){var i=t.active&&!t.disabled,n=e.state.choices.some((function(e){return e.active&&!e.disabled}));return i&&n}),[])},enumerable:!1,configurable:!0}),e.prototype.inTxn=function(){return this._txn>0},e.prototype.getChoiceById=function(e){return this.activeChoices.find((function(t){return t.id===e}))},e.prototype.getGroupById=function(e){return this.groups.find((function(t){return t.id===e}))},e}(),ie="no-choices",ne="no-results",se="add-choice";function oe(e,t){if(0===e.length)return 0;for(var i=[0],n=1;n<e.length;n++){for(var s=i[n-1];s>0&&e.charAt(n)!==e.charAt(s);)s=i[s-1];e.charAt(n)===e.charAt(s)&&s++,i.push(s)}var o=0;for(n=0;n<t.length;n++){for(;o>0&&t.charAt(n)!==e.charAt(o);)o=i[o-1];if(t.charAt(n)===e.charAt(o)&&++o===e.length)return n-(o-1)}return-1}var re=function(){function e(e){this._haystack=[],this._fields=e.searchFields}return e.prototype.index=function(e){this._haystack=e},e.prototype.reset=function(){this._haystack=[]},e.prototype.isEmptyIndex=function(){return!this._haystack.length},e.prototype.search=function(e){var t=this._fields;if(!t||!t.length||!e)return[];for(var i=e.toLowerCase(),n=[],s=0,o=0,r=this._haystack.length;o<r;o++)for(var a=this._haystack[o],c=0,l=this._fields.length;c<l;c++){var h=this._fields[c];if(h in a&&-1!==oe(i,a[h].toLowerCase())){n.push({item:a,score:s,rank:s+1}),s++;break}}return n},e}(),ae=function(e,t,i){var n=e.dataset,s=t.customProperties,o=t.labelClass,r=t.labelDescription;o&&(n.labelClass=M(o).join(" ")),r&&(n.labelDescription=x(r)),i&&s&&("string"==typeof s?n.customProperties=s:"object"!=typeof s||function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(s)||(n.customProperties=JSON.stringify(s)))},ce=function(e,t,i){var n=t&&e.querySelector("label[for='".concat(t,"']")),s=n&&n.innerText;s&&i.setAttribute("aria-label",s)},le={containerOuter:function(e,t,i,n,s,o,r){var a=e.classNames.containerOuter,c=document.createElement("div");return j(c,a),c.dataset.type=o,t&&(c.dir=t),n&&(c.tabIndex=0),i&&(c.setAttribute("role",s?"combobox":"listbox"),s?c.setAttribute("aria-autocomplete","list"):r||ce(this._docRoot,this.passedElement.element.id,c),c.setAttribute("aria-haspopup","true"),c.setAttribute("aria-expanded","false")),r&&c.setAttribute("aria-labelledby",r),c},containerInner:function(e){var t=e.classNames.containerInner,i=document.createElement("div");return j(i,t),i},itemList:function(e,t){var i=e.searchEnabled,n=e.classNames,s=n.list,o=n.listSingle,r=n.listItems,a=document.createElement("div");return j(a,s),j(a,t?o:r),this._isSelectElement&&i&&a.setAttribute("role","listbox"),a},placeholder:function(e,t){var i=e.allowHTML,n=e.classNames.placeholder,s=document.createElement("div");return j(s,n),F(s,i,t),s},item:function(e,t,i){var n=e.allowHTML,s=e.removeItemButtonAlignLeft,o=e.removeItemIconText,r=e.removeItemLabelText,a=e.classNames,c=a.item,l=a.button,h=a.highlightedState,d=a.itemSelectable,u=a.placeholder,p=x(t.value),m=document.createElement("div");if(j(m,c),t.labelClass){var f=document.createElement("span");F(f,n,t.label),j(f,t.labelClass),m.appendChild(f)}else F(m,n,t.label);if(m.dataset.item="",m.dataset.id=t.id,m.dataset.value=p,ae(m,t,!0),(t.disabled||this.containerOuter.isDisabled)&&m.setAttribute("aria-disabled","true"),this._isSelectElement&&(m.setAttribute("aria-selected","true"),m.setAttribute("role","option")),t.placeholder&&(j(m,u),m.dataset.placeholder=""),j(m,t.highlighted?h:d),i){t.disabled&&V(m,d),m.dataset.deletable="";var v=document.createElement("button");v.type="button",j(v,l);var _=N(t);F(v,!0,D(o,t.value,_));var g=D(r,t.value,_);g&&v.setAttribute("aria-label",g),v.dataset.button="",s?m.insertAdjacentElement("afterbegin",v):m.appendChild(v)}return m},choiceList:function(e,t){var i=e.classNames.list,n=document.createElement("div");return j(n,i),t||n.setAttribute("aria-multiselectable","true"),n.setAttribute("role","listbox"),n},choiceGroup:function(e,t){var i=e.allowHTML,n=e.classNames,s=n.group,o=n.groupHeading,r=n.itemDisabled,a=t.id,c=t.label,l=t.disabled,h=x(c),d=document.createElement("div");j(d,s),l&&j(d,r),d.setAttribute("role","group"),d.dataset.group="",d.dataset.id=a,d.dataset.value=h,l&&d.setAttribute("aria-disabled","true");var u=document.createElement("div");return j(u,o),F(u,i,c||""),d.appendChild(u),d},choice:function(e,t,i,n){var s=e.allowHTML,o=e.classNames,r=o.item,a=o.itemChoice,c=o.itemSelectable,l=o.selectedState,h=o.itemDisabled,d=o.description,u=o.placeholder,p=t.label,m=x(t.value),f=document.createElement("div");f.id=t.elementId,j(f,r),j(f,a),n&&"string"==typeof p&&(p=P(s,p),p={trusted:p+=" (".concat(n,")")});var v=f;if(t.labelClass){var _=document.createElement("span");F(_,s,p),j(_,t.labelClass),v=_,f.appendChild(_)}else F(f,s,p);if(t.labelDescription){var g="".concat(t.elementId,"-description");v.setAttribute("aria-describedby",g);var y=document.createElement("span");F(y,s,t.labelDescription),y.id=g,j(y,d),f.appendChild(y)}return t.selected&&j(f,l),t.placeholder&&j(f,u),f.setAttribute("role",t.group?"treeitem":"option"),f.dataset.choice="",f.dataset.id=t.id,f.dataset.value=m,i&&(f.dataset.selectText=i),t.group&&(f.dataset.groupId="".concat(t.group.id)),ae(f,t,!1),t.disabled?(j(f,h),f.dataset.choiceDisabled="",f.setAttribute("aria-disabled","true")):(j(f,c),f.dataset.choiceSelectable="",f.setAttribute("aria-selected",t.selected?"true":"false")),f},input:function(e,t){var i=e.classNames,n=i.input,s=i.inputCloned,o=e.labelId,r=document.createElement("input");return r.type="search",j(r,n),j(r,s),r.autocomplete="off",r.autocapitalize="off",r.spellcheck=!1,r.setAttribute("aria-autocomplete","list"),t?r.setAttribute("aria-label",t):o||ce(this._docRoot,this.passedElement.element.id,r),r},dropdown:function(e,t){var i=e.classNames,n=i.list,s=i.listDropdown,o=document.createElement("div");return j(o,n),j(o,s),t!==_&&o.setAttribute("aria-expanded","false"),o},notice:function(e,t,i){var n=e.classNames,s=n.item,o=n.itemChoice,r=n.addChoice,a=n.noResults,c=n.noChoices,l=n.notice;void 0===i&&(i="");var h=document.createElement("div");switch(F(h,!0,t),j(h,s),j(h,o),j(h,l),i){case se:j(h,r);break;case ne:j(h,a);break;case ie:j(h,c)}return i===se&&(h.dataset.choiceSelectable="",h.dataset.choice=""),h},option:function(e){var t=x(e.label),i=new Option(t,e.value,!1,e.selected);return ae(i,e,!0),i.disabled=e.disabled,e.selected&&i.setAttribute("selected",""),i}},he="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,de={},ue=function(e){if(e)return e.dataset.id?parseInt(e.dataset.id,10):void 0},pe="[data-choice-selectable]";return function(){function e(t,n){void 0===t&&(t="[data-choice]"),void 0===n&&(n={});var s=this;this.initialisedOK=void 0,this._hasNonChoicePlaceholder=!1,this._lastAddedChoiceId=0,this._lastAddedGroupId=0;var o=e.defaults;this.config=i(i(i({},o.allOptions),o.options),n),v.forEach((function(e){s.config[e]=i(i(i({},o.allOptions[e]),o.options[e]),n[e])}));var r=this.config;r.silent||this._validateConfig();var a=r.shadowRoot||document.documentElement;this._docRoot=a;var c="string"==typeof t?a.querySelector(t):t;if(!c||"object"!=typeof c||"INPUT"!==c.tagName&&!Q(c)){if(!c&&"string"==typeof t)throw TypeError("Selector ".concat(t," failed to find an element"));throw TypeError("Expected one of the following types text|select-one|select-multiple")}var l=c.type,h=l===_;(h||1!==r.maxItemCount)&&(r.singleModeForMultiSelect=!1),r.singleModeForMultiSelect&&(l=y);var d=l===g,u=l===y,p=d||u;if(this._elementType=l,this._isTextElement=h,this._isSelectOneElement=d,this._isSelectMultipleElement=u,this._isSelectElement=d||u,this._canAddUserChoices=h&&r.addItems||p&&r.addChoices,"boolean"!=typeof r.renderSelectedChoices&&(r.renderSelectedChoices="always"===r.renderSelectedChoices||d),r.closeDropdownOnSelect="auto"===r.closeDropdownOnSelect?h||d||r.singleModeForMultiSelect:X(r.closeDropdownOnSelect),r.placeholder&&(r.placeholderValue?this._hasNonChoicePlaceholder=!0:c.dataset.placeholder&&(this._hasNonChoicePlaceholder=!0,r.placeholderValue=c.dataset.placeholder)),n.addItemFilter&&"function"!=typeof n.addItemFilter){var m=n.addItemFilter instanceof RegExp?n.addItemFilter:new RegExp(n.addItemFilter);r.addItemFilter=m.test.bind(m)}if(this.passedElement=this._isTextElement?new W({element:c,classNames:r.classNames}):new Y({element:c,classNames:r.classNames,template:function(e){return s._templates.option(e)},extractPlaceholder:r.placeholder&&!this._hasNonChoicePlaceholder}),this.initialised=!1,this._store=new te(r),this._currentValue="",r.searchEnabled=!h&&r.searchEnabled,this._canSearch=r.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=function(e){var t=e.id||e.name&&"".concat(e.name,"-").concat(w(2))||w(4);return t=t.replace(/(:|\.|\[|\]|,)/g,""),"".concat("choices-","-").concat(t)}(c),this._direction=c.dir,!this._direction){var f=window.getComputedStyle(c).direction;f!==window.getComputedStyle(document.documentElement).direction&&(this._direction=f)}if(this._idNames={itemChoice:"item-choice"},this._templates=o.templates,this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onInput=this._onInput.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onSelectKey=this._onSelectKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),this._onChange=this._onChange.bind(this),this._onInvalid=this._onInvalid.bind(this),this.passedElement.isActive)return r.silent||console.warn("Trying to initialise Choices on element already initialised",{element:t}),this.initialised=!0,void(this.initialisedOK=!1);this.init(),this._initialItems=this._store.items.map((function(e){return e.value}))}return Object.defineProperty(e,"defaults",{get:function(){return Object.preventExtensions({get options(){return de},get allOptions(){return Z},get templates(){return le}})},enumerable:!1,configurable:!0}),e.prototype.init=function(){if(!this.initialised&&void 0===this.initialisedOK){this._searcher=new re(this.config),this._loadChoices(),this._createTemplates(),this._createElements(),this._createStructure(),this._isTextElement&&!this.config.addItems||this.passedElement.element.hasAttribute("disabled")||this.passedElement.element.closest("fieldset:disabled")?this.disable():(this.enable(),this._addEventListeners()),this._initStore(),this.initialised=!0,this.initialisedOK=!0;var e=this.config.callbackOnInit;"function"==typeof e&&e.call(this)}},e.prototype.destroy=function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this._store._listeners=[],this.clearStore(!1),this._stopSearch(),this._templates=e.defaults.templates,this.initialised=!1,this.initialisedOK=void 0)},e.prototype.enable=function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this},e.prototype.disable=function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this},e.prototype.highlightItem=function(e,t){if(void 0===t&&(t=!0),!e||!e.id)return this;var i=this._store.items.find((function(t){return t.id===e.id}));return!i||i.highlighted||(this._store.dispatch(S(i,!0)),t&&this.passedElement.triggerEvent(f,N(i))),this},e.prototype.unhighlightItem=function(e,t){if(void 0===t&&(t=!0),!e||!e.id)return this;var i=this._store.items.find((function(t){return t.id===e.id}));return i&&i.highlighted?(this._store.dispatch(S(i,!1)),t&&this.passedElement.triggerEvent("unhighlightItem",N(i)),this):this},e.prototype.highlightAll=function(){var e=this;return this._store.withTxn((function(){e._store.items.forEach((function(t){t.highlighted||(e._store.dispatch(S(t,!0)),e.passedElement.triggerEvent(f,N(t)))}))})),this},e.prototype.unhighlightAll=function(){var e=this;return this._store.withTxn((function(){e._store.items.forEach((function(t){t.highlighted&&(e._store.dispatch(S(t,!1)),e.passedElement.triggerEvent(f,N(t)))}))})),this},e.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.withTxn((function(){t._store.items.filter((function(t){return t.value===e})).forEach((function(e){return t._removeItem(e)}))})),this},e.prototype.removeActiveItems=function(e){var t=this;return this._store.withTxn((function(){t._store.items.filter((function(t){return t.id!==e})).forEach((function(e){return t._removeItem(e)}))})),this},e.prototype.removeHighlightedItems=function(e){var t=this;return void 0===e&&(e=!1),this._store.withTxn((function(){t._store.highlightedActiveItems.forEach((function(i){t._removeItem(i),e&&t._triggerChange(i.value)}))})),this},e.prototype.showDropdown=function(e){var t=this;if(this.dropdown.isActive)return this;void 0===e&&(e=!this._canSearch),this.dropdown.show();var i=this.dropdown.element.getBoundingClientRect();return this.containerOuter.open(i.bottom,i.height),e||this.input.focus(),requestAnimationFrame((function(){t.passedElement.triggerEvent("showDropdown");var e=t.choiceList.element.querySelector(K(t.config.classNames.selectedState));null===e||I(e,t.choiceList.element)||(t.choiceList.element.scrollTop=e.offsetTop)})),this},e.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(this._removeHighlightedChoices(),requestAnimationFrame((function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent("hideDropdown")})),this):this},e.prototype.getValue=function(e){var t=this._store.items.map((function(t){return e?t.value:N(t)}));return this._isSelectOneElement||this.config.singleModeForMultiSelect?t[0]:t},e.prototype.setValue=function(e){var t=this;return this.initialisedOK?(this._store.withTxn((function(){e.forEach((function(e){e&&t._addChoice(z(e,!1))}))})),this._searcher.reset(),this):(this._warnChoicesInitFailed("setValue"),this)},e.prototype.setChoiceByValue=function(e){var t=this;return this.initialisedOK?(this._isTextElement||(this._store.withTxn((function(){(Array.isArray(e)?e:[e]).forEach((function(e){return t._findAndSelectChoiceByValue(e)})),t.unhighlightAll()})),this._searcher.reset()),this):(this._warnChoicesInitFailed("setChoiceByValue"),this)},e.prototype.setChoices=function(e,t,n,s,o,r){var a=this;if(void 0===t&&(t="value"),void 0===n&&(n="label"),void 0===s&&(s=!1),void 0===o&&(o=!0),void 0===r&&(r=!1),!this.initialisedOK)return this._warnChoicesInitFailed("setChoices"),this;if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof t||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if("function"==typeof e){var c=e(this);if("function"==typeof Promise&&c instanceof Promise)return new Promise((function(e){return requestAnimationFrame(e)})).then((function(){return a._handleLoadingState(!0)})).then((function(){return c})).then((function(e){return a.setChoices(e,t,n,s,o,r)})).catch((function(e){a.config.silent||console.error(e)})).then((function(){return a._handleLoadingState(!1)})).then((function(){return a}));if(!Array.isArray(c))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof c));e=c}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._store.withTxn((function(){o&&(a._isSearching=!1),s&&a.clearChoices(!0,r);var c="value"===t,l="label"===n;e.forEach((function(e){if("choices"in e){var s=e;l||(s=i(i({},s),{label:s[n]})),a._addGroup(z(s,!0))}else{var o=e;l&&c||(o=i(i({},o),{value:o[t],label:o[n]}));var r=z(o,!1);a._addChoice(r),r.placeholder&&!a._hasNonChoicePlaceholder&&(a._placeholderValue=L(r.label))}})),a.unhighlightAll()})),this.dropdown.isActive&&this._canAddUserChoices&&this._canCreateItem(this.input.value),this._searcher.reset(),this},e.prototype.refresh=function(e,t,i){var n=this;return void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===i&&(i=!1),this._isSelectElement?(this._store.withTxn((function(){var s=n.passedElement.optionsAsChoices(),o={};i||n._store.items.forEach((function(e){e.id&&e.active&&e.selected&&(o[e.value]=!0)})),n.clearStore(!1);var r=function(e){i?n._store.dispatch(C(e)):o[e.value]&&(e.selected=!0)};s.forEach((function(e){"choices"in e?e.choices.forEach(r):r(e)})),n._addPredefinedChoices(s,t,e),n._isSearching&&n._searchChoices(n.input.value)})),this):(this.config.silent||console.warn("refresh method can only be used on choices backed by a <select> element"),this)},e.prototype.removeChoice=function(e){var t=this._store.choices.find((function(t){return t.value===e}));return t?(this._clearNotice(),this._store.dispatch(function(e){return{type:o,choice:e}}(t)),this._searcher.reset(),t.selected&&this.passedElement.triggerEvent(m,N(t)),this):this},e.prototype.clearChoices=function(e,t){var i=this;return void 0===e&&(e=!0),void 0===t&&(t=!1),e&&(t?this.passedElement.element.replaceChildren(""):this.passedElement.element.querySelectorAll(":not([selected])").forEach((function(e){e.remove()}))),this.itemList.element.replaceChildren(""),this.choiceList.element.replaceChildren(""),this._clearNotice(),this._store.withTxn((function(){var e=t?[]:i._store.items;i._store.reset(),e.forEach((function(e){i._store.dispatch(b(e)),i._store.dispatch(E(e))}))})),this._searcher.reset(),this},e.prototype.clearStore=function(e){return void 0===e&&(e=!0),this.clearChoices(e,!0),this._stopSearch(),this._lastAddedChoiceId=0,this._lastAddedGroupId=0,this},e.prototype.clearInput=function(){return this.input.clear(!this._isSelectOneElement),this._stopSearch(),this},e.prototype._validateConfig=function(){var e,t,i,n=this.config,s=(e=Z,t=Object.keys(n).sort(),i=Object.keys(e).sort(),t.filter((function(e){return i.indexOf(e)<0})));s.length&&console.warn("Unknown config option(s) passed",s.join(", ")),n.allowHTML&&n.allowHtmlUserInput&&(n.addItems&&console.warn("Warning: allowHTML/allowHtmlUserInput/addItems all being true is strongly not recommended and may lead to XSS attacks"),n.addChoices&&console.warn("Warning: allowHTML/allowHtmlUserInput/addChoices all being true is strongly not recommended and may lead to XSS attacks"))},e.prototype._render=function(e){void 0===e&&(e={choices:!0,groups:!0,items:!0}),this._store.inTxn()||(this._isSelectElement&&(e.choices||e.groups)&&this._renderChoices(),e.items&&this._renderItems())},e.prototype._renderChoices=function(){var e=this;if(this._canAddItems()){var t=this.config,i=this._isSearching,n=this._store,s=n.activeGroups,o=n.activeChoices,r=i?t.searchResultLimit:t.renderChoiceLimit;if(this._isSelectElement){var a=o.filter((function(e){return!e.element}));a.length&&this.passedElement.addOptions(a)}var c=document.createDocumentFragment(),l=function(e){return e.filter((function(e){return!e.placeholder&&(i?(t.searchRenderSelectedChoices||!e.selected)&&!!e.rank:t.renderSelectedChoices||!e.selected)}))},h=t.appendGroupInSearch&&i,d=!1,u=null,p=function(n,s){i?n.sort(k):t.shouldSort&&n.sort(t.sorter);var o=n.length;o=!s&&r>0&&o>r?r:o,o--,n.every((function(n,s){var r=n.choiceEl||e._templates.choice(t,n,t.itemSelectText,h&&n.group?n.group.label:void 0);return n.choiceEl=r,c.appendChild(r),i||!n.selected?d=!0:u||(u=r),s<o}))};o.length&&(t.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),this._hasNonChoicePlaceholder||i||!this._isSelectOneElement||p(o.filter((function(e){return e.placeholder&&!e.group})),!1),s.length&&!i?(t.shouldSort&&s.sort(t.sorter),p(o.filter((function(e){return!e.placeholder&&!e.group})),!1),s.forEach((function(t){var i=l(t.choices);if(i.length){if(t.label){var n=t.groupEl||e._templates.choiceGroup(e.config,t);t.groupEl=n,n.remove(),c.appendChild(n)}p(i,!0)}}))):p(l(o),!1)),d||!i&&c.children.length&&t.renderSelectedChoices||(this._notice||(this._notice={text:O(i?t.noResultsText:t.noChoicesText),type:i?ne:ie}),c.replaceChildren("")),this._renderNotice(c),this.choiceList.element.replaceChildren(c),this._highlightChoice(u)}},e.prototype._renderItems=function(){var e=this,t=this._store.items||[],i=this.itemList.element,n=this.config,s=document.createDocumentFragment(),o=function(e){return i.querySelector('[data-item][data-id="'.concat(e.id,'"]'))},r=function(t){var i=t.itemEl;i&&i.parentElement||(i=o(t)||e._templates.item(n,t,n.removeItemButton),t.itemEl=i,s.appendChild(i))};t.forEach(r);var a=!!s.childNodes.length;if(this._isSelectOneElement){var c=i.children.length;if(a||c>1){var l=i.querySelector(K(n.classNames.placeholder));l&&l.remove()}else a||c||!this._placeholderValue||(a=!0,r(z({selected:!0,value:"",label:this._placeholderValue,placeholder:!0},!1)))}a&&(i.append(s),n.shouldSortItems&&!this._isSelectOneElement&&(t.sort(n.sorter),t.forEach((function(e){var t=o(e);t&&(t.remove(),s.append(t))})),i.append(s))),this._isTextElement&&(this.passedElement.value=t.map((function(e){return e.value})).join(n.delimiter))},e.prototype._displayNotice=function(e,t,i){void 0===i&&(i=!0);var n=this._notice;n&&(n.type===t&&n.text===e||n.type===se&&(t===ne||t===ie))?i&&this.showDropdown(!0):(this._clearNotice(),this._notice=e?{text:e,type:t}:void 0,this._renderNotice(),i&&e&&this.showDropdown(!0))},e.prototype._clearNotice=function(){if(this._notice){var e=this.choiceList.element.querySelector(K(this.config.classNames.notice));e&&e.remove(),this._notice=void 0}},e.prototype._renderNotice=function(e){var t=this._notice;if(t){var i=this._templates.notice(this.config,t.text,t.type);e?e.append(i):this.choiceList.prepend(i)}},e.prototype._getChoiceForOutput=function(e,t){return N(e,t)},e.prototype._triggerChange=function(e){null!=e&&this.passedElement.triggerEvent("change",{value:e})},e.prototype._handleButtonAction=function(e){var t=this,i=this._store.items;if(i.length&&this.config.removeItems&&this.config.removeItemButton){var n=e&&ue(e.closest("[data-id]")),s=n&&i.find((function(e){return e.id===n}));s&&this._store.withTxn((function(){if(t._removeItem(s),t._triggerChange(s.value),t._isSelectOneElement&&!t._hasNonChoicePlaceholder){var e=(t.config.shouldSort?t._store.choices.reverse():t._store.choices).find((function(e){return e.placeholder}));e&&(t._addItem(e),t.unhighlightAll(),e.value&&t._triggerChange(e.value))}}))}},e.prototype._handleItemAction=function(e,t){var i=this;void 0===t&&(t=!1);var n=this._store.items;if(n.length&&this.config.removeItems&&!this._isSelectOneElement){var s=ue(e);s&&(n.forEach((function(e){e.id!==s||e.highlighted?!t&&e.highlighted&&i.unhighlightItem(e):i.highlightItem(e)})),this.input.focus())}},e.prototype._handleChoiceAction=function(e){var t=this,i=ue(e),n=i&&this._store.getChoiceById(i);if(!n||n.disabled)return!1;var s=this.dropdown.isActive;if(!n.selected){if(!this._canAddItems())return!0;this._store.withTxn((function(){t._addItem(n,!0,!0),t.clearInput(),t.unhighlightAll()})),this._triggerChange(n.value)}return s&&this.config.closeDropdownOnSelect&&(this.hideDropdown(!0),this.containerOuter.element.focus()),!0},e.prototype._handleBackspace=function(e){var t=this.config;if(t.removeItems&&e.length){var i=e[e.length-1],n=e.some((function(e){return e.highlighted}));t.editItems&&!n&&i?(this.input.value=i.value,this.input.setWidth(),this._removeItem(i),this._triggerChange(i.value)):(n||this.highlightItem(i,!1),this.removeHighlightedItems(!0))}},e.prototype._loadChoices=function(){var e,t=this,i=this.config;if(this._isTextElement){if(this._presetChoices=i.items.map((function(e){return z(e,!1)})),this.passedElement.value){var n=this.passedElement.value.split(i.delimiter).map((function(e){return z(e,!1,t.config.allowHtmlUserInput)}));this._presetChoices=this._presetChoices.concat(n)}this._presetChoices.forEach((function(e){e.selected=!0}))}else if(this._isSelectElement){this._presetChoices=i.choices.map((function(e){return z(e,!0)}));var s=this.passedElement.optionsAsChoices();s&&(e=this._presetChoices).push.apply(e,s)}},e.prototype._handleLoadingState=function(e){void 0===e&&(e=!0);var t=this.itemList.element;e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t.replaceChildren(this._templates.placeholder(this.config,this.config.loadingText)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?(t.replaceChildren(""),this._render()):this.input.placeholder=this._placeholderValue||"")},e.prototype._handleSearch=function(e){if(this.input.isFocussed)if(null!=e&&e.length>=this.config.searchFloor){var t=this.config.searchChoices?this._searchChoices(e):0;null!==t&&this.passedElement.triggerEvent(p,{value:e,resultCount:t})}else this._store.choices.some((function(e){return!e.active}))&&this._stopSearch()},e.prototype._canAddItems=function(){var e=this.config,t=e.maxItemCount,i=e.maxItemText;return!e.singleModeForMultiSelect&&t>0&&t<=this._store.items.length?(this.choiceList.element.replaceChildren(""),this._notice=void 0,this._displayNotice("function"==typeof i?i(t):i,se,!1),!1):(this._notice&&this._notice.type===se&&this._clearNotice(),!0)},e.prototype._canCreateItem=function(e){var t=this.config,i=!0,n="";if(i&&this._store.choices.find((function(i){return t.valueComparer(i.value,e)}))){if(this._isSelectElement)return this._displayNotice("",se),!1;t.duplicateItemsAllowed||(i=!1,n=D(t.uniqueItemText,e,void 0))}return i&&"function"==typeof t.addItemFilter&&!t.addItemFilter(e)&&(i=!1,n=D(t.customAddItemText,e,void 0)),i&&(n=D(t.addItemText,e,void 0)),n&&this._displayNotice(n,se),i},e.prototype._searchChoices=function(e){var t=e.trim().replace(/\s{2,}/," ");if(!t.length||t===this._currentValue)return null;var i=this._searcher;i.isEmptyIndex()&&i.index(this._store.searchableChoices);var n=i.search(t);this._currentValue=t,this._highlightPosition=0,this._isSearching=!0;var s=this._notice;return(s&&s.type)!==se&&(n.length?this._clearNotice():this._displayNotice(O(this.config.noResultsText),ne)),this._store.dispatch(function(e){return{type:r,results:e}}(n)),n.length},e.prototype._stopSearch=function(){this._isSearching&&(this._currentValue="",this._isSearching=!1,this._clearNotice(),this._store.dispatch({type:a,active:!0}),this.passedElement.triggerEvent(p,{value:"",resultCount:0}))},e.prototype._addEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,i=this.input.element,n=this.passedElement.element;e.addEventListener("touchend",this._onTouchEnd,!0),t.addEventListener("keydown",this._onKeyDown,!0),t.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(t.addEventListener("focus",this._onFocus,{passive:!0}),t.addEventListener("blur",this._onBlur,{passive:!0})),i.addEventListener("keyup",this._onKeyUp,{passive:!0}),i.addEventListener("input",this._onInput,{passive:!0}),i.addEventListener("focus",this._onFocus,{passive:!0}),i.addEventListener("blur",this._onBlur,{passive:!0}),i.form&&i.form.addEventListener("reset",this._onFormReset,{passive:!0}),n.hasAttribute("required")&&(n.addEventListener("change",this._onChange,{passive:!0}),n.addEventListener("invalid",this._onInvalid,{passive:!0})),this.input.addEventListeners()},e.prototype._removeEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,i=this.input.element,n=this.passedElement.element;e.removeEventListener("touchend",this._onTouchEnd,!0),t.removeEventListener("keydown",this._onKeyDown,!0),t.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(t.removeEventListener("focus",this._onFocus),t.removeEventListener("blur",this._onBlur)),i.removeEventListener("keyup",this._onKeyUp),i.removeEventListener("input",this._onInput),i.removeEventListener("focus",this._onFocus),i.removeEventListener("blur",this._onBlur),i.form&&i.form.removeEventListener("reset",this._onFormReset),n.hasAttribute("required")&&(n.removeEventListener("change",this._onChange),n.removeEventListener("invalid",this._onInvalid)),this.input.removeEventListeners()},e.prototype._onKeyDown=function(e){var t=e.keyCode,i=this.dropdown.isActive,n=1===e.key.length||2===e.key.length&&e.key.charCodeAt(0)>=55296||"Unidentified"===e.key;switch(this._isTextElement||i||27===t||9===t||16===t||(this.showDropdown(),!this.input.isFocussed&&n&&(this.input.value+=e.key," "===e.key&&e.preventDefault())),t){case 65:return this._onSelectKey(e,this.itemList.element.hasChildNodes());case 13:return this._onEnterKey(e,i);case 27:return this._onEscapeKey(e,i);case 38:case 33:case 40:case 34:return this._onDirectionKey(e,i);case 8:case 46:return this._onDeleteKey(e,this._store.items,this.input.isFocussed)}},e.prototype._onKeyUp=function(){this._canSearch=this.config.searchEnabled},e.prototype._onInput=function(){var e=this.input.value;e?this._canAddItems()&&(this._canSearch&&this._handleSearch(e),this._canAddUserChoices&&(this._canCreateItem(e),this._isSelectElement&&(this._highlightPosition=0,this._highlightChoice()))):this._isTextElement?this.hideDropdown(!0):this._stopSearch()},e.prototype._onSelectKey=function(e,t){(e.ctrlKey||e.metaKey)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e,t){var i=this,n=this.input.value,s=e.target;if(e.preventDefault(),s&&s.hasAttribute("data-button"))this._handleButtonAction(s);else if(t){var o=this.dropdown.element.querySelector(K(this.config.classNames.highlightedState));if(!o||!this._handleChoiceAction(o))if(s&&n){if(this._canAddItems()){var r=!1;this._store.withTxn((function(){if(!(r=i._findAndSelectChoiceByValue(n,!0))){if(!i._canAddUserChoices)return;if(!i._canCreateItem(n))return;i._addChoice(z(n,!1,i.config.allowHtmlUserInput),!0,!0),r=!0}i.clearInput(),i.unhighlightAll()})),r&&(this._triggerChange(n),this.config.closeDropdownOnSelect&&this.hideDropdown(!0))}}else this.hideDropdown(!0)}else(this._isSelectElement||this._notice)&&this.showDropdown()},e.prototype._onEscapeKey=function(e,t){t&&(e.stopPropagation(),this.hideDropdown(!0),this._stopSearch(),this.containerOuter.element.focus())},e.prototype._onDirectionKey=function(e,t){var i=e.keyCode;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var n=40===i||34===i?1:-1,s=void 0;if(e.metaKey||34===i||33===i)s=this.dropdown.element.querySelector(n>0?"".concat(pe,":last-of-type"):pe);else{var o=this.dropdown.element.querySelector(K(this.config.classNames.highlightedState))||this.dropdown.element.querySelector(K(this.config.classNames.selectedState));s=o?function(e,t,i){void 0===i&&(i=1);for(var n="".concat(i>0?"next":"previous","ElementSibling"),s=e[n];s;){if(s.matches(t))return s;s=s[n]}return null}(o,pe,n):this.dropdown.element.querySelector(pe)}s&&(I(s,this.choiceList.element,n)||this.choiceList.scrollToChildElement(s,n),this._highlightChoice(s)),e.preventDefault()}},e.prototype._onDeleteKey=function(e,t,i){this._isSelectOneElement||e.target.value||!i||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()),this._wasTap=!0},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof Element){if(he&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild;this._isScrollingOnIe="ltr"===this._direction?e.offsetX>=i.offsetWidth:e.offsetX<i.offsetLeft}if(t!==this.input.element){var n=t.closest("[data-button],[data-item],[data-choice]");n instanceof HTMLElement&&("button"in n.dataset?this._handleButtonAction(n):"item"in n.dataset?this._handleItemAction(n,e.shiftKey):"choice"in n.dataset&&this._handleChoiceAction(n)),e.preventDefault()}}},e.prototype._onMouseOver=function(e){var t=e.target;t instanceof HTMLElement&&"choice"in t.dataset&&this._highlightChoice(t)},e.prototype._onClick=function(e){var t=e.target,i=this.containerOuter;i.element.contains(t)?this.dropdown.isActive||i.isDisabled?this._isSelectOneElement&&t!==this.input.element&&!this.dropdown.element.contains(t)&&this.hideDropdown():this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(i.element.focus(),this.showDropdown()):(i.removeFocusState(),this.hideDropdown(!0),this.unhighlightAll())},e.prototype._onFocus=function(e){var t=e.target,i=this.containerOuter;if(t&&i.element.contains(t)){var n=t===this.input.element;this._isTextElement?n&&i.addFocusState():this._isSelectMultipleElement?n&&(this.showDropdown(!0),i.addFocusState()):(i.addFocusState(),n&&this.showDropdown(!0))}},e.prototype._onBlur=function(e){var t=e.target,i=this.containerOuter;t&&i.element.contains(t)&&!this._isScrollingOnIe?t===this.input.element?(i.removeFocusState(),this.hideDropdown(!0),(this._isTextElement||this._isSelectMultipleElement)&&this.unhighlightAll()):t===this.containerOuter.element&&(i.removeFocusState(),this.config.searchEnabled||this.hideDropdown(!0)):(this._isScrollingOnIe=!1,this.input.element.focus())},e.prototype._onFormReset=function(){var e=this;this._store.withTxn((function(){e.clearInput(),e.hideDropdown(),e.refresh(!1,!1,!0),e._initialItems.length&&e.setChoiceByValue(e._initialItems)}))},e.prototype._onChange=function(e){e.target.checkValidity()&&this.containerOuter.removeInvalidState()},e.prototype._onInvalid=function(){this.containerOuter.addInvalidState()},e.prototype._removeHighlightedChoices=function(){var e=this.config.classNames.highlightedState;Array.from(this.dropdown.element.querySelectorAll(K(e))).forEach((function(t){V(t,e),t.setAttribute("aria-selected","false")}))},e.prototype._highlightChoice=function(e){void 0===e&&(e=null);var t=Array.from(this.dropdown.element.querySelectorAll(pe));if(t.length){var i=e,n=this.config.classNames.highlightedState;this._removeHighlightedChoices(),i?this._highlightPosition=t.indexOf(i):(i=t.length>this._highlightPosition?t[this._highlightPosition]:t[t.length-1])||(i=t[0]),j(i,n),i.setAttribute("aria-selected","true"),this.passedElement.triggerEvent("highlightChoice",{el:i}),this.dropdown.isActive&&(this.input.setActiveDescendant(i.id),this.containerOuter.setActiveDescendant(i.id))}},e.prototype._addItem=function(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!e.id)throw new TypeError("item.id must be set before _addItem is called for a choice/item");if((this.config.singleModeForMultiSelect||this._isSelectOneElement)&&this.removeActiveItems(e.id),this._store.dispatch(E(e)),t){var n=N(e);this.passedElement.triggerEvent("addItem",n),i&&this.passedElement.triggerEvent("choice",n)}},e.prototype._removeItem=function(e){if(e.id){this._store.dispatch(C(e));var t=this._notice;t&&t.type===ie&&this._clearNotice(),this.passedElement.triggerEvent(m,N(e))}},e.prototype._addChoice=function(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),e.id)throw new TypeError("Can not re-add a choice which has already been added");var n=this.config;if(n.duplicateItemsAllowed||!this._store.choices.find((function(t){return n.valueComparer(t.value,e.value)}))){this._lastAddedChoiceId++,e.id=this._lastAddedChoiceId,e.elementId="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(e.id);var s=n.prependValue,o=n.appendValue;s&&(e.value=s+e.value),o&&(e.value+=o.toString()),(s||o)&&e.element&&(e.element.value=e.value),this._clearNotice(),this._store.dispatch(b(e)),e.selected&&this._addItem(e,t,i)}},e.prototype._addGroup=function(e,t){var i=this;if(void 0===t&&(t=!0),e.id)throw new TypeError("Can not re-add a group which has already been added");this._store.dispatch(function(e){return{type:l,group:e}}(e)),e.choices&&(this._lastAddedGroupId++,e.id=this._lastAddedGroupId,e.choices.forEach((function(n){n.group=e,e.disabled&&(n.disabled=!0),i._addChoice(n,t)})))},e.prototype._createTemplates=function(){var e=this,t=this.config.callbackOnCreateTemplates,i={};"function"==typeof t&&(i=t.call(this,T,P,M));var n={};Object.keys(this._templates).forEach((function(t){n[t]=t in i?i[t].bind(e):e._templates[t].bind(e)})),this._templates=n},e.prototype._createElements=function(){var e=this._templates,t=this.config,i=this._isSelectOneElement,n=t.position,s=t.classNames,o=this._elementType;this.containerOuter=new R({element:e.containerOuter(t,this._direction,this._isSelectElement,i,t.searchEnabled,o,t.labelId),classNames:s,type:o,position:n}),this.containerInner=new R({element:e.containerInner(t),classNames:s,type:o,position:n}),this.input=new q({element:e.input(t,this._placeholderValue),classNames:s,type:o,preventPaste:!t.paste}),this.choiceList=new U({element:e.choiceList(t,i)}),this.itemList=new U({element:e.itemList(t,i)}),this.dropdown=new H({element:e.dropdown(t,o),classNames:s,type:o})},e.prototype._createStructure=function(){var e=this,t=e.containerInner,i=e.containerOuter,n=e.passedElement,s=this.dropdown.element;n.conceal(),t.wrap(n.element),i.wrap(t.element),i.element.appendChild(t.element),i.element.appendChild(s),t.element.appendChild(this.itemList.element),s.appendChild(this.choiceList.element),this._isSelectOneElement?(this.input.placeholder=this.config.searchPlaceholderValue||"",this.config.searchEnabled&&s.insertBefore(this.input.element,s.firstChild)):(this._isSelectMultipleElement&&!this.config.searchEnabled||t.element.appendChild(this.input.element),this._placeholderValue&&(this.input.placeholder=this._placeholderValue),this.input.setWidth()),this._highlightPosition=0,this._isSearching=!1},e.prototype._initStore=function(){var e=this;this._store.subscribe(this._render).withTxn((function(){e._addPredefinedChoices(e._presetChoices,e._isSelectOneElement&&!e._hasNonChoicePlaceholder,!1)})),(!this._store.choices.length||this._isSelectOneElement&&this._hasNonChoicePlaceholder)&&this._render()},e.prototype._addPredefinedChoices=function(e,t,i){var n=this;void 0===t&&(t=!1),void 0===i&&(i=!0),t&&-1===e.findIndex((function(e){return e.selected}))&&e.some((function(e){return!e.disabled&&!("choices"in e)&&(e.selected=!0,!0)})),e.forEach((function(e){"choices"in e?n._isSelectElement&&n._addGroup(e,i):n._addChoice(e,i)}))},e.prototype._findAndSelectChoiceByValue=function(e,t){var i=this;void 0===t&&(t=!1);var n=this._store.choices.find((function(t){return i.config.valueComparer(t.value,e)}));return!(!n||n.disabled||n.selected||(this._addItem(n,!0,t),0))},e.prototype._generatePlaceholderValue=function(){var e=this.config;if(!e.placeholder)return null;if(this._hasNonChoicePlaceholder)return e.placeholderValue;if(this._isSelectElement){var t=this.passedElement.placeholderOption;return t?t.text:null}return null},e.prototype._warnChoicesInitFailed=function(e){if(!this.config.silent){if(!this.initialised)throw new TypeError("".concat(e," called on a non-initialised instance of Choices"));if(!this.initialisedOK)throw new TypeError("".concat(e," called for an element which has multiple instances of Choices initialised on it"))}},e.version="11.2.4",e}()}));
@@ -1,4 +1,4 @@
1
- /*! choices.js v11.2.3 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
1
+ /*! choices.js v11.2.4 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
2
2
 
3
3
  /******************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
@@ -342,7 +342,9 @@ var Dropdown = /** @class */ (function () {
342
342
  */
343
343
  Dropdown.prototype.show = function () {
344
344
  addClassesToElement(this.element, this.classNames.activeState);
345
- this.element.setAttribute('aria-expanded', 'true');
345
+ if (this.type !== PassedElementTypes.Text) {
346
+ this.element.setAttribute('aria-expanded', 'true');
347
+ }
346
348
  this.isActive = true;
347
349
  return this;
348
350
  };
@@ -351,7 +353,9 @@ var Dropdown = /** @class */ (function () {
351
353
  */
352
354
  Dropdown.prototype.hide = function () {
353
355
  removeClassesFromElement(this.element, this.classNames.activeState);
354
- this.element.setAttribute('aria-expanded', 'false');
356
+ if (this.type !== PassedElementTypes.Text) {
357
+ this.element.setAttribute('aria-expanded', 'false');
358
+ }
355
359
  this.isActive = false;
356
360
  return this;
357
361
  };
@@ -1719,12 +1723,14 @@ var templates = {
1719
1723
  }
1720
1724
  return inp;
1721
1725
  },
1722
- dropdown: function (_a) {
1726
+ dropdown: function (_a, passedElementType) {
1723
1727
  var _b = _a.classNames, list = _b.list, listDropdown = _b.listDropdown;
1724
1728
  var div = document.createElement('div');
1725
1729
  addClassesToElement(div, list);
1726
1730
  addClassesToElement(div, listDropdown);
1727
- div.setAttribute('aria-expanded', 'false');
1731
+ if (passedElementType !== PassedElementTypes.Text) {
1732
+ div.setAttribute('aria-expanded', 'false');
1733
+ }
1728
1734
  return div;
1729
1735
  },
1730
1736
  notice: function (_a, innerHTML, type) {
@@ -2099,13 +2105,14 @@ var Choices = /** @class */ (function () {
2099
2105
  // eslint-disable-next-line no-param-reassign
2100
2106
  preventInputFocus = !this._canSearch;
2101
2107
  }
2108
+ // to ensure a virtual keyboard trigger as expected, the focus/animation must be started from the input event and not an animation frame which
2109
+ this.dropdown.show();
2110
+ var rect = this.dropdown.element.getBoundingClientRect();
2111
+ this.containerOuter.open(rect.bottom, rect.height);
2112
+ if (!preventInputFocus) {
2113
+ this.input.focus();
2114
+ }
2102
2115
  requestAnimationFrame(function () {
2103
- _this.dropdown.show();
2104
- var rect = _this.dropdown.element.getBoundingClientRect();
2105
- _this.containerOuter.open(rect.bottom, rect.height);
2106
- if (!preventInputFocus) {
2107
- _this.input.focus();
2108
- }
2109
2116
  _this.passedElement.triggerEvent(EventType.showDropdown);
2110
2117
  var activeElement = _this.choiceList.element.querySelector(getClassNamesSelector(_this.config.classNames.selectedState));
2111
2118
  if (activeElement !== null && !isScrolledIntoView(activeElement, _this.choiceList.element)) {
@@ -2240,7 +2247,6 @@ var Choices = /** @class */ (function () {
2240
2247
  */
2241
2248
  Choices.prototype.setChoices = function (choicesArrayOrFetcher, value, label, replaceChoices, clearSearchFlag, replaceItems) {
2242
2249
  var _this = this;
2243
- if (choicesArrayOrFetcher === void 0) { choicesArrayOrFetcher = []; }
2244
2250
  if (value === void 0) { value = 'value'; }
2245
2251
  if (label === void 0) { label = 'label'; }
2246
2252
  if (replaceChoices === void 0) { replaceChoices = false; }
@@ -2260,7 +2266,7 @@ var Choices = /** @class */ (function () {
2260
2266
  // it's a choices fetcher function
2261
2267
  var fetcher_1 = choicesArrayOrFetcher(this);
2262
2268
  if (typeof Promise === 'function' && fetcher_1 instanceof Promise) {
2263
- // that's a promise
2269
+ // @ts-expect-error wonky typing
2264
2270
  // eslint-disable-next-line no-promise-executor-return
2265
2271
  return new Promise(function (resolve) { return requestAnimationFrame(resolve); })
2266
2272
  .then(function () { return _this._handleLoadingState(true); })
@@ -2280,6 +2286,7 @@ var Choices = /** @class */ (function () {
2280
2286
  if (!Array.isArray(fetcher_1)) {
2281
2287
  throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof fetcher_1));
2282
2288
  }
2289
+ // @ts-expect-error wonky typing
2283
2290
  // eslint-disable-next-line no-param-reassign
2284
2291
  choicesArrayOrFetcher = fetcher_1;
2285
2292
  }
@@ -2325,6 +2332,7 @@ var Choices = /** @class */ (function () {
2325
2332
  }
2326
2333
  // @todo integrate with Store
2327
2334
  this._searcher.reset();
2335
+ // @ts-expect-error wonky typing
2328
2336
  return this;
2329
2337
  };
2330
2338
  Choices.prototype.refresh = function (withEvents, selectFirstOption, deselectAll) {
@@ -2887,10 +2895,6 @@ var Choices = /** @class */ (function () {
2887
2895
  var config = this.config;
2888
2896
  var canAddItem = true;
2889
2897
  var notice = '';
2890
- if (canAddItem && typeof config.addItemFilter === 'function' && !config.addItemFilter(value)) {
2891
- canAddItem = false;
2892
- notice = resolveNoticeFunction(config.customAddItemText, value, undefined);
2893
- }
2894
2898
  if (canAddItem) {
2895
2899
  var foundChoice = this._store.choices.find(function (choice) { return config.valueComparer(choice.value, value); });
2896
2900
  if (foundChoice) {
@@ -2905,6 +2909,10 @@ var Choices = /** @class */ (function () {
2905
2909
  }
2906
2910
  }
2907
2911
  }
2912
+ if (canAddItem && typeof config.addItemFilter === 'function' && !config.addItemFilter(value)) {
2913
+ canAddItem = false;
2914
+ notice = resolveNoticeFunction(config.customAddItemText, value, undefined);
2915
+ }
2908
2916
  if (canAddItem) {
2909
2917
  notice = resolveNoticeFunction(config.addItemText, value, undefined);
2910
2918
  }
@@ -3224,7 +3232,8 @@ var Choices = /** @class */ (function () {
3224
3232
  }
3225
3233
  }
3226
3234
  else {
3227
- var currentEl = this.dropdown.element.querySelector(getClassNamesSelector(this.config.classNames.highlightedState));
3235
+ var currentEl = this.dropdown.element.querySelector(getClassNamesSelector(this.config.classNames.highlightedState)) ||
3236
+ this.dropdown.element.querySelector(getClassNamesSelector(this.config.classNames.selectedState));
3228
3237
  if (currentEl) {
3229
3238
  nextEl = getAdjacentEl(currentEl, selectableChoiceIdentifier, directionInt);
3230
3239
  }
@@ -3329,8 +3338,8 @@ var Choices = /** @class */ (function () {
3329
3338
  }
3330
3339
  }
3331
3340
  else {
3332
- this.showDropdown();
3333
3341
  containerOuter.element.focus();
3342
+ this.showDropdown();
3334
3343
  }
3335
3344
  }
3336
3345
  else if (this._isSelectOneElement &&
@@ -3600,7 +3609,7 @@ var Choices = /** @class */ (function () {
3600
3609
  element: templating.itemList(config, isSelectOneElement),
3601
3610
  });
3602
3611
  this.dropdown = new Dropdown({
3603
- element: templating.dropdown(config),
3612
+ element: templating.dropdown(config, elementType),
3604
3613
  classNames: classNames,
3605
3614
  type: elementType,
3606
3615
  });
@@ -3714,7 +3723,7 @@ var Choices = /** @class */ (function () {
3714
3723
  throw new TypeError("".concat(caller, " called for an element which has multiple instances of Choices initialised on it"));
3715
3724
  }
3716
3725
  };
3717
- Choices.version = '11.2.3';
3726
+ Choices.version = '11.2.4';
3718
3727
  return Choices;
3719
3728
  }());
3720
3729
 
@@ -1,4 +1,4 @@
1
- /*! choices.js v11.2.3 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
1
+ /*! choices.js v11.2.4 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -348,7 +348,9 @@
348
348
  */
349
349
  Dropdown.prototype.show = function () {
350
350
  addClassesToElement(this.element, this.classNames.activeState);
351
- this.element.setAttribute('aria-expanded', 'true');
351
+ if (this.type !== PassedElementTypes.Text) {
352
+ this.element.setAttribute('aria-expanded', 'true');
353
+ }
352
354
  this.isActive = true;
353
355
  return this;
354
356
  };
@@ -357,7 +359,9 @@
357
359
  */
358
360
  Dropdown.prototype.hide = function () {
359
361
  removeClassesFromElement(this.element, this.classNames.activeState);
360
- this.element.setAttribute('aria-expanded', 'false');
362
+ if (this.type !== PassedElementTypes.Text) {
363
+ this.element.setAttribute('aria-expanded', 'false');
364
+ }
361
365
  this.isActive = false;
362
366
  return this;
363
367
  };
@@ -1683,12 +1687,14 @@
1683
1687
  }
1684
1688
  return inp;
1685
1689
  },
1686
- dropdown: function (_a) {
1690
+ dropdown: function (_a, passedElementType) {
1687
1691
  var _b = _a.classNames, list = _b.list, listDropdown = _b.listDropdown;
1688
1692
  var div = document.createElement('div');
1689
1693
  addClassesToElement(div, list);
1690
1694
  addClassesToElement(div, listDropdown);
1691
- div.setAttribute('aria-expanded', 'false');
1695
+ if (passedElementType !== PassedElementTypes.Text) {
1696
+ div.setAttribute('aria-expanded', 'false');
1697
+ }
1692
1698
  return div;
1693
1699
  },
1694
1700
  notice: function (_a, innerHTML, type) {
@@ -2063,13 +2069,14 @@
2063
2069
  // eslint-disable-next-line no-param-reassign
2064
2070
  preventInputFocus = !this._canSearch;
2065
2071
  }
2072
+ // to ensure a virtual keyboard trigger as expected, the focus/animation must be started from the input event and not an animation frame which
2073
+ this.dropdown.show();
2074
+ var rect = this.dropdown.element.getBoundingClientRect();
2075
+ this.containerOuter.open(rect.bottom, rect.height);
2076
+ if (!preventInputFocus) {
2077
+ this.input.focus();
2078
+ }
2066
2079
  requestAnimationFrame(function () {
2067
- _this.dropdown.show();
2068
- var rect = _this.dropdown.element.getBoundingClientRect();
2069
- _this.containerOuter.open(rect.bottom, rect.height);
2070
- if (!preventInputFocus) {
2071
- _this.input.focus();
2072
- }
2073
2080
  _this.passedElement.triggerEvent(EventType.showDropdown);
2074
2081
  var activeElement = _this.choiceList.element.querySelector(getClassNamesSelector(_this.config.classNames.selectedState));
2075
2082
  if (activeElement !== null && !isScrolledIntoView(activeElement, _this.choiceList.element)) {
@@ -2204,7 +2211,6 @@
2204
2211
  */
2205
2212
  Choices.prototype.setChoices = function (choicesArrayOrFetcher, value, label, replaceChoices, clearSearchFlag, replaceItems) {
2206
2213
  var _this = this;
2207
- if (choicesArrayOrFetcher === void 0) { choicesArrayOrFetcher = []; }
2208
2214
  if (value === void 0) { value = 'value'; }
2209
2215
  if (label === void 0) { label = 'label'; }
2210
2216
  if (replaceChoices === void 0) { replaceChoices = false; }
@@ -2224,7 +2230,7 @@
2224
2230
  // it's a choices fetcher function
2225
2231
  var fetcher_1 = choicesArrayOrFetcher(this);
2226
2232
  if (typeof Promise === 'function' && fetcher_1 instanceof Promise) {
2227
- // that's a promise
2233
+ // @ts-expect-error wonky typing
2228
2234
  // eslint-disable-next-line no-promise-executor-return
2229
2235
  return new Promise(function (resolve) { return requestAnimationFrame(resolve); })
2230
2236
  .then(function () { return _this._handleLoadingState(true); })
@@ -2244,6 +2250,7 @@
2244
2250
  if (!Array.isArray(fetcher_1)) {
2245
2251
  throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof fetcher_1));
2246
2252
  }
2253
+ // @ts-expect-error wonky typing
2247
2254
  // eslint-disable-next-line no-param-reassign
2248
2255
  choicesArrayOrFetcher = fetcher_1;
2249
2256
  }
@@ -2289,6 +2296,7 @@
2289
2296
  }
2290
2297
  // @todo integrate with Store
2291
2298
  this._searcher.reset();
2299
+ // @ts-expect-error wonky typing
2292
2300
  return this;
2293
2301
  };
2294
2302
  Choices.prototype.refresh = function (withEvents, selectFirstOption, deselectAll) {
@@ -2851,10 +2859,6 @@
2851
2859
  var config = this.config;
2852
2860
  var canAddItem = true;
2853
2861
  var notice = '';
2854
- if (canAddItem && typeof config.addItemFilter === 'function' && !config.addItemFilter(value)) {
2855
- canAddItem = false;
2856
- notice = resolveNoticeFunction(config.customAddItemText, value, undefined);
2857
- }
2858
2862
  if (canAddItem) {
2859
2863
  var foundChoice = this._store.choices.find(function (choice) { return config.valueComparer(choice.value, value); });
2860
2864
  if (foundChoice) {
@@ -2869,6 +2873,10 @@
2869
2873
  }
2870
2874
  }
2871
2875
  }
2876
+ if (canAddItem && typeof config.addItemFilter === 'function' && !config.addItemFilter(value)) {
2877
+ canAddItem = false;
2878
+ notice = resolveNoticeFunction(config.customAddItemText, value, undefined);
2879
+ }
2872
2880
  if (canAddItem) {
2873
2881
  notice = resolveNoticeFunction(config.addItemText, value, undefined);
2874
2882
  }
@@ -3188,7 +3196,8 @@
3188
3196
  }
3189
3197
  }
3190
3198
  else {
3191
- var currentEl = this.dropdown.element.querySelector(getClassNamesSelector(this.config.classNames.highlightedState));
3199
+ var currentEl = this.dropdown.element.querySelector(getClassNamesSelector(this.config.classNames.highlightedState)) ||
3200
+ this.dropdown.element.querySelector(getClassNamesSelector(this.config.classNames.selectedState));
3192
3201
  if (currentEl) {
3193
3202
  nextEl = getAdjacentEl(currentEl, selectableChoiceIdentifier, directionInt);
3194
3203
  }
@@ -3293,8 +3302,8 @@
3293
3302
  }
3294
3303
  }
3295
3304
  else {
3296
- this.showDropdown();
3297
3305
  containerOuter.element.focus();
3306
+ this.showDropdown();
3298
3307
  }
3299
3308
  }
3300
3309
  else if (this._isSelectOneElement &&
@@ -3564,7 +3573,7 @@
3564
3573
  element: templating.itemList(config, isSelectOneElement),
3565
3574
  });
3566
3575
  this.dropdown = new Dropdown({
3567
- element: templating.dropdown(config),
3576
+ element: templating.dropdown(config, elementType),
3568
3577
  classNames: classNames,
3569
3578
  type: elementType,
3570
3579
  });
@@ -3678,7 +3687,7 @@
3678
3687
  throw new TypeError("".concat(caller, " called for an element which has multiple instances of Choices initialised on it"));
3679
3688
  }
3680
3689
  };
3681
- Choices.version = '11.2.3';
3690
+ Choices.version = '11.2.4';
3682
3691
  return Choices;
3683
3692
  }());
3684
3693