@flickfyi/flkr 0.0.141 → 0.0.146

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 (494) hide show
  1. package/node_modules/@flickfyi/attestation/.turbo/turbo-build.log +7 -7
  2. package/node_modules/@flickfyi/biscuit/.turbo/turbo-build.log +7 -7
  3. package/node_modules/@flickfyi/core/.oxlintrc.json +2 -1
  4. package/node_modules/@flickfyi/core/.turbo/turbo-build.log +502 -95
  5. package/node_modules/@flickfyi/core/README.md +58 -4
  6. package/node_modules/@flickfyi/core/dist/index.cjs +1 -1
  7. package/node_modules/@flickfyi/core/dist/index.js +35 -24
  8. package/node_modules/@flickfyi/core/dist/kowalski/calculations.d.ts +17 -0
  9. package/node_modules/@flickfyi/core/dist/kowalski/calculator.d.ts +13 -0
  10. package/node_modules/@flickfyi/core/dist/kowalski/catalog.cjs +1 -0
  11. package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.cts +962 -0
  12. package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.ts +962 -0
  13. package/node_modules/@flickfyi/core/dist/kowalski/catalog.js +639 -0
  14. package/node_modules/@flickfyi/core/dist/kowalski/clocks.d.ts +4 -0
  15. package/node_modules/@flickfyi/core/dist/kowalski/date-time.d.ts +22 -0
  16. package/node_modules/@flickfyi/core/dist/kowalski/details.d.ts +7 -0
  17. package/node_modules/@flickfyi/core/dist/kowalski/everyday.d.ts +8 -0
  18. package/node_modules/@flickfyi/core/dist/kowalski/format.d.ts +4 -0
  19. package/node_modules/@flickfyi/core/dist/kowalski/frame.d.ts +161 -0
  20. package/node_modules/@flickfyi/core/dist/kowalski/index.cjs +21 -0
  21. package/node_modules/@flickfyi/core/dist/kowalski/index.d.cts +8 -0
  22. package/node_modules/@flickfyi/core/dist/kowalski/index.d.ts +8 -0
  23. package/node_modules/@flickfyi/core/dist/kowalski/index.js +7496 -0
  24. package/node_modules/@flickfyi/core/dist/kowalski/productivity.d.ts +5 -0
  25. package/node_modules/@flickfyi/core/dist/kowalski/recipe.d.ts +8 -0
  26. package/node_modules/@flickfyi/core/dist/kowalski/tools.d.ts +7 -0
  27. package/node_modules/@flickfyi/core/dist/kowalski/use-clock.d.ts +6 -0
  28. package/node_modules/@flickfyi/core/dist/kowalski/use-configured-feature.d.ts +19 -0
  29. package/node_modules/@flickfyi/core/dist/kowalski/use-feature-store.d.ts +15 -0
  30. package/node_modules/@flickfyi/core/dist/kowalski.css +506 -0
  31. package/node_modules/@flickfyi/core/dist/molecules/field/field.d.ts +8 -0
  32. package/node_modules/@flickfyi/core/dist/molecules/index.cjs +1 -1
  33. package/node_modules/@flickfyi/core/dist/molecules/index.d.cts +3 -0
  34. package/node_modules/@flickfyi/core/dist/molecules/index.d.ts +3 -0
  35. package/node_modules/@flickfyi/core/dist/molecules/index.js +88 -27
  36. package/node_modules/@flickfyi/core/dist/molecules/segmented/segmented.d.ts +10 -0
  37. package/node_modules/@flickfyi/core/dist/molecules/stepper/stepper.d.ts +10 -0
  38. package/node_modules/@flickfyi/core/dist/quantum/use-store.d.ts +7 -1
  39. package/node_modules/@flickfyi/core/dist/themes.css +2 -0
  40. package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.stories.tsx +15 -0
  41. package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.tsx +17 -0
  42. package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.stories.tsx +15 -0
  43. package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.tsx +23 -0
  44. package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.stories.tsx +15 -0
  45. package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.tsx +26 -0
  46. package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.stories.tsx +15 -0
  47. package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.tsx +24 -0
  48. package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.stories.tsx +15 -0
  49. package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.tsx +26 -0
  50. package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.stories.tsx +15 -0
  51. package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.tsx +22 -0
  52. package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.stories.tsx +15 -0
  53. package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.tsx +23 -0
  54. package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.stories.tsx +15 -0
  55. package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.tsx +23 -0
  56. package/node_modules/@flickfyi/core/examples/kowalski/event/event.stories.tsx +15 -0
  57. package/node_modules/@flickfyi/core/examples/kowalski/event/event.tsx +24 -0
  58. package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.stories.tsx +15 -0
  59. package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.tsx +23 -0
  60. package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.stories.tsx +15 -0
  61. package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.tsx +24 -0
  62. package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.stories.tsx +15 -0
  63. package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.tsx +23 -0
  64. package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.stories.tsx +15 -0
  65. package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.tsx +25 -0
  66. package/node_modules/@flickfyi/core/examples/kowalski/note/note.stories.tsx +15 -0
  67. package/node_modules/@flickfyi/core/examples/kowalski/note/note.tsx +22 -0
  68. package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.stories.tsx +15 -0
  69. package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.tsx +26 -0
  70. package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.stories.tsx +15 -0
  71. package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.tsx +23 -0
  72. package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.stories.tsx +15 -0
  73. package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.tsx +19 -0
  74. package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.stories.tsx +15 -0
  75. package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.tsx +120 -0
  76. package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.stories.tsx +15 -0
  77. package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.tsx +23 -0
  78. package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.stories.tsx +15 -0
  79. package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.tsx +27 -0
  80. package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.stories.tsx +15 -0
  81. package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.tsx +26 -0
  82. package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.stories.tsx +15 -0
  83. package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.tsx +27 -0
  84. package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.stories.tsx +15 -0
  85. package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.tsx +27 -0
  86. package/node_modules/@flickfyi/core/examples/kowalski/theme.ts +3 -0
  87. package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.stories.tsx +15 -0
  88. package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.tsx +22 -0
  89. package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.stories.tsx +15 -0
  90. package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.tsx +23 -0
  91. package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.stories.tsx +15 -0
  92. package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.tsx +26 -0
  93. package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.stories.tsx +15 -0
  94. package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.tsx +24 -0
  95. package/node_modules/@flickfyi/core/examples/parrott/calculator/calculator.stories.tsx +3 -1
  96. package/node_modules/@flickfyi/core/examples/parrott/checklist/checklist.stories.tsx +3 -1
  97. package/node_modules/@flickfyi/core/examples/parrott/countdown/countdown.stories.tsx +3 -1
  98. package/node_modules/@flickfyi/core/examples/parrott/counter/counter.stories.tsx +1 -0
  99. package/node_modules/@flickfyi/core/examples/parrott/fortune/fortune.stories.tsx +3 -1
  100. package/node_modules/@flickfyi/core/examples/parrott/grid/grid.stories.tsx +3 -1
  101. package/node_modules/@flickfyi/core/examples/parrott/kale-smoothie/kale-smoothie.stories.tsx +1 -0
  102. package/node_modules/@flickfyi/core/examples/parrott/list/list.stories.tsx +3 -1
  103. package/node_modules/@flickfyi/core/examples/parrott/log/log.stories.tsx +3 -1
  104. package/node_modules/@flickfyi/core/examples/parrott/timed-task/timed-task.stories.tsx +3 -1
  105. package/node_modules/@flickfyi/core/examples/parrott/timer/timer.stories.tsx +3 -1
  106. package/node_modules/@flickfyi/core/fixtures/native/host/project.yml +3 -0
  107. package/node_modules/@flickfyi/core/fixtures/native/src/catalog-features.tsx +88 -0
  108. package/node_modules/@flickfyi/core/package.json +35 -5
  109. package/node_modules/@flickfyi/core/package.tsgo.json +19 -1
  110. package/node_modules/@flickfyi/core/scripts/vite-globals.d.ts +2 -0
  111. package/node_modules/@flickfyi/core/src/generated-types.d.ts +1 -0
  112. package/node_modules/@flickfyi/core/src/kowalski/README.md +9 -0
  113. package/node_modules/@flickfyi/core/src/kowalski/calculations.ts +106 -0
  114. package/node_modules/@flickfyi/core/src/kowalski/calculator.ts +243 -0
  115. package/node_modules/@flickfyi/core/src/kowalski/catalog.ts +787 -0
  116. package/node_modules/@flickfyi/core/src/kowalski/clocks.tsx +464 -0
  117. package/node_modules/@flickfyi/core/src/kowalski/date-time.tsx +469 -0
  118. package/node_modules/@flickfyi/core/src/kowalski/details.tsx +1387 -0
  119. package/node_modules/@flickfyi/core/src/kowalski/everyday.tsx +652 -0
  120. package/node_modules/@flickfyi/core/src/kowalski/format.ts +48 -0
  121. package/node_modules/@flickfyi/core/src/kowalski/frame.tsx +351 -0
  122. package/node_modules/@flickfyi/core/src/kowalski/index.ts +23 -0
  123. package/node_modules/@flickfyi/core/src/kowalski/productivity.tsx +575 -0
  124. package/node_modules/@flickfyi/core/src/kowalski/recipe.tsx +555 -0
  125. package/node_modules/@flickfyi/core/src/kowalski/stories/composition.stories.tsx +47 -0
  126. package/node_modules/@flickfyi/core/src/kowalski/stories/composition.tsx +100 -0
  127. package/node_modules/@flickfyi/core/src/kowalski/tools.tsx +1213 -0
  128. package/node_modules/@flickfyi/core/src/kowalski/use-clock.ts +19 -0
  129. package/node_modules/@flickfyi/core/src/kowalski/use-configured-feature.ts +85 -0
  130. package/node_modules/@flickfyi/core/src/kowalski/use-feature-store.ts +119 -0
  131. package/node_modules/@flickfyi/core/src/molecules/field/field.tsx +34 -0
  132. package/node_modules/@flickfyi/core/src/molecules/index.ts +3 -0
  133. package/node_modules/@flickfyi/core/src/molecules/segmented/segmented.tsx +48 -0
  134. package/node_modules/@flickfyi/core/src/molecules/stepper/stepper.tsx +54 -0
  135. package/node_modules/@flickfyi/core/src/quantum/use-store.ts +41 -16
  136. package/node_modules/@flickfyi/core/tests/fly.test.ts +34 -7
  137. package/node_modules/@flickfyi/core/tests/kowalski-calculations.test.ts +60 -0
  138. package/node_modules/@flickfyi/core/tests/kowalski-calculator.test.ts +142 -0
  139. package/node_modules/@flickfyi/core/tests/kowalski-contracts.test.ts +223 -0
  140. package/node_modules/@flickfyi/core/tests/kowalski-date-time.test.tsx +462 -0
  141. package/node_modules/@flickfyi/core/tests/kowalski-features.test.tsx +2158 -0
  142. package/node_modules/@flickfyi/core/tests/kowalski-store.test.tsx +514 -0
  143. package/node_modules/@flickfyi/core/tests/preview-build.test.ts +1 -1
  144. package/node_modules/@flickfyi/core/tests/quantum-use-store.test.ts +53 -1
  145. package/node_modules/@flickfyi/core/tests/verify-tsgo-assets.test.ts +1 -1
  146. package/node_modules/@flickfyi/core/tsconfig.vite-dts.json +2 -1
  147. package/node_modules/@flickfyi/core/tsgo.bun.lock +111 -9
  148. package/node_modules/@flickfyi/core/tsgo.package.json +21 -3
  149. package/node_modules/@flickfyi/core/vite.config.ts +9 -5
  150. package/node_modules/@flickfyi/core/vitest.config.ts +1 -1
  151. package/node_modules/@flickfyi/http-message-sig/.turbo/turbo-build.log +7 -7
  152. package/node_modules/@flickfyi/identity/.turbo/turbo-build.log +8 -9
  153. package/node_modules/@flickfyi/lens/.turbo/turbo-build.log +7 -7
  154. package/node_modules/@flickfyi/photon/.turbo/turbo-build.log +10 -4
  155. package/node_modules/@flickfyi/photon/Sources/Photon/Components/Button.swift +29 -2
  156. package/node_modules/@flickfyi/photon/Sources/PhotonVersion/Resources/photon-version.json +1 -1
  157. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Components/ButtonHostTests.swift +26 -0
  158. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-features.styles.json +1 -0
  159. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-native.styles.json +1 -1
  160. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-scale.styles.json +1 -1
  161. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-theme.styles.json +1 -1
  162. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-typography.styles.json +1 -1
  163. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/stylex-calculator.styles.json +1 -1
  164. package/node_modules/@flickfyi/photon/dist/globals.d.ts +5 -0
  165. package/node_modules/@flickfyi/photon/dist/version.cjs +1 -1
  166. package/node_modules/@flickfyi/photon/dist/version.js +1 -1
  167. package/node_modules/@flickfyi/photon/generated/react-swiftui.d.ts +1 -0
  168. package/node_modules/@flickfyi/photon/package.json +1 -1
  169. package/node_modules/@flickfyi/photon/src/globals.d.ts +5 -0
  170. package/node_modules/@flickfyi/rwsdk-extensions/.turbo/turbo-build.log +7 -7
  171. package/node_modules/@formatjs/fast-memoize/LICENSE.md +9 -0
  172. package/node_modules/@formatjs/fast-memoize/README.md +3 -0
  173. package/node_modules/@formatjs/fast-memoize/index.d.ts +35 -0
  174. package/node_modules/@formatjs/fast-memoize/index.js +69 -0
  175. package/node_modules/@formatjs/fast-memoize/index.js.map +1 -0
  176. package/node_modules/@formatjs/fast-memoize/package.json +25 -0
  177. package/node_modules/@formatjs/icu-messageformat-parser/LICENSE.md +9 -0
  178. package/node_modules/@formatjs/icu-messageformat-parser/README.md +38 -0
  179. package/node_modules/@formatjs/icu-messageformat-parser/index.d.ts +393 -0
  180. package/node_modules/@formatjs/icu-messageformat-parser/index.js +2187 -0
  181. package/node_modules/@formatjs/icu-messageformat-parser/index.js.map +1 -0
  182. package/node_modules/@formatjs/icu-messageformat-parser/manipulator.d.ts +175 -0
  183. package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js +209 -0
  184. package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js.map +1 -0
  185. package/node_modules/@formatjs/icu-messageformat-parser/no-parser.d.ts +183 -0
  186. package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js +162 -0
  187. package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js.map +1 -0
  188. package/node_modules/@formatjs/icu-messageformat-parser/package.json +21 -0
  189. package/node_modules/@formatjs/icu-messageformat-parser/printer.d.ts +154 -0
  190. package/node_modules/@formatjs/icu-messageformat-parser/printer.js +224 -0
  191. package/node_modules/@formatjs/icu-messageformat-parser/printer.js.map +1 -0
  192. package/node_modules/@formatjs/icu-skeleton-parser/LICENSE.md +9 -0
  193. package/node_modules/@formatjs/icu-skeleton-parser/README.md +1 -0
  194. package/node_modules/@formatjs/icu-skeleton-parser/index.d.ts +67 -0
  195. package/node_modules/@formatjs/icu-skeleton-parser/index.js +380 -0
  196. package/node_modules/@formatjs/icu-skeleton-parser/index.js.map +1 -0
  197. package/node_modules/@formatjs/icu-skeleton-parser/package.json +15 -0
  198. package/node_modules/@formatjs/intl/LICENSE.md +9 -0
  199. package/node_modules/@formatjs/intl/README.md +3 -0
  200. package/node_modules/@formatjs/intl/index.d.ts +499 -0
  201. package/node_modules/@formatjs/intl/index.js +595 -0
  202. package/node_modules/@formatjs/intl/index.js.map +1 -0
  203. package/node_modules/@formatjs/intl/package.json +37 -0
  204. package/node_modules/decimal.js/LICENCE.md +23 -0
  205. package/node_modules/decimal.js/README.md +246 -0
  206. package/node_modules/decimal.js/decimal.d.ts +301 -0
  207. package/node_modules/decimal.js/decimal.js +4951 -0
  208. package/node_modules/decimal.js/decimal.mjs +4914 -0
  209. package/node_modules/decimal.js/package.json +55 -0
  210. package/node_modules/format-quantity/LICENSE +21 -0
  211. package/node_modules/format-quantity/README.md +181 -0
  212. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.d.ts +131 -0
  213. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js +214 -0
  214. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js.map +1 -0
  215. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.d.ts +131 -0
  216. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js +2 -0
  217. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js.map +1 -0
  218. package/node_modules/format-quantity/dist/cjs/index.d.ts +1 -0
  219. package/node_modules/format-quantity/dist/cjs/index.js +6 -0
  220. package/node_modules/format-quantity/dist/format-quantity.d.mts +131 -0
  221. package/node_modules/format-quantity/dist/format-quantity.legacy-esm.d.ts +131 -0
  222. package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js +268 -0
  223. package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js.map +1 -0
  224. package/node_modules/format-quantity/dist/format-quantity.mjs +208 -0
  225. package/node_modules/format-quantity/dist/format-quantity.mjs.map +1 -0
  226. package/node_modules/format-quantity/dist/format-quantity.production.d.mts +131 -0
  227. package/node_modules/format-quantity/dist/format-quantity.production.mjs +2 -0
  228. package/node_modules/format-quantity/dist/format-quantity.production.mjs.map +1 -0
  229. package/node_modules/format-quantity/dist/format-quantity.umd.min.js +3 -0
  230. package/node_modules/format-quantity/dist/format-quantity.umd.min.js.map +1 -0
  231. package/node_modules/format-quantity/package.json +81 -0
  232. package/node_modules/intl-messageformat/LICENSE.md +33 -0
  233. package/node_modules/intl-messageformat/README.md +3 -0
  234. package/node_modules/intl-messageformat/index.d.ts +177 -0
  235. package/node_modules/intl-messageformat/index.js +327 -0
  236. package/node_modules/intl-messageformat/index.js.map +1 -0
  237. package/node_modules/intl-messageformat/intl-messageformat.iife.js +2819 -0
  238. package/node_modules/intl-messageformat/package.json +40 -0
  239. package/node_modules/numeric-quantity/LICENSE +21 -0
  240. package/node_modules/numeric-quantity/README.md +306 -0
  241. package/node_modules/numeric-quantity/dist/cjs/index.d.ts +1 -0
  242. package/node_modules/numeric-quantity/dist/cjs/index.js +6 -0
  243. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.d.ts +293 -0
  244. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js +579 -0
  245. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js.map +1 -0
  246. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.d.ts +293 -0
  247. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js +2 -0
  248. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js.map +1 -0
  249. package/node_modules/numeric-quantity/dist/numeric-quantity.d.mts +293 -0
  250. package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js +2 -0
  251. package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js.map +1 -0
  252. package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.d.ts +293 -0
  253. package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js +622 -0
  254. package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js.map +1 -0
  255. package/node_modules/numeric-quantity/dist/numeric-quantity.mjs +564 -0
  256. package/node_modules/numeric-quantity/dist/numeric-quantity.mjs.map +1 -0
  257. package/node_modules/numeric-quantity/dist/numeric-quantity.production.d.mts +293 -0
  258. package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs +2 -0
  259. package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs.map +1 -0
  260. package/node_modules/numeric-quantity/package.json +72 -0
  261. package/node_modules/validator/LICENSE +20 -0
  262. package/node_modules/validator/README.md +269 -0
  263. package/node_modules/validator/es/index.js +218 -0
  264. package/node_modules/validator/es/lib/alpha.js +151 -0
  265. package/node_modules/validator/es/lib/blacklist.js +5 -0
  266. package/node_modules/validator/es/lib/contains.js +15 -0
  267. package/node_modules/validator/es/lib/equals.js +5 -0
  268. package/node_modules/validator/es/lib/escape.js +5 -0
  269. package/node_modules/validator/es/lib/isAbaRouting.js +15 -0
  270. package/node_modules/validator/es/lib/isAfter.js +10 -0
  271. package/node_modules/validator/es/lib/isAlpha.js +23 -0
  272. package/node_modules/validator/es/lib/isAlphanumeric.js +23 -0
  273. package/node_modules/validator/es/lib/isAscii.js +10 -0
  274. package/node_modules/validator/es/lib/isBIC.js +16 -0
  275. package/node_modules/validator/es/lib/isBase32.js +15 -0
  276. package/node_modules/validator/es/lib/isBase58.js +8 -0
  277. package/node_modules/validator/es/lib/isBase64.js +23 -0
  278. package/node_modules/validator/es/lib/isBefore.js +10 -0
  279. package/node_modules/validator/es/lib/isBoolean.js +15 -0
  280. package/node_modules/validator/es/lib/isBtcAddress.js +7 -0
  281. package/node_modules/validator/es/lib/isByteLength.js +19 -0
  282. package/node_modules/validator/es/lib/isCreditCard.js +43 -0
  283. package/node_modules/validator/es/lib/isCurrency.js +74 -0
  284. package/node_modules/validator/es/lib/isDataURI.js +31 -0
  285. package/node_modules/validator/es/lib/isDate.js +93 -0
  286. package/node_modules/validator/es/lib/isDecimal.js +22 -0
  287. package/node_modules/validator/es/lib/isDivisibleBy.js +6 -0
  288. package/node_modules/validator/es/lib/isEAN.js +70 -0
  289. package/node_modules/validator/es/lib/isEmail.js +165 -0
  290. package/node_modules/validator/es/lib/isEmpty.js +10 -0
  291. package/node_modules/validator/es/lib/isEthereumAddress.js +6 -0
  292. package/node_modules/validator/es/lib/isFQDN.js +67 -0
  293. package/node_modules/validator/es/lib/isFloat.js +14 -0
  294. package/node_modules/validator/es/lib/isFullWidth.js +6 -0
  295. package/node_modules/validator/es/lib/isHSL.js +13 -0
  296. package/node_modules/validator/es/lib/isHalfWidth.js +6 -0
  297. package/node_modules/validator/es/lib/isHash.js +21 -0
  298. package/node_modules/validator/es/lib/isHexColor.js +13 -0
  299. package/node_modules/validator/es/lib/isHexadecimal.js +6 -0
  300. package/node_modules/validator/es/lib/isIBAN.js +171 -0
  301. package/node_modules/validator/es/lib/isIMEI.js +40 -0
  302. package/node_modules/validator/es/lib/isIP.js +58 -0
  303. package/node_modules/validator/es/lib/isIPRange.js +41 -0
  304. package/node_modules/validator/es/lib/isISBN.js +47 -0
  305. package/node_modules/validator/es/lib/isISIN.js +55 -0
  306. package/node_modules/validator/es/lib/isISO15924.js +9 -0
  307. package/node_modules/validator/es/lib/isISO31661Alpha2.js +21 -0
  308. package/node_modules/validator/es/lib/isISO31661Alpha3.js +20 -0
  309. package/node_modules/validator/es/lib/isISO31661Numeric.js +8 -0
  310. package/node_modules/validator/es/lib/isISO4217.js +9 -0
  311. package/node_modules/validator/es/lib/isISO6346.js +28 -0
  312. package/node_modules/validator/es/lib/isISO6391.js +6 -0
  313. package/node_modules/validator/es/lib/isISO8601.js +42 -0
  314. package/node_modules/validator/es/lib/isISRC.js +8 -0
  315. package/node_modules/validator/es/lib/isISSN.js +19 -0
  316. package/node_modules/validator/es/lib/isIdentityCard.js +407 -0
  317. package/node_modules/validator/es/lib/isIn.js +23 -0
  318. package/node_modules/validator/es/lib/isInt.js +19 -0
  319. package/node_modules/validator/es/lib/isJSON.js +26 -0
  320. package/node_modules/validator/es/lib/isJWT.js +15 -0
  321. package/node_modules/validator/es/lib/isLatLong.js +21 -0
  322. package/node_modules/validator/es/lib/isLength.js +27 -0
  323. package/node_modules/validator/es/lib/isLicensePlate.js +58 -0
  324. package/node_modules/validator/es/lib/isLocale.js +107 -0
  325. package/node_modules/validator/es/lib/isLowercase.js +5 -0
  326. package/node_modules/validator/es/lib/isLuhnNumber.js +25 -0
  327. package/node_modules/validator/es/lib/isMACAddress.js +36 -0
  328. package/node_modules/validator/es/lib/isMD5.js +6 -0
  329. package/node_modules/validator/es/lib/isMagnetURI.js +9 -0
  330. package/node_modules/validator/es/lib/isMailtoURI.js +75 -0
  331. package/node_modules/validator/es/lib/isMimeType.js +40 -0
  332. package/node_modules/validator/es/lib/isMobilePhone.js +212 -0
  333. package/node_modules/validator/es/lib/isMongoId.js +6 -0
  334. package/node_modules/validator/es/lib/isMultibyte.js +10 -0
  335. package/node_modules/validator/es/lib/isNumeric.js +10 -0
  336. package/node_modules/validator/es/lib/isOctal.js +6 -0
  337. package/node_modules/validator/es/lib/isPassportNumber.js +145 -0
  338. package/node_modules/validator/es/lib/isPort.js +8 -0
  339. package/node_modules/validator/es/lib/isPostalCode.js +100 -0
  340. package/node_modules/validator/es/lib/isRFC3339.js +21 -0
  341. package/node_modules/validator/es/lib/isRgbColor.js +34 -0
  342. package/node_modules/validator/es/lib/isSemVer.js +14 -0
  343. package/node_modules/validator/es/lib/isSlug.js +6 -0
  344. package/node_modules/validator/es/lib/isStrongPassword.js +90 -0
  345. package/node_modules/validator/es/lib/isSurrogatePair.js +6 -0
  346. package/node_modules/validator/es/lib/isTaxID.js +1407 -0
  347. package/node_modules/validator/es/lib/isTime.js +22 -0
  348. package/node_modules/validator/es/lib/isULID.js +5 -0
  349. package/node_modules/validator/es/lib/isURL.js +241 -0
  350. package/node_modules/validator/es/lib/isUUID.js +23 -0
  351. package/node_modules/validator/es/lib/isUppercase.js +5 -0
  352. package/node_modules/validator/es/lib/isVAT.js +264 -0
  353. package/node_modules/validator/es/lib/isVariableWidth.js +7 -0
  354. package/node_modules/validator/es/lib/isWhitelisted.js +10 -0
  355. package/node_modules/validator/es/lib/ltrim.js +7 -0
  356. package/node_modules/validator/es/lib/matches.js +8 -0
  357. package/node_modules/validator/es/lib/normalizeEmail.js +131 -0
  358. package/node_modules/validator/es/lib/rtrim.js +15 -0
  359. package/node_modules/validator/es/lib/stripLow.js +7 -0
  360. package/node_modules/validator/es/lib/toBoolean.js +8 -0
  361. package/node_modules/validator/es/lib/toDate.js +6 -0
  362. package/node_modules/validator/es/lib/toFloat.js +5 -0
  363. package/node_modules/validator/es/lib/toInt.js +5 -0
  364. package/node_modules/validator/es/lib/trim.js +5 -0
  365. package/node_modules/validator/es/lib/unescape.js +8 -0
  366. package/node_modules/validator/es/lib/util/algorithms.js +79 -0
  367. package/node_modules/validator/es/lib/util/assertString.js +4 -0
  368. package/node_modules/validator/es/lib/util/checkHost.js +12 -0
  369. package/node_modules/validator/es/lib/util/includesArray.js +6 -0
  370. package/node_modules/validator/es/lib/util/includesString.js +4 -0
  371. package/node_modules/validator/es/lib/util/merge.js +14 -0
  372. package/node_modules/validator/es/lib/util/multilineRegex.js +12 -0
  373. package/node_modules/validator/es/lib/util/nullUndefinedCheck.js +3 -0
  374. package/node_modules/validator/es/lib/util/toString.js +13 -0
  375. package/node_modules/validator/es/lib/util/typeOf.js +10 -0
  376. package/node_modules/validator/es/lib/whitelist.js +5 -0
  377. package/node_modules/validator/index.js +229 -0
  378. package/node_modules/validator/lib/alpha.js +157 -0
  379. package/node_modules/validator/lib/blacklist.js +14 -0
  380. package/node_modules/validator/lib/contains.js +24 -0
  381. package/node_modules/validator/lib/equals.js +14 -0
  382. package/node_modules/validator/lib/escape.js +14 -0
  383. package/node_modules/validator/lib/isAbaRouting.js +23 -0
  384. package/node_modules/validator/lib/isAfter.js +19 -0
  385. package/node_modules/validator/lib/isAlpha.js +31 -0
  386. package/node_modules/validator/lib/isAlphanumeric.js +31 -0
  387. package/node_modules/validator/lib/isAscii.js +18 -0
  388. package/node_modules/validator/lib/isBIC.js +24 -0
  389. package/node_modules/validator/lib/isBase32.js +24 -0
  390. package/node_modules/validator/lib/isBase58.js +16 -0
  391. package/node_modules/validator/lib/isBase64.js +32 -0
  392. package/node_modules/validator/lib/isBefore.js +19 -0
  393. package/node_modules/validator/lib/isBoolean.js +24 -0
  394. package/node_modules/validator/lib/isBtcAddress.js +16 -0
  395. package/node_modules/validator/lib/isByteLength.js +27 -0
  396. package/node_modules/validator/lib/isCreditCard.js +52 -0
  397. package/node_modules/validator/lib/isCurrency.js +83 -0
  398. package/node_modules/validator/lib/isDataURI.js +40 -0
  399. package/node_modules/validator/lib/isDate.js +102 -0
  400. package/node_modules/validator/lib/isDecimal.js +31 -0
  401. package/node_modules/validator/lib/isDivisibleBy.js +15 -0
  402. package/node_modules/validator/lib/isEAN.js +78 -0
  403. package/node_modules/validator/lib/isEmail.js +174 -0
  404. package/node_modules/validator/lib/isEmpty.js +19 -0
  405. package/node_modules/validator/lib/isEthereumAddress.js +15 -0
  406. package/node_modules/validator/lib/isFQDN.js +76 -0
  407. package/node_modules/validator/lib/isFloat.js +22 -0
  408. package/node_modules/validator/lib/isFullWidth.js +14 -0
  409. package/node_modules/validator/lib/isHSL.js +22 -0
  410. package/node_modules/validator/lib/isHalfWidth.js +14 -0
  411. package/node_modules/validator/lib/isHash.js +30 -0
  412. package/node_modules/validator/lib/isHexColor.js +22 -0
  413. package/node_modules/validator/lib/isHexadecimal.js +15 -0
  414. package/node_modules/validator/lib/isIBAN.js +178 -0
  415. package/node_modules/validator/lib/isIMEI.js +49 -0
  416. package/node_modules/validator/lib/isIP.js +67 -0
  417. package/node_modules/validator/lib/isIPRange.js +50 -0
  418. package/node_modules/validator/lib/isISBN.js +56 -0
  419. package/node_modules/validator/lib/isISIN.js +64 -0
  420. package/node_modules/validator/lib/isISO15924.js +16 -0
  421. package/node_modules/validator/lib/isISO31661Alpha2.js +28 -0
  422. package/node_modules/validator/lib/isISO31661Alpha3.js +28 -0
  423. package/node_modules/validator/lib/isISO31661Numeric.js +16 -0
  424. package/node_modules/validator/lib/isISO4217.js +16 -0
  425. package/node_modules/validator/lib/isISO6346.js +35 -0
  426. package/node_modules/validator/lib/isISO6391.js +15 -0
  427. package/node_modules/validator/lib/isISO8601.js +50 -0
  428. package/node_modules/validator/lib/isISRC.js +16 -0
  429. package/node_modules/validator/lib/isISSN.js +28 -0
  430. package/node_modules/validator/lib/isIdentityCard.js +416 -0
  431. package/node_modules/validator/lib/isIn.js +32 -0
  432. package/node_modules/validator/lib/isInt.js +28 -0
  433. package/node_modules/validator/lib/isJSON.js +35 -0
  434. package/node_modules/validator/lib/isJWT.js +24 -0
  435. package/node_modules/validator/lib/isLatLong.js +30 -0
  436. package/node_modules/validator/lib/isLength.js +35 -0
  437. package/node_modules/validator/lib/isLicensePlate.js +67 -0
  438. package/node_modules/validator/lib/isLocale.js +115 -0
  439. package/node_modules/validator/lib/isLowercase.js +14 -0
  440. package/node_modules/validator/lib/isLuhnNumber.js +34 -0
  441. package/node_modules/validator/lib/isMACAddress.js +45 -0
  442. package/node_modules/validator/lib/isMD5.js +15 -0
  443. package/node_modules/validator/lib/isMagnetURI.js +18 -0
  444. package/node_modules/validator/lib/isMailtoURI.js +84 -0
  445. package/node_modules/validator/lib/isMimeType.js +48 -0
  446. package/node_modules/validator/lib/isMobilePhone.js +219 -0
  447. package/node_modules/validator/lib/isMongoId.js +15 -0
  448. package/node_modules/validator/lib/isMultibyte.js +18 -0
  449. package/node_modules/validator/lib/isNumeric.js +19 -0
  450. package/node_modules/validator/lib/isOctal.js +15 -0
  451. package/node_modules/validator/lib/isPassportNumber.js +152 -0
  452. package/node_modules/validator/lib/isPort.js +17 -0
  453. package/node_modules/validator/lib/isPostalCode.js +107 -0
  454. package/node_modules/validator/lib/isRFC3339.js +29 -0
  455. package/node_modules/validator/lib/isRgbColor.js +42 -0
  456. package/node_modules/validator/lib/isSemVer.js +22 -0
  457. package/node_modules/validator/lib/isSlug.js +15 -0
  458. package/node_modules/validator/lib/isStrongPassword.js +99 -0
  459. package/node_modules/validator/lib/isSurrogatePair.js +15 -0
  460. package/node_modules/validator/lib/isTaxID.js +1417 -0
  461. package/node_modules/validator/lib/isTime.js +31 -0
  462. package/node_modules/validator/lib/isULID.js +14 -0
  463. package/node_modules/validator/lib/isURL.js +249 -0
  464. package/node_modules/validator/lib/isUUID.js +32 -0
  465. package/node_modules/validator/lib/isUppercase.js +14 -0
  466. package/node_modules/validator/lib/isVAT.js +274 -0
  467. package/node_modules/validator/lib/isVariableWidth.js +16 -0
  468. package/node_modules/validator/lib/isWhitelisted.js +19 -0
  469. package/node_modules/validator/lib/ltrim.js +16 -0
  470. package/node_modules/validator/lib/matches.js +17 -0
  471. package/node_modules/validator/lib/normalizeEmail.js +140 -0
  472. package/node_modules/validator/lib/rtrim.js +24 -0
  473. package/node_modules/validator/lib/stripLow.js +16 -0
  474. package/node_modules/validator/lib/toBoolean.js +17 -0
  475. package/node_modules/validator/lib/toDate.js +15 -0
  476. package/node_modules/validator/lib/toFloat.js +14 -0
  477. package/node_modules/validator/lib/toInt.js +14 -0
  478. package/node_modules/validator/lib/trim.js +14 -0
  479. package/node_modules/validator/lib/unescape.js +17 -0
  480. package/node_modules/validator/lib/util/algorithms.js +88 -0
  481. package/node_modules/validator/lib/util/assertString.js +12 -0
  482. package/node_modules/validator/lib/util/checkHost.js +20 -0
  483. package/node_modules/validator/lib/util/includesArray.js +14 -0
  484. package/node_modules/validator/lib/util/includesString.js +12 -0
  485. package/node_modules/validator/lib/util/merge.js +22 -0
  486. package/node_modules/validator/lib/util/multilineRegex.js +20 -0
  487. package/node_modules/validator/lib/util/nullUndefinedCheck.js +11 -0
  488. package/node_modules/validator/lib/util/toString.js +21 -0
  489. package/node_modules/validator/lib/util/typeOf.js +18 -0
  490. package/node_modules/validator/lib/whitelist.js +14 -0
  491. package/node_modules/validator/package.json +76 -0
  492. package/node_modules/validator/validator.js +5808 -0
  493. package/node_modules/validator/validator.min.js +23 -0
  494. package/package.json +3 -3
@@ -0,0 +1,2187 @@
1
+ import { parseDateTimeSkeleton, parseNumberSkeleton, parseNumberSkeletonFromString } from "@formatjs/icu-skeleton-parser";
2
+ //#region packages/icu-messageformat-parser/error.ts
3
+ let ErrorKind = /* @__PURE__ */ function(ErrorKind) {
4
+ /** Argument is unclosed (e.g. `{0`) */
5
+ ErrorKind[ErrorKind["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE";
6
+ /** Argument is empty (e.g. `{}`). */
7
+ ErrorKind[ErrorKind["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT";
8
+ /** Argument is malformed (e.g. `{foo!}``) */
9
+ ErrorKind[ErrorKind["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT";
10
+ /** Expect an argument type (e.g. `{foo,}`) */
11
+ ErrorKind[ErrorKind["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE";
12
+ /** Unsupported argument type (e.g. `{foo,foo}`) */
13
+ ErrorKind[ErrorKind["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE";
14
+ /** Expect an argument style (e.g. `{foo, number, }`) */
15
+ ErrorKind[ErrorKind["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE";
16
+ /** The number skeleton is invalid. */
17
+ ErrorKind[ErrorKind["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON";
18
+ /** The date time skeleton is invalid. */
19
+ ErrorKind[ErrorKind["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON";
20
+ /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */
21
+ ErrorKind[ErrorKind["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON";
22
+ /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */
23
+ ErrorKind[ErrorKind["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON";
24
+ /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */
25
+ ErrorKind[ErrorKind["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE";
26
+ /** Missing select argument options (e.g. `{foo, select}`) */
27
+ ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS";
28
+ /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */
29
+ ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE";
30
+ /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */
31
+ ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE";
32
+ /** Expecting a selector in `select` argument (e.g `{foo, select}`) */
33
+ ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR";
34
+ /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */
35
+ ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR";
36
+ /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */
37
+ ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT";
38
+ /**
39
+ * Expecting a message fragment after the `plural` or `selectordinal` selector
40
+ * (e.g. `{foo, plural, one}`)
41
+ */
42
+ ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT";
43
+ /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */
44
+ ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR";
45
+ /**
46
+ * Duplicate selectors in `plural` or `selectordinal` argument.
47
+ * (e.g. {foo, plural, one {#} one {#}})
48
+ */
49
+ ErrorKind[ErrorKind["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR";
50
+ /** Duplicate selectors in `select` argument.
51
+ * (e.g. {foo, select, apple {apple} apple {apple}})
52
+ */
53
+ ErrorKind[ErrorKind["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR";
54
+ /** Plural or select argument option must have `other` clause. */
55
+ ErrorKind[ErrorKind["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE";
56
+ /** The tag is malformed. (e.g. `<bold!>foo</bold!>) */
57
+ ErrorKind[ErrorKind["INVALID_TAG"] = 23] = "INVALID_TAG";
58
+ /** The tag name is invalid. (e.g. `<123>foo</123>`) */
59
+ ErrorKind[ErrorKind["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME";
60
+ /** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
61
+ ErrorKind[ErrorKind["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG";
62
+ /** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
63
+ ErrorKind[ErrorKind["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG";
64
+ return ErrorKind;
65
+ }({});
66
+ //#endregion
67
+ //#region packages/icu-messageformat-parser/types.ts
68
+ let TYPE = /* @__PURE__ */ function(TYPE) {
69
+ /**
70
+ * Raw text
71
+ */
72
+ TYPE[TYPE["literal"] = 0] = "literal";
73
+ /**
74
+ * Variable w/o any format, e.g `var` in `this is a {var}`
75
+ */
76
+ TYPE[TYPE["argument"] = 1] = "argument";
77
+ /**
78
+ * Variable w/ number format
79
+ */
80
+ TYPE[TYPE["number"] = 2] = "number";
81
+ /**
82
+ * Variable w/ date format
83
+ */
84
+ TYPE[TYPE["date"] = 3] = "date";
85
+ /**
86
+ * Variable w/ time format
87
+ */
88
+ TYPE[TYPE["time"] = 4] = "time";
89
+ /**
90
+ * Variable w/ select format
91
+ */
92
+ TYPE[TYPE["select"] = 5] = "select";
93
+ /**
94
+ * Variable w/ plural format
95
+ */
96
+ TYPE[TYPE["plural"] = 6] = "plural";
97
+ /**
98
+ * Only possible within plural argument.
99
+ * This is the `#` symbol that will be substituted with the count.
100
+ */
101
+ TYPE[TYPE["pound"] = 7] = "pound";
102
+ /**
103
+ * XML-like tag
104
+ */
105
+ TYPE[TYPE["tag"] = 8] = "tag";
106
+ return TYPE;
107
+ }({});
108
+ let SKELETON_TYPE = /* @__PURE__ */ function(SKELETON_TYPE) {
109
+ SKELETON_TYPE[SKELETON_TYPE["number"] = 0] = "number";
110
+ SKELETON_TYPE[SKELETON_TYPE["dateTime"] = 1] = "dateTime";
111
+ return SKELETON_TYPE;
112
+ }({});
113
+ /**
114
+ * Type Guards
115
+ */
116
+ function isLiteralElement(el) {
117
+ return el.type === 0;
118
+ }
119
+ function isArgumentElement(el) {
120
+ return el.type === 1;
121
+ }
122
+ function isNumberElement(el) {
123
+ return el.type === 2;
124
+ }
125
+ function isDateElement(el) {
126
+ return el.type === 3;
127
+ }
128
+ function isTimeElement(el) {
129
+ return el.type === 4;
130
+ }
131
+ function isSelectElement(el) {
132
+ return el.type === 5;
133
+ }
134
+ function isPluralElement(el) {
135
+ return el.type === 6;
136
+ }
137
+ function isPoundElement(el) {
138
+ return el.type === 7;
139
+ }
140
+ function isTagElement(el) {
141
+ return el.type === 8;
142
+ }
143
+ function isNumberSkeleton(el) {
144
+ return !!(el && typeof el === "object" && el.type === 0);
145
+ }
146
+ function isDateTimeSkeleton(el) {
147
+ return !!(el && typeof el === "object" && el.type === 1);
148
+ }
149
+ function createLiteralElement(value) {
150
+ return {
151
+ type: 0,
152
+ value
153
+ };
154
+ }
155
+ function createNumberElement(value, style) {
156
+ return {
157
+ type: 2,
158
+ value,
159
+ style
160
+ };
161
+ }
162
+ //#endregion
163
+ //#region node_modules/.aspect_rules_js/@formatjs_generated+unicode@0.0.0/node_modules/@formatjs_generated/unicode/icu-messageformat-parser-regex.js
164
+ const SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
165
+ const IDENTIFIER_PREFIX_REGEX = /([^\t-\r -\/:-@\[-\^`\{-~\x85\xA0-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u1680\u2000-\u200A\u2010-\u2029\u202F-\u203E\u2041-\u2053\u2055-\u205F\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3000-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]*)/g;
166
+ //#endregion
167
+ //#region node_modules/.aspect_rules_js/@formatjs_generated+cldr.core@0.0.0/node_modules/@formatjs_generated/cldr.core/time-data.js
168
+ const timeData = {
169
+ "001": ["H", "h"],
170
+ "419": [
171
+ "h",
172
+ "H",
173
+ "hB",
174
+ "hb"
175
+ ],
176
+ "AC": [
177
+ "H",
178
+ "h",
179
+ "hb",
180
+ "hB"
181
+ ],
182
+ "AD": ["H", "hB"],
183
+ "AE": [
184
+ "h",
185
+ "hB",
186
+ "hb",
187
+ "H"
188
+ ],
189
+ "AF": [
190
+ "H",
191
+ "hb",
192
+ "hB",
193
+ "h"
194
+ ],
195
+ "AG": [
196
+ "h",
197
+ "hb",
198
+ "H",
199
+ "hB"
200
+ ],
201
+ "AI": [
202
+ "H",
203
+ "h",
204
+ "hb",
205
+ "hB"
206
+ ],
207
+ "AL": [
208
+ "h",
209
+ "H",
210
+ "hB"
211
+ ],
212
+ "AM": ["H", "hB"],
213
+ "AO": ["H", "hB"],
214
+ "AR": [
215
+ "h",
216
+ "H",
217
+ "hB",
218
+ "hb"
219
+ ],
220
+ "AS": ["h", "H"],
221
+ "AT": ["H", "hB"],
222
+ "AU": [
223
+ "h",
224
+ "hb",
225
+ "H",
226
+ "hB"
227
+ ],
228
+ "AW": ["H", "hB"],
229
+ "AX": ["H"],
230
+ "AZ": [
231
+ "H",
232
+ "hB",
233
+ "h"
234
+ ],
235
+ "BA": [
236
+ "H",
237
+ "hB",
238
+ "h"
239
+ ],
240
+ "BB": [
241
+ "h",
242
+ "hb",
243
+ "H",
244
+ "hB"
245
+ ],
246
+ "BD": [
247
+ "h",
248
+ "hB",
249
+ "H"
250
+ ],
251
+ "BE": ["H", "hB"],
252
+ "BF": ["H", "hB"],
253
+ "BG": [
254
+ "H",
255
+ "hB",
256
+ "h"
257
+ ],
258
+ "BH": [
259
+ "h",
260
+ "hB",
261
+ "hb",
262
+ "H"
263
+ ],
264
+ "BI": ["H", "h"],
265
+ "BJ": ["H", "hB"],
266
+ "BL": ["H", "hB"],
267
+ "BM": [
268
+ "h",
269
+ "hb",
270
+ "H",
271
+ "hB"
272
+ ],
273
+ "BN": [
274
+ "hb",
275
+ "hB",
276
+ "h",
277
+ "H"
278
+ ],
279
+ "BO": [
280
+ "h",
281
+ "H",
282
+ "hB",
283
+ "hb"
284
+ ],
285
+ "BQ": ["H"],
286
+ "BR": ["H", "hB"],
287
+ "BS": [
288
+ "h",
289
+ "hb",
290
+ "H",
291
+ "hB"
292
+ ],
293
+ "BT": ["h", "H"],
294
+ "BW": [
295
+ "H",
296
+ "h",
297
+ "hb",
298
+ "hB"
299
+ ],
300
+ "BY": ["H", "h"],
301
+ "BZ": [
302
+ "H",
303
+ "h",
304
+ "hb",
305
+ "hB"
306
+ ],
307
+ "CA": [
308
+ "h",
309
+ "hb",
310
+ "H",
311
+ "hB"
312
+ ],
313
+ "CC": [
314
+ "H",
315
+ "h",
316
+ "hb",
317
+ "hB"
318
+ ],
319
+ "CD": ["hB", "H"],
320
+ "CF": [
321
+ "H",
322
+ "h",
323
+ "hB"
324
+ ],
325
+ "CG": ["H", "hB"],
326
+ "CH": [
327
+ "H",
328
+ "hB",
329
+ "h"
330
+ ],
331
+ "CI": ["H", "hB"],
332
+ "CK": [
333
+ "H",
334
+ "h",
335
+ "hb",
336
+ "hB"
337
+ ],
338
+ "CL": [
339
+ "h",
340
+ "H",
341
+ "hB",
342
+ "hb"
343
+ ],
344
+ "CM": [
345
+ "H",
346
+ "h",
347
+ "hB"
348
+ ],
349
+ "CN": [
350
+ "H",
351
+ "hB",
352
+ "hb",
353
+ "h"
354
+ ],
355
+ "CO": [
356
+ "h",
357
+ "H",
358
+ "hB",
359
+ "hb"
360
+ ],
361
+ "CP": ["H"],
362
+ "CR": [
363
+ "h",
364
+ "H",
365
+ "hB",
366
+ "hb"
367
+ ],
368
+ "CU": [
369
+ "h",
370
+ "H",
371
+ "hB",
372
+ "hb"
373
+ ],
374
+ "CV": ["H", "hB"],
375
+ "CW": ["H", "hB"],
376
+ "CX": [
377
+ "H",
378
+ "h",
379
+ "hb",
380
+ "hB"
381
+ ],
382
+ "CY": [
383
+ "h",
384
+ "H",
385
+ "hb",
386
+ "hB"
387
+ ],
388
+ "CZ": ["H"],
389
+ "DE": ["H", "hB"],
390
+ "DG": [
391
+ "H",
392
+ "h",
393
+ "hb",
394
+ "hB"
395
+ ],
396
+ "DJ": ["h", "H"],
397
+ "DK": ["H"],
398
+ "DM": [
399
+ "h",
400
+ "hb",
401
+ "H",
402
+ "hB"
403
+ ],
404
+ "DO": [
405
+ "h",
406
+ "H",
407
+ "hB",
408
+ "hb"
409
+ ],
410
+ "DZ": [
411
+ "h",
412
+ "hB",
413
+ "hb",
414
+ "H"
415
+ ],
416
+ "EA": [
417
+ "H",
418
+ "h",
419
+ "hB",
420
+ "hb"
421
+ ],
422
+ "EC": [
423
+ "h",
424
+ "H",
425
+ "hB",
426
+ "hb"
427
+ ],
428
+ "EE": ["H", "hB"],
429
+ "EG": [
430
+ "h",
431
+ "hB",
432
+ "hb",
433
+ "H"
434
+ ],
435
+ "EH": [
436
+ "h",
437
+ "hB",
438
+ "hb",
439
+ "H"
440
+ ],
441
+ "ER": ["h", "H"],
442
+ "ES": [
443
+ "H",
444
+ "hB",
445
+ "h",
446
+ "hb"
447
+ ],
448
+ "ET": [
449
+ "hB",
450
+ "hb",
451
+ "h",
452
+ "H"
453
+ ],
454
+ "FI": ["H"],
455
+ "FJ": [
456
+ "h",
457
+ "hb",
458
+ "H",
459
+ "hB"
460
+ ],
461
+ "FK": [
462
+ "H",
463
+ "h",
464
+ "hb",
465
+ "hB"
466
+ ],
467
+ "FM": [
468
+ "h",
469
+ "hb",
470
+ "H",
471
+ "hB"
472
+ ],
473
+ "FO": ["H", "h"],
474
+ "FR": ["H", "hB"],
475
+ "GA": ["H", "hB"],
476
+ "GB": [
477
+ "H",
478
+ "h",
479
+ "hb",
480
+ "hB"
481
+ ],
482
+ "GD": [
483
+ "h",
484
+ "hb",
485
+ "H",
486
+ "hB"
487
+ ],
488
+ "GE": [
489
+ "H",
490
+ "hB",
491
+ "h"
492
+ ],
493
+ "GF": ["H", "hB"],
494
+ "GG": [
495
+ "H",
496
+ "h",
497
+ "hb",
498
+ "hB"
499
+ ],
500
+ "GH": ["h", "H"],
501
+ "GI": [
502
+ "H",
503
+ "h",
504
+ "hb",
505
+ "hB"
506
+ ],
507
+ "GL": ["H", "h"],
508
+ "GM": [
509
+ "h",
510
+ "hb",
511
+ "H",
512
+ "hB"
513
+ ],
514
+ "GN": ["H", "hB"],
515
+ "GP": ["H", "hB"],
516
+ "GQ": [
517
+ "H",
518
+ "hB",
519
+ "h",
520
+ "hb"
521
+ ],
522
+ "GR": [
523
+ "h",
524
+ "H",
525
+ "hb",
526
+ "hB"
527
+ ],
528
+ "GS": [
529
+ "H",
530
+ "h",
531
+ "hb",
532
+ "hB"
533
+ ],
534
+ "GT": [
535
+ "h",
536
+ "H",
537
+ "hB",
538
+ "hb"
539
+ ],
540
+ "GU": [
541
+ "h",
542
+ "hb",
543
+ "H",
544
+ "hB"
545
+ ],
546
+ "GW": ["H", "hB"],
547
+ "GY": [
548
+ "h",
549
+ "hb",
550
+ "H",
551
+ "hB"
552
+ ],
553
+ "HK": [
554
+ "h",
555
+ "hB",
556
+ "hb",
557
+ "H"
558
+ ],
559
+ "HN": [
560
+ "h",
561
+ "H",
562
+ "hB",
563
+ "hb"
564
+ ],
565
+ "HR": ["H", "hB"],
566
+ "HU": ["H", "h"],
567
+ "IC": [
568
+ "H",
569
+ "h",
570
+ "hB",
571
+ "hb"
572
+ ],
573
+ "ID": ["H"],
574
+ "IE": [
575
+ "H",
576
+ "h",
577
+ "hb",
578
+ "hB"
579
+ ],
580
+ "IL": ["H", "hB"],
581
+ "IM": [
582
+ "H",
583
+ "h",
584
+ "hb",
585
+ "hB"
586
+ ],
587
+ "IN": ["h", "H"],
588
+ "IO": [
589
+ "H",
590
+ "h",
591
+ "hb",
592
+ "hB"
593
+ ],
594
+ "IQ": [
595
+ "h",
596
+ "hB",
597
+ "hb",
598
+ "H"
599
+ ],
600
+ "IR": ["hB", "H"],
601
+ "IS": ["H"],
602
+ "IT": ["H", "hB"],
603
+ "JE": [
604
+ "H",
605
+ "h",
606
+ "hb",
607
+ "hB"
608
+ ],
609
+ "JM": [
610
+ "h",
611
+ "hb",
612
+ "H",
613
+ "hB"
614
+ ],
615
+ "JO": [
616
+ "h",
617
+ "hB",
618
+ "hb",
619
+ "H"
620
+ ],
621
+ "JP": [
622
+ "H",
623
+ "K",
624
+ "h"
625
+ ],
626
+ "KE": [
627
+ "hB",
628
+ "hb",
629
+ "H",
630
+ "h"
631
+ ],
632
+ "KG": [
633
+ "H",
634
+ "h",
635
+ "hB",
636
+ "hb"
637
+ ],
638
+ "KH": [
639
+ "hB",
640
+ "h",
641
+ "H",
642
+ "hb"
643
+ ],
644
+ "KI": [
645
+ "h",
646
+ "hb",
647
+ "H",
648
+ "hB"
649
+ ],
650
+ "KM": [
651
+ "H",
652
+ "h",
653
+ "hB",
654
+ "hb"
655
+ ],
656
+ "KN": [
657
+ "h",
658
+ "hb",
659
+ "H",
660
+ "hB"
661
+ ],
662
+ "KP": [
663
+ "h",
664
+ "H",
665
+ "hB",
666
+ "hb"
667
+ ],
668
+ "KR": [
669
+ "h",
670
+ "H",
671
+ "hB",
672
+ "hb"
673
+ ],
674
+ "KW": [
675
+ "h",
676
+ "hB",
677
+ "hb",
678
+ "H"
679
+ ],
680
+ "KY": [
681
+ "h",
682
+ "hb",
683
+ "H",
684
+ "hB"
685
+ ],
686
+ "KZ": ["H", "hB"],
687
+ "LA": [
688
+ "H",
689
+ "hb",
690
+ "hB",
691
+ "h"
692
+ ],
693
+ "LB": [
694
+ "h",
695
+ "hB",
696
+ "hb",
697
+ "H"
698
+ ],
699
+ "LC": [
700
+ "h",
701
+ "hb",
702
+ "H",
703
+ "hB"
704
+ ],
705
+ "LI": [
706
+ "H",
707
+ "hB",
708
+ "h"
709
+ ],
710
+ "LK": [
711
+ "H",
712
+ "h",
713
+ "hB",
714
+ "hb"
715
+ ],
716
+ "LR": [
717
+ "h",
718
+ "hb",
719
+ "H",
720
+ "hB"
721
+ ],
722
+ "LS": ["h", "H"],
723
+ "LT": [
724
+ "H",
725
+ "h",
726
+ "hb",
727
+ "hB"
728
+ ],
729
+ "LU": [
730
+ "H",
731
+ "h",
732
+ "hB"
733
+ ],
734
+ "LV": [
735
+ "H",
736
+ "hB",
737
+ "hb",
738
+ "h"
739
+ ],
740
+ "LY": [
741
+ "h",
742
+ "hB",
743
+ "hb",
744
+ "H"
745
+ ],
746
+ "MA": [
747
+ "H",
748
+ "h",
749
+ "hB",
750
+ "hb"
751
+ ],
752
+ "MC": ["H", "hB"],
753
+ "MD": ["H", "hB"],
754
+ "ME": [
755
+ "H",
756
+ "hB",
757
+ "h"
758
+ ],
759
+ "MF": ["H", "hB"],
760
+ "MG": ["H", "h"],
761
+ "MH": [
762
+ "h",
763
+ "hb",
764
+ "H",
765
+ "hB"
766
+ ],
767
+ "MK": [
768
+ "H",
769
+ "h",
770
+ "hb",
771
+ "hB"
772
+ ],
773
+ "ML": ["H"],
774
+ "MM": [
775
+ "hB",
776
+ "hb",
777
+ "H",
778
+ "h"
779
+ ],
780
+ "MN": [
781
+ "H",
782
+ "h",
783
+ "hb",
784
+ "hB"
785
+ ],
786
+ "MO": [
787
+ "h",
788
+ "hB",
789
+ "hb",
790
+ "H"
791
+ ],
792
+ "MP": [
793
+ "h",
794
+ "hb",
795
+ "H",
796
+ "hB"
797
+ ],
798
+ "MQ": ["H", "hB"],
799
+ "MR": [
800
+ "h",
801
+ "hB",
802
+ "hb",
803
+ "H"
804
+ ],
805
+ "MS": [
806
+ "H",
807
+ "h",
808
+ "hb",
809
+ "hB"
810
+ ],
811
+ "MT": ["H", "h"],
812
+ "MU": ["H", "h"],
813
+ "MV": ["H", "h"],
814
+ "MW": [
815
+ "h",
816
+ "hb",
817
+ "H",
818
+ "hB"
819
+ ],
820
+ "MX": [
821
+ "h",
822
+ "H",
823
+ "hB",
824
+ "hb"
825
+ ],
826
+ "MY": [
827
+ "hb",
828
+ "hB",
829
+ "h",
830
+ "H"
831
+ ],
832
+ "MZ": ["H", "hB"],
833
+ "NA": [
834
+ "h",
835
+ "H",
836
+ "hB",
837
+ "hb"
838
+ ],
839
+ "NC": ["H", "hB"],
840
+ "NE": ["H"],
841
+ "NF": [
842
+ "H",
843
+ "h",
844
+ "hb",
845
+ "hB"
846
+ ],
847
+ "NG": [
848
+ "H",
849
+ "h",
850
+ "hb",
851
+ "hB"
852
+ ],
853
+ "NI": [
854
+ "h",
855
+ "H",
856
+ "hB",
857
+ "hb"
858
+ ],
859
+ "NL": ["H", "hB"],
860
+ "NO": ["H", "h"],
861
+ "NP": [
862
+ "H",
863
+ "h",
864
+ "hB"
865
+ ],
866
+ "NR": [
867
+ "H",
868
+ "h",
869
+ "hb",
870
+ "hB"
871
+ ],
872
+ "NU": [
873
+ "H",
874
+ "h",
875
+ "hb",
876
+ "hB"
877
+ ],
878
+ "NZ": [
879
+ "h",
880
+ "hb",
881
+ "H",
882
+ "hB"
883
+ ],
884
+ "OM": [
885
+ "h",
886
+ "hB",
887
+ "hb",
888
+ "H"
889
+ ],
890
+ "PA": [
891
+ "h",
892
+ "H",
893
+ "hB",
894
+ "hb"
895
+ ],
896
+ "PE": [
897
+ "h",
898
+ "H",
899
+ "hB",
900
+ "hb"
901
+ ],
902
+ "PF": [
903
+ "H",
904
+ "h",
905
+ "hB"
906
+ ],
907
+ "PG": ["h", "H"],
908
+ "PH": [
909
+ "h",
910
+ "hB",
911
+ "hb",
912
+ "H"
913
+ ],
914
+ "PK": [
915
+ "h",
916
+ "hB",
917
+ "H"
918
+ ],
919
+ "PL": ["H", "h"],
920
+ "PM": ["H", "hB"],
921
+ "PN": [
922
+ "H",
923
+ "h",
924
+ "hb",
925
+ "hB"
926
+ ],
927
+ "PR": [
928
+ "h",
929
+ "H",
930
+ "hB",
931
+ "hb"
932
+ ],
933
+ "PS": [
934
+ "h",
935
+ "hB",
936
+ "hb",
937
+ "H"
938
+ ],
939
+ "PT": ["H", "hB"],
940
+ "PW": ["h", "H"],
941
+ "PY": [
942
+ "h",
943
+ "H",
944
+ "hB",
945
+ "hb"
946
+ ],
947
+ "QA": [
948
+ "h",
949
+ "hB",
950
+ "hb",
951
+ "H"
952
+ ],
953
+ "RE": ["H", "hB"],
954
+ "RO": ["H", "hB"],
955
+ "RS": [
956
+ "H",
957
+ "hB",
958
+ "h"
959
+ ],
960
+ "RU": ["H"],
961
+ "RW": ["H", "h"],
962
+ "SA": [
963
+ "h",
964
+ "hB",
965
+ "hb",
966
+ "H"
967
+ ],
968
+ "SB": [
969
+ "h",
970
+ "hb",
971
+ "H",
972
+ "hB"
973
+ ],
974
+ "SC": [
975
+ "H",
976
+ "h",
977
+ "hB"
978
+ ],
979
+ "SD": [
980
+ "h",
981
+ "hB",
982
+ "hb",
983
+ "H"
984
+ ],
985
+ "SE": ["H"],
986
+ "SG": [
987
+ "h",
988
+ "hb",
989
+ "H",
990
+ "hB"
991
+ ],
992
+ "SH": [
993
+ "H",
994
+ "h",
995
+ "hb",
996
+ "hB"
997
+ ],
998
+ "SI": ["H", "hB"],
999
+ "SJ": ["H"],
1000
+ "SK": ["H"],
1001
+ "SL": [
1002
+ "h",
1003
+ "hb",
1004
+ "H",
1005
+ "hB"
1006
+ ],
1007
+ "SM": [
1008
+ "H",
1009
+ "h",
1010
+ "hB"
1011
+ ],
1012
+ "SN": [
1013
+ "H",
1014
+ "h",
1015
+ "hB"
1016
+ ],
1017
+ "SO": ["h", "H"],
1018
+ "SR": ["H", "hB"],
1019
+ "SS": [
1020
+ "h",
1021
+ "hb",
1022
+ "H",
1023
+ "hB"
1024
+ ],
1025
+ "ST": ["H", "hB"],
1026
+ "SV": [
1027
+ "h",
1028
+ "H",
1029
+ "hB",
1030
+ "hb"
1031
+ ],
1032
+ "SX": [
1033
+ "H",
1034
+ "h",
1035
+ "hb",
1036
+ "hB"
1037
+ ],
1038
+ "SY": [
1039
+ "h",
1040
+ "hB",
1041
+ "hb",
1042
+ "H"
1043
+ ],
1044
+ "SZ": [
1045
+ "h",
1046
+ "hb",
1047
+ "H",
1048
+ "hB"
1049
+ ],
1050
+ "TA": [
1051
+ "H",
1052
+ "h",
1053
+ "hb",
1054
+ "hB"
1055
+ ],
1056
+ "TC": [
1057
+ "h",
1058
+ "hb",
1059
+ "H",
1060
+ "hB"
1061
+ ],
1062
+ "TD": [
1063
+ "h",
1064
+ "H",
1065
+ "hB"
1066
+ ],
1067
+ "TF": [
1068
+ "H",
1069
+ "h",
1070
+ "hB"
1071
+ ],
1072
+ "TG": ["H", "hB"],
1073
+ "TH": ["H", "h"],
1074
+ "TJ": ["H", "h"],
1075
+ "TL": [
1076
+ "H",
1077
+ "hB",
1078
+ "hb",
1079
+ "h"
1080
+ ],
1081
+ "TM": ["H", "h"],
1082
+ "TN": [
1083
+ "h",
1084
+ "hB",
1085
+ "hb",
1086
+ "H"
1087
+ ],
1088
+ "TO": ["h", "H"],
1089
+ "TR": ["H", "hB"],
1090
+ "TT": [
1091
+ "h",
1092
+ "hb",
1093
+ "H",
1094
+ "hB"
1095
+ ],
1096
+ "TW": [
1097
+ "hB",
1098
+ "hb",
1099
+ "h",
1100
+ "H"
1101
+ ],
1102
+ "TZ": [
1103
+ "hB",
1104
+ "hb",
1105
+ "H",
1106
+ "h"
1107
+ ],
1108
+ "UA": [
1109
+ "H",
1110
+ "hB",
1111
+ "h"
1112
+ ],
1113
+ "UG": [
1114
+ "hB",
1115
+ "hb",
1116
+ "H",
1117
+ "h"
1118
+ ],
1119
+ "UM": [
1120
+ "h",
1121
+ "hb",
1122
+ "H",
1123
+ "hB"
1124
+ ],
1125
+ "US": [
1126
+ "h",
1127
+ "hb",
1128
+ "H",
1129
+ "hB"
1130
+ ],
1131
+ "UY": [
1132
+ "h",
1133
+ "H",
1134
+ "hB",
1135
+ "hb"
1136
+ ],
1137
+ "UZ": [
1138
+ "H",
1139
+ "hB",
1140
+ "h"
1141
+ ],
1142
+ "VA": [
1143
+ "H",
1144
+ "h",
1145
+ "hB"
1146
+ ],
1147
+ "VC": [
1148
+ "h",
1149
+ "hb",
1150
+ "H",
1151
+ "hB"
1152
+ ],
1153
+ "VE": [
1154
+ "h",
1155
+ "H",
1156
+ "hB",
1157
+ "hb"
1158
+ ],
1159
+ "VG": [
1160
+ "h",
1161
+ "hb",
1162
+ "H",
1163
+ "hB"
1164
+ ],
1165
+ "VI": [
1166
+ "h",
1167
+ "hb",
1168
+ "H",
1169
+ "hB"
1170
+ ],
1171
+ "VN": ["H", "h"],
1172
+ "VU": ["h", "H"],
1173
+ "WF": ["H", "hB"],
1174
+ "WS": ["h", "H"],
1175
+ "XK": [
1176
+ "H",
1177
+ "hB",
1178
+ "h"
1179
+ ],
1180
+ "YE": [
1181
+ "h",
1182
+ "hB",
1183
+ "hb",
1184
+ "H"
1185
+ ],
1186
+ "YT": ["H", "hB"],
1187
+ "ZA": [
1188
+ "H",
1189
+ "h",
1190
+ "hb",
1191
+ "hB"
1192
+ ],
1193
+ "ZM": [
1194
+ "h",
1195
+ "hb",
1196
+ "H",
1197
+ "hB"
1198
+ ],
1199
+ "ZW": ["H", "h"],
1200
+ "af-ZA": [
1201
+ "H",
1202
+ "h",
1203
+ "hB",
1204
+ "hb"
1205
+ ],
1206
+ "ar-001": [
1207
+ "h",
1208
+ "hB",
1209
+ "hb",
1210
+ "H"
1211
+ ],
1212
+ "ca-ES": [
1213
+ "H",
1214
+ "h",
1215
+ "hB"
1216
+ ],
1217
+ "en-001": [
1218
+ "h",
1219
+ "hb",
1220
+ "H",
1221
+ "hB"
1222
+ ],
1223
+ "en-HK": [
1224
+ "h",
1225
+ "hb",
1226
+ "H",
1227
+ "hB"
1228
+ ],
1229
+ "en-IL": [
1230
+ "H",
1231
+ "h",
1232
+ "hb",
1233
+ "hB"
1234
+ ],
1235
+ "en-MY": [
1236
+ "h",
1237
+ "hb",
1238
+ "H",
1239
+ "hB"
1240
+ ],
1241
+ "es-BR": [
1242
+ "H",
1243
+ "h",
1244
+ "hB",
1245
+ "hb"
1246
+ ],
1247
+ "es-ES": [
1248
+ "H",
1249
+ "h",
1250
+ "hB",
1251
+ "hb"
1252
+ ],
1253
+ "es-GQ": [
1254
+ "H",
1255
+ "h",
1256
+ "hB",
1257
+ "hb"
1258
+ ],
1259
+ "fr-CA": [
1260
+ "H",
1261
+ "h",
1262
+ "hB"
1263
+ ],
1264
+ "gl-ES": [
1265
+ "H",
1266
+ "h",
1267
+ "hB"
1268
+ ],
1269
+ "gu-IN": [
1270
+ "hB",
1271
+ "hb",
1272
+ "h",
1273
+ "H"
1274
+ ],
1275
+ "hi-IN": [
1276
+ "hB",
1277
+ "h",
1278
+ "H"
1279
+ ],
1280
+ "it-CH": [
1281
+ "H",
1282
+ "h",
1283
+ "hB"
1284
+ ],
1285
+ "it-IT": [
1286
+ "H",
1287
+ "h",
1288
+ "hB"
1289
+ ],
1290
+ "kn-IN": [
1291
+ "hB",
1292
+ "h",
1293
+ "H"
1294
+ ],
1295
+ "ku-SY": ["H", "hB"],
1296
+ "ml-IN": [
1297
+ "hB",
1298
+ "h",
1299
+ "H"
1300
+ ],
1301
+ "mr-IN": [
1302
+ "hB",
1303
+ "hb",
1304
+ "h",
1305
+ "H"
1306
+ ],
1307
+ "pa-IN": [
1308
+ "hB",
1309
+ "hb",
1310
+ "h",
1311
+ "H"
1312
+ ],
1313
+ "ta-IN": [
1314
+ "hB",
1315
+ "h",
1316
+ "hb",
1317
+ "H"
1318
+ ],
1319
+ "te-IN": [
1320
+ "hB",
1321
+ "h",
1322
+ "H"
1323
+ ],
1324
+ "zu-ZA": [
1325
+ "H",
1326
+ "hB",
1327
+ "hb",
1328
+ "h"
1329
+ ]
1330
+ };
1331
+ //#endregion
1332
+ //#region packages/icu-messageformat-parser/date-time-pattern-generator.ts
1333
+ /**
1334
+ * Returns the best matching date time pattern if a date time skeleton
1335
+ * pattern is provided with a locale. Follows the Unicode specification:
1336
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns
1337
+ * @param skeleton date time skeleton pattern that possibly includes j, J or C
1338
+ * @param locale
1339
+ */
1340
+ function getBestPattern(skeleton, locale) {
1341
+ let skeletonCopy = "";
1342
+ for (let patternPos = 0; patternPos < skeleton.length; patternPos++) {
1343
+ const patternChar = skeleton.charAt(patternPos);
1344
+ if (patternChar === "j") {
1345
+ let extraLength = 0;
1346
+ while (patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar) {
1347
+ extraLength++;
1348
+ patternPos++;
1349
+ }
1350
+ let hourLen = 1 + (extraLength & 1);
1351
+ let dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);
1352
+ let dayPeriodChar = "a";
1353
+ let hourChar = getDefaultHourSymbolFromLocale(locale);
1354
+ if (hourChar == "H" || hourChar == "k") dayPeriodLen = 0;
1355
+ while (dayPeriodLen-- > 0) skeletonCopy += dayPeriodChar;
1356
+ while (hourLen-- > 0) skeletonCopy = hourChar + skeletonCopy;
1357
+ } else if (patternChar === "J") skeletonCopy += "H";
1358
+ else skeletonCopy += patternChar;
1359
+ }
1360
+ return skeletonCopy;
1361
+ }
1362
+ /**
1363
+ * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)
1364
+ * of the given `locale` to the corresponding time pattern.
1365
+ * @param locale
1366
+ */
1367
+ function getDefaultHourSymbolFromLocale(locale) {
1368
+ let hourCycle = locale.hourCycle;
1369
+ if (hourCycle === void 0) {
1370
+ const localeWithHourCycles = locale;
1371
+ hourCycle = localeWithHourCycles.getHourCycles?.()[0] ?? localeWithHourCycles.hourCycles?.[0];
1372
+ }
1373
+ if (hourCycle) switch (hourCycle) {
1374
+ case "h24": return "k";
1375
+ case "h23": return "H";
1376
+ case "h12": return "h";
1377
+ case "h11": return "K";
1378
+ default: throw new Error("Invalid hourCycle");
1379
+ }
1380
+ const languageTag = locale.language;
1381
+ let regionTag;
1382
+ if (languageTag !== "root") regionTag = locale.maximize().region;
1383
+ return (timeData[`${languageTag}-${regionTag}`] || timeData[regionTag || ""] || timeData[languageTag || ""] || timeData[`${languageTag}-001`] || timeData["001"])[0].charAt(0);
1384
+ }
1385
+ //#endregion
1386
+ //#region packages/icu-messageformat-parser/parser.ts
1387
+ const SPACE_SEPARATOR_START_REGEX = new RegExp(`^${SPACE_SEPARATOR_REGEX.source}*`);
1388
+ const SPACE_SEPARATOR_END_REGEX = new RegExp(`${SPACE_SEPARATOR_REGEX.source}*$`);
1389
+ function createLocation(start, end) {
1390
+ return {
1391
+ start,
1392
+ end
1393
+ };
1394
+ }
1395
+ const hasNativeFromEntries = !!Object.fromEntries;
1396
+ const hasTrimStart = !!String.prototype.trimStart;
1397
+ const hasTrimEnd = !!String.prototype.trimEnd;
1398
+ const fromEntries = hasNativeFromEntries ? Object.fromEntries : function fromEntries(entries) {
1399
+ const obj = {};
1400
+ for (const [k, v] of entries) obj[k] = v;
1401
+ return obj;
1402
+ };
1403
+ const trimStart = hasTrimStart ? function trimStart(s) {
1404
+ return s.trimStart();
1405
+ } : function trimStart(s) {
1406
+ return s.replace(SPACE_SEPARATOR_START_REGEX, "");
1407
+ };
1408
+ const trimEnd = hasTrimEnd ? function trimEnd(s) {
1409
+ return s.trimEnd();
1410
+ } : function trimEnd(s) {
1411
+ return s.replace(SPACE_SEPARATOR_END_REGEX, "");
1412
+ };
1413
+ let IDENTIFIER_PREFIX_RE = createIdentifierPrefixRegex();
1414
+ function createIdentifierPrefixRegex() {
1415
+ try {
1416
+ const regex = new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
1417
+ if (regex.exec("a ")?.[1] === "a") return regex;
1418
+ } catch {}
1419
+ return IDENTIFIER_PREFIX_REGEX;
1420
+ }
1421
+ function matchIdentifierAtIndex(s, index) {
1422
+ IDENTIFIER_PREFIX_RE.lastIndex = index;
1423
+ return IDENTIFIER_PREFIX_RE.exec(s)[1] ?? "";
1424
+ }
1425
+ function plainTopLevelEndPosition(message) {
1426
+ if (message.length === 0) return null;
1427
+ let line = 1;
1428
+ let column = 1;
1429
+ for (let offset = 0; offset < message.length;) {
1430
+ const code = message.charCodeAt(offset);
1431
+ switch (code) {
1432
+ case 35:
1433
+ case 39:
1434
+ case 60:
1435
+ case 123:
1436
+ case 125: return null;
1437
+ }
1438
+ if (code === 10) {
1439
+ line++;
1440
+ column = 1;
1441
+ offset++;
1442
+ } else {
1443
+ column++;
1444
+ if (code >= 55296 && code <= 56319 && offset + 1 < message.length) {
1445
+ const next = message.charCodeAt(offset + 1);
1446
+ offset += next >= 56320 && next <= 57343 ? 2 : 1;
1447
+ } else offset++;
1448
+ }
1449
+ }
1450
+ return {
1451
+ offset: message.length,
1452
+ line,
1453
+ column
1454
+ };
1455
+ }
1456
+ var Parser = class {
1457
+ constructor(message, options = {}) {
1458
+ this.message = message;
1459
+ this.position = {
1460
+ offset: 0,
1461
+ line: 1,
1462
+ column: 1
1463
+ };
1464
+ this.ignoreTag = !!options.ignoreTag;
1465
+ this.locale = options.locale;
1466
+ this.requiresOtherClause = !!options.requiresOtherClause;
1467
+ this.shouldParseSkeletons = !!options.shouldParseSkeletons;
1468
+ }
1469
+ parse() {
1470
+ if (this.offset() !== 0) throw Error("parser can only be used once");
1471
+ if (this.message.length > 0) {
1472
+ const firstCode = this.message.charCodeAt(0);
1473
+ if (firstCode !== 35 && firstCode !== 39 && firstCode !== 60 && firstCode !== 123 && firstCode !== 125) {
1474
+ const plainEndPosition = plainTopLevelEndPosition(this.message);
1475
+ if (plainEndPosition) {
1476
+ const start = this.clonePosition();
1477
+ this.position = plainEndPosition;
1478
+ return {
1479
+ val: [{
1480
+ type: 0,
1481
+ value: this.message,
1482
+ location: createLocation(start, this.clonePosition())
1483
+ }],
1484
+ err: null
1485
+ };
1486
+ }
1487
+ }
1488
+ }
1489
+ return this.parseMessage(0, "", false);
1490
+ }
1491
+ parseMessage(nestingLevel, parentArgType, expectingCloseTag) {
1492
+ let elements = [];
1493
+ while (!this.isEOF()) {
1494
+ const char = this.char();
1495
+ if (char === 123) {
1496
+ const result = this.parseArgument(nestingLevel, expectingCloseTag);
1497
+ if (result.err) return result;
1498
+ elements.push(result.val);
1499
+ } else if (char === 125 && nestingLevel > 0) break;
1500
+ else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) {
1501
+ const position = this.clonePosition();
1502
+ this.bump();
1503
+ elements.push({
1504
+ type: 7,
1505
+ location: createLocation(position, this.clonePosition())
1506
+ });
1507
+ } else if (char === 60 && !this.ignoreTag && this.peek() === 47) {
1508
+ if (expectingCloseTag) break;
1509
+ else return this.error(26, createLocation(this.clonePosition(), this.clonePosition()));
1510
+ } else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) {
1511
+ const result = this.parseTag(nestingLevel, parentArgType);
1512
+ if (result.err) return result;
1513
+ elements.push(result.val);
1514
+ } else {
1515
+ const result = this.parseLiteral(nestingLevel, parentArgType);
1516
+ if (result.err) return result;
1517
+ elements.push(result.val);
1518
+ }
1519
+ }
1520
+ return {
1521
+ val: elements,
1522
+ err: null
1523
+ };
1524
+ }
1525
+ /**
1526
+ * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
1527
+ * [custom element name][] except that a dash is NOT always mandatory and uppercase letters
1528
+ * are accepted:
1529
+ *
1530
+ * ```
1531
+ * tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "</" tagName (whitespace)* ">"
1532
+ * tagName ::= [a-z] (PENChar)*
1533
+ * PENChar ::=
1534
+ * "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |
1535
+ * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |
1536
+ * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
1537
+ * ```
1538
+ *
1539
+ * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
1540
+ * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
1541
+ * since other tag-based engines like React allow it
1542
+ */
1543
+ parseTag(nestingLevel, parentArgType) {
1544
+ const startPosition = this.clonePosition();
1545
+ this.bump();
1546
+ const tagName = this.parseTagName();
1547
+ this.bumpSpace();
1548
+ if (this.bumpIf("/>")) return {
1549
+ val: {
1550
+ type: 0,
1551
+ value: `<${tagName}/>`,
1552
+ location: createLocation(startPosition, this.clonePosition())
1553
+ },
1554
+ err: null
1555
+ };
1556
+ else if (this.bumpIf(">")) {
1557
+ const childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);
1558
+ if (childrenResult.err) return childrenResult;
1559
+ const children = childrenResult.val;
1560
+ const endTagStartPosition = this.clonePosition();
1561
+ if (this.bumpIf("</")) {
1562
+ if (this.isEOF() || !_isAlpha(this.char())) return this.error(23, createLocation(endTagStartPosition, this.clonePosition()));
1563
+ const closingTagNameStartPosition = this.clonePosition();
1564
+ if (tagName !== this.parseTagName()) return this.error(26, createLocation(closingTagNameStartPosition, this.clonePosition()));
1565
+ this.bumpSpace();
1566
+ if (!this.bumpIf(">")) return this.error(23, createLocation(endTagStartPosition, this.clonePosition()));
1567
+ return {
1568
+ val: {
1569
+ type: 8,
1570
+ value: tagName,
1571
+ children,
1572
+ location: createLocation(startPosition, this.clonePosition())
1573
+ },
1574
+ err: null
1575
+ };
1576
+ } else return this.error(27, createLocation(startPosition, this.clonePosition()));
1577
+ } else return this.error(23, createLocation(startPosition, this.clonePosition()));
1578
+ }
1579
+ /**
1580
+ * This method assumes that the caller has peeked ahead for the first tag character.
1581
+ */
1582
+ parseTagName() {
1583
+ const startOffset = this.offset();
1584
+ this.bump();
1585
+ while (!this.isEOF() && _isPotentialElementNameChar(this.char())) this.bump();
1586
+ return this.message.slice(startOffset, this.offset());
1587
+ }
1588
+ parseLiteral(nestingLevel, parentArgType) {
1589
+ const start = this.clonePosition();
1590
+ let value = "";
1591
+ while (true) {
1592
+ const parseQuoteResult = this.tryParseQuote(parentArgType);
1593
+ if (parseQuoteResult) {
1594
+ value += parseQuoteResult;
1595
+ continue;
1596
+ }
1597
+ const parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);
1598
+ if (parseUnquotedResult) {
1599
+ value += parseUnquotedResult;
1600
+ continue;
1601
+ }
1602
+ const parseLeftAngleResult = this.tryParseLeftAngleBracket();
1603
+ if (parseLeftAngleResult) {
1604
+ value += parseLeftAngleResult;
1605
+ continue;
1606
+ }
1607
+ break;
1608
+ }
1609
+ const location = createLocation(start, this.clonePosition());
1610
+ return {
1611
+ val: {
1612
+ type: 0,
1613
+ value,
1614
+ location
1615
+ },
1616
+ err: null
1617
+ };
1618
+ }
1619
+ tryParseLeftAngleBracket() {
1620
+ if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) {
1621
+ this.bump();
1622
+ return "<";
1623
+ }
1624
+ return null;
1625
+ }
1626
+ /**
1627
+ * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
1628
+ * a character that requires quoting (that is, "only where needed"), and works the same in
1629
+ * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.
1630
+ */
1631
+ tryParseQuote(parentArgType) {
1632
+ if (this.isEOF() || this.char() !== 39) return null;
1633
+ switch (this.peek()) {
1634
+ case 39:
1635
+ this.bump();
1636
+ this.bump();
1637
+ return "'";
1638
+ case 123:
1639
+ case 60:
1640
+ case 62:
1641
+ case 125: break;
1642
+ case 35:
1643
+ if (parentArgType === "plural" || parentArgType === "selectordinal") break;
1644
+ return null;
1645
+ default: return null;
1646
+ }
1647
+ this.bump();
1648
+ const codePoints = [this.char()];
1649
+ this.bump();
1650
+ while (!this.isEOF()) {
1651
+ const ch = this.char();
1652
+ if (ch === 39) {
1653
+ if (this.peek() === 39) {
1654
+ codePoints.push(39);
1655
+ this.bump();
1656
+ } else {
1657
+ this.bump();
1658
+ break;
1659
+ }
1660
+ } else codePoints.push(ch);
1661
+ this.bump();
1662
+ }
1663
+ return String.fromCodePoint(...codePoints);
1664
+ }
1665
+ tryParseUnquoted(nestingLevel, parentArgType) {
1666
+ if (this.isEOF()) return null;
1667
+ const ch = this.char();
1668
+ if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) return null;
1669
+ else {
1670
+ this.bump();
1671
+ return String.fromCodePoint(ch);
1672
+ }
1673
+ }
1674
+ parseArgument(nestingLevel, expectingCloseTag) {
1675
+ const openingBracePosition = this.clonePosition();
1676
+ this.bump();
1677
+ this.bumpSpace();
1678
+ if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
1679
+ if (this.char() === 125) {
1680
+ this.bump();
1681
+ return this.error(2, createLocation(openingBracePosition, this.clonePosition()));
1682
+ }
1683
+ let value = this.parseIdentifierIfPossible().value;
1684
+ if (!value) return this.error(3, createLocation(openingBracePosition, this.clonePosition()));
1685
+ this.bumpSpace();
1686
+ if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
1687
+ switch (this.char()) {
1688
+ case 125:
1689
+ this.bump();
1690
+ return {
1691
+ val: {
1692
+ type: 1,
1693
+ value,
1694
+ location: createLocation(openingBracePosition, this.clonePosition())
1695
+ },
1696
+ err: null
1697
+ };
1698
+ case 44:
1699
+ this.bump();
1700
+ this.bumpSpace();
1701
+ if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
1702
+ return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);
1703
+ default: return this.error(3, createLocation(openingBracePosition, this.clonePosition()));
1704
+ }
1705
+ }
1706
+ /**
1707
+ * Advance the parser until the end of the identifier, if it is currently on
1708
+ * an identifier character. Return an empty string otherwise.
1709
+ */
1710
+ parseIdentifierIfPossible() {
1711
+ const startingPosition = this.clonePosition();
1712
+ const startOffset = this.offset();
1713
+ const value = matchIdentifierAtIndex(this.message, startOffset);
1714
+ const endOffset = startOffset + value.length;
1715
+ this.bumpTo(endOffset);
1716
+ return {
1717
+ value,
1718
+ location: createLocation(startingPosition, this.clonePosition())
1719
+ };
1720
+ }
1721
+ parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition) {
1722
+ let typeStartPosition = this.clonePosition();
1723
+ let argType = this.parseIdentifierIfPossible().value;
1724
+ let typeEndPosition = this.clonePosition();
1725
+ switch (argType) {
1726
+ case "": return this.error(4, createLocation(typeStartPosition, typeEndPosition));
1727
+ case "number":
1728
+ case "date":
1729
+ case "time": {
1730
+ this.bumpSpace();
1731
+ let styleAndLocation = null;
1732
+ if (this.bumpIf(",")) {
1733
+ this.bumpSpace();
1734
+ const styleStartPosition = this.clonePosition();
1735
+ const result = this.parseSimpleArgStyleIfPossible();
1736
+ if (result.err) return result;
1737
+ const style = trimEnd(result.val);
1738
+ if (style.length === 0) return this.error(6, createLocation(this.clonePosition(), this.clonePosition()));
1739
+ styleAndLocation = {
1740
+ style,
1741
+ styleLocation: createLocation(styleStartPosition, this.clonePosition())
1742
+ };
1743
+ }
1744
+ const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
1745
+ if (argCloseResult.err) return argCloseResult;
1746
+ const location = createLocation(openingBracePosition, this.clonePosition());
1747
+ if (styleAndLocation && styleAndLocation.style.startsWith("::")) {
1748
+ let skeleton = trimStart(styleAndLocation.style.slice(2));
1749
+ if (argType === "number") {
1750
+ const result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);
1751
+ if (result.err) return result;
1752
+ return {
1753
+ val: {
1754
+ type: 2,
1755
+ value,
1756
+ location,
1757
+ style: result.val
1758
+ },
1759
+ err: null
1760
+ };
1761
+ } else {
1762
+ if (skeleton.length === 0) return this.error(10, location);
1763
+ let dateTimePattern = skeleton;
1764
+ if (this.locale) dateTimePattern = getBestPattern(skeleton, this.locale);
1765
+ const style = {
1766
+ type: 1,
1767
+ pattern: dateTimePattern,
1768
+ location: styleAndLocation.styleLocation,
1769
+ parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {}
1770
+ };
1771
+ return {
1772
+ val: {
1773
+ type: argType === "date" ? 3 : 4,
1774
+ value,
1775
+ location,
1776
+ style
1777
+ },
1778
+ err: null
1779
+ };
1780
+ }
1781
+ }
1782
+ return {
1783
+ val: {
1784
+ type: argType === "number" ? 2 : argType === "date" ? 3 : 4,
1785
+ value,
1786
+ location,
1787
+ style: styleAndLocation?.style ?? null
1788
+ },
1789
+ err: null
1790
+ };
1791
+ }
1792
+ case "plural":
1793
+ case "selectordinal":
1794
+ case "select": {
1795
+ const typeEndPosition = this.clonePosition();
1796
+ this.bumpSpace();
1797
+ if (!this.bumpIf(",")) return this.error(12, createLocation(typeEndPosition, { ...typeEndPosition }));
1798
+ this.bumpSpace();
1799
+ let identifierAndLocation = this.parseIdentifierIfPossible();
1800
+ let pluralOffset = 0;
1801
+ if (argType !== "select" && identifierAndLocation.value === "offset") {
1802
+ if (!this.bumpIf(":")) return this.error(13, createLocation(this.clonePosition(), this.clonePosition()));
1803
+ this.bumpSpace();
1804
+ const result = this.tryParseDecimalInteger(13, 14);
1805
+ if (result.err) return result;
1806
+ this.bumpSpace();
1807
+ identifierAndLocation = this.parseIdentifierIfPossible();
1808
+ pluralOffset = result.val;
1809
+ }
1810
+ const optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);
1811
+ if (optionsResult.err) return optionsResult;
1812
+ const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
1813
+ if (argCloseResult.err) return argCloseResult;
1814
+ const location = createLocation(openingBracePosition, this.clonePosition());
1815
+ if (argType === "select") return {
1816
+ val: {
1817
+ type: 5,
1818
+ value,
1819
+ options: fromEntries(optionsResult.val),
1820
+ location
1821
+ },
1822
+ err: null
1823
+ };
1824
+ else return {
1825
+ val: {
1826
+ type: 6,
1827
+ value,
1828
+ options: fromEntries(optionsResult.val),
1829
+ offset: pluralOffset,
1830
+ pluralType: argType === "plural" ? "cardinal" : "ordinal",
1831
+ location
1832
+ },
1833
+ err: null
1834
+ };
1835
+ }
1836
+ default: return this.error(5, createLocation(typeStartPosition, typeEndPosition));
1837
+ }
1838
+ }
1839
+ tryParseArgumentClose(openingBracePosition) {
1840
+ if (this.isEOF() || this.char() !== 125) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
1841
+ this.bump();
1842
+ return {
1843
+ val: true,
1844
+ err: null
1845
+ };
1846
+ }
1847
+ /**
1848
+ * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
1849
+ */
1850
+ parseSimpleArgStyleIfPossible() {
1851
+ let nestedBraces = 0;
1852
+ const startPosition = this.clonePosition();
1853
+ while (!this.isEOF()) switch (this.char()) {
1854
+ case 39: {
1855
+ this.bump();
1856
+ let apostrophePosition = this.clonePosition();
1857
+ if (!this.bumpUntil("'")) return this.error(11, createLocation(apostrophePosition, this.clonePosition()));
1858
+ this.bump();
1859
+ break;
1860
+ }
1861
+ case 123:
1862
+ nestedBraces += 1;
1863
+ this.bump();
1864
+ break;
1865
+ case 125:
1866
+ if (nestedBraces > 0) nestedBraces -= 1;
1867
+ else return {
1868
+ val: this.message.slice(startPosition.offset, this.offset()),
1869
+ err: null
1870
+ };
1871
+ break;
1872
+ default: this.bump();
1873
+ }
1874
+ return {
1875
+ val: this.message.slice(startPosition.offset, this.offset()),
1876
+ err: null
1877
+ };
1878
+ }
1879
+ parseNumberSkeletonFromString(skeleton, location) {
1880
+ let tokens = [];
1881
+ try {
1882
+ tokens = parseNumberSkeletonFromString(skeleton);
1883
+ } catch {
1884
+ return this.error(7, location);
1885
+ }
1886
+ return {
1887
+ val: {
1888
+ type: 0,
1889
+ tokens,
1890
+ location,
1891
+ parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {}
1892
+ },
1893
+ err: null
1894
+ };
1895
+ }
1896
+ /**
1897
+ * @param nesting_level The current nesting level of messages.
1898
+ * This can be positive when parsing message fragment in select or plural argument options.
1899
+ * @param parent_arg_type The parent argument's type.
1900
+ * @param parsed_first_identifier If provided, this is the first identifier-like selector of
1901
+ * the argument. It is a by-product of a previous parsing attempt.
1902
+ * @param expecting_close_tag If true, this message is directly or indirectly nested inside
1903
+ * between a pair of opening and closing tags. The nested message will not parse beyond
1904
+ * the closing tag boundary.
1905
+ */
1906
+ tryParsePluralOrSelectOptions(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {
1907
+ let hasOtherClause = false;
1908
+ const options = [];
1909
+ const parsedSelectors = /* @__PURE__ */ new Set();
1910
+ let { value: selector, location: selectorLocation } = parsedFirstIdentifier;
1911
+ while (true) {
1912
+ if (selector.length === 0) {
1913
+ const startPosition = this.clonePosition();
1914
+ if (parentArgType !== "select" && this.bumpIf("=")) {
1915
+ const result = this.tryParseDecimalInteger(16, 19);
1916
+ if (result.err) return result;
1917
+ selectorLocation = createLocation(startPosition, this.clonePosition());
1918
+ selector = this.message.slice(startPosition.offset, this.offset());
1919
+ } else break;
1920
+ }
1921
+ if (parsedSelectors.has(selector)) return this.error(parentArgType === "select" ? 21 : 20, selectorLocation);
1922
+ if (selector === "other") hasOtherClause = true;
1923
+ this.bumpSpace();
1924
+ const openingBracePosition = this.clonePosition();
1925
+ if (!this.bumpIf("{")) return this.error(parentArgType === "select" ? 17 : 18, createLocation(this.clonePosition(), this.clonePosition()));
1926
+ const fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);
1927
+ if (fragmentResult.err) return fragmentResult;
1928
+ const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
1929
+ if (argCloseResult.err) return argCloseResult;
1930
+ options.push([selector, {
1931
+ value: fragmentResult.val,
1932
+ location: createLocation(openingBracePosition, this.clonePosition())
1933
+ }]);
1934
+ parsedSelectors.add(selector);
1935
+ this.bumpSpace();
1936
+ ({value: selector, location: selectorLocation} = this.parseIdentifierIfPossible());
1937
+ }
1938
+ if (options.length === 0) return this.error(parentArgType === "select" ? 15 : 16, createLocation(this.clonePosition(), this.clonePosition()));
1939
+ if (this.requiresOtherClause && !hasOtherClause) return this.error(22, createLocation(this.clonePosition(), this.clonePosition()));
1940
+ return {
1941
+ val: options,
1942
+ err: null
1943
+ };
1944
+ }
1945
+ tryParseDecimalInteger(expectNumberError, invalidNumberError) {
1946
+ let sign = 1;
1947
+ const startingPosition = this.clonePosition();
1948
+ if (this.bumpIf("+")) {} else if (this.bumpIf("-")) sign = -1;
1949
+ let hasDigits = false;
1950
+ let decimal = 0;
1951
+ while (!this.isEOF()) {
1952
+ const ch = this.char();
1953
+ if (ch >= 48 && ch <= 57) {
1954
+ hasDigits = true;
1955
+ decimal = decimal * 10 + (ch - 48);
1956
+ this.bump();
1957
+ } else break;
1958
+ }
1959
+ const location = createLocation(startingPosition, this.clonePosition());
1960
+ if (!hasDigits) return this.error(expectNumberError, location);
1961
+ decimal *= sign;
1962
+ if (!Number.isSafeInteger(decimal)) return this.error(invalidNumberError, location);
1963
+ return {
1964
+ val: decimal,
1965
+ err: null
1966
+ };
1967
+ }
1968
+ offset() {
1969
+ return this.position.offset;
1970
+ }
1971
+ isEOF() {
1972
+ return this.offset() === this.message.length;
1973
+ }
1974
+ clonePosition() {
1975
+ return {
1976
+ offset: this.position.offset,
1977
+ line: this.position.line,
1978
+ column: this.position.column
1979
+ };
1980
+ }
1981
+ /**
1982
+ * Return the code point at the current position of the parser.
1983
+ * Throws if the index is out of bound.
1984
+ */
1985
+ char() {
1986
+ const offset = this.position.offset;
1987
+ if (offset >= this.message.length) throw Error("out of bound");
1988
+ const code = this.message.codePointAt(offset);
1989
+ if (code === void 0) throw Error(`Offset ${offset} is at invalid UTF-16 code unit boundary`);
1990
+ return code;
1991
+ }
1992
+ error(kind, location) {
1993
+ return {
1994
+ val: null,
1995
+ err: {
1996
+ kind,
1997
+ message: this.message,
1998
+ location
1999
+ }
2000
+ };
2001
+ }
2002
+ /** Bump the parser to the next UTF-16 code unit. */
2003
+ bump() {
2004
+ if (this.isEOF()) return;
2005
+ const code = this.char();
2006
+ if (code === 10) {
2007
+ this.position.line += 1;
2008
+ this.position.column = 1;
2009
+ this.position.offset += 1;
2010
+ } else {
2011
+ this.position.column += 1;
2012
+ this.position.offset += code < 65536 ? 1 : 2;
2013
+ }
2014
+ }
2015
+ /**
2016
+ * If the substring starting at the current position of the parser has
2017
+ * the given prefix, then bump the parser to the character immediately
2018
+ * following the prefix and return true. Otherwise, don't bump the parser
2019
+ * and return false.
2020
+ */
2021
+ bumpIf(prefix) {
2022
+ const offset = this.offset();
2023
+ if (this.message.slice(offset, offset + prefix.length) === prefix) {
2024
+ for (let i = 0; i < prefix.length; i++) this.bump();
2025
+ return true;
2026
+ }
2027
+ return false;
2028
+ }
2029
+ /**
2030
+ * Bump the parser until the pattern character is found and return `true`.
2031
+ * Otherwise bump to the end of the file and return `false`.
2032
+ */
2033
+ bumpUntil(pattern) {
2034
+ const currentOffset = this.offset();
2035
+ const index = this.message.indexOf(pattern, currentOffset);
2036
+ if (index >= 0) {
2037
+ this.bumpTo(index);
2038
+ return true;
2039
+ } else {
2040
+ this.bumpTo(this.message.length);
2041
+ return false;
2042
+ }
2043
+ }
2044
+ /**
2045
+ * Bump the parser to the target offset.
2046
+ * If target offset is beyond the end of the input, bump the parser to the end of the input.
2047
+ */
2048
+ bumpTo(targetOffset) {
2049
+ if (this.offset() > targetOffset) throw Error(`targetOffset ${targetOffset} must be greater than or equal to the current offset ${this.offset()}`);
2050
+ targetOffset = Math.min(targetOffset, this.message.length);
2051
+ while (true) {
2052
+ const offset = this.offset();
2053
+ if (offset === targetOffset) break;
2054
+ if (offset > targetOffset) throw Error(`targetOffset ${targetOffset} is at invalid UTF-16 code unit boundary`);
2055
+ this.bump();
2056
+ if (this.isEOF()) break;
2057
+ }
2058
+ }
2059
+ /** advance the parser through all whitespace to the next non-whitespace code unit. */
2060
+ bumpSpace() {
2061
+ while (!this.isEOF() && _isWhiteSpace(this.char())) this.bump();
2062
+ }
2063
+ /**
2064
+ * Peek at the *next* Unicode codepoint in the input without advancing the parser.
2065
+ * If the input has been exhausted, then this returns null.
2066
+ */
2067
+ peek() {
2068
+ if (this.isEOF()) return null;
2069
+ const code = this.char();
2070
+ const offset = this.offset();
2071
+ return this.message.charCodeAt(offset + (code >= 65536 ? 2 : 1)) ?? null;
2072
+ }
2073
+ };
2074
+ /**
2075
+ * This check if codepoint is alphabet (lower & uppercase)
2076
+ * @param codepoint
2077
+ * @returns
2078
+ */
2079
+ function _isAlpha(codepoint) {
2080
+ return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90;
2081
+ }
2082
+ function _isAlphaOrSlash(codepoint) {
2083
+ return _isAlpha(codepoint) || codepoint === 47;
2084
+ }
2085
+ /** See `parseTag` function docs. */
2086
+ function _isPotentialElementNameChar(c) {
2087
+ return c === 45 || c === 46 || c >= 48 && c <= 57 || c === 95 || c >= 97 && c <= 122 || c >= 65 && c <= 90 || c == 183 || c >= 192 && c <= 214 || c >= 216 && c <= 246 || c >= 248 && c <= 893 || c >= 895 && c <= 8191 || c >= 8204 && c <= 8205 || c >= 8255 && c <= 8256 || c >= 8304 && c <= 8591 || c >= 11264 && c <= 12271 || c >= 12289 && c <= 55295 || c >= 63744 && c <= 64975 || c >= 65008 && c <= 65533 || c >= 65536 && c <= 983039;
2088
+ }
2089
+ /**
2090
+ * Code point equivalent of regex `\p{White_Space}`.
2091
+ * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
2092
+ */
2093
+ function _isWhiteSpace(c) {
2094
+ return c >= 9 && c <= 13 || c === 32 || c === 133 || c >= 8206 && c <= 8207 || c === 8232 || c === 8233;
2095
+ }
2096
+ //#endregion
2097
+ //#region packages/icu-messageformat-parser/manipulator.ts
2098
+ /**
2099
+ * Collect all variables in an AST to Record<string, TYPE>
2100
+ * @param ast AST to collect variables from
2101
+ * @param vars Record of variable name to variable type
2102
+ */
2103
+ function collectVariables(ast, vars = /* @__PURE__ */ new Map()) {
2104
+ ast.forEach((el) => {
2105
+ if (isArgumentElement(el) || isDateElement(el) || isTimeElement(el) || isNumberElement(el)) {
2106
+ if (vars.has(el.value)) {
2107
+ const existingType = vars.get(el.value);
2108
+ if (existingType !== el.type && existingType !== 6 && existingType !== 5) throw new Error(`Variable ${el.value} has conflicting types`);
2109
+ } else vars.set(el.value, el.type);
2110
+ }
2111
+ if (isPluralElement(el) || isSelectElement(el)) {
2112
+ vars.set(el.value, el.type);
2113
+ Object.keys(el.options).forEach((k) => {
2114
+ collectVariables(el.options[k].value, vars);
2115
+ });
2116
+ }
2117
+ if (isTagElement(el)) {
2118
+ vars.set(el.value, el.type);
2119
+ collectVariables(el.children, vars);
2120
+ }
2121
+ });
2122
+ }
2123
+ /**
2124
+ * Check if 2 ASTs are structurally the same. This primarily means that
2125
+ * they have the same variables with the same type
2126
+ * @param a
2127
+ * @param b
2128
+ * @returns
2129
+ */
2130
+ function isStructurallySame(a, b) {
2131
+ const aVars = /* @__PURE__ */ new Map();
2132
+ const bVars = /* @__PURE__ */ new Map();
2133
+ collectVariables(a, aVars);
2134
+ collectVariables(b, bVars);
2135
+ if (aVars.size !== bVars.size) return {
2136
+ success: false,
2137
+ error: /* @__PURE__ */ new Error(`Different number of variables: [${Array.from(aVars.keys()).join(", ")}] vs [${Array.from(bVars.keys()).join(", ")}]`)
2138
+ };
2139
+ return Array.from(aVars.entries()).reduce((result, [key, type]) => {
2140
+ if (!result.success) return result;
2141
+ const bType = bVars.get(key);
2142
+ if (bType == null) return {
2143
+ success: false,
2144
+ error: /* @__PURE__ */ new Error(`Missing variable ${key} in message`)
2145
+ };
2146
+ if (bType !== type) return {
2147
+ success: false,
2148
+ error: /* @__PURE__ */ new Error(`Variable ${key} has conflicting types: ${TYPE[type]} vs ${TYPE[bType]}`)
2149
+ };
2150
+ return result;
2151
+ }, { success: true });
2152
+ }
2153
+ //#endregion
2154
+ //#region packages/icu-messageformat-parser/index.ts
2155
+ function pruneLocation(els) {
2156
+ els.forEach((el) => {
2157
+ delete el.location;
2158
+ if (isSelectElement(el) || isPluralElement(el)) for (const k in el.options) {
2159
+ delete el.options[k].location;
2160
+ pruneLocation(el.options[k].value);
2161
+ }
2162
+ else if (isNumberElement(el) && isNumberSkeleton(el.style)) delete el.style.location;
2163
+ else if ((isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style)) delete el.style.location;
2164
+ else if (isTagElement(el)) pruneLocation(el.children);
2165
+ });
2166
+ }
2167
+ function parse(message, opts = {}) {
2168
+ opts = {
2169
+ shouldParseSkeletons: true,
2170
+ requiresOtherClause: true,
2171
+ ...opts
2172
+ };
2173
+ const result = new Parser(message, opts).parse();
2174
+ if (result.err) {
2175
+ const error = SyntaxError(ErrorKind[result.err.kind]);
2176
+ error.location = result.err.location;
2177
+ error.originalMessage = result.err.message;
2178
+ throw error;
2179
+ }
2180
+ if (!opts?.captureLocation) pruneLocation(result.val);
2181
+ return result.val;
2182
+ }
2183
+ const _Parser = Parser;
2184
+ //#endregion
2185
+ export { SKELETON_TYPE, TYPE, _Parser, createLiteralElement, createNumberElement, isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isStructurallySame, isTagElement, isTimeElement, parse };
2186
+
2187
+ //# sourceMappingURL=index.js.map