shoelace-rails-ui 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (332) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/CHANGELOG.md +5 -0
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/Gemfile +12 -0
  6. data/Gemfile.lock +42 -0
  7. data/LICENSE.txt +21 -0
  8. data/README-real.md +24 -0
  9. data/README.md +43 -0
  10. data/Rakefile +16 -0
  11. data/bin/console +15 -0
  12. data/bin/setup +8 -0
  13. data/lib/shoelace/rails/ui/version.rb +9 -0
  14. data/lib/shoelace/rails/ui.rb +12 -0
  15. data/regenerate.rb +48 -0
  16. data/remote-src/.DS_Store +0 -0
  17. data/remote-src/2.0.0.beta64/.DS_Store +0 -0
  18. data/remote-src/2.0.0.beta64/shoelace-next/.editorconfig +15 -0
  19. data/remote-src/2.0.0.beta64/shoelace-next/.github/CODE_OF_CONDUCT.md +44 -0
  20. data/remote-src/2.0.0.beta64/shoelace-next/.github/FUNDING.yml +1 -0
  21. data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/bug_report.md +36 -0
  22. data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/config.yml +4 -0
  23. data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
  24. data/remote-src/2.0.0.beta64/shoelace-next/.github/SECURITY.md +7 -0
  25. data/remote-src/2.0.0.beta64/shoelace-next/.github/workflows/node.js.yml +30 -0
  26. data/remote-src/2.0.0.beta64/shoelace-next/.github/workflows/release.yml +17 -0
  27. data/remote-src/2.0.0.beta64/shoelace-next/.gitignore +8 -0
  28. data/remote-src/2.0.0.beta64/shoelace-next/.husky/pre-commit +4 -0
  29. data/remote-src/2.0.0.beta64/shoelace-next/.prettierignore +12 -0
  30. data/remote-src/2.0.0.beta64/shoelace-next/.vscode/extensions.json +9 -0
  31. data/remote-src/2.0.0.beta64/shoelace-next/.vscode/settings.json +4 -0
  32. data/remote-src/2.0.0.beta64/shoelace-next/CONTRIBUTING.md +5 -0
  33. data/remote-src/2.0.0.beta64/shoelace-next/LICENSE.md +7 -0
  34. data/remote-src/2.0.0.beta64/shoelace-next/README.md +94 -0
  35. data/remote-src/2.0.0.beta64/shoelace-next/cspell.json +110 -0
  36. data/remote-src/2.0.0.beta64/shoelace-next/custom-elements-manifest.config.js +104 -0
  37. data/remote-src/2.0.0.beta64/shoelace-next/docs/404.md +5 -0
  38. data/remote-src/2.0.0.beta64/shoelace-next/docs/_sidebar.md +89 -0
  39. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/icons/sprite.svg +1 -0
  40. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/chrome.png +0 -0
  41. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/edge.png +0 -0
  42. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/firefox.png +0 -0
  43. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/logo.svg +7 -0
  44. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/og-image.png +0 -0
  45. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/opera.png +0 -0
  46. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/safari.png +0 -0
  47. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/shoe.svg +134 -0
  48. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/tie.webp +0 -0
  49. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/touch-icon.png +0 -0
  50. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/twitter-card.png +0 -0
  51. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/undraw-content-team.svg +80 -0
  52. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/undraw-not-found.svg +1 -0
  53. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/walk.gif +0 -0
  54. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/wordmark.svg +7 -0
  55. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/code-block/code-block.css +228 -0
  56. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/code-block/code-block.js +376 -0
  57. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/metadata/metadata.js +537 -0
  58. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/scroll-position/scroll-position.js +24 -0
  59. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/lunr.min.js +1311 -0
  60. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/search.css +180 -0
  61. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/search.js +293 -0
  62. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/theme-picker/theme-picker.css +29 -0
  63. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/theme-picker/theme-picker.js +83 -0
  64. data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/styles/docs.css +642 -0
  65. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/alert.md +441 -0
  66. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/animated-image.md +128 -0
  67. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/animation.md +351 -0
  68. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/avatar.md +201 -0
  69. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/badge.md +191 -0
  70. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/breadcrumb-item.md +35 -0
  71. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/breadcrumb.md +266 -0
  72. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/button-group.md +470 -0
  73. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/button.md +453 -0
  74. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/card.md +311 -0
  75. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/checkbox.md +71 -0
  76. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/color-picker.md +101 -0
  77. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/details.md +89 -0
  78. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/dialog.md +265 -0
  79. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/divider.md +152 -0
  80. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/drawer.md +452 -0
  81. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/dropdown.md +389 -0
  82. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-bytes.md +126 -0
  83. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-date.md +120 -0
  84. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-number.md +124 -0
  85. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/icon-button.md +160 -0
  86. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/icon.md +711 -0
  87. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/image-comparer.md +51 -0
  88. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/include.md +47 -0
  89. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/input.md +283 -0
  90. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu-item.md +255 -0
  91. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu-label.md +52 -0
  92. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu.md +49 -0
  93. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/mutation-observer.md +196 -0
  94. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/progress-bar.md +144 -0
  95. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/progress-ring.md +178 -0
  96. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/qr-code.md +167 -0
  97. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/radio-group.md +52 -0
  98. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/radio.md +59 -0
  99. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/range.md +180 -0
  100. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/rating.md +153 -0
  101. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/relative-time.md +105 -0
  102. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/resize-observer.md +68 -0
  103. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/responsive-media.md +73 -0
  104. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/select.md +457 -0
  105. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/skeleton.md +439 -0
  106. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/spinner.md +86 -0
  107. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/split-panel.md +671 -0
  108. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/switch.md +77 -0
  109. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab-group.md +359 -0
  110. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab-panel.md +41 -0
  111. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab.md +29 -0
  112. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tag.md +142 -0
  113. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/textarea.md +184 -0
  114. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tooltip.md +410 -0
  115. data/remote-src/2.0.0.beta64/shoelace-next/docs/components/visually-hidden.md +47 -0
  116. data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/angular.md +46 -0
  117. data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/react.md +156 -0
  118. data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/vue.md +92 -0
  119. data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/customizing.md +153 -0
  120. data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/form-controls.md +336 -0
  121. data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/installation.md +137 -0
  122. data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/localization.md +140 -0
  123. data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/overview.md +131 -0
  124. data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/themes.md +139 -0
  125. data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/usage.md +173 -0
  126. data/remote-src/2.0.0.beta64/shoelace-next/docs/index.html +98 -0
  127. data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/accessibility.md +18 -0
  128. data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/changelog.md +925 -0
  129. data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/community.md +53 -0
  130. data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/contributing.md +261 -0
  131. data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/border-radius.md +12 -0
  132. data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/color.md +439 -0
  133. data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/elevation.md +11 -0
  134. data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/spacing.md +16 -0
  135. data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/transition.md +11 -0
  136. data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/typography.md +58 -0
  137. data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/z-index.md +11 -0
  138. data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-laravel.md +117 -0
  139. data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-nextjs.md +137 -0
  140. data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-rails.md +103 -0
  141. data/remote-src/2.0.0.beta64/shoelace-next/lint-staged.config.js +4 -0
  142. data/remote-src/2.0.0.beta64/shoelace-next/package-lock.json +9534 -0
  143. data/remote-src/2.0.0.beta64/shoelace-next/package.json +93 -0
  144. data/remote-src/2.0.0.beta64/shoelace-next/prettier.config.cjs +17 -0
  145. data/remote-src/2.0.0.beta64/shoelace-next/scripts/build.js +158 -0
  146. data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-css.js +42 -0
  147. data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-icons.js +71 -0
  148. data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-metadata.js +11 -0
  149. data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-react.js +63 -0
  150. data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-search.js +100 -0
  151. data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-vscode-data.js +58 -0
  152. data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/plopfile.js +67 -0
  153. data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/component.hbs +44 -0
  154. data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/docs.hbs +21 -0
  155. data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/styles.hbs +10 -0
  156. data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/tests.hbs +13 -0
  157. data/remote-src/2.0.0.beta64/shoelace-next/scripts/shared.js +18 -0
  158. data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.styles.ts +95 -0
  159. data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.test.ts +93 -0
  160. data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.ts +238 -0
  161. data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.styles.ts +52 -0
  162. data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.test.ts +13 -0
  163. data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.ts +120 -0
  164. data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animation.styles.ts +10 -0
  165. data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animation.ts +222 -0
  166. data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animations.ts +15 -0
  167. data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.styles.ts +66 -0
  168. data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.test.ts +111 -0
  169. data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.ts +83 -0
  170. data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.styles.ts +94 -0
  171. data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.test.ts +77 -0
  172. data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.ts +53 -0
  173. data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.styles.ts +12 -0
  174. data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.test.ts +104 -0
  175. data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.ts +82 -0
  176. data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.styles.ts +85 -0
  177. data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.test.ts +160 -0
  178. data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.ts +92 -0
  179. data/remote-src/2.0.0.beta64/shoelace-next/src/components/button/button.styles.ts +637 -0
  180. data/remote-src/2.0.0.beta64/shoelace-next/src/components/button/button.ts +209 -0
  181. data/remote-src/2.0.0.beta64/shoelace-next/src/components/button-group/button-group.styles.ts +15 -0
  182. data/remote-src/2.0.0.beta64/shoelace-next/src/components/button-group/button-group.ts +84 -0
  183. data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.styles.ts +62 -0
  184. data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.test.ts +139 -0
  185. data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.ts +68 -0
  186. data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.styles.ts +108 -0
  187. data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.test.ts +47 -0
  188. data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.ts +203 -0
  189. data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.styles.ts +326 -0
  190. data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.test.ts +43 -0
  191. data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.ts +853 -0
  192. data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.styles.ts +73 -0
  193. data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.test.ts +153 -0
  194. data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.ts +192 -0
  195. data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.styles.ts +106 -0
  196. data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.test.ts +135 -0
  197. data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.ts +296 -0
  198. data/remote-src/2.0.0.beta64/shoelace-next/src/components/divider/divider.styles.ts +25 -0
  199. data/remote-src/2.0.0.beta64/shoelace-next/src/components/divider/divider.ts +34 -0
  200. data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.styles.ts +142 -0
  201. data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.test.ts +135 -0
  202. data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.ts +377 -0
  203. data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.styles.ts +58 -0
  204. data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.test.ts +147 -0
  205. data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.ts +459 -0
  206. data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-bytes/format-bytes.ts +35 -0
  207. data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-date/format-date.ts +81 -0
  208. data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-number/format-number.ts +69 -0
  209. data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/icon.styles.ts +21 -0
  210. data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/icon.ts +131 -0
  211. data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.default.ts +9 -0
  212. data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.system.ts +97 -0
  213. data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.ts +49 -0
  214. data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/request.ts +36 -0
  215. data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon-button/icon-button.styles.ts +48 -0
  216. data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon-button/icon-button.ts +100 -0
  217. data/remote-src/2.0.0.beta64/shoelace-next/src/components/image-comparer/image-comparer.styles.ts +77 -0
  218. data/remote-src/2.0.0.beta64/shoelace-next/src/components/image-comparer/image-comparer.ts +147 -0
  219. data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.styles.ts +10 -0
  220. data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.test.ts +62 -0
  221. data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.ts +80 -0
  222. data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/request.ts +23 -0
  223. data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.styles.ts +282 -0
  224. data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.test.ts +35 -0
  225. data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.ts +410 -0
  226. data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu/menu.styles.ts +18 -0
  227. data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu/menu.ts +205 -0
  228. data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-item/menu-item.styles.ts +84 -0
  229. data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-item/menu-item.ts +92 -0
  230. data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-label/menu-label.styles.ts +21 -0
  231. data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-label/menu-label.ts +30 -0
  232. data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.styles.ts +10 -0
  233. data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.test.ts +13 -0
  234. data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.ts +118 -0
  235. data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.styles.ts +57 -0
  236. data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.test.ts +89 -0
  237. data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.ts +74 -0
  238. data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.styles.ts +66 -0
  239. data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.test.ts +68 -0
  240. data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.ts +84 -0
  241. data/remote-src/2.0.0.beta64/shoelace-next/src/components/qr-code/qr-code.styles.ts +22 -0
  242. data/remote-src/2.0.0.beta64/shoelace-next/src/components/qr-code/qr-code.ts +90 -0
  243. data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.styles.ts +107 -0
  244. data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.test.ts +65 -0
  245. data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.ts +226 -0
  246. data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio-group/radio-group.styles.ts +47 -0
  247. data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio-group/radio-group.ts +66 -0
  248. data/remote-src/2.0.0.beta64/shoelace-next/src/components/range/range.styles.ts +192 -0
  249. data/remote-src/2.0.0.beta64/shoelace-next/src/components/range/range.ts +273 -0
  250. data/remote-src/2.0.0.beta64/shoelace-next/src/components/rating/rating.styles.ts +79 -0
  251. data/remote-src/2.0.0.beta64/shoelace-next/src/components/rating/rating.ts +249 -0
  252. data/remote-src/2.0.0.beta64/shoelace-next/src/components/relative-time/relative-time.ts +116 -0
  253. data/remote-src/2.0.0.beta64/shoelace-next/src/components/resize-observer/resize-observer.styles.ts +10 -0
  254. data/remote-src/2.0.0.beta64/shoelace-next/src/components/resize-observer/resize-observer.ts +87 -0
  255. data/remote-src/2.0.0.beta64/shoelace-next/src/components/responsive-media/responsive-media.styles.ts +36 -0
  256. data/remote-src/2.0.0.beta64/shoelace-next/src/components/responsive-media/responsive-media.ts +50 -0
  257. data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.styles.ts +331 -0
  258. data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.test.ts +56 -0
  259. data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.ts +560 -0
  260. data/remote-src/2.0.0.beta64/shoelace-next/src/components/skeleton/skeleton.styles.ts +60 -0
  261. data/remote-src/2.0.0.beta64/shoelace-next/src/components/skeleton/skeleton.ts +46 -0
  262. data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.styles.ts +56 -0
  263. data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.test.ts +24 -0
  264. data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.ts +34 -0
  265. data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.styles.ts +76 -0
  266. data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.test.ts +13 -0
  267. data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.ts +272 -0
  268. data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.styles.ts +135 -0
  269. data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.test.ts +64 -0
  270. data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.ts +187 -0
  271. data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab/tab.styles.ts +61 -0
  272. data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab/tab.ts +104 -0
  273. data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-group/tab-group.styles.ts +209 -0
  274. data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-group/tab-group.ts +409 -0
  275. data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-panel/tab-panel.styles.ts +17 -0
  276. data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-panel/tab-panel.ts +49 -0
  277. data/remote-src/2.0.0.beta64/shoelace-next/src/components/tag/tag.styles.ts +110 -0
  278. data/remote-src/2.0.0.beta64/shoelace-next/src/components/tag/tag.ts +92 -0
  279. data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.styles.ts +167 -0
  280. data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.test.ts +35 -0
  281. data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.ts +339 -0
  282. data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.styles.ts +131 -0
  283. data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.test.ts +117 -0
  284. data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.ts +355 -0
  285. data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.styles.ts +18 -0
  286. data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.test.ts +39 -0
  287. data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.ts +24 -0
  288. data/remote-src/2.0.0.beta64/shoelace-next/src/declaration.d.ts +8 -0
  289. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/animate.ts +70 -0
  290. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/event.ts +35 -0
  291. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/focus-visible.ts +26 -0
  292. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/form-control.ts +203 -0
  293. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/formdata-event-polyfill.ts +93 -0
  294. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/math.ts +8 -0
  295. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/modal.ts +53 -0
  296. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/number.ts +32 -0
  297. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/offset.ts +13 -0
  298. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/scroll.ts +57 -0
  299. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/slot.ts +91 -0
  300. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/string.ts +3 -0
  301. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/support.ts +15 -0
  302. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/tabbable.ts +81 -0
  303. data/remote-src/2.0.0.beta64/shoelace-next/src/internal/watch.ts +40 -0
  304. data/remote-src/2.0.0.beta64/shoelace-next/src/shoelace.ts +58 -0
  305. data/remote-src/2.0.0.beta64/shoelace-next/src/styles/component.styles.ts +23 -0
  306. data/remote-src/2.0.0.beta64/shoelace-next/src/styles/form-control.styles.ts +52 -0
  307. data/remote-src/2.0.0.beta64/shoelace-next/src/styles/utility.styles.ts +23 -0
  308. data/remote-src/2.0.0.beta64/shoelace-next/src/themes/dark.styles.ts +524 -0
  309. data/remote-src/2.0.0.beta64/shoelace-next/src/themes/light.styles.ts +524 -0
  310. data/remote-src/2.0.0.beta64/shoelace-next/src/translations/de-ch.ts +21 -0
  311. data/remote-src/2.0.0.beta64/shoelace-next/src/translations/de.ts +21 -0
  312. data/remote-src/2.0.0.beta64/shoelace-next/src/translations/en.ts +21 -0
  313. data/remote-src/2.0.0.beta64/shoelace-next/src/translations/es.ts +21 -0
  314. data/remote-src/2.0.0.beta64/shoelace-next/src/translations/fr.ts +21 -0
  315. data/remote-src/2.0.0.beta64/shoelace-next/src/translations/he.ts +21 -0
  316. data/remote-src/2.0.0.beta64/shoelace-next/src/translations/ja.ts +21 -0
  317. data/remote-src/2.0.0.beta64/shoelace-next/src/translations/nl.ts +21 -0
  318. data/remote-src/2.0.0.beta64/shoelace-next/src/translations/pl.ts +21 -0
  319. data/remote-src/2.0.0.beta64/shoelace-next/src/translations/pt.ts +21 -0
  320. data/remote-src/2.0.0.beta64/shoelace-next/src/translations/ru.ts +21 -0
  321. data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/animation-registry.ts +59 -0
  322. data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/animation.ts +1 -0
  323. data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/base-path.ts +43 -0
  324. data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/form.ts +22 -0
  325. data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/icon-library.ts +1 -0
  326. data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/localize.ts +5 -0
  327. data/remote-src/2.0.0.beta64/shoelace-next/tsconfig.json +35 -0
  328. data/remote-src/2.0.0.beta64/shoelace-next/vercel.json +4 -0
  329. data/remote-src/2.0.0.beta64/shoelace-next/web-test-runner.config.js +14 -0
  330. data/shoelace-rails-ui.gemspec +39 -0
  331. data/shoelace-rails-ui.rb +0 -0
  332. metadata +377 -0
@@ -0,0 +1,1311 @@
1
+ /**
2
+ * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9
3
+ * Copyright (C) 2020 Oliver Nightingale
4
+ * @license MIT
5
+ */
6
+ !(function () {
7
+ var e = function (t) {
8
+ var r = new e.Builder();
9
+ return (
10
+ r.pipeline.add(e.trimmer, e.stopWordFilter, e.stemmer), r.searchPipeline.add(e.stemmer), t.call(r, r), r.build()
11
+ );
12
+ };
13
+ (e.version = '2.3.9'),
14
+ (e.utils = {}),
15
+ (e.utils.warn = (function (e) {
16
+ return function (t) {
17
+ e.console && console.warn && console.warn(t);
18
+ };
19
+ })(this)),
20
+ (e.utils.asString = function (e) {
21
+ return void 0 === e || null === e ? '' : e.toString();
22
+ }),
23
+ (e.utils.clone = function (e) {
24
+ if (null === e || void 0 === e) return e;
25
+ for (var t = Object.create(null), r = Object.keys(e), i = 0; i < r.length; i++) {
26
+ var n = r[i],
27
+ s = e[n];
28
+ if (Array.isArray(s)) t[n] = s.slice();
29
+ else {
30
+ if ('string' != typeof s && 'number' != typeof s && 'boolean' != typeof s)
31
+ throw new TypeError('clone is not deep and does not support nested objects');
32
+ t[n] = s;
33
+ }
34
+ }
35
+ return t;
36
+ }),
37
+ (e.FieldRef = function (e, t, r) {
38
+ (this.docRef = e), (this.fieldName = t), (this._stringValue = r);
39
+ }),
40
+ (e.FieldRef.joiner = '/'),
41
+ (e.FieldRef.fromString = function (t) {
42
+ var r = t.indexOf(e.FieldRef.joiner);
43
+ if (r === -1) throw 'malformed field ref string';
44
+ var i = t.slice(0, r),
45
+ n = t.slice(r + 1);
46
+ return new e.FieldRef(n, i, t);
47
+ }),
48
+ (e.FieldRef.prototype.toString = function () {
49
+ return (
50
+ void 0 == this._stringValue && (this._stringValue = this.fieldName + e.FieldRef.joiner + this.docRef),
51
+ this._stringValue
52
+ );
53
+ }),
54
+ (e.Set = function (e) {
55
+ if (((this.elements = Object.create(null)), e)) {
56
+ this.length = e.length;
57
+ for (var t = 0; t < this.length; t++) this.elements[e[t]] = !0;
58
+ } else this.length = 0;
59
+ }),
60
+ (e.Set.complete = {
61
+ intersect: function (e) {
62
+ return e;
63
+ },
64
+ union: function () {
65
+ return this;
66
+ },
67
+ contains: function () {
68
+ return !0;
69
+ }
70
+ }),
71
+ (e.Set.empty = {
72
+ intersect: function () {
73
+ return this;
74
+ },
75
+ union: function (e) {
76
+ return e;
77
+ },
78
+ contains: function () {
79
+ return !1;
80
+ }
81
+ }),
82
+ (e.Set.prototype.contains = function (e) {
83
+ return !!this.elements[e];
84
+ }),
85
+ (e.Set.prototype.intersect = function (t) {
86
+ var r,
87
+ i,
88
+ n,
89
+ s = [];
90
+ if (t === e.Set.complete) return this;
91
+ if (t === e.Set.empty) return t;
92
+ this.length < t.length ? ((r = this), (i = t)) : ((r = t), (i = this)), (n = Object.keys(r.elements));
93
+ for (var o = 0; o < n.length; o++) {
94
+ var a = n[o];
95
+ a in i.elements && s.push(a);
96
+ }
97
+ return new e.Set(s);
98
+ }),
99
+ (e.Set.prototype.union = function (t) {
100
+ return t === e.Set.complete
101
+ ? e.Set.complete
102
+ : t === e.Set.empty
103
+ ? this
104
+ : new e.Set(Object.keys(this.elements).concat(Object.keys(t.elements)));
105
+ }),
106
+ (e.idf = function (e, t) {
107
+ var r = 0;
108
+ for (var i in e) '_index' != i && (r += Object.keys(e[i]).length);
109
+ var n = (t - r + 0.5) / (r + 0.5);
110
+ return Math.log(1 + Math.abs(n));
111
+ }),
112
+ (e.Token = function (e, t) {
113
+ (this.str = e || ''), (this.metadata = t || {});
114
+ }),
115
+ (e.Token.prototype.toString = function () {
116
+ return this.str;
117
+ }),
118
+ (e.Token.prototype.update = function (e) {
119
+ return (this.str = e(this.str, this.metadata)), this;
120
+ }),
121
+ (e.Token.prototype.clone = function (t) {
122
+ return (
123
+ (t =
124
+ t ||
125
+ function (e) {
126
+ return e;
127
+ }),
128
+ new e.Token(t(this.str, this.metadata), this.metadata)
129
+ );
130
+ }),
131
+ (e.tokenizer = function (t, r) {
132
+ if (null == t || void 0 == t) return [];
133
+ if (Array.isArray(t))
134
+ return t.map(function (t) {
135
+ return new e.Token(e.utils.asString(t).toLowerCase(), e.utils.clone(r));
136
+ });
137
+ for (var i = t.toString().toLowerCase(), n = i.length, s = [], o = 0, a = 0; o <= n; o++) {
138
+ var u = i.charAt(o),
139
+ l = o - a;
140
+ if (u.match(e.tokenizer.separator) || o == n) {
141
+ if (l > 0) {
142
+ var c = e.utils.clone(r) || {};
143
+ (c.position = [a, l]), (c.index = s.length), s.push(new e.Token(i.slice(a, o), c));
144
+ }
145
+ a = o + 1;
146
+ }
147
+ }
148
+ return s;
149
+ }),
150
+ (e.tokenizer.separator = /[\s\-]+/),
151
+ (e.Pipeline = function () {
152
+ this._stack = [];
153
+ }),
154
+ (e.Pipeline.registeredFunctions = Object.create(null)),
155
+ (e.Pipeline.registerFunction = function (t, r) {
156
+ r in this.registeredFunctions && e.utils.warn('Overwriting existing registered function: ' + r),
157
+ (t.label = r),
158
+ (e.Pipeline.registeredFunctions[t.label] = t);
159
+ }),
160
+ (e.Pipeline.warnIfFunctionNotRegistered = function (t) {
161
+ var r = t.label && t.label in this.registeredFunctions;
162
+ r ||
163
+ e.utils.warn(
164
+ 'Function is not registered with pipeline. This may cause problems when serialising the index.\n',
165
+ t
166
+ );
167
+ }),
168
+ (e.Pipeline.load = function (t) {
169
+ var r = new e.Pipeline();
170
+ return (
171
+ t.forEach(function (t) {
172
+ var i = e.Pipeline.registeredFunctions[t];
173
+ if (!i) throw new Error('Cannot load unregistered function: ' + t);
174
+ r.add(i);
175
+ }),
176
+ r
177
+ );
178
+ }),
179
+ (e.Pipeline.prototype.add = function () {
180
+ var t = Array.prototype.slice.call(arguments);
181
+ t.forEach(function (t) {
182
+ e.Pipeline.warnIfFunctionNotRegistered(t), this._stack.push(t);
183
+ }, this);
184
+ }),
185
+ (e.Pipeline.prototype.after = function (t, r) {
186
+ e.Pipeline.warnIfFunctionNotRegistered(r);
187
+ var i = this._stack.indexOf(t);
188
+ if (i == -1) throw new Error('Cannot find existingFn');
189
+ (i += 1), this._stack.splice(i, 0, r);
190
+ }),
191
+ (e.Pipeline.prototype.before = function (t, r) {
192
+ e.Pipeline.warnIfFunctionNotRegistered(r);
193
+ var i = this._stack.indexOf(t);
194
+ if (i == -1) throw new Error('Cannot find existingFn');
195
+ this._stack.splice(i, 0, r);
196
+ }),
197
+ (e.Pipeline.prototype.remove = function (e) {
198
+ var t = this._stack.indexOf(e);
199
+ t != -1 && this._stack.splice(t, 1);
200
+ }),
201
+ (e.Pipeline.prototype.run = function (e) {
202
+ for (var t = this._stack.length, r = 0; r < t; r++) {
203
+ for (var i = this._stack[r], n = [], s = 0; s < e.length; s++) {
204
+ var o = i(e[s], s, e);
205
+ if (null !== o && void 0 !== o && '' !== o)
206
+ if (Array.isArray(o)) for (var a = 0; a < o.length; a++) n.push(o[a]);
207
+ else n.push(o);
208
+ }
209
+ e = n;
210
+ }
211
+ return e;
212
+ }),
213
+ (e.Pipeline.prototype.runString = function (t, r) {
214
+ var i = new e.Token(t, r);
215
+ return this.run([i]).map(function (e) {
216
+ return e.toString();
217
+ });
218
+ }),
219
+ (e.Pipeline.prototype.reset = function () {
220
+ this._stack = [];
221
+ }),
222
+ (e.Pipeline.prototype.toJSON = function () {
223
+ return this._stack.map(function (t) {
224
+ return e.Pipeline.warnIfFunctionNotRegistered(t), t.label;
225
+ });
226
+ }),
227
+ (e.Vector = function (e) {
228
+ (this._magnitude = 0), (this.elements = e || []);
229
+ }),
230
+ (e.Vector.prototype.positionForIndex = function (e) {
231
+ if (0 == this.elements.length) return 0;
232
+ for (
233
+ var t = 0, r = this.elements.length / 2, i = r - t, n = Math.floor(i / 2), s = this.elements[2 * n];
234
+ i > 1 && (s < e && (t = n), s > e && (r = n), s != e);
235
+
236
+ )
237
+ (i = r - t), (n = t + Math.floor(i / 2)), (s = this.elements[2 * n]);
238
+ return s == e ? 2 * n : s > e ? 2 * n : s < e ? 2 * (n + 1) : void 0;
239
+ }),
240
+ (e.Vector.prototype.insert = function (e, t) {
241
+ this.upsert(e, t, function () {
242
+ throw 'duplicate index';
243
+ });
244
+ }),
245
+ (e.Vector.prototype.upsert = function (e, t, r) {
246
+ this._magnitude = 0;
247
+ var i = this.positionForIndex(e);
248
+ this.elements[i] == e ? (this.elements[i + 1] = r(this.elements[i + 1], t)) : this.elements.splice(i, 0, e, t);
249
+ }),
250
+ (e.Vector.prototype.magnitude = function () {
251
+ if (this._magnitude) return this._magnitude;
252
+ for (var e = 0, t = this.elements.length, r = 1; r < t; r += 2) {
253
+ var i = this.elements[r];
254
+ e += i * i;
255
+ }
256
+ return (this._magnitude = Math.sqrt(e));
257
+ }),
258
+ (e.Vector.prototype.dot = function (e) {
259
+ for (
260
+ var t = 0, r = this.elements, i = e.elements, n = r.length, s = i.length, o = 0, a = 0, u = 0, l = 0;
261
+ u < n && l < s;
262
+
263
+ )
264
+ (o = r[u]),
265
+ (a = i[l]),
266
+ o < a ? (u += 2) : o > a ? (l += 2) : o == a && ((t += r[u + 1] * i[l + 1]), (u += 2), (l += 2));
267
+ return t;
268
+ }),
269
+ (e.Vector.prototype.similarity = function (e) {
270
+ return this.dot(e) / this.magnitude() || 0;
271
+ }),
272
+ (e.Vector.prototype.toArray = function () {
273
+ for (var e = new Array(this.elements.length / 2), t = 1, r = 0; t < this.elements.length; t += 2, r++)
274
+ e[r] = this.elements[t];
275
+ return e;
276
+ }),
277
+ (e.Vector.prototype.toJSON = function () {
278
+ return this.elements;
279
+ }),
280
+ (e.stemmer = (function () {
281
+ var e = {
282
+ ational: 'ate',
283
+ tional: 'tion',
284
+ enci: 'ence',
285
+ anci: 'ance',
286
+ izer: 'ize',
287
+ bli: 'ble',
288
+ alli: 'al',
289
+ entli: 'ent',
290
+ eli: 'e',
291
+ ousli: 'ous',
292
+ ization: 'ize',
293
+ ation: 'ate',
294
+ ator: 'ate',
295
+ alism: 'al',
296
+ iveness: 'ive',
297
+ fulness: 'ful',
298
+ ousness: 'ous',
299
+ aliti: 'al',
300
+ iviti: 'ive',
301
+ biliti: 'ble',
302
+ logi: 'log'
303
+ },
304
+ t = { icate: 'ic', ative: '', alize: 'al', iciti: 'ic', ical: 'ic', ful: '', ness: '' },
305
+ r = '[^aeiou]',
306
+ i = '[aeiouy]',
307
+ n = r + '[^aeiouy]*',
308
+ s = i + '[aeiou]*',
309
+ o = '^(' + n + ')?' + s + n,
310
+ a = '^(' + n + ')?' + s + n + '(' + s + ')?$',
311
+ u = '^(' + n + ')?' + s + n + s + n,
312
+ l = '^(' + n + ')?' + i,
313
+ c = new RegExp(o),
314
+ h = new RegExp(u),
315
+ d = new RegExp(a),
316
+ f = new RegExp(l),
317
+ p = /^(.+?)(ss|i)es$/,
318
+ y = /^(.+?)([^s])s$/,
319
+ m = /^(.+?)eed$/,
320
+ v = /^(.+?)(ed|ing)$/,
321
+ g = /.$/,
322
+ x = /(at|bl|iz)$/,
323
+ w = new RegExp('([^aeiouylsz])\\1$'),
324
+ Q = new RegExp('^' + n + i + '[^aeiouwxy]$'),
325
+ k = /^(.+?[^aeiou])y$/,
326
+ S =
327
+ /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,
328
+ E = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,
329
+ L = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,
330
+ b = /^(.+?)(s|t)(ion)$/,
331
+ P = /^(.+?)e$/,
332
+ T = /ll$/,
333
+ O = new RegExp('^' + n + i + '[^aeiouwxy]$'),
334
+ I = function (r) {
335
+ var i, n, s, o, a, u, l;
336
+ if (r.length < 3) return r;
337
+ if (
338
+ ((s = r.substr(0, 1)),
339
+ 'y' == s && (r = s.toUpperCase() + r.substr(1)),
340
+ (o = p),
341
+ (a = y),
342
+ o.test(r) ? (r = r.replace(o, '$1$2')) : a.test(r) && (r = r.replace(a, '$1$2')),
343
+ (o = m),
344
+ (a = v),
345
+ o.test(r))
346
+ ) {
347
+ var I = o.exec(r);
348
+ (o = c), o.test(I[1]) && ((o = g), (r = r.replace(o, '')));
349
+ } else if (a.test(r)) {
350
+ var I = a.exec(r);
351
+ (i = I[1]),
352
+ (a = f),
353
+ a.test(i) &&
354
+ ((r = i),
355
+ (a = x),
356
+ (u = w),
357
+ (l = Q),
358
+ a.test(r) ? (r += 'e') : u.test(r) ? ((o = g), (r = r.replace(o, ''))) : l.test(r) && (r += 'e'));
359
+ }
360
+ if (((o = k), o.test(r))) {
361
+ var I = o.exec(r);
362
+ (i = I[1]), (r = i + 'i');
363
+ }
364
+ if (((o = S), o.test(r))) {
365
+ var I = o.exec(r);
366
+ (i = I[1]), (n = I[2]), (o = c), o.test(i) && (r = i + e[n]);
367
+ }
368
+ if (((o = E), o.test(r))) {
369
+ var I = o.exec(r);
370
+ (i = I[1]), (n = I[2]), (o = c), o.test(i) && (r = i + t[n]);
371
+ }
372
+ if (((o = L), (a = b), o.test(r))) {
373
+ var I = o.exec(r);
374
+ (i = I[1]), (o = h), o.test(i) && (r = i);
375
+ } else if (a.test(r)) {
376
+ var I = a.exec(r);
377
+ (i = I[1] + I[2]), (a = h), a.test(i) && (r = i);
378
+ }
379
+ if (((o = P), o.test(r))) {
380
+ var I = o.exec(r);
381
+ (i = I[1]), (o = h), (a = d), (u = O), (o.test(i) || (a.test(i) && !u.test(i))) && (r = i);
382
+ }
383
+ return (
384
+ (o = T),
385
+ (a = h),
386
+ o.test(r) && a.test(r) && ((o = g), (r = r.replace(o, ''))),
387
+ 'y' == s && (r = s.toLowerCase() + r.substr(1)),
388
+ r
389
+ );
390
+ };
391
+ return function (e) {
392
+ return e.update(I);
393
+ };
394
+ })()),
395
+ e.Pipeline.registerFunction(e.stemmer, 'stemmer'),
396
+ (e.generateStopWordFilter = function (e) {
397
+ var t = e.reduce(function (e, t) {
398
+ return (e[t] = t), e;
399
+ }, {});
400
+ return function (e) {
401
+ if (e && t[e.toString()] !== e.toString()) return e;
402
+ };
403
+ }),
404
+ (e.stopWordFilter = e.generateStopWordFilter([
405
+ 'a',
406
+ 'able',
407
+ 'about',
408
+ 'across',
409
+ 'after',
410
+ 'all',
411
+ 'almost',
412
+ 'also',
413
+ 'am',
414
+ 'among',
415
+ 'an',
416
+ 'and',
417
+ 'any',
418
+ 'are',
419
+ 'as',
420
+ 'at',
421
+ 'be',
422
+ 'because',
423
+ 'been',
424
+ 'but',
425
+ 'by',
426
+ 'can',
427
+ 'cannot',
428
+ 'could',
429
+ 'dear',
430
+ 'did',
431
+ 'do',
432
+ 'does',
433
+ 'either',
434
+ 'else',
435
+ 'ever',
436
+ 'every',
437
+ 'for',
438
+ 'from',
439
+ 'get',
440
+ 'got',
441
+ 'had',
442
+ 'has',
443
+ 'have',
444
+ 'he',
445
+ 'her',
446
+ 'hers',
447
+ 'him',
448
+ 'his',
449
+ 'how',
450
+ 'however',
451
+ 'i',
452
+ 'if',
453
+ 'in',
454
+ 'into',
455
+ 'is',
456
+ 'it',
457
+ 'its',
458
+ 'just',
459
+ 'least',
460
+ 'let',
461
+ 'like',
462
+ 'likely',
463
+ 'may',
464
+ 'me',
465
+ 'might',
466
+ 'most',
467
+ 'must',
468
+ 'my',
469
+ 'neither',
470
+ 'no',
471
+ 'nor',
472
+ 'not',
473
+ 'of',
474
+ 'off',
475
+ 'often',
476
+ 'on',
477
+ 'only',
478
+ 'or',
479
+ 'other',
480
+ 'our',
481
+ 'own',
482
+ 'rather',
483
+ 'said',
484
+ 'say',
485
+ 'says',
486
+ 'she',
487
+ 'should',
488
+ 'since',
489
+ 'so',
490
+ 'some',
491
+ 'than',
492
+ 'that',
493
+ 'the',
494
+ 'their',
495
+ 'them',
496
+ 'then',
497
+ 'there',
498
+ 'these',
499
+ 'they',
500
+ 'this',
501
+ 'tis',
502
+ 'to',
503
+ 'too',
504
+ 'twas',
505
+ 'us',
506
+ 'wants',
507
+ 'was',
508
+ 'we',
509
+ 'were',
510
+ 'what',
511
+ 'when',
512
+ 'where',
513
+ 'which',
514
+ 'while',
515
+ 'who',
516
+ 'whom',
517
+ 'why',
518
+ 'will',
519
+ 'with',
520
+ 'would',
521
+ 'yet',
522
+ 'you',
523
+ 'your'
524
+ ])),
525
+ e.Pipeline.registerFunction(e.stopWordFilter, 'stopWordFilter'),
526
+ (e.trimmer = function (e) {
527
+ return e.update(function (e) {
528
+ return e.replace(/^\W+/, '').replace(/\W+$/, '');
529
+ });
530
+ }),
531
+ e.Pipeline.registerFunction(e.trimmer, 'trimmer'),
532
+ (e.TokenSet = function () {
533
+ (this['final'] = !1), (this.edges = {}), (this.id = e.TokenSet._nextId), (e.TokenSet._nextId += 1);
534
+ }),
535
+ (e.TokenSet._nextId = 1),
536
+ (e.TokenSet.fromArray = function (t) {
537
+ for (var r = new e.TokenSet.Builder(), i = 0, n = t.length; i < n; i++) r.insert(t[i]);
538
+ return r.finish(), r.root;
539
+ }),
540
+ (e.TokenSet.fromClause = function (t) {
541
+ return 'editDistance' in t ? e.TokenSet.fromFuzzyString(t.term, t.editDistance) : e.TokenSet.fromString(t.term);
542
+ }),
543
+ (e.TokenSet.fromFuzzyString = function (t, r) {
544
+ for (var i = new e.TokenSet(), n = [{ node: i, editsRemaining: r, str: t }]; n.length; ) {
545
+ var s = n.pop();
546
+ if (s.str.length > 0) {
547
+ var o,
548
+ a = s.str.charAt(0);
549
+ a in s.node.edges ? (o = s.node.edges[a]) : ((o = new e.TokenSet()), (s.node.edges[a] = o)),
550
+ 1 == s.str.length && (o['final'] = !0),
551
+ n.push({ node: o, editsRemaining: s.editsRemaining, str: s.str.slice(1) });
552
+ }
553
+ if (0 != s.editsRemaining) {
554
+ if ('*' in s.node.edges) var u = s.node.edges['*'];
555
+ else {
556
+ var u = new e.TokenSet();
557
+ s.node.edges['*'] = u;
558
+ }
559
+ if (
560
+ (0 == s.str.length && (u['final'] = !0),
561
+ n.push({ node: u, editsRemaining: s.editsRemaining - 1, str: s.str }),
562
+ s.str.length > 1 && n.push({ node: s.node, editsRemaining: s.editsRemaining - 1, str: s.str.slice(1) }),
563
+ 1 == s.str.length && (s.node['final'] = !0),
564
+ s.str.length >= 1)
565
+ ) {
566
+ if ('*' in s.node.edges) var l = s.node.edges['*'];
567
+ else {
568
+ var l = new e.TokenSet();
569
+ s.node.edges['*'] = l;
570
+ }
571
+ 1 == s.str.length && (l['final'] = !0),
572
+ n.push({ node: l, editsRemaining: s.editsRemaining - 1, str: s.str.slice(1) });
573
+ }
574
+ if (s.str.length > 1) {
575
+ var c,
576
+ h = s.str.charAt(0),
577
+ d = s.str.charAt(1);
578
+ d in s.node.edges ? (c = s.node.edges[d]) : ((c = new e.TokenSet()), (s.node.edges[d] = c)),
579
+ 1 == s.str.length && (c['final'] = !0),
580
+ n.push({ node: c, editsRemaining: s.editsRemaining - 1, str: h + s.str.slice(2) });
581
+ }
582
+ }
583
+ }
584
+ return i;
585
+ }),
586
+ (e.TokenSet.fromString = function (t) {
587
+ for (var r = new e.TokenSet(), i = r, n = 0, s = t.length; n < s; n++) {
588
+ var o = t[n],
589
+ a = n == s - 1;
590
+ if ('*' == o) (r.edges[o] = r), (r['final'] = a);
591
+ else {
592
+ var u = new e.TokenSet();
593
+ (u['final'] = a), (r.edges[o] = u), (r = u);
594
+ }
595
+ }
596
+ return i;
597
+ }),
598
+ (e.TokenSet.prototype.toArray = function () {
599
+ for (var e = [], t = [{ prefix: '', node: this }]; t.length; ) {
600
+ var r = t.pop(),
601
+ i = Object.keys(r.node.edges),
602
+ n = i.length;
603
+ r.node['final'] && (r.prefix.charAt(0), e.push(r.prefix));
604
+ for (var s = 0; s < n; s++) {
605
+ var o = i[s];
606
+ t.push({ prefix: r.prefix.concat(o), node: r.node.edges[o] });
607
+ }
608
+ }
609
+ return e;
610
+ }),
611
+ (e.TokenSet.prototype.toString = function () {
612
+ if (this._str) return this._str;
613
+ for (var e = this['final'] ? '1' : '0', t = Object.keys(this.edges).sort(), r = t.length, i = 0; i < r; i++) {
614
+ var n = t[i],
615
+ s = this.edges[n];
616
+ e = e + n + s.id;
617
+ }
618
+ return e;
619
+ }),
620
+ (e.TokenSet.prototype.intersect = function (t) {
621
+ for (var r = new e.TokenSet(), i = void 0, n = [{ qNode: t, output: r, node: this }]; n.length; ) {
622
+ i = n.pop();
623
+ for (
624
+ var s = Object.keys(i.qNode.edges), o = s.length, a = Object.keys(i.node.edges), u = a.length, l = 0;
625
+ l < o;
626
+ l++
627
+ )
628
+ for (var c = s[l], h = 0; h < u; h++) {
629
+ var d = a[h];
630
+ if (d == c || '*' == c) {
631
+ var f = i.node.edges[d],
632
+ p = i.qNode.edges[c],
633
+ y = f['final'] && p['final'],
634
+ m = void 0;
635
+ d in i.output.edges
636
+ ? ((m = i.output.edges[d]), (m['final'] = m['final'] || y))
637
+ : ((m = new e.TokenSet()), (m['final'] = y), (i.output.edges[d] = m)),
638
+ n.push({ qNode: p, output: m, node: f });
639
+ }
640
+ }
641
+ }
642
+ return r;
643
+ }),
644
+ (e.TokenSet.Builder = function () {
645
+ (this.previousWord = ''), (this.root = new e.TokenSet()), (this.uncheckedNodes = []), (this.minimizedNodes = {});
646
+ }),
647
+ (e.TokenSet.Builder.prototype.insert = function (t) {
648
+ var r,
649
+ i = 0;
650
+ if (t < this.previousWord) throw new Error('Out of order word insertion');
651
+ for (var n = 0; n < t.length && n < this.previousWord.length && t[n] == this.previousWord[n]; n++) i++;
652
+ this.minimize(i),
653
+ (r = 0 == this.uncheckedNodes.length ? this.root : this.uncheckedNodes[this.uncheckedNodes.length - 1].child);
654
+ for (var n = i; n < t.length; n++) {
655
+ var s = new e.TokenSet(),
656
+ o = t[n];
657
+ (r.edges[o] = s), this.uncheckedNodes.push({ parent: r, char: o, child: s }), (r = s);
658
+ }
659
+ (r['final'] = !0), (this.previousWord = t);
660
+ }),
661
+ (e.TokenSet.Builder.prototype.finish = function () {
662
+ this.minimize(0);
663
+ }),
664
+ (e.TokenSet.Builder.prototype.minimize = function (e) {
665
+ for (var t = this.uncheckedNodes.length - 1; t >= e; t--) {
666
+ var r = this.uncheckedNodes[t],
667
+ i = r.child.toString();
668
+ i in this.minimizedNodes
669
+ ? (r.parent.edges[r['char']] = this.minimizedNodes[i])
670
+ : ((r.child._str = i), (this.minimizedNodes[i] = r.child)),
671
+ this.uncheckedNodes.pop();
672
+ }
673
+ }),
674
+ (e.Index = function (e) {
675
+ (this.invertedIndex = e.invertedIndex),
676
+ (this.fieldVectors = e.fieldVectors),
677
+ (this.tokenSet = e.tokenSet),
678
+ (this.fields = e.fields),
679
+ (this.pipeline = e.pipeline);
680
+ }),
681
+ (e.Index.prototype.search = function (t) {
682
+ return this.query(function (r) {
683
+ var i = new e.QueryParser(t, r);
684
+ i.parse();
685
+ });
686
+ }),
687
+ (e.Index.prototype.query = function (t) {
688
+ for (
689
+ var r = new e.Query(this.fields),
690
+ i = Object.create(null),
691
+ n = Object.create(null),
692
+ s = Object.create(null),
693
+ o = Object.create(null),
694
+ a = Object.create(null),
695
+ u = 0;
696
+ u < this.fields.length;
697
+ u++
698
+ )
699
+ n[this.fields[u]] = new e.Vector();
700
+ t.call(r, r);
701
+ for (var u = 0; u < r.clauses.length; u++) {
702
+ var l = r.clauses[u],
703
+ c = null,
704
+ h = e.Set.empty;
705
+ c = l.usePipeline ? this.pipeline.runString(l.term, { fields: l.fields }) : [l.term];
706
+ for (var d = 0; d < c.length; d++) {
707
+ var f = c[d];
708
+ l.term = f;
709
+ var p = e.TokenSet.fromClause(l),
710
+ y = this.tokenSet.intersect(p).toArray();
711
+ if (0 === y.length && l.presence === e.Query.presence.REQUIRED) {
712
+ for (var m = 0; m < l.fields.length; m++) {
713
+ var v = l.fields[m];
714
+ o[v] = e.Set.empty;
715
+ }
716
+ break;
717
+ }
718
+ for (var g = 0; g < y.length; g++)
719
+ for (var x = y[g], w = this.invertedIndex[x], Q = w._index, m = 0; m < l.fields.length; m++) {
720
+ var v = l.fields[m],
721
+ k = w[v],
722
+ S = Object.keys(k),
723
+ E = x + '/' + v,
724
+ L = new e.Set(S);
725
+ if (
726
+ (l.presence == e.Query.presence.REQUIRED &&
727
+ ((h = h.union(L)), void 0 === o[v] && (o[v] = e.Set.complete)),
728
+ l.presence != e.Query.presence.PROHIBITED)
729
+ ) {
730
+ if (
731
+ (n[v].upsert(Q, l.boost, function (e, t) {
732
+ return e + t;
733
+ }),
734
+ !s[E])
735
+ ) {
736
+ for (var b = 0; b < S.length; b++) {
737
+ var P,
738
+ T = S[b],
739
+ O = new e.FieldRef(T, v),
740
+ I = k[T];
741
+ void 0 === (P = i[O]) ? (i[O] = new e.MatchData(x, v, I)) : P.add(x, v, I);
742
+ }
743
+ s[E] = !0;
744
+ }
745
+ } else void 0 === a[v] && (a[v] = e.Set.empty), (a[v] = a[v].union(L));
746
+ }
747
+ }
748
+ if (l.presence === e.Query.presence.REQUIRED)
749
+ for (var m = 0; m < l.fields.length; m++) {
750
+ var v = l.fields[m];
751
+ o[v] = o[v].intersect(h);
752
+ }
753
+ }
754
+ for (var R = e.Set.complete, F = e.Set.empty, u = 0; u < this.fields.length; u++) {
755
+ var v = this.fields[u];
756
+ o[v] && (R = R.intersect(o[v])), a[v] && (F = F.union(a[v]));
757
+ }
758
+ var C = Object.keys(i),
759
+ N = [],
760
+ _ = Object.create(null);
761
+ if (r.isNegated()) {
762
+ C = Object.keys(this.fieldVectors);
763
+ for (var u = 0; u < C.length; u++) {
764
+ var O = C[u],
765
+ j = e.FieldRef.fromString(O);
766
+ i[O] = new e.MatchData();
767
+ }
768
+ }
769
+ for (var u = 0; u < C.length; u++) {
770
+ var j = e.FieldRef.fromString(C[u]),
771
+ D = j.docRef;
772
+ if (R.contains(D) && !F.contains(D)) {
773
+ var A,
774
+ B = this.fieldVectors[j],
775
+ V = n[j.fieldName].similarity(B);
776
+ if (void 0 !== (A = _[D])) (A.score += V), A.matchData.combine(i[j]);
777
+ else {
778
+ var z = { ref: D, score: V, matchData: i[j] };
779
+ (_[D] = z), N.push(z);
780
+ }
781
+ }
782
+ }
783
+ return N.sort(function (e, t) {
784
+ return t.score - e.score;
785
+ });
786
+ }),
787
+ (e.Index.prototype.toJSON = function () {
788
+ var t = Object.keys(this.invertedIndex)
789
+ .sort()
790
+ .map(function (e) {
791
+ return [e, this.invertedIndex[e]];
792
+ }, this),
793
+ r = Object.keys(this.fieldVectors).map(function (e) {
794
+ return [e, this.fieldVectors[e].toJSON()];
795
+ }, this);
796
+ return {
797
+ version: e.version,
798
+ fields: this.fields,
799
+ fieldVectors: r,
800
+ invertedIndex: t,
801
+ pipeline: this.pipeline.toJSON()
802
+ };
803
+ }),
804
+ (e.Index.load = function (t) {
805
+ var r = {},
806
+ i = {},
807
+ n = t.fieldVectors,
808
+ s = Object.create(null),
809
+ o = t.invertedIndex,
810
+ a = new e.TokenSet.Builder(),
811
+ u = e.Pipeline.load(t.pipeline);
812
+ t.version != e.version &&
813
+ e.utils.warn(
814
+ "Version mismatch when loading serialised index. Current version of lunr '" +
815
+ e.version +
816
+ "' does not match serialized index '" +
817
+ t.version +
818
+ "'"
819
+ );
820
+ for (var l = 0; l < n.length; l++) {
821
+ var c = n[l],
822
+ h = c[0],
823
+ d = c[1];
824
+ i[h] = new e.Vector(d);
825
+ }
826
+ for (var l = 0; l < o.length; l++) {
827
+ var c = o[l],
828
+ f = c[0],
829
+ p = c[1];
830
+ a.insert(f), (s[f] = p);
831
+ }
832
+ return (
833
+ a.finish(),
834
+ (r.fields = t.fields),
835
+ (r.fieldVectors = i),
836
+ (r.invertedIndex = s),
837
+ (r.tokenSet = a.root),
838
+ (r.pipeline = u),
839
+ new e.Index(r)
840
+ );
841
+ }),
842
+ (e.Builder = function () {
843
+ (this._ref = 'id'),
844
+ (this._fields = Object.create(null)),
845
+ (this._documents = Object.create(null)),
846
+ (this.invertedIndex = Object.create(null)),
847
+ (this.fieldTermFrequencies = {}),
848
+ (this.fieldLengths = {}),
849
+ (this.tokenizer = e.tokenizer),
850
+ (this.pipeline = new e.Pipeline()),
851
+ (this.searchPipeline = new e.Pipeline()),
852
+ (this.documentCount = 0),
853
+ (this._b = 0.75),
854
+ (this._k1 = 1.2),
855
+ (this.termIndex = 0),
856
+ (this.metadataWhitelist = []);
857
+ }),
858
+ (e.Builder.prototype.ref = function (e) {
859
+ this._ref = e;
860
+ }),
861
+ (e.Builder.prototype.field = function (e, t) {
862
+ if (/\//.test(e)) throw new RangeError("Field '" + e + "' contains illegal character '/'");
863
+ this._fields[e] = t || {};
864
+ }),
865
+ (e.Builder.prototype.b = function (e) {
866
+ e < 0 ? (this._b = 0) : e > 1 ? (this._b = 1) : (this._b = e);
867
+ }),
868
+ (e.Builder.prototype.k1 = function (e) {
869
+ this._k1 = e;
870
+ }),
871
+ (e.Builder.prototype.add = function (t, r) {
872
+ var i = t[this._ref],
873
+ n = Object.keys(this._fields);
874
+ (this._documents[i] = r || {}), (this.documentCount += 1);
875
+ for (var s = 0; s < n.length; s++) {
876
+ var o = n[s],
877
+ a = this._fields[o].extractor,
878
+ u = a ? a(t) : t[o],
879
+ l = this.tokenizer(u, { fields: [o] }),
880
+ c = this.pipeline.run(l),
881
+ h = new e.FieldRef(i, o),
882
+ d = Object.create(null);
883
+ (this.fieldTermFrequencies[h] = d), (this.fieldLengths[h] = 0), (this.fieldLengths[h] += c.length);
884
+ for (var f = 0; f < c.length; f++) {
885
+ var p = c[f];
886
+ if ((void 0 == d[p] && (d[p] = 0), (d[p] += 1), void 0 == this.invertedIndex[p])) {
887
+ var y = Object.create(null);
888
+ (y._index = this.termIndex), (this.termIndex += 1);
889
+ for (var m = 0; m < n.length; m++) y[n[m]] = Object.create(null);
890
+ this.invertedIndex[p] = y;
891
+ }
892
+ void 0 == this.invertedIndex[p][o][i] && (this.invertedIndex[p][o][i] = Object.create(null));
893
+ for (var v = 0; v < this.metadataWhitelist.length; v++) {
894
+ var g = this.metadataWhitelist[v],
895
+ x = p.metadata[g];
896
+ void 0 == this.invertedIndex[p][o][i][g] && (this.invertedIndex[p][o][i][g] = []),
897
+ this.invertedIndex[p][o][i][g].push(x);
898
+ }
899
+ }
900
+ }
901
+ }),
902
+ (e.Builder.prototype.calculateAverageFieldLengths = function () {
903
+ for (var t = Object.keys(this.fieldLengths), r = t.length, i = {}, n = {}, s = 0; s < r; s++) {
904
+ var o = e.FieldRef.fromString(t[s]),
905
+ a = o.fieldName;
906
+ n[a] || (n[a] = 0), (n[a] += 1), i[a] || (i[a] = 0), (i[a] += this.fieldLengths[o]);
907
+ }
908
+ for (var u = Object.keys(this._fields), s = 0; s < u.length; s++) {
909
+ var l = u[s];
910
+ i[l] = i[l] / n[l];
911
+ }
912
+ this.averageFieldLength = i;
913
+ }),
914
+ (e.Builder.prototype.createFieldVectors = function () {
915
+ for (
916
+ var t = {}, r = Object.keys(this.fieldTermFrequencies), i = r.length, n = Object.create(null), s = 0;
917
+ s < i;
918
+ s++
919
+ ) {
920
+ for (
921
+ var o = e.FieldRef.fromString(r[s]),
922
+ a = o.fieldName,
923
+ u = this.fieldLengths[o],
924
+ l = new e.Vector(),
925
+ c = this.fieldTermFrequencies[o],
926
+ h = Object.keys(c),
927
+ d = h.length,
928
+ f = this._fields[a].boost || 1,
929
+ p = this._documents[o.docRef].boost || 1,
930
+ y = 0;
931
+ y < d;
932
+ y++
933
+ ) {
934
+ var m,
935
+ v,
936
+ g,
937
+ x = h[y],
938
+ w = c[x],
939
+ Q = this.invertedIndex[x]._index;
940
+ void 0 === n[x] ? ((m = e.idf(this.invertedIndex[x], this.documentCount)), (n[x] = m)) : (m = n[x]),
941
+ (v =
942
+ (m * ((this._k1 + 1) * w)) / (this._k1 * (1 - this._b + this._b * (u / this.averageFieldLength[a])) + w)),
943
+ (v *= f),
944
+ (v *= p),
945
+ (g = Math.round(1e3 * v) / 1e3),
946
+ l.insert(Q, g);
947
+ }
948
+ t[o] = l;
949
+ }
950
+ this.fieldVectors = t;
951
+ }),
952
+ (e.Builder.prototype.createTokenSet = function () {
953
+ this.tokenSet = e.TokenSet.fromArray(Object.keys(this.invertedIndex).sort());
954
+ }),
955
+ (e.Builder.prototype.build = function () {
956
+ return (
957
+ this.calculateAverageFieldLengths(),
958
+ this.createFieldVectors(),
959
+ this.createTokenSet(),
960
+ new e.Index({
961
+ invertedIndex: this.invertedIndex,
962
+ fieldVectors: this.fieldVectors,
963
+ tokenSet: this.tokenSet,
964
+ fields: Object.keys(this._fields),
965
+ pipeline: this.searchPipeline
966
+ })
967
+ );
968
+ }),
969
+ (e.Builder.prototype.use = function (e) {
970
+ var t = Array.prototype.slice.call(arguments, 1);
971
+ t.unshift(this), e.apply(this, t);
972
+ }),
973
+ (e.MatchData = function (e, t, r) {
974
+ for (var i = Object.create(null), n = Object.keys(r || {}), s = 0; s < n.length; s++) {
975
+ var o = n[s];
976
+ i[o] = r[o].slice();
977
+ }
978
+ (this.metadata = Object.create(null)),
979
+ void 0 !== e && ((this.metadata[e] = Object.create(null)), (this.metadata[e][t] = i));
980
+ }),
981
+ (e.MatchData.prototype.combine = function (e) {
982
+ for (var t = Object.keys(e.metadata), r = 0; r < t.length; r++) {
983
+ var i = t[r],
984
+ n = Object.keys(e.metadata[i]);
985
+ void 0 == this.metadata[i] && (this.metadata[i] = Object.create(null));
986
+ for (var s = 0; s < n.length; s++) {
987
+ var o = n[s],
988
+ a = Object.keys(e.metadata[i][o]);
989
+ void 0 == this.metadata[i][o] && (this.metadata[i][o] = Object.create(null));
990
+ for (var u = 0; u < a.length; u++) {
991
+ var l = a[u];
992
+ void 0 == this.metadata[i][o][l]
993
+ ? (this.metadata[i][o][l] = e.metadata[i][o][l])
994
+ : (this.metadata[i][o][l] = this.metadata[i][o][l].concat(e.metadata[i][o][l]));
995
+ }
996
+ }
997
+ }
998
+ }),
999
+ (e.MatchData.prototype.add = function (e, t, r) {
1000
+ if (!(e in this.metadata)) return (this.metadata[e] = Object.create(null)), void (this.metadata[e][t] = r);
1001
+ if (!(t in this.metadata[e])) return void (this.metadata[e][t] = r);
1002
+ for (var i = Object.keys(r), n = 0; n < i.length; n++) {
1003
+ var s = i[n];
1004
+ s in this.metadata[e][t]
1005
+ ? (this.metadata[e][t][s] = this.metadata[e][t][s].concat(r[s]))
1006
+ : (this.metadata[e][t][s] = r[s]);
1007
+ }
1008
+ }),
1009
+ (e.Query = function (e) {
1010
+ (this.clauses = []), (this.allFields = e);
1011
+ }),
1012
+ (e.Query.wildcard = new String('*')),
1013
+ (e.Query.wildcard.NONE = 0),
1014
+ (e.Query.wildcard.LEADING = 1),
1015
+ (e.Query.wildcard.TRAILING = 2),
1016
+ (e.Query.presence = { OPTIONAL: 1, REQUIRED: 2, PROHIBITED: 3 }),
1017
+ (e.Query.prototype.clause = function (t) {
1018
+ return (
1019
+ 'fields' in t || (t.fields = this.allFields),
1020
+ 'boost' in t || (t.boost = 1),
1021
+ 'usePipeline' in t || (t.usePipeline = !0),
1022
+ 'wildcard' in t || (t.wildcard = e.Query.wildcard.NONE),
1023
+ t.wildcard & e.Query.wildcard.LEADING && t.term.charAt(0) != e.Query.wildcard && (t.term = '*' + t.term),
1024
+ t.wildcard & e.Query.wildcard.TRAILING && t.term.slice(-1) != e.Query.wildcard && (t.term = '' + t.term + '*'),
1025
+ 'presence' in t || (t.presence = e.Query.presence.OPTIONAL),
1026
+ this.clauses.push(t),
1027
+ this
1028
+ );
1029
+ }),
1030
+ (e.Query.prototype.isNegated = function () {
1031
+ for (var t = 0; t < this.clauses.length; t++)
1032
+ if (this.clauses[t].presence != e.Query.presence.PROHIBITED) return !1;
1033
+ return !0;
1034
+ }),
1035
+ (e.Query.prototype.term = function (t, r) {
1036
+ if (Array.isArray(t))
1037
+ return (
1038
+ t.forEach(function (t) {
1039
+ this.term(t, e.utils.clone(r));
1040
+ }, this),
1041
+ this
1042
+ );
1043
+ var i = r || {};
1044
+ return (i.term = t.toString()), this.clause(i), this;
1045
+ }),
1046
+ (e.QueryParseError = function (e, t, r) {
1047
+ (this.name = 'QueryParseError'), (this.message = e), (this.start = t), (this.end = r);
1048
+ }),
1049
+ (e.QueryParseError.prototype = new Error()),
1050
+ (e.QueryLexer = function (e) {
1051
+ (this.lexemes = []),
1052
+ (this.str = e),
1053
+ (this.length = e.length),
1054
+ (this.pos = 0),
1055
+ (this.start = 0),
1056
+ (this.escapeCharPositions = []);
1057
+ }),
1058
+ (e.QueryLexer.prototype.run = function () {
1059
+ for (var t = e.QueryLexer.lexText; t; ) t = t(this);
1060
+ }),
1061
+ (e.QueryLexer.prototype.sliceString = function () {
1062
+ for (var e = [], t = this.start, r = this.pos, i = 0; i < this.escapeCharPositions.length; i++)
1063
+ (r = this.escapeCharPositions[i]), e.push(this.str.slice(t, r)), (t = r + 1);
1064
+ return e.push(this.str.slice(t, this.pos)), (this.escapeCharPositions.length = 0), e.join('');
1065
+ }),
1066
+ (e.QueryLexer.prototype.emit = function (e) {
1067
+ this.lexemes.push({ type: e, str: this.sliceString(), start: this.start, end: this.pos }),
1068
+ (this.start = this.pos);
1069
+ }),
1070
+ (e.QueryLexer.prototype.escapeCharacter = function () {
1071
+ this.escapeCharPositions.push(this.pos - 1), (this.pos += 1);
1072
+ }),
1073
+ (e.QueryLexer.prototype.next = function () {
1074
+ if (this.pos >= this.length) return e.QueryLexer.EOS;
1075
+ var t = this.str.charAt(this.pos);
1076
+ return (this.pos += 1), t;
1077
+ }),
1078
+ (e.QueryLexer.prototype.width = function () {
1079
+ return this.pos - this.start;
1080
+ }),
1081
+ (e.QueryLexer.prototype.ignore = function () {
1082
+ this.start == this.pos && (this.pos += 1), (this.start = this.pos);
1083
+ }),
1084
+ (e.QueryLexer.prototype.backup = function () {
1085
+ this.pos -= 1;
1086
+ }),
1087
+ (e.QueryLexer.prototype.acceptDigitRun = function () {
1088
+ var t, r;
1089
+ do (t = this.next()), (r = t.charCodeAt(0));
1090
+ while (r > 47 && r < 58);
1091
+ t != e.QueryLexer.EOS && this.backup();
1092
+ }),
1093
+ (e.QueryLexer.prototype.more = function () {
1094
+ return this.pos < this.length;
1095
+ }),
1096
+ (e.QueryLexer.EOS = 'EOS'),
1097
+ (e.QueryLexer.FIELD = 'FIELD'),
1098
+ (e.QueryLexer.TERM = 'TERM'),
1099
+ (e.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE'),
1100
+ (e.QueryLexer.BOOST = 'BOOST'),
1101
+ (e.QueryLexer.PRESENCE = 'PRESENCE'),
1102
+ (e.QueryLexer.lexField = function (t) {
1103
+ return t.backup(), t.emit(e.QueryLexer.FIELD), t.ignore(), e.QueryLexer.lexText;
1104
+ }),
1105
+ (e.QueryLexer.lexTerm = function (t) {
1106
+ if ((t.width() > 1 && (t.backup(), t.emit(e.QueryLexer.TERM)), t.ignore(), t.more())) return e.QueryLexer.lexText;
1107
+ }),
1108
+ (e.QueryLexer.lexEditDistance = function (t) {
1109
+ return t.ignore(), t.acceptDigitRun(), t.emit(e.QueryLexer.EDIT_DISTANCE), e.QueryLexer.lexText;
1110
+ }),
1111
+ (e.QueryLexer.lexBoost = function (t) {
1112
+ return t.ignore(), t.acceptDigitRun(), t.emit(e.QueryLexer.BOOST), e.QueryLexer.lexText;
1113
+ }),
1114
+ (e.QueryLexer.lexEOS = function (t) {
1115
+ t.width() > 0 && t.emit(e.QueryLexer.TERM);
1116
+ }),
1117
+ (e.QueryLexer.termSeparator = e.tokenizer.separator),
1118
+ (e.QueryLexer.lexText = function (t) {
1119
+ for (;;) {
1120
+ var r = t.next();
1121
+ if (r == e.QueryLexer.EOS) return e.QueryLexer.lexEOS;
1122
+ if (92 != r.charCodeAt(0)) {
1123
+ if (':' == r) return e.QueryLexer.lexField;
1124
+ if ('~' == r) return t.backup(), t.width() > 0 && t.emit(e.QueryLexer.TERM), e.QueryLexer.lexEditDistance;
1125
+ if ('^' == r) return t.backup(), t.width() > 0 && t.emit(e.QueryLexer.TERM), e.QueryLexer.lexBoost;
1126
+ if ('+' == r && 1 === t.width()) return t.emit(e.QueryLexer.PRESENCE), e.QueryLexer.lexText;
1127
+ if ('-' == r && 1 === t.width()) return t.emit(e.QueryLexer.PRESENCE), e.QueryLexer.lexText;
1128
+ if (r.match(e.QueryLexer.termSeparator)) return e.QueryLexer.lexTerm;
1129
+ } else t.escapeCharacter();
1130
+ }
1131
+ }),
1132
+ (e.QueryParser = function (t, r) {
1133
+ (this.lexer = new e.QueryLexer(t)), (this.query = r), (this.currentClause = {}), (this.lexemeIdx = 0);
1134
+ }),
1135
+ (e.QueryParser.prototype.parse = function () {
1136
+ this.lexer.run(), (this.lexemes = this.lexer.lexemes);
1137
+ for (var t = e.QueryParser.parseClause; t; ) t = t(this);
1138
+ return this.query;
1139
+ }),
1140
+ (e.QueryParser.prototype.peekLexeme = function () {
1141
+ return this.lexemes[this.lexemeIdx];
1142
+ }),
1143
+ (e.QueryParser.prototype.consumeLexeme = function () {
1144
+ var e = this.peekLexeme();
1145
+ return (this.lexemeIdx += 1), e;
1146
+ }),
1147
+ (e.QueryParser.prototype.nextClause = function () {
1148
+ var e = this.currentClause;
1149
+ this.query.clause(e), (this.currentClause = {});
1150
+ }),
1151
+ (e.QueryParser.parseClause = function (t) {
1152
+ var r = t.peekLexeme();
1153
+ if (void 0 != r)
1154
+ switch (r.type) {
1155
+ case e.QueryLexer.PRESENCE:
1156
+ return e.QueryParser.parsePresence;
1157
+ case e.QueryLexer.FIELD:
1158
+ return e.QueryParser.parseField;
1159
+ case e.QueryLexer.TERM:
1160
+ return e.QueryParser.parseTerm;
1161
+ default:
1162
+ var i = 'expected either a field or a term, found ' + r.type;
1163
+ throw (r.str.length >= 1 && (i += " with value '" + r.str + "'"), new e.QueryParseError(i, r.start, r.end));
1164
+ }
1165
+ }),
1166
+ (e.QueryParser.parsePresence = function (t) {
1167
+ var r = t.consumeLexeme();
1168
+ if (void 0 != r) {
1169
+ switch (r.str) {
1170
+ case '-':
1171
+ t.currentClause.presence = e.Query.presence.PROHIBITED;
1172
+ break;
1173
+ case '+':
1174
+ t.currentClause.presence = e.Query.presence.REQUIRED;
1175
+ break;
1176
+ default:
1177
+ var i = "unrecognised presence operator'" + r.str + "'";
1178
+ throw new e.QueryParseError(i, r.start, r.end);
1179
+ }
1180
+ var n = t.peekLexeme();
1181
+ if (void 0 == n) {
1182
+ var i = 'expecting term or field, found nothing';
1183
+ throw new e.QueryParseError(i, r.start, r.end);
1184
+ }
1185
+ switch (n.type) {
1186
+ case e.QueryLexer.FIELD:
1187
+ return e.QueryParser.parseField;
1188
+ case e.QueryLexer.TERM:
1189
+ return e.QueryParser.parseTerm;
1190
+ default:
1191
+ var i = "expecting term or field, found '" + n.type + "'";
1192
+ throw new e.QueryParseError(i, n.start, n.end);
1193
+ }
1194
+ }
1195
+ }),
1196
+ (e.QueryParser.parseField = function (t) {
1197
+ var r = t.consumeLexeme();
1198
+ if (void 0 != r) {
1199
+ if (t.query.allFields.indexOf(r.str) == -1) {
1200
+ var i = t.query.allFields
1201
+ .map(function (e) {
1202
+ return "'" + e + "'";
1203
+ })
1204
+ .join(', '),
1205
+ n = "unrecognised field '" + r.str + "', possible fields: " + i;
1206
+ throw new e.QueryParseError(n, r.start, r.end);
1207
+ }
1208
+ t.currentClause.fields = [r.str];
1209
+ var s = t.peekLexeme();
1210
+ if (void 0 == s) {
1211
+ var n = 'expecting term, found nothing';
1212
+ throw new e.QueryParseError(n, r.start, r.end);
1213
+ }
1214
+ switch (s.type) {
1215
+ case e.QueryLexer.TERM:
1216
+ return e.QueryParser.parseTerm;
1217
+ default:
1218
+ var n = "expecting term, found '" + s.type + "'";
1219
+ throw new e.QueryParseError(n, s.start, s.end);
1220
+ }
1221
+ }
1222
+ }),
1223
+ (e.QueryParser.parseTerm = function (t) {
1224
+ var r = t.consumeLexeme();
1225
+ if (void 0 != r) {
1226
+ (t.currentClause.term = r.str.toLowerCase()), r.str.indexOf('*') != -1 && (t.currentClause.usePipeline = !1);
1227
+ var i = t.peekLexeme();
1228
+ if (void 0 == i) return void t.nextClause();
1229
+ switch (i.type) {
1230
+ case e.QueryLexer.TERM:
1231
+ return t.nextClause(), e.QueryParser.parseTerm;
1232
+ case e.QueryLexer.FIELD:
1233
+ return t.nextClause(), e.QueryParser.parseField;
1234
+ case e.QueryLexer.EDIT_DISTANCE:
1235
+ return e.QueryParser.parseEditDistance;
1236
+ case e.QueryLexer.BOOST:
1237
+ return e.QueryParser.parseBoost;
1238
+ case e.QueryLexer.PRESENCE:
1239
+ return t.nextClause(), e.QueryParser.parsePresence;
1240
+ default:
1241
+ var n = "Unexpected lexeme type '" + i.type + "'";
1242
+ throw new e.QueryParseError(n, i.start, i.end);
1243
+ }
1244
+ }
1245
+ }),
1246
+ (e.QueryParser.parseEditDistance = function (t) {
1247
+ var r = t.consumeLexeme();
1248
+ if (void 0 != r) {
1249
+ var i = parseInt(r.str, 10);
1250
+ if (isNaN(i)) {
1251
+ var n = 'edit distance must be numeric';
1252
+ throw new e.QueryParseError(n, r.start, r.end);
1253
+ }
1254
+ t.currentClause.editDistance = i;
1255
+ var s = t.peekLexeme();
1256
+ if (void 0 == s) return void t.nextClause();
1257
+ switch (s.type) {
1258
+ case e.QueryLexer.TERM:
1259
+ return t.nextClause(), e.QueryParser.parseTerm;
1260
+ case e.QueryLexer.FIELD:
1261
+ return t.nextClause(), e.QueryParser.parseField;
1262
+ case e.QueryLexer.EDIT_DISTANCE:
1263
+ return e.QueryParser.parseEditDistance;
1264
+ case e.QueryLexer.BOOST:
1265
+ return e.QueryParser.parseBoost;
1266
+ case e.QueryLexer.PRESENCE:
1267
+ return t.nextClause(), e.QueryParser.parsePresence;
1268
+ default:
1269
+ var n = "Unexpected lexeme type '" + s.type + "'";
1270
+ throw new e.QueryParseError(n, s.start, s.end);
1271
+ }
1272
+ }
1273
+ }),
1274
+ (e.QueryParser.parseBoost = function (t) {
1275
+ var r = t.consumeLexeme();
1276
+ if (void 0 != r) {
1277
+ var i = parseInt(r.str, 10);
1278
+ if (isNaN(i)) {
1279
+ var n = 'boost must be numeric';
1280
+ throw new e.QueryParseError(n, r.start, r.end);
1281
+ }
1282
+ t.currentClause.boost = i;
1283
+ var s = t.peekLexeme();
1284
+ if (void 0 == s) return void t.nextClause();
1285
+ switch (s.type) {
1286
+ case e.QueryLexer.TERM:
1287
+ return t.nextClause(), e.QueryParser.parseTerm;
1288
+ case e.QueryLexer.FIELD:
1289
+ return t.nextClause(), e.QueryParser.parseField;
1290
+ case e.QueryLexer.EDIT_DISTANCE:
1291
+ return e.QueryParser.parseEditDistance;
1292
+ case e.QueryLexer.BOOST:
1293
+ return e.QueryParser.parseBoost;
1294
+ case e.QueryLexer.PRESENCE:
1295
+ return t.nextClause(), e.QueryParser.parsePresence;
1296
+ default:
1297
+ var n = "Unexpected lexeme type '" + s.type + "'";
1298
+ throw new e.QueryParseError(n, s.start, s.end);
1299
+ }
1300
+ }
1301
+ }),
1302
+ (function (e, t) {
1303
+ 'function' == typeof define && define.amd
1304
+ ? define(t)
1305
+ : 'object' == typeof exports
1306
+ ? (module.exports = t())
1307
+ : (e.lunr = t());
1308
+ })(this, function () {
1309
+ return e;
1310
+ });
1311
+ })();