monobill-mintui 0.6.612 → 0.6.613

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 (623) hide show
  1. package/README.md +76 -302
  2. package/bin/component-dependencies.json +131 -0
  3. package/bin/mint-ui.js +446 -0
  4. package/dist/alert.css +3 -0
  5. package/dist/back-button.css +3 -0
  6. package/dist/bottom-navigation.css +3 -0
  7. package/dist/button.css +3 -0
  8. package/dist/card.css +3 -0
  9. package/dist/chart.css +3 -0
  10. package/dist/checkbox.css +3 -0
  11. package/dist/chip.css +3 -0
  12. package/dist/choice.css +3 -0
  13. package/dist/clickable.css +3 -0
  14. package/dist/collapsible.css +3 -0
  15. package/dist/components/alert/Alert.d.ts +1 -32
  16. package/dist/components/alert/Alert.d.ts.map +10 -1
  17. package/dist/components/alert/browser.js +167 -0
  18. package/dist/components/alert/index.cjs +1 -0
  19. package/dist/components/alert/index.d.ts +1 -3
  20. package/dist/components/alert/index.d.ts.map +10 -1
  21. package/dist/components/alert/index.js +155 -0
  22. package/dist/components/back-button/BackButton.d.ts +1 -18
  23. package/dist/components/back-button/BackButton.d.ts.map +10 -1
  24. package/dist/components/back-button/browser.js +241 -0
  25. package/dist/components/back-button/index.cjs +1 -0
  26. package/dist/components/back-button/index.d.ts +1 -3
  27. package/dist/components/back-button/index.d.ts.map +10 -1
  28. package/dist/components/back-button/index.js +229 -0
  29. package/dist/components/bottom-navigation/BottomNavigation.d.ts +1 -10
  30. package/dist/components/bottom-navigation/BottomNavigation.d.ts.map +10 -1
  31. package/dist/components/bottom-navigation/browser.js +97 -0
  32. package/dist/components/bottom-navigation/index.cjs +1 -0
  33. package/dist/components/bottom-navigation/index.d.ts +2 -5
  34. package/dist/components/bottom-navigation/index.d.ts.map +10 -1
  35. package/dist/components/bottom-navigation/index.js +85 -0
  36. package/dist/components/button/Button.d.ts +1 -57
  37. package/dist/components/button/Button.d.ts.map +10 -1
  38. package/dist/components/button/browser.js +18 -0
  39. package/dist/components/button/index.cjs +1 -0
  40. package/dist/components/button/index.d.ts +1 -3
  41. package/dist/components/button/index.d.ts.map +10 -1
  42. package/dist/components/button/index.js +6 -0
  43. package/dist/components/card/Card.d.ts +1 -17
  44. package/dist/components/card/Card.d.ts.map +10 -1
  45. package/dist/components/card/browser.js +25 -0
  46. package/dist/components/card/index.cjs +1 -0
  47. package/dist/components/card/index.d.ts +1 -3
  48. package/dist/components/card/index.d.ts.map +10 -1
  49. package/dist/components/card/index.js +13 -0
  50. package/dist/components/chart/Chart.d.ts +1 -291
  51. package/dist/components/chart/Chart.d.ts.map +10 -1
  52. package/dist/components/chart/browser.js +1331 -0
  53. package/dist/components/chart/index.cjs +37 -0
  54. package/dist/components/chart/index.d.ts +1 -3
  55. package/dist/components/chart/index.d.ts.map +10 -1
  56. package/dist/components/chart/index.js +1319 -0
  57. package/dist/components/checkbox/Checkbox.d.ts +1 -41
  58. package/dist/components/checkbox/Checkbox.d.ts.map +10 -1
  59. package/dist/components/checkbox/browser.js +162 -0
  60. package/dist/components/checkbox/index.cjs +1 -0
  61. package/dist/components/checkbox/index.d.ts +1 -3
  62. package/dist/components/checkbox/index.d.ts.map +10 -1
  63. package/dist/components/checkbox/index.js +150 -0
  64. package/dist/components/chip/Chip.d.ts +1 -16
  65. package/dist/components/chip/Chip.d.ts.map +10 -1
  66. package/dist/components/chip/browser.js +17 -0
  67. package/dist/components/chip/index.cjs +1 -0
  68. package/dist/components/chip/index.d.ts +1 -3
  69. package/dist/components/chip/index.d.ts.map +10 -1
  70. package/dist/components/chip/index.js +5 -0
  71. package/dist/components/choice/Choice.d.ts +1 -27
  72. package/dist/components/choice/Choice.d.ts.map +10 -1
  73. package/dist/components/choice/browser.js +272 -0
  74. package/dist/components/choice/index.cjs +1 -0
  75. package/dist/components/choice/index.d.ts +1 -5
  76. package/dist/components/choice/index.d.ts.map +10 -1
  77. package/dist/components/choice/index.js +260 -0
  78. package/dist/components/chunks/button-B0Yt0MX1.js +380 -0
  79. package/dist/components/chunks/button-BlbLHMts.js +1 -0
  80. package/dist/components/chunks/caret-down-BN9cl4o4.js +1 -0
  81. package/dist/components/chunks/caret-down-Ch6IfR7r.js +9 -0
  82. package/dist/components/chunks/caret-right-CDUwqoen.js +1 -0
  83. package/dist/components/chunks/caret-right-CVOgr4nk.js +9 -0
  84. package/dist/components/chunks/caret-up-3XCuTXSE.js +1 -0
  85. package/dist/components/chunks/caret-up-D_6oa7o1.js +9 -0
  86. package/dist/components/chunks/chip-B04bJM4r.js +1 -0
  87. package/dist/components/chunks/chip-B9whjEvW.js +54 -0
  88. package/dist/components/chunks/close-5tYlQdkk.js +1 -0
  89. package/dist/components/chunks/close-Dg6U0IjZ.js +10 -0
  90. package/dist/components/chunks/icon-C0OLmjDY.js +1 -0
  91. package/dist/components/chunks/icon-CyzR9aVl.js +1 -0
  92. package/dist/components/chunks/icon-dG8sLTBn.js +27 -0
  93. package/dist/components/chunks/icon-gQAtsERy.js +1324 -0
  94. package/dist/components/chunks/input-8bbXzpa5.js +334 -0
  95. package/dist/components/chunks/input-BoiREc6Y.js +1 -0
  96. package/dist/components/chunks/link-BxhPnVaz.js +1 -0
  97. package/dist/components/chunks/link-DKgtBYK6.js +38 -0
  98. package/dist/components/chunks/modal-B8gNdwEl.js +153 -0
  99. package/dist/components/chunks/modal-WYWvk2lZ.js +1 -0
  100. package/dist/components/chunks/popover-BeaGf_JC.js +1 -0
  101. package/dist/components/chunks/popover-gviDCspV.js +188 -0
  102. package/dist/components/chunks/register-element-BFYmIynH.js +53 -0
  103. package/dist/components/chunks/register-element-tCL_F1YI.js +1 -0
  104. package/dist/components/chunks/search-ANUKQi0r.js +9 -0
  105. package/dist/components/chunks/search-B3egXuw4.js +1 -0
  106. package/dist/components/chunks/spinner-BsaFHuS6.js +108 -0
  107. package/dist/components/chunks/spinner-DbTohC6i.js +63 -0
  108. package/dist/components/chunks/stack-D1uh4L79.js +1 -0
  109. package/dist/components/chunks/stack-DyQfjPDh.js +53 -0
  110. package/dist/components/chunks/table-BgboosRK.js +65 -0
  111. package/dist/components/chunks/table-DDUNUwGd.js +1 -0
  112. package/dist/components/chunks/text-BHkEs8U5.js +67 -0
  113. package/dist/components/chunks/text-BmHZbBMo.js +1 -0
  114. package/dist/components/clickable/Clickable.d.ts +1 -14
  115. package/dist/components/clickable/Clickable.d.ts.map +10 -1
  116. package/dist/components/clickable/browser.js +78 -0
  117. package/dist/components/clickable/index.cjs +1 -0
  118. package/dist/components/clickable/index.d.ts +1 -3
  119. package/dist/components/clickable/index.d.ts.map +10 -1
  120. package/dist/components/clickable/index.js +66 -0
  121. package/dist/components/collapsible/Collapsible.d.ts +1 -28
  122. package/dist/components/collapsible/Collapsible.d.ts.map +10 -1
  123. package/dist/components/collapsible/browser.js +170 -0
  124. package/dist/components/collapsible/index.cjs +1 -0
  125. package/dist/components/collapsible/index.d.ts +1 -3
  126. package/dist/components/collapsible/index.d.ts.map +10 -1
  127. package/dist/components/collapsible/index.js +158 -0
  128. package/dist/components/confirm-action/ConfirmAction.d.ts +1 -27
  129. package/dist/components/confirm-action/ConfirmAction.d.ts.map +10 -1
  130. package/dist/components/confirm-action/browser.js +130 -0
  131. package/dist/components/confirm-action/index.cjs +1 -0
  132. package/dist/components/confirm-action/index.d.ts +2 -3
  133. package/dist/components/confirm-action/index.d.ts.map +10 -1
  134. package/dist/components/confirm-action/index.js +118 -0
  135. package/dist/components/date-picker/DatePicker.d.ts +1 -130
  136. package/dist/components/date-picker/DatePicker.d.ts.map +10 -1
  137. package/dist/components/date-picker/browser.js +1288 -0
  138. package/dist/components/date-picker/index.cjs +1 -0
  139. package/dist/components/date-picker/index.d.ts +1 -3
  140. package/dist/components/date-picker/index.d.ts.map +10 -1
  141. package/dist/components/date-picker/index.js +1276 -0
  142. package/dist/components/dropzone/Dropzone.d.ts +1 -59
  143. package/dist/components/dropzone/Dropzone.d.ts.map +10 -1
  144. package/dist/components/dropzone/browser.js +355 -0
  145. package/dist/components/dropzone/index.cjs +1 -0
  146. package/dist/components/dropzone/index.d.ts +1 -3
  147. package/dist/components/dropzone/index.d.ts.map +10 -1
  148. package/dist/components/dropzone/index.js +343 -0
  149. package/dist/components/form/Form.d.ts +1 -133
  150. package/dist/components/form/Form.d.ts.map +10 -1
  151. package/dist/components/form/browser.js +1002 -0
  152. package/dist/components/form/index.cjs +1 -0
  153. package/dist/components/form/index.d.ts +1 -3
  154. package/dist/components/form/index.d.ts.map +10 -1
  155. package/dist/components/form/index.js +990 -0
  156. package/dist/components/grid/Grid.d.ts +1 -16
  157. package/dist/components/grid/Grid.d.ts.map +10 -1
  158. package/dist/components/grid/browser.js +24 -0
  159. package/dist/components/grid/index.cjs +1 -0
  160. package/dist/components/grid/index.d.ts +1 -3
  161. package/dist/components/grid/index.d.ts.map +10 -1
  162. package/dist/components/grid/index.js +12 -0
  163. package/dist/components/icon/Icon.d.ts +1 -16
  164. package/dist/components/icon/Icon.d.ts.map +10 -1
  165. package/dist/components/icon/browser.js +16 -0
  166. package/dist/components/icon/index.cjs +1 -0
  167. package/dist/components/icon/index.d.ts +2 -3
  168. package/dist/components/icon/index.d.ts.map +10 -1
  169. package/dist/components/icon/index.js +4 -0
  170. package/dist/components/input/Input.d.ts +1 -68
  171. package/dist/components/input/Input.d.ts.map +10 -1
  172. package/dist/components/input/browser.js +17 -0
  173. package/dist/components/input/index.cjs +1 -0
  174. package/dist/components/input/index.d.ts +1 -3
  175. package/dist/components/input/index.d.ts.map +10 -1
  176. package/dist/components/input/index.js +5 -0
  177. package/dist/components/link/Link.d.ts +1 -16
  178. package/dist/components/link/Link.d.ts.map +10 -1
  179. package/dist/components/link/browser.js +16 -0
  180. package/dist/components/link/index.cjs +1 -0
  181. package/dist/components/link/index.d.ts +1 -3
  182. package/dist/components/link/index.d.ts.map +10 -1
  183. package/dist/components/link/index.js +4 -0
  184. package/dist/components/modal/Modal.d.ts +1 -38
  185. package/dist/components/modal/Modal.d.ts.map +10 -1
  186. package/dist/components/modal/browser.js +21 -0
  187. package/dist/components/modal/index.cjs +1 -0
  188. package/dist/components/modal/index.d.ts +1 -3
  189. package/dist/components/modal/index.d.ts.map +10 -1
  190. package/dist/components/modal/index.js +9 -0
  191. package/dist/components/navigation/Navigation.d.ts +1 -0
  192. package/dist/components/navigation/Navigation.d.ts.map +10 -0
  193. package/dist/components/navigation/browser.js +198 -0
  194. package/dist/components/navigation/index.cjs +1 -0
  195. package/dist/components/navigation/index.d.ts +1 -0
  196. package/dist/components/navigation/index.d.ts.map +10 -0
  197. package/dist/components/navigation/index.js +186 -0
  198. package/dist/components/off-canvas/OffCanvas.d.ts +1 -46
  199. package/dist/components/off-canvas/OffCanvas.d.ts.map +10 -1
  200. package/dist/components/off-canvas/browser.js +192 -0
  201. package/dist/components/off-canvas/index.cjs +1 -0
  202. package/dist/components/off-canvas/index.d.ts +1 -3
  203. package/dist/components/off-canvas/index.d.ts.map +10 -1
  204. package/dist/components/off-canvas/index.js +180 -0
  205. package/dist/components/page/Page.d.ts +1 -37
  206. package/dist/components/page/Page.d.ts.map +10 -1
  207. package/dist/components/page/browser.js +74 -0
  208. package/dist/components/page/index.cjs +16 -0
  209. package/dist/components/page/index.d.ts +1 -3
  210. package/dist/components/page/index.d.ts.map +10 -1
  211. package/dist/components/page/index.js +62 -0
  212. package/dist/components/popover/Popover.d.ts +1 -64
  213. package/dist/components/popover/Popover.d.ts.map +10 -1
  214. package/dist/components/popover/browser.js +17 -0
  215. package/dist/components/popover/index.cjs +1 -0
  216. package/dist/components/popover/index.d.ts +1 -3
  217. package/dist/components/popover/index.d.ts.map +10 -1
  218. package/dist/components/popover/index.js +5 -0
  219. package/dist/components/resource-table/ResourceTable.d.ts +1 -327
  220. package/dist/components/resource-table/ResourceTable.d.ts.map +10 -1
  221. package/dist/components/resource-table/browser.js +1457 -0
  222. package/dist/components/resource-table/index.cjs +2 -0
  223. package/dist/components/resource-table/index.d.ts +1 -4
  224. package/dist/components/resource-table/index.d.ts.map +10 -1
  225. package/dist/components/resource-table/index.js +1445 -0
  226. package/dist/components/search/Search.d.ts +1 -151
  227. package/dist/components/search/Search.d.ts.map +10 -1
  228. package/dist/components/search/browser.js +681 -0
  229. package/dist/components/search/index.cjs +1 -0
  230. package/dist/components/search/index.d.ts +1 -3
  231. package/dist/components/search/index.d.ts.map +10 -1
  232. package/dist/components/search/index.js +669 -0
  233. package/dist/components/select/Select.d.ts +1 -37
  234. package/dist/components/select/Select.d.ts.map +10 -1
  235. package/dist/components/select/browser.js +285 -0
  236. package/dist/components/select/index.cjs +1 -0
  237. package/dist/components/select/index.d.ts +1 -3
  238. package/dist/components/select/index.d.ts.map +10 -1
  239. package/dist/components/select/index.js +273 -0
  240. package/dist/components/side-navigation/SideNavigation.d.ts +1 -52
  241. package/dist/components/side-navigation/SideNavigation.d.ts.map +10 -1
  242. package/dist/components/side-navigation/browser.js +466 -0
  243. package/dist/components/side-navigation/index.cjs +1 -0
  244. package/dist/components/side-navigation/index.d.ts +5 -8
  245. package/dist/components/side-navigation/index.d.ts.map +10 -1
  246. package/dist/components/side-navigation/index.js +454 -0
  247. package/dist/components/sortable/Sortable.d.ts +1 -62
  248. package/dist/components/sortable/Sortable.d.ts.map +10 -1
  249. package/dist/components/sortable/browser.js +340 -0
  250. package/dist/components/sortable/index.cjs +1 -0
  251. package/dist/components/sortable/index.d.ts +1 -3
  252. package/dist/components/sortable/index.d.ts.map +10 -1
  253. package/dist/components/sortable/index.js +328 -0
  254. package/dist/components/spinner/Spinner.d.ts +1 -13
  255. package/dist/components/spinner/Spinner.d.ts.map +10 -1
  256. package/dist/components/spinner/browser.js +16 -0
  257. package/dist/components/spinner/index.cjs +1 -0
  258. package/dist/components/spinner/index.d.ts +1 -3
  259. package/dist/components/spinner/index.d.ts.map +10 -1
  260. package/dist/components/spinner/index.js +4 -0
  261. package/dist/components/stack/Stack.d.ts +1 -23
  262. package/dist/components/stack/Stack.d.ts.map +10 -1
  263. package/dist/components/stack/browser.js +16 -0
  264. package/dist/components/stack/index.cjs +1 -0
  265. package/dist/components/stack/index.d.ts +1 -3
  266. package/dist/components/stack/index.d.ts.map +10 -1
  267. package/dist/components/stack/index.js +4 -0
  268. package/dist/components/switch/Switch.d.ts +1 -33
  269. package/dist/components/switch/Switch.d.ts.map +10 -1
  270. package/dist/components/switch/browser.js +203 -0
  271. package/dist/components/switch/index.cjs +1 -0
  272. package/dist/components/switch/index.d.ts +1 -3
  273. package/dist/components/switch/index.d.ts.map +10 -1
  274. package/dist/components/switch/index.js +191 -0
  275. package/dist/components/table/Table.d.ts +1 -11
  276. package/dist/components/table/Table.d.ts.map +10 -1
  277. package/dist/components/table/browser.js +16 -0
  278. package/dist/components/table/index.cjs +1 -0
  279. package/dist/components/table/index.d.ts +1 -3
  280. package/dist/components/table/index.d.ts.map +10 -1
  281. package/dist/components/table/index.js +4 -0
  282. package/dist/components/tabs/Tabs.d.ts +1 -20
  283. package/dist/components/tabs/Tabs.d.ts.map +10 -1
  284. package/dist/components/tabs/browser.js +251 -0
  285. package/dist/components/tabs/index.cjs +1 -0
  286. package/dist/components/tabs/index.d.ts +4 -9
  287. package/dist/components/tabs/index.d.ts.map +10 -1
  288. package/dist/components/tabs/index.js +239 -0
  289. package/dist/components/tags/Tags.d.ts +1 -82
  290. package/dist/components/tags/Tags.d.ts.map +10 -1
  291. package/dist/components/tags/browser.js +416 -0
  292. package/dist/components/tags/index.cjs +1 -0
  293. package/dist/components/tags/index.d.ts +1 -3
  294. package/dist/components/tags/index.d.ts.map +10 -1
  295. package/dist/components/tags/index.js +404 -0
  296. package/dist/components/text/Text.d.ts +1 -25
  297. package/dist/components/text/Text.d.ts.map +10 -1
  298. package/dist/components/text/browser.js +16 -0
  299. package/dist/components/text/index.cjs +1 -0
  300. package/dist/components/text/index.d.ts +1 -3
  301. package/dist/components/text/index.d.ts.map +10 -1
  302. package/dist/components/text/index.js +4 -0
  303. package/dist/components/time-picker/TimePicker.d.ts +1 -61
  304. package/dist/components/time-picker/TimePicker.d.ts.map +10 -1
  305. package/dist/components/time-picker/browser.js +366 -0
  306. package/dist/components/time-picker/index.cjs +1 -0
  307. package/dist/components/time-picker/index.d.ts +1 -3
  308. package/dist/components/time-picker/index.d.ts.map +10 -1
  309. package/dist/components/time-picker/index.js +354 -0
  310. package/dist/components/toast/Toast.d.ts +1 -21
  311. package/dist/components/toast/Toast.d.ts.map +10 -1
  312. package/dist/components/toast/browser.js +147 -0
  313. package/dist/components/toast/index.cjs +3 -0
  314. package/dist/components/toast/index.d.ts +3 -3
  315. package/dist/components/toast/index.d.ts.map +10 -1
  316. package/dist/components/toast/index.js +135 -0
  317. package/dist/confirm-action.css +3 -0
  318. package/dist/date-picker.css +3 -0
  319. package/dist/dropzone.css +3 -0
  320. package/dist/form.css +3 -0
  321. package/dist/grid.css +3 -0
  322. package/dist/icon.css +3 -0
  323. package/dist/icons/ai.svg +5 -6
  324. package/dist/icons/bank.svg +1 -1
  325. package/dist/icons/barcode.svg +1 -1
  326. package/dist/icons/basket.svg +1 -1
  327. package/dist/icons/building.svg +1 -1
  328. package/dist/icons/buildings.svg +1 -1
  329. package/dist/icons/calendar.svg +1 -1
  330. package/dist/icons/cash.svg +3 -0
  331. package/dist/icons/check.svg +1 -1
  332. package/dist/icons/close.svg +1 -1
  333. package/dist/icons/coupon.svg +3 -0
  334. package/dist/icons/delivery-location.svg +3 -0
  335. package/dist/icons/desktop.svg +3 -0
  336. package/dist/icons/dollar-sign.svg +1 -1
  337. package/dist/icons/edit.svg +1 -1
  338. package/dist/icons/gift.svg +3 -0
  339. package/dist/icons/grip-lines.svg +2 -2
  340. package/dist/icons/heart.svg +3 -0
  341. package/dist/icons/installments.svg +3 -0
  342. package/dist/icons/inventory.svg +3 -0
  343. package/dist/icons/invoice.svg +3 -0
  344. package/dist/icons/loyalty-points.svg +3 -0
  345. package/dist/icons/membership.svg +3 -0
  346. package/dist/icons/mobile.svg +3 -0
  347. package/dist/icons/order-tracking.svg +7 -0
  348. package/dist/icons/out-of-stock.svg +3 -0
  349. package/dist/icons/package.svg +3 -0
  350. package/dist/icons/percent-discount.svg +3 -0
  351. package/dist/icons/pickup.svg +3 -0
  352. package/dist/icons/plus.svg +1 -1
  353. package/dist/icons/price-label.svg +3 -0
  354. package/dist/icons/product-review.svg +3 -0
  355. package/dist/icons/receipt.svg +3 -0
  356. package/dist/icons/refund.svg +3 -0
  357. package/dist/icons/remove.svg +1 -1
  358. package/dist/icons/return.svg +3 -0
  359. package/dist/icons/sale-burst.svg +3 -0
  360. package/dist/icons/secure-checkout.svg +3 -0
  361. package/dist/icons/shopping-bag.svg +3 -0
  362. package/dist/icons/shopping-cart.svg +3 -0
  363. package/dist/icons/storefront.svg +3 -0
  364. package/dist/icons/support.svg +3 -0
  365. package/dist/icons/tablet.svg +3 -0
  366. package/dist/icons/wallet.svg +3 -0
  367. package/dist/icons/warehouse.svg +3 -0
  368. package/dist/index.cjs +83 -79
  369. package/dist/index.css +253 -0
  370. package/dist/index.d.ts +94 -91
  371. package/dist/index.d.ts.map +10 -1
  372. package/dist/index.js +10695 -10239
  373. package/dist/input.css +3 -0
  374. package/dist/link.css +3 -0
  375. package/dist/mintui-elements.d.ts +156 -0
  376. package/dist/mintui-elements.d.ts.map +10 -0
  377. package/dist/modal.css +3 -0
  378. package/dist/navigation.css +3 -0
  379. package/dist/off-canvas.css +3 -0
  380. package/dist/page.css +3 -0
  381. package/dist/popover.css +3 -0
  382. package/dist/resource-table.css +3 -0
  383. package/dist/search.css +3 -0
  384. package/dist/select.css +3 -0
  385. package/dist/side-navigation.css +3 -0
  386. package/dist/sortable.css +3 -0
  387. package/dist/spinner.css +3 -0
  388. package/dist/stack.css +3 -0
  389. package/dist/switch.css +3 -0
  390. package/dist/table.css +3 -0
  391. package/dist/tabs.css +3 -0
  392. package/dist/tags.css +3 -0
  393. package/dist/text.css +3 -0
  394. package/dist/theme.css +101 -0
  395. package/dist/time-picker.css +3 -0
  396. package/dist/toast.css +3 -0
  397. package/package.json +379 -30
  398. package/dist/components/bottom-navigation/BottomNavItem.d.ts +0 -14
  399. package/dist/components/bottom-navigation/BottomNavItem.d.ts.map +0 -1
  400. package/dist/components/choice/ChoiceOption.d.ts +0 -30
  401. package/dist/components/choice/ChoiceOption.d.ts.map +0 -1
  402. package/dist/components/confirm-action/ConfirmActionApi.d.ts +0 -17
  403. package/dist/components/confirm-action/ConfirmActionApi.d.ts.map +0 -1
  404. package/dist/components/icon/build-icons.d.ts +0 -2
  405. package/dist/components/icon/build-icons.d.ts.map +0 -1
  406. package/dist/components/icon/icons/ai.d.ts +0 -3
  407. package/dist/components/icon/icons/ai.d.ts.map +0 -1
  408. package/dist/components/icon/icons/archive.d.ts +0 -3
  409. package/dist/components/icon/icons/archive.d.ts.map +0 -1
  410. package/dist/components/icon/icons/arrow-down.d.ts +0 -3
  411. package/dist/components/icon/icons/arrow-down.d.ts.map +0 -1
  412. package/dist/components/icon/icons/arrow-left.d.ts +0 -3
  413. package/dist/components/icon/icons/arrow-left.d.ts.map +0 -1
  414. package/dist/components/icon/icons/arrow-right.d.ts +0 -3
  415. package/dist/components/icon/icons/arrow-right.d.ts.map +0 -1
  416. package/dist/components/icon/icons/arrow-up.d.ts +0 -3
  417. package/dist/components/icon/icons/arrow-up.d.ts.map +0 -1
  418. package/dist/components/icon/icons/attach.d.ts +0 -3
  419. package/dist/components/icon/icons/attach.d.ts.map +0 -1
  420. package/dist/components/icon/icons/bank.d.ts +0 -3
  421. package/dist/components/icon/icons/bank.d.ts.map +0 -1
  422. package/dist/components/icon/icons/barcode.d.ts +0 -3
  423. package/dist/components/icon/icons/barcode.d.ts.map +0 -1
  424. package/dist/components/icon/icons/basket.d.ts +0 -3
  425. package/dist/components/icon/icons/basket.d.ts.map +0 -1
  426. package/dist/components/icon/icons/bookmark.d.ts +0 -3
  427. package/dist/components/icon/icons/bookmark.d.ts.map +0 -1
  428. package/dist/components/icon/icons/building.d.ts +0 -3
  429. package/dist/components/icon/icons/building.d.ts.map +0 -1
  430. package/dist/components/icon/icons/buildings.d.ts +0 -3
  431. package/dist/components/icon/icons/buildings.d.ts.map +0 -1
  432. package/dist/components/icon/icons/bullhorn.d.ts +0 -3
  433. package/dist/components/icon/icons/bullhorn.d.ts.map +0 -1
  434. package/dist/components/icon/icons/calendar-day.d.ts +0 -3
  435. package/dist/components/icon/icons/calendar-day.d.ts.map +0 -1
  436. package/dist/components/icon/icons/calendar-empty.d.ts +0 -3
  437. package/dist/components/icon/icons/calendar-empty.d.ts.map +0 -1
  438. package/dist/components/icon/icons/calendar-week.d.ts +0 -3
  439. package/dist/components/icon/icons/calendar-week.d.ts.map +0 -1
  440. package/dist/components/icon/icons/calendar.d.ts +0 -3
  441. package/dist/components/icon/icons/calendar.d.ts.map +0 -1
  442. package/dist/components/icon/icons/caret-down.d.ts +0 -3
  443. package/dist/components/icon/icons/caret-down.d.ts.map +0 -1
  444. package/dist/components/icon/icons/caret-left.d.ts +0 -3
  445. package/dist/components/icon/icons/caret-left.d.ts.map +0 -1
  446. package/dist/components/icon/icons/caret-right.d.ts +0 -3
  447. package/dist/components/icon/icons/caret-right.d.ts.map +0 -1
  448. package/dist/components/icon/icons/caret-up.d.ts +0 -3
  449. package/dist/components/icon/icons/caret-up.d.ts.map +0 -1
  450. package/dist/components/icon/icons/chart-bar.d.ts +0 -3
  451. package/dist/components/icon/icons/chart-bar.d.ts.map +0 -1
  452. package/dist/components/icon/icons/chart-line.d.ts +0 -3
  453. package/dist/components/icon/icons/chart-line.d.ts.map +0 -1
  454. package/dist/components/icon/icons/chat.d.ts +0 -3
  455. package/dist/components/icon/icons/chat.d.ts.map +0 -1
  456. package/dist/components/icon/icons/check.d.ts +0 -3
  457. package/dist/components/icon/icons/check.d.ts.map +0 -1
  458. package/dist/components/icon/icons/clock.d.ts +0 -3
  459. package/dist/components/icon/icons/clock.d.ts.map +0 -1
  460. package/dist/components/icon/icons/close.d.ts +0 -3
  461. package/dist/components/icon/icons/close.d.ts.map +0 -1
  462. package/dist/components/icon/icons/copy.d.ts +0 -3
  463. package/dist/components/icon/icons/copy.d.ts.map +0 -1
  464. package/dist/components/icon/icons/credit-card.d.ts +0 -3
  465. package/dist/components/icon/icons/credit-card.d.ts.map +0 -1
  466. package/dist/components/icon/icons/delete.d.ts +0 -3
  467. package/dist/components/icon/icons/delete.d.ts.map +0 -1
  468. package/dist/components/icon/icons/desktop-screen.d.ts +0 -3
  469. package/dist/components/icon/icons/desktop-screen.d.ts.map +0 -1
  470. package/dist/components/icon/icons/documentation.d.ts +0 -3
  471. package/dist/components/icon/icons/documentation.d.ts.map +0 -1
  472. package/dist/components/icon/icons/dollar-sign.d.ts +0 -3
  473. package/dist/components/icon/icons/dollar-sign.d.ts.map +0 -1
  474. package/dist/components/icon/icons/download.d.ts +0 -3
  475. package/dist/components/icon/icons/download.d.ts.map +0 -1
  476. package/dist/components/icon/icons/duplicate.d.ts +0 -3
  477. package/dist/components/icon/icons/duplicate.d.ts.map +0 -1
  478. package/dist/components/icon/icons/edit.d.ts +0 -3
  479. package/dist/components/icon/icons/edit.d.ts.map +0 -1
  480. package/dist/components/icon/icons/ellipsis.d.ts +0 -3
  481. package/dist/components/icon/icons/ellipsis.d.ts.map +0 -1
  482. package/dist/components/icon/icons/error.d.ts +0 -3
  483. package/dist/components/icon/icons/error.d.ts.map +0 -1
  484. package/dist/components/icon/icons/external-link.d.ts +0 -3
  485. package/dist/components/icon/icons/external-link.d.ts.map +0 -1
  486. package/dist/components/icon/icons/eye.d.ts +0 -3
  487. package/dist/components/icon/icons/eye.d.ts.map +0 -1
  488. package/dist/components/icon/icons/file.d.ts +0 -3
  489. package/dist/components/icon/icons/file.d.ts.map +0 -1
  490. package/dist/components/icon/icons/filter.d.ts +0 -3
  491. package/dist/components/icon/icons/filter.d.ts.map +0 -1
  492. package/dist/components/icon/icons/folder.d.ts +0 -3
  493. package/dist/components/icon/icons/folder.d.ts.map +0 -1
  494. package/dist/components/icon/icons/gavel.d.ts +0 -3
  495. package/dist/components/icon/icons/gavel.d.ts.map +0 -1
  496. package/dist/components/icon/icons/globe.d.ts +0 -3
  497. package/dist/components/icon/icons/globe.d.ts.map +0 -1
  498. package/dist/components/icon/icons/grid.d.ts +0 -3
  499. package/dist/components/icon/icons/grid.d.ts.map +0 -1
  500. package/dist/components/icon/icons/grip-lines.d.ts +0 -3
  501. package/dist/components/icon/icons/grip-lines.d.ts.map +0 -1
  502. package/dist/components/icon/icons/help.d.ts +0 -3
  503. package/dist/components/icon/icons/help.d.ts.map +0 -1
  504. package/dist/components/icon/icons/home.d.ts +0 -3
  505. package/dist/components/icon/icons/home.d.ts.map +0 -1
  506. package/dist/components/icon/icons/image.d.ts +0 -3
  507. package/dist/components/icon/icons/image.d.ts.map +0 -1
  508. package/dist/components/icon/icons/index.cjs +0 -34
  509. package/dist/components/icon/icons/index.d.ts +0 -92
  510. package/dist/components/icon/icons/index.d.ts.map +0 -1
  511. package/dist/components/icon/icons/index.js +0 -752
  512. package/dist/components/icon/icons/info.d.ts +0 -3
  513. package/dist/components/icon/icons/info.d.ts.map +0 -1
  514. package/dist/components/icon/icons/language.d.ts +0 -3
  515. package/dist/components/icon/icons/language.d.ts.map +0 -1
  516. package/dist/components/icon/icons/line-chart.d.ts +0 -3
  517. package/dist/components/icon/icons/line-chart.d.ts.map +0 -1
  518. package/dist/components/icon/icons/link.d.ts +0 -3
  519. package/dist/components/icon/icons/link.d.ts.map +0 -1
  520. package/dist/components/icon/icons/list.d.ts +0 -3
  521. package/dist/components/icon/icons/list.d.ts.map +0 -1
  522. package/dist/components/icon/icons/location.d.ts +0 -3
  523. package/dist/components/icon/icons/location.d.ts.map +0 -1
  524. package/dist/components/icon/icons/lock.d.ts +0 -3
  525. package/dist/components/icon/icons/lock.d.ts.map +0 -1
  526. package/dist/components/icon/icons/login.d.ts +0 -3
  527. package/dist/components/icon/icons/login.d.ts.map +0 -1
  528. package/dist/components/icon/icons/logout.d.ts +0 -3
  529. package/dist/components/icon/icons/logout.d.ts.map +0 -1
  530. package/dist/components/icon/icons/mail.d.ts +0 -3
  531. package/dist/components/icon/icons/mail.d.ts.map +0 -1
  532. package/dist/components/icon/icons/map.d.ts +0 -3
  533. package/dist/components/icon/icons/map.d.ts.map +0 -1
  534. package/dist/components/icon/icons/menu.d.ts +0 -3
  535. package/dist/components/icon/icons/menu.d.ts.map +0 -1
  536. package/dist/components/icon/icons/moon.d.ts +0 -3
  537. package/dist/components/icon/icons/moon.d.ts.map +0 -1
  538. package/dist/components/icon/icons/notifications.d.ts +0 -3
  539. package/dist/components/icon/icons/notifications.d.ts.map +0 -1
  540. package/dist/components/icon/icons/paste.d.ts +0 -3
  541. package/dist/components/icon/icons/paste.d.ts.map +0 -1
  542. package/dist/components/icon/icons/pin.d.ts +0 -3
  543. package/dist/components/icon/icons/pin.d.ts.map +0 -1
  544. package/dist/components/icon/icons/plus.d.ts +0 -3
  545. package/dist/components/icon/icons/plus.d.ts.map +0 -1
  546. package/dist/components/icon/icons/print.d.ts +0 -3
  547. package/dist/components/icon/icons/print.d.ts.map +0 -1
  548. package/dist/components/icon/icons/refresh.d.ts +0 -3
  549. package/dist/components/icon/icons/refresh.d.ts.map +0 -1
  550. package/dist/components/icon/icons/remove.d.ts +0 -3
  551. package/dist/components/icon/icons/remove.d.ts.map +0 -1
  552. package/dist/components/icon/icons/save.d.ts +0 -3
  553. package/dist/components/icon/icons/save.d.ts.map +0 -1
  554. package/dist/components/icon/icons/search.d.ts +0 -3
  555. package/dist/components/icon/icons/search.d.ts.map +0 -1
  556. package/dist/components/icon/icons/settings.d.ts +0 -3
  557. package/dist/components/icon/icons/settings.d.ts.map +0 -1
  558. package/dist/components/icon/icons/share.d.ts +0 -3
  559. package/dist/components/icon/icons/share.d.ts.map +0 -1
  560. package/dist/components/icon/icons/sort-arrows.d.ts +0 -3
  561. package/dist/components/icon/icons/sort-arrows.d.ts.map +0 -1
  562. package/dist/components/icon/icons/sort.d.ts +0 -3
  563. package/dist/components/icon/icons/sort.d.ts.map +0 -1
  564. package/dist/components/icon/icons/star.d.ts +0 -3
  565. package/dist/components/icon/icons/star.d.ts.map +0 -1
  566. package/dist/components/icon/icons/success.d.ts +0 -3
  567. package/dist/components/icon/icons/success.d.ts.map +0 -1
  568. package/dist/components/icon/icons/sun.d.ts +0 -3
  569. package/dist/components/icon/icons/sun.d.ts.map +0 -1
  570. package/dist/components/icon/icons/table.d.ts +0 -3
  571. package/dist/components/icon/icons/table.d.ts.map +0 -1
  572. package/dist/components/icon/icons/tag.d.ts +0 -3
  573. package/dist/components/icon/icons/tag.d.ts.map +0 -1
  574. package/dist/components/icon/icons/trash.d.ts +0 -3
  575. package/dist/components/icon/icons/trash.d.ts.map +0 -1
  576. package/dist/components/icon/icons/truck.d.ts +0 -3
  577. package/dist/components/icon/icons/truck.d.ts.map +0 -1
  578. package/dist/components/icon/icons/unlock.d.ts +0 -3
  579. package/dist/components/icon/icons/unlock.d.ts.map +0 -1
  580. package/dist/components/icon/icons/upload.d.ts +0 -3
  581. package/dist/components/icon/icons/upload.d.ts.map +0 -1
  582. package/dist/components/icon/icons/user-add.d.ts +0 -3
  583. package/dist/components/icon/icons/user-add.d.ts.map +0 -1
  584. package/dist/components/icon/icons/user.d.ts +0 -3
  585. package/dist/components/icon/icons/user.d.ts.map +0 -1
  586. package/dist/components/icon/icons/users.d.ts +0 -3
  587. package/dist/components/icon/icons/users.d.ts.map +0 -1
  588. package/dist/components/icon/icons/video.d.ts +0 -3
  589. package/dist/components/icon/icons/video.d.ts.map +0 -1
  590. package/dist/components/icon/icons/warning.d.ts +0 -3
  591. package/dist/components/icon/icons/warning.d.ts.map +0 -1
  592. package/dist/components/icon/registry.d.ts +0 -15
  593. package/dist/components/icon/registry.d.ts.map +0 -1
  594. package/dist/components/resource-table/ResourceTableContextMenu.d.ts +0 -40
  595. package/dist/components/resource-table/ResourceTableContextMenu.d.ts.map +0 -1
  596. package/dist/components/side-navigation/SideNavigationActionHeader.d.ts +0 -2
  597. package/dist/components/side-navigation/SideNavigationActionHeader.d.ts.map +0 -1
  598. package/dist/components/side-navigation/SideNavigationActionLinks.d.ts +0 -9
  599. package/dist/components/side-navigation/SideNavigationActionLinks.d.ts.map +0 -1
  600. package/dist/components/side-navigation/SideNavigationActionMenu.d.ts +0 -26
  601. package/dist/components/side-navigation/SideNavigationActionMenu.d.ts.map +0 -1
  602. package/dist/components/side-navigation/SideNavigationLink.d.ts +0 -38
  603. package/dist/components/side-navigation/SideNavigationLink.d.ts.map +0 -1
  604. package/dist/components/side-navigation/SideNavigationLinks.d.ts +0 -38
  605. package/dist/components/side-navigation/SideNavigationLinks.d.ts.map +0 -1
  606. package/dist/components/tabs/Tab.d.ts +0 -19
  607. package/dist/components/tabs/Tab.d.ts.map +0 -1
  608. package/dist/components/tabs/TabContent.d.ts +0 -13
  609. package/dist/components/tabs/TabContent.d.ts.map +0 -1
  610. package/dist/components/tabs/TabList.d.ts +0 -12
  611. package/dist/components/tabs/TabList.d.ts.map +0 -1
  612. package/dist/components/toast/ToastApi.d.ts +0 -21
  613. package/dist/components/toast/ToastApi.d.ts.map +0 -1
  614. package/dist/components/top-navigation/TopNavigation.d.ts +0 -65
  615. package/dist/components/top-navigation/TopNavigation.d.ts.map +0 -1
  616. package/dist/components/top-navigation/index.d.ts +0 -4
  617. package/dist/components/top-navigation/index.d.ts.map +0 -1
  618. package/dist/icons/truck.svg +0 -13
  619. package/dist/search-CM-OgatF.js +0 -179
  620. package/dist/search-C_vLUsm7.cjs +0 -1
  621. package/dist/styles.css +0 -3
  622. package/tailwind.preset.cjs +0 -75
  623. package/tailwind.preset.js +0 -97
@@ -0,0 +1,681 @@
1
+
2
+ const __mintLoadStyle = (key, url) => {
3
+ if (typeof document === 'undefined') return
4
+ const href = new URL(url, import.meta.url).href
5
+ if ([...document.querySelectorAll('link[rel="stylesheet"]')].some(link => link.href === href)) return
6
+ if (document.querySelector('style[data-mint-ui-style="' + key + '"]') || document.querySelector('link[data-mint-ui-style="' + key + '"]')) return
7
+ const link = document.createElement('link')
8
+ link.rel = 'stylesheet'
9
+ link.href = href
10
+ link.dataset.mintUiStyle = key
11
+ document.head.append(link)
12
+ }
13
+ __mintLoadStyle('theme', '../../theme.css')
14
+ __mintLoadStyle('icon', '../../icon.css')
15
+ __mintLoadStyle('chip', '../../chip.css')
16
+ __mintLoadStyle('input', '../../input.css')
17
+ __mintLoadStyle('button', '../../button.css')
18
+ __mintLoadStyle('spinner', '../../spinner.css')
19
+ __mintLoadStyle('search', '../../search.css')
20
+ import "../chunks/icon-gQAtsERy.js";
21
+ import { t as e } from "../chunks/register-element-BFYmIynH.js";
22
+ import "../chunks/icon-C0OLmjDY.js";
23
+ import "../chunks/close-Dg6U0IjZ.js";
24
+ import "../chunks/button-B0Yt0MX1.js";
25
+ import "../chunks/chip-B9whjEvW.js";
26
+ import "../chunks/input-8bbXzpa5.js";
27
+ import "../chunks/search-ANUKQi0r.js";
28
+ //#region src/components/search/Search.ts
29
+ var t = class e extends HTMLElement {
30
+ constructor(...e) {
31
+ super(...e), this._shell = null, this._desktopInput = null, this._panel = null, this._panelInner = null, this._resultsId = "", this._panelInput = null, this._panelFiltersWrap = null, this._panelFiltersMainRow = null, this._panelFiltersChips = null, this._panelFiltersShowAllWrap = null, this._panelFiltersShowAllBtn = null, this._panelFiltersMorePanel = null, this._filtersMoreOpen = !1, this._filterOverflowObserver = null, this._filterOverflowZeroWidthRetries = 0, this._desktopFilterWrap = null, this._mobileFilterWrap = null, this._resultsWrap = null, this._stateWrap = null, this._customResultsWrap = null, this._query = "", this._searchOpen = !1, this._selectedFilters = [], this._selectedFilterBackspaceArmed = !1, this._debounceId = null, this._abortController = null, this._docPointerDownHandler = null, this._globalKeydownHandler = null, this._focusOutHandler = null, this._resizeHandler = null, this._scrollHandler = null, this._desktopShortcutHint = null, this._panelSearchBar = null, this._contentObserver = null, this._renderFrame = null;
32
+ }
33
+ static {
34
+ this._filterMorePanelSeq = 0;
35
+ }
36
+ static {
37
+ this._filterChipsOverflowMask = "linear-gradient(to right, #000 0%, #000 max(0%, calc(100% - 3.5rem)), transparent 100%)";
38
+ }
39
+ static get observedAttributes() {
40
+ return [
41
+ "endpoint",
42
+ "search-param",
43
+ "placeholder",
44
+ "filters",
45
+ "filter-param",
46
+ "open-shortcut",
47
+ "open-shortcut-hint",
48
+ "collapse-on-mobile",
49
+ "results-limit"
50
+ ];
51
+ }
52
+ connectedCallback() {
53
+ this.classList.add("mint-search-host"), this._attachGlobalHandlers(), this._attachFocusOutHandler(), this._attachResizeHandler(), this.render(), this._observeContentMutations();
54
+ }
55
+ disconnectedCallback() {
56
+ this._panel?.remove(), this._docPointerDownHandler &&= (document.removeEventListener("pointerdown", this._docPointerDownHandler, !0), null), this._globalKeydownHandler &&= (document.removeEventListener("keydown", this._globalKeydownHandler), null), this._resizeHandler &&= (window.removeEventListener("resize", this._resizeHandler), null), this._scrollHandler &&= (document.removeEventListener("scroll", this._scrollHandler, !0), null), this._focusOutHandler &&= (this.removeEventListener("focusout", this._focusOutHandler, !0), null), this._cancelDebounce(), this._abortSearch(), this._filterOverflowObserver &&= (this._filterOverflowObserver.disconnect(), null), this._contentObserver &&= (this._contentObserver.disconnect(), null), this._renderFrame !== null && (cancelAnimationFrame(this._renderFrame), this._renderFrame = null);
57
+ }
58
+ attributeChangedCallback(e, t, n) {
59
+ t !== n && this.render();
60
+ }
61
+ _scheduleRender() {
62
+ this._renderFrame === null && (this._renderFrame = requestAnimationFrame(() => {
63
+ this._renderFrame = null, this.render();
64
+ }));
65
+ }
66
+ _observeContentMutations() {
67
+ this._contentObserver ||= new MutationObserver(() => {
68
+ this._scheduleRender();
69
+ }), this._contentObserver.disconnect(), this._contentObserver.observe(this, {
70
+ childList: !0,
71
+ attributes: !0,
72
+ attributeFilter: ["slot"]
73
+ });
74
+ }
75
+ _getEndpoint() {
76
+ return (this.getAttribute("endpoint") || "").trim();
77
+ }
78
+ _getSearchParam() {
79
+ return (this.getAttribute("search-param") || "q").trim() || "q";
80
+ }
81
+ _getPlaceholder() {
82
+ return this.getAttribute("placeholder") || "Search";
83
+ }
84
+ _getFilterParam() {
85
+ return (this.getAttribute("filter-param") || "").trim();
86
+ }
87
+ _getFilterOptions() {
88
+ return (this.getAttribute("filters") || "").split(",").map((e) => e.trim()).filter(Boolean);
89
+ }
90
+ _hasSelectedFilters() {
91
+ return this._selectedFilters.length > 0;
92
+ }
93
+ _getFilterChipOverflowReservePx() {
94
+ let e = Math.max(1, this._getFilterOptions().length), t = this._hasSelectedFilters() ? 28 : 56;
95
+ return Math.min(200, t + e * 34);
96
+ }
97
+ _getFilterParamValue() {
98
+ return this._selectedFilters.join(",");
99
+ }
100
+ _getFilterChipLabelText() {
101
+ return this._selectedFilters.join(", ");
102
+ }
103
+ _getCondensedFilterChipLabel(e = 22) {
104
+ if (!this._hasSelectedFilters()) return "";
105
+ let [t = ""] = this._selectedFilters, n = this._selectedFilters.length - 1, r = Math.max(8, e - 2), i = t;
106
+ if (n <= 0) return i.length <= r ? i : `${i.slice(0, Math.max(1, r - 3))}...`;
107
+ let a = `${t}, and ${n} more`;
108
+ return a.length <= r ? a : `${a.slice(0, Math.max(1, r - 3))}...`;
109
+ }
110
+ _isMobileViewport() {
111
+ return window.matchMedia("(max-width: 1099.98px)").matches;
112
+ }
113
+ _collapseOnMobile() {
114
+ let e = this.getAttribute("collapse-on-mobile");
115
+ if (e === null) return !1;
116
+ let t = e.trim().toLowerCase();
117
+ return !(t === "false" || t === "0" || t === "off" || t === "none");
118
+ }
119
+ _primarySearchInput() {
120
+ return this._isMobileViewport() && this._collapseOnMobile() ? this._panelInput : this._desktopInput;
121
+ }
122
+ _isApplePlatform() {
123
+ return typeof navigator > "u" ? !1 : /Mac|iPhone|iPad|iPod/i.test(navigator.platform) || /Mac OS/i.test(navigator.userAgent);
124
+ }
125
+ _parseOpenShortcut() {
126
+ let e = (this.getAttribute("open-shortcut") ?? "mod+k").trim().toLowerCase();
127
+ if (!e || e === "none" || e === "false" || e === "off") return {
128
+ disabled: !0,
129
+ wantMod: !1,
130
+ wantMeta: !1,
131
+ wantCtrl: !1,
132
+ wantAlt: !1,
133
+ wantShift: !1,
134
+ key: ""
135
+ };
136
+ let t = e.split("+").map((e) => e.trim()).filter(Boolean);
137
+ if (t.length === 0) return {
138
+ disabled: !0,
139
+ wantMod: !1,
140
+ wantMeta: !1,
141
+ wantCtrl: !1,
142
+ wantAlt: !1,
143
+ wantShift: !1,
144
+ key: ""
145
+ };
146
+ let n = t[t.length - 1], r = new Set(t.slice(0, -1).map((e) => e.toLowerCase()));
147
+ return {
148
+ disabled: !1,
149
+ wantMod: r.has("mod"),
150
+ wantMeta: r.has("meta") || r.has("cmd") || r.has("super"),
151
+ wantCtrl: r.has("ctrl") || r.has("control"),
152
+ wantAlt: r.has("alt"),
153
+ wantShift: r.has("shift"),
154
+ key: n.toLowerCase()
155
+ };
156
+ }
157
+ _eventKeyMatchesShortcutKey(e, t) {
158
+ let n = t.toLowerCase();
159
+ return (e.key.length, e.key.toLowerCase()) === n;
160
+ }
161
+ _openShortcutMatches(e) {
162
+ let t = this._parseOpenShortcut();
163
+ return t.disabled || !t.key || e.repeat || !this._eventKeyMatchesShortcutKey(e, t.key) || t.wantShift !== e.shiftKey || t.wantAlt !== e.altKey ? !1 : t.wantMod || t.wantMeta || t.wantCtrl ? !(t.wantMod && !(e.metaKey || e.ctrlKey) || t.wantMeta && !e.metaKey || t.wantCtrl && !e.ctrlKey) : !!t.wantAlt;
164
+ }
165
+ _getOpenShortcutHintText() {
166
+ let e = this.getAttribute("open-shortcut-hint");
167
+ if (e === "none" || e === "false") return "";
168
+ if (e !== null && e.trim() !== "") return e.trim();
169
+ let t = this._parseOpenShortcut();
170
+ if (t.disabled) return "";
171
+ let n = this._isApplePlatform(), r = [];
172
+ t.wantMod && r.push(n ? "⌘" : "Ctrl"), t.wantMeta && !t.wantMod && r.push(n ? "⌘" : "Meta"), t.wantCtrl && !t.wantMod && r.push("Ctrl"), t.wantAlt && r.push("Alt"), t.wantShift && r.push("Shift");
173
+ let i = t.key.length === 1 ? t.key.toUpperCase() : t.key;
174
+ return i ? t.wantMod && !t.wantMeta && !t.wantCtrl && !t.wantAlt && !t.wantShift && t.key.length === 1 ? `${n ? "⌘" : "Ctrl+"}${i}` : [...r, i].join("+") : "";
175
+ }
176
+ _attachGlobalHandlers() {
177
+ this._globalKeydownHandler || (this._globalKeydownHandler = (e) => {
178
+ if (this._openShortcutMatches(e)) {
179
+ e.preventDefault(), this._openSearch(!0);
180
+ return;
181
+ }
182
+ if (e.key === "Tab" && this._searchOpen) {
183
+ let t = e.composedPath();
184
+ if (this._shell && t.includes(this._shell) || this._panelInner && t.includes(this._panelInner)) {
185
+ let t = this._getSearchFocusableElements();
186
+ if (t.length) {
187
+ let n = document.activeElement, r = n ? t.indexOf(n) : -1, i = e.shiftKey ? -1 : 1, a = r < 0 ? e.shiftKey ? t.length - 1 : 0 : (r + i + t.length) % t.length;
188
+ e.preventDefault(), t[a]?.focus();
189
+ }
190
+ }
191
+ return;
192
+ }
193
+ if (e.key.toLowerCase() === "escape" && this._searchOpen) {
194
+ if (this._filtersMoreOpen) {
195
+ this._filtersMoreOpen = !1, this.render(), requestAnimationFrame(() => this._focusActiveInput());
196
+ return;
197
+ }
198
+ this._closeSearch();
199
+ }
200
+ }, document.addEventListener("keydown", this._globalKeydownHandler)), this._docPointerDownHandler || (this._docPointerDownHandler = (e) => {
201
+ if (!this._searchOpen) return;
202
+ let t = e.composedPath();
203
+ this._filtersMoreOpen && this._panelFiltersWrap && !t.includes(this._panelFiltersWrap) && (this._filtersMoreOpen = !1, this.render(), requestAnimationFrame(() => this._focusActiveInput())), !(this._shell && t.includes(this._shell) || this._panelInner && t.includes(this._panelInner)) && this._closeSearch();
204
+ }, document.addEventListener("pointerdown", this._docPointerDownHandler, !0));
205
+ }
206
+ _attachResizeHandler() {
207
+ this._resizeHandler || (this._resizeHandler = () => {
208
+ this._syncPanelVisibility(), this._syncFilterOverflow();
209
+ }, window.addEventListener("resize", this._resizeHandler, { passive: !0 })), this._scrollHandler || (this._scrollHandler = () => {
210
+ this._searchOpen && this._positionPanel();
211
+ }, document.addEventListener("scroll", this._scrollHandler, !0));
212
+ }
213
+ _attachFocusOutHandler() {
214
+ this._focusOutHandler || (this._focusOutHandler = (e) => {
215
+ if (!this._searchOpen) return;
216
+ let t = e.relatedTarget;
217
+ t && (this._shell && this._shell.contains(t) || this._panelInner && this._panelInner.contains(t) || this._closeSearch());
218
+ }, this.addEventListener("focusout", this._focusOutHandler, !0));
219
+ }
220
+ _emitSearchOpenChange() {
221
+ this.dispatchEvent(new CustomEvent("search-open-change", {
222
+ detail: { open: this._searchOpen },
223
+ bubbles: !0,
224
+ composed: !0
225
+ }));
226
+ }
227
+ _openSearch(e = !1) {
228
+ this._getEndpoint() && (this._searchOpen || (this._searchOpen = !0, this._syncPanelVisibility(), this._emitSearchOpenChange(), e && this._primarySearchInput()?.focus()));
229
+ }
230
+ _closeSearch() {
231
+ this._searchOpen && (this._searchOpen = !1, this._filtersMoreOpen = !1, this._syncPanelVisibility(), this._emitSearchOpenChange());
232
+ }
233
+ _syncPanelVisibility() {
234
+ if (this._panel) {
235
+ this._syncPanelLayoutClass(), this._panel.classList.toggle("is-hidden", !this._searchOpen), this._panel.classList.toggle("is-open", this._searchOpen), this._shell && this._shell.classList.toggle("is-open", this._searchOpen);
236
+ for (let e of [this._desktopInput, this._panelInput]) {
237
+ let t = e?.querySelector("input");
238
+ t && (t.setAttribute("aria-expanded", String(this._searchOpen)), this._resultsId && t.setAttribute("aria-controls", this._resultsId));
239
+ }
240
+ this._positionPanel(), this._searchOpen && this._scheduleFilterOverflowSync();
241
+ }
242
+ }
243
+ _syncPanelLayoutClass() {
244
+ if (!this._panel) return;
245
+ let e = !this._isMobileViewport() || !this._collapseOnMobile();
246
+ this._panel.classList.toggle("mint-search-panel-anchored", e), this._panel.classList.toggle("mint-search-panel-mobile", !e), this._panel.classList.toggle("mint-search-panel-global", this.classList.contains("global-search-control"));
247
+ }
248
+ _positionPanel() {
249
+ if (!this._panel) return;
250
+ if (!(!this._isMobileViewport() || !this._collapseOnMobile())) {
251
+ this._panel.style.left = "", this._panel.style.right = "", this._panel.style.top = "", this._panel.style.bottom = "", this._panel.style.width = "", this._panel.classList.remove("is-open-above"), this._panelInner && (this._panelInner.style.maxHeight = "");
252
+ return;
253
+ }
254
+ let e = this._shell?.getBoundingClientRect();
255
+ if (!e) return;
256
+ let t = window.innerHeight, n = Math.max(0, Math.min(416, t - 16)), r = Math.max(0, t - e.bottom - 4), i = Math.max(0, e.top - 4), a = r < n && i > r, o = Math.min(n, a ? i : r);
257
+ this._panel.classList.toggle("is-open-above", a), this._panelInner && (this._panelInner.style.maxHeight = `${o}px`), this._panel.style.left = `${e.left}px`, this._panel.style.width = `${e.width}px`, this._panel.style.right = "auto", a ? (this._panel.style.top = "auto", this._panel.style.bottom = `${Math.max(0, t - e.top - 4)}px`) : (this._panel.style.top = `${e.bottom - 4}px`, this._panel.style.bottom = "auto");
258
+ }
259
+ _setQuery(e) {
260
+ let t = this._query;
261
+ this._query = e, e !== t && (this._selectedFilterBackspaceArmed = !1), this._desktopInput && (this._desktopInput.value = e), this._panelInput && (this._panelInput.value = e);
262
+ }
263
+ _cancelDebounce() {
264
+ this._debounceId !== null && (window.clearTimeout(this._debounceId), this._debounceId = null);
265
+ }
266
+ _abortSearch() {
267
+ this._abortController &&= (this._abortController.abort(), null);
268
+ }
269
+ _normalizeResults(e) {
270
+ let t = Number.parseInt(this.getAttribute("results-limit") || "", 10), n = Number.isFinite(t) && t > 0 ? Math.min(t, 1e3) : 8;
271
+ return ((e) => {
272
+ if (Array.isArray(e)) return e;
273
+ if (!e || typeof e != "object") return [];
274
+ let t = e;
275
+ for (let e of [
276
+ "results",
277
+ "items",
278
+ "data",
279
+ "products"
280
+ ]) {
281
+ let n = t[e];
282
+ if (Array.isArray(n)) return n;
283
+ }
284
+ return [];
285
+ })(e).map((e) => {
286
+ let t = e || {};
287
+ return {
288
+ title: String(t.title || t.name || t.label || t.email || t.id || "").trim() || "Untitled",
289
+ subtitle: String(t.description || t.category || t.username || "").trim(),
290
+ parent: String(t.parent || t.type || t.entity || t.kind || t.category || "").trim() || void 0
291
+ };
292
+ }).slice(0, n);
293
+ }
294
+ _emitResultsChange(e, t) {
295
+ let n = this._hasSelectedFilters() ? this._getFilterParamValue() : null;
296
+ this.dispatchEvent(new CustomEvent("search-results-change", {
297
+ detail: {
298
+ query: this._query,
299
+ filter: n,
300
+ filters: [...this._selectedFilters],
301
+ results: e,
302
+ raw: t ?? null
303
+ },
304
+ bubbles: !0,
305
+ composed: !0
306
+ }));
307
+ }
308
+ _emitFilterChange() {
309
+ let e = this._hasSelectedFilters() ? this._getFilterParamValue() : null;
310
+ this.dispatchEvent(new CustomEvent("search-filter-change", {
311
+ detail: {
312
+ query: this._query,
313
+ filter: e,
314
+ filters: [...this._selectedFilters]
315
+ },
316
+ bubbles: !0,
317
+ composed: !0
318
+ }));
319
+ }
320
+ _renderState(e) {
321
+ if (this._customResultsWrap && this._customResultsWrap.childElementCount > 0) {
322
+ this._stateWrap && this._stateWrap.classList.add("is-hidden"), this._resultsWrap && this._resultsWrap.classList.add("is-hidden");
323
+ return;
324
+ }
325
+ this._stateWrap && (this._stateWrap.textContent = e, this._stateWrap.classList.remove("is-hidden"), this._resultsWrap && (this._resultsWrap.classList.remove("is-hidden"), this._resultsWrap.innerHTML = ""));
326
+ }
327
+ _renderResults(e) {
328
+ if (this._customResultsWrap && this._customResultsWrap.childElementCount > 0) {
329
+ this._stateWrap && this._stateWrap.classList.add("is-hidden"), this._resultsWrap && this._resultsWrap.classList.add("is-hidden");
330
+ return;
331
+ }
332
+ if (!(!this._resultsWrap || !this._stateWrap)) {
333
+ if (this._resultsWrap.innerHTML = "", e.length === 0) {
334
+ this._renderState("No results found");
335
+ return;
336
+ }
337
+ this._stateWrap.classList.add("is-hidden");
338
+ for (let t of e) {
339
+ let e = document.createElement("button");
340
+ e.type = "button", e.className = "mint-search-result", e.setAttribute("role", "option"), e.setAttribute("aria-selected", "false");
341
+ let n = document.createElement("mint-icon");
342
+ n.setAttribute("name", "search"), n.className = "mint-search-result-icon";
343
+ let r = document.createElement("div");
344
+ r.className = "mint-search-result-copy";
345
+ let i = document.createElement("div");
346
+ if (i.className = "mint-search-result-title", i.textContent = t.title, r.appendChild(i), t.subtitle) {
347
+ let e = document.createElement("div");
348
+ e.className = "mint-search-result-subtitle", e.textContent = t.subtitle, r.appendChild(e);
349
+ }
350
+ e.appendChild(n), e.appendChild(r), e.addEventListener("keydown", (t) => {
351
+ if (t.key === "ArrowDown") {
352
+ t.preventDefault(), this._moveFocusInResults(e, 1);
353
+ return;
354
+ }
355
+ if (t.key === "ArrowUp") {
356
+ t.preventDefault(), this._moveFocusInResults(e, -1);
357
+ return;
358
+ }
359
+ }), e.addEventListener("click", () => {
360
+ let e = this._hasSelectedFilters() ? this._getFilterParamValue() : null;
361
+ this.dispatchEvent(new CustomEvent("search-select", {
362
+ detail: {
363
+ query: this._query,
364
+ filter: e,
365
+ filters: [...this._selectedFilters],
366
+ result: t
367
+ },
368
+ bubbles: !0,
369
+ composed: !0
370
+ })), this._closeSearch();
371
+ }), this._resultsWrap.appendChild(e);
372
+ }
373
+ }
374
+ }
375
+ _fetchSearchResults(e) {
376
+ let t = this._getEndpoint();
377
+ if (!t) return;
378
+ let n = e.trim();
379
+ if (!n) {
380
+ this._emitResultsChange([]), this._renderState("Start typing to search");
381
+ return;
382
+ }
383
+ this._abortSearch(), this._abortController = new AbortController(), this._renderState("Searching...");
384
+ let r = new URLSearchParams();
385
+ r.set(this._getSearchParam(), n);
386
+ let i = this._getFilterParam();
387
+ i && this._hasSelectedFilters() && r.set(i, this._getFilterParamValue());
388
+ let a = t.includes("{query}") ? t.replace("{query}", encodeURIComponent(n)) : `${t}${t.includes("?") ? "&" : "?"}${r.toString()}`;
389
+ fetch(a, { signal: this._abortController.signal }).then((e) => {
390
+ if (!e.ok) throw Error(`Request failed: ${e.status}`);
391
+ return e.json();
392
+ }).then((e) => {
393
+ let t = this._normalizeResults(e);
394
+ this._emitResultsChange(t, e), this._renderResults(t);
395
+ }).catch((e) => {
396
+ e?.name !== "AbortError" && (this._emitResultsChange([]), this._renderState("Unable to load results"));
397
+ });
398
+ }
399
+ _scheduleSearch(e) {
400
+ this._setQuery(e), this._cancelDebounce(), this._debounceId = window.setTimeout(() => this._fetchSearchResults(e), 220);
401
+ }
402
+ _getNativeInputValue(e) {
403
+ if (!e) return "";
404
+ let t = e.querySelector("input, textarea");
405
+ return t ? t.value || "" : e.value || "";
406
+ }
407
+ _getCurrentInputValue() {
408
+ let e = document.activeElement;
409
+ return e && this._desktopInput && this._desktopInput.contains(e) ? this._getNativeInputValue(this._desktopInput) : e && this._panelInput && this._panelInput.contains(e) ? this._getNativeInputValue(this._panelInput) : this._getNativeInputValue(this._primarySearchInput());
410
+ }
411
+ _applyFilterSelectionChange() {
412
+ let e = this._getCurrentInputValue();
413
+ if (this._setQuery(e), this._emitFilterChange(), this.render(), e.trim()) {
414
+ this._scheduleSearch(e);
415
+ return;
416
+ }
417
+ this._cancelDebounce(), this._abortSearch(), this._emitResultsChange([]), this._renderState("Start typing to search");
418
+ }
419
+ _clearAllSelectedFilters() {
420
+ this._selectedFilters = [], this._selectedFilterBackspaceArmed = !1, this._applyFilterSelectionChange();
421
+ }
422
+ _popLastSelectedFilter() {
423
+ this._selectedFilters.length !== 0 && (this._selectedFilters.pop(), this._selectedFilterBackspaceArmed = !1, this._applyFilterSelectionChange());
424
+ }
425
+ _focusActiveInput() {
426
+ let e = this._primarySearchInput();
427
+ e && requestAnimationFrame(() => {
428
+ e.focus();
429
+ });
430
+ }
431
+ _focusHideFiltersControl() {
432
+ let e = this._panelFiltersShowAllBtn;
433
+ e && (e.querySelector("button") ?? e).focus();
434
+ }
435
+ _getFilterChipElements() {
436
+ return this._panelFiltersWrap ? Array.from(this._panelFiltersWrap.querySelectorAll("mint-chip")) : [];
437
+ }
438
+ _ensurePanelFiltersShell() {
439
+ !this._panelFiltersWrap || this._panelFiltersMainRow || (this._panelFiltersWrap.replaceChildren(), this._panelFiltersWrap.className = "mint-search-filters", this._panelFiltersMainRow = document.createElement("div"), this._panelFiltersMainRow.className = "mint-search-filter-row", this._panelFiltersChips = document.createElement("div"), this._panelFiltersChips.className = "mint-search-filter-chips", this._panelFiltersMorePanel = document.createElement("div"), this._panelFiltersMorePanel.id = `mint-search-filter-more-${e._filterMorePanelSeq++}`, this._panelFiltersMorePanel.className = "mint-search-filter-more is-hidden", this._panelFiltersShowAllWrap = document.createElement("div"), this._panelFiltersShowAllWrap.className = "mint-search-filter-more-trigger is-hidden", this._panelFiltersShowAllBtn = document.createElement("mint-button"), this._panelFiltersShowAllBtn.setAttribute("type", "button"), this._panelFiltersShowAllBtn.setAttribute("variant", "ghost"), this._panelFiltersShowAllBtn.setAttribute("tone", "neutral"), this._panelFiltersShowAllBtn.setAttribute("size", "small"), this._panelFiltersShowAllBtn.classList.add("mint-search-filter-more-button"), this._panelFiltersShowAllBtn.setAttribute("aria-expanded", "false"), this._panelFiltersShowAllBtn.setAttribute("aria-controls", this._panelFiltersMorePanel.id), this._panelFiltersShowAllBtn.addEventListener("click", (e) => {
440
+ e.stopPropagation();
441
+ let t = this._filtersMoreOpen;
442
+ this._filtersMoreOpen = !this._filtersMoreOpen, this.render(), t && requestAnimationFrame(() => this._focusActiveInput());
443
+ }), this._panelFiltersShowAllWrap.append(this._panelFiltersShowAllBtn), this._panelFiltersMainRow.append(this._panelFiltersChips, this._panelFiltersShowAllWrap), this._setPanelFiltersShowAllLabel("Show all"), this._panelFiltersWrap.append(this._panelFiltersMainRow, this._panelFiltersMorePanel), typeof ResizeObserver < "u" && !this._filterOverflowObserver && (this._filterOverflowObserver = new ResizeObserver(() => this._syncFilterOverflow()), this._filterOverflowObserver.observe(this._panelFiltersChips), this._filterOverflowObserver.observe(this._panelFiltersMainRow)));
444
+ }
445
+ _setPanelFiltersShowAllLabel(e) {
446
+ let t = this._panelFiltersShowAllBtn;
447
+ if (!t) return;
448
+ for (let e of Array.from(t.childNodes)) e.nodeType === Node.TEXT_NODE && e.remove();
449
+ let n = t.querySelector("button .mint-button-content") || t.querySelector(".mint-button-content");
450
+ if (n) {
451
+ n.textContent = e;
452
+ return;
453
+ }
454
+ let r = t.querySelector(":scope > button");
455
+ if (r) {
456
+ r.replaceChildren(document.createTextNode(e)), t.render?.();
457
+ return;
458
+ }
459
+ t.firstElementChild || t.appendChild(document.createTextNode(e));
460
+ }
461
+ _scheduleFilterOverflowSync() {
462
+ requestAnimationFrame(() => {
463
+ requestAnimationFrame(() => this._syncFilterOverflow());
464
+ });
465
+ }
466
+ _setFilterChipsEdgeFade(t) {
467
+ let n = this._panelFiltersChips;
468
+ n && (t ? (n.style.maskImage = e._filterChipsOverflowMask, n.style.webkitMaskImage = e._filterChipsOverflowMask) : (n.style.maskImage = "", n.style.webkitMaskImage = ""));
469
+ }
470
+ _syncFilterOverflow() {
471
+ if (!this._panelFiltersChips || !this._panelFiltersShowAllWrap || !this._panelFiltersShowAllBtn) return;
472
+ if (this._filtersMoreOpen) {
473
+ this._panelFiltersShowAllWrap.classList.remove("is-hidden"), this._filterOverflowZeroWidthRetries = 0, this._setFilterChipsEdgeFade(!1);
474
+ return;
475
+ }
476
+ let e = this._panelFiltersChips.clientWidth;
477
+ if (e === 0 && this._searchOpen) {
478
+ this._filterOverflowZeroWidthRetries < 10 && (this._filterOverflowZeroWidthRetries += 1, this._scheduleFilterOverflowSync()), this._setFilterChipsEdgeFade(!1);
479
+ return;
480
+ }
481
+ this._filterOverflowZeroWidthRetries = 0;
482
+ let t = this._panelFiltersChips.scrollWidth + this._getFilterChipOverflowReservePx() > e;
483
+ this._panelFiltersShowAllWrap.classList.toggle("is-hidden", !t), this._setFilterChipsEdgeFade(t);
484
+ }
485
+ _getResultFocusableElements() {
486
+ let e = this._customResultsWrap && !this._customResultsWrap.classList.contains("is-hidden") ? this._customResultsWrap : this._resultsWrap;
487
+ return e ? Array.from(e.querySelectorAll("button:not([disabled]), [href], [tabindex]:not([tabindex=\"-1\"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])")) : [];
488
+ }
489
+ _getSearchFocusableElements() {
490
+ return [this._shell, this._panelInner].filter((e) => !!e).flatMap((e) => Array.from(e.querySelectorAll("button:not([disabled]), [href], [tabindex]:not([tabindex=\"-1\"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])"))).filter((e) => {
491
+ if (e.closest(".is-hidden") || e.closest("[aria-hidden=\"true\"]")) return !1;
492
+ let t = window.getComputedStyle(e);
493
+ return t.display !== "none" && t.visibility !== "hidden";
494
+ });
495
+ }
496
+ _focusFirstChipOrResult(e = !1) {
497
+ let t = this._getFilterChipElements(), n = this._getResultFocusableElements();
498
+ if (!e) {
499
+ (t[0] || n[0])?.focus();
500
+ return;
501
+ }
502
+ (n[n.length - 1] || t[t.length - 1])?.focus();
503
+ }
504
+ _moveFocusInResults(e, t) {
505
+ let n = this._getResultFocusableElements();
506
+ if (n.length === 0) return;
507
+ let r = n.indexOf(e);
508
+ if (r === -1) return;
509
+ let i = n[r + t];
510
+ if (i) {
511
+ i.focus();
512
+ return;
513
+ }
514
+ if (t === -1) {
515
+ let e = this._getFilterChipElements(), t = e[e.length - 1];
516
+ t ? t.focus() : this._focusActiveInput();
517
+ }
518
+ }
519
+ _renderSelectedFilter() {
520
+ let e = (e) => {
521
+ if (!e || (e.innerHTML = "", !this._hasSelectedFilters())) return;
522
+ let t = document.createElement("mint-chip");
523
+ t.setAttribute("dismissable", ""), t.title = this._getFilterChipLabelText();
524
+ let n = this._getCondensedFilterChipLabel();
525
+ t.classList.add("mint-search-selected-filter"), this._selectedFilterBackspaceArmed && t.classList.add("is-backspace-armed"), t.textContent = n, t.addEventListener("dismiss", (e) => {
526
+ e.stopPropagation(), this._clearAllSelectedFilters();
527
+ }), e.appendChild(t);
528
+ };
529
+ e(this._desktopFilterWrap), e(this._mobileFilterWrap);
530
+ let t = this._hasSelectedFilters();
531
+ this._desktopInput?.classList.toggle("has-selected-filter", t), this._panelInput?.classList.toggle("has-selected-filter", t), this._syncSelectedFilterInputOffset(this._desktopInput, this._desktopFilterWrap), this._syncSelectedFilterInputOffset(this._panelInput, this._mobileFilterWrap);
532
+ }
533
+ _syncSelectedFilterInputOffset(e, t) {
534
+ if (!e || !t) return;
535
+ let n = t.querySelector("mint-chip");
536
+ if (!n) {
537
+ e.style.removeProperty("--mint-search-filter-chip-width");
538
+ return;
539
+ }
540
+ let r = () => {
541
+ n.isConnected && e.style.setProperty("--mint-search-filter-chip-width", `${n.getBoundingClientRect().width}px`);
542
+ };
543
+ r(), requestAnimationFrame(r);
544
+ }
545
+ _bindInputHandlers(e) {
546
+ let t = () => {
547
+ this._scheduleSearch(this._getNativeInputValue(e));
548
+ };
549
+ e.addEventListener("focusin", () => this._openSearch(!1)), e.addEventListener("input", t), e.addEventListener("search", t), e.addEventListener("change", t), e.addEventListener("keydown", (t) => {
550
+ if (t.key === "ArrowDown") {
551
+ this._searchOpen || this._openSearch(!1), t.preventDefault(), this._focusFirstChipOrResult(!1);
552
+ return;
553
+ }
554
+ if (t.key === "ArrowUp") {
555
+ this._searchOpen || this._openSearch(!1), t.preventDefault(), this._focusFirstChipOrResult(!0);
556
+ return;
557
+ }
558
+ if (t.key !== "Backspace") return;
559
+ let n = this._getNativeInputValue(e);
560
+ if (n !== this._query && this._setQuery(n), !(n.length > 0) && this._hasSelectedFilters()) {
561
+ if (!this._selectedFilterBackspaceArmed) {
562
+ t.preventDefault(), this._selectedFilterBackspaceArmed = !0, this._renderSelectedFilter();
563
+ return;
564
+ }
565
+ t.preventDefault(), this._popLastSelectedFilter();
566
+ }
567
+ });
568
+ }
569
+ openSearch(e = !0) {
570
+ this._openSearch(e);
571
+ }
572
+ closeSearch() {
573
+ this._closeSearch();
574
+ }
575
+ toggleSearch(e = !0) {
576
+ if (this._searchOpen) {
577
+ this._closeSearch();
578
+ return;
579
+ }
580
+ this._openSearch(e);
581
+ }
582
+ isSearchOpen() {
583
+ return this._searchOpen;
584
+ }
585
+ render() {
586
+ let e = this._getEndpoint();
587
+ if (this.classList.toggle("is-hidden", !e), !e) {
588
+ this._searchOpen = !1, this._panel?.classList.add("is-hidden");
589
+ return;
590
+ }
591
+ if (!this._shell) {
592
+ this._shell = document.createElement("div"), this._shell.className = "mint-search-shell", this._desktopFilterWrap = document.createElement("div"), this._desktopFilterWrap.className = "mint-search-filter-slot", this._desktopFilterWrap.setAttribute("slot", "prepend"), this._desktopInput = document.createElement("mint-input"), this._desktopInput.setAttribute("type", "search"), this._desktopInput.setAttribute("icon", "search"), this._desktopInput.setAttribute("aria-label", this.getAttribute("placeholder") || "Search"), this._desktopInput.className = "mint-search-input";
593
+ let e = document.createElement("span");
594
+ e.className = "mint-search-shortcut-hint", e.setAttribute("slot", "append"), this._desktopShortcutHint = e, this._bindInputHandlers(this._desktopInput), this._desktopInput.appendChild(this._desktopFilterWrap), this._desktopInput.appendChild(e), this._shell.appendChild(this._desktopInput), this.appendChild(this._shell);
595
+ }
596
+ if (!this._panel) {
597
+ this._panel = document.createElement("div"), this._panel.className = "mint-search-panel is-hidden";
598
+ let e = document.createElement("div");
599
+ e.className = "mint-search-panel-inner", this._panelInner = e;
600
+ let t = document.createElement("div");
601
+ this._panelSearchBar = t, t.className = "mint-search-panel-searchbar is-hidden", this._mobileFilterWrap = document.createElement("div"), this._mobileFilterWrap.className = "mint-search-filter-slot", this._mobileFilterWrap.setAttribute("slot", "prepend"), this._panelInput = document.createElement("mint-input"), this._panelInput.setAttribute("type", "search"), this._panelInput.setAttribute("aria-label", this.getAttribute("placeholder") || "Search"), this._panelInput.className = "mint-search-input", this._bindInputHandlers(this._panelInput), this._panelInput.appendChild(this._mobileFilterWrap), t.appendChild(this._panelInput), this._customResultsWrap = document.createElement("div"), this._customResultsWrap.className = "mint-search-custom-results is-hidden", this._stateWrap = document.createElement("div"), this._stateWrap.className = "mint-search-state", this._stateWrap.textContent = "Start typing to search", this._stateWrap.setAttribute("role", "status"), this._stateWrap.setAttribute("aria-live", "polite"), this._resultsWrap = document.createElement("div"), this._resultsWrap.className = "mint-search-results", this._resultsId = `mint-search-results-${Math.random().toString(36).slice(2, 10)}`, this._resultsWrap.id = this._resultsId, this._resultsWrap.setAttribute("role", "listbox"), this._resultsWrap.setAttribute("aria-label", "Search results"), this._customResultsWrap.setAttribute("role", "region"), this._customResultsWrap.setAttribute("aria-label", "Search results"), e.appendChild(t), this._panelFiltersWrap = document.createElement("div"), e.appendChild(this._panelFiltersWrap), this._ensurePanelFiltersShell(), e.appendChild(this._customResultsWrap), e.appendChild(this._stateWrap), e.appendChild(this._resultsWrap), this._panel.appendChild(e);
602
+ }
603
+ this._panel.parentElement !== document.body && document.body.appendChild(this._panel);
604
+ let t = this._hasSelectedFilters() ? "" : this._getPlaceholder();
605
+ if (this._desktopInput && this._desktopInput.setAttribute("placeholder", t), this._panelInput && this._panelInput.setAttribute("placeholder", t), this._desktopInput && this._desktopInput.setAttribute("aria-label", this.getAttribute("aria-label") || this._getPlaceholder()), this._panelInput && this._panelInput.setAttribute("aria-label", this.getAttribute("aria-label") || this._getPlaceholder()), this._desktopShortcutHint) {
606
+ let e = this._getOpenShortcutHintText();
607
+ this._desktopShortcutHint.textContent = e, this._desktopShortcutHint.classList.toggle("is-hidden", !e);
608
+ }
609
+ if (this._panelFiltersWrap) {
610
+ this._ensurePanelFiltersShell();
611
+ let e = this._getFilterOptions();
612
+ this._selectedFilters = this._selectedFilters.filter((t) => e.includes(t));
613
+ let t = e.length > 0;
614
+ t || (this._filtersMoreOpen = !1), this._panelFiltersWrap.classList.toggle("is-hidden", !t), this._panelInner?.classList.toggle("has-no-filters", !t), this._panelFiltersChips && this._panelFiltersChips.replaceChildren(), this._panelFiltersMorePanel && this._panelFiltersMorePanel.replaceChildren();
615
+ let n = this._filtersMoreOpen && this._panelFiltersMorePanel ? this._panelFiltersMorePanel : this._panelFiltersChips;
616
+ for (let t of e) {
617
+ if (!n) break;
618
+ let r = document.createElement("mint-chip"), i = this._selectedFilters.includes(t);
619
+ if (i && r.classList.add("is-selected"), r.classList.add("mint-search-filter-chip"), i) {
620
+ let e = document.createElement("span");
621
+ e.textContent = t;
622
+ let n = document.createElement("mint-icon");
623
+ n.setAttribute("name", "close"), n.className = "mint-search-filter-chip-close", n.setAttribute("aria-hidden", "true"), r.append(e, n);
624
+ } else r.textContent = t;
625
+ r.tabIndex = 0, r.setAttribute("role", "button"), r.setAttribute("aria-label", i ? `Remove filter ${t}` : `Filter by ${t}`), r.dataset.mintSearchFilter = t, r.addEventListener("pointerdown", (e) => {
626
+ e.preventDefault();
627
+ });
628
+ let a = (n) => {
629
+ n && n.stopPropagation();
630
+ let r = this._filtersMoreOpen, i = this._selectedFilters.indexOf(t);
631
+ i >= 0 ? this._selectedFilters.splice(i, 1) : this._selectedFilters.push(t), this._selectedFilterBackspaceArmed = !1;
632
+ let a = e.length > 0 && this._selectedFilters.length === e.length, o = this._selectedFilters.length === 0;
633
+ r && (a || o) && (this._filtersMoreOpen = !1), this._emitFilterChange(), this._renderSelectedFilter(), this.render(), this._query.trim() && this._scheduleSearch(this._query), r ? a || o ? this._focusActiveInput() : requestAnimationFrame(() => {
634
+ this._getFilterChipElements().find((e) => e.dataset.mintSearchFilter === t)?.focus();
635
+ }) : this._focusActiveInput();
636
+ };
637
+ r.addEventListener("click", (e) => a(e)), r.addEventListener("keydown", (e) => {
638
+ let t = this._getFilterChipElements(), n = t.indexOf(r);
639
+ if (e.key === "Enter" || e.key === " ") {
640
+ e.preventDefault(), a(e);
641
+ return;
642
+ }
643
+ if (e.key === "ArrowRight") {
644
+ e.preventDefault();
645
+ let r = t[n + 1];
646
+ r && r.focus();
647
+ return;
648
+ }
649
+ if (e.key === "ArrowLeft") {
650
+ e.preventDefault();
651
+ let r = t[n - 1];
652
+ r ? r.focus() : this._filtersMoreOpen ? this._focusHideFiltersControl() : this._focusActiveInput();
653
+ return;
654
+ }
655
+ if (e.key === "ArrowDown") {
656
+ e.preventDefault(), this._getResultFocusableElements()[0]?.focus();
657
+ return;
658
+ }
659
+ if (e.key === "ArrowUp") {
660
+ e.preventDefault(), this._filtersMoreOpen ? this._focusHideFiltersControl() : this._focusActiveInput();
661
+ return;
662
+ }
663
+ }), n.appendChild(r);
664
+ }
665
+ this._panelFiltersChips && this._panelFiltersChips.classList.toggle("is-hidden", this._filtersMoreOpen), this._panelFiltersMorePanel && this._panelFiltersMorePanel.classList.toggle("is-hidden", !this._filtersMoreOpen), this._panelFiltersShowAllBtn && (this._setPanelFiltersShowAllLabel(this._filtersMoreOpen ? "Hide filters" : "Show all"), this._panelFiltersShowAllBtn.setAttribute("aria-expanded", this._filtersMoreOpen ? "true" : "false")), this._panelInner && (this._filtersMoreOpen && t ? this._panelInner.classList.add("is-overflow-visible") : this._panelInner.classList.remove("is-overflow-visible")), this._scheduleFilterOverflowSync();
666
+ }
667
+ if (this._customResultsWrap) {
668
+ Array.from(this.children).filter((e) => e === this._shell || e === this._panel ? !1 : e.getAttribute("slot") === "results").forEach((e) => this._customResultsWrap.appendChild(e));
669
+ let e = this._customResultsWrap.childElementCount > 0;
670
+ this._customResultsWrap.classList.toggle("is-hidden", !e), e ? (this._stateWrap?.classList.add("is-hidden"), this._resultsWrap?.classList.add("is-hidden")) : this._resultsWrap?.classList.remove("is-hidden");
671
+ }
672
+ this._renderSelectedFilter(), this._syncResponsiveChrome(), this._syncPanelVisibility();
673
+ }
674
+ _syncResponsiveChrome() {
675
+ let e = this._collapseOnMobile();
676
+ this._shell && this._shell.classList.toggle("is-collapsed", e), this._panelSearchBar && (this._panelSearchBar.classList.toggle("is-hidden", !e), this._panelSearchBar.classList.toggle("is-collapsed", e));
677
+ }
678
+ };
679
+ customElements.get("mint-search") || e("mint-search", t);
680
+ //#endregion
681
+ export { t as default };