smoothly 1.0.0-alpha.21 → 1.0.0-alpha.211

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 (549) hide show
  1. package/dist/cjs/{Listenable-63ea2d90.js → Data-ae713814.js} +523 -6
  2. package/dist/cjs/Data-ae713814.js.map +1 -0
  3. package/dist/cjs/Observers-6450f075.js +25 -0
  4. package/dist/cjs/Observers-6450f075.js.map +1 -0
  5. package/dist/cjs/TimeZone-016ac7b0.js +6181 -0
  6. package/dist/cjs/TimeZone-016ac7b0.js.map +1 -0
  7. package/dist/cjs/getLanguage-49a534df.js +6118 -0
  8. package/dist/cjs/getLanguage-49a534df.js.map +1 -0
  9. package/dist/cjs/{index-8adc5c1b.js → index-43af753b.js} +55 -2
  10. package/dist/cjs/index-43af753b.js.map +1 -0
  11. package/dist/cjs/index.cjs.js +22 -17
  12. package/dist/cjs/index.cjs.js.map +1 -1
  13. package/dist/cjs/loader.cjs.js +4 -3
  14. package/dist/cjs/loader.cjs.js.map +1 -1
  15. package/dist/cjs/{Notice-88ba4c70.js → redirect-2e5d4524.js} +11 -2
  16. package/dist/cjs/redirect-2e5d4524.js.map +1 -0
  17. package/dist/cjs/smoothly-accordion-item.cjs.entry.js +61 -0
  18. package/dist/cjs/smoothly-accordion-item.cjs.entry.js.map +1 -0
  19. package/dist/cjs/smoothly-accordion.cjs.entry.js +58 -0
  20. package/dist/cjs/smoothly-accordion.cjs.entry.js.map +1 -0
  21. package/dist/cjs/smoothly-address-display.cjs.entry.js +1 -1
  22. package/dist/cjs/smoothly-address.cjs.entry.js +1 -1
  23. package/dist/cjs/smoothly-addresses.cjs.entry.js +1 -1
  24. package/dist/cjs/smoothly-app_80.cjs.entry.js +10897 -0
  25. package/dist/cjs/smoothly-app_80.cjs.entry.js.map +1 -0
  26. package/dist/cjs/smoothly-checkbox.cjs.entry.js +102 -0
  27. package/dist/cjs/smoothly-checkbox.cjs.entry.js.map +1 -0
  28. package/dist/cjs/smoothly-color.cjs.entry.js +1 -1
  29. package/dist/cjs/smoothly-country.cjs.entry.js +56 -55
  30. package/dist/cjs/smoothly-country.cjs.entry.js.map +1 -1
  31. package/dist/cjs/smoothly-display-date-time.cjs.entry.js +26 -0
  32. package/dist/cjs/smoothly-display-date-time.cjs.entry.js.map +1 -0
  33. package/dist/cjs/smoothly-google-font.cjs.entry.js +1 -1
  34. package/dist/cjs/smoothly-reorder.cjs.entry.js +1 -1
  35. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +4 -4
  36. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js.map +1 -1
  37. package/dist/cjs/smoothly-trigger-source.cjs.entry.js +6 -6
  38. package/dist/cjs/smoothly-trigger-source.cjs.entry.js.map +1 -1
  39. package/dist/cjs/smoothly.cjs.js +4 -3
  40. package/dist/cjs/smoothly.cjs.js.map +1 -1
  41. package/dist/collection/collection-manifest.json +37 -15
  42. package/dist/collection/components/Button.js +16 -2
  43. package/dist/collection/components/Button.js.map +1 -1
  44. package/dist/collection/components/accordion/index.js +32 -12
  45. package/dist/collection/components/accordion/index.js.map +1 -1
  46. package/dist/collection/components/accordion-item/index.js +18 -25
  47. package/dist/collection/components/accordion-item/index.js.map +1 -1
  48. package/dist/collection/components/app/index.js +99 -29
  49. package/dist/collection/components/app/index.js.map +1 -1
  50. package/dist/collection/components/app/room/index.js +134 -25
  51. package/dist/collection/components/app/room/index.js.map +1 -1
  52. package/dist/collection/components/app/room/style.css +39 -10
  53. package/dist/collection/components/app/style.css +104 -39
  54. package/dist/collection/components/app-demo/index.js +1 -1
  55. package/dist/collection/components/app-demo/index.js.map +1 -1
  56. package/dist/collection/components/backtotop/index.js +3 -3
  57. package/dist/collection/components/backtotop/index.js.map +1 -1
  58. package/dist/collection/components/burger/index.js +60 -14
  59. package/dist/collection/components/burger/index.js.map +1 -1
  60. package/dist/collection/components/burger/style.css +2 -2
  61. package/dist/collection/components/button/index.js +10 -23
  62. package/dist/collection/components/button/index.js.map +1 -1
  63. package/dist/collection/components/button/style.css +33 -35
  64. package/dist/collection/components/button-demo/index.js +4 -2
  65. package/dist/collection/components/button-demo/index.js.map +1 -1
  66. package/dist/collection/components/button-demo/style.css +1 -0
  67. package/dist/collection/components/calendar/generate.js +1 -1
  68. package/dist/collection/components/calendar/generate.js.map +1 -1
  69. package/dist/collection/components/calendar/index.js +16 -16
  70. package/dist/collection/components/calendar/index.js.map +1 -1
  71. package/dist/collection/components/checkbox/index.js +82 -29
  72. package/dist/collection/components/checkbox/index.js.map +1 -1
  73. package/dist/collection/components/checkbox/style.css +39 -42
  74. package/dist/collection/components/confirm/index.js +261 -0
  75. package/dist/collection/components/confirm/index.js.map +1 -0
  76. package/dist/collection/components/confirm/style.css +15 -0
  77. package/dist/collection/components/country/index.js +1 -1
  78. package/dist/collection/components/display/index.js +6 -3
  79. package/dist/collection/components/display/index.js.map +1 -1
  80. package/dist/collection/components/display-amount/index.js +1 -1
  81. package/dist/collection/components/display-demo/index.js +16 -1
  82. package/dist/collection/components/display-demo/index.js.map +1 -1
  83. package/dist/collection/components/filter/Filter.js +17 -0
  84. package/dist/collection/components/filter/Filter.js.map +1 -0
  85. package/dist/collection/components/filter/field/index.js +105 -0
  86. package/dist/collection/components/filter/field/index.js.map +1 -0
  87. package/dist/collection/components/filter/field/style.css +4 -0
  88. package/dist/collection/components/filter/index.js +55 -132
  89. package/dist/collection/components/filter/index.js.map +1 -1
  90. package/dist/collection/components/filter/input/index.js +64 -302
  91. package/dist/collection/components/filter/input/index.js.map +1 -1
  92. package/dist/collection/components/filter/picker/index.js +209 -0
  93. package/dist/collection/components/filter/picker/index.js.map +1 -0
  94. package/dist/collection/components/filter/picker/style.css +8 -0
  95. package/dist/collection/components/filter/style.css +56 -71
  96. package/dist/collection/components/filter/toggle/index.js +248 -0
  97. package/dist/collection/components/filter/toggle/index.js.map +1 -0
  98. package/dist/collection/components/filter/toggle/style.css +8 -0
  99. package/dist/collection/components/form/index.js +302 -35
  100. package/dist/collection/components/form/index.js.map +1 -1
  101. package/dist/collection/components/form/style.css +11 -17
  102. package/dist/collection/components/icon/index.js +29 -38
  103. package/dist/collection/components/icon/index.js.map +1 -1
  104. package/dist/collection/components/icon-demo/index.js +1 -1
  105. package/dist/collection/components/icon-demo/index.js.map +1 -1
  106. package/dist/collection/components/icon-demo/style.css +5 -6
  107. package/dist/collection/components/input/Clearable.js.map +1 -0
  108. package/dist/collection/components/input/Editable.js +18 -0
  109. package/dist/collection/components/input/Editable.js.map +1 -0
  110. package/dist/collection/components/input/Input.js +23 -0
  111. package/dist/collection/components/input/Input.js.map +1 -0
  112. package/dist/collection/components/input/Looks.js +8 -0
  113. package/dist/collection/components/input/Looks.js.map +1 -0
  114. package/dist/collection/components/input/Submittable.js +8 -0
  115. package/dist/collection/components/input/Submittable.js.map +1 -0
  116. package/dist/collection/components/input/checkbox/index.js +235 -0
  117. package/dist/collection/components/input/checkbox/index.js.map +1 -0
  118. package/dist/collection/components/input/checkbox/style.css +31 -0
  119. package/dist/collection/components/input/clear/index.js +242 -0
  120. package/dist/collection/components/input/clear/index.js.map +1 -0
  121. package/dist/collection/components/input/clear/style.css +256 -0
  122. package/dist/collection/components/input/color/index.js +226 -0
  123. package/dist/collection/components/input/color/index.js.map +1 -0
  124. package/dist/collection/components/input/color/style.css +15 -0
  125. package/dist/collection/components/{input-date-range → input/date}/index.js +153 -99
  126. package/dist/collection/components/input/date/index.js.map +1 -0
  127. package/dist/collection/components/input/date/range/index.js +443 -0
  128. package/dist/collection/components/input/date/range/index.js.map +1 -0
  129. package/dist/collection/components/input/date/range/style.css +94 -0
  130. package/dist/collection/components/input/date/style.css +83 -0
  131. package/dist/collection/components/input/demo/index.js +47 -0
  132. package/dist/collection/components/input/demo/index.js.map +1 -0
  133. package/dist/collection/components/input/demo/style.css +15 -0
  134. package/dist/collection/components/input/edit/index.js +231 -0
  135. package/dist/collection/components/input/edit/index.js.map +1 -0
  136. package/dist/collection/components/input/edit/style.css +239 -0
  137. package/dist/collection/components/input/file/index.js +305 -0
  138. package/dist/collection/components/input/file/index.js.map +1 -0
  139. package/dist/collection/components/input/file/style.css +107 -0
  140. package/dist/collection/components/input/index.js +329 -104
  141. package/dist/collection/components/input/index.js.map +1 -1
  142. package/dist/collection/components/{input-month → input/month}/index.js +8 -8
  143. package/dist/collection/components/input/month/index.js.map +1 -0
  144. package/dist/collection/components/input/radio/Selected.js +11 -0
  145. package/dist/collection/components/input/radio/Selected.js.map +1 -0
  146. package/dist/collection/components/input/radio/index.js +404 -0
  147. package/dist/collection/components/input/radio/index.js.map +1 -0
  148. package/dist/collection/components/input/radio/item/index.js +150 -0
  149. package/dist/collection/components/input/radio/item/index.js.map +1 -0
  150. package/dist/collection/components/input/radio/item/style.css +28 -0
  151. package/dist/collection/components/input/radio/style.css +66 -0
  152. package/dist/collection/components/input/range/index.js +305 -0
  153. package/dist/collection/components/input/range/index.js.map +1 -0
  154. package/dist/collection/components/input/range/style.css +154 -0
  155. package/dist/collection/components/input/reset/index.js +241 -0
  156. package/dist/collection/components/input/reset/index.js.map +1 -0
  157. package/dist/collection/components/input/reset/style.css +259 -0
  158. package/dist/collection/components/input/select/index.js +452 -0
  159. package/dist/collection/components/input/select/index.js.map +1 -0
  160. package/dist/collection/components/input/select/style.css +104 -0
  161. package/dist/collection/components/input/style.css +47 -10
  162. package/dist/collection/components/input/submit/index.js +232 -0
  163. package/dist/collection/components/input/submit/index.js.map +1 -0
  164. package/dist/collection/components/input/submit/style.css +236 -0
  165. package/dist/collection/components/item/index.js +5 -5
  166. package/dist/collection/components/item/index.js.map +1 -1
  167. package/dist/collection/components/label/index.js +81 -0
  168. package/dist/collection/components/label/index.js.map +1 -0
  169. package/dist/collection/components/label/style.css +15 -0
  170. package/dist/collection/components/lazy/index.js +73 -0
  171. package/dist/collection/components/lazy/index.js.map +1 -0
  172. package/dist/collection/components/{radio → load-more}/index.js +35 -46
  173. package/dist/collection/components/load-more/index.js.map +1 -0
  174. package/dist/collection/components/load-more/style.css +5 -0
  175. package/dist/collection/components/notification/index.js +45 -8
  176. package/dist/collection/components/notification/index.js.map +1 -1
  177. package/dist/collection/components/notification/style.css +25 -1
  178. package/dist/collection/components/notifier/style.css +1 -3
  179. package/dist/collection/components/picker/demo/index.js +91 -0
  180. package/dist/collection/components/picker/demo/index.js.map +1 -0
  181. package/dist/collection/components/picker/demo/style.css +30 -0
  182. package/dist/collection/components/picker/index.js +197 -396
  183. package/dist/collection/components/picker/index.js.map +1 -1
  184. package/dist/collection/components/picker/menu/index.js +429 -0
  185. package/dist/collection/components/picker/menu/index.js.map +1 -0
  186. package/dist/collection/components/picker/menu/style.css +44 -0
  187. package/dist/collection/components/picker/option/index.js +298 -0
  188. package/dist/collection/components/picker/option/index.js.map +1 -0
  189. package/dist/collection/components/picker/option/style.css +30 -0
  190. package/dist/collection/components/picker/slot-elements/index.js +109 -0
  191. package/dist/collection/components/picker/slot-elements/index.js.map +1 -0
  192. package/dist/collection/components/picker/slot-elements/style.css +3 -0
  193. package/dist/collection/components/picker/slotted-elements/index.js +84 -0
  194. package/dist/collection/components/picker/slotted-elements/index.js.map +1 -0
  195. package/dist/collection/components/picker/slotted-elements/style.css +3 -0
  196. package/dist/collection/components/picker/style.css +76 -136
  197. package/dist/collection/components/popup/index.js +5 -5
  198. package/dist/collection/components/popup/index.js.map +1 -1
  199. package/dist/collection/components/popup/style.css +4 -4
  200. package/dist/collection/components/select-demo/index.js +0 -87
  201. package/dist/collection/components/select-demo/index.js.map +1 -1
  202. package/dist/collection/components/spinner/style.css +1 -0
  203. package/dist/collection/components/submit/index.js +64 -5
  204. package/dist/collection/components/submit/index.js.map +1 -1
  205. package/dist/collection/components/submit/style.css +226 -0
  206. package/dist/collection/components/summary/index.js +46 -4
  207. package/dist/collection/components/summary/index.js.map +1 -1
  208. package/dist/collection/components/summary/style.css +25 -16
  209. package/dist/collection/components/svg/style.css +2 -2
  210. package/dist/collection/components/table/cell/index.js +1 -1
  211. package/dist/collection/components/table/cell/index.js.map +1 -1
  212. package/dist/collection/components/table/cell/style.css +18 -11
  213. package/dist/collection/components/table/demo/filtered/Root.js.map +1 -1
  214. package/dist/collection/components/table/demo/filtered/index.js +25 -18
  215. package/dist/collection/components/table/demo/filtered/index.js.map +1 -1
  216. package/dist/collection/components/table/demo/filtered/style.css +9 -0
  217. package/dist/collection/components/table/demo/index.js +2 -9
  218. package/dist/collection/components/table/demo/index.js.map +1 -1
  219. package/dist/collection/components/table/demo/style.css +7 -0
  220. package/dist/collection/components/table/demo/testing/data.js +28 -0
  221. package/dist/collection/components/table/demo/testing/data.js.map +1 -0
  222. package/dist/collection/components/table/demo/testing/index.js +28 -0
  223. package/dist/collection/components/table/demo/testing/index.js.map +1 -0
  224. package/dist/collection/components/table/demo/testing/style.css +32 -0
  225. package/dist/collection/components/table/expandable/cell/index.js +14 -33
  226. package/dist/collection/components/table/expandable/cell/index.js.map +1 -1
  227. package/dist/collection/components/table/expandable/cell/style.css +32 -25
  228. package/dist/collection/components/table/expandable/row/index.js +9 -51
  229. package/dist/collection/components/table/expandable/row/index.js.map +1 -1
  230. package/dist/collection/components/table/expandable/row/style.css +32 -29
  231. package/dist/collection/components/table/footer/index.js +19 -0
  232. package/dist/collection/components/table/footer/index.js.map +1 -0
  233. package/dist/collection/components/table/footer/style.css +10 -0
  234. package/dist/collection/components/table/header/style.css +2 -3
  235. package/dist/collection/components/table/index.js +55 -12
  236. package/dist/collection/components/table/index.js.map +1 -1
  237. package/dist/collection/components/table/row/index.js +37 -5
  238. package/dist/collection/components/table/row/index.js.map +1 -1
  239. package/dist/collection/components/table/row/style.css +4 -1
  240. package/dist/collection/components/table/style.css +0 -2
  241. package/dist/collection/components/theme/color/index.js +48 -0
  242. package/dist/collection/components/theme/color/index.js.map +1 -0
  243. package/dist/collection/components/theme/color/style.css +8 -0
  244. package/dist/collection/components/theme/color/variant/index.js +66 -0
  245. package/dist/collection/components/theme/color/variant/index.js.map +1 -0
  246. package/dist/collection/components/theme/color/variant/style.css +18 -0
  247. package/dist/collection/components/theme/colors/index.js +30 -0
  248. package/dist/collection/components/theme/colors/index.js.map +1 -0
  249. package/dist/collection/components/theme/colors/style.css +7 -0
  250. package/dist/collection/components/theme/picker/index.js +48 -0
  251. package/dist/collection/components/theme/picker/index.js.map +1 -0
  252. package/dist/collection/components/theme/picker/style.css +0 -0
  253. package/dist/collection/components/toggle-switch/index.js +69 -17
  254. package/dist/collection/components/toggle-switch/index.js.map +1 -1
  255. package/dist/collection/components/toggle-switch/style.css +19 -12
  256. package/dist/collection/components/trigger-source/index.js +3 -3
  257. package/dist/collection/components/trigger-source/index.js.map +1 -1
  258. package/dist/collection/global/Observers.js +22 -0
  259. package/dist/collection/global/Observers.js.map +1 -0
  260. package/dist/collection/global/index.js +5 -0
  261. package/dist/collection/global/index.js.map +1 -0
  262. package/dist/collection/index.js +2 -2
  263. package/dist/collection/index.js.map +1 -1
  264. package/dist/collection/model/Color.js +18 -1
  265. package/dist/collection/model/Color.js.map +1 -1
  266. package/dist/collection/{components/form → model}/Data.js +8 -1
  267. package/dist/collection/model/Data.js.map +1 -0
  268. package/dist/collection/model/Icon.js +23 -0
  269. package/dist/collection/model/Icon.js.map +1 -0
  270. package/dist/collection/model/Listenable.js +17 -4
  271. package/dist/collection/model/Listenable.js.map +1 -1
  272. package/dist/collection/model/Notice.js +1 -1
  273. package/dist/collection/model/Notice.js.map +1 -1
  274. package/dist/collection/model/Option.js.map +1 -1
  275. package/dist/collection/model/index.js +4 -0
  276. package/dist/collection/model/index.js.map +1 -1
  277. package/dist/collection/model/redirect.js +8 -0
  278. package/dist/collection/model/redirect.js.map +1 -0
  279. package/dist/collection/smoothly.js +3 -0
  280. package/dist/collection/smoothly.js.map +1 -0
  281. package/dist/custom-elements/index.d.ts +176 -50
  282. package/dist/custom-elements/index.js +13394 -29834
  283. package/dist/custom-elements/index.js.map +1 -1
  284. package/dist/esm/{Listenable-fb6f4723.js → Data-0390d600.js} +518 -7
  285. package/dist/esm/Data-0390d600.js.map +1 -0
  286. package/dist/esm/Observers-5f08e828.js +25 -0
  287. package/dist/esm/Observers-5f08e828.js.map +1 -0
  288. package/dist/esm/TimeZone-c8df4905.js +6181 -0
  289. package/dist/esm/TimeZone-c8df4905.js.map +1 -0
  290. package/dist/esm/getLanguage-1e9ec036.js +6116 -0
  291. package/dist/esm/getLanguage-1e9ec036.js.map +1 -0
  292. package/dist/esm/{index-6ac4212d.js → index-258984d3.js} +55 -2
  293. package/dist/esm/index-258984d3.js.map +1 -0
  294. package/dist/esm/index.js +20 -5
  295. package/dist/esm/index.js.map +1 -1
  296. package/dist/esm/loader.js +5 -4
  297. package/dist/esm/loader.js.map +1 -1
  298. package/dist/esm/{Notice-1fa17794.js → redirect-b0f87e88.js} +11 -3
  299. package/dist/esm/redirect-b0f87e88.js.map +1 -0
  300. package/dist/esm/smoothly-accordion-item.entry.js +57 -0
  301. package/dist/esm/smoothly-accordion-item.entry.js.map +1 -0
  302. package/dist/esm/smoothly-accordion.entry.js +54 -0
  303. package/dist/esm/smoothly-accordion.entry.js.map +1 -0
  304. package/dist/esm/smoothly-address-display.entry.js +1 -1
  305. package/dist/esm/smoothly-address.entry.js +1 -1
  306. package/dist/esm/smoothly-addresses.entry.js +1 -1
  307. package/dist/esm/smoothly-app_80.entry.js +10814 -0
  308. package/dist/esm/smoothly-app_80.entry.js.map +1 -0
  309. package/dist/esm/smoothly-checkbox.entry.js +98 -0
  310. package/dist/esm/smoothly-checkbox.entry.js.map +1 -0
  311. package/dist/esm/smoothly-color.entry.js +1 -1
  312. package/dist/esm/smoothly-country.entry.js +10 -9
  313. package/dist/esm/smoothly-country.entry.js.map +1 -1
  314. package/dist/esm/smoothly-display-date-time.entry.js +22 -0
  315. package/dist/esm/smoothly-display-date-time.entry.js.map +1 -0
  316. package/dist/esm/smoothly-google-font.entry.js +1 -1
  317. package/dist/esm/smoothly-reorder.entry.js +1 -1
  318. package/dist/esm/smoothly-trigger-sink.entry.js +2 -2
  319. package/dist/esm/smoothly-trigger-source.entry.js +4 -4
  320. package/dist/esm/smoothly-trigger-source.entry.js.map +1 -1
  321. package/dist/esm/smoothly.js +5 -4
  322. package/dist/esm/smoothly.js.map +1 -1
  323. package/dist/smoothly/index.esm.js +1 -1
  324. package/dist/smoothly/index.esm.js.map +1 -1
  325. package/dist/smoothly/{p-04fb45e1.entry.js → p-12182a73.entry.js} +2 -2
  326. package/dist/smoothly/{p-5629e452.entry.js → p-127dcc56.entry.js} +2 -2
  327. package/dist/smoothly/p-21905b32.entry.js +2 -0
  328. package/dist/smoothly/p-21905b32.entry.js.map +1 -0
  329. package/dist/smoothly/p-312ef066.js +2 -0
  330. package/dist/smoothly/p-312ef066.js.map +1 -0
  331. package/dist/smoothly/p-47151a53.entry.js +2 -0
  332. package/dist/smoothly/p-5e387578.js +3 -0
  333. package/dist/smoothly/p-5e387578.js.map +1 -0
  334. package/dist/smoothly/{p-0fec28cc.entry.js → p-6aebb818.entry.js} +2 -2
  335. package/dist/smoothly/p-6e9aca2e.entry.js +2 -0
  336. package/dist/smoothly/p-6e9aca2e.entry.js.map +1 -0
  337. package/dist/smoothly/{p-ae467192.entry.js → p-7bf147bf.entry.js} +2 -2
  338. package/dist/smoothly/p-823e02b0.entry.js +2 -0
  339. package/dist/smoothly/p-823e02b0.entry.js.map +1 -0
  340. package/dist/smoothly/p-9b828bde.js +2 -0
  341. package/dist/smoothly/p-9b828bde.js.map +1 -0
  342. package/dist/smoothly/p-a0ebd646.entry.js +2 -0
  343. package/dist/smoothly/p-a0ebd646.entry.js.map +1 -0
  344. package/dist/smoothly/{p-b3eef141.entry.js → p-b3eac6af.entry.js} +2 -2
  345. package/dist/smoothly/p-b9165e1d.entry.js +2 -0
  346. package/dist/smoothly/p-b9165e1d.entry.js.map +1 -0
  347. package/dist/smoothly/p-c833c402.js +2 -0
  348. package/dist/smoothly/p-c833c402.js.map +1 -0
  349. package/dist/smoothly/{p-3a6873ed.entry.js → p-cb493516.entry.js} +2 -2
  350. package/dist/smoothly/p-ede93d69.js +2 -0
  351. package/dist/smoothly/p-ede93d69.js.map +1 -0
  352. package/dist/smoothly/p-eef1c80b.entry.js +2 -0
  353. package/dist/smoothly/p-eef1c80b.entry.js.map +1 -0
  354. package/dist/smoothly/p-f125610c.entry.js +2 -0
  355. package/dist/smoothly/p-f125610c.entry.js.map +1 -0
  356. package/dist/smoothly/p-fa664317.js +2 -0
  357. package/dist/smoothly/p-fa664317.js.map +1 -0
  358. package/dist/smoothly/smoothly.esm.js +1 -1
  359. package/dist/smoothly/smoothly.esm.js.map +1 -1
  360. package/dist/types/components/Button.d.ts +1 -2
  361. package/dist/types/components/accordion/index.d.ts +1 -1
  362. package/dist/types/components/accordion-item/index.d.ts +5 -4
  363. package/dist/types/components/app/index.d.ts +23 -10
  364. package/dist/types/components/app/room/index.d.ts +21 -7
  365. package/dist/types/components/app-demo/index.d.ts +1 -0
  366. package/dist/types/components/backtotop/index.d.ts +1 -1
  367. package/dist/types/components/burger/index.d.ts +7 -2
  368. package/dist/types/components/button/index.d.ts +2 -2
  369. package/dist/types/components/calendar/index.d.ts +5 -5
  370. package/dist/types/components/checkbox/index.d.ts +7 -3
  371. package/dist/types/components/confirm/index.d.ts +19 -0
  372. package/dist/types/components/filter/Filter.d.ts +21 -0
  373. package/dist/types/components/filter/field/index.d.ts +10 -0
  374. package/dist/types/components/filter/index.d.ts +13 -12
  375. package/dist/types/components/filter/input/index.d.ts +15 -23
  376. package/dist/types/components/filter/picker/index.d.ts +24 -0
  377. package/dist/types/components/filter/toggle/index.d.ts +22 -0
  378. package/dist/types/components/form/index.d.ts +23 -7
  379. package/dist/types/components/icon/index.d.ts +3 -9
  380. package/dist/types/components/input/Editable.d.ts +20 -0
  381. package/dist/types/components/input/Input.d.ts +22 -0
  382. package/dist/types/components/input/Looks.d.ts +7 -0
  383. package/dist/types/components/input/Submittable.d.ts +6 -0
  384. package/dist/types/components/input/checkbox/index.d.ts +20 -0
  385. package/dist/types/components/input/clear/index.d.ts +17 -0
  386. package/dist/types/components/input/color/index.d.ts +24 -0
  387. package/dist/types/components/input/date/index.d.ts +28 -0
  388. package/dist/types/components/input/date/range/index.d.ts +33 -0
  389. package/dist/types/components/input/demo/index.d.ts +6 -0
  390. package/dist/types/components/input/edit/index.d.ts +17 -0
  391. package/dist/types/components/input/file/index.d.ts +24 -0
  392. package/dist/types/components/input/index.d.ts +30 -11
  393. package/dist/types/components/{input-month → input/month}/index.d.ts +2 -2
  394. package/dist/types/components/input/radio/Selected.d.ts +10 -0
  395. package/dist/types/components/input/radio/index.d.ts +35 -0
  396. package/dist/types/components/input/radio/item/index.d.ts +15 -0
  397. package/dist/types/components/input/range/index.d.ts +24 -0
  398. package/dist/types/components/input/reset/index.d.ts +18 -0
  399. package/dist/types/components/input/select/index.d.ts +36 -0
  400. package/dist/types/components/input/submit/index.d.ts +17 -0
  401. package/dist/types/components/item/index.d.ts +1 -1
  402. package/dist/types/components/label/index.d.ts +6 -0
  403. package/dist/types/components/lazy/index.d.ts +7 -0
  404. package/dist/types/components/load-more/index.d.ts +11 -0
  405. package/dist/types/components/notification/index.d.ts +3 -1
  406. package/dist/types/components/picker/demo/index.d.ts +22 -0
  407. package/dist/types/components/picker/index.d.ts +33 -45
  408. package/dist/types/components/picker/menu/index.d.ts +54 -0
  409. package/dist/types/components/picker/option/index.d.ts +23 -0
  410. package/dist/types/components/picker/slot-elements/index.d.ts +15 -0
  411. package/dist/types/components/picker/slotted-elements/index.d.ts +8 -0
  412. package/dist/types/components/popup/index.d.ts +1 -1
  413. package/dist/types/components/select-demo/index.d.ts +0 -9
  414. package/dist/types/components/submit/index.d.ts +6 -1
  415. package/dist/types/components/summary/index.d.ts +4 -0
  416. package/dist/types/components/table/demo/filtered/Root.d.ts +2 -0
  417. package/dist/types/components/table/demo/filtered/index.d.ts +7 -7
  418. package/dist/types/components/table/demo/index.d.ts +1 -1
  419. package/dist/types/components/table/demo/testing/data.d.ts +5 -0
  420. package/dist/types/components/table/demo/testing/index.d.ts +4 -0
  421. package/dist/types/components/table/expandable/cell/index.d.ts +4 -5
  422. package/dist/types/components/table/expandable/row/index.d.ts +3 -8
  423. package/dist/types/components/table/footer/index.d.ts +3 -0
  424. package/dist/types/components/table/index.d.ts +6 -3
  425. package/dist/types/components/table/row/index.d.ts +3 -1
  426. package/dist/types/components/theme/color/index.d.ts +5 -0
  427. package/dist/types/components/theme/color/variant/index.d.ts +6 -0
  428. package/dist/types/components/theme/colors/index.d.ts +3 -0
  429. package/dist/types/components/theme/picker/index.d.ts +4 -0
  430. package/dist/types/components/toggle-switch/index.d.ts +7 -2
  431. package/dist/types/components/trigger-source/index.d.ts +1 -1
  432. package/dist/types/components.d.ts +914 -347
  433. package/dist/types/global/Observers.d.ts +8 -0
  434. package/dist/types/global/index.d.ts +4 -0
  435. package/dist/types/index.d.ts +1 -3
  436. package/dist/types/model/Color.d.ts +7 -1
  437. package/dist/types/{components/form → model}/Data.d.ts +4 -0
  438. package/dist/types/model/Icon.d.ts +8 -0
  439. package/dist/types/model/Listenable.d.ts +10 -1
  440. package/dist/types/model/Notice.d.ts +1 -1
  441. package/dist/types/model/Option.d.ts +24 -6
  442. package/dist/types/model/index.d.ts +3 -0
  443. package/dist/types/model/redirect.d.ts +1 -0
  444. package/dist/types/smoothly.d.ts +3 -0
  445. package/package.json +7 -6
  446. package/dist/cjs/Listenable-63ea2d90.js.map +0 -1
  447. package/dist/cjs/Notice-88ba4c70.js.map +0 -1
  448. package/dist/cjs/getLanguage-4f0a45d5.js +0 -12227
  449. package/dist/cjs/getLanguage-4f0a45d5.js.map +0 -1
  450. package/dist/cjs/index-8adc5c1b.js.map +0 -1
  451. package/dist/cjs/index-d16d46f4.js +0 -1224
  452. package/dist/cjs/index-d16d46f4.js.map +0 -1
  453. package/dist/cjs/smoothly-accordion_62.cjs.entry.js +0 -28199
  454. package/dist/cjs/smoothly-accordion_62.cjs.entry.js.map +0 -1
  455. package/dist/cjs/smoothly-radio-group.cjs.entry.js +0 -22
  456. package/dist/cjs/smoothly-radio-group.cjs.entry.js.map +0 -1
  457. package/dist/collection/components/filter/Clearable.js.map +0 -1
  458. package/dist/collection/components/form/Clearable.js +0 -8
  459. package/dist/collection/components/form/Clearable.js.map +0 -1
  460. package/dist/collection/components/form/Data.js.map +0 -1
  461. package/dist/collection/components/input-date/index.js +0 -206
  462. package/dist/collection/components/input-date/index.js.map +0 -1
  463. package/dist/collection/components/input-date/style.css +0 -40
  464. package/dist/collection/components/input-date-range/index.js.map +0 -1
  465. package/dist/collection/components/input-date-range/style.css +0 -51
  466. package/dist/collection/components/input-demo/index.js +0 -45
  467. package/dist/collection/components/input-demo/index.js.map +0 -1
  468. package/dist/collection/components/input-demo/style.css +0 -4
  469. package/dist/collection/components/input-month/index.js.map +0 -1
  470. package/dist/collection/components/menu-options/index.js +0 -413
  471. package/dist/collection/components/menu-options/index.js.map +0 -1
  472. package/dist/collection/components/menu-options/style.css +0 -18
  473. package/dist/collection/components/option/index.js +0 -270
  474. package/dist/collection/components/option/index.js.map +0 -1
  475. package/dist/collection/components/option/style.css +0 -42
  476. package/dist/collection/components/radio/index.js.map +0 -1
  477. package/dist/collection/components/radio/style.css +0 -31
  478. package/dist/collection/components/radio-button/Selected.js +0 -2
  479. package/dist/collection/components/radio-button/Selected.js.map +0 -1
  480. package/dist/collection/components/radio-button/index.js +0 -137
  481. package/dist/collection/components/radio-button/index.js.map +0 -1
  482. package/dist/collection/components/radio-button/item/index.js +0 -117
  483. package/dist/collection/components/radio-button/item/index.js.map +0 -1
  484. package/dist/collection/components/radio-button/item/style.css +0 -85
  485. package/dist/collection/components/radio-group/index.js +0 -43
  486. package/dist/collection/components/radio-group/index.js.map +0 -1
  487. package/dist/collection/components/radio-group/style.css +0 -36
  488. package/dist/collection/components/select/index.js +0 -108
  489. package/dist/collection/components/select/index.js.map +0 -1
  490. package/dist/collection/components/select/style.css +0 -20
  491. package/dist/collection/components/selector/index.js +0 -234
  492. package/dist/collection/components/selector/index.js.map +0 -1
  493. package/dist/collection/components/selector/style.css +0 -46
  494. package/dist/custom-elements/index2.js +0 -1222
  495. package/dist/custom-elements/index2.js.map +0 -1
  496. package/dist/esm/Listenable-fb6f4723.js.map +0 -1
  497. package/dist/esm/Notice-1fa17794.js.map +0 -1
  498. package/dist/esm/getLanguage-ffacd7b7.js +0 -12225
  499. package/dist/esm/getLanguage-ffacd7b7.js.map +0 -1
  500. package/dist/esm/index-6ac4212d.js.map +0 -1
  501. package/dist/esm/index-d5330059.js +0 -1222
  502. package/dist/esm/index-d5330059.js.map +0 -1
  503. package/dist/esm/smoothly-accordion_62.entry.js +0 -28134
  504. package/dist/esm/smoothly-accordion_62.entry.js.map +0 -1
  505. package/dist/esm/smoothly-radio-group.entry.js +0 -18
  506. package/dist/esm/smoothly-radio-group.entry.js.map +0 -1
  507. package/dist/smoothly/p-06337b89.js +0 -2
  508. package/dist/smoothly/p-06337b89.js.map +0 -1
  509. package/dist/smoothly/p-16cba662.entry.js +0 -2
  510. package/dist/smoothly/p-16cba662.entry.js.map +0 -1
  511. package/dist/smoothly/p-3ad51805.entry.js +0 -2
  512. package/dist/smoothly/p-3ad51805.entry.js.map +0 -1
  513. package/dist/smoothly/p-5e34795b.js +0 -2
  514. package/dist/smoothly/p-5e34795b.js.map +0 -1
  515. package/dist/smoothly/p-75373584.js +0 -2
  516. package/dist/smoothly/p-75373584.js.map +0 -1
  517. package/dist/smoothly/p-75452eb8.js +0 -2
  518. package/dist/smoothly/p-75452eb8.js.map +0 -1
  519. package/dist/smoothly/p-ae33d7e1.entry.js +0 -2
  520. package/dist/smoothly/p-ae33d7e1.entry.js.map +0 -1
  521. package/dist/smoothly/p-b98cd447.js +0 -3
  522. package/dist/smoothly/p-b98cd447.js.map +0 -1
  523. package/dist/smoothly/p-c109fc66.entry.js +0 -2
  524. package/dist/smoothly/p-c109fc66.entry.js.map +0 -1
  525. package/dist/smoothly/p-f29cc9ff.entry.js +0 -2
  526. package/dist/types/components/form/Clearable.d.ts +0 -6
  527. package/dist/types/components/input-date/index.d.ts +0 -14
  528. package/dist/types/components/input-date-range/index.d.ts +0 -23
  529. package/dist/types/components/input-demo/index.d.ts +0 -3
  530. package/dist/types/components/menu-options/index.d.ts +0 -35
  531. package/dist/types/components/option/index.d.ts +0 -32
  532. package/dist/types/components/radio/index.d.ts +0 -13
  533. package/dist/types/components/radio-button/Selected.d.ts +0 -5
  534. package/dist/types/components/radio-button/index.d.ts +0 -15
  535. package/dist/types/components/radio-button/item/index.d.ts +0 -12
  536. package/dist/types/components/radio-group/index.d.ts +0 -4
  537. package/dist/types/components/select/index.d.ts +0 -14
  538. package/dist/types/components/selector/index.d.ts +0 -23
  539. /package/dist/collection/components/{filter → input}/Clearable.js +0 -0
  540. /package/dist/collection/components/{input-month → input/month}/style.css +0 -0
  541. /package/dist/collection/components/{radio-button → lazy}/style.css +0 -0
  542. /package/dist/smoothly/{p-04fb45e1.entry.js.map → p-12182a73.entry.js.map} +0 -0
  543. /package/dist/smoothly/{p-5629e452.entry.js.map → p-127dcc56.entry.js.map} +0 -0
  544. /package/dist/smoothly/{p-f29cc9ff.entry.js.map → p-47151a53.entry.js.map} +0 -0
  545. /package/dist/smoothly/{p-0fec28cc.entry.js.map → p-6aebb818.entry.js.map} +0 -0
  546. /package/dist/smoothly/{p-ae467192.entry.js.map → p-7bf147bf.entry.js.map} +0 -0
  547. /package/dist/smoothly/{p-b3eef141.entry.js.map → p-b3eac6af.entry.js.map} +0 -0
  548. /package/dist/smoothly/{p-3a6873ed.entry.js.map → p-cb493516.entry.js.map} +0 -0
  549. /package/dist/types/components/{filter → input}/Clearable.d.ts +0 -0
@@ -1,1224 +0,0 @@
1
- 'use strict';
2
-
3
- // src/path-to-regex-modified.ts
4
- var regexIdentifierStart = /[$_\p{ID_Start}]/u;
5
- var regexIdentifierPart = /[$_\u200C\u200D\p{ID_Continue}]/u;
6
- function isASCII(str, extended) {
7
- return (extended ? /^[\x00-\xFF]*$/ : /^[\x00-\x7F]*$/).test(str);
8
- }
9
- function lexer(str, lenient = false) {
10
- const tokens = [];
11
- let i = 0;
12
- while (i < str.length) {
13
- const char = str[i];
14
- const ErrorOrInvalid = function(msg) {
15
- if (!lenient)
16
- throw new TypeError(msg);
17
- tokens.push({ type: "INVALID_CHAR", index: i, value: str[i++] });
18
- };
19
- if (char === "*") {
20
- tokens.push({ type: "ASTERISK", index: i, value: str[i++] });
21
- continue;
22
- }
23
- if (char === "+" || char === "?") {
24
- tokens.push({ type: "MODIFIER", index: i, value: str[i++] });
25
- continue;
26
- }
27
- if (char === "\\") {
28
- tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] });
29
- continue;
30
- }
31
- if (char === "{") {
32
- tokens.push({ type: "OPEN", index: i, value: str[i++] });
33
- continue;
34
- }
35
- if (char === "}") {
36
- tokens.push({ type: "CLOSE", index: i, value: str[i++] });
37
- continue;
38
- }
39
- if (char === ":") {
40
- let name = "";
41
- let j = i + 1;
42
- while (j < str.length) {
43
- const code = str.substr(j, 1);
44
- if (j === i + 1 && regexIdentifierStart.test(code) || j !== i + 1 && regexIdentifierPart.test(code)) {
45
- name += str[j++];
46
- continue;
47
- }
48
- break;
49
- }
50
- if (!name) {
51
- ErrorOrInvalid(`Missing parameter name at ${i}`);
52
- continue;
53
- }
54
- tokens.push({ type: "NAME", index: i, value: name });
55
- i = j;
56
- continue;
57
- }
58
- if (char === "(") {
59
- let count = 1;
60
- let pattern = "";
61
- let j = i + 1;
62
- let error = false;
63
- if (str[j] === "?") {
64
- ErrorOrInvalid(`Pattern cannot start with "?" at ${j}`);
65
- continue;
66
- }
67
- while (j < str.length) {
68
- if (!isASCII(str[j], false)) {
69
- ErrorOrInvalid(`Invalid character '${str[j]}' at ${j}.`);
70
- error = true;
71
- break;
72
- }
73
- if (str[j] === "\\") {
74
- pattern += str[j++] + str[j++];
75
- continue;
76
- }
77
- if (str[j] === ")") {
78
- count--;
79
- if (count === 0) {
80
- j++;
81
- break;
82
- }
83
- } else if (str[j] === "(") {
84
- count++;
85
- if (str[j + 1] !== "?") {
86
- ErrorOrInvalid(`Capturing groups are not allowed at ${j}`);
87
- error = true;
88
- break;
89
- }
90
- }
91
- pattern += str[j++];
92
- }
93
- if (error) {
94
- continue;
95
- }
96
- if (count) {
97
- ErrorOrInvalid(`Unbalanced pattern at ${i}`);
98
- continue;
99
- }
100
- if (!pattern) {
101
- ErrorOrInvalid(`Missing pattern at ${i}`);
102
- continue;
103
- }
104
- tokens.push({ type: "PATTERN", index: i, value: pattern });
105
- i = j;
106
- continue;
107
- }
108
- tokens.push({ type: "CHAR", index: i, value: str[i++] });
109
- }
110
- tokens.push({ type: "END", index: i, value: "" });
111
- return tokens;
112
- }
113
- function parse(str, options = {}) {
114
- const tokens = lexer(str);
115
- const { prefixes = "./" } = options;
116
- const defaultPattern = `[^${escapeString(options.delimiter === void 0 ? "/#?" : options.delimiter)}]+?`;
117
- const result = [];
118
- let key = 0;
119
- let i = 0;
120
- let path = "";
121
- let nameSet = /* @__PURE__ */ new Set();
122
- const tryConsume = (type) => {
123
- if (i < tokens.length && tokens[i].type === type)
124
- return tokens[i++].value;
125
- };
126
- const tryConsumeModifier = () => {
127
- const r = tryConsume("MODIFIER");
128
- if (r) {
129
- return r;
130
- }
131
- return tryConsume("ASTERISK");
132
- };
133
- const mustConsume = (type) => {
134
- const value = tryConsume(type);
135
- if (value !== void 0)
136
- return value;
137
- const { type: nextType, index } = tokens[i];
138
- throw new TypeError(`Unexpected ${nextType} at ${index}, expected ${type}`);
139
- };
140
- const consumeText = () => {
141
- let result2 = "";
142
- let value;
143
- while (value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR")) {
144
- result2 += value;
145
- }
146
- return result2;
147
- };
148
- const DefaultEncodePart = (value) => {
149
- return value;
150
- };
151
- const encodePart = options.encodePart || DefaultEncodePart;
152
- while (i < tokens.length) {
153
- const char = tryConsume("CHAR");
154
- const name = tryConsume("NAME");
155
- let pattern = tryConsume("PATTERN");
156
- if (!name && !pattern && tryConsume("ASTERISK")) {
157
- pattern = ".*";
158
- }
159
- if (name || pattern) {
160
- let prefix = char || "";
161
- if (prefixes.indexOf(prefix) === -1) {
162
- path += prefix;
163
- prefix = "";
164
- }
165
- if (path) {
166
- result.push(encodePart(path));
167
- path = "";
168
- }
169
- const finalName = name || key++;
170
- if (nameSet.has(finalName)) {
171
- throw new TypeError(`Duplicate name '${finalName}'.`);
172
- }
173
- nameSet.add(finalName);
174
- result.push({
175
- name: finalName,
176
- prefix: encodePart(prefix),
177
- suffix: "",
178
- pattern: pattern || defaultPattern,
179
- modifier: tryConsumeModifier() || ""
180
- });
181
- continue;
182
- }
183
- const value = char || tryConsume("ESCAPED_CHAR");
184
- if (value) {
185
- path += value;
186
- continue;
187
- }
188
- const open = tryConsume("OPEN");
189
- if (open) {
190
- const prefix = consumeText();
191
- const name2 = tryConsume("NAME") || "";
192
- let pattern2 = tryConsume("PATTERN") || "";
193
- if (!name2 && !pattern2 && tryConsume("ASTERISK")) {
194
- pattern2 = ".*";
195
- }
196
- const suffix = consumeText();
197
- mustConsume("CLOSE");
198
- const modifier = tryConsumeModifier() || "";
199
- if (!name2 && !pattern2 && !modifier) {
200
- path += prefix;
201
- continue;
202
- }
203
- if (!name2 && !pattern2 && !prefix) {
204
- continue;
205
- }
206
- if (path) {
207
- result.push(encodePart(path));
208
- path = "";
209
- }
210
- result.push({
211
- name: name2 || (pattern2 ? key++ : ""),
212
- pattern: name2 && !pattern2 ? defaultPattern : pattern2,
213
- prefix: encodePart(prefix),
214
- suffix: encodePart(suffix),
215
- modifier
216
- });
217
- continue;
218
- }
219
- if (path) {
220
- result.push(encodePart(path));
221
- path = "";
222
- }
223
- mustConsume("END");
224
- }
225
- return result;
226
- }
227
- function escapeString(str) {
228
- return str.replace(/([.+*?^${}()[\]|/\\])/g, "\\$1");
229
- }
230
- function flags(options) {
231
- return options && options.ignoreCase ? "ui" : "u";
232
- }
233
- function regexpToRegexp(path, keys) {
234
- if (!keys)
235
- return path;
236
- const groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g;
237
- let index = 0;
238
- let execResult = groupsRegex.exec(path.source);
239
- while (execResult) {
240
- keys.push({
241
- name: execResult[1] || index++,
242
- prefix: "",
243
- suffix: "",
244
- modifier: "",
245
- pattern: ""
246
- });
247
- execResult = groupsRegex.exec(path.source);
248
- }
249
- return path;
250
- }
251
- function arrayToRegexp(paths, keys, options) {
252
- const parts = paths.map((path) => pathToRegexp(path, keys, options).source);
253
- return new RegExp(`(?:${parts.join("|")})`, flags(options));
254
- }
255
- function stringToRegexp(path, keys, options) {
256
- return tokensToRegexp(parse(path, options), keys, options);
257
- }
258
- function tokensToRegexp(tokens, keys, options = {}) {
259
- const {
260
- strict = false,
261
- start = true,
262
- end = true,
263
- encode = (x) => x
264
- } = options;
265
- const endsWith = `[${escapeString(options.endsWith === void 0 ? "" : options.endsWith)}]|$`;
266
- const delimiter = `[${escapeString(options.delimiter === void 0 ? "/#?" : options.delimiter)}]`;
267
- let route = start ? "^" : "";
268
- for (const token of tokens) {
269
- if (typeof token === "string") {
270
- route += escapeString(encode(token));
271
- } else {
272
- const prefix = escapeString(encode(token.prefix));
273
- const suffix = escapeString(encode(token.suffix));
274
- if (token.pattern) {
275
- if (keys)
276
- keys.push(token);
277
- if (prefix || suffix) {
278
- if (token.modifier === "+" || token.modifier === "*") {
279
- const mod = token.modifier === "*" ? "?" : "";
280
- route += `(?:${prefix}((?:${token.pattern})(?:${suffix}${prefix}(?:${token.pattern}))*)${suffix})${mod}`;
281
- } else {
282
- route += `(?:${prefix}(${token.pattern})${suffix})${token.modifier}`;
283
- }
284
- } else {
285
- if (token.modifier === "+" || token.modifier === "*") {
286
- route += `((?:${token.pattern})${token.modifier})`;
287
- } else {
288
- route += `(${token.pattern})${token.modifier}`;
289
- }
290
- }
291
- } else {
292
- route += `(?:${prefix}${suffix})${token.modifier}`;
293
- }
294
- }
295
- }
296
- if (end) {
297
- if (!strict)
298
- route += `${delimiter}?`;
299
- route += !options.endsWith ? "$" : `(?=${endsWith})`;
300
- } else {
301
- const endToken = tokens[tokens.length - 1];
302
- const isEndDelimited = typeof endToken === "string" ? delimiter.indexOf(endToken[endToken.length - 1]) > -1 : endToken === void 0;
303
- if (!strict) {
304
- route += `(?:${delimiter}(?=${endsWith}))?`;
305
- }
306
- if (!isEndDelimited) {
307
- route += `(?=${delimiter}|${endsWith})`;
308
- }
309
- }
310
- return new RegExp(route, flags(options));
311
- }
312
- function pathToRegexp(path, keys, options) {
313
- if (path instanceof RegExp)
314
- return regexpToRegexp(path, keys);
315
- if (Array.isArray(path))
316
- return arrayToRegexp(path, keys, options);
317
- return stringToRegexp(path, keys, options);
318
- }
319
-
320
- // src/url-utils.ts
321
- var DEFAULT_OPTIONS = {
322
- delimiter: "",
323
- prefixes: "",
324
- sensitive: true,
325
- strict: true
326
- };
327
- var HOSTNAME_OPTIONS = {
328
- delimiter: ".",
329
- prefixes: "",
330
- sensitive: true,
331
- strict: true
332
- };
333
- var PATHNAME_OPTIONS = {
334
- delimiter: "/",
335
- prefixes: "/",
336
- sensitive: true,
337
- strict: true
338
- };
339
- function isAbsolutePathname(pathname, isPattern) {
340
- if (!pathname.length) {
341
- return false;
342
- }
343
- if (pathname[0] === "/") {
344
- return true;
345
- }
346
- if (!isPattern) {
347
- return false;
348
- }
349
- if (pathname.length < 2) {
350
- return false;
351
- }
352
- if ((pathname[0] == "\\" || pathname[0] == "{") && pathname[1] == "/") {
353
- return true;
354
- }
355
- return false;
356
- }
357
- function maybeStripPrefix(value, prefix) {
358
- if (value.startsWith(prefix)) {
359
- return value.substring(prefix.length, value.length);
360
- }
361
- return value;
362
- }
363
- function maybeStripSuffix(value, suffix) {
364
- if (value.endsWith(suffix)) {
365
- return value.substr(0, value.length - suffix.length);
366
- }
367
- return value;
368
- }
369
- function treatAsIPv6Hostname(value) {
370
- if (!value || value.length < 2) {
371
- return false;
372
- }
373
- if (value[0] === "[") {
374
- return true;
375
- }
376
- if ((value[0] === "\\" || value[0] === "{") && value[1] === "[") {
377
- return true;
378
- }
379
- return false;
380
- }
381
- var SPECIAL_SCHEMES = [
382
- "ftp",
383
- "file",
384
- "http",
385
- "https",
386
- "ws",
387
- "wss"
388
- ];
389
- function isSpecialScheme(protocol_regexp) {
390
- if (!protocol_regexp) {
391
- return true;
392
- }
393
- for (const scheme of SPECIAL_SCHEMES) {
394
- if (protocol_regexp.test(scheme)) {
395
- return true;
396
- }
397
- }
398
- return false;
399
- }
400
- function canonicalizeHash(hash, isPattern) {
401
- hash = maybeStripPrefix(hash, "#");
402
- if (isPattern || hash === "") {
403
- return hash;
404
- }
405
- const url = new URL("https://example.com");
406
- url.hash = hash;
407
- return url.hash ? url.hash.substring(1, url.hash.length) : "";
408
- }
409
- function canonicalizeSearch(search, isPattern) {
410
- search = maybeStripPrefix(search, "?");
411
- if (isPattern || search === "") {
412
- return search;
413
- }
414
- const url = new URL("https://example.com");
415
- url.search = search;
416
- return url.search ? url.search.substring(1, url.search.length) : "";
417
- }
418
- function canonicalizeHostname(hostname, isPattern) {
419
- if (isPattern || hostname === "") {
420
- return hostname;
421
- }
422
- if (treatAsIPv6Hostname(hostname)) {
423
- return ipv6HostnameEncodeCallback(hostname);
424
- } else {
425
- return hostnameEncodeCallback(hostname);
426
- }
427
- }
428
- function canonicalizePassword(password, isPattern) {
429
- if (isPattern || password === "") {
430
- return password;
431
- }
432
- const url = new URL("https://example.com");
433
- url.password = password;
434
- return url.password;
435
- }
436
- function canonicalizeUsername(username, isPattern) {
437
- if (isPattern || username === "") {
438
- return username;
439
- }
440
- const url = new URL("https://example.com");
441
- url.username = username;
442
- return url.username;
443
- }
444
- function canonicalizePathname(pathname, protocol, isPattern) {
445
- if (isPattern || pathname === "") {
446
- return pathname;
447
- }
448
- if (protocol && !SPECIAL_SCHEMES.includes(protocol)) {
449
- const url = new URL(`${protocol}:${pathname}`);
450
- return url.pathname;
451
- }
452
- const leadingSlash = pathname[0] == "/";
453
- pathname = new URL(
454
- !leadingSlash ? "/-" + pathname : pathname,
455
- "https://example.com"
456
- ).pathname;
457
- if (!leadingSlash) {
458
- pathname = pathname.substring(2, pathname.length);
459
- }
460
- return pathname;
461
- }
462
- function canonicalizePort(port, protocol, isPattern) {
463
- if (defaultPortForProtocol(protocol) === port) {
464
- port = "";
465
- }
466
- if (isPattern || port === "") {
467
- return port;
468
- }
469
- return portEncodeCallback(port);
470
- }
471
- function canonicalizeProtocol(protocol, isPattern) {
472
- protocol = maybeStripSuffix(protocol, ":");
473
- if (isPattern || protocol === "") {
474
- return protocol;
475
- }
476
- return protocolEncodeCallback(protocol);
477
- }
478
- function defaultPortForProtocol(protocol) {
479
- switch (protocol) {
480
- case "ws":
481
- case "http":
482
- return "80";
483
- case "wws":
484
- case "https":
485
- return "443";
486
- case "ftp":
487
- return "21";
488
- default:
489
- return "";
490
- }
491
- }
492
- function protocolEncodeCallback(input) {
493
- if (input === "") {
494
- return input;
495
- }
496
- if (/^[-+.A-Za-z0-9]*$/.test(input))
497
- return input.toLowerCase();
498
- throw new TypeError(`Invalid protocol '${input}'.`);
499
- }
500
- function usernameEncodeCallback(input) {
501
- if (input === "") {
502
- return input;
503
- }
504
- const url = new URL("https://example.com");
505
- url.username = input;
506
- return url.username;
507
- }
508
- function passwordEncodeCallback(input) {
509
- if (input === "") {
510
- return input;
511
- }
512
- const url = new URL("https://example.com");
513
- url.password = input;
514
- return url.password;
515
- }
516
- function hostnameEncodeCallback(input) {
517
- if (input === "") {
518
- return input;
519
- }
520
- if (/[\t\n\r #%/:<>?@[\]^\\|]/g.test(input)) {
521
- throw new TypeError(`Invalid hostname '${input}'`);
522
- }
523
- const url = new URL("https://example.com");
524
- url.hostname = input;
525
- return url.hostname;
526
- }
527
- function ipv6HostnameEncodeCallback(input) {
528
- if (input === "") {
529
- return input;
530
- }
531
- if (/[^0-9a-fA-F[\]:]/g.test(input)) {
532
- throw new TypeError(`Invalid IPv6 hostname '${input}'`);
533
- }
534
- return input.toLowerCase();
535
- }
536
- function portEncodeCallback(input) {
537
- if (input === "") {
538
- return input;
539
- }
540
- if (/^[0-9]*$/.test(input) && parseInt(input) <= 65535) {
541
- return input;
542
- }
543
- throw new TypeError(`Invalid port '${input}'.`);
544
- }
545
- function standardURLPathnameEncodeCallback(input) {
546
- if (input === "") {
547
- return input;
548
- }
549
- const url = new URL("https://example.com");
550
- url.pathname = input[0] !== "/" ? "/-" + input : input;
551
- if (input[0] !== "/") {
552
- return url.pathname.substring(2, url.pathname.length);
553
- }
554
- return url.pathname;
555
- }
556
- function pathURLPathnameEncodeCallback(input) {
557
- if (input === "") {
558
- return input;
559
- }
560
- const url = new URL(`data:${input}`);
561
- return url.pathname;
562
- }
563
- function searchEncodeCallback(input) {
564
- if (input === "") {
565
- return input;
566
- }
567
- const url = new URL("https://example.com");
568
- url.search = input;
569
- return url.search.substring(1, url.search.length);
570
- }
571
- function hashEncodeCallback(input) {
572
- if (input === "") {
573
- return input;
574
- }
575
- const url = new URL("https://example.com");
576
- url.hash = input;
577
- return url.hash.substring(1, url.hash.length);
578
- }
579
-
580
- // src/url-pattern-parser.ts
581
- var Parser = class {
582
- constructor(input) {
583
- this.tokenList = [];
584
- this.internalResult = {};
585
- this.tokenIndex = 0;
586
- this.tokenIncrement = 1;
587
- this.componentStart = 0;
588
- this.state = 0 /* INIT */;
589
- this.groupDepth = 0;
590
- this.hostnameIPv6BracketDepth = 0;
591
- this.shouldTreatAsStandardURL = false;
592
- this.input = input;
593
- }
594
- get result() {
595
- return this.internalResult;
596
- }
597
- parse() {
598
- this.tokenList = lexer(this.input, true);
599
- for (; this.tokenIndex < this.tokenList.length; this.tokenIndex += this.tokenIncrement) {
600
- this.tokenIncrement = 1;
601
- if (this.tokenList[this.tokenIndex].type === "END") {
602
- if (this.state === 0 /* INIT */) {
603
- this.rewind();
604
- if (this.isHashPrefix()) {
605
- this.changeState(9 /* HASH */, 1);
606
- } else if (this.isSearchPrefix()) {
607
- this.changeState(8 /* SEARCH */, 1);
608
- this.internalResult.hash = "";
609
- } else {
610
- this.changeState(7 /* PATHNAME */, 0);
611
- this.internalResult.search = "";
612
- this.internalResult.hash = "";
613
- }
614
- continue;
615
- } else if (this.state === 2 /* AUTHORITY */) {
616
- this.rewindAndSetState(5 /* HOSTNAME */);
617
- continue;
618
- }
619
- this.changeState(10 /* DONE */, 0);
620
- break;
621
- }
622
- if (this.groupDepth > 0) {
623
- if (this.isGroupClose()) {
624
- this.groupDepth -= 1;
625
- } else {
626
- continue;
627
- }
628
- }
629
- if (this.isGroupOpen()) {
630
- this.groupDepth += 1;
631
- continue;
632
- }
633
- switch (this.state) {
634
- case 0 /* INIT */:
635
- if (this.isProtocolSuffix()) {
636
- this.internalResult.username = "";
637
- this.internalResult.password = "";
638
- this.internalResult.hostname = "";
639
- this.internalResult.port = "";
640
- this.internalResult.pathname = "";
641
- this.internalResult.search = "";
642
- this.internalResult.hash = "";
643
- this.rewindAndSetState(1 /* PROTOCOL */);
644
- }
645
- break;
646
- case 1 /* PROTOCOL */:
647
- if (this.isProtocolSuffix()) {
648
- this.computeShouldTreatAsStandardURL();
649
- let nextState = 7 /* PATHNAME */;
650
- let skip = 1;
651
- if (this.shouldTreatAsStandardURL) {
652
- this.internalResult.pathname = "/";
653
- }
654
- if (this.nextIsAuthoritySlashes()) {
655
- nextState = 2 /* AUTHORITY */;
656
- skip = 3;
657
- } else if (this.shouldTreatAsStandardURL) {
658
- nextState = 2 /* AUTHORITY */;
659
- }
660
- this.changeState(nextState, skip);
661
- }
662
- break;
663
- case 2 /* AUTHORITY */:
664
- if (this.isIdentityTerminator()) {
665
- this.rewindAndSetState(3 /* USERNAME */);
666
- } else if (this.isPathnameStart() || this.isSearchPrefix() || this.isHashPrefix()) {
667
- this.rewindAndSetState(5 /* HOSTNAME */);
668
- }
669
- break;
670
- case 3 /* USERNAME */:
671
- if (this.isPasswordPrefix()) {
672
- this.changeState(4 /* PASSWORD */, 1);
673
- } else if (this.isIdentityTerminator()) {
674
- this.changeState(5 /* HOSTNAME */, 1);
675
- }
676
- break;
677
- case 4 /* PASSWORD */:
678
- if (this.isIdentityTerminator()) {
679
- this.changeState(5 /* HOSTNAME */, 1);
680
- }
681
- break;
682
- case 5 /* HOSTNAME */:
683
- if (this.isIPv6Open()) {
684
- this.hostnameIPv6BracketDepth += 1;
685
- } else if (this.isIPv6Close()) {
686
- this.hostnameIPv6BracketDepth -= 1;
687
- }
688
- if (this.isPortPrefix() && !this.hostnameIPv6BracketDepth) {
689
- this.changeState(6 /* PORT */, 1);
690
- } else if (this.isPathnameStart()) {
691
- this.changeState(7 /* PATHNAME */, 0);
692
- } else if (this.isSearchPrefix()) {
693
- this.changeState(8 /* SEARCH */, 1);
694
- } else if (this.isHashPrefix()) {
695
- this.changeState(9 /* HASH */, 1);
696
- }
697
- break;
698
- case 6 /* PORT */:
699
- if (this.isPathnameStart()) {
700
- this.changeState(7 /* PATHNAME */, 0);
701
- } else if (this.isSearchPrefix()) {
702
- this.changeState(8 /* SEARCH */, 1);
703
- } else if (this.isHashPrefix()) {
704
- this.changeState(9 /* HASH */, 1);
705
- }
706
- break;
707
- case 7 /* PATHNAME */:
708
- if (this.isSearchPrefix()) {
709
- this.changeState(8 /* SEARCH */, 1);
710
- } else if (this.isHashPrefix()) {
711
- this.changeState(9 /* HASH */, 1);
712
- }
713
- break;
714
- case 8 /* SEARCH */:
715
- if (this.isHashPrefix()) {
716
- this.changeState(9 /* HASH */, 1);
717
- }
718
- break;
719
- }
720
- }
721
- }
722
- changeState(newState, skip) {
723
- switch (this.state) {
724
- case 0 /* INIT */:
725
- break;
726
- case 1 /* PROTOCOL */:
727
- this.internalResult.protocol = this.makeComponentString();
728
- break;
729
- case 2 /* AUTHORITY */:
730
- break;
731
- case 3 /* USERNAME */:
732
- this.internalResult.username = this.makeComponentString();
733
- break;
734
- case 4 /* PASSWORD */:
735
- this.internalResult.password = this.makeComponentString();
736
- break;
737
- case 5 /* HOSTNAME */:
738
- this.internalResult.hostname = this.makeComponentString();
739
- break;
740
- case 6 /* PORT */:
741
- this.internalResult.port = this.makeComponentString();
742
- break;
743
- case 7 /* PATHNAME */:
744
- this.internalResult.pathname = this.makeComponentString();
745
- break;
746
- case 8 /* SEARCH */:
747
- this.internalResult.search = this.makeComponentString();
748
- break;
749
- case 9 /* HASH */:
750
- this.internalResult.hash = this.makeComponentString();
751
- break;
752
- }
753
- this.changeStateWithoutSettingComponent(newState, skip);
754
- }
755
- changeStateWithoutSettingComponent(newState, skip) {
756
- this.state = newState;
757
- this.componentStart = this.tokenIndex + skip;
758
- this.tokenIndex += skip;
759
- this.tokenIncrement = 0;
760
- }
761
- rewind() {
762
- this.tokenIndex = this.componentStart;
763
- this.tokenIncrement = 0;
764
- }
765
- rewindAndSetState(newState) {
766
- this.rewind();
767
- this.state = newState;
768
- }
769
- safeToken(index) {
770
- if (index < 0) {
771
- index = this.tokenList.length - index;
772
- }
773
- if (index < this.tokenList.length) {
774
- return this.tokenList[index];
775
- }
776
- return this.tokenList[this.tokenList.length - 1];
777
- }
778
- isNonSpecialPatternChar(index, value) {
779
- const token = this.safeToken(index);
780
- return token.value === value && (token.type === "CHAR" || token.type === "ESCAPED_CHAR" || token.type === "INVALID_CHAR");
781
- }
782
- isProtocolSuffix() {
783
- return this.isNonSpecialPatternChar(this.tokenIndex, ":");
784
- }
785
- nextIsAuthoritySlashes() {
786
- return this.isNonSpecialPatternChar(this.tokenIndex + 1, "/") && this.isNonSpecialPatternChar(this.tokenIndex + 2, "/");
787
- }
788
- isIdentityTerminator() {
789
- return this.isNonSpecialPatternChar(this.tokenIndex, "@");
790
- }
791
- isPasswordPrefix() {
792
- return this.isNonSpecialPatternChar(this.tokenIndex, ":");
793
- }
794
- isPortPrefix() {
795
- return this.isNonSpecialPatternChar(this.tokenIndex, ":");
796
- }
797
- isPathnameStart() {
798
- return this.isNonSpecialPatternChar(this.tokenIndex, "/");
799
- }
800
- isSearchPrefix() {
801
- if (this.isNonSpecialPatternChar(this.tokenIndex, "?")) {
802
- return true;
803
- }
804
- if (this.tokenList[this.tokenIndex].value !== "?") {
805
- return false;
806
- }
807
- const previousToken = this.safeToken(this.tokenIndex - 1);
808
- return previousToken.type !== "NAME" && previousToken.type !== "PATTERN" && previousToken.type !== "CLOSE" && previousToken.type !== "ASTERISK";
809
- }
810
- isHashPrefix() {
811
- return this.isNonSpecialPatternChar(this.tokenIndex, "#");
812
- }
813
- isGroupOpen() {
814
- return this.tokenList[this.tokenIndex].type == "OPEN";
815
- }
816
- isGroupClose() {
817
- return this.tokenList[this.tokenIndex].type == "CLOSE";
818
- }
819
- isIPv6Open() {
820
- return this.isNonSpecialPatternChar(this.tokenIndex, "[");
821
- }
822
- isIPv6Close() {
823
- return this.isNonSpecialPatternChar(this.tokenIndex, "]");
824
- }
825
- makeComponentString() {
826
- const token = this.tokenList[this.tokenIndex];
827
- const componentCharStart = this.safeToken(this.componentStart).index;
828
- return this.input.substring(componentCharStart, token.index);
829
- }
830
- computeShouldTreatAsStandardURL() {
831
- const options = {};
832
- Object.assign(options, DEFAULT_OPTIONS);
833
- options.encodePart = protocolEncodeCallback;
834
- const regexp = pathToRegexp(this.makeComponentString(), void 0, options);
835
- this.shouldTreatAsStandardURL = isSpecialScheme(regexp);
836
- }
837
- };
838
-
839
- // src/url-pattern.ts
840
- var COMPONENTS = [
841
- "protocol",
842
- "username",
843
- "password",
844
- "hostname",
845
- "port",
846
- "pathname",
847
- "search",
848
- "hash"
849
- ];
850
- var DEFAULT_PATTERN = "*";
851
- function extractValues(url, baseURL) {
852
- if (typeof url !== "string") {
853
- throw new TypeError(`parameter 1 is not of type 'string'.`);
854
- }
855
- const o = new URL(url, baseURL);
856
- return {
857
- protocol: o.protocol.substring(0, o.protocol.length - 1),
858
- username: o.username,
859
- password: o.password,
860
- hostname: o.hostname,
861
- port: o.port,
862
- pathname: o.pathname,
863
- search: o.search != "" ? o.search.substring(1, o.search.length) : void 0,
864
- hash: o.hash != "" ? o.hash.substring(1, o.hash.length) : void 0
865
- };
866
- }
867
- function processBaseURLString(input, isPattern) {
868
- if (!isPattern) {
869
- return input;
870
- }
871
- return escapePatternString(input);
872
- }
873
- function applyInit(o, init, isPattern) {
874
- let baseURL;
875
- if (typeof init.baseURL === "string") {
876
- try {
877
- baseURL = new URL(init.baseURL);
878
- o.protocol = processBaseURLString(baseURL.protocol.substring(0, baseURL.protocol.length - 1), isPattern);
879
- o.username = processBaseURLString(baseURL.username, isPattern);
880
- o.password = processBaseURLString(baseURL.password, isPattern);
881
- o.hostname = processBaseURLString(baseURL.hostname, isPattern);
882
- o.port = processBaseURLString(baseURL.port, isPattern);
883
- o.pathname = processBaseURLString(baseURL.pathname, isPattern);
884
- o.search = processBaseURLString(baseURL.search.substring(1, baseURL.search.length), isPattern);
885
- o.hash = processBaseURLString(baseURL.hash.substring(1, baseURL.hash.length), isPattern);
886
- } catch {
887
- throw new TypeError(`invalid baseURL '${init.baseURL}'.`);
888
- }
889
- }
890
- if (typeof init.protocol === "string") {
891
- o.protocol = canonicalizeProtocol(init.protocol, isPattern);
892
- }
893
- if (typeof init.username === "string") {
894
- o.username = canonicalizeUsername(init.username, isPattern);
895
- }
896
- if (typeof init.password === "string") {
897
- o.password = canonicalizePassword(init.password, isPattern);
898
- }
899
- if (typeof init.hostname === "string") {
900
- o.hostname = canonicalizeHostname(init.hostname, isPattern);
901
- }
902
- if (typeof init.port === "string") {
903
- o.port = canonicalizePort(init.port, o.protocol, isPattern);
904
- }
905
- if (typeof init.pathname === "string") {
906
- o.pathname = init.pathname;
907
- if (baseURL && !isAbsolutePathname(o.pathname, isPattern)) {
908
- const slashIndex = baseURL.pathname.lastIndexOf("/");
909
- if (slashIndex >= 0) {
910
- o.pathname = processBaseURLString(baseURL.pathname.substring(0, slashIndex + 1), isPattern) + o.pathname;
911
- }
912
- }
913
- o.pathname = canonicalizePathname(o.pathname, o.protocol, isPattern);
914
- }
915
- if (typeof init.search === "string") {
916
- o.search = canonicalizeSearch(init.search, isPattern);
917
- }
918
- if (typeof init.hash === "string") {
919
- o.hash = canonicalizeHash(init.hash, isPattern);
920
- }
921
- return o;
922
- }
923
- function escapePatternString(value) {
924
- return value.replace(/([+*?:{}()\\])/g, "\\$1");
925
- }
926
- function escapeRegexpString(value) {
927
- return value.replace(/([.+*?^${}()[\]|/\\])/g, "\\$1");
928
- }
929
- function tokensToPattern(tokens, options) {
930
- const wildcardPattern = ".*";
931
- const segmentWildcardPattern = `[^${escapeRegexpString(options.delimiter === void 0 ? "/#?" : options.delimiter)}]+?`;
932
- const regexIdentifierPart2 = /[$_\u200C\u200D\p{ID_Continue}]/u;
933
- let result = "";
934
- for (let i = 0; i < tokens.length; ++i) {
935
- const token = tokens[i];
936
- const lastToken = i > 0 ? tokens[i - 1] : null;
937
- const nextToken = i < tokens.length - 1 ? tokens[i + 1] : null;
938
- if (typeof token === "string") {
939
- result += escapePatternString(token);
940
- continue;
941
- }
942
- if (token.pattern === "") {
943
- if (token.modifier === "") {
944
- result += escapePatternString(token.prefix);
945
- continue;
946
- }
947
- result += `{${escapePatternString(token.prefix)}}${token.modifier}`;
948
- continue;
949
- }
950
- const customName = typeof token.name !== "number";
951
- const optionsPrefixes = options.prefixes !== void 0 ? options.prefixes : "./";
952
- let needsGrouping = token.suffix !== "" || token.prefix !== "" && (token.prefix.length !== 1 || !optionsPrefixes.includes(token.prefix));
953
- if (!needsGrouping && customName && token.pattern === segmentWildcardPattern && token.modifier === "" && nextToken && !nextToken.prefix && !nextToken.suffix) {
954
- if (typeof nextToken === "string") {
955
- const code = nextToken.length > 0 ? nextToken[0] : "";
956
- needsGrouping = regexIdentifierPart2.test(code);
957
- } else {
958
- needsGrouping = typeof nextToken.name === "number";
959
- }
960
- }
961
- if (!needsGrouping && token.prefix === "" && lastToken && typeof lastToken === "string" && lastToken.length > 0) {
962
- const code = lastToken[lastToken.length - 1];
963
- needsGrouping = optionsPrefixes.includes(code);
964
- }
965
- if (needsGrouping) {
966
- result += "{";
967
- }
968
- result += escapePatternString(token.prefix);
969
- if (customName) {
970
- result += `:${token.name}`;
971
- }
972
- if (token.pattern === wildcardPattern) {
973
- if (!customName && (!lastToken || typeof lastToken === "string" || lastToken.modifier || needsGrouping || token.prefix !== "")) {
974
- result += "*";
975
- } else {
976
- result += `(${wildcardPattern})`;
977
- }
978
- } else if (token.pattern === segmentWildcardPattern) {
979
- if (!customName) {
980
- result += `(${segmentWildcardPattern})`;
981
- }
982
- } else {
983
- result += `(${token.pattern})`;
984
- }
985
- if (token.pattern === segmentWildcardPattern && customName && token.suffix !== "") {
986
- if (regexIdentifierPart2.test(token.suffix[0])) {
987
- result += "\\";
988
- }
989
- }
990
- result += escapePatternString(token.suffix);
991
- if (needsGrouping) {
992
- result += "}";
993
- }
994
- result += token.modifier;
995
- }
996
- return result;
997
- }
998
- var URLPattern = class {
999
- constructor(init = {}, baseURLOrOptions, options) {
1000
- this.regexp = {};
1001
- this.keys = {};
1002
- this.component_pattern = {};
1003
- try {
1004
- let baseURL = void 0;
1005
- if (typeof baseURLOrOptions === "string") {
1006
- baseURL = baseURLOrOptions;
1007
- } else {
1008
- options = baseURLOrOptions;
1009
- }
1010
- if (typeof init === "string") {
1011
- const parser = new Parser(init);
1012
- parser.parse();
1013
- init = parser.result;
1014
- if (baseURL === void 0 && typeof init.protocol !== "string") {
1015
- throw new TypeError(`A base URL must be provided for a relative constructor string.`);
1016
- }
1017
- init.baseURL = baseURL;
1018
- } else {
1019
- if (!init || typeof init !== "object") {
1020
- throw new TypeError(`parameter 1 is not of type 'string' and cannot convert to dictionary.`);
1021
- }
1022
- if (baseURL) {
1023
- throw new TypeError(`parameter 1 is not of type 'string'.`);
1024
- }
1025
- }
1026
- if (typeof options === "undefined") {
1027
- options = { ignoreCase: false };
1028
- }
1029
- const ignoreCaseOptions = { ignoreCase: options.ignoreCase === true };
1030
- const defaults = {
1031
- pathname: DEFAULT_PATTERN,
1032
- protocol: DEFAULT_PATTERN,
1033
- username: DEFAULT_PATTERN,
1034
- password: DEFAULT_PATTERN,
1035
- hostname: DEFAULT_PATTERN,
1036
- port: DEFAULT_PATTERN,
1037
- search: DEFAULT_PATTERN,
1038
- hash: DEFAULT_PATTERN
1039
- };
1040
- this.pattern = applyInit(defaults, init, true);
1041
- if (defaultPortForProtocol(this.pattern.protocol) === this.pattern.port) {
1042
- this.pattern.port = "";
1043
- }
1044
- let component;
1045
- for (component of COMPONENTS) {
1046
- if (!(component in this.pattern))
1047
- continue;
1048
- const options2 = {};
1049
- const pattern = this.pattern[component];
1050
- this.keys[component] = [];
1051
- switch (component) {
1052
- case "protocol":
1053
- Object.assign(options2, DEFAULT_OPTIONS);
1054
- options2.encodePart = protocolEncodeCallback;
1055
- break;
1056
- case "username":
1057
- Object.assign(options2, DEFAULT_OPTIONS);
1058
- options2.encodePart = usernameEncodeCallback;
1059
- break;
1060
- case "password":
1061
- Object.assign(options2, DEFAULT_OPTIONS);
1062
- options2.encodePart = passwordEncodeCallback;
1063
- break;
1064
- case "hostname":
1065
- Object.assign(options2, HOSTNAME_OPTIONS);
1066
- if (treatAsIPv6Hostname(pattern)) {
1067
- options2.encodePart = ipv6HostnameEncodeCallback;
1068
- } else {
1069
- options2.encodePart = hostnameEncodeCallback;
1070
- }
1071
- break;
1072
- case "port":
1073
- Object.assign(options2, DEFAULT_OPTIONS);
1074
- options2.encodePart = portEncodeCallback;
1075
- break;
1076
- case "pathname":
1077
- if (isSpecialScheme(this.regexp.protocol)) {
1078
- Object.assign(options2, PATHNAME_OPTIONS, ignoreCaseOptions);
1079
- options2.encodePart = standardURLPathnameEncodeCallback;
1080
- } else {
1081
- Object.assign(options2, DEFAULT_OPTIONS, ignoreCaseOptions);
1082
- options2.encodePart = pathURLPathnameEncodeCallback;
1083
- }
1084
- break;
1085
- case "search":
1086
- Object.assign(options2, DEFAULT_OPTIONS, ignoreCaseOptions);
1087
- options2.encodePart = searchEncodeCallback;
1088
- break;
1089
- case "hash":
1090
- Object.assign(options2, DEFAULT_OPTIONS, ignoreCaseOptions);
1091
- options2.encodePart = hashEncodeCallback;
1092
- break;
1093
- }
1094
- try {
1095
- const tokens = parse(pattern, options2);
1096
- this.regexp[component] = tokensToRegexp(tokens, this.keys[component], options2);
1097
- this.component_pattern[component] = tokensToPattern(tokens, options2);
1098
- } catch {
1099
- throw new TypeError(`invalid ${component} pattern '${this.pattern[component]}'.`);
1100
- }
1101
- }
1102
- } catch (err) {
1103
- throw new TypeError(`Failed to construct 'URLPattern': ${err.message}`);
1104
- }
1105
- }
1106
- test(input = {}, baseURL) {
1107
- let values = {
1108
- pathname: "",
1109
- protocol: "",
1110
- username: "",
1111
- password: "",
1112
- hostname: "",
1113
- port: "",
1114
- search: "",
1115
- hash: ""
1116
- };
1117
- if (typeof input !== "string" && baseURL) {
1118
- throw new TypeError(`parameter 1 is not of type 'string'.`);
1119
- }
1120
- if (typeof input === "undefined") {
1121
- return false;
1122
- }
1123
- try {
1124
- if (typeof input === "object") {
1125
- values = applyInit(values, input, false);
1126
- } else {
1127
- values = applyInit(values, extractValues(input, baseURL), false);
1128
- }
1129
- } catch (err) {
1130
- return false;
1131
- }
1132
- let component;
1133
- for (component of COMPONENTS) {
1134
- if (!this.regexp[component].exec(values[component])) {
1135
- return false;
1136
- }
1137
- }
1138
- return true;
1139
- }
1140
- exec(input = {}, baseURL) {
1141
- let values = {
1142
- pathname: "",
1143
- protocol: "",
1144
- username: "",
1145
- password: "",
1146
- hostname: "",
1147
- port: "",
1148
- search: "",
1149
- hash: ""
1150
- };
1151
- if (typeof input !== "string" && baseURL) {
1152
- throw new TypeError(`parameter 1 is not of type 'string'.`);
1153
- }
1154
- if (typeof input === "undefined") {
1155
- return;
1156
- }
1157
- try {
1158
- if (typeof input === "object") {
1159
- values = applyInit(values, input, false);
1160
- } else {
1161
- values = applyInit(values, extractValues(input, baseURL), false);
1162
- }
1163
- } catch (err) {
1164
- return null;
1165
- }
1166
- let result = {};
1167
- if (baseURL) {
1168
- result.inputs = [input, baseURL];
1169
- } else {
1170
- result.inputs = [input];
1171
- }
1172
- let component;
1173
- for (component of COMPONENTS) {
1174
- let match = this.regexp[component].exec(values[component]);
1175
- if (!match) {
1176
- return null;
1177
- }
1178
- let groups = {};
1179
- for (let [i, key] of this.keys[component].entries()) {
1180
- if (typeof key.name === "string" || typeof key.name === "number") {
1181
- let value = match[i + 1];
1182
- groups[key.name] = value;
1183
- }
1184
- }
1185
- result[component] = {
1186
- input: values[component] || "",
1187
- groups
1188
- };
1189
- }
1190
- return result;
1191
- }
1192
- get protocol() {
1193
- return this.component_pattern.protocol;
1194
- }
1195
- get username() {
1196
- return this.component_pattern.username;
1197
- }
1198
- get password() {
1199
- return this.component_pattern.password;
1200
- }
1201
- get hostname() {
1202
- return this.component_pattern.hostname;
1203
- }
1204
- get port() {
1205
- return this.component_pattern.port;
1206
- }
1207
- get pathname() {
1208
- return this.component_pattern.pathname;
1209
- }
1210
- get search() {
1211
- return this.component_pattern.search;
1212
- }
1213
- get hash() {
1214
- return this.component_pattern.hash;
1215
- }
1216
- };
1217
-
1218
- if (!globalThis.URLPattern) {
1219
- globalThis.URLPattern = URLPattern;
1220
- }
1221
-
1222
- exports.URLPattern = URLPattern;
1223
-
1224
- //# sourceMappingURL=index-d16d46f4.js.map