spell-ui 0.8.6 → 0.8.8

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 (722) hide show
  1. package/README-components.md +14 -6
  2. package/README-frameworks.md +22 -12
  3. package/README-migrating.md +7 -6
  4. package/README-runtime.md +14 -13
  5. package/README-site.md +11 -11
  6. package/README-themes.md +38 -11
  7. package/README.md +61 -73
  8. package/dist/Dragging-CMZoLEWQ.js +169 -0
  9. package/dist/Dragging-CMZoLEWQ.js.map +1 -0
  10. package/dist/{MarkdownEngine-CbuT9Mjc.js → MarkdownEngine-CW1WGqNp.js} +122 -100
  11. package/dist/MarkdownEngine-CW1WGqNp.js.map +1 -0
  12. package/dist/{PrefStore-CeaTtjTz.js → PrefStore-Qv0e5y04.js} +22 -22
  13. package/dist/PrefStore-Qv0e5y04.js.map +1 -0
  14. package/dist/ScrollingRow-7n7Z-HIE.js +88 -0
  15. package/dist/ScrollingRow-7n7Z-HIE.js.map +1 -0
  16. package/dist/SitePages-CciwREek.js +51 -0
  17. package/dist/SitePages-CciwREek.js.map +1 -0
  18. package/dist/{SlottedItems-Ch0tzzlL.js → SlottedItems-Du3aJwG1.js} +22 -22
  19. package/dist/{SlottedItems-Ch0tzzlL.js.map → SlottedItems-Du3aJwG1.js.map} +1 -1
  20. package/dist/ThemeDraft-B7NPif4d.js +805 -0
  21. package/dist/ThemeDraft-B7NPif4d.js.map +1 -0
  22. package/dist/TreeMeasure-BVJeGb1L.js +42 -0
  23. package/dist/TreeMeasure-BVJeGb1L.js.map +1 -0
  24. package/dist/UIButton-DFEds67r.js +6 -0
  25. package/dist/UIButton-DFEds67r.js.map +1 -0
  26. package/dist/UIInput-BodVbUoQ.js +6 -0
  27. package/dist/UIInput-BodVbUoQ.js.map +1 -0
  28. package/dist/{UIKeys-DJF2TIKE.js → UIKeys-Rh_gUZjP.js} +10 -9
  29. package/dist/UIKeys-Rh_gUZjP.js.map +1 -0
  30. package/dist/UILabel-DgJUBzB_.js +6 -0
  31. package/dist/UILabel-DgJUBzB_.js.map +1 -0
  32. package/dist/UIMenu-zdcAtwTa.js +42 -0
  33. package/dist/UIMenu-zdcAtwTa.js.map +1 -0
  34. package/dist/{UIRuntime-BBuehGly.js → UIRuntime-KH309p5B.js} +398 -207
  35. package/dist/UIRuntime-KH309p5B.js.map +1 -0
  36. package/dist/_spell-element/DOMElement.d.ts +62 -5
  37. package/dist/_spell-element/MoveAndResize.d.ts +75 -0
  38. package/dist/_spell-element/UIComponent.d.ts +42 -0
  39. package/dist/_spell-element/elements.types.d.ts +47 -0
  40. package/dist/_spell-element/index.d.ts +1 -0
  41. package/dist/_spell-element/vocabulary.types.d.ts +34 -2
  42. package/dist/{runtime → _util}/Api.d.ts +14 -4
  43. package/dist/_util/Dragging.d.ts +148 -0
  44. package/dist/_util/ListSelection.d.ts +46 -0
  45. package/dist/{util → _util}/LoadOnce.d.ts +9 -1
  46. package/dist/_util/ReconnectingSocket.d.ts +51 -0
  47. package/dist/_util/diagram/DiagramColumns.d.ts +14 -0
  48. package/dist/_util/diagram/DiagramLayout.d.ts +119 -0
  49. package/dist/_util/diagram/DiagramSVG.d.ts +17 -0
  50. package/dist/_util/dom.d.ts +10 -0
  51. package/dist/_util/fetching.d.ts +92 -0
  52. package/dist/_util/measures/Dimension.d.ts +63 -0
  53. package/dist/_util/measures/MeasureSystem.d.ts +66 -0
  54. package/dist/_util/measures/dimensions.generated.d.ts +16 -0
  55. package/dist/_util/persist/ColorScheme.d.ts +6 -0
  56. package/dist/_util/persist/ServerPlace.d.ts +42 -0
  57. package/dist/_util/persist/WaitedOnPlace.d.ts +27 -0
  58. package/dist/_util/persist/persist.types.d.ts +21 -2
  59. package/dist/_util/timing.d.ts +10 -1
  60. package/dist/api.js +8 -7
  61. package/dist/api.js.map +1 -1
  62. package/dist/components/ComponentDefinitions.d.ts +29 -0
  63. package/dist/components/components.es.d.ts +13 -0
  64. package/dist/components/components.types.d.ts +113 -8
  65. package/dist/components/ui-accordion/UIAccordion.d.ts +1 -0
  66. package/dist/components/ui-accordion/UIAccordion.en.d.ts +1 -0
  67. package/dist/components/ui-action/UIAction.en.d.ts +5 -1
  68. package/dist/components/ui-ad/UIAd.d.ts +1 -0
  69. package/dist/components/ui-ad/UIAd.en.d.ts +1 -0
  70. package/dist/components/ui-breadcrumbs/UIBreadcrumb.d.ts +1 -0
  71. package/dist/components/ui-breadcrumbs/UIBreadcrumb.en.d.ts +1 -0
  72. package/dist/components/ui-breadcrumbs/UIBreadcrumbs.d.ts +1 -0
  73. package/dist/components/ui-breadcrumbs/UIBreadcrumbs.en.d.ts +1 -0
  74. package/dist/components/ui-button/UIButton.d.ts +8 -3
  75. package/dist/components/ui-button/UIButton.en.d.ts +9 -4
  76. package/dist/components/ui-button/UIButton.es.d.ts +6 -0
  77. package/dist/components/ui-button/UIButton.fallback.d.ts +8 -3
  78. package/dist/components/ui-button/UIButtons.d.ts +1 -0
  79. package/dist/components/ui-button/UIButtons.en.d.ts +1 -0
  80. package/dist/components/ui-button/UIOr.d.ts +1 -0
  81. package/dist/components/ui-button/UIOr.en.d.ts +1 -0
  82. package/dist/components/ui-calendar/UICalendar.d.ts +6 -0
  83. package/dist/components/ui-calendar/UICalendar.en.d.ts +6 -0
  84. package/dist/components/ui-calendar/UICalendar.fallback.d.ts +6 -0
  85. package/dist/components/ui-card/CardClicks.d.ts +40 -0
  86. package/dist/components/ui-card/UICard.d.ts +41 -0
  87. package/dist/components/ui-card/UICard.en.d.ts +49 -0
  88. package/dist/components/ui-card/UICard.es.d.ts +1 -0
  89. package/dist/components/ui-card/UICards.d.ts +31 -0
  90. package/dist/components/ui-card/UICards.en.d.ts +31 -0
  91. package/dist/components/ui-card/UICards.es.d.ts +8 -0
  92. package/dist/components/ui-checkbox/CheckControl.d.ts +7 -0
  93. package/dist/components/ui-checkbox/UICheckbox.d.ts +7 -0
  94. package/dist/components/ui-checkbox/UICheckbox.en.d.ts +7 -0
  95. package/dist/components/ui-checkbox/UICheckbox.es.d.ts +1 -0
  96. package/dist/components/ui-checkbox/UICheckbox.fallback.d.ts +7 -0
  97. package/dist/components/ui-checkbox/UICheckbox.types.d.ts +5 -0
  98. package/dist/components/ui-checkbox/UIRadio.d.ts +8 -0
  99. package/dist/components/ui-checkbox/UIRadio.en.d.ts +6 -0
  100. package/dist/components/ui-code/UICode.en.d.ts +1 -0
  101. package/dist/components/ui-comment/UIComment.d.ts +1 -0
  102. package/dist/components/ui-comment/UIComment.en.d.ts +1 -0
  103. package/dist/components/ui-comment/UIComments.d.ts +1 -0
  104. package/dist/components/ui-comment/UIComments.en.d.ts +1 -0
  105. package/dist/components/ui-components/PackHotSwap.d.ts +13 -3
  106. package/dist/components/ui-components/UIComponents.d.ts +1 -0
  107. package/dist/components/ui-components/UIComponents.en.d.ts +1 -0
  108. package/dist/components/ui-container/UIContainer.d.ts +11 -0
  109. package/dist/components/ui-container/UIContainer.en.d.ts +7 -0
  110. package/dist/components/ui-container/UIContainer.es.d.ts +1 -0
  111. package/dist/components/ui-diagram/UIDiagram.d.ts +268 -0
  112. package/dist/components/ui-diagram/UIDiagram.en.d.ts +106 -0
  113. package/dist/components/ui-diagram/UIDiagram.es.d.ts +37 -0
  114. package/dist/components/ui-diagram/UIDiagramNode.d.ts +98 -0
  115. package/dist/components/ui-diagram/UIDiagramNode.en.d.ts +38 -0
  116. package/dist/components/ui-diagram/UIDiagramNode.es.d.ts +16 -0
  117. package/dist/components/ui-diagram/index.d.ts +8 -0
  118. package/dist/components/ui-dimension/UIDimension.d.ts +81 -0
  119. package/dist/components/ui-dimension/UIDimension.en.d.ts +54 -0
  120. package/dist/components/ui-dimension/UIDimension.es.d.ts +22 -0
  121. package/dist/components/ui-dimension/index.d.ts +2 -0
  122. package/dist/components/ui-dimmer/UIDimmer.d.ts +6 -1
  123. package/dist/components/ui-dimmer/UIDimmer.en.d.ts +1 -0
  124. package/dist/components/ui-dimmer/UIDimmer.es.d.ts +1 -1
  125. package/dist/components/ui-divider/UIDivider.d.ts +2 -0
  126. package/dist/components/ui-divider/UIDivider.en.d.ts +2 -0
  127. package/dist/components/ui-divider/UIDivider.es.d.ts +1 -0
  128. package/dist/components/ui-dropdown/UIDropdown.d.ts +6 -0
  129. package/dist/components/ui-dropdown/UIDropdown.en.d.ts +6 -0
  130. package/dist/components/ui-dropdown/UIDropdown.fallback.d.ts +6 -0
  131. package/dist/components/ui-embed/UIEmbed.d.ts +1 -0
  132. package/dist/components/ui-embed/UIEmbed.en.d.ts +1 -0
  133. package/dist/components/ui-emoji/UIEmoji.d.ts +1 -0
  134. package/dist/components/ui-emoji/UIEmoji.en.d.ts +1 -0
  135. package/dist/components/ui-example/UIExample.en.d.ts +4 -2
  136. package/dist/components/ui-example/UIExample.es.d.ts +3 -2
  137. package/dist/components/ui-feed/UIFeed.d.ts +1 -0
  138. package/dist/components/ui-feed/UIFeed.en.d.ts +1 -0
  139. package/dist/components/ui-feed/UIFeedEvent.d.ts +1 -0
  140. package/dist/components/ui-feed/UIFeedEvent.en.d.ts +1 -0
  141. package/dist/components/ui-flag/UIFlag.d.ts +1 -0
  142. package/dist/components/ui-flag/UIFlag.en.d.ts +1 -0
  143. package/dist/components/ui-flyout/UIFlyout.d.ts +1 -0
  144. package/dist/components/ui-flyout/UIFlyout.en.d.ts +1 -0
  145. package/dist/components/ui-form/FormBinding.d.ts +13 -1
  146. package/dist/components/ui-form/FormFields.d.ts +4 -4
  147. package/dist/components/ui-form/UIField.d.ts +30 -3
  148. package/dist/components/ui-form/UIField.en.d.ts +9 -0
  149. package/dist/components/ui-form/UIField.es.d.ts +6 -0
  150. package/dist/components/ui-form/UIFields.d.ts +1 -0
  151. package/dist/components/ui-form/UIFields.en.d.ts +1 -0
  152. package/dist/components/ui-form/UIForm.d.ts +15 -0
  153. package/dist/components/ui-form/UIForm.en.d.ts +6 -0
  154. package/dist/components/ui-form/UIRepeat.d.ts +1 -0
  155. package/dist/components/ui-form/UIRepeat.en.d.ts +1 -0
  156. package/dist/components/ui-form/index.d.ts +2 -1
  157. package/dist/components/ui-grid/UIColumn.d.ts +1 -0
  158. package/dist/components/ui-grid/UIColumn.en.d.ts +1 -0
  159. package/dist/components/ui-grid/UIGrid.d.ts +1 -0
  160. package/dist/components/ui-grid/UIGrid.en.d.ts +1 -0
  161. package/dist/components/ui-grid/UIRow.d.ts +1 -0
  162. package/dist/components/ui-grid/UIRow.en.d.ts +1 -0
  163. package/dist/components/ui-icon/UIIcon.d.ts +3 -2
  164. package/dist/components/ui-icon/UIIcon.en.d.ts +3 -2
  165. package/dist/components/ui-icon/UIIcons.d.ts +1 -0
  166. package/dist/components/ui-icon/UIIcons.en.d.ts +1 -0
  167. package/dist/components/ui-icon-picker/UIIconPicker.d.ts +6 -0
  168. package/dist/components/ui-icon-picker/UIIconPicker.en.d.ts +6 -0
  169. package/dist/components/ui-icon-picker/UIIconPicker.fallback.d.ts +6 -0
  170. package/dist/components/ui-image/UIImage.d.ts +34 -0
  171. package/dist/components/ui-image/UIImage.en.d.ts +23 -0
  172. package/dist/components/ui-image/UIImage.es.d.ts +2 -0
  173. package/dist/components/ui-image/UIImages.d.ts +1 -0
  174. package/dist/components/ui-image/UIImages.en.d.ts +1 -0
  175. package/dist/components/ui-include/UIInclude.d.ts +1 -0
  176. package/dist/components/ui-include/UIInclude.en.d.ts +1 -0
  177. package/dist/components/ui-input/TextControl.d.ts +7 -0
  178. package/dist/components/ui-input/UIInput.d.ts +22 -3
  179. package/dist/components/ui-input/UIInput.en.d.ts +9 -2
  180. package/dist/components/ui-input/UIInput.es.d.ts +2 -0
  181. package/dist/components/ui-input/UIInput.fallback.d.ts +9 -2
  182. package/dist/components/ui-input/UITextarea.d.ts +20 -0
  183. package/dist/components/ui-input/UITextarea.en.d.ts +15 -0
  184. package/dist/components/ui-input/UITextarea.es.d.ts +4 -0
  185. package/dist/components/ui-item/UIItem.d.ts +27 -4
  186. package/dist/components/ui-item/UIItem.en.d.ts +5 -1
  187. package/dist/components/ui-items/UIItems.d.ts +1 -0
  188. package/dist/components/ui-items/UIItems.en.d.ts +1 -0
  189. package/dist/components/ui-json/JsonChild.d.ts +30 -0
  190. package/dist/components/ui-json/UIJson.d.ts +128 -0
  191. package/dist/components/ui-json/UIJson.en.d.ts +71 -0
  192. package/dist/components/ui-json/UIJson.es.d.ts +12 -0
  193. package/dist/components/ui-json/index.d.ts +3 -0
  194. package/dist/components/ui-keys/UIKeys.d.ts +1 -0
  195. package/dist/components/ui-keys/UIKeys.en.d.ts +1 -0
  196. package/dist/components/ui-label/UILabel.d.ts +2 -0
  197. package/dist/components/ui-label/UILabel.en.d.ts +2 -0
  198. package/dist/components/ui-label/UILabel.es.d.ts +1 -0
  199. package/dist/components/ui-label/UILabels.d.ts +1 -0
  200. package/dist/components/ui-label/UILabels.en.d.ts +1 -0
  201. package/dist/components/ui-list/UIList.d.ts +2 -0
  202. package/dist/components/ui-list/UIList.en.d.ts +2 -0
  203. package/dist/components/ui-list/UIList.es.d.ts +1 -0
  204. package/dist/components/ui-loader/UILoader.d.ts +1 -0
  205. package/dist/components/ui-loader/UILoader.en.d.ts +1 -0
  206. package/dist/components/ui-markdown/MarkdownBox.d.ts +143 -0
  207. package/dist/components/ui-markdown/MarkdownEngine.d.ts +14 -2
  208. package/dist/components/ui-markdown/MarkdownFormats.d.ts +95 -0
  209. package/dist/components/ui-markdown/MarkdownSource.d.ts +57 -0
  210. package/dist/components/ui-markdown/UIMarkdown.d.ts +126 -6
  211. package/dist/components/ui-markdown/UIMarkdown.en.d.ts +111 -8
  212. package/dist/components/ui-markdown/UIMarkdown.es.d.ts +29 -1
  213. package/dist/components/ui-markdown/UIMarkdown.types.d.ts +26 -0
  214. package/dist/components/ui-menu/ScrollingRow.d.ts +79 -0
  215. package/dist/components/ui-menu/TitleFit.d.ts +3 -0
  216. package/dist/components/ui-menu/UIMenu.d.ts +97 -4
  217. package/dist/components/ui-menu/UIMenu.en.d.ts +50 -1
  218. package/dist/components/ui-menu/UIMenu.es.d.ts +4 -0
  219. package/dist/components/ui-message/UIMessage.d.ts +2 -0
  220. package/dist/components/ui-message/UIMessage.en.d.ts +2 -0
  221. package/dist/components/ui-message/UIMessage.es.d.ts +1 -0
  222. package/dist/components/ui-modal/UIModal.d.ts +1 -0
  223. package/dist/components/ui-modal/UIModal.en.d.ts +1 -0
  224. package/dist/components/ui-nag/UINag.d.ts +1 -0
  225. package/dist/components/ui-nag/UINag.en.d.ts +1 -0
  226. package/dist/components/ui-page/UIPage.d.ts +15 -0
  227. package/dist/components/ui-page/UIPage.en.d.ts +15 -0
  228. package/dist/components/ui-page/UIPage.es.d.ts +1 -0
  229. package/dist/components/ui-panel/UIPanel.d.ts +6 -0
  230. package/dist/components/ui-panel/UIPanel.en.d.ts +33 -20
  231. package/dist/components/ui-parts/UIActions.d.ts +1 -0
  232. package/dist/components/ui-parts/UIActions.en.d.ts +1 -0
  233. package/dist/components/ui-parts/UIAuthor.d.ts +1 -0
  234. package/dist/components/ui-parts/UIAuthor.en.d.ts +1 -0
  235. package/dist/components/ui-parts/UIAvatar.d.ts +1 -0
  236. package/dist/components/ui-parts/UIAvatar.en.d.ts +1 -0
  237. package/dist/components/ui-parts/UIContent.d.ts +1 -0
  238. package/dist/components/ui-parts/UIContent.en.d.ts +1 -0
  239. package/dist/components/ui-parts/UIDate.d.ts +1 -0
  240. package/dist/components/ui-parts/UIDate.en.d.ts +1 -0
  241. package/dist/components/ui-parts/UIDescription.d.ts +1 -0
  242. package/dist/components/ui-parts/UIDescription.en.d.ts +1 -0
  243. package/dist/components/ui-parts/UIDetail.d.ts +1 -0
  244. package/dist/components/ui-parts/UIDetail.en.d.ts +1 -0
  245. package/dist/components/ui-parts/UIExtra.d.ts +1 -0
  246. package/dist/components/ui-parts/UIExtra.en.d.ts +1 -0
  247. package/dist/components/ui-parts/UIHeader.d.ts +3 -1
  248. package/dist/components/ui-parts/UIHeader.en.d.ts +3 -1
  249. package/dist/components/ui-parts/UIMeta.d.ts +1 -0
  250. package/dist/components/ui-parts/UIMeta.en.d.ts +1 -0
  251. package/dist/components/ui-parts/UIParts.types.d.ts +15 -1
  252. package/dist/components/ui-parts/UISummary.d.ts +1 -0
  253. package/dist/components/ui-parts/UISummary.en.d.ts +1 -0
  254. package/dist/components/ui-parts/UITitle.d.ts +1 -0
  255. package/dist/components/ui-parts/UITitle.en.d.ts +1 -0
  256. package/dist/components/ui-parts/UIValue.d.ts +1 -0
  257. package/dist/components/ui-parts/UIValue.en.d.ts +1 -0
  258. package/dist/components/ui-placeholder/UIPlaceholder.d.ts +1 -0
  259. package/dist/components/ui-placeholder/UIPlaceholder.en.d.ts +1 -0
  260. package/dist/components/ui-placeholder/UIPlaceholderHeader.d.ts +1 -0
  261. package/dist/components/ui-placeholder/UIPlaceholderHeader.en.d.ts +1 -0
  262. package/dist/components/ui-placeholder/UIPlaceholderImage.d.ts +1 -0
  263. package/dist/components/ui-placeholder/UIPlaceholderImage.en.d.ts +1 -0
  264. package/dist/components/ui-placeholder/UIPlaceholderLine.d.ts +1 -0
  265. package/dist/components/ui-placeholder/UIPlaceholderLine.en.d.ts +1 -0
  266. package/dist/components/ui-placeholder/UIPlaceholderParagraph.d.ts +1 -0
  267. package/dist/components/ui-placeholder/UIPlaceholderParagraph.en.d.ts +1 -0
  268. package/dist/components/ui-popup/UIPopup.d.ts +30 -3
  269. package/dist/components/ui-popup/UIPopup.en.d.ts +7 -0
  270. package/dist/components/ui-popup/UIPopup.es.d.ts +1 -0
  271. package/dist/components/ui-progress/UIProgress.d.ts +2 -0
  272. package/dist/components/ui-progress/UIProgress.en.d.ts +2 -0
  273. package/dist/components/ui-progress/UIProgress.es.d.ts +1 -0
  274. package/dist/components/ui-property-editor/UIProperty.d.ts +132 -5
  275. package/dist/components/ui-property-editor/UIProperty.en.d.ts +11 -44
  276. package/dist/components/ui-property-editor/UIProperty.es.d.ts +4 -0
  277. package/dist/components/ui-property-editor/UIPropertyEditor.d.ts +38 -0
  278. package/dist/components/ui-property-editor/UIPropertyEditor.en.d.ts +1 -0
  279. package/dist/components/ui-property-editor/UIPropertyEditor.es.d.ts +4 -0
  280. package/dist/components/ui-property-editor/UIPropertyEditor.types.d.ts +33 -0
  281. package/dist/components/ui-property-editor/UIPropertyGroup.d.ts +12 -0
  282. package/dist/components/ui-property-editor/UIPropertyGroup.en.d.ts +2 -0
  283. package/dist/components/ui-property-editor/UIPropertyGroup.es.d.ts +9 -0
  284. package/dist/components/ui-property-editor/index.d.ts +1 -0
  285. package/dist/components/ui-quote/UIQuote.d.ts +1 -0
  286. package/dist/components/ui-quote/UIQuote.en.d.ts +1 -0
  287. package/dist/components/ui-rail/UIRail.d.ts +1 -0
  288. package/dist/components/ui-rail/UIRail.en.d.ts +1 -0
  289. package/dist/components/ui-rating/UIRating.d.ts +6 -0
  290. package/dist/components/ui-rating/UIRating.en.d.ts +6 -0
  291. package/dist/components/ui-rating/UIRating.fallback.d.ts +6 -0
  292. package/dist/components/ui-reveal/UIReveal.d.ts +1 -0
  293. package/dist/components/ui-reveal/UIReveal.en.d.ts +1 -0
  294. package/dist/components/ui-root/UIRoot.d.ts +18 -3
  295. package/dist/components/ui-root/UIRoot.en.d.ts +15 -0
  296. package/dist/components/ui-root/UIRoot.es.d.ts +1 -0
  297. package/dist/components/ui-search/UISearch.d.ts +48 -7
  298. package/dist/components/ui-search/UISearch.en.d.ts +13 -1
  299. package/dist/components/ui-search/UISearch.es.d.ts +1 -0
  300. package/dist/components/ui-search/UISearch.fallback.d.ts +13 -1
  301. package/dist/components/ui-section/UISection.d.ts +22 -1
  302. package/dist/components/ui-section/UISection.en.d.ts +10 -0
  303. package/dist/components/ui-section/UISection.es.d.ts +1 -0
  304. package/dist/components/ui-section/UISections.d.ts +1 -0
  305. package/dist/components/ui-section/UISections.en.d.ts +1 -0
  306. package/dist/components/ui-segment/UISegment.d.ts +2 -0
  307. package/dist/components/ui-segment/UISegment.en.d.ts +2 -0
  308. package/dist/components/ui-segment/UISegment.es.d.ts +1 -0
  309. package/dist/components/ui-segment/UISegments.d.ts +1 -0
  310. package/dist/components/ui-segment/UISegments.en.d.ts +1 -0
  311. package/dist/components/ui-select/UISelect.d.ts +6 -0
  312. package/dist/components/ui-select/UISelect.en.d.ts +6 -0
  313. package/dist/components/ui-select/UISelect.fallback.d.ts +6 -0
  314. package/dist/components/ui-shape/UIShape.d.ts +23 -2
  315. package/dist/components/ui-shape/UIShape.en.d.ts +8 -0
  316. package/dist/components/ui-shape/UIShape.es.d.ts +1 -0
  317. package/dist/components/ui-shape/UISide.d.ts +4 -0
  318. package/dist/components/ui-shape/UISide.en.d.ts +4 -0
  319. package/dist/components/ui-sidebar/UIPushable.d.ts +1 -0
  320. package/dist/components/ui-sidebar/UIPushable.en.d.ts +1 -0
  321. package/dist/components/ui-sidebar/UIPusher.d.ts +1 -0
  322. package/dist/components/ui-sidebar/UIPusher.en.d.ts +1 -0
  323. package/dist/components/ui-sidebar/UISidebar.d.ts +1 -0
  324. package/dist/components/ui-sidebar/UISidebar.en.d.ts +1 -0
  325. package/dist/components/ui-sides/UISides.d.ts +209 -0
  326. package/dist/components/ui-sides/UISides.en.d.ts +122 -0
  327. package/dist/components/ui-sides/UISides.es.d.ts +30 -0
  328. package/dist/components/ui-sides/UISides.fallback.d.ts +134 -0
  329. package/dist/components/ui-sides/index.d.ts +2 -0
  330. package/dist/components/ui-site-nav/SitePages.d.ts +53 -0
  331. package/dist/components/ui-site-nav/UISiteNav.d.ts +207 -0
  332. package/dist/components/ui-site-nav/UISiteNav.en.d.ts +87 -0
  333. package/dist/components/ui-site-nav/UISiteNav.es.d.ts +29 -0
  334. package/dist/components/ui-site-nav/index.d.ts +1 -0
  335. package/dist/components/ui-site-tabs/UISiteTabs.d.ts +126 -0
  336. package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +49 -0
  337. package/dist/components/ui-site-tabs/UISiteTabs.es.d.ts +18 -0
  338. package/dist/components/ui-site-tabs/index.d.ts +1 -0
  339. package/dist/components/ui-slider/UISlider.d.ts +7 -0
  340. package/dist/components/ui-slider/UISlider.en.d.ts +7 -0
  341. package/dist/components/ui-slider/UISlider.es.d.ts +1 -0
  342. package/dist/components/ui-slider/UISlider.fallback.d.ts +7 -0
  343. package/dist/components/ui-space/UISpace.d.ts +1 -0
  344. package/dist/components/ui-space/UISpace.en.d.ts +1 -0
  345. package/dist/components/ui-split-panel/UISplitPanel.d.ts +175 -0
  346. package/dist/components/ui-split-panel/UISplitPanel.en.d.ts +74 -0
  347. package/dist/components/ui-split-panel/UISplitPanel.es.d.ts +25 -0
  348. package/dist/components/ui-split-panel/index.d.ts +2 -0
  349. package/dist/components/ui-stack/UIStack.d.ts +31 -5
  350. package/dist/components/ui-stack/UIStack.en.d.ts +15 -3
  351. package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
  352. package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
  353. package/dist/components/ui-statistic/UIStatistics.d.ts +1 -0
  354. package/dist/components/ui-statistic/UIStatistics.en.d.ts +1 -0
  355. package/dist/components/ui-step/UIStep.d.ts +1 -0
  356. package/dist/components/ui-step/UIStep.en.d.ts +1 -0
  357. package/dist/components/ui-step/UISteps.d.ts +1 -0
  358. package/dist/components/ui-step/UISteps.en.d.ts +1 -0
  359. package/dist/components/ui-sticky/UISticky.d.ts +4 -0
  360. package/dist/components/ui-sticky/UISticky.en.d.ts +1 -0
  361. package/dist/components/ui-tab/UITab.d.ts +8 -0
  362. package/dist/components/ui-tab/UITab.en.d.ts +1 -0
  363. package/dist/components/ui-tab/UITabs.d.ts +107 -16
  364. package/dist/components/ui-tab/UITabs.en.d.ts +40 -1
  365. package/dist/components/ui-tab/UITabs.es.d.ts +4 -0
  366. package/dist/components/ui-table/TableEditing.d.ts +77 -0
  367. package/dist/components/ui-table/UICell.d.ts +1 -0
  368. package/dist/components/ui-table/UICell.en.d.ts +1 -0
  369. package/dist/components/ui-table/UITable.d.ts +145 -5
  370. package/dist/components/ui-table/UITable.en.d.ts +19 -0
  371. package/dist/components/ui-table/UITable.es.d.ts +3 -0
  372. package/dist/components/ui-terms/UITerm.d.ts +1 -0
  373. package/dist/components/ui-terms/UITerm.en.d.ts +1 -0
  374. package/dist/components/ui-terms/UITerms.d.ts +1 -0
  375. package/dist/components/ui-terms/UITerms.en.d.ts +1 -0
  376. package/dist/components/ui-text/UILink.d.ts +11 -0
  377. package/dist/components/ui-text/UILink.en.d.ts +4 -0
  378. package/dist/components/ui-text/UIText.d.ts +7 -0
  379. package/dist/components/ui-text/UIText.en.d.ts +7 -0
  380. package/dist/components/ui-text/UIText.es.d.ts +2 -0
  381. package/dist/components/ui-theme-editor/SavedTheme.d.ts +55 -43
  382. package/dist/components/ui-theme-editor/ThemeDraft.d.ts +15 -0
  383. package/dist/components/ui-theme-editor/UIColorChip.d.ts +1 -0
  384. package/dist/components/ui-theme-editor/UIColorChip.en.d.ts +1 -0
  385. package/dist/components/ui-theme-editor/UIThemeEditor.d.ts +157 -26
  386. package/dist/components/ui-theme-editor/UIThemeEditor.en.d.ts +79 -6
  387. package/dist/components/ui-theme-editor/UIThemeEditor.es.d.ts +20 -2
  388. package/dist/components/ui-theme-editor/UIThemeEditor.types.d.ts +0 -2
  389. package/dist/components/ui-theme-editor/UIThemeToken.d.ts +1 -0
  390. package/dist/components/ui-theme-editor/UIThemeToken.en.d.ts +1 -0
  391. package/dist/components/ui-theme-menu/HueDropdown.d.ts +47 -0
  392. package/dist/components/ui-theme-menu/ThemeMenu.d.ts +18 -7
  393. package/dist/components/ui-theme-menu/ThemePreference.d.ts +145 -36
  394. package/dist/components/ui-theme-menu/UIThemeMenu.d.ts +118 -7
  395. package/dist/components/ui-theme-menu/UIThemeMenu.en.d.ts +82 -2
  396. package/dist/components/ui-theme-menu/UIThemeMenu.es.d.ts +21 -1
  397. package/dist/components/ui-theme-menu/UIThemeMenu.types.d.ts +36 -8
  398. package/dist/components/ui-theme-menu/index.d.ts +2 -1
  399. package/dist/components/ui-toast/UIToast.d.ts +1 -0
  400. package/dist/components/ui-toast/UIToast.en.d.ts +1 -0
  401. package/dist/components/ui-toc/UIToc.d.ts +1 -0
  402. package/dist/components/ui-toc/UIToc.en.d.ts +1 -0
  403. package/dist/components/ui-toolbar/UIToolbar.d.ts +13 -10
  404. package/dist/components/ui-toolbar/UIToolbar.en.d.ts +138 -84
  405. package/dist/components/ui-toolbar/UIToolbar.es.d.ts +2 -0
  406. package/dist/components/ui-transition/UITransition.d.ts +1 -0
  407. package/dist/components/ui-transition/UITransition.en.d.ts +1 -0
  408. package/dist/components/ui-tree/UITree.d.ts +162 -0
  409. package/dist/components/ui-tree/UITree.en.d.ts +88 -0
  410. package/dist/components/ui-tree/UITree.es.d.ts +35 -0
  411. package/dist/components/ui-tree/UITreeItem.d.ts +204 -0
  412. package/dist/components/ui-tree/UITreeItem.en.d.ts +142 -0
  413. package/dist/components/ui-tree/UITreeItem.es.d.ts +32 -0
  414. package/dist/components/ui-tree/index.d.ts +3 -0
  415. package/dist/components/ui-tree-diagram/TreeData.d.ts +3 -12
  416. package/dist/components/ui-tree-diagram/TreeLayout.d.ts +54 -21
  417. package/dist/components/ui-tree-diagram/TreeMeasure.d.ts +36 -0
  418. package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +152 -27
  419. package/dist/components/ui-tree-diagram/UITreeDiagram.en.d.ts +47 -7
  420. package/dist/components/ui-tree-diagram/UITreeDiagram.es.d.ts +12 -1
  421. package/dist/components/ui-tree-diagram/UITreeDiagram.types.d.ts +66 -21
  422. package/dist/components/ui-tree-diagram/UITreeNode.d.ts +148 -0
  423. package/dist/components/ui-tree-diagram/UITreeNode.en.d.ts +69 -0
  424. package/dist/components/ui-tree-diagram/UITreeNode.es.d.ts +21 -0
  425. package/dist/components/ui-tree-diagram/index.d.ts +4 -2
  426. package/dist/components/ui-video/UIAudio.d.ts +1 -0
  427. package/dist/components/ui-video/UIAudio.en.d.ts +1 -0
  428. package/dist/components/ui-video/UIVideo.d.ts +1 -0
  429. package/dist/components/ui-video/UIVideo.en.d.ts +1 -0
  430. package/dist/components/ui-visibility/UIVisibility.d.ts +1 -0
  431. package/dist/components/ui-visibility/UIVisibility.en.d.ts +1 -0
  432. package/dist/components/ui-zoom/UIZoom.d.ts +1 -0
  433. package/dist/components/ui-zoom/UIZoom.en.d.ts +1 -0
  434. package/dist/{components.es-DmLzT-Bq.js → components.es-BOa_7gFF.js} +498 -109
  435. package/dist/components.es-BOa_7gFF.js.map +1 -0
  436. package/dist/core.d.ts +3 -1
  437. package/dist/core.js +1082 -511
  438. package/dist/core.js.map +1 -1
  439. package/dist/crisp-VfYZlTph.js +6 -0
  440. package/dist/{crisp-CoZRRDuQ.js.map → crisp-VfYZlTph.js.map} +1 -1
  441. package/dist/docs-components/index.d.ts +1 -0
  442. package/dist/docs-components/ui-docs-index/UIDocsIndex.d.ts +89 -0
  443. package/dist/docs-components/ui-docs-index/UIDocsIndex.en.d.ts +43 -0
  444. package/dist/docs-components/ui-docs-index/index.d.ts +2 -0
  445. package/dist/docs-components/ui-docs-nav/UIDocsNav.d.ts +54 -87
  446. package/dist/docs-components/ui-docs-nav/UIDocsNav.types.d.ts +2 -29
  447. package/dist/docs-components/ui-docs-search/SearchIndex.d.ts +8 -2
  448. package/dist/docs-components/ui-docs-search/UIDocsSearch.d.ts +10 -0
  449. package/dist/docs-components/ui-docs-search/UIDocsSearch.en.d.ts +5 -0
  450. package/dist/elements/AddressParameter.d.ts +87 -0
  451. package/dist/elements/DOMFormControl.d.ts +5 -0
  452. package/dist/elements/FormComponent.d.ts +32 -0
  453. package/dist/elements/LoadableBody.d.ts +6 -1
  454. package/dist/elements/LoadableComponent.d.ts +10 -1
  455. package/dist/elements/RootSettings.d.ts +43 -6
  456. package/dist/elements/SpellUISettings.d.ts +1 -0
  457. package/dist/elements/StickyWatch.d.ts +20 -0
  458. package/dist/elements/elements.types.d.ts +15 -0
  459. package/dist/elements/index.d.ts +2 -0
  460. package/dist/forms.js +93 -63
  461. package/dist/forms.js.map +1 -1
  462. package/dist/fruity-BRVlgJZd.js +6 -0
  463. package/dist/fruity-BRVlgJZd.js.map +1 -0
  464. package/dist/{fruity.theme-BJcMiPl1.js → fruity.theme-CbC7Jyvk.js} +2 -2
  465. package/dist/fruity.theme-CbC7Jyvk.js.map +1 -0
  466. package/dist/glass-x9tbbwVq.js +6 -0
  467. package/dist/glass-x9tbbwVq.js.map +1 -0
  468. package/dist/glass.theme-24wY2wH9.js +6 -0
  469. package/dist/glass.theme-24wY2wH9.js.map +1 -0
  470. package/dist/hot.js +530 -24
  471. package/dist/hot.js.map +1 -1
  472. package/dist/index.d.ts +8 -0
  473. package/dist/index.js +91 -81
  474. package/dist/jsx.d.ts +21149 -10377
  475. package/dist/matrix-QY2gWbJ0.js +6 -0
  476. package/dist/{matrix-CqA59hiF.js.map → matrix-QY2gWbJ0.js.map} +1 -1
  477. package/dist/{matrix.theme-jqQZjcq3.js → matrix.theme-_8xtwhDq.js} +2 -2
  478. package/dist/matrix.theme-_8xtwhDq.js.map +1 -0
  479. package/dist/midnight-BxlTQSfw.js +6 -0
  480. package/dist/{midnight-BnoVOrhC.js.map → midnight-BxlTQSfw.js.map} +1 -1
  481. package/dist/mockup-83ELBuVr.js +6 -0
  482. package/dist/mockup-83ELBuVr.js.map +1 -0
  483. package/dist/mockup.theme-DmpBgGBl.js +6 -0
  484. package/dist/mockup.theme-DmpBgGBl.js.map +1 -0
  485. package/dist/paper-M61nUilz.js +6 -0
  486. package/dist/{paper-CynH8ZuT.js.map → paper-M61nUilz.js.map} +1 -1
  487. package/dist/persist.types-D2m6wD-S.js +9 -0
  488. package/dist/persist.types-D2m6wD-S.js.map +1 -0
  489. package/dist/pop-CxXfytjk.js +6 -0
  490. package/dist/{pop-D2i9V_rG.js.map → pop-CxXfytjk.js.map} +1 -1
  491. package/dist/runtime/DataTooltips.d.ts +75 -0
  492. package/dist/runtime/PropertyControls.d.ts +15 -1
  493. package/dist/runtime/Sources.d.ts +16 -4
  494. package/dist/runtime/Styles.d.ts +11 -0
  495. package/dist/runtime/Themes.d.ts +10 -4
  496. package/dist/runtime/UIRuntime.d.ts +4 -1
  497. package/dist/runtime/index.d.ts +1 -1
  498. package/dist/runtime/runtime.types.d.ts +18 -85
  499. package/dist/spell-By5Y3jKP.js +6 -0
  500. package/dist/{spell-BFtLICm7.js.map → spell-By5Y3jKP.js.map} +1 -1
  501. package/dist/{spell.theme-B7AU7SQX.js → spell.theme-DxGj7qHx.js} +2 -2
  502. package/dist/spell.theme-DxGj7qHx.js.map +1 -0
  503. package/dist/styles/CodeThemeFile.d.ts +73 -0
  504. package/dist/styles/StyleGenerator.d.ts +6 -0
  505. package/dist/styles/styles.en.d.ts +141 -3
  506. package/dist/styles/styles.types.d.ts +2 -0
  507. package/dist/{styles.en-RLpYiO5_.js → styles.en-CUUxNwHo.js} +71 -14
  508. package/dist/styles.en-CUUxNwHo.js.map +1 -0
  509. package/dist/styles.js +13 -13
  510. package/dist/styles.js.map +1 -1
  511. package/dist/ui-accordion.js +54 -53
  512. package/dist/ui-accordion.js.map +1 -1
  513. package/dist/ui-action.js +20 -19
  514. package/dist/ui-action.js.map +1 -1
  515. package/dist/ui-ad.js +5 -4
  516. package/dist/ui-ad.js.map +1 -1
  517. package/dist/ui-breadcrumbs.js +15 -13
  518. package/dist/ui-breadcrumbs.js.map +1 -1
  519. package/dist/ui-button.js +132 -125
  520. package/dist/ui-button.js.map +1 -1
  521. package/dist/ui-calendar.js +208 -206
  522. package/dist/ui-calendar.js.map +1 -1
  523. package/dist/ui-card.js +260 -98
  524. package/dist/ui-card.js.map +1 -1
  525. package/dist/ui-checkbox.js +95 -81
  526. package/dist/ui-checkbox.js.map +1 -1
  527. package/dist/ui-code.js +25 -24
  528. package/dist/ui-code.js.map +1 -1
  529. package/dist/ui-comment.js +14 -12
  530. package/dist/ui-comment.js.map +1 -1
  531. package/dist/ui-components.js +7 -6
  532. package/dist/ui-components.js.map +1 -1
  533. package/dist/ui-container.js +24 -12
  534. package/dist/ui-container.js.map +1 -1
  535. package/dist/ui-diagram.js +1328 -0
  536. package/dist/ui-diagram.js.map +1 -0
  537. package/dist/ui-dimension.js +779 -0
  538. package/dist/ui-dimension.js.map +1 -0
  539. package/dist/ui-dimmer.js +36 -34
  540. package/dist/ui-dimmer.js.map +1 -1
  541. package/dist/ui-divider.js +7 -5
  542. package/dist/ui-divider.js.map +1 -1
  543. package/dist/ui-dropdown.js +107 -105
  544. package/dist/ui-dropdown.js.map +1 -1
  545. package/dist/ui-embed.js +36 -35
  546. package/dist/ui-embed.js.map +1 -1
  547. package/dist/ui-emoji.js +10 -9
  548. package/dist/ui-emoji.js.map +1 -1
  549. package/dist/ui-example.js +63 -61
  550. package/dist/ui-example.js.map +1 -1
  551. package/dist/ui-feed.js +12 -10
  552. package/dist/ui-feed.js.map +1 -1
  553. package/dist/ui-flag.js +10 -9
  554. package/dist/ui-flag.js.map +1 -1
  555. package/dist/ui-flyout.js +7 -6
  556. package/dist/ui-flyout.js.map +1 -1
  557. package/dist/ui-form.js +244 -162
  558. package/dist/ui-form.js.map +1 -1
  559. package/dist/ui-grid.js +21 -18
  560. package/dist/ui-grid.js.map +1 -1
  561. package/dist/ui-icon-picker.js +46 -44
  562. package/dist/ui-icon-picker.js.map +1 -1
  563. package/dist/ui-icon.js +17 -14
  564. package/dist/ui-icon.js.map +1 -1
  565. package/dist/ui-image.js +93 -55
  566. package/dist/ui-image.js.map +1 -1
  567. package/dist/ui-include.js +18 -17
  568. package/dist/ui-include.js.map +1 -1
  569. package/dist/ui-input.js +154 -112
  570. package/dist/ui-input.js.map +1 -1
  571. package/dist/ui-item.js +152 -102
  572. package/dist/ui-item.js.map +1 -1
  573. package/dist/ui-items.js +9 -8
  574. package/dist/ui-items.js.map +1 -1
  575. package/dist/ui-json.js +115 -0
  576. package/dist/ui-json.js.map +1 -0
  577. package/dist/ui-keys.js +1 -1
  578. package/dist/ui-label.js +18 -15
  579. package/dist/ui-label.js.map +1 -1
  580. package/dist/ui-list.js +7 -5
  581. package/dist/ui-list.js.map +1 -1
  582. package/dist/ui-loader.js +7 -6
  583. package/dist/ui-loader.js.map +1 -1
  584. package/dist/ui-markdown.js +975 -83
  585. package/dist/ui-markdown.js.map +1 -1
  586. package/dist/ui-menu.js +329 -196
  587. package/dist/ui-menu.js.map +1 -1
  588. package/dist/ui-message.js +20 -18
  589. package/dist/ui-message.js.map +1 -1
  590. package/dist/ui-modal.js +46 -45
  591. package/dist/ui-modal.js.map +1 -1
  592. package/dist/ui-nag.js +19 -18
  593. package/dist/ui-nag.js.map +1 -1
  594. package/dist/ui-page.js +8 -7
  595. package/dist/ui-page.js.map +1 -1
  596. package/dist/ui-panel.js +28 -17
  597. package/dist/ui-panel.js.map +1 -1
  598. package/dist/ui-parts.js +66 -52
  599. package/dist/ui-parts.js.map +1 -1
  600. package/dist/ui-placeholder.js +21 -16
  601. package/dist/ui-placeholder.js.map +1 -1
  602. package/dist/ui-popup.js +113 -84
  603. package/dist/ui-popup.js.map +1 -1
  604. package/dist/ui-progress.js +9 -7
  605. package/dist/ui-progress.js.map +1 -1
  606. package/dist/ui-property-editor.js +706 -203
  607. package/dist/ui-property-editor.js.map +1 -1
  608. package/dist/ui-quote.js +5 -4
  609. package/dist/ui-quote.js.map +1 -1
  610. package/dist/ui-rail.js +5 -4
  611. package/dist/ui-rail.js.map +1 -1
  612. package/dist/ui-rating.js +31 -29
  613. package/dist/ui-rating.js.map +1 -1
  614. package/dist/ui-reveal.js +7 -6
  615. package/dist/ui-reveal.js.map +1 -1
  616. package/dist/ui-root.js +324 -158
  617. package/dist/ui-root.js.map +1 -1
  618. package/dist/ui-search.js +210 -168
  619. package/dist/ui-search.js.map +1 -1
  620. package/dist/ui-section.js +124 -92
  621. package/dist/ui-section.js.map +1 -1
  622. package/dist/ui-segment.js +15 -12
  623. package/dist/ui-segment.js.map +1 -1
  624. package/dist/ui-select.js +83 -81
  625. package/dist/ui-select.js.map +1 -1
  626. package/dist/ui-shape.js +86 -58
  627. package/dist/ui-shape.js.map +1 -1
  628. package/dist/ui-sidebar.js +59 -56
  629. package/dist/ui-sidebar.js.map +1 -1
  630. package/dist/ui-sides.js +325 -0
  631. package/dist/ui-sides.js.map +1 -0
  632. package/dist/ui-site-nav.js +329 -0
  633. package/dist/ui-site-nav.js.map +1 -0
  634. package/dist/ui-site-tabs.js +177 -0
  635. package/dist/ui-site-tabs.js.map +1 -0
  636. package/dist/ui-slider.js +84 -81
  637. package/dist/ui-slider.js.map +1 -1
  638. package/dist/ui-space.js +7 -6
  639. package/dist/ui-space.js.map +1 -1
  640. package/dist/ui-split-panel.js +298 -0
  641. package/dist/ui-split-panel.js.map +1 -0
  642. package/dist/ui-stack.js +47 -23
  643. package/dist/ui-stack.js.map +1 -1
  644. package/dist/ui-statistic.js +15 -13
  645. package/dist/ui-statistic.js.map +1 -1
  646. package/dist/ui-step.js +31 -29
  647. package/dist/ui-step.js.map +1 -1
  648. package/dist/ui-sticky.js +7 -6
  649. package/dist/ui-sticky.js.map +1 -1
  650. package/dist/ui-tab.js +230 -138
  651. package/dist/ui-tab.js.map +1 -1
  652. package/dist/ui-table.js +724 -162
  653. package/dist/ui-table.js.map +1 -1
  654. package/dist/ui-terms.js +12 -10
  655. package/dist/ui-terms.js.map +1 -1
  656. package/dist/ui-text.js +53 -28
  657. package/dist/ui-text.js.map +1 -1
  658. package/dist/ui-theme-editor.js +1018 -1545
  659. package/dist/ui-theme-editor.js.map +1 -1
  660. package/dist/ui-theme-menu-CuIjr8Ou.js +1493 -0
  661. package/dist/ui-theme-menu-CuIjr8Ou.js.map +1 -0
  662. package/dist/ui-toast.js +45 -44
  663. package/dist/ui-toast.js.map +1 -1
  664. package/dist/ui-toc.js +75 -74
  665. package/dist/ui-toc.js.map +1 -1
  666. package/dist/ui-toolbar.js +51 -73
  667. package/dist/ui-toolbar.js.map +1 -1
  668. package/dist/ui-transition.js +12 -11
  669. package/dist/ui-transition.js.map +1 -1
  670. package/dist/ui-tree-diagram.js +676 -197
  671. package/dist/ui-tree-diagram.js.map +1 -1
  672. package/dist/ui-tree.js +625 -0
  673. package/dist/ui-tree.js.map +1 -0
  674. package/dist/ui-video.js +13 -11
  675. package/dist/ui-video.js.map +1 -1
  676. package/dist/ui-visibility.js +26 -25
  677. package/dist/ui-visibility.js.map +1 -1
  678. package/dist/ui-zoom.js +79 -78
  679. package/dist/ui-zoom.js.map +1 -1
  680. package/dist/util/TopLayerTip.d.ts +28 -0
  681. package/dist/util/index.d.ts +5 -2
  682. package/dist/vocabulary/DefaultValues.d.ts +34 -0
  683. package/dist/vocabulary/SharedVocabulary.d.ts +4 -0
  684. package/dist/vocabulary/SharedVocabulary.es.d.ts +7 -0
  685. package/dist/vocabulary/ValueSets.d.ts +18 -0
  686. package/dist/vocabulary/Vocabulary.d.ts +1 -0
  687. package/dist/vocabulary/defaults.generated.d.ts +6 -0
  688. package/dist/vocabulary/index.d.ts +1 -0
  689. package/package.json +1 -1
  690. package/dist/MarkdownEngine-CbuT9Mjc.js.map +0 -1
  691. package/dist/PrefStore-CeaTtjTz.js.map +0 -1
  692. package/dist/UIButton-XkfGqgh6.js +0 -6
  693. package/dist/UIButton-XkfGqgh6.js.map +0 -1
  694. package/dist/UIInput-BUudZstW.js +0 -6
  695. package/dist/UIInput-BUudZstW.js.map +0 -1
  696. package/dist/UIKeys-DJF2TIKE.js.map +0 -1
  697. package/dist/UILabel-C1jy3Yl8.js +0 -6
  698. package/dist/UILabel-C1jy3Yl8.js.map +0 -1
  699. package/dist/UIMenu-Btd-8V3A.js +0 -42
  700. package/dist/UIMenu-Btd-8V3A.js.map +0 -1
  701. package/dist/UIRuntime-BBuehGly.js.map +0 -1
  702. package/dist/components.es-DmLzT-Bq.js.map +0 -1
  703. package/dist/crisp-CoZRRDuQ.js +0 -6
  704. package/dist/fruity-CQFYeRlh.js +0 -6
  705. package/dist/fruity-CQFYeRlh.js.map +0 -1
  706. package/dist/fruity.theme-BJcMiPl1.js.map +0 -1
  707. package/dist/glass-CAfW11kL.js +0 -6
  708. package/dist/glass-CAfW11kL.js.map +0 -1
  709. package/dist/glass.theme-DQcBbtCW.js +0 -6
  710. package/dist/glass.theme-DQcBbtCW.js.map +0 -1
  711. package/dist/matrix-CqA59hiF.js +0 -6
  712. package/dist/matrix.theme-jqQZjcq3.js.map +0 -1
  713. package/dist/midnight-BnoVOrhC.js +0 -6
  714. package/dist/paper-CynH8ZuT.js +0 -6
  715. package/dist/persist.types-CsZxS8TG.js +0 -9
  716. package/dist/persist.types-CsZxS8TG.js.map +0 -1
  717. package/dist/pop-D2i9V_rG.js +0 -6
  718. package/dist/spell-BFtLICm7.js +0 -6
  719. package/dist/spell.theme-B7AU7SQX.js.map +0 -1
  720. package/dist/styles.en-RLpYiO5_.js.map +0 -1
  721. package/dist/ui-theme-menu-DyKZygpV.js +0 -921
  722. package/dist/ui-theme-menu-DyKZygpV.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ui-search.js","names":["UIT.SearchMatches","_vocabulary_dec","_a","_init","E.NativeFallback","E.proto","__name","E.escapeRegExp","UIT.WHITESPACE","E.withoutAccents","class={PROMPT}","this","type=\"text\"","role=\"combobox\"","autocomplete=\"off\"","spellcheck={false}","enterkeyhint=\"search\"","ref={(element) => this.input = element}","<div class={this.rootClass} part={this.partForName(\"search\")} style={this.popover.anchorStyle}>\n <div\n class={[INPUT, { [LOADING]: this.isLoading, [UIT.FLUID]: this.fluid, [UIT.DISABLED]: this.isDisabled }]}\n part={this.partForName(\"input\")}\n >\n <input\n ref={(element) => this.input = element}\n class={PROMPT}\n part={this.partForName(\"prompt\")}\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck={false}\n enterkeyhint=\"search\"\n value={this.startingQuery}\n placeholder={this.placeholder}\n disabled={this.isDisabled}\n readonly={this.isReadOnly}\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-expanded={this.resultsAreShowing && this.shownResults.length ? \"true\" : \"false\"}\n aria-controls={this.ids.results}\n aria-activedescendant={this.resultsAreShowing && this.highlightedResult ? this.idFor(this.highlightedResult) : void 0}\n aria-label={this.label}\n aria-busy={this.isLoading ? \"true\" : void 0}\n aria-required={this.required ? \"true\" : void 0}\n aria-invalid={this.validation.valid ? void 0 : \"true\"}\n {...this.staticControl}\n onInput={this.onInput}\n onKeyDown={this.onKeyDown}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.onClick}\n />\n <span class={SEARCH_ICON_CLASS} part={this.partForName(\"icon\")}>\n <slot name={this.slotForName(\"icon\")}>{this.iconGlyph.svg}</slot>\n </span>\n </div>\n {this.results()}\n <span class=\"status\" role=\"status\">\n {this.statusText}\n </span>\n </div>","part={this.partForName(\"search\")}","style={this.popover.anchorStyle}","class={[INPUT, { [LOADING]: this.isLoading, [UIT.FLUID]: this.fluid, [UIT.DISABLED]: this.isDisabled }]}","part={this.partForName(\"input\")}","class={SEARCH_ICON_CLASS}","part={this.partForName(\"icon\")}","name={this.slotForName(\"icon\")}","ref={(element) => this.resultsBox = element}","<Show when={this.resultsAreShowing}>\n <Show when={this.shownResults.length} fallback={this.messageBox()}>\n <Show when={this.category} fallback={<For each={this.shownResults}>{(result) => this.row(result)}</For>}>\n <For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>\n </Show>\n </Show>\n </Show>","<Show when={this.shownResults.length} fallback={this.messageBox()}>\n <Show when={this.category} fallback={<For each={this.shownResults}>{(result) => this.row(result)}</For>}>\n <For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>\n </Show>\n </Show>","<Show when={this.category} fallback={<For each={this.shownResults}>{(result) => this.row(result)}</For>}>\n <For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>\n </Show>","<For each={this.shownResults}>{(result) => this.row(result)}</For>","<For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>","class={RESULTS}","style={this.popover.panelStyle}","part={this.partForName(\"results\")}","role={this.shownResults.length ? \"listbox\" : void 0}","aria-label={this.shownResults.length ? this.label : void 0}","<div\n ref={(element) => this.resultsBox = element}\n id={this.ids.results}\n class={RESULTS}\n style={this.popover.panelStyle}\n popover=\"manual\"\n part={this.partForName(\"results\")}\n role={this.shownResults.length ? \"listbox\" : void 0}\n aria-label={this.shownResults.length ? this.label : void 0}\n onMouseDown={_UISearch.preventDefault}\n >\n <Show when={this.resultsAreShowing}>\n <Show when={this.shownResults.length} fallback={this.messageBox()}>\n <Show when={this.category} fallback={<For each={this.shownResults}>{(result) => this.row(result)}</For>}>\n <For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>\n </Show>\n </Show>\n </Show>\n </div>","<For each={group.results}>{(result) => this.row(result)}</For>","aria-labelledby={nameId()}","part={this.partForName(\"category\")}","id={nameId()}","class={NAME}","part={this.partForName(\"name\")}","<div\n class={[CATEGORY, { [UIT.ACTIVE]: group.results.includes(this.highlightedResult) }]}\n role=\"group\"\n aria-labelledby={nameId()}\n part={this.partForName(\"category\")}\n >\n <div id={nameId()} class={NAME} part={this.partForName(\"name\")}>\n {group.name}\n </div>\n <div class={RESULTS} role=\"none\">\n <For each={group.results}>{(result) => this.row(result)}</For>\n </div>\n </div>","class={classes()}","part={this.partForName(\"result\")}","aria-selected={selected()}","<a\n id={this.idFor(result)}\n class={classes()}\n href={url}\n tabindex=\"-1\"\n role=\"option\"\n part={this.partForName(\"result\")}\n aria-selected={selected()}\n onPointerMove={onPointerMove}\n onClick={onClick}\n >\n {this.resultContent(result)}\n </a>","<div\n id={this.idFor(result)}\n class={classes()}\n role=\"option\"\n part={this.partForName(\"result\")}\n aria-selected={selected()}\n onPointerMove={onPointerMove}\n onClick={onClick}\n >\n {this.resultContent(result)}\n </div>","<Show when={typeof result.image === \"string\"}>\n <div class={UIT.IMAGE}>\n <img src={result.image} alt={typeof result.alt === \"string\" ? result.alt : \"\"} />\n </div>\n </Show>","src={result.image}","alt={typeof result.alt === \"string\" ? result.alt : \"\"}","<div class={UIT.IMAGE}>\n <img src={result.image} alt={typeof result.alt === \"string\" ? result.alt : \"\"} />\n </div>","<Show when={result.price !== void 0 && result.price !== null}>\n <div class={PRICE}>{String(result.price)}</div>\n </Show>","result.price !== void 0 && result.price !== null","<div class={PRICE}>{String(result.price)}</div>","<div class={UIT.CONTENT}>\n <Show when={result.price !== void 0 && result.price !== null}>\n <div class={PRICE}>{String(result.price)}</div>\n </Show>\n <div class={UIT.TITLE}>{this.markedText(String(result.title ?? \"\"))}</div>\n <Show when={result.description}>\n <div class={UIT.DESCRIPTION}>{this.markedText(String(result.description))}</div>\n </Show>\n </div>","<Show when={result.description}>\n <div class={UIT.DESCRIPTION}>{this.markedText(String(result.description))}</div>\n </Show>","<div class={UIT.DESCRIPTION}>{this.markedText(String(result.description))}</div>","class={UIT.TITLE}","<Show when={this.message}>\n {(message) => <div class={[UIT.MESSAGE, message().kind]} part={this.partForName(\"message\")}>\n <Show when={message().header}>\n <div class={UIT.HEADER}>{message().header}</div>\n </Show>\n <div class={UIT.DESCRIPTION}>{message().text}</div>\n </div>}\n </Show>","<Show when={message().header}>\n <div class={UIT.HEADER}>{message().header}</div>\n </Show>","<div class={UIT.HEADER}>{message().header}</div>","<div class={[UIT.MESSAGE, message().kind]} part={this.partForName(\"message\")}>\n <Show when={message().header}>\n <div class={UIT.HEADER}>{message().header}</div>\n </Show>\n <div class={UIT.DESCRIPTION}>{message().text}</div>\n </div>","part={this.partForName(\"message\")}","class={UIT.DESCRIPTION}","F.FormComponent","E.proto","E.protoMerged","E.controlled","E.state","E.onChange","E.derived","E.untracked","E.cssState","F.HighlightedOption","E.PopoverPanel","E.IconGlyph","F.MenuOptions","_$getOwner","_$readShallow","UIT.FLUID","UIT.DISABLED","_$setAttribute","UIT.STATIC_CONTROL","_$createComponent","UIT.ACTIVE","UIT.IMAGE","_$memo","UIT.DESCRIPTION","UIT.CONTENT","UIT.TITLE","UIT.HEADER","UIT.MESSAGE","E.markedPieces","__name","inputCSS","searchCSS","_$delegateEvents","__publicField","FormControlAttributes","HEADER","Key","__decorateElement","__decoratorMetadata","__decoratorStart","IMAGE","WHITESPACE","STATIC_CONTROL","MESSAGE","__name$1","__runInitializers","SearchMatch","CONTENT","DISABLED","ACTIVE","DESCRIPTION","SearchMatches","FLUID","FormControlStates","TITLE","__privateAdd","UIInput_default","getOwner$1","searchVocabulary","RemoteStatus","SearchMessageKind","INPUT","PROMPT","_degraded_dec","_vocabulary_dec$1","_a$1","_init$1","_SearchFallback","NativeFallback","proto","domElement","listId","SUGGESTIONS_SUFFIX","placeholder","input","list","titles","result","title","box","INPUT_PART","root","CHANGE_EVENT","event","SearchFallback","SearchMatcher","DEFAULT_FIELDS","fields","match","ignoreCase","ignoreDiacritics","term","query","wordStart","escapeRegExp","words","first","exact","fuzzy","source","texts","joined","word","text","groups","results","group","name","members","response","category","plain","maxResults","field","value","withoutAccents","position","char","UISearch_default","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_tmpl$6","_tmpl$7","_tmpl$8","_tmpl$9","_tmpl$10","_onKeyDown_dec","_onBlur_dec","_onClick_dec","_startingQuery_dec","_isLoading_dec","_onPopoverChanged_dec","_resultsAreShowing_dec","_isOpen_dec","_onHighlightChanged_dec","_rerunQuery_dec","_message_dec","_shownResults_dec","_runningQuery_dec","_remoteAnswer_dec","_localGroups_dec","_matcher_dec","_onQueryChanged_dec","_inputRevision_dec","_value_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_value","_inputRevision","_remoteAnswer","_runningQuery","_isOpen","_UISearch","FormComponent","protoMerged","controlled","state","onChange","derived","untracked","cssState","HighlightedOption","PopoverPanel","open","IconGlyph","SEARCH_ICON","MenuOptions","isLong","next","isShowing","Converters","max","remote","originalEvent","url","cached","running","error","resultsAreShowing","isConnected","UI","ID_PREFIX","_self$","_el$","_el$2","_el$3","_el$4","_el$5","_el$6","spread","ref","element","insert","effect","readShallow","LOADING","SEARCH_ICON_CLASS","className","_p$","t","setAttribute","style","a","o","i","n","s","h","isServer","_self$2","_el$7","addEvent","createComponent","Show","For","index","RESULTS","nameId","CATEGORY_ID_INFIX","_self$3","_el$8","_el$9","_el$10","CATEGORY","NAME","classes","RESULT","selected","onPointerMove","onClick","_self$4","_el$11","_o$","claimElement","_self$5","_el$12","_self$6","_el$13","_el$14","_el$15","_el$17","_el$19","memo","_el$16","PRICE","_v$","_$p","_el$18","_self$7","_el$20","_el$22","message","_el$21","ranges","markedPieces","piece","_el$23","count","id","UISearch","delegateEvents"],"sources":["../src/components/ui-search/UISearch.en.ts","../src/components/ui-search/UISearch.types.ts","../src/components/ui-search/UISearch.fallback.ts","../src/components/ui-search/SearchMatcher.ts","../src/components/ui-search/UISearch.css?inline","../src/components/ui-search/UISearch.tsx","../src/components/ui-search/index.ts"],"sourcesContent":["/**\n * Every name `<ui-search>` uses: tag, attributes (kind + allowed values), events, slots, parts, states, texts.\n * Schema: `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Pure data: node imports it (`yarn site:data`, `yarn gen:root`), so `spell/ui/core` for types only,\n * `UIT` by value straight from `components.types`.\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-search category fluid align=\"right\">` => `ui category fluid right aligned search`.\n * `UISearch.css` keys on those words.\n * - Rich data is a PROPERTY (`source`, `kind: \"json\"`);\n * first paint never needs it -- the input and its `value` are all SSR must show.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `<ui-search>`\n * A combobox + listbox: a text `<input>` and an anchor-positioned popover of results,\n * from a local `source` or a remote `url`.\n ****************/\nexport const searchVocabulary = {\n tag: \"ui-search\",\n formControl: true,\n topics: [\"inputs\", \"forms\", \"navigation\", \"selection\", \"modules\"],\n aka: [\"autocomplete\", \"typeahead\", \"search box\", \"combobox\", \"lookup\"],\n skeleton: \"inline 15 x 2.5\",\n noun: \"search\",\n description: \"A search module lets people query for results from a selection of data.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Size, `mini` ... `massive`; `medium` is the default.\"\n },\n {\n name: \"category\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Results in named groups (`category` of each result).\"\n },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"horizontal\"],\n replaces: [{ from: \"horizontal\", value: \"horizontal\" }],\n description:\n \"`horizontal`, with `category`: each group's name above its results, not beside them. \" +\n \"Old name: `horizontal`.\"\n },\n {\n name: \"fluid\",\n group: \"layout\",\n kind: \"keyOnly\",\n description: \"Takes the full width of its container; so do the results.\"\n },\n { name: \"scrolling\", group: \"layout\", kind: \"keyOnly\", description: \"The results scroll after a fixed height.\" },\n {\n name: \"resizable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description: \"`scrolling`: people can resize the results vertically.\"\n },\n {\n name: \"length\",\n group: \"appearance\",\n kind: \"valueOnly\",\n values: [\"very-short\", \"short\", \"long\", \"very-long\"],\n classes: { \"very-short\": \"very short\", \"very-long\": \"very long\" },\n replaces: [\n { from: \"short\", value: \"short\" },\n { from: \"very-short\", value: \"very-short\" },\n { from: \"long\", value: \"long\" },\n { from: \"very-long\", value: \"very-long\" }\n ],\n description:\n \"How far the results go before they scroll: `very-short`, `short`, `long`, `very-long`. \" +\n \"Old names: `short`, `very-short`, `long`, `very-long`.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"valueAndKey\",\n key: \"aligned\",\n values: [\"left\", \"right\"],\n replaces: [\"aligned\"],\n description:\n \"Which edge the results line up with: `right` => `right aligned` (they extend to the left). \" +\n \"Old name: `aligned`.\"\n },\n {\n name: \"loading\",\n group: \"states\",\n kind: \"keyOnly\",\n description: \"Busy: the icon spins. Also shown while a remote query runs.\"\n },\n {\n name: \"disabled\",\n group: \"states\",\n kind: \"keyOnly\",\n description: \"Can't be used; dimmed, and left out of the form.\"\n },\n {\n ...UIT.FormControlAttributes.readonly,\n description: \"Shows its value but can't be typed in, and the results never open; still focusable and submitted.\"\n },\n {\n name: \"open\",\n group: \"states\",\n kind: \"boolean\",\n description:\n \"The results are showing. Controlled: `ui-opening` / `ui-closing` can veto; shown only with something to show.\"\n },\n { ...UIT.FormControlAttributes.placeholder, description: \"Placeholder text of the input.\" },\n {\n name: \"value\",\n group: \"form\",\n kind: \"string\",\n description: \"The input's text: the query, or a chosen result's title.\"\n },\n { ...UIT.FormControlAttributes.name, description: \"Form field name: submits the input's text.\" },\n { ...UIT.FormControlAttributes.required, description: \"Form validation: the input can't be empty.\" },\n {\n name: \"url\",\n group: \"link\",\n kind: \"string\",\n description: \"Remote results: a `UI.api` URL template with `{query}`, e.g. `/api/search?q={query}`.\"\n },\n {\n name: \"min-characters\",\n group: \"form\",\n kind: \"number\",\n default: 1,\n description: \"Characters to type before a search runs.\"\n },\n {\n name: \"max-results\",\n group: \"appearance\",\n kind: \"number\",\n default: 7,\n description: \"The most results shown (before categories); `0` for no limit.\"\n },\n {\n name: \"search-delay\",\n group: \"behaviour\",\n kind: \"number\",\n default: 200,\n description: \"Remote: ms to wait after typing stops before querying (a newer query aborts an older one).\"\n },\n {\n name: \"full-text-search\",\n group: \"appearance\",\n kind: \"enum\",\n values: UIT.SearchMatches,\n default: UIT.SearchMatch.exact,\n description:\n \"Local matching (`SearchMatch`): a word START always matches; then `exact` anywhere, `fuzzy` in order, \" +\n \"`prefix` nothing more, `some` any word, `all` every word.\"\n },\n {\n name: \"search-fields\",\n group: \"behaviour\",\n kind: \"string\",\n default: \"title description\",\n description: \"Local: the result fields searched, a comma / space list.\"\n },\n { name: \"ignore-diacritics\", group: \"advanced\", kind: \"boolean\", description: \"Local: `a` matches `á`.\" },\n {\n name: \"highlight-matches\",\n group: \"advanced\",\n kind: \"boolean\",\n description: \"Marks the query in titles and descriptions (`<mark>`).\"\n },\n {\n name: \"select-first-result\",\n group: \"advanced\",\n kind: \"boolean\",\n description: \"Highlights the first result as results arrive.\"\n },\n {\n name: \"show-no-results\",\n group: \"advanced\",\n kind: \"boolean\",\n default: true,\n description: \"Shows the no-results message; `false` shows nothing instead.\"\n },\n {\n name: \"source\",\n group: \"content\",\n kind: \"json\",\n reflect: false,\n description:\n \"Local results as a PROPERTY: `SearchResult[]` (`{ title, description, image, price, category, url }`).\"\n }\n ],\n events: [\n {\n name: \"ui-searched\",\n detail: \"{ query: string, originalEvent?: Event }\",\n description: \"Someone typed a query at least `min-characters` long; it's about to run.\"\n },\n {\n name: \"ui-choosing\",\n detail: \"{ result: SearchResult, originalEvent?: Event }\",\n cancelable: true,\n description: \"A result is about to be chosen; `preventDefault()` keeps the text, the results and the page.\"\n },\n {\n name: \"ui-changed\",\n detail: \"{ value: string, originalEvent?: Event }\",\n description: \"The text was committed: a result chosen, the input cleared with Escape, or left after an edit.\"\n },\n {\n name: \"ui-replied\",\n detail: \"{ query: string, results: SearchResult[] }\",\n description: \"A remote query answered.\"\n },\n {\n name: \"ui-opening\",\n detail: \"{ open: true, originalEvent?: Event }\",\n cancelable: true,\n description: \"The results are about to show; `preventDefault()` keeps them hidden.\"\n },\n {\n name: \"ui-closing\",\n detail: \"{ open: false, originalEvent?: Event }\",\n cancelable: true,\n description: \"The results are about to hide; `preventDefault()` keeps them showing.\"\n }\n ],\n slots: [{ name: \"icon\", description: \"Replaces the magnifying glass.\" }],\n parts: [\n { name: \"search\", description: \"The root box (`ui search`): where the `--ui-search-*` tokens are read.\" },\n { name: \"input\", description: \"The `ui icon input` box around the text field.\" },\n { name: \"prompt\", description: \"The text `<input>` (the combobox).\" },\n { name: \"icon\", description: \"The icon box.\" },\n { name: \"results\", description: \"The results popover (the listbox while there are results).\" },\n { name: \"result\", description: \"Each result.\" },\n { name: \"category\", description: \"Each group of a `category` search.\" },\n { name: \"name\", description: \"Each group's name.\" },\n { name: \"message\", description: \"The no-results or error message.\" }\n ],\n states: [\n { name: \"open\", description: \"The results are showing.\" },\n { name: \"disabled\", description: \"Can't be used.\" },\n UIT.FormControlStates.readonly,\n { name: \"loading\", description: \"Busy (`loading`, or a remote query running).\" },\n { ...UIT.FormControlStates.invalid, description: \"Fails validation (`required`).\" },\n { name: \"fluid\", description: \"The host is block-level (`fluid`).\" }\n ],\n // NOTE: text keys share ONE namespace across components (`UI.i18n`, first registration wins), hence the prefix\n texts: [\n { key: \"searchLabel\", text: \"Search\", description: \"Accessible name of the input when nothing else names it.\" },\n { key: \"searchNoResultsHeader\", text: \"No Results\", description: \"Header of the no-results message.\" },\n { key: \"searchNoResults\", text: \"Your search returned no results\", description: \"The no-results message.\" },\n {\n key: \"searchServerError\",\n text: \"There was an issue querying the server.\",\n description: \"A remote query failed.\"\n },\n { key: \"searchOneResult\", text: \"1 result available.\", description: \"Announced when one result shows.\" },\n { key: \"searchResultCount\", text: \"{count} results available.\", description: \"Announced when results show.\" }\n ]\n} as const satisfies E.ComponentVocabulary\n","/**\n * Constants and types of the `ui-search` family: what its component (`UISearch`) and its native fallback\n * (`SearchFallback`) share.\n * - Pure data: types only (`spell/ui/core`, the vocabulary), so node can load it (`yarn site:data`).\n * - Its other class words and ids are module constants below `UISearch`, the one class that uses them;\n * `SearchMatcher`'s props live with it.\n */\n\nimport type { UIT } from \"spell/ui/core\"\nimport type { searchVocabulary } from \"./UISearch.en\"\n\n////////////////\n// ## Types\n////////////////\n\n/** The vocabulary's type, for short. */\nexport type Vocabulary = typeof searchVocabulary\n\n/**\n * How the last remote query went: a const object (the `UIT.Key` shape), compared as `RemoteStatus.error`.\n * - `idle` -- nothing asked yet\n * - `done` -- answered (maybe with no results)\n * - `error` -- the request failed\n */\nexport const RemoteStatus = { idle: \"idle\", done: \"done\", error: \"error\" } as const\n/** One of `RemoteStatus`'s values, e.g. `\"done\"`. */\nexport type RemoteStatus = (typeof RemoteStatus)[keyof typeof RemoteStatus]\n\n/** The last remote answer: for which query, and how it went. */\nexport type RemoteAnswer = {\n /** the query it answers, trimmed */\n query: string\n /** its results, grouped (`SearchMatcher.groupsFor()`) */\n groups: readonly UIT.SearchCategory[]\n /** how it went */\n status: RemoteStatus\n}\n\n/**\n * The kind of a message the results show instead of results.\n * - Also its class word (`empty message`, `error message`, `UISearch.css`).\n */\nexport const SearchMessageKind = { empty: \"empty\", error: \"error\" } as const\n/** One of `SearchMessageKind`'s values, e.g. `\"empty\"`. */\nexport type SearchMessageKind = (typeof SearchMessageKind)[keyof typeof SearchMessageKind]\n\n/** A message the results show instead of results. */\nexport type SearchMessage = {\n /** no results, or a failed request */\n kind: SearchMessageKind\n /** its header line, if any */\n header?: string\n /** its text, also what the live region says */\n text: string\n}\n\n////////////////\n// ## Class words: shared by the component and its fallback\n////////////////\n\n/** The class words of the box around the text field (`UIInput.css`). */\nexport const INPUT = \"ui icon input\"\n\n/** The class word of the text `<input>` (`UISearch.css`): Fomantic's `prompt`. */\nexport const PROMPT = \"prompt\"\n","import { E, UIT } from \"spell/ui/core\"\nimport { searchVocabulary } from \"./UISearch.en\"\nimport { INPUT, PROMPT, type Vocabulary } from \"./UISearch.types\"\n\n/****************\n * ### `SearchFallback`\n * The native fallback of `<ui-search>`: what it shows when its component breaks,\n * so the text is still typed in, validated and submitted with the form.\n *\n * - Its shadow DOM: a plain text field in the class grammar,\n * `div.ui.search` > `div.ui.icon.input` > `<input class=\"prompt\">`,\n * whose suggestions are a native `<datalist>` of the local `source` titles.\n * - The input is a native search field (`type=\"search\"`): typing narrows the browser's own suggestion list.\n * - Its text is the DOM element's form value (with `required` validity), and `domElement.value` follows it;\n * the native `change` sends `ui-changed`.\n * - `readonly`: the input's own `readonly`, as the component's; its text can't be changed.\n * - Its accessible name is the DOM element's `aria-label`, else `placeholder`.\n ****************/\nexport class SearchFallback extends E.NativeFallback<Vocabulary> {\n @E.proto static vocabulary = searchVocabulary\n @E.proto static degraded = [\n \"remote results (`url`): no suggestions\",\n \"result descriptions, images, prices and categories (titles only, as the browser's suggestions)\",\n \"Fomantic's matching (`full-text-search`, `search-fields`, `max-results`): the browser's own\",\n \"`ui-search`, `ui-select`, `ui-replied`, `ui-opening`, `ui-closing`; following a result's `url`\",\n \"the magnifying glass and the loading spinner\"\n ]\n\n /** The native input, once built, for `sync()`. */\n private input: HTMLInputElement | undefined\n\n protected override build() {\n const domElement = this.domElement as SearchDOMElement\n const listId = `${this.vocabulary.tag}${SUGGESTIONS_SUFFIX}`\n const placeholder = this.attr(\"placeholder\")\n const input = this.create(\"input\", {\n class: PROMPT,\n type: \"search\",\n placeholder,\n required: this.flag(\"required\"),\n disabled: this.flag(\"disabled\"),\n readonly: this.flag(\"readonly\"),\n autocomplete: \"off\",\n list: listId\n })\n input.value = typeof domElement.value === \"string\" ? domElement.value : (this.attr(\"value\") ?? \"\")\n this.decorate(input, \"prompt\")\n this.nameFromPlaceholder(input)\n\n const list = this.create(\"datalist\", { id: listId })\n const titles = new Set<string>()\n for (const result of Array.isArray(domElement.source) ? domElement.source : []) {\n if (typeof result?.title === \"string\") titles.add(result.title)\n }\n for (const title of titles) list.append(this.create(\"option\", { value: title }))\n\n const box = this.create(\"div\", { class: INPUT, part: INPUT_PART }, input, list)\n const root = this.create(\"div\", { class: this.classes() }, box)\n\n this.listen(input, \"input\", () => {\n domElement.value = input.value\n this.sync()\n })\n this.listen(input, \"change\", (event) => {\n this.send(CHANGE_EVENT, { value: input.value, originalEvent: event })\n })\n this.input = input\n return [root]\n }\n\n /** The input's text, and its validity (`required`). */\n protected override sync() {\n const { input } = this\n if (input) this.syncForm({ value: input.value, control: input })\n }\n}\n\n/** What the fallback reads and writes of the DOM element: all optional, the element may not have upgraded. */\ntype SearchDOMElement = HTMLElement & {\n /** the text, once set as a property */\n value?: string\n /** the `source` property, once set */\n source?: readonly UIT.SearchResult[]\n}\n\n/** The event the input's `change` becomes. */\nconst CHANGE_EVENT: E.EventName<Vocabulary> = \"ui-changed\"\n\n/** The part of the box around the input (the input itself is `prompt`, through `decorate()`). */\nconst INPUT_PART: E.PartName<Vocabulary> = \"input\"\n\n/** The suffix of the `<datalist>` id, after the tag. */\nconst SUGGESTIONS_SUFFIX = \"-suggestions\"\n","import { E, UIT } from \"spell/ui/core\"\n\n/****************\n * ### `SearchMatcher`\n * Local search over a `<ui-search>` `source`, and the shapes results arrive in. Pure data, NO DOM: `UISearch`\n * builds one per change of its matching attributes; the family barrel exports it for use on its own.\n * - Ported from Fomantic's `search.object()`: each result is tried field by field (`fields`, in order); its\n * FIRST matching field decides its bucket, and buckets sort as\n * - the query at the start of a word (`(?:\\s|^)query`) -- always tried, except for `all`\n * - then, by `match` (`UIT.SearchMatch`): `exact` / `some` / `all` matches\n * - then `fuzzy` matches\n * - Case-insensitive unless `ignoreCase: false`; `ignoreDiacritics` folds `á` to `a` on both sides.\n * - Numbers count as text; other field values are skipped.\n ****************/\nexport class SearchMatcher {\n /** Fields tried, in order. */\n readonly fields: readonly string[]\n\n /** What counts as a match besides a word start. */\n readonly match: UIT.SearchMatch\n\n /** Case-insensitive. */\n readonly ignoreCase: boolean\n\n /** Fold diacritics. */\n readonly ignoreDiacritics: boolean\n\n constructor({\n fields = DEFAULT_FIELDS,\n match = UIT.SearchMatch.exact,\n ignoreCase = true,\n ignoreDiacritics = false\n }: SearchMatcherProps = {}) {\n this.fields = fields\n this.match = match\n this.ignoreCase = ignoreCase\n this.ignoreDiacritics = ignoreDiacritics\n }\n\n /** Results of `source` matching `query`, best first; `[]` for a blank query. */\n search(source: readonly UIT.SearchResult[], query: string): UIT.SearchResult[] {\n const term = this.fold(query.trim())\n if (!term) return []\n const wordStart = new RegExp(`(?:\\\\s|^)${E.escapeRegExp(term)}`, \"u\")\n const words = term.split(UIT.WHITESPACE)\n const first: UIT.SearchResult[] = []\n const exact: UIT.SearchResult[] = []\n const fuzzy: UIT.SearchResult[] = []\n for (const result of source) {\n const texts = this.texts(result)\n if (this.match === UIT.SearchMatch.all) {\n const joined = texts.join(\" \")\n if (words.every((word) => joined.includes(word))) exact.push(result)\n continue\n }\n for (const text of texts) {\n if (wordStart.test(text)) first.push(result)\n else if (this.match === UIT.SearchMatch.exact && text.includes(term)) exact.push(result)\n else if (this.match === UIT.SearchMatch.some && words.some((word) => text.includes(word))) exact.push(result)\n else if (this.match === UIT.SearchMatch.fuzzy && SearchMatcher.isFuzzyMatch(term, text)) fuzzy.push(result)\n else continue\n break\n }\n }\n return [...first, ...exact, ...fuzzy]\n }\n\n ////////////////\n // ## Shapes\n ////////////////\n\n /**\n * `results` grouped by their `category`, in order of first appearance.\n * - NOTE: as Fomantic's `categoryResults()`, a result WITHOUT a category is left out.\n * - STATIC: pure, needs no matcher (a remote answer is grouped without one).\n */\n static categorize(results: readonly UIT.SearchResult[]): UIT.SearchCategory[] {\n const groups = new Map<string, UIT.SearchResult[]>()\n for (const result of results) {\n if (!result.category) continue\n const group = groups.get(result.category)\n if (group) group.push(result)\n else groups.set(result.category, [result])\n }\n return [...groups].map(([name, members]) => ({ name, results: members }))\n }\n\n /**\n * A remote answer as groups: Fomantic's `{ results }` (a list, or categories as a list or a keyed object), or a\n * bare list. A plain list is ONE unnamed group, capped at `maxResults` (`0`: no cap).\n * - Anything else (no `results`, not an object) is no results.\n * - STATIC: pure, needs no matcher (a remote answer is already matched).\n */\n static groupsFor(response: UIT.SearchResponse | undefined, maxResults = 0): UIT.SearchCategory[] {\n const results = Array.isArray(response) ? response : (response as { results?: unknown } | undefined)?.results\n if (!results || typeof results !== \"object\") return []\n const list = (Array.isArray(results) ? results : Object.values(results)) as unknown[]\n if (list.length && list.every(SearchMatcher.isCategory)) {\n return (list as UIT.SearchCategory[]).filter((category) => category.results.length)\n }\n const plain = (list as UIT.SearchResult[]).filter((result) => result && typeof result === \"object\")\n return [{ name: \"\", results: maxResults > 0 ? plain.slice(0, maxResults) : plain }]\n }\n\n ////////////////\n // ## Internals\n ////////////////\n\n /** Folded texts of `result`'s searchable fields, in field order. */\n private texts(result: UIT.SearchResult): string[] {\n const texts: string[] = []\n for (const field of this.fields) {\n const value = result[field]\n if (typeof value === \"string\" || typeof value === \"number\") texts.push(this.fold(String(value)))\n }\n return texts\n }\n\n /** `text` compared the configured way: diacritics stripped, lower-cased. */\n private fold(text: string): string {\n const plain = this.ignoreDiacritics ? E.withoutAccents(text) : text\n return this.ignoreCase ? plain.toLowerCase() : plain\n }\n\n /**\n * Is `value` a `{ name, results: [] }` category?\n * - STATIC: pure, an `every()` predicate.\n */\n private static isCategory(value: unknown): value is UIT.SearchCategory {\n return !!value && typeof value === \"object\" && Array.isArray((value as UIT.SearchCategory).results)\n }\n\n /**\n * Fomantic's `fuzzySearch()`: every character of `term` appears in `text`, in order; a term as long as the\n * text must equal it.\n * - STATIC: pure.\n */\n private static isFuzzyMatch(term: string, text: string): boolean {\n if (term.length > text.length) return false\n if (term.length === text.length) return term === text\n let position = 0\n for (const char of term) {\n position = text.indexOf(char, position) + 1\n if (!position) return false\n }\n return true\n }\n}\n\n/** Constructor props for `SearchMatcher`, named as Fomantic's search settings; each falls back to its default. */\nexport type SearchMatcherProps = {\n /** fields tried, in order (Fomantic's `searchFields`); default `title`, `description` */\n fields?: readonly string[]\n /** Fomantic's `fullTextSearch`; default `exact` */\n match?: UIT.SearchMatch\n /** Fomantic's `ignoreSearchCase`; default `true` */\n ignoreCase?: boolean\n /** Fomantic's `ignoreDiacritics`; default `false` */\n ignoreDiacritics?: boolean\n}\n\n////////////////\n// ## Constants\n////////////////\n\n/** Fields searched by default. */\nconst DEFAULT_FIELDS = [\"title\", \"description\"]\n","/*\n * The style sheet of `<ui-search>`: a port of Fomantic's `search.less` + `search.variables`.\n * - Adopted after the foundation and AFTER `UIInput.css`: the prompt sits in a real `ui icon input`,\n * and this sheet re-shapes it (Fomantic's round prompt), since `ui.components.search` layers come later.\n * - The shadow markup it expects (class grammar on semantic elements), in this order inside the root:\n *\n * <div class=\"ui [size] [category horizontal fluid scrolling resizable short ...] [left|right aligned]\n * [loading disabled read-only] search\" style=\"anchor-name: --ui-search-4\">\n * <div class=\"ui icon [loading fluid disabled] input\" part=\"input\">\n * <input class=\"prompt\" part=\"prompt\" role=\"combobox\">\n * <span class=\"search icon\" part=\"icon\"><slot name=\"icon\"><svg></slot></span>\n * </div>\n * <div class=\"results\" popover part=\"results\" role=\"listbox\" style=\"position-anchor: --ui-search-4\">\n * <a|div class=\"[active] result\" role=\"option\" part=\"result\">\n * <div class=\"image\"><img></div>\n * <div class=\"content\"><div class=\"price\"> <div class=\"title\"> <div class=\"description\"></div>\n * </a|div>\n * <div class=\"[active] category\" role=\"group\" part=\"category\"> (category: in place of results)\n * <div class=\"name\" part=\"name\"> <div class=\"results\" role=\"none\"> result ... </div>\n * </div>\n * <div class=\"empty|error message\" part=\"message\"><div class=\"header\"> <div class=\"description\"></div>\n * </div>\n * <span class=\"status\" role=\"status\">3 results available.</span> (visually hidden)\n * </div>\n *\n * - `active` on a result === the keyboard-HIGHLIGHTED one (Fomantic's meaning), also `[aria-selected=\"true\"]`.\n * - Positioning: POPOVER + ANCHOR, no JS (as the dropdown's menu).\n * - the anchor's name, and the results hung from it: inline, per element (the component's `PopoverPanel`)\n * - root: `anchor-scope: all`\n * - `.results[popover]`: below, flipping (`flip-block, flip-inline`); `right aligned` extends to the start\n * - a `.results` WITHOUT `popover` is Fomantic's `top: 100%` box, shown with `visible` (static examples)\n * - The `:state()`s the component sets: `:state(fluid)` (a block-level DOM element),\n * plus `open` / `disabled` / `loading` / `invalid` for PAGE styling only -- this sheet keys on the root's classes.\n * - Public tokens (`--ui-search-*`, the theming surface) are NEVER declared here:\n * the token block reads each through a private alias, and every rule reads the alias:\n * `--_ui-search-results-radius: var(--ui-search-results-radius, var(--ui-radius))`.\n * So a value set on `:root`, an ancestor, the DOM element, `::part(input)` / `::part(results)`\n * or in the app stylesheet reaches the box (`notes/theming.md` \"Component tokens\").\n * - Cross-family, on purpose: the prompt sets the nested input's PUBLIC `--ui-input-radius`\n * (from `--ui-search-prompt-radius`), as a page would.\n * - NOTE: left out, on purpose:\n * - the \"view all results\" `.action` link of a remote answer: a link inside a listbox; put one near the search\n * - the `clearable` variation (`.remove.icon`, the webkit cancel button): Escape clears\n * - Scrolling heights stay Fomantic's per-breakpoint result counts (4 / 6 / 8 / 12), by viewport `@media`\n * (`--_search-results-rows`), as the DEFAULT of one token, `--ui-search-results-max-height`:\n * a value set from outside wins at every width.\n */\n\n@layer ui.components.search.types, ui.components.search.content, ui.components.search.variations, ui.components.search.states;\n\n/* Breakpoints (`@custom-media`), inlined at build time: the scrolling result counts and the phone width. */\n@import \"../../styles/media.css\";\n\n/* Loader spin, for a `loading` search whose input isn't marked `loading` itself (static markup). */\n@keyframes ui-search-spin {\n to {\n rotate: 1turn;\n }\n}\n\n/*******************************\n Search\n*******************************/\n\n@layer ui.components.search.types {\n /* The DOM element: layout only; the look lives on the root inside. */\n :host {\n display: inline-block;\n vertical-align: baseline;\n }\n :host(:state(fluid)) {\n display: block;\n }\n /* `delegatesFocus`: the prompt draws the focus, never the DOM element. */\n :host(:focus-visible) {\n outline: none;\n }\n\n /*\n * Tokens: one per `search.variables` entry that still matters, from the global tokens --\n * each the private alias of its public token (never declare the public one: it would block inherited values).\n * - Declared on the root AND on its two parts (the root has no part name),\n * so a value set through `::part(input)` / `::part(results)` reaches the part's own rules.\n */\n .ui.search,\n .ui.search > .ui.input,\n .ui.search > .results {\n --_ui-search-prompt-radius: var(--ui-search-prompt-radius, var(--ui-radius-pill));\n --_ui-search-duration: var(--ui-search-duration, var(--ui-duration-fast));\n --_ui-search-results-width: var(--ui-search-results-width, 18em);\n --_ui-search-results-background: var(--ui-search-results-background, var(--ui-surface));\n --_ui-search-results-color: var(--ui-search-results-color, var(--ui-text-color));\n --_ui-search-results-border-color: var(--ui-search-results-border-color, var(--ui-border-color));\n --_ui-search-results-radius: var(--ui-search-results-radius, var(--ui-radius));\n --_ui-search-results-shadow: var(--ui-search-results-shadow, var(--ui-shadow-floating));\n --_ui-search-results-offset: var(--ui-search-results-offset, 0.5em);\n --_ui-search-result-padding: var(--ui-search-result-padding, 0.85714em 1.14285em);\n --_ui-search-result-line-height: var(--ui-search-result-line-height, 1.33);\n --_ui-search-result-divider-color: var(--ui-search-result-divider-color, var(--ui-border-color-internal));\n --_ui-search-result-background-hover: var(--ui-search-result-background-hover, var(--ui-surface-muted));\n --_ui-search-result-background-active: var(\n --ui-search-result-background-active,\n oklch(from var(--ui-ink) l c h / 0.05)\n );\n --_ui-search-result-image-width: var(--ui-search-result-image-width, 5em);\n --_ui-search-result-image-height: var(--ui-search-result-image-height, 3em);\n --_ui-search-result-image-radius: var(--ui-search-result-image-radius, 0.25em);\n --_ui-search-result-image-margin: var(--ui-search-result-image-margin, 6em);\n --_ui-search-title-color: var(--ui-search-title-color, var(--ui-text-dark));\n --_ui-search-description-color: var(--ui-search-description-color, var(--ui-text-light));\n --_ui-search-description-font-size: var(--ui-search-description-font-size, 0.92857em);\n --_ui-search-price-color: var(--ui-search-price-color, var(--ui-green-text, var(--ui-green)));\n --_ui-search-message-padding: var(--ui-search-message-padding, 1em);\n --_ui-search-category-background: var(--ui-search-category-background, var(--ui-surface-muted));\n --_ui-search-category-results-width: var(--ui-search-category-results-width, 28em);\n --_ui-search-category-name-width: var(--ui-search-category-name-width, 100px);\n --_ui-search-category-name-color: var(--ui-search-category-name-color, var(--ui-text-light));\n --_ui-search-category-name-padding: var(--ui-search-category-name-padding, 0.4em 1em);\n --_ui-search-category-divider-color: var(--ui-search-category-divider-color, var(--ui-border-color-internal));\n --_ui-search-category-result-border-color: var(--ui-search-category-result-border-color, var(--ui-border-color));\n /* Height of the results list; its default grows with the viewport (the result rows below):\n a value set from outside wins at every width. */\n --_ui-search-results-max-height: var(\n --ui-search-results-max-height,\n calc(var(--_search-results-rows) * (2 * 0.85714em + 1.33em))\n );\n --_ui-search-disabled-opacity: var(--ui-search-disabled-opacity, var(--ui-disabled-opacity));\n }\n\n /* Root */\n .ui.search {\n /* Fomantic's scrolling result count, 4 / 6 / 8 / 12 by viewport (`@media` below); the root only, so it inherits */\n --_search-results-rows: 4;\n position: relative;\n box-sizing: border-box;\n display: inline-block;\n max-width: 100%;\n anchor-scope: all;\n font-family: var(--ui-font-family);\n font-size: calc(var(--ui-font-size) * var(--ui-scale, 1));\n text-align: start;\n }\n\n /* Prompt: Fomantic's round input. */\n .ui.search > .ui.input {\n --ui-input-radius: var(--_ui-search-prompt-radius);\n display: flex;\n }\n .ui.search > .ui.input > .prompt {\n margin: 0;\n font-style: normal;\n text-shadow: none;\n transition-property: background-color, color, box-shadow, border-color;\n }\n .ui.search .prompt ~ .search.icon {\n cursor: pointer;\n }\n\n /* Results: hidden until open; a popover in the top layer, anchored to the root. */\n .ui.search > .results {\n position: absolute;\n top: 100%;\n inset-inline-start: 0;\n z-index: var(--ui-z-dropdown);\n box-sizing: border-box;\n display: none;\n width: var(--_ui-search-results-width);\n margin: var(--_ui-search-results-offset) 0 0;\n padding: 0;\n overflow: visible;\n border: var(--ui-border-width) solid var(--_ui-search-results-border-color);\n border-radius: var(--_ui-search-results-radius);\n outline: none;\n background: var(--_ui-search-results-background);\n box-shadow: var(--_ui-search-results-shadow);\n color: var(--_ui-search-results-color);\n font-size: 1em;\n line-height: normal;\n text-align: start;\n text-transform: none;\n white-space: normal;\n }\n .ui.search > .results[popover] {\n position-area: block-end span-inline-end;\n position-try-fallbacks: flip-block, flip-inline;\n inset: auto;\n margin: var(--_ui-search-results-offset) 0;\n opacity: 0;\n transition-property: opacity, display, overlay;\n transition-duration: var(--_ui-search-duration);\n transition-timing-function: var(--ui-ease);\n transition-behavior: allow-discrete;\n }\n .ui.search > .results > :first-child {\n border-start-start-radius: var(--_ui-search-results-radius);\n border-start-end-radius: var(--_ui-search-results-radius);\n }\n .ui.search > .results > :last-child {\n border-end-start-radius: var(--_ui-search-results-radius);\n border-end-end-radius: var(--_ui-search-results-radius);\n }\n\n /* The live region: heard, not seen. */\n .ui.search > .status {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n}\n\n/*******************************\n Content\n*******************************/\n\n@layer ui.components.search.content {\n /* Result */\n .ui.search > .results .result {\n box-sizing: border-box;\n display: block;\n overflow: hidden;\n padding: var(--_ui-search-result-padding);\n border-bottom: var(--ui-border-width) solid var(--_ui-search-result-divider-color);\n color: var(--_ui-search-results-color);\n font-size: 1em;\n line-height: var(--_ui-search-result-line-height);\n text-decoration: none;\n cursor: pointer;\n }\n .ui.search > .results .result:last-child {\n border-bottom: none;\n }\n\n /* Image: at the result's end. */\n .ui.search > .results .result .image {\n float: inline-end;\n width: var(--_ui-search-result-image-width);\n height: var(--_ui-search-result-image-height);\n overflow: hidden;\n border-radius: var(--_ui-search-result-image-radius);\n background: none;\n }\n .ui.search > .results .result .image img {\n display: block;\n width: auto;\n height: 100%;\n }\n .ui.search > .results .result .image + .content {\n margin-inline-end: var(--_ui-search-result-image-margin);\n }\n\n /* Title, description, price */\n .ui.search > .results .result .title {\n margin: 0;\n color: var(--_ui-search-title-color);\n font-family: var(--ui-font-family-heading, var(--ui-font-family));\n font-size: 1em;\n font-weight: var(--ui-font-weight-bold);\n }\n .ui.search > .results .result .description {\n margin-top: 0;\n color: var(--_ui-search-description-color);\n font-size: var(--_ui-search-description-font-size);\n }\n .ui.search > .results .result .price {\n float: inline-end;\n color: var(--_ui-search-price-color);\n }\n .ui.search > .results mark {\n background: var(--ui-highlight);\n color: inherit;\n }\n\n /* Message: no results, or an error. */\n .ui.search > .results > .message {\n padding: var(--_ui-search-message-padding);\n }\n .ui.search > .results > .message .header {\n color: var(--_ui-search-results-color);\n font-family: var(--ui-font-family-heading, var(--ui-font-family));\n font-size: 1em;\n font-weight: var(--ui-font-weight-bold);\n }\n .ui.search > .results > .message .description {\n margin-top: 0.25em;\n color: var(--_ui-search-results-color);\n font-size: 1em;\n }\n .ui.search > .results > .error.message .description {\n color: var(--ui-red-text, var(--ui-red));\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.search.variations {\n /* Category: a table of groups, the name in a cell beside its results. */\n .ui.category.search > .results {\n width: var(--_ui-search-category-results-width);\n }\n .ui.category.search > .results .category {\n display: table-row;\n background: var(--_ui-search-category-background);\n box-shadow: none;\n transition:\n background var(--_ui-search-duration) var(--ui-ease),\n border-color var(--_ui-search-duration) var(--ui-ease);\n }\n .ui.category.search > .results .category:last-child {\n border-bottom: none;\n }\n .ui.category.search > .results .category > .name {\n display: table-cell;\n width: var(--_ui-search-category-name-width);\n padding: var(--_ui-search-category-name-padding);\n overflow: hidden;\n border-bottom: var(--ui-border-width) solid var(--_ui-search-category-divider-color);\n background: transparent;\n color: var(--_ui-search-category-name-color);\n font-family: var(--ui-font-family);\n font-size: 1em;\n font-weight: var(--ui-font-weight-bold);\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .ui.category.search > .results .category > .results {\n display: table-cell;\n border-bottom: var(--ui-border-width) solid var(--_ui-search-category-divider-color);\n border-inline-start: var(--ui-border-width) solid var(--_ui-search-category-result-border-color);\n background: var(--_ui-search-results-background);\n }\n .ui.category.search > .results .category:last-child > :is(.name, .results) {\n border-bottom: none;\n }\n .ui.category.search > .results .category .result {\n padding: var(--_ui-search-result-padding);\n border-bottom: var(--ui-border-width) solid var(--_ui-search-result-divider-color);\n transition:\n background var(--_ui-search-duration) var(--ui-ease),\n border-color var(--_ui-search-duration) var(--ui-ease);\n }\n .ui.category.search > .results .category .result:last-child {\n border-bottom: none;\n }\n .ui.category.search > .results .category:first-child .name + .results > .result:first-child {\n border-start-end-radius: var(--_ui-search-results-radius);\n }\n .ui.category.search > .results .category:last-child .result:last-child {\n border-end-end-radius: var(--_ui-search-results-radius);\n }\n\n /* Horizontal category: each name above its results. */\n .ui.horizontal.category.search > .results .category,\n .ui.horizontal.category.search > .results .category > .name,\n .ui.horizontal.category.search > .results .category > .results {\n display: block;\n }\n .ui.horizontal.category.search > .results .category > .results {\n width: 100%;\n border-inline-start: 0;\n }\n\n /* Scrolling / short / long: the results scroll after a height (4 results on phones, more on larger screens). */\n .ui:is(.scrolling, .short, .long).search > .results {\n overflow: hidden auto;\n overscroll-behavior: contain;\n }\n .ui.scrolling.search > .results,\n .ui.short.search > .results {\n max-height: var(--_ui-search-results-max-height);\n }\n .ui[class*=\"very short\"].search > .results {\n max-height: calc(var(--_ui-search-results-max-height) * 0.75);\n }\n .ui.long.search > .results {\n max-height: calc(var(--_ui-search-results-max-height) * 2);\n }\n .ui[class*=\"very long\"].search > .results {\n max-height: calc(var(--_ui-search-results-max-height) * 3);\n }\n .ui.scrolling.resizable.search > .results {\n height: var(--_ui-search-results-max-height);\n max-height: none;\n resize: vertical;\n }\n @media (--ui-tablet), (--ui-computer) {\n .ui.search {\n --_search-results-rows: 6;\n }\n }\n @media (--ui-computer) {\n .ui.search {\n --_search-results-rows: 8;\n }\n }\n @media (--ui-widescreen) {\n .ui.search {\n --_search-results-rows: 12;\n }\n }\n\n /* Aligned: which edge the results line up with. */\n .ui[class*=\"left aligned\"].search > .results:not([popover]) {\n inset-inline: 0 auto;\n }\n .ui[class*=\"right aligned\"].search > .results:not([popover]) {\n inset-inline: auto 0;\n }\n .ui[class*=\"left aligned\"].search > .results[popover] {\n position-area: block-end span-inline-end;\n }\n .ui[class*=\"right aligned\"].search > .results[popover] {\n position-area: block-end span-inline-start;\n }\n\n /* Fluid: the prompt and the results take the full width. */\n .ui.fluid.search {\n display: block;\n width: 100%;\n }\n .ui.fluid.search > .results {\n width: 100%;\n }\n .ui.fluid.search > .results[popover] {\n width: anchor-size(width);\n }\n\n /* Phones: never wider than the screen. */\n @media (--ui-mobile) {\n .ui.search > .results {\n max-width: calc(100vw - 2em);\n }\n }\n}\n\n/*******************************\n States\n*******************************/\n\n@layer ui.components.search.states {\n /* Open: a popover while `:popover-open`; a plain one with `visible`. */\n .ui.search > .results[popover]:popover-open,\n .ui.search > .visible.results:not([popover]) {\n display: block;\n opacity: 1;\n }\n .ui.category.search > .results[popover]:popover-open,\n .ui.category.search > .visible.results:not([popover]) {\n display: table;\n }\n @starting-style {\n .ui.search > .results[popover]:popover-open {\n opacity: 0;\n }\n }\n\n /* Hover and the keyboard highlight (`active`). */\n .ui.search > .results .result:hover,\n .ui.category.search > .results .category .result:hover {\n background: var(--_ui-search-result-background-hover);\n }\n .ui.category.search > .results .category.active {\n background: var(--_ui-search-result-background-active);\n }\n .ui.category.search > .results .category.active > .name {\n color: var(--_ui-search-results-color);\n }\n .ui.search > .results .result.active,\n .ui.category.search > .results .category .result.active {\n position: relative;\n background: var(--_ui-search-result-background-active);\n box-shadow: none;\n }\n .ui.search > .results .result.active :is(.title, .description) {\n color: var(--_ui-search-title-color);\n }\n\n /* Loading: the icon box becomes a spinner (the element also marks its input `loading`, `UIInput.css`). */\n .ui.loading.search > .ui.input > .icon {\n opacity: 1;\n }\n .ui.loading.search > .ui.input > .icon > * {\n visibility: hidden;\n }\n .ui.loading.search > .ui.input > .icon::before,\n .ui.loading.search > .ui.input > .icon::after {\n content: \"\";\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 50%;\n box-sizing: border-box;\n inline-size: 1.28571em;\n block-size: 1.28571em;\n margin: -0.642855em 0 0 -0.642855em;\n border: 0.2em solid oklch(from var(--ui-ink) l c h / 0.1);\n border-radius: var(--ui-radius-circle);\n }\n .ui.loading.search > .ui.input > .icon::after {\n border-color: var(--ui-text-muted) transparent transparent;\n animation: ui-search-spin 0.6s linear infinite;\n }\n\n /* Disabled: dimmed and inert. */\n .ui.disabled.search {\n cursor: default;\n opacity: var(--_ui-search-disabled-opacity);\n pointer-events: none;\n }\n .ui.disabled.search > .disabled.input {\n opacity: 1;\n }\n\n /* Read-only: shown, not typed in; the arrow, as every control's `read-only`. */\n .ui.read-only.search > .input > input {\n cursor: default;\n }\n}\n","import { For, Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { F } from \"spell/ui/forms\"\nimport { searchVocabulary } from \"./UISearch.en\"\nimport { SearchFallback } from \"./UISearch.fallback\"\nimport { SearchMatcher } from \"./SearchMatcher\"\nimport {\n INPUT,\n PROMPT,\n RemoteStatus,\n SearchMessageKind,\n type RemoteAnswer,\n type SearchMessage,\n type Vocabulary\n} from \"./UISearch.types\"\n\nimport inputCSS from \"spell/ui/components/ui-input/UIInput.css?inline\"\nimport searchCSS from \"./UISearch.css?inline\"\n\n/****************\n * ### `UISearch`\n * The component behind `<ui-search>`: a text field that suggests results as you type\n * (a combobox and its listbox, the APG's \"list autocomplete\").\n *\n * - Its shadow DOM: a text `<input>` in Fomantic's `ui icon input`, and an anchor-positioned popover of results.\n *\n * - The results: the `source` PROPERTY, searched here (`SearchMatcher`, Fomantic's matching),\n * or the `url` template, asked through `UI.api` (`{query}`).\n * - `search-delay` waits for a pause in typing\n * - a newer query cancels an older one\n * - answers are kept per query\n * - `category` groups them\n *\n * - `value` (the input's text) and `open` are controlled (`@controlled`):\n * the events go first, and a handler may cancel or override.\n * Choosing a result puts its title in the input and follows its `url`.\n * - The rows render only while shown; `aria-activedescendant` points at the highlighted one.\n * - A polite live region announces the result count and messages.\n * - Escape and outside clicks come from `UI.overlays`.\n * - A form control (decided 2026-09-30): Fomantic's search wraps a REAL `<input class=\"prompt\">`,\n * which submits its text under its `name`; so does this one, with `required` => `valueMissing`.\n ****************/\nexport class UISearch extends F.FormComponent<Vocabulary> {\n @E.proto static vocabulary = searchVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { input: inputCSS, search: searchCSS },\n cssStates: [\"fluid\"],\n Fallback: SearchFallback,\n // `loading`: a spinner in its input\n loading: \"its own\"\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## The text\n ////////////////\n\n /** `value`, the input's text: set by the page, or typed in. */\n @E.controlled(\"value\") accessor value: string | undefined = \"\"\n\n /** The input's text, as a string. */\n get query(): string {\n return String(this.value ?? \"\")\n }\n\n /** Is the query long enough to search? */\n get queryIsLongEnough(): boolean {\n return this.isLongEnough(this.query)\n }\n\n /** Is `text`, trimmed, at least `min-characters` long (never under 1)? */\n private isLongEnough(text: string): boolean {\n return text.trim().length >= Math.max(1, this.minCharacters ?? 1)\n }\n\n /** Bumped when the input must show the value again (the page cancelled the typing). */\n @E.state accessor inputRevision = 0\n\n /** The value to restore on a form reset: the page's `value` (its attribute), `undefined` when it has none. */\n private readonly initialValue = this.isControlledByPage(\"value\") ? this.value : undefined\n\n /** The value when the input took focus, to tell whether leaving it is an edit. */\n private valueAtFocus?: string\n\n /** The input shows the value: once rendered, and again after the page cancelled typing (`inputRevision`). */\n @E.onChange(\"query\", \"inputRevision\", \"isReady\")\n protected onQueryChanged(query: string) {\n if (this.input && this.input.value !== query) this.input.value = query\n }\n\n /** Commit `value` as the input's text, with `ui-changed`; if the page cancels it, the input shows its value. */\n private commit(value: string, originalEvent?: Event) {\n this.requestChange(\"value\", value, () => {\n this.send(\"ui-changed\", { value, originalEvent })\n return true\n })\n this.valueAtFocus = value\n this.inputRevision++\n }\n\n ////////////////\n // ## Results\n ////////////////\n\n /** Local matcher, from the matching attributes. */\n @E.derived\n get matcher(): SearchMatcher {\n const fields = this.searchFields\n return new SearchMatcher({\n fields: fields === undefined ? undefined : E.Converters.list(fields),\n match: this.fullTextSearch as UIT.SearchMatch | undefined,\n ignoreDiacritics: this.ignoreDiacritics\n })\n }\n\n /** Local results of the query, grouped. */\n @E.derived\n get localGroups(): readonly UIT.SearchCategory[] {\n const source = this.source\n if (!Array.isArray(source) || !this.queryIsLongEnough) return []\n const max = this.maxResults ?? 0\n let results = this.matcher.search(source as UIT.SearchResult[], this.query)\n if (max > 0) results = results.slice(0, max)\n return this.category ? SearchMatcher.categorize(results) : [{ name: \"\", results }]\n }\n\n /** The last remote answer. */\n @E.state accessor remoteAnswer: RemoteAnswer = { query: \"\", groups: [], status: RemoteStatus.idle }\n\n /** The remote query running now (aborts it), if any. */\n @E.state accessor runningQuery: AbortController | undefined = undefined\n\n /** Is a remote query running? */\n get isFetching(): boolean {\n return this.runningQuery !== undefined\n }\n\n /** Remote answers by query. */\n private readonly answersByQuery = new Map<string, readonly UIT.SearchCategory[]>()\n\n /** Results shown now, grouped: the last remote answer, or the local ones. */\n get groups(): readonly UIT.SearchCategory[] {\n if (!this.url) return this.localGroups\n return this.queryIsLongEnough ? this.remoteAnswer.groups : []\n }\n\n /** Every shown result, in order: what the arrows move through. */\n @E.derived\n get shownResults(): readonly UIT.SearchResult[] {\n return this.groups.flatMap((group) => group.results)\n }\n\n /** What to say instead of results, if anything. */\n @E.derived\n get message(): SearchMessage | undefined {\n if (!this.queryIsLongEnough || this.shownResults.length) return undefined\n const remote = this.remoteAnswer\n const isCurrent = !this.url || (remote.query === this.query.trim() && !this.isFetching)\n if (!isCurrent) return undefined\n if (this.url && remote.status === RemoteStatus.error) {\n return { kind: SearchMessageKind.error, text: this.translationForKey(\"searchServerError\") }\n }\n if (this.url && remote.status !== RemoteStatus.done) return undefined\n if (this.showNoResults === false) return undefined\n return {\n kind: SearchMessageKind.empty,\n header: this.translationForKey(\"searchNoResultsHeader\"),\n text: this.translationForKey(\"searchNoResults\")\n }\n }\n\n /** Run the query in `text` (typed, or on focus): open, and ask the server when there's a `url`. */\n private runQuery(text: string, originalEvent?: Event) {\n if (!this.isLongEnough(text)) return\n this.requestOpen(true, originalEvent)\n if (this.url) this.fetch(text.trim())\n }\n\n /** Run the query already in the input, as `originalEvent` asked (a click, ArrowDown). */\n @E.untracked\n private rerunQuery(originalEvent: Event) {\n this.runQuery(this.query, originalEvent)\n }\n\n /**\n * Ask the `url` for `query`'s results through `UI.api`:\n * debounced by `search-delay`, the previous query aborted, the answer cached per query.\n * - An aborted query is ignored; a failed one shows `searchServerError`.\n */\n private fetch(query: string) {\n const url = this.url!\n const cached = this.answersByQuery.get(query)\n this.runningQuery?.abort()\n if (cached) {\n this.runningQuery = undefined\n this.remoteAnswer = { query, groups: cached, status: RemoteStatus.done }\n return\n }\n const running = (this.runningQuery = new AbortController())\n const max = this.maxResults ?? 0\n UI.api\n .request<UIT.SearchResponse>({\n url,\n urlData: { query },\n throttle: this.searchDelay ?? 0,\n key: this.ids.results,\n signal: running.signal\n })\n .then((response) => {\n const groups = SearchMatcher.groupsFor(response, max)\n this.answersByQuery.set(query, groups)\n // superseded while the answer was on its way (a transport that ignores the signal still delivers it):\n // cached, not shown\n if (running.signal.aborted) return\n this.remoteAnswer = { query, groups, status: RemoteStatus.done }\n this.send(\"ui-replied\", { query, results: groups.flatMap((group) => group.results) })\n })\n .catch((error: unknown) => {\n if (running.signal.aborted || (error as Error)?.name === \"AbortError\") return\n this.remoteAnswer = { query, groups: [], status: RemoteStatus.error }\n })\n .finally(() => {\n if (this.runningQuery === running) this.runningQuery = undefined\n })\n }\n\n ////////////////\n // ## Highlight\n ////////////////\n\n /** The highlighted result of `shownResults`. */\n readonly highlighted = new F.HighlightedOption(() => this.shownResults)\n\n /** Highlighted result. */\n get highlightedResult(): UIT.SearchResult | undefined {\n return this.highlighted.option\n }\n\n /** A newly highlighted result scrolls into view, while results show. */\n @E.onChange(\"resultsAreShowing\", \"highlightedResult\")\n protected onHighlightChanged(resultsAreShowing: boolean, result: UIT.SearchResult | undefined) {\n if (resultsAreShowing && result)\n this.domElement.renderRoot.getElementById(this.idFor(result))?.scrollIntoView({ block: \"nearest\" })\n }\n\n ////////////////\n // ## Open\n ////////////////\n\n /** `open`, asked to show results: set by the page, or by typing. */\n @E.controlled(\"open\") accessor isOpen = false\n\n /** Results (or a message) are showing: `:state(open)` follows SHOWING results, not `open`. */\n @E.cssState(\"open\")\n get resultsAreShowing(): boolean {\n return this.isOpen && this.queryIsLongEnough && (!!this.shownResults.length || !!this.message)\n }\n\n /**\n * The results, a popover panel on `isOpen`: `ui-opening` / `ui-closing`, the overlay entry, the anchor.\n * - Never opens while disabled or readonly; opening highlights the first result (`select-first-result`) or none.\n */\n readonly popover = new E.PopoverPanel({\n component: this,\n member: \"isOpen\",\n restoreFocus: false,\n canChange: (open) => !open || !(this.isDisabled || this.isReadOnly),\n onChange: (open) => {\n if (open) this.highlighted.index = this.selectFirstResult ? 0 : -1\n }\n })\n\n /** Show the popover and open the overlay entry while results show in the page; undone when they stop. */\n @E.onChange(\"resultsAreShowing\", \"isConnected\")\n protected onPopoverChanged(resultsAreShowing: boolean, isConnected: boolean) {\n return this.popover.follow(this.resultsBox, resultsAreShowing && isConnected)\n }\n\n /**\n * Show or hide the results as a person would (`popover.request()`); true when it changed.\n * - Not `open()` / `close()`: `open` is the attribute's.\n */\n requestOpen(open: boolean, originalEvent?: Event): boolean {\n return this.popover.request(open, originalEvent)\n }\n\n /**\n * Choose `result`, as someone did with `originalEvent`:\n * the cancelable `ui-select` first, then its title in the input (`ui-changed`), the results hidden,\n * and its `url` followed.\n * - A click on a result LINK follows it natively (new tabs work);\n * other ways follow it with `location.assign()`, the DOM element's own document's.\n */\n select(result: UIT.SearchResult, originalEvent?: Event) {\n if (!this.send(\"ui-choosing\", { result, originalEvent })) {\n originalEvent?.preventDefault()\n return\n }\n this.commit(String(result.title ?? \"\"), originalEvent)\n this.requestOpen(false, originalEvent)\n const url = typeof result.url === \"string\" ? result.url : undefined\n if (url && originalEvent?.type !== \"click\") this.domElement.ownerDocument.location.assign(url)\n }\n\n ////////////////\n // ## Busy\n ////////////////\n\n /** Busy: the `loading` attribute, or a remote query running. */\n @E.cssState(\"loading\")\n get isLoading(): boolean {\n return this.loading || this.isFetching\n }\n\n /** The `loading` class: also by a running remote query. */\n protected classValue(name: E.AttributeName<Vocabulary>): unknown {\n if (name === \"loading\") return this.isLoading\n return super.classValue(name)\n }\n\n ////////////////\n // ## Name\n ////////////////\n\n /** Name for the input: its `<label>`s / `aria-label` (`labels`), else `placeholder`, else the translated `label`. */\n private get label(): string {\n return this.labels.accessibleName ?? this.placeholder ?? this.translationForKey(\"searchLabel\")\n }\n\n ////////////////\n // ## Form\n ////////////////\n\n get formValue(): E.FieldValue {\n return this.query\n }\n\n /** Back to the `value` attribute; the input shows it, nothing is highlighted. */\n onFormReset() {\n this.value = this.initialValue\n this.inputRevision++\n this.highlighted.clear()\n }\n\n /**\n * The label in validation messages.\n * - Only once `isReady`: `label` may fall back to a translated text,\n * and validation can run before the runtime arrives\n * (seen on the docs kitchen sink: `UI.i18n ... isn't loaded yet`).\n * - Tracked, so it recomputes.\n */\n protected get validationLabel(): string | undefined {\n return this.isReady ? this.label : undefined\n }\n\n protected get validationAnchor(): HTMLElement | undefined {\n return this.input\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** The magnifying glass. */\n readonly iconGlyph = new E.IconGlyph({ owner: this, name: () => SEARCH_ICON })\n\n /** Match highlighting (`MenuOptions.highlights()`). */\n private readonly highlighter = new F.MenuOptions()\n\n /** Stable DOM id per result. */\n private readonly resultIds = new WeakMap<UIT.SearchResult, string>()\n\n /** Ids, from `UI.ids` once rendering. */\n private ids = { results: \"\" }\n\n /** The text input. */\n private input?: HTMLInputElement\n\n /** The text the input is drawn with (a server render's too); untracked: `onQueryChanged()` keeps it in step. */\n @E.untracked\n private get startingQuery(): string {\n return this.query\n }\n\n /** The results popover. */\n private resultsBox?: HTMLElement\n\n render(): JSX.Element {\n this.ids = { results: UI.ids.next(ID_PREFIX) }\n return (\n <div class={this.rootClass} part={this.partForName(\"search\")} style={this.popover.anchorStyle}>\n <div\n class={[INPUT, { [LOADING]: this.isLoading, [UIT.FLUID]: this.fluid, [UIT.DISABLED]: this.isDisabled }]}\n part={this.partForName(\"input\")}\n >\n <input\n ref={(element) => (this.input = element)}\n class={PROMPT}\n part={this.partForName(\"prompt\")}\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck={false}\n enterkeyhint=\"search\"\n value={this.startingQuery}\n placeholder={this.placeholder}\n disabled={this.isDisabled}\n readonly={this.isReadOnly}\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-expanded={this.resultsAreShowing && this.shownResults.length ? \"true\" : \"false\"}\n aria-controls={this.ids.results}\n aria-activedescendant={\n this.resultsAreShowing && this.highlightedResult ? this.idFor(this.highlightedResult) : undefined\n }\n aria-label={this.label}\n aria-busy={this.isLoading ? \"true\" : undefined}\n aria-required={this.required ? \"true\" : undefined}\n aria-invalid={this.validation.valid ? undefined : \"true\"}\n {...this.staticControl}\n onInput={this.onInput}\n onKeyDown={this.onKeyDown}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.onClick}\n />\n <span class={SEARCH_ICON_CLASS} part={this.partForName(\"icon\")}>\n <slot name={this.slotForName(\"icon\")}>{this.iconGlyph.svg}</slot>\n </span>\n </div>\n {this.results()}\n <span class=\"status\" role=\"status\">\n {this.statusText}\n </span>\n </div>\n )\n }\n\n /**\n * Server render only (`spell/ui/static`): the input's `name` (it holds the query, the value)\n * and the `STATIC_CONTROL` mark, so a static form submits it.\n * - `{}` in a browser, where the DOM element submits (`ElementInternals`).\n */\n private get staticControl(): Record<string, unknown> {\n return isServer ? { [UIT.STATIC_CONTROL]: \"\", name: this.name } : {}\n }\n\n /** The results popover: a listbox while there are results, else the message. */\n private results(): JSX.Element {\n return (\n <div\n ref={(element) => (this.resultsBox = element)}\n id={this.ids.results}\n class={RESULTS}\n style={this.popover.panelStyle}\n popover=\"manual\"\n part={this.partForName(\"results\")}\n role={this.shownResults.length ? \"listbox\" : undefined}\n aria-label={this.shownResults.length ? this.label : undefined}\n onMouseDown={UISearch.preventDefault}\n >\n <Show when={this.resultsAreShowing}>\n <Show when={this.shownResults.length} fallback={this.messageBox()}>\n <Show when={this.category} fallback={<For each={this.shownResults}>{(result) => this.row(result)}</For>}>\n <For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>\n </Show>\n </Show>\n </Show>\n </div>\n )\n }\n\n /**\n * One category: its name, then its results, as a named `group`.\n * - Not `category()`: `category` is the attribute's.\n */\n private resultCategory(group: UIT.SearchCategory, index: () => number): JSX.Element {\n // a function: `index` is `<For>`'s accessor, so it's read in JSX (tracked), never in the callback body\n const nameId = () => `${this.ids.results}${CATEGORY_ID_INFIX}${index()}`\n return (\n <div\n class={[CATEGORY, { [UIT.ACTIVE]: group.results.includes(this.highlightedResult!) }]}\n role=\"group\"\n aria-labelledby={nameId()}\n part={this.partForName(\"category\")}\n >\n <div id={nameId()} class={NAME} part={this.partForName(\"name\")}>\n {group.name}\n </div>\n <div class={RESULTS} role=\"none\">\n <For each={group.results}>{(result) => this.row(result)}</For>\n </div>\n </div>\n )\n }\n\n /**\n * One result: a link when it has a `url`, else a `<div>`.\n * - The link: Fomantic's `<a class=\"result\">`, `tabindex=-1`, so focus stays in the input.\n */\n private row(result: UIT.SearchResult): JSX.Element {\n const url = typeof result.url === \"string\" && result.url ? result.url : undefined\n const classes = () => [RESULT, { [UIT.ACTIVE]: this.highlightedResult === result }]\n const selected = () => (this.highlightedResult === result ? \"true\" : \"false\")\n const onPointerMove = () => this.highlighted.highlight(result)\n const onClick = (event: MouseEvent) => this.select(result, event)\n if (url) {\n return (\n <a\n id={this.idFor(result)}\n class={classes()}\n href={url}\n tabindex=\"-1\"\n role=\"option\"\n part={this.partForName(\"result\")}\n aria-selected={selected()}\n onPointerMove={onPointerMove}\n onClick={onClick}\n >\n {this.resultContent(result)}\n </a>\n )\n }\n return (\n <div\n id={this.idFor(result)}\n class={classes()}\n role=\"option\"\n part={this.partForName(\"result\")}\n aria-selected={selected()}\n onPointerMove={onPointerMove}\n onClick={onClick}\n >\n {this.resultContent(result)}\n </div>\n )\n }\n\n /** Image, price, title, description: Fomantic's result template. */\n private resultContent(result: UIT.SearchResult): JSX.Element {\n return (\n <>\n <Show when={typeof result.image === \"string\"}>\n <div class={UIT.IMAGE}>\n <img src={result.image as string} alt={typeof result.alt === \"string\" ? result.alt : \"\"} />\n </div>\n </Show>\n <div class={UIT.CONTENT}>\n <Show when={result.price !== undefined && result.price !== null}>\n <div class={PRICE}>{String(result.price)}</div>\n </Show>\n <div class={UIT.TITLE}>{this.markedText(String(result.title ?? \"\"))}</div>\n <Show when={result.description}>\n <div class={UIT.DESCRIPTION}>{this.markedText(String(result.description))}</div>\n </Show>\n </div>\n </>\n )\n }\n\n /** The no-results or error message. */\n private messageBox(): JSX.Element {\n return (\n <Show when={this.message}>\n {(message) => (\n <div class={[UIT.MESSAGE, message().kind]} part={this.partForName(\"message\")}>\n <Show when={message().header}>\n <div class={UIT.HEADER}>{message().header}</div>\n </Show>\n <div class={UIT.DESCRIPTION}>{message().text}</div>\n </div>\n )}\n </Show>\n )\n }\n\n /** `text` with the query in `<mark>`, when `highlight-matches`. */\n private markedText(text: string): JSX.Element {\n const query = this.query.trim()\n if (!this.highlightMatches || !query) return text\n const ranges = this.highlighter.highlights({ value: \"\", text }, query, {\n ignoreDiacritics: this.ignoreDiacritics\n })\n return E.markedPieces(text, ranges).map((piece) => (piece.isMarked ? <mark>{piece.text}</mark> : piece.text))\n }\n\n /** What the live region says: the result count, or the message. */\n private get statusText(): string {\n if (!this.resultsAreShowing) return \"\"\n const count = this.shownResults.length\n if (count === 1) return this.translationForKey(\"searchOneResult\")\n if (count) return this.translationForKey(\"searchResultCount\", { count })\n return this.message?.text ?? \"\"\n }\n\n /** Stable id for `result`'s row. */\n private idFor(result: UIT.SearchResult): string {\n let id = this.resultIds.get(result)\n if (!id) this.resultIds.set(result, (id = `${this.ids.results}-${++UISearch.resultCounter}`))\n return id\n }\n\n ////////////////\n // ## Handlers\n ////////////////\n\n /** Typing: the value (with `ui-searched` once long enough), then the query. */\n private readonly onInput = (event: Event) => {\n const text = (event.currentTarget as HTMLInputElement).value\n const isLong = this.isLongEnough(text)\n this.requestChange(\"value\", text, () => {\n if (isLong) this.send(\"ui-searched\", { query: text.trim(), originalEvent: event })\n return true\n })\n this.inputRevision++\n this.highlighted.index = this.selectFirstResult ? 0 : -1\n this.runQuery(text, event)\n }\n\n /** Focus: remember the value; show the results of what's there (Fomantic's `searchOnFocus`). */\n private readonly onFocus = (event: FocusEvent) => {\n this.valueAtFocus = this.query\n this.runQuery(this.valueAtFocus, event)\n }\n\n /** A click in the input reopens results someone closed. */\n @E.untracked\n private readonly onClick = (event: MouseEvent) => {\n if (!this.isOpen) this.rerunQuery(event)\n }\n\n /** Leaving: close (unless focus stays inside); an edited text commits with `ui-changed`. */\n @E.untracked\n private readonly onBlur = (event: FocusEvent) => {\n const next = event.relatedTarget as Node | null\n if (next && (this.domElement.contains(next) || this.domElement.renderRoot.contains(next))) return\n this.requestOpen(false, event)\n const value = this.query\n if (this.valueAtFocus !== undefined && value !== this.valueAtFocus) {\n this.send(\"ui-changed\", { value, originalEvent: event })\n }\n this.valueAtFocus = undefined\n }\n\n /** Combobox keys: arrows move, Enter chooses, Escape clears a closed search (an open one closes, overlays). */\n @E.untracked\n private readonly onKeyDown = (event: KeyboardEvent) => {\n if (this.isDisabled || event.defaultPrevented || event.isComposing) return\n const isShowing = this.resultsAreShowing\n switch (event.key) {\n case UIT.Key.arrowDown:\n event.preventDefault()\n if (isShowing) this.highlighted.move(1)\n else this.rerunQuery(event)\n return\n case UIT.Key.arrowUp:\n if (!isShowing) return\n event.preventDefault()\n this.highlighted.move(-1)\n return\n case UIT.Key.enter: {\n const result = isShowing ? this.highlightedResult : undefined\n if (result) {\n event.preventDefault()\n this.select(result, event)\n } else this.domElement.form?.requestSubmit()\n return\n }\n case UIT.Key.escape:\n // showing: `UI.overlays` closes it; else Escape clears (APG)\n if (isShowing || !this.query) return\n event.preventDefault()\n this.requestOpen(false, event)\n this.commit(\"\", event)\n return\n case UIT.Key.tab:\n if (this.isOpen) this.requestOpen(false, event)\n return\n }\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /**\n * Counter behind result ids.\n * - STATIC: page-wide, so two searches never share an id (results of the same `source` are the same objects).\n */\n private static resultCounter = 0\n\n /**\n * `preventDefault()`: presses in the results must not take focus from the input.\n * - STATIC: one handler for every instance.\n */\n private static preventDefault(event: Event) {\n event.preventDefault()\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UISearch extends E.AttributeValues<Vocabulary> {}\n\n////////////////\n// ## Constants\n////////////////\n\n/** `UI.ids` prefix. */\nconst ID_PREFIX = \"ui-search\"\n\n/** Infix of a category name's id, between the results id and the category's index. */\nconst CATEGORY_ID_INFIX = \"-category-\"\n\n/** The input's icon: FA's magnifying glass. */\nconst SEARCH_ICON = \"magnifying-glass\"\n\n/**\n * Class word of the input box while busy.\n * - Class words are the markup contract (`UISearch.css`) -- grammar, not attributes, so not in the vocabulary.\n * - NOTE: `active` (`UIT.ACTIVE`) === the HIGHLIGHTED result (and its category): Fomantic's meaning.\n */\nconst LOADING = \"loading\"\n\n/** Class words of the icon box. */\nconst SEARCH_ICON_CLASS = \"search icon\"\n\n/** Class word of the results popover, and of a category's results. */\nconst RESULTS = \"results\"\n\n/** Class word of each result. */\nconst RESULT = \"result\"\n\n/** Class word of each category. */\nconst CATEGORY = \"category\"\n\n/** Class word of a category's name. */\nconst NAME = \"name\"\n\n/** Class word of a result's price. */\nconst PRICE = \"price\"\n","/**\n * The search family: defines `<ui-search>`, and exports its component.\n * - Also the `search` lib entry (`spell/ui/ui-search`), measured in `notes/report.md`.\n * - SIDE EFFECT: importing it defines the tag.\n * - Exports `SearchMatcher` too: Fomantic's local matching, pure data, usable on its own.\n */\n\nimport { UISearch } from \"./UISearch\"\nimport { SearchMatcher } from \"./SearchMatcher\"\n\nUISearch.define()\n\nexport { SearchMatcher, UISearch }\n"],"mappings":";;;;;;;AAoBA,IAAa6H,KAAmB;CAC9B,KAAK;CACL,aAAa;CACb,QAAQ;EAAC;EAAU;EAAS;EAAc;EAAa;CAAS;CAChE,KAAK;EAAC;EAAgB;EAAa;EAAc;EAAY;CAAQ;CACrE,UAAU;CACV,MAAM;CACN,aAAa;CACb,YAAY;EACV;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ,CAAC,YAAY;GACrB,UAAU,CAAC;IAAE,MAAM;IAAc,OAAO;GAAa,CAAC;GACtD,aACE;EAEJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GAAE,MAAM;GAAa,OAAO;GAAU,MAAM;GAAW,aAAa;EAA2C;EAC/G;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ;IAAC;IAAc;IAAS;IAAQ;GAAW;GACnD,SAAS;IAAE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/C5H,EADE4H,GACK,cAAahH,EAApB0G,GAAA,IADEM,GACkBnG,EAAA,CAAA,GAApBb,EAAA0G,GAAA,IADEM,CAAA,GAEI5H,EAFJ4H,GAEW,gBAAehH,EAAtB0G,GAAA,IAFJM,GAE0B;CACnC,aAAa;EAAE,OAAO/H;EAAU,QAAQC;CAAU;CAClD,WAAW,CAAC,OAAO;CACnB,UAAUqD;CAEV,SAAS;AACX,CAAA,CAAA,GANevC,EAAA0G,GAAA,IAFJM,CAAA,GAsoBX5H,EAtoBW4H,GAsoBI,iBAAgB,CAAA;AAtoB1B,IAAM2G,KAAN3G,GAypBD6B,KAAY,aAGZqC,KAAoB,cAGpBrD,KAAc,oBAOd8B,KAAU,WAGVC,KAAoB,eAGpBoB,KAAU,WAGVU,KAAS,UAGTH,KAAW,YAGXC,KAAO,QAGPoB,KAAQ;;;;;;;IC1tBde,GAAS,OAAO"}
1
+ {"version":3,"file":"ui-search.js","names":["UIT.SearchMatches","_vocabulary_dec","_a","_init","E.NativeFallback","E.proto","__name","E.escapeRegExp","UIT.WHITESPACE","E.withoutAccents","class={PROMPT}","this","type=\"text\"","role=\"combobox\"","autocomplete=\"off\"","spellcheck={false}","enterkeyhint=\"search\"","ref={(element) => this.input = element}","<div class={this.rootClass} part={this.partForName(\"search\")} style={this.popover.anchorStyle}>\n <div\n class={[INPUT, { [LOADING]: this.isLoading, [UIT.FLUID]: this.fluid, [UIT.DISABLED]: this.isDisabled }]}\n part={this.partForName(\"input\")}\n >\n <input\n ref={(element) => this.input = element}\n class={PROMPT}\n part={this.partForName(\"prompt\")}\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck={false}\n enterkeyhint=\"search\"\n value={this.startingQuery}\n placeholder={this.placeholder}\n disabled={this.isDisabled}\n readonly={this.isReadOnly}\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-expanded={this.resultsAreShowing && this.shownResults.length ? \"true\" : \"false\"}\n aria-controls={this.ids.results}\n aria-activedescendant={this.resultsAreShowing && this.highlightedResult ? this.idFor(this.highlightedResult) : void 0}\n aria-label={this.label}\n aria-busy={this.isLoading ? \"true\" : void 0}\n aria-required={this.required ? \"true\" : void 0}\n aria-invalid={this.validation.valid ? void 0 : \"true\"}\n {...this.staticControl}\n onInput={this.onInput}\n onKeyDown={this.onKeyDown}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.onClick}\n />\n <span class={SEARCH_ICON_CLASS} part={this.partForName(\"icon\")}>\n <slot name={this.slotForName(\"icon\")}>{this.iconGlyph.svg}</slot>\n </span>\n </div>\n {this.results()}\n <span class=\"status\" role=\"status\">\n {this.statusText}\n </span>\n </div>","part={this.partForName(\"search\")}","style={this.popover.anchorStyle}","class={[INPUT, { [LOADING]: this.isLoading, [UIT.FLUID]: this.fluid, [UIT.DISABLED]: this.isDisabled }]}","part={this.partForName(\"input\")}","class={SEARCH_ICON_CLASS}","part={this.partForName(\"icon\")}","name={this.slotForName(\"icon\")}","ref={(element) => this.resultsBox = element}","<Show when={this.resultsAreShowing}>\n <Show when={this.shownResults.length} fallback={this.messageBox()}>\n <Show when={this.category} fallback={<For each={this.shownResults}>{(result) => this.row(result)}</For>}>\n <For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>\n </Show>\n </Show>\n </Show>","<Show when={this.shownResults.length} fallback={this.messageBox()}>\n <Show when={this.category} fallback={<For each={this.shownResults}>{(result) => this.row(result)}</For>}>\n <For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>\n </Show>\n </Show>","<Show when={this.category} fallback={<For each={this.shownResults}>{(result) => this.row(result)}</For>}>\n <For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>\n </Show>","<For each={this.shownResults}>{(result) => this.row(result)}</For>","<For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>","class={RESULTS}","style={this.popover.panelStyle}","part={this.partForName(\"results\")}","role={this.shownResults.length ? \"listbox\" : void 0}","aria-label={this.shownResults.length ? this.label : void 0}","<div\n ref={(element) => this.resultsBox = element}\n id={this.ids.results}\n class={RESULTS}\n style={this.popover.panelStyle}\n popover=\"manual\"\n part={this.partForName(\"results\")}\n role={this.shownResults.length ? \"listbox\" : void 0}\n aria-label={this.shownResults.length ? this.label : void 0}\n onMouseDown={_UISearch.preventDefault}\n >\n <Show when={this.resultsAreShowing}>\n <Show when={this.shownResults.length} fallback={this.messageBox()}>\n <Show when={this.category} fallback={<For each={this.shownResults}>{(result) => this.row(result)}</For>}>\n <For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>\n </Show>\n </Show>\n </Show>\n </div>","<For each={group.results}>{(result) => this.row(result)}</For>","aria-labelledby={nameId()}","part={this.partForName(\"category\")}","id={nameId()}","class={NAME}","part={this.partForName(\"name\")}","<div\n class={[CATEGORY, { [UIT.ACTIVE]: group.results.includes(this.highlightedResult) }]}\n role=\"group\"\n aria-labelledby={nameId()}\n part={this.partForName(\"category\")}\n >\n <div id={nameId()} class={NAME} part={this.partForName(\"name\")}>\n {group.name}\n </div>\n <div class={RESULTS} role=\"none\">\n <For each={group.results}>{(result) => this.row(result)}</For>\n </div>\n </div>","class={classes()}","part={this.partForName(\"result\")}","aria-selected={selected()}","<a\n id={this.idFor(result)}\n class={classes()}\n href={url}\n tabindex=\"-1\"\n role=\"option\"\n part={this.partForName(\"result\")}\n aria-selected={selected()}\n onPointerMove={onPointerMove}\n onClick={onClick}\n >\n {this.resultContent(result)}\n </a>","<div\n id={this.idFor(result)}\n class={classes()}\n role=\"option\"\n part={this.partForName(\"result\")}\n aria-selected={selected()}\n onPointerMove={onPointerMove}\n onClick={onClick}\n >\n {this.resultContent(result)}\n </div>","<Show when={typeof result.image === \"string\"}>\n <div class={UIT.IMAGE}>\n <img src={result.image} alt={typeof result.alt === \"string\" ? result.alt : \"\"} />\n </div>\n </Show>","src={result.image}","alt={typeof result.alt === \"string\" ? result.alt : \"\"}","<div class={UIT.IMAGE}>\n <img src={result.image} alt={typeof result.alt === \"string\" ? result.alt : \"\"} />\n </div>","<Show when={result.price !== void 0 && result.price !== null}>\n <div class={PRICE}>{String(result.price)}</div>\n </Show>","result.price !== void 0 && result.price !== null","<div class={PRICE}>{String(result.price)}</div>","<div class={UIT.CONTENT}>\n <Show when={result.price !== void 0 && result.price !== null}>\n <div class={PRICE}>{String(result.price)}</div>\n </Show>\n <div class={UIT.TITLE}>{this.markedText(String(result.title ?? \"\"))}</div>\n <Show when={result.description}>\n <div class={UIT.DESCRIPTION}>{this.markedText(String(result.description))}</div>\n </Show>\n </div>","<Show when={result.description}>\n <div class={UIT.DESCRIPTION}>{this.markedText(String(result.description))}</div>\n </Show>","<div class={UIT.DESCRIPTION}>{this.markedText(String(result.description))}</div>","class={UIT.TITLE}","<Show when={this.message}>\n {(message) => <div class={[UIT.MESSAGE, message().kind]} part={this.partForName(\"message\")}>\n <Show when={message().header}>\n <div class={UIT.HEADER}>{message().header}</div>\n </Show>\n <div class={UIT.DESCRIPTION}>{message().text}</div>\n </div>}\n </Show>","<Show when={message().header}>\n <div class={UIT.HEADER}>{message().header}</div>\n </Show>","<div class={UIT.HEADER}>{message().header}</div>","<div class={[UIT.MESSAGE, message().kind]} part={this.partForName(\"message\")}>\n <Show when={message().header}>\n <div class={UIT.HEADER}>{message().header}</div>\n </Show>\n <div class={UIT.DESCRIPTION}>{message().text}</div>\n </div>","part={this.partForName(\"message\")}","class={UIT.DESCRIPTION}","F.FormComponent","E.proto","E.protoMerged","E.controlled","E.state","E.onChange","E.untracked","E.whileConnected","E.derived","E.cssState","F.HighlightedOption","E.PopoverPanel","E.IconGlyph","F.MenuOptions","E.after","_$getOwner","_$readShallow","UIT.FLUID","UIT.DISABLED","_$setAttribute","UIT.STATIC_CONTROL","_$createComponent","UIT.ACTIVE","UIT.IMAGE","_$memo","UIT.DESCRIPTION","UIT.CONTENT","UIT.TITLE","UIT.HEADER","UIT.MESSAGE","E.markedPieces","__name","inputCSS","searchCSS","_$delegateEvents","STATIC_CONTROL","__name$1","FormControlAttributes","TITLE","HEADER","Key","WHITESPACE","__publicField","__decorateElement","IMAGE","MESSAGE","__decoratorMetadata","__runInitializers","__privateAdd","CONTENT","DISABLED","ACTIVE","SearchMatches","DESCRIPTION","SearchMatch","FLUID","FormControlStates","__decoratorStart","UIInput_default","getOwner$1","searchVocabulary","RemoteStatus","SearchMessageKind","INPUT","PROMPT","_degraded_dec","_vocabulary_dec$1","_a$1","_init$1","_SearchFallback","NativeFallback","proto","domElement","listId","SUGGESTIONS_SUFFIX","placeholder","input","list","titles","result","title","box","INPUT_PART","root","CHANGE_EVENT","event","SearchFallback","SearchMatcher","DEFAULT_FIELDS","fields","match","ignoreCase","ignoreDiacritics","term","query","wordStart","escapeRegExp","words","first","exact","fuzzy","source","texts","joined","word","text","groups","results","group","name","members","response","category","plain","maxResults","field","value","withoutAccents","position","char","UISearch_default","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_tmpl$6","_tmpl$7","_tmpl$8","_tmpl$9","_tmpl$10","_onKeyDown_dec","_onBlur_dec","_onClick_dec","_startingQuery_dec","_isLoading_dec","_onPopoverChanged_dec","_resultsAreShowing_dec","_isOpen_dec","_onHighlightChanged_dec","_rerunQuery_dec","_message_dec","_shownResults_dec","_runningQuery_dec","_remoteAnswer_dec","_localGroups_dec","_matcher_dec","_stopSettlingOnDisconnect_dec","_settle_dec","_delayMs_dec","_recordPageValue_dec","_onQueryChanged_dec","_inputRevision_dec","_value_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_value","_inputRevision","_remoteAnswer","_runningQuery","_isOpen","_UISearch","FormComponent","protoMerged","controlled","state","onChange","untracked","whileConnected","derived","cssState","HighlightedOption","PopoverPanel","open","IconGlyph","SEARCH_ICON","MenuOptions","isLong","next","isShowing","DEFAULT_DELAY","delay","originalEvent","after","Converters","max","remote","url","cached","running","error","resultsAreShowing","isConnected","UI","ID_PREFIX","_self$","_el$","_el$2","_el$3","_el$4","_el$5","_el$6","spread","ref","element","insert","effect","readShallow","LOADING","SEARCH_ICON_CLASS","className","_p$","t","setAttribute","style","a","o","i","n","s","h","isServer","_self$2","_el$7","addEvent","createComponent","Show","For","index","RESULTS","nameId","CATEGORY_ID_INFIX","_self$3","_el$8","_el$9","_el$10","CATEGORY","NAME","classes","RESULT","selected","onPointerMove","onClick","_self$4","_el$11","_o$","claimElement","_self$5","_el$12","_self$6","_el$13","_el$14","_el$15","_el$17","_el$19","memo","_el$16","PRICE","_v$","_$p","_el$18","_self$7","_el$20","_el$22","message","_el$21","ranges","markedPieces","piece","_el$23","count","id","time","UISearch","delegateEvents"],"sources":["../src/components/ui-search/UISearch.en.ts","../src/components/ui-search/UISearch.types.ts","../src/components/ui-search/UISearch.fallback.ts","../src/components/ui-search/SearchMatcher.ts","../src/components/ui-search/UISearch.css?inline","../src/components/ui-search/UISearch.tsx","../src/components/ui-search/index.ts"],"sourcesContent":["/**\n * Every name `<ui-search>` uses: tag, attributes (kind + allowed values), events, slots, parts, states, texts.\n * Schema: `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Pure data: node imports it (`yarn site:data`, `yarn gen:root`), so `spell/ui/core` for types only,\n * `UIT` by value straight from `components.types`.\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-search category fluid align=\"right\">` => `ui category fluid right aligned search`.\n * `UISearch.css` keys on those words.\n * - Rich data is a PROPERTY (`source`, `kind: \"json\"`);\n * first paint never needs it -- the input and its `value` are all SSR must show.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `<ui-search>`\n * A combobox + listbox: a text `<input>` and an anchor-positioned popover of results,\n * from a local `source` or a remote `url`.\n ****************/\nexport const searchVocabulary = {\n tag: \"ui-search\",\n icon: \"search\",\n formControl: true,\n topics: [\"inputs\", \"forms\", \"navigation\", \"selection\", \"modules\"],\n aka: [\"autocomplete\", \"typeahead\", \"search box\", \"combobox\", \"lookup\"],\n skeleton: \"inline 15 x 2.5\",\n noun: \"search\",\n description: \"A search module lets people query for results from a selection of data.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Size, `mini` ... `massive`; `medium` is the default.\"\n },\n {\n name: \"category\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Results in named groups (`category` of each result).\"\n },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"horizontal\"],\n replaces: [{ from: \"horizontal\", value: \"horizontal\" }],\n description:\n \"`horizontal`, with `category`: each group's name above its results, not beside them. \" +\n \"Old name: `horizontal`.\"\n },\n {\n name: \"fluid\",\n group: \"layout\",\n kind: \"keyOnly\",\n description: \"Takes the full width of its container; so do the results.\"\n },\n { name: \"scrolling\", group: \"layout\", kind: \"keyOnly\", description: \"The results scroll after a fixed height.\" },\n {\n name: \"resizable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description: \"`scrolling`: people can resize the results vertically.\"\n },\n {\n name: \"length\",\n group: \"appearance\",\n kind: \"valueOnly\",\n values: [\"very-short\", \"short\", \"long\", \"very-long\"],\n classes: { \"very-short\": \"very short\", \"very-long\": \"very long\" },\n replaces: [\n { from: \"short\", value: \"short\" },\n { from: \"very-short\", value: \"very-short\" },\n { from: \"long\", value: \"long\" },\n { from: \"very-long\", value: \"very-long\" }\n ],\n description:\n \"How far the results go before they scroll: `very-short`, `short`, `long`, `very-long`. \" +\n \"Old names: `short`, `very-short`, `long`, `very-long`.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"valueAndKey\",\n key: \"aligned\",\n values: [\"left\", \"right\"],\n replaces: [\"aligned\"],\n description:\n \"Which edge the results line up with: `right` => `right aligned` (they extend to the left). \" +\n \"Old name: `aligned`.\"\n },\n {\n name: \"loading\",\n group: \"states\",\n kind: \"keyOnly\",\n description: \"Busy: the icon spins. Also shown while a remote query runs.\"\n },\n {\n name: \"disabled\",\n group: \"states\",\n kind: \"keyOnly\",\n description: \"Can't be used; dimmed, and left out of the form.\"\n },\n {\n ...UIT.FormControlAttributes.readonly,\n description: \"Shows its value but can't be typed in, and the results never open; still focusable and submitted.\"\n },\n {\n name: \"open\",\n group: \"states\",\n kind: \"boolean\",\n description:\n \"The results are showing. Controlled: `ui-opening` / `ui-closing` can veto; shown only with something to show.\"\n },\n { ...UIT.FormControlAttributes.placeholder, description: \"Placeholder text of the input.\" },\n {\n name: \"value\",\n group: \"form\",\n kind: \"string\",\n description: \"The input's text: the query, or a chosen result's title.\"\n },\n { ...UIT.FormControlAttributes.name, description: \"Form field name: submits the input's text.\" },\n UIT.FormControlAttributes.parameter,\n { ...UIT.FormControlAttributes.required, description: \"Form validation: the input can't be empty.\" },\n {\n name: \"url\",\n group: \"link\",\n kind: \"string\",\n description: \"Remote results: a `UI.api` URL template with `{query}`, e.g. `/api/search?q={query}`.\"\n },\n {\n name: \"min-characters\",\n group: \"form\",\n kind: \"number\",\n default: 1,\n description: \"Characters to type before a search runs.\"\n },\n {\n name: \"max-results\",\n group: \"appearance\",\n kind: \"number\",\n default: 7,\n description: \"The most results shown (before categories); `0` for no limit.\"\n },\n {\n name: \"search-delay\",\n group: \"behaviour\",\n kind: \"number\",\n default: 200,\n description: \"Remote: ms to wait after typing stops before querying (a newer query aborts an older one).\"\n },\n {\n name: \"delay\",\n group: \"behaviour\",\n kind: \"string\",\n default: \"2s\",\n description:\n \"How long typing must pause before the text SETTLES: a CSS time (`0.5s`, `500ms`) or bare ms; `0` settles \" +\n \"every keystroke. Settling sends `ui-changed`, writes a bound form's field, and records `parameter`; \" +\n \"Enter, leaving the field, choosing a result and clearing it settle at once.\"\n },\n {\n name: \"full-text-search\",\n group: \"appearance\",\n kind: \"enum\",\n values: UIT.SearchMatches,\n default: UIT.SearchMatch.exact,\n description:\n \"Local matching (`SearchMatch`): a word START always matches; then `exact` anywhere, `fuzzy` in order, \" +\n \"`prefix` nothing more, `some` any word, `all` every word.\"\n },\n {\n name: \"search-fields\",\n group: \"behaviour\",\n kind: \"string\",\n default: \"title description\",\n description: \"Local: the result fields searched, a comma / space list.\"\n },\n { name: \"ignore-diacritics\", group: \"advanced\", kind: \"boolean\", description: \"Local: `a` matches `á`.\" },\n {\n name: \"highlight-matches\",\n group: \"advanced\",\n kind: \"boolean\",\n description: \"Marks the query in titles and descriptions (`<mark>`).\"\n },\n {\n name: \"select-first-result\",\n group: \"advanced\",\n kind: \"boolean\",\n description: \"Highlights the first result as results arrive.\"\n },\n {\n name: \"show-no-results\",\n group: \"advanced\",\n kind: \"boolean\",\n default: true,\n description: \"Shows the no-results message; `false` shows nothing instead.\"\n },\n {\n name: \"source\",\n group: \"content\",\n kind: \"json\",\n reflect: false,\n description:\n \"Local results as a PROPERTY: `SearchResult[]` (`{ title, description, image, price, category, url }`).\"\n }\n ],\n events: [\n {\n name: \"ui-searched\",\n detail: \"{ query: string, originalEvent?: Event }\",\n description: \"Someone typed a query at least `min-characters` long; it's about to run.\"\n },\n {\n name: \"ui-choosing\",\n detail: \"{ result: SearchResult, originalEvent?: Event }\",\n cancelable: true,\n description: \"A result is about to be chosen; `preventDefault()` keeps the text, the results and the page.\"\n },\n {\n name: \"ui-changed\",\n detail: \"{ value: string, originalEvent?: Event }\",\n description:\n \"The text settled: typing paused for `delay`, Enter pressed, a result chosen, the input cleared, or left \" +\n \"after an edit. Once per new text.\"\n },\n {\n name: \"ui-replied\",\n detail: \"{ query: string, results: SearchResult[] }\",\n description: \"A remote query answered.\"\n },\n {\n name: \"ui-opening\",\n detail: \"{ open: true, originalEvent?: Event }\",\n cancelable: true,\n description: \"The results are about to show; `preventDefault()` keeps them hidden.\"\n },\n {\n name: \"ui-closing\",\n detail: \"{ open: false, originalEvent?: Event }\",\n cancelable: true,\n description: \"The results are about to hide; `preventDefault()` keeps them showing.\"\n }\n ],\n slots: [{ name: \"icon\", description: \"Replaces the magnifying glass.\" }],\n parts: [\n { name: \"search\", description: \"The root box (`ui search`): where the `--ui-search-*` tokens are read.\" },\n { name: \"input\", description: \"The `ui icon input` box around the text field.\" },\n { name: \"prompt\", description: \"The text `<input>` (the combobox).\" },\n { name: \"icon\", description: \"The icon box.\" },\n { name: \"results\", description: \"The results popover (the listbox while there are results).\" },\n { name: \"result\", description: \"Each result.\" },\n { name: \"category\", description: \"Each group of a `category` search.\" },\n { name: \"name\", description: \"Each group's name.\" },\n { name: \"message\", description: \"The no-results or error message.\" }\n ],\n states: [\n { name: \"open\", description: \"The results are showing.\" },\n { name: \"disabled\", description: \"Can't be used.\" },\n UIT.FormControlStates.readonly,\n { name: \"loading\", description: \"Busy (`loading`, or a remote query running).\" },\n { ...UIT.FormControlStates.invalid, description: \"Fails validation (`required`).\" },\n { name: \"fluid\", description: \"The host is block-level (`fluid`).\" }\n ],\n // NOTE: text keys share ONE namespace across components (`UI.i18n`, first registration wins), hence the prefix\n texts: [\n { key: \"searchLabel\", text: \"Search\", description: \"Accessible name of the input when nothing else names it.\" },\n { key: \"searchNoResultsHeader\", text: \"No Results\", description: \"Header of the no-results message.\" },\n { key: \"searchNoResults\", text: \"Your search returned no results\", description: \"The no-results message.\" },\n {\n key: \"searchServerError\",\n text: \"There was an issue querying the server.\",\n description: \"A remote query failed.\"\n },\n { key: \"searchOneResult\", text: \"1 result available.\", description: \"Announced when one result shows.\" },\n { key: \"searchResultCount\", text: \"{count} results available.\", description: \"Announced when results show.\" }\n ]\n} as const satisfies E.ComponentVocabulary\n","/**\n * Constants and types of the `ui-search` family: what its component (`UISearch`) and its native fallback\n * (`SearchFallback`) share.\n * - Pure data: types only (`spell/ui/core`, the vocabulary), so node can load it (`yarn site:data`).\n * - Its other class words and ids are module constants below `UISearch`, the one class that uses them;\n * `SearchMatcher`'s props live with it.\n */\n\nimport type { UIT } from \"spell/ui/core\"\nimport type { searchVocabulary } from \"./UISearch.en\"\n\n////////////////\n// ## Types\n////////////////\n\n/** The vocabulary's type, for short. */\nexport type Vocabulary = typeof searchVocabulary\n\n/**\n * How the last remote query went: a const object (the `UIT.Key` shape), compared as `RemoteStatus.error`.\n * - `idle` -- nothing asked yet\n * - `done` -- answered (maybe with no results)\n * - `error` -- the request failed\n */\nexport const RemoteStatus = { idle: \"idle\", done: \"done\", error: \"error\" } as const\n/** One of `RemoteStatus`'s values, e.g. `\"done\"`. */\nexport type RemoteStatus = (typeof RemoteStatus)[keyof typeof RemoteStatus]\n\n/** The last remote answer: for which query, and how it went. */\nexport type RemoteAnswer = {\n /** the query it answers, trimmed */\n query: string\n /** its results, grouped (`SearchMatcher.groupsFor()`) */\n groups: readonly UIT.SearchCategory[]\n /** how it went */\n status: RemoteStatus\n}\n\n/**\n * The kind of a message the results show instead of results.\n * - Also its class word (`empty message`, `error message`, `UISearch.css`).\n */\nexport const SearchMessageKind = { empty: \"empty\", error: \"error\" } as const\n/** One of `SearchMessageKind`'s values, e.g. `\"empty\"`. */\nexport type SearchMessageKind = (typeof SearchMessageKind)[keyof typeof SearchMessageKind]\n\n/** A message the results show instead of results. */\nexport type SearchMessage = {\n /** no results, or a failed request */\n kind: SearchMessageKind\n /** its header line, if any */\n header?: string\n /** its text, also what the live region says */\n text: string\n}\n\n////////////////\n// ## Class words: shared by the component and its fallback\n////////////////\n\n/** The class words of the box around the text field (`UIInput.css`). */\nexport const INPUT = \"ui icon input\"\n\n/** The class word of the text `<input>` (`UISearch.css`): Fomantic's `prompt`. */\nexport const PROMPT = \"prompt\"\n","import { E, UIT } from \"spell/ui/core\"\nimport { searchVocabulary } from \"./UISearch.en\"\nimport { INPUT, PROMPT, type Vocabulary } from \"./UISearch.types\"\n\n/****************\n * ### `SearchFallback`\n * The native fallback of `<ui-search>`: what it shows when its component breaks,\n * so the text is still typed in, validated and submitted with the form.\n *\n * - Its shadow DOM: a plain text field in the class grammar,\n * `div.ui.search` > `div.ui.icon.input` > `<input class=\"prompt\">`,\n * whose suggestions are a native `<datalist>` of the local `source` titles.\n * - The input is a native search field (`type=\"search\"`): typing narrows the browser's own suggestion list.\n * - Its text is the DOM element's form value (with `required` validity), and `domElement.value` follows it;\n * the native `change` sends `ui-changed`.\n * - `readonly`: the input's own `readonly`, as the component's; its text can't be changed.\n * - Its accessible name is the DOM element's `aria-label`, else `placeholder`.\n ****************/\nexport class SearchFallback extends E.NativeFallback<Vocabulary> {\n @E.proto static vocabulary = searchVocabulary\n @E.proto static degraded = [\n \"remote results (`url`): no suggestions\",\n \"result descriptions, images, prices and categories (titles only, as the browser's suggestions)\",\n \"Fomantic's matching (`full-text-search`, `search-fields`, `max-results`): the browser's own\",\n \"`ui-search`, `ui-select`, `ui-replied`, `ui-opening`, `ui-closing`; following a result's `url`\",\n \"the magnifying glass and the loading spinner\"\n ]\n\n /** The native input, once built, for `sync()`. */\n private input: HTMLInputElement | undefined\n\n protected override build() {\n const domElement = this.domElement as SearchDOMElement\n const listId = `${this.vocabulary.tag}${SUGGESTIONS_SUFFIX}`\n const placeholder = this.attr(\"placeholder\")\n const input = this.create(\"input\", {\n class: PROMPT,\n type: \"search\",\n placeholder,\n required: this.flag(\"required\"),\n disabled: this.flag(\"disabled\"),\n readonly: this.flag(\"readonly\"),\n autocomplete: \"off\",\n list: listId\n })\n input.value = typeof domElement.value === \"string\" ? domElement.value : (this.attr(\"value\") ?? \"\")\n this.decorate(input, \"prompt\")\n this.nameFromPlaceholder(input)\n\n const list = this.create(\"datalist\", { id: listId })\n const titles = new Set<string>()\n for (const result of Array.isArray(domElement.source) ? domElement.source : []) {\n if (typeof result?.title === \"string\") titles.add(result.title)\n }\n for (const title of titles) list.append(this.create(\"option\", { value: title }))\n\n const box = this.create(\"div\", { class: INPUT, part: INPUT_PART }, input, list)\n const root = this.create(\"div\", { class: this.classes() }, box)\n\n this.listen(input, \"input\", () => {\n domElement.value = input.value\n this.sync()\n })\n this.listen(input, \"change\", (event) => {\n this.send(CHANGE_EVENT, { value: input.value, originalEvent: event })\n })\n this.input = input\n return [root]\n }\n\n /** The input's text, and its validity (`required`). */\n protected override sync() {\n const { input } = this\n if (input) this.syncForm({ value: input.value, control: input })\n }\n}\n\n/** What the fallback reads and writes of the DOM element: all optional, the element may not have upgraded. */\ntype SearchDOMElement = HTMLElement & {\n /** the text, once set as a property */\n value?: string\n /** the `source` property, once set */\n source?: readonly UIT.SearchResult[]\n}\n\n/** The event the input's `change` becomes. */\nconst CHANGE_EVENT: E.EventName<Vocabulary> = \"ui-changed\"\n\n/** The part of the box around the input (the input itself is `prompt`, through `decorate()`). */\nconst INPUT_PART: E.PartName<Vocabulary> = \"input\"\n\n/** The suffix of the `<datalist>` id, after the tag. */\nconst SUGGESTIONS_SUFFIX = \"-suggestions\"\n","import { E, UIT } from \"spell/ui/core\"\n\n/****************\n * ### `SearchMatcher`\n * Local search over a `<ui-search>` `source`, and the shapes results arrive in. Pure data, NO DOM: `UISearch`\n * builds one per change of its matching attributes; the family barrel exports it for use on its own.\n * - Ported from Fomantic's `search.object()`: each result is tried field by field (`fields`, in order); its\n * FIRST matching field decides its bucket, and buckets sort as\n * - the query at the start of a word (`(?:\\s|^)query`) -- always tried, except for `all`\n * - then, by `match` (`UIT.SearchMatch`): `exact` / `some` / `all` matches\n * - then `fuzzy` matches\n * - Case-insensitive unless `ignoreCase: false`; `ignoreDiacritics` folds `á` to `a` on both sides.\n * - Numbers count as text; other field values are skipped.\n ****************/\nexport class SearchMatcher {\n /** Fields tried, in order. */\n readonly fields: readonly string[]\n\n /** What counts as a match besides a word start. */\n readonly match: UIT.SearchMatch\n\n /** Case-insensitive. */\n readonly ignoreCase: boolean\n\n /** Fold diacritics. */\n readonly ignoreDiacritics: boolean\n\n constructor({\n fields = DEFAULT_FIELDS,\n match = UIT.SearchMatch.exact,\n ignoreCase = true,\n ignoreDiacritics = false\n }: SearchMatcherProps = {}) {\n this.fields = fields\n this.match = match\n this.ignoreCase = ignoreCase\n this.ignoreDiacritics = ignoreDiacritics\n }\n\n /** Results of `source` matching `query`, best first; `[]` for a blank query. */\n search(source: readonly UIT.SearchResult[], query: string): UIT.SearchResult[] {\n const term = this.fold(query.trim())\n if (!term) return []\n const wordStart = new RegExp(`(?:\\\\s|^)${E.escapeRegExp(term)}`, \"u\")\n const words = term.split(UIT.WHITESPACE)\n const first: UIT.SearchResult[] = []\n const exact: UIT.SearchResult[] = []\n const fuzzy: UIT.SearchResult[] = []\n for (const result of source) {\n const texts = this.texts(result)\n if (this.match === UIT.SearchMatch.all) {\n const joined = texts.join(\" \")\n if (words.every((word) => joined.includes(word))) exact.push(result)\n continue\n }\n for (const text of texts) {\n if (wordStart.test(text)) first.push(result)\n else if (this.match === UIT.SearchMatch.exact && text.includes(term)) exact.push(result)\n else if (this.match === UIT.SearchMatch.some && words.some((word) => text.includes(word))) exact.push(result)\n else if (this.match === UIT.SearchMatch.fuzzy && SearchMatcher.isFuzzyMatch(term, text)) fuzzy.push(result)\n else continue\n break\n }\n }\n return [...first, ...exact, ...fuzzy]\n }\n\n ////////////////\n // ## Shapes\n ////////////////\n\n /**\n * `results` grouped by their `category`, in order of first appearance.\n * - NOTE: as Fomantic's `categoryResults()`, a result WITHOUT a category is left out.\n * - STATIC: pure, needs no matcher (a remote answer is grouped without one).\n */\n static categorize(results: readonly UIT.SearchResult[]): UIT.SearchCategory[] {\n const groups = new Map<string, UIT.SearchResult[]>()\n for (const result of results) {\n if (!result.category) continue\n const group = groups.get(result.category)\n if (group) group.push(result)\n else groups.set(result.category, [result])\n }\n return [...groups].map(([name, members]) => ({ name, results: members }))\n }\n\n /**\n * A remote answer as groups: Fomantic's `{ results }` (a list, or categories as a list or a keyed object), or a\n * bare list. A plain list is ONE unnamed group, capped at `maxResults` (`0`: no cap).\n * - Anything else (no `results`, not an object) is no results.\n * - STATIC: pure, needs no matcher (a remote answer is already matched).\n */\n static groupsFor(response: UIT.SearchResponse | undefined, maxResults = 0): UIT.SearchCategory[] {\n const results = Array.isArray(response) ? response : (response as { results?: unknown } | undefined)?.results\n if (!results || typeof results !== \"object\") return []\n const list = (Array.isArray(results) ? results : Object.values(results)) as unknown[]\n if (list.length && list.every(SearchMatcher.isCategory)) {\n return (list as UIT.SearchCategory[]).filter((category) => category.results.length)\n }\n const plain = (list as UIT.SearchResult[]).filter((result) => result && typeof result === \"object\")\n return [{ name: \"\", results: maxResults > 0 ? plain.slice(0, maxResults) : plain }]\n }\n\n ////////////////\n // ## Internals\n ////////////////\n\n /** Folded texts of `result`'s searchable fields, in field order. */\n private texts(result: UIT.SearchResult): string[] {\n const texts: string[] = []\n for (const field of this.fields) {\n const value = result[field]\n if (typeof value === \"string\" || typeof value === \"number\") texts.push(this.fold(String(value)))\n }\n return texts\n }\n\n /** `text` compared the configured way: diacritics stripped, lower-cased. */\n private fold(text: string): string {\n const plain = this.ignoreDiacritics ? E.withoutAccents(text) : text\n return this.ignoreCase ? plain.toLowerCase() : plain\n }\n\n /**\n * Is `value` a `{ name, results: [] }` category?\n * - STATIC: pure, an `every()` predicate.\n */\n private static isCategory(value: unknown): value is UIT.SearchCategory {\n return !!value && typeof value === \"object\" && Array.isArray((value as UIT.SearchCategory).results)\n }\n\n /**\n * Fomantic's `fuzzySearch()`: every character of `term` appears in `text`, in order; a term as long as the\n * text must equal it.\n * - STATIC: pure.\n */\n private static isFuzzyMatch(term: string, text: string): boolean {\n if (term.length > text.length) return false\n if (term.length === text.length) return term === text\n let position = 0\n for (const char of term) {\n position = text.indexOf(char, position) + 1\n if (!position) return false\n }\n return true\n }\n}\n\n/** Constructor props for `SearchMatcher`, named as Fomantic's search settings; each falls back to its default. */\nexport type SearchMatcherProps = {\n /** fields tried, in order (Fomantic's `searchFields`); default `title`, `description` */\n fields?: readonly string[]\n /** Fomantic's `fullTextSearch`; default `exact` */\n match?: UIT.SearchMatch\n /** Fomantic's `ignoreSearchCase`; default `true` */\n ignoreCase?: boolean\n /** Fomantic's `ignoreDiacritics`; default `false` */\n ignoreDiacritics?: boolean\n}\n\n////////////////\n// ## Constants\n////////////////\n\n/** Fields searched by default. */\nconst DEFAULT_FIELDS = [\"title\", \"description\"]\n","/*\n * The style sheet of `<ui-search>`: a port of Fomantic's `search.less` + `search.variables`.\n * - Adopted after the foundation and AFTER `UIInput.css`: the prompt sits in a real `ui icon input`,\n * and this sheet re-shapes it (Fomantic's round prompt), since `ui.components.search` layers come later.\n * - The shadow markup it expects (class grammar on semantic elements), in this order inside the root:\n *\n * <div class=\"ui [size] [category horizontal fluid scrolling resizable short ...] [left|right aligned]\n * [loading disabled read-only] search\" style=\"anchor-name: --ui-search-4\">\n * <div class=\"ui icon [loading fluid disabled] input\" part=\"input\">\n * <input class=\"prompt\" part=\"prompt\" role=\"combobox\">\n * <span class=\"search icon\" part=\"icon\"><slot name=\"icon\"><svg></slot></span>\n * </div>\n * <div class=\"results\" popover part=\"results\" role=\"listbox\" style=\"position-anchor: --ui-search-4\">\n * <a|div class=\"[active] result\" role=\"option\" part=\"result\">\n * <div class=\"image\"><img></div>\n * <div class=\"content\"><div class=\"price\"> <div class=\"title\"> <div class=\"description\"></div>\n * </a|div>\n * <div class=\"[active] category\" role=\"group\" part=\"category\"> (category: in place of results)\n * <div class=\"name\" part=\"name\"> <div class=\"results\" role=\"none\"> result ... </div>\n * </div>\n * <div class=\"empty|error message\" part=\"message\"><div class=\"header\"> <div class=\"description\"></div>\n * </div>\n * <span class=\"status\" role=\"status\">3 results available.</span> (visually hidden)\n * </div>\n *\n * - `active` on a result === the keyboard-HIGHLIGHTED one (Fomantic's meaning), also `[aria-selected=\"true\"]`.\n * - Positioning: POPOVER + ANCHOR, no JS (as the dropdown's menu).\n * - the anchor's name, and the results hung from it: inline, per element (the component's `PopoverPanel`)\n * - root: `anchor-scope: all`\n * - `.results[popover]`: below, flipping (`flip-block, flip-inline`); `right aligned` extends to the start\n * - a `.results` WITHOUT `popover` is Fomantic's `top: 100%` box, shown with `visible` (static examples)\n * - The `:state()`s the component sets: `:state(fluid)` (a block-level DOM element),\n * plus `open` / `disabled` / `loading` / `invalid` for PAGE styling only -- this sheet keys on the root's classes.\n * - Public tokens (`--ui-search-*`, the theming surface) are NEVER declared here:\n * the token block reads each through a private alias, and every rule reads the alias:\n * `--_ui-search-results-radius: var(--ui-search-results-radius, var(--ui-radius))`.\n * So a value set on `:root`, an ancestor, the DOM element, `::part(input)` / `::part(results)`\n * or in the app stylesheet reaches the box (`notes/theming.md` \"Component tokens\").\n * - Cross-family, on purpose: the prompt sets the nested input's PUBLIC `--ui-input-radius`\n * (from `--ui-search-prompt-radius`), as a page would.\n * - NOTE: left out, on purpose:\n * - the \"view all results\" `.action` link of a remote answer: a link inside a listbox; put one near the search\n * - the `clearable` variation (`.remove.icon`, the webkit cancel button): Escape clears\n * - Scrolling heights stay Fomantic's per-breakpoint result counts (4 / 6 / 8 / 12), by viewport `@media`\n * (`--_search-results-rows`), as the DEFAULT of one token, `--ui-search-results-max-height`:\n * a value set from outside wins at every width.\n */\n\n@layer ui.components.search.types, ui.components.search.content, ui.components.search.variations, ui.components.search.states;\n\n/* Breakpoints (`@custom-media`), inlined at build time: the scrolling result counts and the phone width. */\n@import \"../../styles/media.css\";\n\n/* Loader spin, for a `loading` search whose input isn't marked `loading` itself (static markup). */\n@keyframes ui-search-spin {\n to {\n rotate: 1turn;\n }\n}\n\n/*******************************\n Search\n*******************************/\n\n@layer ui.components.search.types {\n /* The DOM element: layout only; the look lives on the root inside. */\n :host {\n display: inline-block;\n vertical-align: baseline;\n }\n :host(:state(fluid)) {\n display: block;\n }\n /* `delegatesFocus`: the prompt draws the focus, never the DOM element. */\n :host(:focus-visible) {\n outline: none;\n }\n\n /*\n * Tokens: one per `search.variables` entry that still matters, from the global tokens --\n * each the private alias of its public token (never declare the public one: it would block inherited values).\n * - Declared on the root AND on its two parts (the root has no part name),\n * so a value set through `::part(input)` / `::part(results)` reaches the part's own rules.\n */\n .ui.search,\n .ui.search > .ui.input,\n .ui.search > .results {\n --_ui-search-prompt-radius: var(--ui-search-prompt-radius, var(--ui-radius-pill));\n --_ui-search-duration: var(--ui-search-duration, var(--ui-duration-fast));\n --_ui-search-results-width: var(--ui-search-results-width, 18em);\n --_ui-search-results-background: var(--ui-search-results-background, var(--ui-surface));\n --_ui-search-results-color: var(--ui-search-results-color, var(--ui-text-color));\n --_ui-search-results-border-color: var(--ui-search-results-border-color, var(--ui-border-color));\n --_ui-search-results-radius: var(--ui-search-results-radius, var(--ui-radius));\n --_ui-search-results-shadow: var(--ui-search-results-shadow, var(--ui-shadow-floating));\n --_ui-search-results-offset: var(--ui-search-results-offset, 0.5em);\n --_ui-search-result-padding: var(--ui-search-result-padding, 0.85714em 1.14285em);\n --_ui-search-result-line-height: var(--ui-search-result-line-height, 1.33);\n --_ui-search-result-divider-color: var(--ui-search-result-divider-color, var(--ui-border-color-internal));\n --_ui-search-result-background-hover: var(--ui-search-result-background-hover, var(--ui-surface-muted));\n --_ui-search-result-background-active: var(\n --ui-search-result-background-active,\n oklch(from var(--ui-ink) l c h / 0.05)\n );\n --_ui-search-result-image-width: var(--ui-search-result-image-width, 5em);\n --_ui-search-result-image-height: var(--ui-search-result-image-height, 3em);\n --_ui-search-result-image-radius: var(--ui-search-result-image-radius, 0.25em);\n --_ui-search-result-image-margin: var(--ui-search-result-image-margin, 6em);\n --_ui-search-title-color: var(--ui-search-title-color, var(--ui-text-dark));\n --_ui-search-description-color: var(--ui-search-description-color, var(--ui-text-light));\n --_ui-search-description-font-size: var(--ui-search-description-font-size, 0.92857em);\n --_ui-search-price-color: var(--ui-search-price-color, var(--ui-green-text, var(--ui-green)));\n --_ui-search-message-padding: var(--ui-search-message-padding, 1em);\n --_ui-search-category-background: var(--ui-search-category-background, var(--ui-surface-muted));\n --_ui-search-category-results-width: var(--ui-search-category-results-width, 28em);\n --_ui-search-category-name-width: var(--ui-search-category-name-width, 100px);\n --_ui-search-category-name-color: var(--ui-search-category-name-color, var(--ui-text-light));\n --_ui-search-category-name-padding: var(--ui-search-category-name-padding, 0.4em 1em);\n --_ui-search-category-divider-color: var(--ui-search-category-divider-color, var(--ui-border-color-internal));\n --_ui-search-category-result-border-color: var(--ui-search-category-result-border-color, var(--ui-border-color));\n /* Height of the results list; its default grows with the viewport (the result rows below):\n a value set from outside wins at every width. */\n --_ui-search-results-max-height: var(\n --ui-search-results-max-height,\n calc(var(--_search-results-rows) * (2 * 0.85714em + 1.33em))\n );\n --_ui-search-disabled-opacity: var(--ui-search-disabled-opacity, var(--ui-disabled-opacity));\n }\n\n /* Root */\n .ui.search {\n /* Fomantic's scrolling result count, 4 / 6 / 8 / 12 by viewport (`@media` below); the root only, so it inherits */\n --_search-results-rows: 4;\n position: relative;\n box-sizing: border-box;\n display: inline-block;\n max-width: 100%;\n anchor-scope: all;\n font-family: var(--ui-font-family);\n font-size: calc(var(--ui-font-size) * var(--ui-scale, 1));\n text-align: start;\n }\n\n /* Prompt: Fomantic's round input. */\n .ui.search > .ui.input {\n --ui-input-radius: var(--_ui-search-prompt-radius);\n display: flex;\n }\n .ui.search > .ui.input > .prompt {\n margin: 0;\n font-style: normal;\n text-shadow: none;\n transition-property: background-color, color, box-shadow, border-color;\n }\n .ui.search .prompt ~ .search.icon {\n cursor: var(--ui-control-cursor);\n }\n\n /* Results: hidden until open; a popover in the top layer, anchored to the root. */\n .ui.search > .results {\n position: absolute;\n top: 100%;\n inset-inline-start: 0;\n z-index: var(--ui-z-dropdown);\n box-sizing: border-box;\n display: none;\n width: var(--_ui-search-results-width);\n margin: var(--_ui-search-results-offset) 0 0;\n padding: 0;\n overflow: visible;\n border: var(--ui-border-width) solid var(--_ui-search-results-border-color);\n border-radius: var(--_ui-search-results-radius);\n outline: none;\n background: var(--_ui-search-results-background);\n box-shadow: var(--_ui-search-results-shadow);\n color: var(--_ui-search-results-color);\n font-size: 1em;\n line-height: normal;\n text-align: start;\n text-transform: none;\n white-space: normal;\n }\n .ui.search > .results[popover] {\n position-area: block-end span-inline-end;\n position-try-fallbacks: flip-block, flip-inline;\n inset: auto;\n margin: var(--_ui-search-results-offset) 0;\n opacity: 0;\n transition-property: opacity, display, overlay;\n transition-duration: var(--_ui-search-duration);\n transition-timing-function: var(--ui-ease);\n transition-behavior: allow-discrete;\n }\n .ui.search > .results > :first-child {\n border-start-start-radius: var(--_ui-search-results-radius);\n border-start-end-radius: var(--_ui-search-results-radius);\n }\n .ui.search > .results > :last-child {\n border-end-start-radius: var(--_ui-search-results-radius);\n border-end-end-radius: var(--_ui-search-results-radius);\n }\n\n /* The live region: heard, not seen. */\n .ui.search > .status {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n}\n\n/*******************************\n Content\n*******************************/\n\n@layer ui.components.search.content {\n /* Result */\n .ui.search > .results .result {\n box-sizing: border-box;\n display: block;\n overflow: hidden;\n padding: var(--_ui-search-result-padding);\n border-bottom: var(--ui-border-width) solid var(--_ui-search-result-divider-color);\n color: var(--_ui-search-results-color);\n font-size: 1em;\n line-height: var(--_ui-search-result-line-height);\n text-decoration: none;\n cursor: var(--ui-control-cursor);\n }\n .ui.search > .results .result:last-child {\n border-bottom: none;\n }\n\n /* Image: at the result's end. */\n .ui.search > .results .result .image {\n float: inline-end;\n width: var(--_ui-search-result-image-width);\n height: var(--_ui-search-result-image-height);\n overflow: hidden;\n border-radius: var(--_ui-search-result-image-radius);\n background: none;\n }\n .ui.search > .results .result .image img {\n display: block;\n width: auto;\n height: 100%;\n }\n .ui.search > .results .result .image + .content {\n margin-inline-end: var(--_ui-search-result-image-margin);\n }\n\n /* Title, description, price */\n .ui.search > .results .result .title {\n margin: 0;\n color: var(--_ui-search-title-color);\n font-family: var(--ui-font-family-heading, var(--ui-font-family));\n font-size: 1em;\n font-weight: var(--ui-font-weight-bold);\n }\n .ui.search > .results .result .description {\n margin-top: 0;\n color: var(--_ui-search-description-color);\n font-size: var(--_ui-search-description-font-size);\n }\n .ui.search > .results .result .price {\n float: inline-end;\n color: var(--_ui-search-price-color);\n }\n .ui.search > .results mark {\n background: var(--ui-highlight);\n color: inherit;\n }\n\n /* Message: no results, or an error. */\n .ui.search > .results > .message {\n padding: var(--_ui-search-message-padding);\n }\n .ui.search > .results > .message .header {\n color: var(--_ui-search-results-color);\n font-family: var(--ui-font-family-heading, var(--ui-font-family));\n font-size: 1em;\n font-weight: var(--ui-font-weight-bold);\n }\n .ui.search > .results > .message .description {\n margin-top: 0.25em;\n color: var(--_ui-search-results-color);\n font-size: 1em;\n }\n .ui.search > .results > .error.message .description {\n color: var(--ui-red-text, var(--ui-red));\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.search.variations {\n /* Category: a table of groups, the name in a cell beside its results. */\n .ui.category.search > .results {\n width: var(--_ui-search-category-results-width);\n }\n .ui.category.search > .results .category {\n display: table-row;\n background: var(--_ui-search-category-background);\n box-shadow: none;\n transition:\n background var(--_ui-search-duration) var(--ui-ease),\n border-color var(--_ui-search-duration) var(--ui-ease);\n }\n .ui.category.search > .results .category:last-child {\n border-bottom: none;\n }\n .ui.category.search > .results .category > .name {\n display: table-cell;\n width: var(--_ui-search-category-name-width);\n padding: var(--_ui-search-category-name-padding);\n overflow: hidden;\n border-bottom: var(--ui-border-width) solid var(--_ui-search-category-divider-color);\n background: transparent;\n color: var(--_ui-search-category-name-color);\n font-family: var(--ui-font-family);\n font-size: 1em;\n font-weight: var(--ui-font-weight-bold);\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .ui.category.search > .results .category > .results {\n display: table-cell;\n border-bottom: var(--ui-border-width) solid var(--_ui-search-category-divider-color);\n border-inline-start: var(--ui-border-width) solid var(--_ui-search-category-result-border-color);\n background: var(--_ui-search-results-background);\n }\n .ui.category.search > .results .category:last-child > :is(.name, .results) {\n border-bottom: none;\n }\n .ui.category.search > .results .category .result {\n padding: var(--_ui-search-result-padding);\n border-bottom: var(--ui-border-width) solid var(--_ui-search-result-divider-color);\n transition:\n background var(--_ui-search-duration) var(--ui-ease),\n border-color var(--_ui-search-duration) var(--ui-ease);\n }\n .ui.category.search > .results .category .result:last-child {\n border-bottom: none;\n }\n .ui.category.search > .results .category:first-child .name + .results > .result:first-child {\n border-start-end-radius: var(--_ui-search-results-radius);\n }\n .ui.category.search > .results .category:last-child .result:last-child {\n border-end-end-radius: var(--_ui-search-results-radius);\n }\n\n /* Horizontal category: each name above its results. */\n .ui.horizontal.category.search > .results .category,\n .ui.horizontal.category.search > .results .category > .name,\n .ui.horizontal.category.search > .results .category > .results {\n display: block;\n }\n .ui.horizontal.category.search > .results .category > .results {\n width: 100%;\n border-inline-start: 0;\n }\n\n /* Scrolling / short / long: the results scroll after a height (4 results on phones, more on larger screens). */\n .ui:is(.scrolling, .short, .long).search > .results {\n overflow: hidden auto;\n overscroll-behavior: contain;\n }\n .ui.scrolling.search > .results,\n .ui.short.search > .results {\n max-height: var(--_ui-search-results-max-height);\n }\n .ui[class*=\"very short\"].search > .results {\n max-height: calc(var(--_ui-search-results-max-height) * 0.75);\n }\n .ui.long.search > .results {\n max-height: calc(var(--_ui-search-results-max-height) * 2);\n }\n .ui[class*=\"very long\"].search > .results {\n max-height: calc(var(--_ui-search-results-max-height) * 3);\n }\n .ui.scrolling.resizable.search > .results {\n height: var(--_ui-search-results-max-height);\n max-height: none;\n resize: vertical;\n }\n @media (--ui-tablet), (--ui-computer) {\n .ui.search {\n --_search-results-rows: 6;\n }\n }\n @media (--ui-computer) {\n .ui.search {\n --_search-results-rows: 8;\n }\n }\n @media (--ui-widescreen) {\n .ui.search {\n --_search-results-rows: 12;\n }\n }\n\n /* Aligned: which edge the results line up with. */\n .ui[class*=\"left aligned\"].search > .results:not([popover]) {\n inset-inline: 0 auto;\n }\n .ui[class*=\"right aligned\"].search > .results:not([popover]) {\n inset-inline: auto 0;\n }\n .ui[class*=\"left aligned\"].search > .results[popover] {\n position-area: block-end span-inline-end;\n }\n .ui[class*=\"right aligned\"].search > .results[popover] {\n position-area: block-end span-inline-start;\n }\n\n /* Fluid: the prompt and the results take the full width. */\n .ui.fluid.search {\n display: block;\n width: 100%;\n }\n .ui.fluid.search > .results {\n width: 100%;\n }\n .ui.fluid.search > .results[popover] {\n width: anchor-size(width);\n }\n\n /* Phones: never wider than the screen. */\n @media (--ui-mobile) {\n .ui.search > .results {\n max-width: calc(100vw - 2em);\n }\n }\n}\n\n/*******************************\n States\n*******************************/\n\n@layer ui.components.search.states {\n /* Open: a popover while `:popover-open`; a plain one with `visible`. */\n .ui.search > .results[popover]:popover-open,\n .ui.search > .visible.results:not([popover]) {\n display: block;\n opacity: 1;\n }\n .ui.category.search > .results[popover]:popover-open,\n .ui.category.search > .visible.results:not([popover]) {\n display: table;\n }\n @starting-style {\n .ui.search > .results[popover]:popover-open {\n opacity: 0;\n }\n }\n\n /* Hover and the keyboard highlight (`active`). */\n .ui.search > .results .result:hover,\n .ui.category.search > .results .category .result:hover {\n background: var(--_ui-search-result-background-hover);\n }\n .ui.category.search > .results .category.active {\n background: var(--_ui-search-result-background-active);\n }\n .ui.category.search > .results .category.active > .name {\n color: var(--_ui-search-results-color);\n }\n .ui.search > .results .result.active,\n .ui.category.search > .results .category .result.active {\n position: relative;\n background: var(--_ui-search-result-background-active);\n box-shadow: none;\n }\n .ui.search > .results .result.active :is(.title, .description) {\n color: var(--_ui-search-title-color);\n }\n\n /* Loading: the icon box becomes a spinner (the element also marks its input `loading`, `UIInput.css`). */\n .ui.loading.search > .ui.input > .icon {\n opacity: 1;\n }\n .ui.loading.search > .ui.input > .icon > * {\n visibility: hidden;\n }\n .ui.loading.search > .ui.input > .icon::before,\n .ui.loading.search > .ui.input > .icon::after {\n content: \"\";\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 50%;\n box-sizing: border-box;\n inline-size: 1.28571em;\n block-size: 1.28571em;\n margin: -0.642855em 0 0 -0.642855em;\n border: 0.2em solid oklch(from var(--ui-ink) l c h / 0.1);\n border-radius: var(--ui-radius-circle);\n }\n .ui.loading.search > .ui.input > .icon::after {\n border-color: var(--ui-text-muted) transparent transparent;\n animation: ui-search-spin 0.6s linear infinite;\n }\n\n /* Disabled: dimmed and inert. */\n .ui.disabled.search {\n cursor: default;\n opacity: var(--_ui-search-disabled-opacity);\n pointer-events: none;\n }\n .ui.disabled.search > .disabled.input {\n opacity: 1;\n }\n\n /* Read-only: shown, not typed in; the arrow, as every control's `read-only`. */\n .ui.read-only.search > .input > input {\n cursor: default;\n }\n}\n","import { For, Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { F } from \"spell/ui/forms\"\nimport { searchVocabulary } from \"./UISearch.en\"\nimport { SearchFallback } from \"./UISearch.fallback\"\nimport { SearchMatcher } from \"./SearchMatcher\"\nimport {\n INPUT,\n PROMPT,\n RemoteStatus,\n SearchMessageKind,\n type RemoteAnswer,\n type SearchMessage,\n type Vocabulary\n} from \"./UISearch.types\"\n\nimport inputCSS from \"spell/ui/components/ui-input/UIInput.css?inline\"\nimport searchCSS from \"./UISearch.css?inline\"\n\n/****************\n * ### `UISearch`\n * The component behind `<ui-search>`: a text field that suggests results as you type\n * (a combobox and its listbox, the APG's \"list autocomplete\").\n *\n * - Its shadow DOM: a text `<input>` in Fomantic's `ui icon input`, and an anchor-positioned popover of results.\n *\n * - The results: the `source` PROPERTY, searched here (`SearchMatcher`, Fomantic's matching),\n * or the `url` template, asked through `UI.api` (`{query}`).\n * - `search-delay` waits for a pause in typing before asking\n * - a newer query cancels an older one\n * - answers are kept per query\n * - `category` groups them\n *\n * - The text SETTLES once typing pauses for `delay` (2s), or at once on Enter, leaving, choosing, clearing:\n * `ui-changed`, once per new text.\n * - A form's binding writes it only then (`settlesItself`), and `parameter` records it in the address:\n * so a plain search field (no `source`, no `url`) asks a page's data once per search, not once per letter.\n * - `value` (the input's text) and `open` are controlled (`@controlled`):\n * the events go first, and a handler may cancel or override.\n * Choosing a result puts its title in the input and follows its `url`.\n * - The rows render only while shown; `aria-activedescendant` points at the highlighted one.\n * - A polite live region announces the result count and messages.\n * - Escape and outside clicks come from `UI.overlays`.\n * - A form control (decided 2026-09-30): Fomantic's search wraps a REAL `<input class=\"prompt\">`,\n * which submits its text under its `name`; so does this one, with `required` => `valueMissing`.\n ****************/\nexport class UISearch extends F.FormComponent<Vocabulary> {\n @E.proto static vocabulary = searchVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { input: inputCSS, search: searchCSS },\n cssStates: [\"fluid\"],\n Fallback: SearchFallback,\n // `loading`: a spinner in its input\n loading: \"its own\"\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## The text\n ////////////////\n\n /** `value`, the input's text: set by the page, or typed in. */\n @E.controlled(\"value\") accessor value: string | undefined = \"\"\n\n /** The input's text, as a string. */\n get query(): string {\n return String(this.value ?? \"\")\n }\n\n /** Is the query long enough to search? */\n get queryIsLongEnough(): boolean {\n return this.isLongEnough(this.query)\n }\n\n /** Is `text`, trimmed, at least `min-characters` long (never under 1)? */\n private isLongEnough(text: string): boolean {\n return text.trim().length >= Math.max(1, this.minCharacters ?? 1)\n }\n\n /** Bumped when the input must show the value again (the page cancelled the typing). */\n @E.state accessor inputRevision = 0\n\n /** The value to restore on a form reset: the page's `value` (its attribute), `undefined` when it has none. */\n private readonly initialValue = this.isControlledByPage(\"value\") ? this.value : undefined\n\n /**\n * The input shows the value: once rendered, and again after the page cancelled typing (`inputRevision`).\n * - A value the page sets, while no typing waits to settle, is the settled one: leaving sends nothing for it,\n * and `parameter` records it in the address (a program's \"try this search\" is a step Back returns from).\n */\n @E.onChange(\"query\", \"inputRevision\", \"isReady\")\n protected onQueryChanged(query: string) {\n if (this.input && this.input.value !== query) this.input.value = query\n if (this.settleTimer) return\n this.settledValue = query\n this.recordPageValue()\n }\n\n /** The page set the text: `parameter` records it, as a settled search. */\n @E.untracked\n private recordPageValue() {\n this.address.record(this.addressPlace)\n }\n\n /** Commit `value` as the input's text, with `ui-changed`; if the page cancels it, the input shows its value. */\n private commit(value: string, originalEvent?: Event) {\n this.cancelSettling()\n this.requestChange(\"value\", value, () => {\n this.send(\"ui-changed\", { value, originalEvent })\n return true\n })\n this.settledValue = value\n this.inputRevision++\n }\n\n ////////////////\n // ## Settling\n ////////////////\n\n /** The text last settled (`ui-changed`): settling the same text again sends nothing. */\n private settledValue = this.query\n\n /** The wait for typing to pause, while one runs. */\n private settleTimer?: E.CancelablePromise<void>\n\n /** Is the value written to a form only as it settles? Yes: a search waits for a pause in typing. */\n get settlesItself(): boolean {\n return true\n }\n\n /** `delay` in ms: a CSS time (`0.5s`, `500ms`) or bare ms; default 2s. Untracked: read as typing happens. */\n @E.untracked\n private get delayMs(): number {\n return UISearch.msFor(this.delay ?? DEFAULT_DELAY)\n }\n\n /** Typed: settle once typing pauses for `delay`; at once with no delay, or an emptied input. */\n private settleAfterPause(originalEvent: Event) {\n this.cancelSettling()\n const delay = this.delayMs\n if (delay <= 0 || !this.query) return this.settle(originalEvent)\n this.settleTimer = E.after(delay / 1000, () => {\n this.settleTimer = undefined\n this.settle(originalEvent)\n })\n }\n\n /** Settle the text now: `ui-changed`, unless it's the text last settled. */\n @E.untracked\n settle(originalEvent?: Event) {\n this.cancelSettling()\n const value = this.query\n if (value === this.settledValue) return\n this.settledValue = value\n this.send(\"ui-changed\", { value, originalEvent })\n }\n\n /** Stop waiting to settle. */\n private cancelSettling() {\n this.settleTimer?.cancel()\n this.settleTimer = undefined\n }\n\n /** Leaving the page: no wait outlives it. */\n @E.whileConnected\n protected stopSettlingOnDisconnect() {\n return () => this.cancelSettling()\n }\n\n ////////////////\n // ## Results\n ////////////////\n\n /** Local matcher, from the matching attributes. */\n @E.derived\n get matcher(): SearchMatcher {\n const fields = this.searchFields\n return new SearchMatcher({\n fields: fields === undefined ? undefined : E.Converters.list(fields),\n match: this.fullTextSearch as UIT.SearchMatch | undefined,\n ignoreDiacritics: this.ignoreDiacritics\n })\n }\n\n /** Local results of the query, grouped. */\n @E.derived\n get localGroups(): readonly UIT.SearchCategory[] {\n const source = this.source\n if (!Array.isArray(source) || !this.queryIsLongEnough) return []\n const max = this.maxResults ?? 0\n let results = this.matcher.search(source as UIT.SearchResult[], this.query)\n if (max > 0) results = results.slice(0, max)\n return this.category ? SearchMatcher.categorize(results) : [{ name: \"\", results }]\n }\n\n /** The last remote answer. */\n @E.state accessor remoteAnswer: RemoteAnswer = { query: \"\", groups: [], status: RemoteStatus.idle }\n\n /** The remote query running now (aborts it), if any. */\n @E.state accessor runningQuery: AbortController | undefined = undefined\n\n /** Is a remote query running? */\n get isFetching(): boolean {\n return this.runningQuery !== undefined\n }\n\n /** Remote answers by query. */\n private readonly answersByQuery = new Map<string, readonly UIT.SearchCategory[]>()\n\n /** Results shown now, grouped: the last remote answer, or the local ones. */\n get groups(): readonly UIT.SearchCategory[] {\n if (!this.url) return this.localGroups\n return this.queryIsLongEnough ? this.remoteAnswer.groups : []\n }\n\n /** Every shown result, in order: what the arrows move through. */\n @E.derived\n get shownResults(): readonly UIT.SearchResult[] {\n return this.groups.flatMap((group) => group.results)\n }\n\n /** What to say instead of results, if anything. */\n @E.derived\n get message(): SearchMessage | undefined {\n if (!this.queryIsLongEnough || this.shownResults.length) return undefined\n const remote = this.remoteAnswer\n const isCurrent = !this.url || (remote.query === this.query.trim() && !this.isFetching)\n if (!isCurrent) return undefined\n if (this.url && remote.status === RemoteStatus.error) {\n return { kind: SearchMessageKind.error, text: this.translationForKey(\"searchServerError\") }\n }\n if (this.url && remote.status !== RemoteStatus.done) return undefined\n if (this.showNoResults === false) return undefined\n return {\n kind: SearchMessageKind.empty,\n header: this.translationForKey(\"searchNoResultsHeader\"),\n text: this.translationForKey(\"searchNoResults\")\n }\n }\n\n /** Run the query in `text` (typed, or on focus): open, and ask the server when there's a `url`. */\n private runQuery(text: string, originalEvent?: Event) {\n if (!this.isLongEnough(text)) return\n this.requestOpen(true, originalEvent)\n if (this.url) this.fetch(text.trim())\n }\n\n /** Run the query already in the input, as `originalEvent` asked (a click, ArrowDown). */\n @E.untracked\n private rerunQuery(originalEvent: Event) {\n this.runQuery(this.query, originalEvent)\n }\n\n /**\n * Ask the `url` for `query`'s results through `UI.api`:\n * debounced by `search-delay`, the previous query aborted, the answer cached per query.\n * - An aborted query is ignored; a failed one shows `searchServerError`.\n */\n private fetch(query: string) {\n const url = this.url!\n const cached = this.answersByQuery.get(query)\n this.runningQuery?.abort()\n if (cached) {\n this.runningQuery = undefined\n this.remoteAnswer = { query, groups: cached, status: RemoteStatus.done }\n return\n }\n const running = (this.runningQuery = new AbortController())\n const max = this.maxResults ?? 0\n UI.api\n .request<UIT.SearchResponse>({\n url,\n urlData: { query },\n throttle: this.searchDelay ?? 0,\n key: this.ids.results,\n signal: running.signal\n })\n .then((response) => {\n const groups = SearchMatcher.groupsFor(response, max)\n this.answersByQuery.set(query, groups)\n // superseded while the answer was on its way (a transport that ignores the signal still delivers it):\n // cached, not shown\n if (running.signal.aborted) return\n this.remoteAnswer = { query, groups, status: RemoteStatus.done }\n this.send(\"ui-replied\", { query, results: groups.flatMap((group) => group.results) })\n })\n .catch((error: unknown) => {\n if (running.signal.aborted || (error as Error)?.name === \"AbortError\") return\n this.remoteAnswer = { query, groups: [], status: RemoteStatus.error }\n })\n .finally(() => {\n if (this.runningQuery === running) this.runningQuery = undefined\n })\n }\n\n ////////////////\n // ## Highlight\n ////////////////\n\n /** The highlighted result of `shownResults`. */\n readonly highlighted = new F.HighlightedOption(() => this.shownResults)\n\n /** Highlighted result. */\n get highlightedResult(): UIT.SearchResult | undefined {\n return this.highlighted.option\n }\n\n /** A newly highlighted result scrolls into view, while results show. */\n @E.onChange(\"resultsAreShowing\", \"highlightedResult\")\n protected onHighlightChanged(resultsAreShowing: boolean, result: UIT.SearchResult | undefined) {\n if (resultsAreShowing && result)\n this.domElement.renderRoot.getElementById(this.idFor(result))?.scrollIntoView({ block: \"nearest\" })\n }\n\n ////////////////\n // ## Open\n ////////////////\n\n /** `open`, asked to show results: set by the page, or by typing. */\n @E.controlled(\"open\") accessor isOpen = false\n\n /** Results (or a message) are showing: `:state(open)` follows SHOWING results, not `open`. */\n @E.cssState(\"open\")\n get resultsAreShowing(): boolean {\n return this.isOpen && this.queryIsLongEnough && (!!this.shownResults.length || !!this.message)\n }\n\n /**\n * The results, a popover panel on `isOpen`: `ui-opening` / `ui-closing`, the overlay entry, the anchor.\n * - Never opens while disabled or readonly; opening highlights the first result (`select-first-result`) or none.\n */\n readonly popover = new E.PopoverPanel({\n component: this,\n member: \"isOpen\",\n restoreFocus: false,\n canChange: (open) => !open || !(this.isDisabled || this.isReadOnly),\n onChange: (open) => {\n if (open) this.highlighted.index = this.selectFirstResult ? 0 : -1\n }\n })\n\n /** Show the popover and open the overlay entry while results show in the page; undone when they stop. */\n @E.onChange(\"resultsAreShowing\", \"isConnected\")\n protected onPopoverChanged(resultsAreShowing: boolean, isConnected: boolean) {\n return this.popover.follow(this.resultsBox, resultsAreShowing && isConnected)\n }\n\n /**\n * Show or hide the results as a person would (`popover.request()`); true when it changed.\n * - Not `open()` / `close()`: `open` is the attribute's.\n */\n requestOpen(open: boolean, originalEvent?: Event): boolean {\n return this.popover.request(open, originalEvent)\n }\n\n /**\n * Choose `result`, as someone did with `originalEvent`:\n * the cancelable `ui-select` first, then its title in the input (`ui-changed`), the results hidden,\n * and its `url` followed.\n * - A click on a result LINK follows it natively (new tabs work);\n * other ways follow it with `location.assign()`, the DOM element's own document's.\n */\n select(result: UIT.SearchResult, originalEvent?: Event) {\n if (!this.send(\"ui-choosing\", { result, originalEvent })) {\n originalEvent?.preventDefault()\n return\n }\n this.commit(String(result.title ?? \"\"), originalEvent)\n this.requestOpen(false, originalEvent)\n const url = typeof result.url === \"string\" ? result.url : undefined\n if (url && originalEvent?.type !== \"click\") this.domElement.ownerDocument.location.assign(url)\n }\n\n ////////////////\n // ## Busy\n ////////////////\n\n /** Busy: the `loading` attribute, or a remote query running. */\n @E.cssState(\"loading\")\n get isLoading(): boolean {\n return this.loading || this.isFetching\n }\n\n /** The `loading` class: also by a running remote query. */\n protected classValue(name: E.AttributeName<Vocabulary>): unknown {\n if (name === \"loading\") return this.isLoading\n return super.classValue(name)\n }\n\n ////////////////\n // ## Name\n ////////////////\n\n /** Name for the input: its `<label>`s / `aria-label` (`labels`), else `placeholder`, else the translated `label`. */\n private get label(): string {\n return this.labels.accessibleName ?? this.placeholder ?? this.translationForKey(\"searchLabel\")\n }\n\n ////////////////\n // ## Form\n ////////////////\n\n get formValue(): E.FieldValue {\n return this.query\n }\n\n /** Back to the `value` attribute; the input shows it, nothing is highlighted. */\n onFormReset() {\n this.cancelSettling()\n this.value = this.initialValue\n this.settledValue = this.query\n this.inputRevision++\n this.highlighted.clear()\n }\n\n /**\n * The label in validation messages.\n * - Only once `isReady`: `label` may fall back to a translated text,\n * and validation can run before the runtime arrives\n * (seen on the docs kitchen sink: `UI.i18n ... isn't loaded yet`).\n * - Tracked, so it recomputes.\n */\n protected get validationLabel(): string | undefined {\n return this.isReady ? this.label : undefined\n }\n\n protected get validationAnchor(): HTMLElement | undefined {\n return this.input\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** The magnifying glass. */\n readonly iconGlyph = new E.IconGlyph({ owner: this, name: () => SEARCH_ICON })\n\n /** Match highlighting (`MenuOptions.highlights()`). */\n private readonly highlighter = new F.MenuOptions()\n\n /** Stable DOM id per result. */\n private readonly resultIds = new WeakMap<UIT.SearchResult, string>()\n\n /** Ids, from `UI.ids` once rendering. */\n private ids = { results: \"\" }\n\n /** The text input. */\n private input?: HTMLInputElement\n\n /** The text the input is drawn with (a server render's too); untracked: `onQueryChanged()` keeps it in step. */\n @E.untracked\n private get startingQuery(): string {\n return this.query\n }\n\n /** The results popover. */\n private resultsBox?: HTMLElement\n\n render(): JSX.Element {\n this.ids = { results: UI.ids.next(ID_PREFIX) }\n return (\n <div class={this.rootClass} part={this.partForName(\"search\")} style={this.popover.anchorStyle}>\n <div\n class={[INPUT, { [LOADING]: this.isLoading, [UIT.FLUID]: this.fluid, [UIT.DISABLED]: this.isDisabled }]}\n part={this.partForName(\"input\")}\n >\n <input\n ref={(element) => (this.input = element)}\n class={PROMPT}\n part={this.partForName(\"prompt\")}\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck={false}\n enterkeyhint=\"search\"\n value={this.startingQuery}\n placeholder={this.placeholder}\n disabled={this.isDisabled}\n readonly={this.isReadOnly}\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-expanded={this.resultsAreShowing && this.shownResults.length ? \"true\" : \"false\"}\n aria-controls={this.ids.results}\n aria-activedescendant={\n this.resultsAreShowing && this.highlightedResult ? this.idFor(this.highlightedResult) : undefined\n }\n aria-label={this.label}\n aria-busy={this.isLoading ? \"true\" : undefined}\n aria-required={this.required ? \"true\" : undefined}\n aria-invalid={this.validation.valid ? undefined : \"true\"}\n {...this.staticControl}\n onInput={this.onInput}\n onKeyDown={this.onKeyDown}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.onClick}\n />\n <span class={SEARCH_ICON_CLASS} part={this.partForName(\"icon\")}>\n <slot name={this.slotForName(\"icon\")}>{this.iconGlyph.svg}</slot>\n </span>\n </div>\n {this.results()}\n <span class=\"status\" role=\"status\">\n {this.statusText}\n </span>\n </div>\n )\n }\n\n /**\n * Server render only (`spell/ui/static`): the input's `name` (it holds the query, the value)\n * and the `STATIC_CONTROL` mark, so a static form submits it.\n * - `{}` in a browser, where the DOM element submits (`ElementInternals`).\n */\n private get staticControl(): Record<string, unknown> {\n return isServer ? { [UIT.STATIC_CONTROL]: \"\", name: this.name } : {}\n }\n\n /** The results popover: a listbox while there are results, else the message. */\n private results(): JSX.Element {\n return (\n <div\n ref={(element) => (this.resultsBox = element)}\n id={this.ids.results}\n class={RESULTS}\n style={this.popover.panelStyle}\n popover=\"manual\"\n part={this.partForName(\"results\")}\n role={this.shownResults.length ? \"listbox\" : undefined}\n aria-label={this.shownResults.length ? this.label : undefined}\n onMouseDown={UISearch.preventDefault}\n >\n <Show when={this.resultsAreShowing}>\n <Show when={this.shownResults.length} fallback={this.messageBox()}>\n <Show when={this.category} fallback={<For each={this.shownResults}>{(result) => this.row(result)}</For>}>\n <For each={this.groups}>{(group, index) => this.resultCategory(group, index)}</For>\n </Show>\n </Show>\n </Show>\n </div>\n )\n }\n\n /**\n * One category: its name, then its results, as a named `group`.\n * - Not `category()`: `category` is the attribute's.\n */\n private resultCategory(group: UIT.SearchCategory, index: () => number): JSX.Element {\n // a function: `index` is `<For>`'s accessor, so it's read in JSX (tracked), never in the callback body\n const nameId = () => `${this.ids.results}${CATEGORY_ID_INFIX}${index()}`\n return (\n <div\n class={[CATEGORY, { [UIT.ACTIVE]: group.results.includes(this.highlightedResult!) }]}\n role=\"group\"\n aria-labelledby={nameId()}\n part={this.partForName(\"category\")}\n >\n <div id={nameId()} class={NAME} part={this.partForName(\"name\")}>\n {group.name}\n </div>\n <div class={RESULTS} role=\"none\">\n <For each={group.results}>{(result) => this.row(result)}</For>\n </div>\n </div>\n )\n }\n\n /**\n * One result: a link when it has a `url`, else a `<div>`.\n * - The link: Fomantic's `<a class=\"result\">`, `tabindex=-1`, so focus stays in the input.\n */\n private row(result: UIT.SearchResult): JSX.Element {\n const url = typeof result.url === \"string\" && result.url ? result.url : undefined\n const classes = () => [RESULT, { [UIT.ACTIVE]: this.highlightedResult === result }]\n const selected = () => (this.highlightedResult === result ? \"true\" : \"false\")\n const onPointerMove = () => this.highlighted.highlight(result)\n const onClick = (event: MouseEvent) => this.select(result, event)\n if (url) {\n return (\n <a\n id={this.idFor(result)}\n class={classes()}\n href={url}\n tabindex=\"-1\"\n role=\"option\"\n part={this.partForName(\"result\")}\n aria-selected={selected()}\n onPointerMove={onPointerMove}\n onClick={onClick}\n >\n {this.resultContent(result)}\n </a>\n )\n }\n return (\n <div\n id={this.idFor(result)}\n class={classes()}\n role=\"option\"\n part={this.partForName(\"result\")}\n aria-selected={selected()}\n onPointerMove={onPointerMove}\n onClick={onClick}\n >\n {this.resultContent(result)}\n </div>\n )\n }\n\n /** Image, price, title, description: Fomantic's result template. */\n private resultContent(result: UIT.SearchResult): JSX.Element {\n return (\n <>\n <Show when={typeof result.image === \"string\"}>\n <div class={UIT.IMAGE}>\n <img src={result.image as string} alt={typeof result.alt === \"string\" ? result.alt : \"\"} />\n </div>\n </Show>\n <div class={UIT.CONTENT}>\n <Show when={result.price !== undefined && result.price !== null}>\n <div class={PRICE}>{String(result.price)}</div>\n </Show>\n <div class={UIT.TITLE}>{this.markedText(String(result.title ?? \"\"))}</div>\n <Show when={result.description}>\n <div class={UIT.DESCRIPTION}>{this.markedText(String(result.description))}</div>\n </Show>\n </div>\n </>\n )\n }\n\n /** The no-results or error message. */\n private messageBox(): JSX.Element {\n return (\n <Show when={this.message}>\n {(message) => (\n <div class={[UIT.MESSAGE, message().kind]} part={this.partForName(\"message\")}>\n <Show when={message().header}>\n <div class={UIT.HEADER}>{message().header}</div>\n </Show>\n <div class={UIT.DESCRIPTION}>{message().text}</div>\n </div>\n )}\n </Show>\n )\n }\n\n /** `text` with the query in `<mark>`, when `highlight-matches`. */\n private markedText(text: string): JSX.Element {\n const query = this.query.trim()\n if (!this.highlightMatches || !query) return text\n const ranges = this.highlighter.highlights({ value: \"\", text }, query, {\n ignoreDiacritics: this.ignoreDiacritics\n })\n return E.markedPieces(text, ranges).map((piece) => (piece.isMarked ? <mark>{piece.text}</mark> : piece.text))\n }\n\n /** What the live region says: the result count, or the message. */\n private get statusText(): string {\n if (!this.resultsAreShowing) return \"\"\n const count = this.shownResults.length\n if (count === 1) return this.translationForKey(\"searchOneResult\")\n if (count) return this.translationForKey(\"searchResultCount\", { count })\n return this.message?.text ?? \"\"\n }\n\n /** Stable id for `result`'s row. */\n private idFor(result: UIT.SearchResult): string {\n let id = this.resultIds.get(result)\n if (!id) this.resultIds.set(result, (id = `${this.ids.results}-${++UISearch.resultCounter}`))\n return id\n }\n\n ////////////////\n // ## Handlers\n ////////////////\n\n /** Typing: the value (with `ui-searched` once long enough), then the query. */\n private readonly onInput = (event: Event) => {\n const text = (event.currentTarget as HTMLInputElement).value\n const isLong = this.isLongEnough(text)\n this.requestChange(\"value\", text, () => {\n if (isLong) this.send(\"ui-searched\", { query: text.trim(), originalEvent: event })\n return true\n })\n this.inputRevision++\n this.highlighted.index = this.selectFirstResult ? 0 : -1\n this.runQuery(text, event)\n this.settleAfterPause(event)\n }\n\n /** Focus: show the results of what's there (Fomantic's `searchOnFocus`). */\n private readonly onFocus = (event: FocusEvent) => {\n this.runQuery(this.query, event)\n }\n\n /** A click in the input reopens results someone closed. */\n @E.untracked\n private readonly onClick = (event: MouseEvent) => {\n if (!this.isOpen) this.rerunQuery(event)\n }\n\n /** Leaving: close (unless focus stays inside); an edited text settles at once. */\n @E.untracked\n private readonly onBlur = (event: FocusEvent) => {\n const next = event.relatedTarget as Node | null\n if (next && (this.domElement.contains(next) || this.domElement.renderRoot.contains(next))) return\n this.requestOpen(false, event)\n this.settle(event)\n }\n\n /** Combobox keys: arrows move, Enter chooses, Escape clears a closed search (an open one closes, overlays). */\n @E.untracked\n private readonly onKeyDown = (event: KeyboardEvent) => {\n if (this.isDisabled || event.defaultPrevented || event.isComposing) return\n const isShowing = this.resultsAreShowing\n switch (event.key) {\n case UIT.Key.arrowDown:\n event.preventDefault()\n if (isShowing) this.highlighted.move(1)\n else this.rerunQuery(event)\n return\n case UIT.Key.arrowUp:\n if (!isShowing) return\n event.preventDefault()\n this.highlighted.move(-1)\n return\n case UIT.Key.enter: {\n const result = isShowing ? this.highlightedResult : undefined\n if (result) {\n event.preventDefault()\n this.select(result, event)\n return\n }\n this.settle(event)\n this.domElement.form?.requestSubmit()\n return\n }\n case UIT.Key.escape:\n // showing: `UI.overlays` closes it; else Escape clears (APG)\n if (isShowing || !this.query) return\n event.preventDefault()\n this.requestOpen(false, event)\n this.commit(\"\", event)\n return\n case UIT.Key.tab:\n if (this.isOpen) this.requestOpen(false, event)\n return\n }\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /**\n * Counter behind result ids.\n * - STATIC: page-wide, so two searches never share an id (results of the same `source` are the same objects).\n */\n private static resultCounter = 0\n\n /**\n * `text` as ms: `\"0.5s\"` => 500, `\"500ms\"` and bare `\"500\"` => 500; unreadable => `DEFAULT_DELAY`'s.\n * - Static: reads only its argument.\n */\n static msFor(text: string): number {\n const time = text.trim()\n const value = Number.parseFloat(time)\n if (Number.isNaN(value)) return UISearch.msFor(DEFAULT_DELAY)\n return /\\ds$/.test(time) ? value * 1000 : value\n }\n\n /**\n * `preventDefault()`: presses in the results must not take focus from the input.\n * - STATIC: one handler for every instance.\n */\n private static preventDefault(event: Event) {\n event.preventDefault()\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UISearch extends E.AttributeValues<Vocabulary> {}\n\n////////////////\n// ## Constants\n////////////////\n\n/** How long typing must pause before the text settles, when `delay` doesn't say (Owen, 2026-11-07). */\nconst DEFAULT_DELAY = \"2s\"\n\n/** `UI.ids` prefix. */\nconst ID_PREFIX = \"ui-search\"\n\n/** Infix of a category name's id, between the results id and the category's index. */\nconst CATEGORY_ID_INFIX = \"-category-\"\n\n/** The input's icon: FA's magnifying glass. */\nconst SEARCH_ICON = \"magnifying-glass\"\n\n/**\n * Class word of the input box while busy.\n * - Class words are the markup contract (`UISearch.css`) -- grammar, not attributes, so not in the vocabulary.\n * - NOTE: `active` (`UIT.ACTIVE`) === the HIGHLIGHTED result (and its category): Fomantic's meaning.\n */\nconst LOADING = \"loading\"\n\n/** Class words of the icon box. */\nconst SEARCH_ICON_CLASS = \"search icon\"\n\n/** Class word of the results popover, and of a category's results. */\nconst RESULTS = \"results\"\n\n/** Class word of each result. */\nconst RESULT = \"result\"\n\n/** Class word of each category. */\nconst CATEGORY = \"category\"\n\n/** Class word of a category's name. */\nconst NAME = \"name\"\n\n/** Class word of a result's price. */\nconst PRICE = \"price\"\n","/**\n * The search family: defines `<ui-search>`, and exports its component.\n * - Also the `search` lib entry (`spell/ui/ui-search`), measured in `notes/report.md`.\n * - SIDE EFFECT: importing it defines the tag.\n * - Exports `SearchMatcher` too: Fomantic's local matching, pure data, usable on its own.\n */\n\nimport { UISearch } from \"./UISearch\"\nimport { SearchMatcher } from \"./SearchMatcher\"\n\nUISearch.define()\n\nexport { SearchMatcher, UISearch }\n"],"mappings":";;;;;;;AAoBA,IAAa+H,IAAmB;CAC9B,KAAK;C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,aAAa;EAAiC;EAC1F;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GAAE,GAAAA,EAA6B;GAAM,aAAa;EAA8C;EACtEA,EAAA;EAC1B;GAAE,GAAAA,EAA6B;GAAU,aAAa;EAA8C;EACpG;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aACE;EAGJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQxG;GACR,SAAAyH,EAAyB;GACzB,aACE;EAEJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA;GAAE,MAAM;GAAqB,OAAO;GAAY,MAAM;GAAW,aAAa;EAA2B;EACzG;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aACE;EACJ;CACF;CACA,QAAQ;EACN;GACE,MAAM;GACN,QAAQ;GACR,aAAa;EACf;EACA;GACE,MAAM;GACN,QAAQ;GACR,YAAY;GACZ,aAAa;EACf;EACA;GACE,MAAM;GACN,QAAQ;GACR,aACE;EAEJ;EACA;GACE,MAAM;GACN,QAAQ;GACR,aAAa;EACf;EACA;GACE,MAAM;GACN,QAAQ;GACR,YAAY;GACZ,aAAa;EACf;EACA;GACE,MAAM;GACN,QAAQ;GACR,YAAY;G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