@intlayer/core 8.4.0-canary.0 → 8.4.1

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 (533) hide show
  1. package/dist/cjs/{_virtual/_rolldown/runtime.cjs → chunk-Bmb41Sf3.cjs} +1 -1
  2. package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs +1 -1
  3. package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs.map +1 -1
  4. package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs +1 -1
  5. package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs.map +1 -1
  6. package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs +1 -1
  7. package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs.map +1 -1
  8. package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs +1 -1
  9. package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs.map +1 -1
  10. package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs +1 -1
  11. package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs.map +1 -1
  12. package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs +1 -1
  13. package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs.map +1 -1
  14. package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs +1 -1
  15. package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs.map +1 -1
  16. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs +1 -1
  17. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs.map +1 -1
  18. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs +1 -1
  19. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs.map +1 -1
  20. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs +1 -1
  21. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs.map +1 -1
  22. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs +1 -1
  23. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs.map +1 -1
  24. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs +1 -1
  25. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
  26. package/dist/cjs/dictionaryManipulator/getNodeType.cjs +1 -1
  27. package/dist/cjs/dictionaryManipulator/getNodeType.cjs.map +1 -1
  28. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +1 -1
  29. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs.map +1 -1
  30. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs +1 -1
  31. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs.map +1 -1
  32. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs +1 -1
  33. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs.map +1 -1
  34. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs +1 -1
  35. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs.map +1 -1
  36. package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs +1 -1
  37. package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs.map +1 -1
  38. package/dist/cjs/formatters/compact.cjs +1 -1
  39. package/dist/cjs/formatters/compact.cjs.map +1 -1
  40. package/dist/cjs/formatters/currency.cjs +1 -1
  41. package/dist/cjs/formatters/currency.cjs.map +1 -1
  42. package/dist/cjs/formatters/date.cjs +1 -1
  43. package/dist/cjs/formatters/date.cjs.map +1 -1
  44. package/dist/cjs/formatters/list.cjs +1 -1
  45. package/dist/cjs/formatters/list.cjs.map +1 -1
  46. package/dist/cjs/formatters/number.cjs +1 -1
  47. package/dist/cjs/formatters/number.cjs.map +1 -1
  48. package/dist/cjs/formatters/percentage.cjs +1 -1
  49. package/dist/cjs/formatters/percentage.cjs.map +1 -1
  50. package/dist/cjs/formatters/relativeTime.cjs +1 -1
  51. package/dist/cjs/formatters/relativeTime.cjs.map +1 -1
  52. package/dist/cjs/formatters/units.cjs +1 -1
  53. package/dist/cjs/formatters/units.cjs.map +1 -1
  54. package/dist/cjs/getContent-DrqM8pqO.cjs +2 -0
  55. package/dist/cjs/getContent-DrqM8pqO.cjs.map +1 -0
  56. package/dist/cjs/getStorageAttributes.cjs +1 -1
  57. package/dist/cjs/getStorageAttributes.cjs.map +1 -1
  58. package/dist/cjs/html-CZ1N-VL0.cjs +2 -0
  59. package/dist/cjs/html-CZ1N-VL0.cjs.map +1 -0
  60. package/dist/cjs/index.cjs +1 -1
  61. package/dist/cjs/interpreter/getContent/deepTransform.cjs +1 -1
  62. package/dist/cjs/interpreter/getContent/deepTransform.cjs.map +1 -1
  63. package/dist/cjs/interpreter/getContent/getContent.cjs +1 -2
  64. package/dist/cjs/interpreter/getContent/index.cjs +1 -1
  65. package/dist/cjs/interpreter/getContent/plugins.cjs +1 -2
  66. package/dist/cjs/interpreter/getDictionary.cjs +1 -2
  67. package/dist/cjs/interpreter/getIntlayer.cjs +1 -2
  68. package/dist/cjs/interpreter/getNesting.cjs +1 -2
  69. package/dist/cjs/interpreter/index.cjs +1 -1
  70. package/dist/cjs/localization/getBrowserLocale.cjs +1 -1
  71. package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -1
  72. package/dist/cjs/localization/getHTMLTextDir.cjs +1 -1
  73. package/dist/cjs/localization/getHTMLTextDir.cjs.map +1 -1
  74. package/dist/cjs/localization/getLocale.cjs +1 -1
  75. package/dist/cjs/localization/getLocale.cjs.map +1 -1
  76. package/dist/cjs/localization/getLocaleFromPath.cjs +1 -1
  77. package/dist/cjs/localization/getLocaleFromPath.cjs.map +1 -1
  78. package/dist/cjs/localization/getLocalizedUrl.cjs +1 -1
  79. package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
  80. package/dist/cjs/localization/getMultilingualUrls.cjs +1 -1
  81. package/dist/cjs/localization/getMultilingualUrls.cjs.map +1 -1
  82. package/dist/cjs/localization/getPathWithoutLocale.cjs +1 -1
  83. package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
  84. package/dist/cjs/localization/getPrefix.cjs +1 -1
  85. package/dist/cjs/localization/getPrefix.cjs.map +1 -1
  86. package/dist/cjs/localization/localeMapper.cjs +1 -1
  87. package/dist/cjs/localization/localeMapper.cjs.map +1 -1
  88. package/dist/cjs/localization/localeResolver.cjs +1 -1
  89. package/dist/cjs/localization/localeResolver.cjs.map +1 -1
  90. package/dist/cjs/localization/validatePrefix.cjs +1 -1
  91. package/dist/cjs/localization/validatePrefix.cjs.map +1 -1
  92. package/dist/cjs/messageFormat/ICU.cjs +1 -1
  93. package/dist/cjs/messageFormat/ICU.cjs.map +1 -1
  94. package/dist/cjs/messageFormat/i18next.cjs +1 -1
  95. package/dist/cjs/messageFormat/i18next.cjs.map +1 -1
  96. package/dist/cjs/messageFormat/vue-i18n.cjs +1 -1
  97. package/dist/cjs/messageFormat/vue-i18n.cjs.map +1 -1
  98. package/dist/cjs/transpiler/condition/condition.cjs +1 -1
  99. package/dist/cjs/transpiler/condition/condition.cjs.map +1 -1
  100. package/dist/cjs/transpiler/enumeration/enumeration.cjs +1 -1
  101. package/dist/cjs/transpiler/enumeration/enumeration.cjs.map +1 -1
  102. package/dist/cjs/transpiler/file/file.cjs +1 -1
  103. package/dist/cjs/transpiler/file/file.cjs.map +1 -1
  104. package/dist/cjs/transpiler/gender/gender.cjs +1 -1
  105. package/dist/cjs/transpiler/gender/gender.cjs.map +1 -1
  106. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs +1 -2
  107. package/dist/cjs/transpiler/html/html.cjs +1 -2
  108. package/dist/cjs/transpiler/html/index.cjs +1 -1
  109. package/dist/cjs/transpiler/index.cjs +1 -1
  110. package/dist/cjs/transpiler/insertion/insertion.cjs +1 -1
  111. package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -1
  112. package/dist/cjs/transpiler/markdown/markdown.cjs +1 -1
  113. package/dist/cjs/transpiler/markdown/markdown.cjs.map +1 -1
  114. package/dist/cjs/transpiler/nesting/nesting.cjs +1 -1
  115. package/dist/cjs/transpiler/nesting/nesting.cjs.map +1 -1
  116. package/dist/cjs/transpiler/translation/translation.cjs +1 -1
  117. package/dist/cjs/transpiler/translation/translation.cjs.map +1 -1
  118. package/dist/cjs/utils/intl.cjs +1 -1
  119. package/dist/cjs/utils/intl.cjs.map +1 -1
  120. package/dist/cjs/utils/localeStorage.cjs +1 -1
  121. package/dist/cjs/utils/localeStorage.cjs.map +1 -1
  122. package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs +1 -1
  123. package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs.map +1 -1
  124. package/dist/esm/formatters/list.mjs.map +1 -1
  125. package/dist/esm/getContent-DKqtIZGL.mjs +2 -0
  126. package/dist/esm/getContent-DKqtIZGL.mjs.map +1 -0
  127. package/dist/esm/html-3bo80xzx.mjs +2 -0
  128. package/dist/esm/html-3bo80xzx.mjs.map +1 -0
  129. package/dist/esm/index.mjs +1 -1
  130. package/dist/esm/interpreter/getContent/getContent.mjs +1 -2
  131. package/dist/esm/interpreter/getContent/index.mjs +1 -1
  132. package/dist/esm/interpreter/getContent/plugins.mjs +1 -2
  133. package/dist/esm/interpreter/getDictionary.mjs +1 -2
  134. package/dist/esm/interpreter/getIntlayer.mjs +1 -2
  135. package/dist/esm/interpreter/getNesting.mjs +1 -2
  136. package/dist/esm/interpreter/index.mjs +1 -1
  137. package/dist/esm/localization/getBrowserLocale.mjs +1 -1
  138. package/dist/esm/localization/getBrowserLocale.mjs.map +1 -1
  139. package/dist/esm/localization/getHTMLTextDir.mjs +1 -1
  140. package/dist/esm/localization/getHTMLTextDir.mjs.map +1 -1
  141. package/dist/esm/localization/localeMapper.mjs.map +1 -1
  142. package/dist/esm/messageFormat/ICU.mjs +1 -1
  143. package/dist/esm/messageFormat/ICU.mjs.map +1 -1
  144. package/dist/esm/messageFormat/i18next.mjs +1 -1
  145. package/dist/esm/messageFormat/i18next.mjs.map +1 -1
  146. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs +1 -2
  147. package/dist/esm/transpiler/html/html.mjs +1 -2
  148. package/dist/esm/transpiler/html/index.mjs +1 -1
  149. package/dist/esm/transpiler/index.mjs +1 -1
  150. package/dist/esm/transpiler/markdown/markdown.mjs +1 -1
  151. package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
  152. package/dist/esm/utils/intl.mjs +1 -1
  153. package/dist/esm/utils/intl.mjs.map +1 -1
  154. package/dist/types/ICU-tA3ZHN5U.d.ts +11 -0
  155. package/dist/types/ICU-tA3ZHN5U.d.ts.map +1 -0
  156. package/dist/types/checkIsURLAbsolute-CTf3JFU6.d.ts +5 -0
  157. package/dist/types/checkIsURLAbsolute-CTf3JFU6.d.ts.map +1 -0
  158. package/dist/types/compact-IHXcM4pT.d.ts +20 -0
  159. package/dist/types/compact-IHXcM4pT.d.ts.map +1 -0
  160. package/dist/types/compiler-DFiAsUdH.d.ts +9 -0
  161. package/dist/types/compiler-DFiAsUdH.d.ts.map +1 -0
  162. package/dist/types/condition-BDUtoh_1.d.ts +28 -0
  163. package/dist/types/condition-BDUtoh_1.d.ts.map +1 -0
  164. package/dist/types/constants-CI_D82B1.d.ts +177 -0
  165. package/dist/types/constants-CI_D82B1.d.ts.map +1 -0
  166. package/dist/types/currency-PbMCnHep.d.ts +20 -0
  167. package/dist/types/currency-PbMCnHep.d.ts.map +1 -0
  168. package/dist/types/date-C-PI8KqU.d.ts +20 -0
  169. package/dist/types/date-C-PI8KqU.d.ts.map +1 -0
  170. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +2 -50
  171. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +2 -42
  172. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +2 -34
  173. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts +2 -18
  174. package/dist/types/deepTransformPlugins/getMaskContent.d.ts +2 -10
  175. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts +2 -19
  176. package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts +2 -32
  177. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts +2 -8
  178. package/dist/types/deepTransformPlugins/getSplittedContent.d.ts +2 -43
  179. package/dist/types/deepTransformPlugins/index.d.ts +10 -10
  180. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts +2 -25
  181. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts +2 -8
  182. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts +2 -9
  183. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts +2 -9
  184. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts +2 -7
  185. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts +2 -7
  186. package/dist/types/dictionaryManipulator/getNodeType.d.ts +2 -8
  187. package/dist/types/dictionaryManipulator/index.d.ts +12 -12
  188. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts +2 -7
  189. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts +2 -9
  190. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +2 -15
  191. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts +2 -8
  192. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts +2 -8
  193. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts +2 -7
  194. package/dist/types/editDictionaryByKeyPath-BYIHcsyf.d.ts +8 -0
  195. package/dist/types/editDictionaryByKeyPath-BYIHcsyf.d.ts.map +1 -0
  196. package/dist/types/enumeration-CtuvB5Zz.d.ts +40 -0
  197. package/dist/types/enumeration-CtuvB5Zz.d.ts.map +1 -0
  198. package/dist/types/file-C3q8xvQb.d.ts +28 -0
  199. package/dist/types/file-C3q8xvQb.d.ts.map +1 -0
  200. package/dist/types/formatters/compact.d.ts +2 -20
  201. package/dist/types/formatters/currency.d.ts +2 -20
  202. package/dist/types/formatters/date.d.ts +2 -20
  203. package/dist/types/formatters/index.d.ts +10 -10
  204. package/dist/types/formatters/list.d.ts +2 -24
  205. package/dist/types/formatters/number.d.ts +2 -16
  206. package/dist/types/formatters/percentage.d.ts +2 -16
  207. package/dist/types/formatters/relativeTime.d.ts +2 -11
  208. package/dist/types/formatters/units.d.ts +2 -16
  209. package/dist/types/gender-Dd39Ijmf.d.ts +29 -0
  210. package/dist/types/gender-Dd39Ijmf.d.ts.map +1 -0
  211. package/dist/types/getBrowserLocale-RD_Mwv1t.d.ts +35 -0
  212. package/dist/types/getBrowserLocale-RD_Mwv1t.d.ts.map +1 -0
  213. package/dist/types/getContentNodeByKeyPath-B0Tdi5mj.d.ts +9 -0
  214. package/dist/types/getContentNodeByKeyPath-B0Tdi5mj.d.ts.map +1 -0
  215. package/dist/types/getCookie-DPOvVv_h.d.ts +11 -0
  216. package/dist/types/getCookie-DPOvVv_h.d.ts.map +1 -0
  217. package/dist/types/getDefaultNode-DQNsje2D.d.ts +9 -0
  218. package/dist/types/getDefaultNode-DQNsje2D.d.ts.map +1 -0
  219. package/dist/types/getEmptyNode-DW27TTBj.d.ts +7 -0
  220. package/dist/types/getEmptyNode-DW27TTBj.d.ts.map +1 -0
  221. package/dist/types/getFilterMissingTranslationsContent-CDNQqoy1.d.ts +50 -0
  222. package/dist/types/getFilterMissingTranslationsContent-CDNQqoy1.d.ts.map +1 -0
  223. package/dist/types/getFilterTranslationsOnlyContent-D2YgBkHn.d.ts +42 -0
  224. package/dist/types/getFilterTranslationsOnlyContent-D2YgBkHn.d.ts.map +1 -0
  225. package/dist/types/getFilteredLocalesContent-D0GP-uEg.d.ts +34 -0
  226. package/dist/types/getFilteredLocalesContent-D0GP-uEg.d.ts.map +1 -0
  227. package/dist/types/getHTML-CP6OXtdo.d.ts +32 -0
  228. package/dist/types/getHTML-CP6OXtdo.d.ts.map +1 -0
  229. package/dist/types/getHTMLTextDir-4Zh8J3x7.d.ts +21 -0
  230. package/dist/types/getHTMLTextDir-4Zh8J3x7.d.ts.map +1 -0
  231. package/dist/types/getInsertionValues-Cu9IdbuE.d.ts +5 -0
  232. package/dist/types/getInsertionValues-Cu9IdbuE.d.ts.map +1 -0
  233. package/dist/types/getLocale-B9dECUM_.d.ts +11 -0
  234. package/dist/types/getLocale-B9dECUM_.d.ts.map +1 -0
  235. package/dist/types/getLocaleFromPath-621W32QA.d.ts +26 -0
  236. package/dist/types/getLocaleFromPath-621W32QA.d.ts.map +1 -0
  237. package/dist/types/getLocaleLang-Bcan1gS4.d.ts +20 -0
  238. package/dist/types/getLocaleLang-Bcan1gS4.d.ts.map +1 -0
  239. package/dist/types/getLocaleName-CfRAD9Hc.d.ts +7 -0
  240. package/dist/types/getLocaleName-CfRAD9Hc.d.ts.map +1 -0
  241. package/dist/types/getLocalizedContent-DOncZd-0.d.ts +18 -0
  242. package/dist/types/getLocalizedContent-DOncZd-0.d.ts.map +1 -0
  243. package/dist/types/getLocalizedUrl-BbqeA3-W.d.ts +49 -0
  244. package/dist/types/getLocalizedUrl-BbqeA3-W.d.ts.map +1 -0
  245. package/dist/types/getMarkdownMetadata-Bf1S1NQ0.d.ts +5 -0
  246. package/dist/types/getMarkdownMetadata-Bf1S1NQ0.d.ts.map +1 -0
  247. package/dist/types/getMaskContent-BwLFqp7v.d.ts +10 -0
  248. package/dist/types/getMaskContent-BwLFqp7v.d.ts.map +1 -0
  249. package/dist/types/getMissingLocalesContent-BYffYcdx.d.ts +19 -0
  250. package/dist/types/getMissingLocalesContent-BYffYcdx.d.ts.map +1 -0
  251. package/dist/types/getMultilingualDictionary-DO3i1MFs.d.ts +32 -0
  252. package/dist/types/getMultilingualDictionary-DO3i1MFs.d.ts.map +1 -0
  253. package/dist/types/getMultilingualUrls-CUxYYfA4.d.ts +47 -0
  254. package/dist/types/getMultilingualUrls-CUxYYfA4.d.ts.map +1 -0
  255. package/dist/types/getNodeChildren-OT7Liqke.d.ts +7 -0
  256. package/dist/types/getNodeChildren-OT7Liqke.d.ts.map +1 -0
  257. package/dist/types/getNodeType-Cp765I26.d.ts +8 -0
  258. package/dist/types/getNodeType-Cp765I26.d.ts.map +1 -0
  259. package/dist/types/getPathWithoutLocale-B_aIR7O0.d.ts +31 -0
  260. package/dist/types/getPathWithoutLocale-B_aIR7O0.d.ts.map +1 -0
  261. package/dist/types/getPrefix-X9XKkrZD.d.ts +68 -0
  262. package/dist/types/getPrefix-X9XKkrZD.d.ts.map +1 -0
  263. package/dist/types/getReplacedValuesContent-BvL25pdt.d.ts +8 -0
  264. package/dist/types/getReplacedValuesContent-BvL25pdt.d.ts.map +1 -0
  265. package/dist/types/getSplittedContent-YD4JDMfB.d.ts +43 -0
  266. package/dist/types/getSplittedContent-YD4JDMfB.d.ts.map +1 -0
  267. package/dist/types/getStorageAttributes-CIO2xWqQ.d.ts +29 -0
  268. package/dist/types/getStorageAttributes-CIO2xWqQ.d.ts.map +1 -0
  269. package/dist/types/getStorageAttributes.d.ts +2 -29
  270. package/dist/types/getTranslation-BG2Wg-af.d.ts +30 -0
  271. package/dist/types/getTranslation-BG2Wg-af.d.ts.map +1 -0
  272. package/dist/types/html-Dn6KrpJ3.d.ts +25 -0
  273. package/dist/types/html-Dn6KrpJ3.d.ts.map +1 -0
  274. package/dist/types/htmlTags-YxTtVUx6.d.ts +115 -0
  275. package/dist/types/htmlTags-YxTtVUx6.d.ts.map +1 -0
  276. package/dist/types/i18next-qY0AixrB.d.ts +9 -0
  277. package/dist/types/i18next-qY0AixrB.d.ts.map +1 -0
  278. package/dist/types/index-1CTsSKEn.d.ts +1 -0
  279. package/dist/types/index-B8xF2zGo.d.ts +1 -0
  280. package/dist/types/index-BcsOTSQF.d.ts +1 -0
  281. package/dist/types/index-BnEeKNKW.d.ts +322 -0
  282. package/dist/types/index-BnEeKNKW.d.ts.map +1 -0
  283. package/dist/types/index-Cf8zm5QQ.d.ts +1 -0
  284. package/dist/types/index-CfvILin8.d.ts +1 -0
  285. package/dist/types/index-DK_kKFOF.d.ts +1 -0
  286. package/dist/types/index-DeJa0xZp.d.ts +1 -0
  287. package/dist/types/index-Vlqtiwjx.d.ts +1 -0
  288. package/dist/types/index.d.ts +80 -88
  289. package/dist/types/insertContentInDictionary-DZ3UzG4K.d.ts +25 -0
  290. package/dist/types/insertContentInDictionary-DZ3UzG4K.d.ts.map +1 -0
  291. package/dist/types/insertion-M5fwK-29.d.ts +23 -0
  292. package/dist/types/insertion-M5fwK-29.d.ts.map +1 -0
  293. package/dist/types/interpreter/getCondition.d.ts +2 -22
  294. package/dist/types/interpreter/getContent/deepTransform.d.ts +2 -12
  295. package/dist/types/interpreter/getContent/getContent.d.ts +2 -16
  296. package/dist/types/interpreter/getContent/index.d.ts +1 -3
  297. package/dist/types/interpreter/getContent/plugins.d.ts +2 -151
  298. package/dist/types/interpreter/getDictionary.d.ts +2 -17
  299. package/dist/types/interpreter/getEnumeration.d.ts +2 -58
  300. package/dist/types/interpreter/getGender.d.ts +1 -1
  301. package/dist/types/interpreter/getGender.d.ts.map +1 -1
  302. package/dist/types/interpreter/getHTML.d.ts +2 -32
  303. package/dist/types/interpreter/getInsertion.d.ts +1 -1
  304. package/dist/types/interpreter/getInsertion.d.ts.map +1 -1
  305. package/dist/types/interpreter/getIntlayer.d.ts +2 -8
  306. package/dist/types/interpreter/getNesting.d.ts +2 -27
  307. package/dist/types/interpreter/getTranslation.d.ts +2 -30
  308. package/dist/types/interpreter/index.d.ts +4 -11
  309. package/dist/types/interpreter/splitAndJoinInsertion.d.ts +2 -25
  310. package/dist/types/intl-B2Ap8I5x.d.ts +33 -0
  311. package/dist/types/intl-B2Ap8I5x.d.ts.map +1 -0
  312. package/dist/types/isSameKeyPath-CkH8NdJh.d.ts +7 -0
  313. package/dist/types/isSameKeyPath-CkH8NdJh.d.ts.map +1 -0
  314. package/dist/types/isValidReactElement-BsoJ01oP.d.ts +12 -0
  315. package/dist/types/isValidReactElement-BsoJ01oP.d.ts.map +1 -0
  316. package/dist/types/list-BdjJM2Gx.d.ts +30 -0
  317. package/dist/types/list-BdjJM2Gx.d.ts.map +1 -0
  318. package/dist/types/localeDetector-BWNCQRiZ.d.ts +18 -0
  319. package/dist/types/localeDetector-BWNCQRiZ.d.ts.map +1 -0
  320. package/dist/types/localeMapper-DoAnasqf.d.ts +92 -0
  321. package/dist/types/localeMapper-DoAnasqf.d.ts.map +1 -0
  322. package/dist/types/localeResolver-bb7AWQNX.d.ts +12 -0
  323. package/dist/types/localeResolver-bb7AWQNX.d.ts.map +1 -0
  324. package/dist/types/localeStorage-CZHwY0u3.d.ts +108 -0
  325. package/dist/types/localeStorage-CZHwY0u3.d.ts.map +1 -0
  326. package/dist/types/localization/getBrowserLocale.d.ts +2 -35
  327. package/dist/types/localization/getHTMLTextDir.d.ts +2 -21
  328. package/dist/types/localization/getLocale.d.ts +2 -11
  329. package/dist/types/localization/getLocaleFromPath.d.ts +2 -26
  330. package/dist/types/localization/getLocaleLang.d.ts +2 -20
  331. package/dist/types/localization/getLocaleName.d.ts +2 -7
  332. package/dist/types/localization/getLocalizedUrl.d.ts +2 -49
  333. package/dist/types/localization/getMultilingualUrls.d.ts +2 -47
  334. package/dist/types/localization/getPathWithoutLocale.d.ts +2 -31
  335. package/dist/types/localization/getPrefix.d.ts +2 -68
  336. package/dist/types/localization/index.d.ts +16 -16
  337. package/dist/types/localization/localeDetector.d.ts +2 -18
  338. package/dist/types/localization/localeMapper.d.ts +2 -92
  339. package/dist/types/localization/localeResolver.d.ts +2 -12
  340. package/dist/types/localization/rewriteUtils.d.ts +2 -34
  341. package/dist/types/localization/validatePrefix.d.ts +2 -38
  342. package/dist/types/markdown/compiler.d.ts +2 -9
  343. package/dist/types/markdown/constants.d.ts +2 -177
  344. package/dist/types/markdown/index.d.ts +10 -10
  345. package/dist/types/markdown/parser.d.ts +2 -16
  346. package/dist/types/markdown/renderer.d.ts +2 -22
  347. package/dist/types/markdown/types.d.ts +2 -333
  348. package/dist/types/markdown/utils.d.ts +2 -140
  349. package/dist/types/markdown-MzfikrI1.d.ts +26 -0
  350. package/dist/types/markdown-MzfikrI1.d.ts.map +1 -0
  351. package/dist/types/mergeDictionaries-D6WUMQN5.d.ts +7 -0
  352. package/dist/types/mergeDictionaries-D6WUMQN5.d.ts.map +1 -0
  353. package/dist/types/messageFormat/ICU.d.ts +2 -11
  354. package/dist/types/messageFormat/i18next.d.ts +2 -9
  355. package/dist/types/messageFormat/index.d.ts +3 -3
  356. package/dist/types/messageFormat/vue-i18n.d.ts +2 -9
  357. package/dist/types/normalizeDictionary-coviIGTW.d.ts +9 -0
  358. package/dist/types/normalizeDictionary-coviIGTW.d.ts.map +1 -0
  359. package/dist/types/number-C8izkCmU.d.ts +16 -0
  360. package/dist/types/number-C8izkCmU.d.ts.map +1 -0
  361. package/dist/types/orderDictionaries-SSCMY6qG.d.ts +15 -0
  362. package/dist/types/orderDictionaries-SSCMY6qG.d.ts.map +1 -0
  363. package/dist/types/parseYaml-D5gxutvA.d.ts +5 -0
  364. package/dist/types/parseYaml-D5gxutvA.d.ts.map +1 -0
  365. package/dist/types/parser-BVwR6Tjw.d.ts +16 -0
  366. package/dist/types/parser-BVwR6Tjw.d.ts.map +1 -0
  367. package/dist/types/percentage-BqsvW0Zw.d.ts +16 -0
  368. package/dist/types/percentage-BqsvW0Zw.d.ts.map +1 -0
  369. package/dist/types/relativeTime-mJaYEq7H.d.ts +11 -0
  370. package/dist/types/relativeTime-mJaYEq7H.d.ts.map +1 -0
  371. package/dist/types/removeContentNodeByKeyPath-CotCOOsD.d.ts +8 -0
  372. package/dist/types/removeContentNodeByKeyPath-CotCOOsD.d.ts.map +1 -0
  373. package/dist/types/renameContentNodeByKeyPath-BuyH5gOr.d.ts +8 -0
  374. package/dist/types/renameContentNodeByKeyPath-BuyH5gOr.d.ts.map +1 -0
  375. package/dist/types/renderer-C06x2Orf.d.ts +22 -0
  376. package/dist/types/renderer-C06x2Orf.d.ts.map +1 -0
  377. package/dist/types/rewriteUtils-Bd82NiGR.d.ts +34 -0
  378. package/dist/types/rewriteUtils-Bd82NiGR.d.ts.map +1 -0
  379. package/dist/types/splitAndJoinInsertion-bkuLa7o2.d.ts +25 -0
  380. package/dist/types/splitAndJoinInsertion-bkuLa7o2.d.ts.map +1 -0
  381. package/dist/types/translation-CiC-Avxc.d.ts +33 -0
  382. package/dist/types/translation-CiC-Avxc.d.ts.map +1 -0
  383. package/dist/types/transpiler/condition/condition.d.ts +2 -28
  384. package/dist/types/transpiler/condition/index.d.ts +1 -1
  385. package/dist/types/transpiler/enumeration/enumeration.d.ts +2 -40
  386. package/dist/types/transpiler/enumeration/index.d.ts +1 -1
  387. package/dist/types/transpiler/file/file.d.ts +2 -28
  388. package/dist/types/transpiler/file/fileBrowser.d.ts +1 -1
  389. package/dist/types/transpiler/file/index.d.ts +1 -1
  390. package/dist/types/transpiler/gender/gender.d.ts +2 -29
  391. package/dist/types/transpiler/gender/index.d.ts +1 -1
  392. package/dist/types/transpiler/html/html.d.ts +2 -25
  393. package/dist/types/transpiler/html/htmlTags.d.ts +2 -115
  394. package/dist/types/transpiler/html/index.d.ts +3 -3
  395. package/dist/types/transpiler/html/validateHTML.d.ts +2 -21
  396. package/dist/types/transpiler/index.d.ts +15 -15
  397. package/dist/types/transpiler/insertion/getInsertionValues.d.ts +2 -5
  398. package/dist/types/transpiler/insertion/index.d.ts +2 -2
  399. package/dist/types/transpiler/insertion/insertion.d.ts +2 -23
  400. package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts +2 -5
  401. package/dist/types/transpiler/markdown/index.d.ts +4 -4
  402. package/dist/types/transpiler/markdown/markdown.d.ts +2 -26
  403. package/dist/types/transpiler/markdown/validateMarkdown.d.ts +3 -18
  404. package/dist/types/transpiler/nesting/index.d.ts +1 -1
  405. package/dist/types/transpiler/nesting/nesting.d.ts +2 -49
  406. package/dist/types/transpiler/translation/index.d.ts +1 -1
  407. package/dist/types/transpiler/translation/translation.d.ts +2 -33
  408. package/dist/types/types-C2Om0aEM.d.ts +333 -0
  409. package/dist/types/types-C2Om0aEM.d.ts.map +1 -0
  410. package/dist/types/units-CouGqa8j.d.ts +16 -0
  411. package/dist/types/units-CouGqa8j.d.ts.map +1 -0
  412. package/dist/types/updateNodeChildren-B5Tu1UBZ.d.ts +7 -0
  413. package/dist/types/updateNodeChildren-B5Tu1UBZ.d.ts.map +1 -0
  414. package/dist/types/utils/checkIsURLAbsolute.d.ts +2 -5
  415. package/dist/types/utils/getCookie.d.ts +2 -11
  416. package/dist/types/utils/index.d.ts +8 -8
  417. package/dist/types/utils/intl.d.ts +2 -33
  418. package/dist/types/utils/isSameKeyPath.d.ts +2 -7
  419. package/dist/types/utils/isValidReactElement.d.ts +2 -12
  420. package/dist/types/utils/localeStorage.d.ts +2 -108
  421. package/dist/types/utils/parseYaml.d.ts +2 -5
  422. package/dist/types/utils-Dcmgh_80.d.ts +140 -0
  423. package/dist/types/utils-Dcmgh_80.d.ts.map +1 -0
  424. package/dist/types/validateHTML-U7UKTtFd.d.ts +21 -0
  425. package/dist/types/validateHTML-U7UKTtFd.d.ts.map +1 -0
  426. package/dist/types/validateMarkdown-BUaTDDIu.d.ts +18 -0
  427. package/dist/types/validateMarkdown-BUaTDDIu.d.ts.map +1 -0
  428. package/dist/types/validatePrefix-Dtmg7QLq.d.ts +38 -0
  429. package/dist/types/validatePrefix-Dtmg7QLq.d.ts.map +1 -0
  430. package/dist/types/vue-i18n-JtUB7N_m.d.ts +9 -0
  431. package/dist/types/vue-i18n-JtUB7N_m.d.ts.map +1 -0
  432. package/package.json +6 -6
  433. package/dist/cjs/interpreter/getContent/getContent.cjs.map +0 -1
  434. package/dist/cjs/interpreter/getContent/plugins.cjs.map +0 -1
  435. package/dist/cjs/interpreter/getDictionary.cjs.map +0 -1
  436. package/dist/cjs/interpreter/getIntlayer.cjs.map +0 -1
  437. package/dist/cjs/interpreter/getNesting.cjs.map +0 -1
  438. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs.map +0 -1
  439. package/dist/cjs/transpiler/html/html.cjs.map +0 -1
  440. package/dist/esm/interpreter/getContent/getContent.mjs.map +0 -1
  441. package/dist/esm/interpreter/getContent/plugins.mjs.map +0 -1
  442. package/dist/esm/interpreter/getDictionary.mjs.map +0 -1
  443. package/dist/esm/interpreter/getIntlayer.mjs.map +0 -1
  444. package/dist/esm/interpreter/getNesting.mjs.map +0 -1
  445. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs.map +0 -1
  446. package/dist/esm/transpiler/html/html.mjs.map +0 -1
  447. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +0 -1
  448. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +0 -1
  449. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +0 -1
  450. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts.map +0 -1
  451. package/dist/types/deepTransformPlugins/getMaskContent.d.ts.map +0 -1
  452. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts.map +0 -1
  453. package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts.map +0 -1
  454. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts.map +0 -1
  455. package/dist/types/deepTransformPlugins/getSplittedContent.d.ts.map +0 -1
  456. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts.map +0 -1
  457. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts.map +0 -1
  458. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts.map +0 -1
  459. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts.map +0 -1
  460. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts.map +0 -1
  461. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +0 -1
  462. package/dist/types/dictionaryManipulator/getNodeType.d.ts.map +0 -1
  463. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts.map +0 -1
  464. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts.map +0 -1
  465. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +0 -1
  466. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts.map +0 -1
  467. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts.map +0 -1
  468. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts.map +0 -1
  469. package/dist/types/formatters/compact.d.ts.map +0 -1
  470. package/dist/types/formatters/currency.d.ts.map +0 -1
  471. package/dist/types/formatters/date.d.ts.map +0 -1
  472. package/dist/types/formatters/list.d.ts.map +0 -1
  473. package/dist/types/formatters/number.d.ts.map +0 -1
  474. package/dist/types/formatters/percentage.d.ts.map +0 -1
  475. package/dist/types/formatters/relativeTime.d.ts.map +0 -1
  476. package/dist/types/formatters/units.d.ts.map +0 -1
  477. package/dist/types/getStorageAttributes.d.ts.map +0 -1
  478. package/dist/types/interpreter/getCondition.d.ts.map +0 -1
  479. package/dist/types/interpreter/getContent/deepTransform.d.ts.map +0 -1
  480. package/dist/types/interpreter/getContent/getContent.d.ts.map +0 -1
  481. package/dist/types/interpreter/getContent/plugins.d.ts.map +0 -1
  482. package/dist/types/interpreter/getDictionary.d.ts.map +0 -1
  483. package/dist/types/interpreter/getEnumeration.d.ts.map +0 -1
  484. package/dist/types/interpreter/getHTML.d.ts.map +0 -1
  485. package/dist/types/interpreter/getIntlayer.d.ts.map +0 -1
  486. package/dist/types/interpreter/getNesting.d.ts.map +0 -1
  487. package/dist/types/interpreter/getTranslation.d.ts.map +0 -1
  488. package/dist/types/interpreter/splitAndJoinInsertion.d.ts.map +0 -1
  489. package/dist/types/localization/getBrowserLocale.d.ts.map +0 -1
  490. package/dist/types/localization/getHTMLTextDir.d.ts.map +0 -1
  491. package/dist/types/localization/getLocale.d.ts.map +0 -1
  492. package/dist/types/localization/getLocaleFromPath.d.ts.map +0 -1
  493. package/dist/types/localization/getLocaleLang.d.ts.map +0 -1
  494. package/dist/types/localization/getLocaleName.d.ts.map +0 -1
  495. package/dist/types/localization/getLocalizedUrl.d.ts.map +0 -1
  496. package/dist/types/localization/getMultilingualUrls.d.ts.map +0 -1
  497. package/dist/types/localization/getPathWithoutLocale.d.ts.map +0 -1
  498. package/dist/types/localization/getPrefix.d.ts.map +0 -1
  499. package/dist/types/localization/localeDetector.d.ts.map +0 -1
  500. package/dist/types/localization/localeMapper.d.ts.map +0 -1
  501. package/dist/types/localization/localeResolver.d.ts.map +0 -1
  502. package/dist/types/localization/rewriteUtils.d.ts.map +0 -1
  503. package/dist/types/localization/validatePrefix.d.ts.map +0 -1
  504. package/dist/types/markdown/compiler.d.ts.map +0 -1
  505. package/dist/types/markdown/constants.d.ts.map +0 -1
  506. package/dist/types/markdown/parser.d.ts.map +0 -1
  507. package/dist/types/markdown/renderer.d.ts.map +0 -1
  508. package/dist/types/markdown/types.d.ts.map +0 -1
  509. package/dist/types/markdown/utils.d.ts.map +0 -1
  510. package/dist/types/messageFormat/ICU.d.ts.map +0 -1
  511. package/dist/types/messageFormat/i18next.d.ts.map +0 -1
  512. package/dist/types/messageFormat/vue-i18n.d.ts.map +0 -1
  513. package/dist/types/transpiler/condition/condition.d.ts.map +0 -1
  514. package/dist/types/transpiler/enumeration/enumeration.d.ts.map +0 -1
  515. package/dist/types/transpiler/file/file.d.ts.map +0 -1
  516. package/dist/types/transpiler/gender/gender.d.ts.map +0 -1
  517. package/dist/types/transpiler/html/html.d.ts.map +0 -1
  518. package/dist/types/transpiler/html/htmlTags.d.ts.map +0 -1
  519. package/dist/types/transpiler/html/validateHTML.d.ts.map +0 -1
  520. package/dist/types/transpiler/insertion/getInsertionValues.d.ts.map +0 -1
  521. package/dist/types/transpiler/insertion/insertion.d.ts.map +0 -1
  522. package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts.map +0 -1
  523. package/dist/types/transpiler/markdown/markdown.d.ts.map +0 -1
  524. package/dist/types/transpiler/markdown/validateMarkdown.d.ts.map +0 -1
  525. package/dist/types/transpiler/nesting/nesting.d.ts.map +0 -1
  526. package/dist/types/transpiler/translation/translation.d.ts.map +0 -1
  527. package/dist/types/utils/checkIsURLAbsolute.d.ts.map +0 -1
  528. package/dist/types/utils/getCookie.d.ts.map +0 -1
  529. package/dist/types/utils/intl.d.ts.map +0 -1
  530. package/dist/types/utils/isSameKeyPath.d.ts.map +0 -1
  531. package/dist/types/utils/isValidReactElement.d.ts.map +0 -1
  532. package/dist/types/utils/localeStorage.d.ts.map +0 -1
  533. package/dist/types/utils/parseYaml.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"getNodeType.cjs","names":["NodeType","isValidElement"],"sources":["../../../src/dictionaryManipulator/getNodeType.ts"],"sourcesContent":["import type { ContentNode, TypedNode } from '@intlayer/types/dictionary';;\nimport { NodeType } from '@intlayer/types/nodeType';\nimport { isValidElement } from '../utils/isValidReactElement';\n\n/**\n * Type guard to check if content is a TypedNode\n */\nconst isTypedNode = (content: unknown): content is TypedNode => {\n return (\n typeof content === 'object' &&\n content !== null &&\n 'nodeType' in content &&\n typeof (content as TypedNode).nodeType === 'string'\n );\n};\n\n/**\n * Type guard to check if content is a valid NodeType\n */\nconst isValidNodeType = (nodeType: string): nodeType is NodeType => {\n return Object.values(NodeType).includes(nodeType as NodeType);\n};\n\nexport const getNodeType = (content: ContentNode): NodeType => {\n if (typeof content === 'string') {\n return NodeType.Text;\n }\n\n if (isTypedNode(content)) {\n const nodeType = content.nodeType;\n if (isValidNodeType(nodeType)) {\n return nodeType;\n }\n // Fallback for unknown node types\n return NodeType.Unknown;\n }\n\n if (Array.isArray(content)) {\n return NodeType.Array;\n }\n\n if (isValidElement(content)) {\n return NodeType.ReactNode;\n }\n\n if (typeof content === 'number') {\n return NodeType.Number;\n }\n\n if (typeof content === 'boolean') {\n return NodeType.Boolean;\n }\n\n if (content && typeof content === 'object') {\n return NodeType.Object;\n }\n\n if (content === null) {\n return NodeType.Null;\n }\n\n return NodeType.Unknown;\n};\n"],"mappings":"8MAOA,MAAM,EAAe,GAEjB,OAAO,GAAY,YACnB,GACA,aAAc,GACd,OAAQ,EAAsB,UAAa,SAOzC,EAAmB,GAChB,OAAO,OAAOA,EAAAA,SAAS,CAAC,SAAS,EAAqB,CAGlD,EAAe,GAAmC,CAC7D,GAAI,OAAO,GAAY,SACrB,OAAOA,EAAAA,SAAS,KAGlB,GAAI,EAAY,EAAQ,CAAE,CACxB,IAAM,EAAW,EAAQ,SAKzB,OAJI,EAAgB,EAAS,CACpB,EAGFA,EAAAA,SAAS,QA2BlB,OAxBI,MAAM,QAAQ,EAAQ,CACjBA,EAAAA,SAAS,MAGdC,EAAAA,eAAe,EAAQ,CAClBD,EAAAA,SAAS,UAGd,OAAO,GAAY,SACdA,EAAAA,SAAS,OAGd,OAAO,GAAY,UACdA,EAAAA,SAAS,QAGd,GAAW,OAAO,GAAY,SACzBA,EAAAA,SAAS,OAGd,IAAY,KACPA,EAAAA,SAAS,KAGXA,EAAAA,SAAS"}
1
+ {"version":3,"file":"getNodeType.cjs","names":["NodeType","isValidElement"],"sources":["../../../src/dictionaryManipulator/getNodeType.ts"],"sourcesContent":["import type { ContentNode, TypedNode } from '@intlayer/types/dictionary';;\nimport { NodeType } from '@intlayer/types/nodeType';\nimport { isValidElement } from '../utils/isValidReactElement';\n\n/**\n * Type guard to check if content is a TypedNode\n */\nconst isTypedNode = (content: unknown): content is TypedNode => {\n return (\n typeof content === 'object' &&\n content !== null &&\n 'nodeType' in content &&\n typeof (content as TypedNode).nodeType === 'string'\n );\n};\n\n/**\n * Type guard to check if content is a valid NodeType\n */\nconst isValidNodeType = (nodeType: string): nodeType is NodeType => {\n return Object.values(NodeType).includes(nodeType as NodeType);\n};\n\nexport const getNodeType = (content: ContentNode): NodeType => {\n if (typeof content === 'string') {\n return NodeType.Text;\n }\n\n if (isTypedNode(content)) {\n const nodeType = content.nodeType;\n if (isValidNodeType(nodeType)) {\n return nodeType;\n }\n // Fallback for unknown node types\n return NodeType.Unknown;\n }\n\n if (Array.isArray(content)) {\n return NodeType.Array;\n }\n\n if (isValidElement(content)) {\n return NodeType.ReactNode;\n }\n\n if (typeof content === 'number') {\n return NodeType.Number;\n }\n\n if (typeof content === 'boolean') {\n return NodeType.Boolean;\n }\n\n if (content && typeof content === 'object') {\n return NodeType.Object;\n }\n\n if (content === null) {\n return NodeType.Null;\n }\n\n return NodeType.Unknown;\n};\n"],"mappings":"kMAOA,MAAM,EAAe,GAEjB,OAAO,GAAY,YACnB,GACA,aAAc,GACd,OAAQ,EAAsB,UAAa,SAOzC,EAAmB,GAChB,OAAO,OAAOA,EAAAA,SAAS,CAAC,SAAS,EAAqB,CAGlD,EAAe,GAAmC,CAC7D,GAAI,OAAO,GAAY,SACrB,OAAOA,EAAAA,SAAS,KAGlB,GAAI,EAAY,EAAQ,CAAE,CACxB,IAAM,EAAW,EAAQ,SAKzB,OAJI,EAAgB,EAAS,CACpB,EAGFA,EAAAA,SAAS,QA2BlB,OAxBI,MAAM,QAAQ,EAAQ,CACjBA,EAAAA,SAAS,MAGdC,EAAAA,eAAe,EAAQ,CAClBD,EAAAA,SAAS,UAGd,OAAO,GAAY,SACdA,EAAAA,SAAS,OAGd,OAAO,GAAY,UACdA,EAAAA,SAAS,QAGd,GAAW,OAAO,GAAY,SACzBA,EAAAA,SAAS,OAGd,IAAY,KACPA,EAAAA,SAAS,KAGXA,EAAAA,SAAS"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../deepTransformPlugins/getMultilingualDictionary.cjs`),n=require(`./getNodeType.cjs`);let r=require(`@intlayer/config/built`);r=e.__toESM(r);let i=require(`@intlayer/config/logger`);const a=(e,t,a,o,s=[])=>{let c=(0,i.getAppLogger)(r.default);if(e==null||t==null)return;let l=n.getNodeType(e),u=n.getNodeType(t);if(!(l===`unknown`||u===`unknown`)&&l!==u){c([`Error: Dictionary ${(0,i.colorizeKey)(o)} has a multiple content files with type mismatch at path "${s.join(`.`)}": Cannot merge ${l} with ${u} while merging ${a}`],{level:`error`});return}},o=(e,t)=>{if(e==null)return t;if(t==null||typeof e!=`object`||typeof t!=`object`)return e;if(Array.isArray(e)&&Array.isArray(t))return s(e,t);if(typeof e==`object`&&typeof t==`object`){let n={},r=new Set([...Object.keys(e),...Object.keys(t)]);for(let i of r)n[i]=o(e[i],t[i]);return n}return e},s=(e,t)=>{let n=e.every(e=>typeof e!=`object`||!e),r=t.every(e=>typeof e!=`object`||!e);if(n&&r)return t;let i=[],a=Math.max(e.length,t.length);for(let n=0;n<a;n++){let r=e[n],a=t[n];r===void 0&&a===void 0||(r===void 0?i.push(a):a===void 0?i.push(r):typeof r==`object`&&typeof a==`object`&&r!==null&&a!==null?(`key`in r&&`key`in a&&(r.key,a.key),i.push(o(r,a))):i.push(r))}return i},c=e=>{let n=Array.from(new Set(e.filter(e=>e.localId).map(e=>e.localId))),r=e.map(e=>e.key);if(new Set(r).size!==1)throw Error(`All dictionaries must have the same key`);let i=e[0].content;for(let n=1;n<e.length;n++){let r=t.getMultilingualDictionary(e[n]);a(i,r.content,r.localId,r.key,[]),i=o(i,r.content)}return{key:e[0].key,content:i,localIds:n}};exports.mergeDictionaries=c;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../deepTransformPlugins/getMultilingualDictionary.cjs`),n=require(`./getNodeType.cjs`);let r=require(`@intlayer/config/built`);r=e.t(r);let i=require(`@intlayer/config/logger`);const a=(e,t,a,o,s=[])=>{let c=(0,i.getAppLogger)(r.default);if(e==null||t==null)return;let l=n.getNodeType(e),u=n.getNodeType(t);if(!(l===`unknown`||u===`unknown`)&&l!==u){c([`Error: Dictionary ${(0,i.colorizeKey)(o)} has a multiple content files with type mismatch at path "${s.join(`.`)}": Cannot merge ${l} with ${u} while merging ${a}`],{level:`error`});return}},o=(e,t)=>{if(e==null)return t;if(t==null||typeof e!=`object`||typeof t!=`object`)return e;if(Array.isArray(e)&&Array.isArray(t))return s(e,t);if(typeof e==`object`&&typeof t==`object`){let n={},r=new Set([...Object.keys(e),...Object.keys(t)]);for(let i of r)n[i]=o(e[i],t[i]);return n}return e},s=(e,t)=>{let n=e.every(e=>typeof e!=`object`||!e),r=t.every(e=>typeof e!=`object`||!e);if(n&&r)return t;let i=[],a=Math.max(e.length,t.length);for(let n=0;n<a;n++){let r=e[n],a=t[n];r===void 0&&a===void 0||(r===void 0?i.push(a):a===void 0?i.push(r):typeof r==`object`&&typeof a==`object`&&r!==null&&a!==null?(`key`in r&&`key`in a&&(r.key,a.key),i.push(o(r,a))):i.push(r))}return i},c=e=>{let n=Array.from(new Set(e.filter(e=>e.localId).map(e=>e.localId))),r=e.map(e=>e.key);if(new Set(r).size!==1)throw Error(`All dictionaries must have the same key`);let i=e[0].content;for(let n=1;n<e.length;n++){let r=t.getMultilingualDictionary(e[n]);a(i,r.content,r.localId,r.key,[]),i=o(i,r.content)}return{key:e[0].key,content:i,localIds:n}};exports.mergeDictionaries=c;
2
2
  //# sourceMappingURL=mergeDictionaries.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeDictionaries.cjs","names":["configuration","getNodeType","getMultilingualDictionary"],"sources":["../../../src/dictionaryManipulator/mergeDictionaries.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { colorizeKey, getAppLogger } from '@intlayer/config/logger';\nimport type { ContentNode, Dictionary, LocalDictionaryId } from '@intlayer/types/dictionary';\nimport { getMultilingualDictionary } from '../deepTransformPlugins';\nimport { getNodeType } from './getNodeType';\n\n// Extended type that includes arrays for internal merge operations\ntype MergeableContent = ContentNode | ContentNode[];\n\nconst checkTypesMatch = (\n object1: ContentNode,\n object2: ContentNode,\n object2LocalId: LocalDictionaryId | undefined,\n dictionaryKey: string,\n path: string[] = []\n): void => {\n const appLogger = getAppLogger(configuration);\n\n // If either side is missing/undefined, allow merge without error\n if (\n object1 === undefined ||\n object1 === null ||\n object2 === undefined ||\n object2 === null\n )\n return;\n\n const type1 = getNodeType(object1);\n const type2 = getNodeType(object2);\n\n // Unknown types are treated as flexible; skip strict mismatch reporting\n if (type1 === 'unknown' || type2 === 'unknown') return;\n\n if (type1 !== type2) {\n appLogger(\n [\n `Error: Dictionary ${colorizeKey(dictionaryKey)} has a multiple content files with type mismatch at path \"${path.join('.')}\": Cannot merge ${type1} with ${type2} while merging ${object2LocalId}`,\n ],\n {\n level: 'error',\n }\n );\n\n return;\n }\n};\n\n// Custom merge function that prefers destination (first dictionary) values\nconst customMerge = (\n destination: ContentNode,\n source: ContentNode\n): MergeableContent => {\n // If destination is undefined/null, use source\n if (destination === undefined || destination === null) {\n return source;\n }\n\n // If source is undefined/null, use destination\n if (source === undefined || source === null) {\n return destination;\n }\n\n // For primitive values, prefer destination (first dictionary)\n if (typeof destination !== 'object' || typeof source !== 'object') {\n return destination;\n }\n\n // For arrays, use our custom array merge\n if (Array.isArray(destination) && Array.isArray(source)) {\n return arrayMerge(\n destination as ContentNode[],\n source as ContentNode[]\n ) as MergeableContent;\n }\n\n // For objects, recursively merge with our custom logic\n if (typeof destination === 'object' && typeof source === 'object') {\n const result: Record<string, MergeableContent> = {};\n const allKeys = new Set([\n ...Object.keys(destination as unknown as Record<string, ContentNode>),\n ...Object.keys(source as unknown as Record<string, ContentNode>),\n ]);\n\n for (const key of allKeys) {\n result[key] = customMerge(\n (destination as unknown as Record<string, ContentNode>)[key],\n (source as unknown as Record<string, ContentNode>)[key]\n );\n }\n\n return result as unknown as MergeableContent;\n }\n\n // Fallback to destination\n return destination;\n};\n\n// Custom array merge strategy that merges arrays by key when present, otherwise by index\nconst arrayMerge = (\n destinationArray: ContentNode[],\n sourceArray: ContentNode[]\n): MergeableContent[] => {\n // Check if both arrays contain only primitives\n const destHasOnlyPrimitives = destinationArray.every(\n (item) => typeof item !== 'object' || item === null\n );\n const sourceHasOnlyPrimitives = sourceArray.every(\n (item) => typeof item !== 'object' || item === null\n );\n\n // If both arrays contain only primitives, use the source array (second dictionary)\n if (destHasOnlyPrimitives && sourceHasOnlyPrimitives) {\n return sourceArray;\n }\n\n // Otherwise, merge by index with object merging logic\n const result: MergeableContent[] = [];\n const maxLength = Math.max(destinationArray.length, sourceArray.length);\n\n for (let i = 0; i < maxLength; i++) {\n const destItem = destinationArray[i];\n const sourceItem = sourceArray[i];\n\n if (destItem === undefined && sourceItem === undefined) {\n } else if (destItem === undefined) {\n // Only source exists, add it\n result.push(sourceItem);\n } else if (sourceItem === undefined) {\n // Only destination exists, add it\n result.push(destItem);\n } else {\n // Both exist, merge them\n if (\n typeof destItem === 'object' &&\n typeof sourceItem === 'object' &&\n destItem !== null &&\n sourceItem !== null\n ) {\n // Check if both objects have a 'key' property for keyed merging\n if (\n 'key' in destItem &&\n 'key' in sourceItem &&\n (destItem as Record<string, string>).key ===\n (sourceItem as Record<string, string>).key\n ) {\n // Merge objects with same key, preferring destination (first dictionary) values\n result.push(customMerge(destItem, sourceItem));\n } else {\n // Merge objects by index, preferring destination (first dictionary) values\n result.push(customMerge(destItem, sourceItem));\n }\n } else {\n // For primitives or non-objects, use destination value (first dictionary)\n result.push(destItem);\n }\n }\n }\n\n return result;\n};\n\nexport const mergeDictionaries = (dictionaries: Dictionary[]): Dictionary => {\n const localIds = Array.from(\n new Set<LocalDictionaryId>(\n dictionaries.filter((dict) => dict.localId).map((dict) => dict.localId!)\n )\n );\n\n const dictionariesKeys = dictionaries.map((dict) => dict.key);\n\n // Check if all dictionaries have the same key\n if (new Set(dictionariesKeys).size !== 1) {\n throw new Error('All dictionaries must have the same key');\n }\n\n let mergedContent: Dictionary['content'] = dictionaries[0].content;\n\n for (let i = 1; i < dictionaries.length; i++) {\n // If the dictionary is a per-locale dictionary, transform it to a partial multilingual dictionary\n const currentDictionary = getMultilingualDictionary(dictionaries[i]);\n\n // Check types before merging\n checkTypesMatch(\n mergedContent,\n currentDictionary.content,\n currentDictionary.localId,\n currentDictionary.key,\n []\n );\n\n mergedContent = customMerge(\n mergedContent,\n currentDictionary.content\n ) as ContentNode;\n }\n\n const mergedDictionary: Dictionary = {\n key: dictionaries[0].key,\n content: mergedContent,\n localIds,\n };\n\n return mergedDictionary;\n};\n"],"mappings":"0TASA,MAAM,GACJ,EACA,EACA,EACA,EACA,EAAiB,EAAE,GACV,CACT,IAAM,GAAA,EAAA,EAAA,cAAyBA,EAAAA,QAAc,CAG7C,GACE,GACY,MACZ,GACY,KAEZ,OAEF,IAAM,EAAQC,EAAAA,YAAY,EAAQ,CAC5B,EAAQA,EAAAA,YAAY,EAAQ,CAG9B,SAAU,WAAa,IAAU,YAEjC,IAAU,EAAO,CACnB,EACE,CACE,sBAAA,EAAA,EAAA,aAAiC,EAAc,CAAC,4DAA4D,EAAK,KAAK,IAAI,CAAC,kBAAkB,EAAM,QAAQ,EAAM,iBAAiB,IACnL,CACD,CACE,MAAO,QACR,CACF,CAED,SAKE,GACJ,EACA,IACqB,CAErB,GAAI,GAA6C,KAC/C,OAAO,EAST,GALI,GAAmC,MAKnC,OAAO,GAAgB,UAAY,OAAO,GAAW,SACvD,OAAO,EAIT,GAAI,MAAM,QAAQ,EAAY,EAAI,MAAM,QAAQ,EAAO,CACrD,OAAO,EACL,EACA,EACD,CAIH,GAAI,OAAO,GAAgB,UAAY,OAAO,GAAW,SAAU,CACjE,IAAM,EAA2C,EAAE,CAC7C,EAAU,IAAI,IAAI,CACtB,GAAG,OAAO,KAAK,EAAsD,CACrE,GAAG,OAAO,KAAK,EAAiD,CACjE,CAAC,CAEF,IAAK,IAAM,KAAO,EAChB,EAAO,GAAO,EACX,EAAuD,GACvD,EAAkD,GACpD,CAGH,OAAO,EAIT,OAAO,GAIH,GACJ,EACA,IACuB,CAEvB,IAAM,EAAwB,EAAiB,MAC5C,GAAS,OAAO,GAAS,WAAY,EACvC,CACK,EAA0B,EAAY,MACzC,GAAS,OAAO,GAAS,WAAY,EACvC,CAGD,GAAI,GAAyB,EAC3B,OAAO,EAIT,IAAM,EAA6B,EAAE,CAC/B,EAAY,KAAK,IAAI,EAAiB,OAAQ,EAAY,OAAO,CAEvE,IAAK,IAAI,EAAI,EAAG,EAAI,EAAW,IAAK,CAClC,IAAM,EAAW,EAAiB,GAC5B,EAAa,EAAY,GAE3B,IAAa,IAAA,IAAa,IAAe,IAAA,KAClC,IAAa,IAAA,GAEtB,EAAO,KAAK,EAAW,CACd,IAAe,IAAA,GAExB,EAAO,KAAK,EAAS,CAInB,OAAO,GAAa,UACpB,OAAO,GAAe,UACtB,IAAa,MACb,IAAe,MAIb,QAAS,GACT,QAAS,IACR,EAAoC,IAClC,EAAsC,KAGzC,EAAO,KAAK,EAAY,EAAU,EAAW,CAAC,EAOhD,EAAO,KAAK,EAAS,EAK3B,OAAO,GAGI,EAAqB,GAA2C,CAC3E,IAAM,EAAW,MAAM,KACrB,IAAI,IACF,EAAa,OAAQ,GAAS,EAAK,QAAQ,CAAC,IAAK,GAAS,EAAK,QAAS,CACzE,CACF,CAEK,EAAmB,EAAa,IAAK,GAAS,EAAK,IAAI,CAG7D,GAAI,IAAI,IAAI,EAAiB,CAAC,OAAS,EACrC,MAAU,MAAM,0CAA0C,CAG5D,IAAI,EAAuC,EAAa,GAAG,QAE3D,IAAK,IAAI,EAAI,EAAG,EAAI,EAAa,OAAQ,IAAK,CAE5C,IAAM,EAAoBC,EAAAA,0BAA0B,EAAa,GAAG,CAGpE,EACE,EACA,EAAkB,QAClB,EAAkB,QAClB,EAAkB,IAClB,EAAE,CACH,CAED,EAAgB,EACd,EACA,EAAkB,QACnB,CASH,MANqC,CACnC,IAAK,EAAa,GAAG,IACrB,QAAS,EACT,WACD"}
1
+ {"version":3,"file":"mergeDictionaries.cjs","names":["configuration","getNodeType","getMultilingualDictionary"],"sources":["../../../src/dictionaryManipulator/mergeDictionaries.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { colorizeKey, getAppLogger } from '@intlayer/config/logger';\nimport type { ContentNode, Dictionary, LocalDictionaryId } from '@intlayer/types/dictionary';\nimport { getMultilingualDictionary } from '../deepTransformPlugins';\nimport { getNodeType } from './getNodeType';\n\n// Extended type that includes arrays for internal merge operations\ntype MergeableContent = ContentNode | ContentNode[];\n\nconst checkTypesMatch = (\n object1: ContentNode,\n object2: ContentNode,\n object2LocalId: LocalDictionaryId | undefined,\n dictionaryKey: string,\n path: string[] = []\n): void => {\n const appLogger = getAppLogger(configuration);\n\n // If either side is missing/undefined, allow merge without error\n if (\n object1 === undefined ||\n object1 === null ||\n object2 === undefined ||\n object2 === null\n )\n return;\n\n const type1 = getNodeType(object1);\n const type2 = getNodeType(object2);\n\n // Unknown types are treated as flexible; skip strict mismatch reporting\n if (type1 === 'unknown' || type2 === 'unknown') return;\n\n if (type1 !== type2) {\n appLogger(\n [\n `Error: Dictionary ${colorizeKey(dictionaryKey)} has a multiple content files with type mismatch at path \"${path.join('.')}\": Cannot merge ${type1} with ${type2} while merging ${object2LocalId}`,\n ],\n {\n level: 'error',\n }\n );\n\n return;\n }\n};\n\n// Custom merge function that prefers destination (first dictionary) values\nconst customMerge = (\n destination: ContentNode,\n source: ContentNode\n): MergeableContent => {\n // If destination is undefined/null, use source\n if (destination === undefined || destination === null) {\n return source;\n }\n\n // If source is undefined/null, use destination\n if (source === undefined || source === null) {\n return destination;\n }\n\n // For primitive values, prefer destination (first dictionary)\n if (typeof destination !== 'object' || typeof source !== 'object') {\n return destination;\n }\n\n // For arrays, use our custom array merge\n if (Array.isArray(destination) && Array.isArray(source)) {\n return arrayMerge(\n destination as ContentNode[],\n source as ContentNode[]\n ) as MergeableContent;\n }\n\n // For objects, recursively merge with our custom logic\n if (typeof destination === 'object' && typeof source === 'object') {\n const result: Record<string, MergeableContent> = {};\n const allKeys = new Set([\n ...Object.keys(destination as unknown as Record<string, ContentNode>),\n ...Object.keys(source as unknown as Record<string, ContentNode>),\n ]);\n\n for (const key of allKeys) {\n result[key] = customMerge(\n (destination as unknown as Record<string, ContentNode>)[key],\n (source as unknown as Record<string, ContentNode>)[key]\n );\n }\n\n return result as unknown as MergeableContent;\n }\n\n // Fallback to destination\n return destination;\n};\n\n// Custom array merge strategy that merges arrays by key when present, otherwise by index\nconst arrayMerge = (\n destinationArray: ContentNode[],\n sourceArray: ContentNode[]\n): MergeableContent[] => {\n // Check if both arrays contain only primitives\n const destHasOnlyPrimitives = destinationArray.every(\n (item) => typeof item !== 'object' || item === null\n );\n const sourceHasOnlyPrimitives = sourceArray.every(\n (item) => typeof item !== 'object' || item === null\n );\n\n // If both arrays contain only primitives, use the source array (second dictionary)\n if (destHasOnlyPrimitives && sourceHasOnlyPrimitives) {\n return sourceArray;\n }\n\n // Otherwise, merge by index with object merging logic\n const result: MergeableContent[] = [];\n const maxLength = Math.max(destinationArray.length, sourceArray.length);\n\n for (let i = 0; i < maxLength; i++) {\n const destItem = destinationArray[i];\n const sourceItem = sourceArray[i];\n\n if (destItem === undefined && sourceItem === undefined) {\n } else if (destItem === undefined) {\n // Only source exists, add it\n result.push(sourceItem);\n } else if (sourceItem === undefined) {\n // Only destination exists, add it\n result.push(destItem);\n } else {\n // Both exist, merge them\n if (\n typeof destItem === 'object' &&\n typeof sourceItem === 'object' &&\n destItem !== null &&\n sourceItem !== null\n ) {\n // Check if both objects have a 'key' property for keyed merging\n if (\n 'key' in destItem &&\n 'key' in sourceItem &&\n (destItem as Record<string, string>).key ===\n (sourceItem as Record<string, string>).key\n ) {\n // Merge objects with same key, preferring destination (first dictionary) values\n result.push(customMerge(destItem, sourceItem));\n } else {\n // Merge objects by index, preferring destination (first dictionary) values\n result.push(customMerge(destItem, sourceItem));\n }\n } else {\n // For primitives or non-objects, use destination value (first dictionary)\n result.push(destItem);\n }\n }\n }\n\n return result;\n};\n\nexport const mergeDictionaries = (dictionaries: Dictionary[]): Dictionary => {\n const localIds = Array.from(\n new Set<LocalDictionaryId>(\n dictionaries.filter((dict) => dict.localId).map((dict) => dict.localId!)\n )\n );\n\n const dictionariesKeys = dictionaries.map((dict) => dict.key);\n\n // Check if all dictionaries have the same key\n if (new Set(dictionariesKeys).size !== 1) {\n throw new Error('All dictionaries must have the same key');\n }\n\n let mergedContent: Dictionary['content'] = dictionaries[0].content;\n\n for (let i = 1; i < dictionaries.length; i++) {\n // If the dictionary is a per-locale dictionary, transform it to a partial multilingual dictionary\n const currentDictionary = getMultilingualDictionary(dictionaries[i]);\n\n // Check types before merging\n checkTypesMatch(\n mergedContent,\n currentDictionary.content,\n currentDictionary.localId,\n currentDictionary.key,\n []\n );\n\n mergedContent = customMerge(\n mergedContent,\n currentDictionary.content\n ) as ContentNode;\n }\n\n const mergedDictionary: Dictionary = {\n key: dictionaries[0].key,\n content: mergedContent,\n localIds,\n };\n\n return mergedDictionary;\n};\n"],"mappings":"wSASA,MAAM,GACJ,EACA,EACA,EACA,EACA,EAAiB,EAAE,GACV,CACT,IAAM,GAAA,EAAA,EAAA,cAAyBA,EAAAA,QAAc,CAG7C,GACE,GACY,MACZ,GACY,KAEZ,OAEF,IAAM,EAAQC,EAAAA,YAAY,EAAQ,CAC5B,EAAQA,EAAAA,YAAY,EAAQ,CAG9B,SAAU,WAAa,IAAU,YAEjC,IAAU,EAAO,CACnB,EACE,CACE,sBAAA,EAAA,EAAA,aAAiC,EAAc,CAAC,4DAA4D,EAAK,KAAK,IAAI,CAAC,kBAAkB,EAAM,QAAQ,EAAM,iBAAiB,IACnL,CACD,CACE,MAAO,QACR,CACF,CAED,SAKE,GACJ,EACA,IACqB,CAErB,GAAI,GAA6C,KAC/C,OAAO,EAST,GALI,GAAmC,MAKnC,OAAO,GAAgB,UAAY,OAAO,GAAW,SACvD,OAAO,EAIT,GAAI,MAAM,QAAQ,EAAY,EAAI,MAAM,QAAQ,EAAO,CACrD,OAAO,EACL,EACA,EACD,CAIH,GAAI,OAAO,GAAgB,UAAY,OAAO,GAAW,SAAU,CACjE,IAAM,EAA2C,EAAE,CAC7C,EAAU,IAAI,IAAI,CACtB,GAAG,OAAO,KAAK,EAAsD,CACrE,GAAG,OAAO,KAAK,EAAiD,CACjE,CAAC,CAEF,IAAK,IAAM,KAAO,EAChB,EAAO,GAAO,EACX,EAAuD,GACvD,EAAkD,GACpD,CAGH,OAAO,EAIT,OAAO,GAIH,GACJ,EACA,IACuB,CAEvB,IAAM,EAAwB,EAAiB,MAC5C,GAAS,OAAO,GAAS,WAAY,EACvC,CACK,EAA0B,EAAY,MACzC,GAAS,OAAO,GAAS,WAAY,EACvC,CAGD,GAAI,GAAyB,EAC3B,OAAO,EAIT,IAAM,EAA6B,EAAE,CAC/B,EAAY,KAAK,IAAI,EAAiB,OAAQ,EAAY,OAAO,CAEvE,IAAK,IAAI,EAAI,EAAG,EAAI,EAAW,IAAK,CAClC,IAAM,EAAW,EAAiB,GAC5B,EAAa,EAAY,GAE3B,IAAa,IAAA,IAAa,IAAe,IAAA,KAClC,IAAa,IAAA,GAEtB,EAAO,KAAK,EAAW,CACd,IAAe,IAAA,GAExB,EAAO,KAAK,EAAS,CAInB,OAAO,GAAa,UACpB,OAAO,GAAe,UACtB,IAAa,MACb,IAAe,MAIb,QAAS,GACT,QAAS,IACR,EAAoC,IAClC,EAAsC,KAGzC,EAAO,KAAK,EAAY,EAAU,EAAW,CAAC,EAOhD,EAAO,KAAK,EAAS,EAK3B,OAAO,GAGI,EAAqB,GAA2C,CAC3E,IAAM,EAAW,MAAM,KACrB,IAAI,IACF,EAAa,OAAQ,GAAS,EAAK,QAAQ,CAAC,IAAK,GAAS,EAAK,QAAS,CACzE,CACF,CAEK,EAAmB,EAAa,IAAK,GAAS,EAAK,IAAI,CAG7D,GAAI,IAAI,IAAI,EAAiB,CAAC,OAAS,EACrC,MAAU,MAAM,0CAA0C,CAG5D,IAAI,EAAuC,EAAa,GAAG,QAE3D,IAAK,IAAI,EAAI,EAAG,EAAI,EAAa,OAAQ,IAAK,CAE5C,IAAM,EAAoBC,EAAAA,0BAA0B,EAAa,GAAG,CAGpE,EACE,EACA,EAAkB,QAClB,EAAkB,QAClB,EAAkB,IAClB,EAAE,CACH,CAED,EAAgB,EACd,EACA,EAAkB,QACnB,CASH,MANqC,CACnC,IAAK,EAAa,GAAG,IACrB,QAAS,EACT,WACD"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`@intlayer/config/built`);t=e.__toESM(t);const n=(e,n=t.default)=>{let{editor:r}=n,{dictionaryPriorityStrategy:i}=r;if(e.length<=1)return e;let a=e.map((e,t)=>({dictionary:e,index:t})),o=e=>{let t=e.priority??0;return Number.isFinite(t)?t:0},s=e=>{let t=e.location;return t===void 0?2:i===`distant_first`?t===`remote`?0:1:t===`local`?0:1};return a.sort((e,t)=>{let n=e.dictionary.filled?1:0,r=t.dictionary.filled?1:0;if(n!==r)return n-r;let i=o(e.dictionary),a=o(t.dictionary);if(i!==a)return a-i;let c=s(e.dictionary),l=s(t.dictionary);return c===l?e.index-t.index:c-l}),a.map(({dictionary:e})=>e)};exports.orderDictionaries=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`@intlayer/config/built`);t=e.t(t);const n=(e,n=t.default)=>{let{editor:r}=n,{dictionaryPriorityStrategy:i}=r;if(e.length<=1)return e;let a=e.map((e,t)=>({dictionary:e,index:t})),o=e=>{let t=e.priority??0;return Number.isFinite(t)?t:0},s=e=>{let t=e.location;return t===void 0?2:i===`distant_first`?t===`remote`?0:1:t===`local`?0:1};return a.sort((e,t)=>{let n=e.dictionary.filled?1:0,r=t.dictionary.filled?1:0;if(n!==r)return n-r;let i=o(e.dictionary),a=o(t.dictionary);if(i!==a)return a-i;let c=s(e.dictionary),l=s(t.dictionary);return c===l?e.index-t.index:c-l}),a.map(({dictionary:e})=>e)};exports.orderDictionaries=n;
2
2
  //# sourceMappingURL=orderDictionaries.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"orderDictionaries.cjs","names":["intlayerConfig"],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"sourcesContent":["import intlayerConfig from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\n\n/**\n * Orders dictionaries based on the dictionary priority strategy.\n *\n * @param dictionaries - Array of dictionaries to order\n * @param priorityStrategy - The priority strategy ('local_first' or 'distant_first')\n * @returns Ordered array of dictionaries\n */\nexport const orderDictionaries = (\n dictionaries: Dictionary[],\n configuration = intlayerConfig\n): Dictionary[] => {\n const { editor } = configuration;\n const { dictionaryPriorityStrategy } = editor;\n\n if (dictionaries.length <= 1) {\n return dictionaries;\n }\n\n // Stabilize original indices to preserve relative order for complete ties\n const withIndex = dictionaries.map((dictionary, index) => ({\n dictionary,\n index,\n }));\n\n const getPriority = (dictionary: Dictionary): number => {\n const p = dictionary.priority ?? 0;\n\n return Number.isFinite(p) ? p : 0;\n };\n\n const getLocationWeight = (d: Dictionary): number => {\n const location = d.location;\n\n // undefined location should always be last\n if (location === undefined) {\n return 2;\n }\n\n if (dictionaryPriorityStrategy === 'distant_first') {\n // distant should come first\n return location === 'remote' ? 0 : 1;\n }\n // default: local_first\n return location === 'local' ? 0 : 1;\n };\n\n withIndex.sort((a, b) => {\n // 1) Non-autoFilled before autoFilled (autoFilled have lower precedence)\n const aAuto = a.dictionary.filled ? 1 : 0;\n const bAuto = b.dictionary.filled ? 1 : 0;\n if (aAuto !== bAuto) return aAuto - bAuto; // 0 before 1\n\n // 2) Higher priority first (larger number wins)\n const aP = getPriority(a.dictionary);\n const bP = getPriority(b.dictionary);\n if (aP !== bP) return bP - aP; // descending\n\n // 3) Location according to strategy\n const aLocation = getLocationWeight(a.dictionary);\n const bLocation = getLocationWeight(b.dictionary);\n if (aLocation !== bLocation) return aLocation - bLocation;\n\n // 4) Stable fallback by original index\n return a.index - b.index;\n });\n\n return withIndex.map(({ dictionary }) => dictionary);\n};\n"],"mappings":"+KAUA,MAAa,GACX,EACA,EAAgBA,EAAAA,UACC,CACjB,GAAM,CAAE,UAAW,EACb,CAAE,8BAA+B,EAEvC,GAAI,EAAa,QAAU,EACzB,OAAO,EAIT,IAAM,EAAY,EAAa,KAAK,EAAY,KAAW,CACzD,aACA,QACD,EAAE,CAEG,EAAe,GAAmC,CACtD,IAAM,EAAI,EAAW,UAAY,EAEjC,OAAO,OAAO,SAAS,EAAE,CAAG,EAAI,GAG5B,EAAqB,GAA0B,CACnD,IAAM,EAAW,EAAE,SAYnB,OATI,IAAa,IAAA,GACR,EAGL,IAA+B,gBAE1B,IAAa,SAAW,EAAI,EAG9B,IAAa,QAAU,EAAI,GAuBpC,OApBA,EAAU,MAAM,EAAG,IAAM,CAEvB,IAAM,EAAQ,EAAE,WAAW,OAAS,EAAI,EAClC,EAAQ,EAAE,WAAW,OAAS,EAAI,EACxC,GAAI,IAAU,EAAO,OAAO,EAAQ,EAGpC,IAAM,EAAK,EAAY,EAAE,WAAW,CAC9B,EAAK,EAAY,EAAE,WAAW,CACpC,GAAI,IAAO,EAAI,OAAO,EAAK,EAG3B,IAAM,EAAY,EAAkB,EAAE,WAAW,CAC3C,EAAY,EAAkB,EAAE,WAAW,CAIjD,OAHI,IAAc,EAGX,EAAE,MAAQ,EAAE,MAHiB,EAAY,GAIhD,CAEK,EAAU,KAAK,CAAE,gBAAiB,EAAW"}
1
+ {"version":3,"file":"orderDictionaries.cjs","names":["intlayerConfig"],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"sourcesContent":["import intlayerConfig from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\n\n/**\n * Orders dictionaries based on the dictionary priority strategy.\n *\n * @param dictionaries - Array of dictionaries to order\n * @param priorityStrategy - The priority strategy ('local_first' or 'distant_first')\n * @returns Ordered array of dictionaries\n */\nexport const orderDictionaries = (\n dictionaries: Dictionary[],\n configuration = intlayerConfig\n): Dictionary[] => {\n const { editor } = configuration;\n const { dictionaryPriorityStrategy } = editor;\n\n if (dictionaries.length <= 1) {\n return dictionaries;\n }\n\n // Stabilize original indices to preserve relative order for complete ties\n const withIndex = dictionaries.map((dictionary, index) => ({\n dictionary,\n index,\n }));\n\n const getPriority = (dictionary: Dictionary): number => {\n const p = dictionary.priority ?? 0;\n\n return Number.isFinite(p) ? p : 0;\n };\n\n const getLocationWeight = (d: Dictionary): number => {\n const location = d.location;\n\n // undefined location should always be last\n if (location === undefined) {\n return 2;\n }\n\n if (dictionaryPriorityStrategy === 'distant_first') {\n // distant should come first\n return location === 'remote' ? 0 : 1;\n }\n // default: local_first\n return location === 'local' ? 0 : 1;\n };\n\n withIndex.sort((a, b) => {\n // 1) Non-autoFilled before autoFilled (autoFilled have lower precedence)\n const aAuto = a.dictionary.filled ? 1 : 0;\n const bAuto = b.dictionary.filled ? 1 : 0;\n if (aAuto !== bAuto) return aAuto - bAuto; // 0 before 1\n\n // 2) Higher priority first (larger number wins)\n const aP = getPriority(a.dictionary);\n const bP = getPriority(b.dictionary);\n if (aP !== bP) return bP - aP; // descending\n\n // 3) Location according to strategy\n const aLocation = getLocationWeight(a.dictionary);\n const bLocation = getLocationWeight(b.dictionary);\n if (aLocation !== bLocation) return aLocation - bLocation;\n\n // 4) Stable fallback by original index\n return a.index - b.index;\n });\n\n return withIndex.map(({ dictionary }) => dictionary);\n};\n"],"mappings":"6JAUA,MAAa,GACX,EACA,EAAgBA,EAAAA,UACC,CACjB,GAAM,CAAE,UAAW,EACb,CAAE,8BAA+B,EAEvC,GAAI,EAAa,QAAU,EACzB,OAAO,EAIT,IAAM,EAAY,EAAa,KAAK,EAAY,KAAW,CACzD,aACA,QACD,EAAE,CAEG,EAAe,GAAmC,CACtD,IAAM,EAAI,EAAW,UAAY,EAEjC,OAAO,OAAO,SAAS,EAAE,CAAG,EAAI,GAG5B,EAAqB,GAA0B,CACnD,IAAM,EAAW,EAAE,SAYnB,OATI,IAAa,IAAA,GACR,EAGL,IAA+B,gBAE1B,IAAa,SAAW,EAAI,EAG9B,IAAa,QAAU,EAAI,GAuBpC,OApBA,EAAU,MAAM,EAAG,IAAM,CAEvB,IAAM,EAAQ,EAAE,WAAW,OAAS,EAAI,EAClC,EAAQ,EAAE,WAAW,OAAS,EAAI,EACxC,GAAI,IAAU,EAAO,OAAO,EAAQ,EAGpC,IAAM,EAAK,EAAY,EAAE,WAAW,CAC9B,EAAK,EAAY,EAAE,WAAW,CACpC,GAAI,IAAO,EAAI,OAAO,EAAK,EAG3B,IAAM,EAAY,EAAkB,EAAE,WAAW,CAC3C,EAAY,EAAkB,EAAE,WAAW,CAIjD,OAHI,IAAc,EAGX,EAAE,MAAQ,EAAE,MAHiB,EAAY,GAIhD,CAEK,EAAU,KAAK,CAAE,gBAAiB,EAAW"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@intlayer/types/nodeType`);const t=(t,n)=>{let r=t,i=null,a=null;for(let t of n)i=r,(t.type===e.NodeType.Object||t.type===e.NodeType.Array)&&(a=t.key,r=r[t.key]),(t.type===e.NodeType.Translation||t.type===e.NodeType.Enumeration||t.type===e.NodeType.Condition)&&(a=t.type,r=r[t.type][t.key]),(t.type===e.NodeType.Markdown||t.type===e.NodeType.ReactNode||t.type===e.NodeType.HTML||t.type===e.NodeType.Insertion||t.type===e.NodeType.File)&&(a=t.type,r=r[t.type]);return i&&a!==null&&(Array.isArray(i)?i.splice(a,1):delete i[a]),t};exports.removeContentNodeByKeyPath=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/types/nodeType`);const t=(t,n)=>{let r=t,i=null,a=null;for(let t of n)i=r,(t.type===e.NodeType.Object||t.type===e.NodeType.Array)&&(a=t.key,r=r[t.key]),(t.type===e.NodeType.Translation||t.type===e.NodeType.Enumeration||t.type===e.NodeType.Condition)&&(a=t.type,r=r[t.type][t.key]),(t.type===e.NodeType.Markdown||t.type===e.NodeType.ReactNode||t.type===e.NodeType.HTML||t.type===e.NodeType.Insertion||t.type===e.NodeType.File)&&(a=t.type,r=r[t.type]);return i&&a!==null&&(Array.isArray(i)?i.splice(a,1):delete i[a]),t};exports.removeContentNodeByKeyPath=t;
2
2
  //# sourceMappingURL=removeContentNodeByKeyPath.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"removeContentNodeByKeyPath.cjs","names":["NodeType"],"sources":["../../../src/dictionaryManipulator/removeContentNodeByKeyPath.ts"],"sourcesContent":["import type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';;\nimport { NodeType } from '@intlayer/types/nodeType';\n\nexport const removeContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKey: string | number | null = null;\n\n for (const keyObj of keyPath) {\n parentValue = currentValue;\n\n if (keyObj.type === NodeType.Object || keyObj.type === NodeType.Array) {\n lastKey = keyObj.key;\n currentValue = currentValue[keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Translation ||\n keyObj.type === NodeType.Enumeration ||\n keyObj.type === NodeType.Condition\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type][keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Markdown ||\n keyObj.type === NodeType.ReactNode ||\n keyObj.type === NodeType.HTML ||\n keyObj.type === NodeType.Insertion ||\n keyObj.type === NodeType.File\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type];\n }\n }\n\n if (parentValue && lastKey !== null) {\n if (Array.isArray(parentValue)) {\n parentValue.splice(lastKey as unknown as number, 1);\n } else {\n delete parentValue[lastKey];\n }\n }\n\n return dictionaryContent;\n};\n"],"mappings":"0JAIA,MAAa,GACX,EACA,IACgB,CAChB,IAAI,EAAoB,EACpB,EAAmB,KACnB,EAAkC,KAEtC,IAAK,IAAM,KAAU,EACnB,EAAc,GAEV,EAAO,OAASA,EAAAA,SAAS,QAAU,EAAO,OAASA,EAAAA,SAAS,SAC9D,EAAU,EAAO,IACjB,EAAe,EAAa,EAAO,OAInC,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,MAAM,EAAO,OAIhD,EAAO,OAASA,EAAAA,SAAS,UACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,MACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,QAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,OAYvC,OARI,GAAe,IAAY,OACzB,MAAM,QAAQ,EAAY,CAC5B,EAAY,OAAO,EAA8B,EAAE,CAEnD,OAAO,EAAY,IAIhB"}
1
+ {"version":3,"file":"removeContentNodeByKeyPath.cjs","names":["NodeType"],"sources":["../../../src/dictionaryManipulator/removeContentNodeByKeyPath.ts"],"sourcesContent":["import type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';;\nimport { NodeType } from '@intlayer/types/nodeType';\n\nexport const removeContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKey: string | number | null = null;\n\n for (const keyObj of keyPath) {\n parentValue = currentValue;\n\n if (keyObj.type === NodeType.Object || keyObj.type === NodeType.Array) {\n lastKey = keyObj.key;\n currentValue = currentValue[keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Translation ||\n keyObj.type === NodeType.Enumeration ||\n keyObj.type === NodeType.Condition\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type][keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Markdown ||\n keyObj.type === NodeType.ReactNode ||\n keyObj.type === NodeType.HTML ||\n keyObj.type === NodeType.Insertion ||\n keyObj.type === NodeType.File\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type];\n }\n }\n\n if (parentValue && lastKey !== null) {\n if (Array.isArray(parentValue)) {\n parentValue.splice(lastKey as unknown as number, 1);\n } else {\n delete parentValue[lastKey];\n }\n }\n\n return dictionaryContent;\n};\n"],"mappings":"8IAIA,MAAa,GACX,EACA,IACgB,CAChB,IAAI,EAAoB,EACpB,EAAmB,KACnB,EAAkC,KAEtC,IAAK,IAAM,KAAU,EACnB,EAAc,GAEV,EAAO,OAASA,EAAAA,SAAS,QAAU,EAAO,OAASA,EAAAA,SAAS,SAC9D,EAAU,EAAO,IACjB,EAAe,EAAa,EAAO,OAInC,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,MAAM,EAAO,OAIhD,EAAO,OAASA,EAAAA,SAAS,UACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,MACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,QAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,OAYvC,OARI,GAAe,IAAY,OACzB,MAAM,QAAQ,EAAY,CAC5B,EAAY,OAAO,EAA8B,EAAE,CAEnD,OAAO,EAAY,IAIhB"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@intlayer/types/nodeType`);const t=(t,n,r)=>{let i=t,a=null,o=null;for(let t of r)a=i,(t.type===e.NodeType.Object||t.type===e.NodeType.Array)&&(o=t.key,i=i[t.key]),(t.type===e.NodeType.Translation||t.type===e.NodeType.Enumeration||t.type===e.NodeType.Condition)&&(o=t.type,i=i[t.type][t.key]),(t.type===e.NodeType.Markdown||t.type===e.NodeType.ReactNode||t.type===e.NodeType.HTML||t.type===e.NodeType.Insertion||t.type===e.NodeType.File)&&(o=t.type,i=i[t.type]);if(a&&o!==null)if(Array.isArray(a))a[o]=i;else{let e={};for(let t of Object.keys(a))t===o&&n!==void 0?e[n]=i:e[t]=a[t];Object.keys(a).forEach(e=>{delete a[e]}),Object.assign(a,e)}return t};exports.renameContentNodeByKeyPath=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/types/nodeType`);const t=(t,n,r)=>{let i=t,a=null,o=null;for(let t of r)a=i,(t.type===e.NodeType.Object||t.type===e.NodeType.Array)&&(o=t.key,i=i[t.key]),(t.type===e.NodeType.Translation||t.type===e.NodeType.Enumeration||t.type===e.NodeType.Condition)&&(o=t.type,i=i[t.type][t.key]),(t.type===e.NodeType.Markdown||t.type===e.NodeType.ReactNode||t.type===e.NodeType.HTML||t.type===e.NodeType.Insertion||t.type===e.NodeType.File)&&(o=t.type,i=i[t.type]);if(a&&o!==null)if(Array.isArray(a))a[o]=i;else{let e={};for(let t of Object.keys(a))t===o&&n!==void 0?e[n]=i:e[t]=a[t];Object.keys(a).forEach(e=>{delete a[e]}),Object.assign(a,e)}return t};exports.renameContentNodeByKeyPath=t;
2
2
  //# sourceMappingURL=renameContentNodeByKeyPath.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"renameContentNodeByKeyPath.cjs","names":["NodeType"],"sources":["../../../src/dictionaryManipulator/renameContentNodeByKeyPath.ts"],"sourcesContent":["import type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';;\nimport { NodeType } from '@intlayer/types/nodeType';\n\nexport const renameContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n newKey: KeyPath['key'],\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKey: string | number | null = null;\n\n for (const keyObj of keyPath) {\n parentValue = currentValue;\n\n if (keyObj.type === NodeType.Object || keyObj.type === NodeType.Array) {\n lastKey = keyObj.key;\n currentValue = currentValue[keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Translation ||\n keyObj.type === NodeType.Enumeration ||\n keyObj.type === NodeType.Condition\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type][keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Markdown ||\n keyObj.type === NodeType.ReactNode ||\n keyObj.type === NodeType.HTML ||\n keyObj.type === NodeType.Insertion ||\n keyObj.type === NodeType.File\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type];\n }\n }\n\n // Assign the new value to the last key of the parent while preserving the order\n if (parentValue && lastKey !== null) {\n if (Array.isArray(parentValue)) {\n parentValue[lastKey as number] = currentValue;\n } else {\n const newParentValue: any = {};\n for (const key of Object.keys(parentValue)) {\n if (key === lastKey && typeof newKey !== 'undefined') {\n newParentValue[newKey] = currentValue;\n } else {\n newParentValue[key] = parentValue[key];\n }\n }\n // Replace the contents of parentValue with newParentValue\n Object.keys(parentValue).forEach((key) => {\n delete parentValue[key];\n });\n Object.assign(parentValue, newParentValue);\n }\n }\n\n return dictionaryContent;\n};\n"],"mappings":"0JAIA,MAAa,GACX,EACA,EACA,IACgB,CAChB,IAAI,EAAoB,EACpB,EAAmB,KACnB,EAAkC,KAEtC,IAAK,IAAM,KAAU,EACnB,EAAc,GAEV,EAAO,OAASA,EAAAA,SAAS,QAAU,EAAO,OAASA,EAAAA,SAAS,SAC9D,EAAU,EAAO,IACjB,EAAe,EAAa,EAAO,OAInC,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,MAAM,EAAO,OAIhD,EAAO,OAASA,EAAAA,SAAS,UACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,MACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,QAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,OAKvC,GAAI,GAAe,IAAY,KAC7B,GAAI,MAAM,QAAQ,EAAY,CAC5B,EAAY,GAAqB,MAC5B,CACL,IAAM,EAAsB,EAAE,CAC9B,IAAK,IAAM,KAAO,OAAO,KAAK,EAAY,CACpC,IAAQ,GAAkB,IAAW,OACvC,EAAe,GAAU,EAEzB,EAAe,GAAO,EAAY,GAItC,OAAO,KAAK,EAAY,CAAC,QAAS,GAAQ,CACxC,OAAO,EAAY,IACnB,CACF,OAAO,OAAO,EAAa,EAAe,CAI9C,OAAO"}
1
+ {"version":3,"file":"renameContentNodeByKeyPath.cjs","names":["NodeType"],"sources":["../../../src/dictionaryManipulator/renameContentNodeByKeyPath.ts"],"sourcesContent":["import type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';;\nimport { NodeType } from '@intlayer/types/nodeType';\n\nexport const renameContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n newKey: KeyPath['key'],\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKey: string | number | null = null;\n\n for (const keyObj of keyPath) {\n parentValue = currentValue;\n\n if (keyObj.type === NodeType.Object || keyObj.type === NodeType.Array) {\n lastKey = keyObj.key;\n currentValue = currentValue[keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Translation ||\n keyObj.type === NodeType.Enumeration ||\n keyObj.type === NodeType.Condition\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type][keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Markdown ||\n keyObj.type === NodeType.ReactNode ||\n keyObj.type === NodeType.HTML ||\n keyObj.type === NodeType.Insertion ||\n keyObj.type === NodeType.File\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type];\n }\n }\n\n // Assign the new value to the last key of the parent while preserving the order\n if (parentValue && lastKey !== null) {\n if (Array.isArray(parentValue)) {\n parentValue[lastKey as number] = currentValue;\n } else {\n const newParentValue: any = {};\n for (const key of Object.keys(parentValue)) {\n if (key === lastKey && typeof newKey !== 'undefined') {\n newParentValue[newKey] = currentValue;\n } else {\n newParentValue[key] = parentValue[key];\n }\n }\n // Replace the contents of parentValue with newParentValue\n Object.keys(parentValue).forEach((key) => {\n delete parentValue[key];\n });\n Object.assign(parentValue, newParentValue);\n }\n }\n\n return dictionaryContent;\n};\n"],"mappings":"8IAIA,MAAa,GACX,EACA,EACA,IACgB,CAChB,IAAI,EAAoB,EACpB,EAAmB,KACnB,EAAkC,KAEtC,IAAK,IAAM,KAAU,EACnB,EAAc,GAEV,EAAO,OAASA,EAAAA,SAAS,QAAU,EAAO,OAASA,EAAAA,SAAS,SAC9D,EAAU,EAAO,IACjB,EAAe,EAAa,EAAO,OAInC,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,MAAM,EAAO,OAIhD,EAAO,OAASA,EAAAA,SAAS,UACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,MACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,QAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,OAKvC,GAAI,GAAe,IAAY,KAC7B,GAAI,MAAM,QAAQ,EAAY,CAC5B,EAAY,GAAqB,MAC5B,CACL,IAAM,EAAsB,EAAE,CAC9B,IAAK,IAAM,KAAO,OAAO,KAAK,EAAY,CACpC,IAAQ,GAAkB,IAAW,OACvC,EAAe,GAAU,EAEzB,EAAe,GAAO,EAAY,GAItC,OAAO,KAAK,EAAY,CAAC,QAAS,GAAQ,CACxC,OAAO,EAAY,IACnB,CACF,OAAO,OAAO,EAAa,EAAe,CAI9C,OAAO"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@intlayer/types/nodeType`);const t=(t,n)=>{if(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)return n;if(typeof t?.nodeType==`string`){let r=t,i=r[r.nodeType];if(r.nodeType===e.NodeType.Translation||r.nodeType===e.NodeType.Enumeration||r.nodeType===e.NodeType.Condition){let e=Object.entries(i).reduce((e,[t])=>(e[t]=n,e),{});return{...r,[r.nodeType]:e}}return r.nodeType===e.NodeType.Nested?r:{...r,[r.nodeType]:n}}return!t||typeof t!=`object`?n:Array.isArray(t)?t.map(()=>n):Object.entries(t).reduce((e,[t])=>({...e,[t]:n}),{})};exports.updateNodeChildren=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/types/nodeType`);const t=(t,n)=>{if(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)return n;if(typeof t?.nodeType==`string`){let r=t,i=r[r.nodeType];if(r.nodeType===e.NodeType.Translation||r.nodeType===e.NodeType.Enumeration||r.nodeType===e.NodeType.Condition){let e=Object.entries(i).reduce((e,[t])=>(e[t]=n,e),{});return{...r,[r.nodeType]:e}}return r.nodeType===e.NodeType.Nested?r:{...r,[r.nodeType]:n}}return!t||typeof t!=`object`?n:Array.isArray(t)?t.map(()=>n):Object.entries(t).reduce((e,[t])=>({...e,[t]:n}),{})};exports.updateNodeChildren=t;
2
2
  //# sourceMappingURL=updateNodeChildren.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"updateNodeChildren.cjs","names":["NodeType"],"sources":["../../../src/dictionaryManipulator/updateNodeChildren.ts"],"sourcesContent":["import type { ContentNode, TypedNode } from '@intlayer/types/dictionary';;\nimport { NodeType } from '@intlayer/types/nodeType';\n\nexport const updateNodeChildren = <\n T extends ContentNode,\n U extends ContentNode,\n>(\n section: T,\n newChildren: U\n): ContentNode => {\n if (typeof section === 'string') {\n return newChildren;\n }\n if (typeof section === 'number') {\n return newChildren;\n }\n if (typeof section === 'boolean') {\n return newChildren;\n }\n if (typeof (section as TypedNode)?.nodeType === 'string') {\n const typedNode = section as TypedNode;\n const content =\n typedNode[typedNode.nodeType as unknown as keyof typeof typedNode];\n\n if (\n typedNode.nodeType === NodeType.Translation ||\n typedNode.nodeType === NodeType.Enumeration ||\n typedNode.nodeType === NodeType.Condition\n ) {\n const newContent = Object.entries(content).reduce(\n (acc, [key]) => {\n acc[key] = newChildren;\n return acc;\n },\n {} as Record<string, ContentNode>\n );\n\n return {\n ...typedNode,\n [typedNode.nodeType]: newContent,\n };\n }\n\n if (typedNode.nodeType === NodeType.Nested) {\n return typedNode;\n }\n\n return {\n ...typedNode,\n [typedNode.nodeType]: newChildren,\n };\n }\n\n if (!section || typeof section !== 'object') {\n return newChildren;\n }\n\n if (Array.isArray(section)) {\n return section.map(() => newChildren) as unknown as ContentNode;\n }\n\n return Object.entries(\n section as unknown as Record<string, ContentNode>\n ).reduce(\n (acc, [key]) => ({\n ...acc,\n [key]: newChildren,\n }),\n {} as Record<string, ContentNode>\n ) as unknown as ContentNode;\n};\n"],"mappings":"0JAGA,MAAa,GAIX,EACA,IACgB,CAOhB,GANI,OAAO,GAAY,UAGnB,OAAO,GAAY,UAGnB,OAAO,GAAY,UACrB,OAAO,EAET,GAAI,OAAQ,GAAuB,UAAa,SAAU,CACxD,IAAM,EAAY,EACZ,EACJ,EAAU,EAAU,UAEtB,GACE,EAAU,WAAaA,EAAAA,SAAS,aAChC,EAAU,WAAaA,EAAAA,SAAS,aAChC,EAAU,WAAaA,EAAAA,SAAS,UAChC,CACA,IAAM,EAAa,OAAO,QAAQ,EAAQ,CAAC,QACxC,EAAK,CAAC,MACL,EAAI,GAAO,EACJ,GAET,EAAE,CACH,CAED,MAAO,CACL,GAAG,GACF,EAAU,UAAW,EACvB,CAOH,OAJI,EAAU,WAAaA,EAAAA,SAAS,OAC3B,EAGF,CACL,GAAG,GACF,EAAU,UAAW,EACvB,CAWH,MARI,CAAC,GAAW,OAAO,GAAY,SAC1B,EAGL,MAAM,QAAQ,EAAQ,CACjB,EAAQ,QAAU,EAAY,CAGhC,OAAO,QACZ,EACD,CAAC,QACC,EAAK,CAAC,MAAU,CACf,GAAG,GACF,GAAM,EACR,EACD,EAAE,CACH"}
1
+ {"version":3,"file":"updateNodeChildren.cjs","names":["NodeType"],"sources":["../../../src/dictionaryManipulator/updateNodeChildren.ts"],"sourcesContent":["import type { ContentNode, TypedNode } from '@intlayer/types/dictionary';;\nimport { NodeType } from '@intlayer/types/nodeType';\n\nexport const updateNodeChildren = <\n T extends ContentNode,\n U extends ContentNode,\n>(\n section: T,\n newChildren: U\n): ContentNode => {\n if (typeof section === 'string') {\n return newChildren;\n }\n if (typeof section === 'number') {\n return newChildren;\n }\n if (typeof section === 'boolean') {\n return newChildren;\n }\n if (typeof (section as TypedNode)?.nodeType === 'string') {\n const typedNode = section as TypedNode;\n const content =\n typedNode[typedNode.nodeType as unknown as keyof typeof typedNode];\n\n if (\n typedNode.nodeType === NodeType.Translation ||\n typedNode.nodeType === NodeType.Enumeration ||\n typedNode.nodeType === NodeType.Condition\n ) {\n const newContent = Object.entries(content).reduce(\n (acc, [key]) => {\n acc[key] = newChildren;\n return acc;\n },\n {} as Record<string, ContentNode>\n );\n\n return {\n ...typedNode,\n [typedNode.nodeType]: newContent,\n };\n }\n\n if (typedNode.nodeType === NodeType.Nested) {\n return typedNode;\n }\n\n return {\n ...typedNode,\n [typedNode.nodeType]: newChildren,\n };\n }\n\n if (!section || typeof section !== 'object') {\n return newChildren;\n }\n\n if (Array.isArray(section)) {\n return section.map(() => newChildren) as unknown as ContentNode;\n }\n\n return Object.entries(\n section as unknown as Record<string, ContentNode>\n ).reduce(\n (acc, [key]) => ({\n ...acc,\n [key]: newChildren,\n }),\n {} as Record<string, ContentNode>\n ) as unknown as ContentNode;\n};\n"],"mappings":"8IAGA,MAAa,GAIX,EACA,IACgB,CAOhB,GANI,OAAO,GAAY,UAGnB,OAAO,GAAY,UAGnB,OAAO,GAAY,UACrB,OAAO,EAET,GAAI,OAAQ,GAAuB,UAAa,SAAU,CACxD,IAAM,EAAY,EACZ,EACJ,EAAU,EAAU,UAEtB,GACE,EAAU,WAAaA,EAAAA,SAAS,aAChC,EAAU,WAAaA,EAAAA,SAAS,aAChC,EAAU,WAAaA,EAAAA,SAAS,UAChC,CACA,IAAM,EAAa,OAAO,QAAQ,EAAQ,CAAC,QACxC,EAAK,CAAC,MACL,EAAI,GAAO,EACJ,GAET,EAAE,CACH,CAED,MAAO,CACL,GAAG,GACF,EAAU,UAAW,EACvB,CAOH,OAJI,EAAU,WAAaA,EAAAA,SAAS,OAC3B,EAGF,CACL,GAAG,GACF,EAAU,UAAW,EACvB,CAWH,MARI,CAAC,GAAW,OAAO,GAAY,SAC1B,EAGL,MAAM,QAAQ,EAAQ,CACjB,EAAQ,QAAU,EAAY,CAGhC,OAAO,QACZ,EACD,CAAC,QACC,EAAK,CAAC,MAAU,CACf,GAAG,GACF,GAAM,EACR,EACD,EAAE,CACH"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e,r)=>new t.CachedIntl.NumberFormat(r?.locale??n.default?.internationalization?.defaultLocale,{...r,notation:`compact`}).format(Number(e));exports.compact=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.t(n);const r=(e,r)=>new t.CachedIntl.NumberFormat(r?.locale??n.default?.internationalization?.defaultLocale,{...r,notation:`compact`}).format(Number(e));exports.compact=r;
2
2
  //# sourceMappingURL=compact.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"compact.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/compact.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using compact notation (e.g., 1K, 1M, 1B)\n * based on locale and formatting options.\n *\n * @example\n * compact({ value: 1200 }); // \"1.2K\"\n *\n * @example\n * compact({ value: \"1000000\", locale: Locales.FRENCH, compactDisplay: \"long\" });\n * // \"1 million\"\n */\nexport const compact = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n ...options,\n notation: 'compact',\n }\n ).format(Number(value));\n"],"mappings":"8MAeA,MAAa,GACX,EACA,IAEA,IAAIA,EAAAA,WAAW,aACb,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,CACE,GAAG,EACH,SAAU,UACX,CACF,CAAC,OAAO,OAAO,EAAM,CAAC"}
1
+ {"version":3,"file":"compact.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/compact.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using compact notation (e.g., 1K, 1M, 1B)\n * based on locale and formatting options.\n *\n * @example\n * compact({ value: 1200 }); // \"1.2K\"\n *\n * @example\n * compact({ value: \"1000000\", locale: Locales.FRENCH, compactDisplay: \"long\" });\n * // \"1 million\"\n */\nexport const compact = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n ...options,\n notation: 'compact',\n }\n ).format(Number(value));\n"],"mappings":"4LAeA,MAAa,GACX,EACA,IAEA,IAAIA,EAAAA,WAAW,aACb,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,CACE,GAAG,EACH,SAAU,UACX,CACF,CAAC,OAAO,OAAO,EAAM,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e,r)=>new t.CachedIntl.NumberFormat(r?.locale??n.default?.internationalization?.defaultLocale,{style:`currency`,currency:r?.currency??`USD`,currencyDisplay:r?.currencyDisplay??`symbol`,minimumFractionDigits:r?.minimumFractionDigits??2,maximumFractionDigits:r?.maximumFractionDigits??2,...r}).format(Number(e));exports.currency=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.t(n);const r=(e,r)=>new t.CachedIntl.NumberFormat(r?.locale??n.default?.internationalization?.defaultLocale,{style:`currency`,currency:r?.currency??`USD`,currencyDisplay:r?.currencyDisplay??`symbol`,minimumFractionDigits:r?.minimumFractionDigits??2,maximumFractionDigits:r?.maximumFractionDigits??2,...r}).format(Number(e));exports.currency=r;
2
2
  //# sourceMappingURL=currency.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"currency.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/currency.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric or string value into a localized currency string using the Intl API.\n *\n * @example\n * currency({ value: 1234.5, currency: 'EUR' });\n * // \"€1,234.50\"\n *\n * @example\n * currency({ value: \"5000\", locale: Locales.FRENCH, currency: \"CAD\", currencyDisplay: \"code\" });\n * // \"5 000,00 CAD\"\n */\nexport const currency = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n style: 'currency',\n currency: options?.currency ?? 'USD',\n currencyDisplay: options?.currencyDisplay ?? 'symbol',\n minimumFractionDigits: options?.minimumFractionDigits ?? 2,\n maximumFractionDigits: options?.maximumFractionDigits ?? 2,\n ...options,\n }\n ).format(Number(value));\n"],"mappings":"8MAeA,MAAa,GACX,EACA,IAEA,IAAIA,EAAAA,WAAW,aACb,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,CACE,MAAO,WACP,SAAU,GAAS,UAAY,MAC/B,gBAAiB,GAAS,iBAAmB,SAC7C,sBAAuB,GAAS,uBAAyB,EACzD,sBAAuB,GAAS,uBAAyB,EACzD,GAAG,EACJ,CACF,CAAC,OAAO,OAAO,EAAM,CAAC"}
1
+ {"version":3,"file":"currency.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/currency.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric or string value into a localized currency string using the Intl API.\n *\n * @example\n * currency({ value: 1234.5, currency: 'EUR' });\n * // \"€1,234.50\"\n *\n * @example\n * currency({ value: \"5000\", locale: Locales.FRENCH, currency: \"CAD\", currencyDisplay: \"code\" });\n * // \"5 000,00 CAD\"\n */\nexport const currency = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n style: 'currency',\n currency: options?.currency ?? 'USD',\n currencyDisplay: options?.currencyDisplay ?? 'symbol',\n minimumFractionDigits: options?.minimumFractionDigits ?? 2,\n maximumFractionDigits: options?.maximumFractionDigits ?? 2,\n ...options,\n }\n ).format(Number(value));\n"],"mappings":"4LAeA,MAAa,GACX,EACA,IAEA,IAAIA,EAAAA,WAAW,aACb,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,CACE,MAAO,WACP,SAAU,GAAS,UAAY,MAC/B,gBAAiB,GAAS,iBAAmB,SAC7C,sBAAuB,GAAS,uBAAyB,EACzD,sBAAuB,GAAS,uBAAyB,EACzD,GAAG,EACJ,CACF,CAAC,OAAO,OAAO,EAAM,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r={short:{year:`2-digit`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`},long:{year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`numeric`},full:{year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`numeric`,hour12:!1},dateOnly:{year:`numeric`,month:`short`,day:`numeric`},timeOnly:{hour:`numeric`,minute:`numeric`,second:`numeric`}},i=(e,i)=>{let a=new Date(e),o=typeof i==`string`?r[i]??{}:i;return new t.CachedIntl.DateTimeFormat(i?.locale??n.default?.internationalization?.defaultLocale,o).format(a)};exports.date=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.t(n);const r={short:{year:`2-digit`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`},long:{year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`numeric`},full:{year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`numeric`,hour12:!1},dateOnly:{year:`numeric`,month:`short`,day:`numeric`},timeOnly:{hour:`numeric`,minute:`numeric`,second:`numeric`}},i=(e,i)=>{let a=new Date(e),o=typeof i==`string`?r[i]??{}:i;return new t.CachedIntl.DateTimeFormat(i?.locale??n.default?.internationalization?.defaultLocale,o).format(a)};exports.date=i;
2
2
  //# sourceMappingURL=date.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/date.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\ntype DateTimePreset = 'short' | 'long' | 'dateOnly' | 'timeOnly' | 'full';\n\nconst presets: Record<DateTimePreset, Intl.DateTimeFormatOptions> = {\n short: {\n year: '2-digit',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n },\n long: {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n },\n full: {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: false,\n },\n dateOnly: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n },\n timeOnly: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n};\n\n/**\n * Formats a date/time value into a localized string using Intl.DateTimeFormat.\n *\n * @example\n * date({ date: new Date(), options: \"short\" });\n * // \"08/02/25, 14:30\"\n *\n * @example\n * date({ date: \"2025-08-02T14:30:00Z\", locale: Locales.FRENCH, options: { month: \"long\", day: \"numeric\" } });\n * // \"2 août\"\n */\nexport const date = (\n date: Date | string | number,\n options?: Intl.DateTimeFormatOptions & { locale?: LocalesValues }\n): string => {\n const dateTime = new Date(date);\n\n const resolvedOptions =\n typeof options === 'string' ? (presets[options] ?? {}) : options;\n\n const formatter = new CachedIntl.DateTimeFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n resolvedOptions\n );\n\n return formatter.format(dateTime);\n};\n"],"mappings":"8MAMA,MAAM,EAA8D,CAClE,MAAO,CACL,KAAM,UACN,MAAO,UACP,IAAK,UACL,KAAM,UACN,OAAQ,UACT,CACD,KAAM,CACJ,KAAM,UACN,MAAO,OACP,IAAK,UACL,KAAM,UACN,OAAQ,UACT,CACD,KAAM,CACJ,KAAM,UACN,MAAO,OACP,IAAK,UACL,KAAM,UACN,OAAQ,UACR,OAAQ,GACT,CACD,SAAU,CACR,KAAM,UACN,MAAO,QACP,IAAK,UACN,CACD,SAAU,CACR,KAAM,UACN,OAAQ,UACR,OAAQ,UACT,CACF,CAaY,GACX,EACA,IACW,CACX,IAAM,EAAW,IAAI,KAAK,EAAK,CAEzB,EACJ,OAAO,GAAY,SAAY,EAAQ,IAAY,EAAE,CAAI,EAO3D,OALkB,IAAIA,EAAAA,WAAW,eAC/B,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,EACD,CAEgB,OAAO,EAAS"}
1
+ {"version":3,"file":"date.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/date.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\ntype DateTimePreset = 'short' | 'long' | 'dateOnly' | 'timeOnly' | 'full';\n\nconst presets: Record<DateTimePreset, Intl.DateTimeFormatOptions> = {\n short: {\n year: '2-digit',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n },\n long: {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n },\n full: {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: false,\n },\n dateOnly: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n },\n timeOnly: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n};\n\n/**\n * Formats a date/time value into a localized string using Intl.DateTimeFormat.\n *\n * @example\n * date({ date: new Date(), options: \"short\" });\n * // \"08/02/25, 14:30\"\n *\n * @example\n * date({ date: \"2025-08-02T14:30:00Z\", locale: Locales.FRENCH, options: { month: \"long\", day: \"numeric\" } });\n * // \"2 août\"\n */\nexport const date = (\n date: Date | string | number,\n options?: Intl.DateTimeFormatOptions & { locale?: LocalesValues }\n): string => {\n const dateTime = new Date(date);\n\n const resolvedOptions =\n typeof options === 'string' ? (presets[options] ?? {}) : options;\n\n const formatter = new CachedIntl.DateTimeFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n resolvedOptions\n );\n\n return formatter.format(dateTime);\n};\n"],"mappings":"4LAMA,MAAM,EAA8D,CAClE,MAAO,CACL,KAAM,UACN,MAAO,UACP,IAAK,UACL,KAAM,UACN,OAAQ,UACT,CACD,KAAM,CACJ,KAAM,UACN,MAAO,OACP,IAAK,UACL,KAAM,UACN,OAAQ,UACT,CACD,KAAM,CACJ,KAAM,UACN,MAAO,OACP,IAAK,UACL,KAAM,UACN,OAAQ,UACR,OAAQ,GACT,CACD,SAAU,CACR,KAAM,UACN,MAAO,QACP,IAAK,UACN,CACD,SAAU,CACR,KAAM,UACN,OAAQ,UACR,OAAQ,UACT,CACF,CAaY,GACX,EACA,IACW,CACX,IAAM,EAAW,IAAI,KAAK,EAAK,CAEzB,EACJ,OAAO,GAAY,SAAY,EAAQ,IAAY,EAAE,CAAI,EAO3D,OALkB,IAAIA,EAAAA,WAAW,eAC/B,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,EACD,CAEgB,OAAO,EAAS"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e,r)=>new t.CachedIntl.ListFormat(r?.locale??n.default?.internationalization?.defaultLocale,{type:r?.type??`conjunction`,style:r?.style??`long`,...r}).format(e.map(String));exports.list=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.t(n);const r=(e,r)=>new t.CachedIntl.ListFormat(r?.locale??n.default?.internationalization?.defaultLocale,{type:r?.type??`conjunction`,style:r?.style??`long`,...r}).format(e.map(String));exports.list=r;
2
2
  //# sourceMappingURL=list.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/list.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats an array of values into a localized list string using the Intl API.\n *\n * @example\n * list(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * @example\n * list(['red', 'green', 'blue'], { locale: Locales.FRENCH, type: 'disjunction' });\n * // \"rouge, vert ou bleu\"\n *\n * @example\n * list([1, 2, 3], { type: 'unit' });\n * // \"1, 2, 3\"\n */\nexport const list = (\n values: (string | number)[],\n // @ts-ignore Namespace 'Intl' has no exported member 'ListFormatOptions'\n options?: Intl.ListFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.ListFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n type: options?.type ?? 'conjunction',\n style: options?.style ?? 'long',\n ...options,\n }\n ).format(values.map(String));\n"],"mappings":"8MAmBA,MAAa,GACX,EAEA,IAEA,IAAIA,EAAAA,WAAW,WACb,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,CACE,KAAM,GAAS,MAAQ,cACvB,MAAO,GAAS,OAAS,OACzB,GAAG,EACJ,CACF,CAAC,OAAO,EAAO,IAAI,OAAO,CAAC"}
1
+ {"version":3,"file":"list.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/list.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/** Locally defined subset of Intl.ListFormatOptions so consumers don't need ES2021.Intl in their lib. */\ntype ListFormatOptions = {\n localeMatcher?: 'lookup' | 'best fit';\n type?: 'conjunction' | 'disjunction' | 'unit';\n style?: 'long' | 'short' | 'narrow';\n};\n\n/**\n * Formats an array of values into a localized list string using the Intl API.\n *\n * @example\n * list(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * @example\n * list(['red', 'green', 'blue'], { locale: Locales.FRENCH, type: 'disjunction' });\n * // \"rouge, vert ou bleu\"\n *\n * @example\n * list([1, 2, 3], { type: 'unit' });\n * // \"1, 2, 3\"\n */\nexport const list = (\n values: (string | number)[],\n options?: ListFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.ListFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n type: options?.type ?? 'conjunction',\n style: options?.style ?? 'long',\n ...options,\n }\n ).format(values.map(String));\n"],"mappings":"4LA0BA,MAAa,GACX,EACA,IAEA,IAAIA,EAAAA,WAAW,WACb,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,CACE,KAAM,GAAS,MAAQ,cACvB,MAAO,GAAS,OAAS,OACzB,GAAG,EACJ,CACF,CAAC,OAAO,EAAO,IAAI,OAAO,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e,r)=>new t.CachedIntl.NumberFormat(r?.locale??n.default?.internationalization?.defaultLocale,r).format(Number(e));exports.number=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.t(n);const r=(e,r)=>new t.CachedIntl.NumberFormat(r?.locale??n.default?.internationalization?.defaultLocale,r).format(Number(e));exports.number=r;
2
2
  //# sourceMappingURL=number.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"number.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/number.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using locale-aware formatting.\n *\n * @example\n * number({ value: 123456.789 }); // \"123,456.789\"\n * number({ value: \"1000000\", locale: Locales.FRENCH }); // \"1 000 000\"\n */\nexport const number = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n options\n ).format(Number(value));\n"],"mappings":"8MAWA,MAAa,GACX,EACA,IAEA,IAAIA,EAAAA,WAAW,aACb,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,EACD,CAAC,OAAO,OAAO,EAAM,CAAC"}
1
+ {"version":3,"file":"number.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/number.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using locale-aware formatting.\n *\n * @example\n * number({ value: 123456.789 }); // \"123,456.789\"\n * number({ value: \"1000000\", locale: Locales.FRENCH }); // \"1 000 000\"\n */\nexport const number = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n options\n ).format(Number(value));\n"],"mappings":"4LAWA,MAAa,GACX,EACA,IAEA,IAAIA,EAAAA,WAAW,aACb,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,EACD,CAAC,OAAO,OAAO,EAAM,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e,r)=>{let i=Number(e);return i>1&&(i/=100),new t.CachedIntl.NumberFormat(r?.locale??n.default?.internationalization?.defaultLocale,{style:`percent`,...r}).format(Number(i))};exports.percentage=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.t(n);const r=(e,r)=>{let i=Number(e);return i>1&&(i/=100),new t.CachedIntl.NumberFormat(r?.locale??n.default?.internationalization?.defaultLocale,{style:`percent`,...r}).format(Number(i))};exports.percentage=r;
2
2
  //# sourceMappingURL=percentage.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"percentage.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/percentage.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a number as a percentage string (e.g., 0.25 → \"25%\").\n *\n * @example\n * percentage({ value: 0.25 }) // \"25%\"\n * percentage({ value: 0.25, minimumFractionDigits: 2 }) // \"25.00%\"\n */\nexport const percentage = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string => {\n let numericValue = Number(value);\n\n // Normalize: if user passes 10, treat it as 10% instead of 1000%\n if (numericValue > 1) {\n numericValue /= 100;\n }\n\n const formatter = new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n style: 'percent',\n ...options,\n }\n );\n\n return formatter.format(Number(numericValue));\n};\n"],"mappings":"8MAWA,MAAa,GACX,EACA,IACW,CACX,IAAI,EAAe,OAAO,EAAM,CAehC,OAZI,EAAe,IACjB,GAAgB,KAGA,IAAIA,EAAAA,WAAW,aAC/B,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,CACE,MAAO,UACP,GAAG,EACJ,CACF,CAEgB,OAAO,OAAO,EAAa,CAAC"}
1
+ {"version":3,"file":"percentage.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/percentage.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a number as a percentage string (e.g., 0.25 → \"25%\").\n *\n * @example\n * percentage({ value: 0.25 }) // \"25%\"\n * percentage({ value: 0.25, minimumFractionDigits: 2 }) // \"25.00%\"\n */\nexport const percentage = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string => {\n let numericValue = Number(value);\n\n // Normalize: if user passes 10, treat it as 10% instead of 1000%\n if (numericValue > 1) {\n numericValue /= 100;\n }\n\n const formatter = new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n style: 'percent',\n ...options,\n }\n );\n\n return formatter.format(Number(numericValue));\n};\n"],"mappings":"4LAWA,MAAa,GACX,EACA,IACW,CACX,IAAI,EAAe,OAAO,EAAM,CAehC,OAZI,EAAe,IACjB,GAAgB,KAGA,IAAIA,EAAAA,WAAW,aAC/B,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,CACE,MAAO,UACP,GAAG,EACJ,CACF,CAEgB,OAAO,OAAO,EAAa,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e,t,n)=>{let r=(t.getTime()-e.getTime())/1e3;switch(n){case`second`:return r;case`minute`:return r/60;case`hour`:return r/3600;case`day`:return r/86400;case`month`:return r/(30*86400);case`quarter`:return r/(90*86400);case`year`:return r/(365*86400);default:return r}},i=(e,i=new Date,a)=>{let o=new Date(e),s=new Date(i),c=a?.unit??`second`,l=r(o,s,c);return new t.CachedIntl.RelativeTimeFormat(a?.locale??n.default?.internationalization?.defaultLocale,a).format(Math.round(l),c)};exports.relativeTime=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.t(n);const r=(e,t,n)=>{let r=(t.getTime()-e.getTime())/1e3;switch(n){case`second`:return r;case`minute`:return r/60;case`hour`:return r/3600;case`day`:return r/86400;case`month`:return r/(30*86400);case`quarter`:return r/(90*86400);case`year`:return r/(365*86400);default:return r}},i=(e,i=new Date,a)=>{let o=new Date(e),s=new Date(i),c=a?.unit??`second`,l=r(o,s,c);return new t.CachedIntl.RelativeTimeFormat(a?.locale??n.default?.internationalization?.defaultLocale,a).format(Math.round(l),c)};exports.relativeTime=i;
2
2
  //# sourceMappingURL=relativeTime.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"relativeTime.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/relativeTime.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\ntype RelativeTimeUnit = Intl.RelativeTimeFormatUnit;\n\n/**\n * Calculate the difference between 2 dates in the given unit.\n */\nconst diffInUnit = (from: Date, to: Date, unit: RelativeTimeUnit): number => {\n const msDiff = to.getTime() - from.getTime();\n const sec = msDiff / 1000;\n\n switch (unit) {\n case 'second':\n return sec;\n case 'minute':\n return sec / 60;\n case 'hour':\n return sec / 3600;\n case 'day':\n return sec / 86400;\n case 'month':\n return sec / (30 * 86400); // approx\n case 'quarter':\n return sec / (3 * 30 * 86400); // 3 months approx\n case 'year':\n return sec / (365 * 86400); // approx\n default:\n return sec;\n }\n};\n\nexport const relativeTime = (\n from: Date | string | number,\n to: Date | string | number = new Date(),\n options?: Intl.RelativeTimeFormatOptions & {\n locale?: LocalesValues;\n unit?: RelativeTimeUnit;\n }\n): string => {\n const fromDate = new Date(from);\n const toDate = new Date(to);\n const unit = options?.unit ?? 'second';\n\n const value = diffInUnit(fromDate, toDate, unit);\n\n return new CachedIntl.RelativeTimeFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n options\n ).format(Math.round(value), unit);\n};\n"],"mappings":"8MASA,MAAM,GAAc,EAAY,EAAU,IAAmC,CAE3E,IAAM,GADS,EAAG,SAAS,CAAG,EAAK,SAAS,EACvB,IAErB,OAAQ,EAAR,CACE,IAAK,SACH,OAAO,EACT,IAAK,SACH,OAAO,EAAM,GACf,IAAK,OACH,OAAO,EAAM,KACf,IAAK,MACH,OAAO,EAAM,MACf,IAAK,QACH,OAAO,GAAO,GAAK,OACrB,IAAK,UACH,OAAO,GAAO,GAAS,OACzB,IAAK,OACH,OAAO,GAAO,IAAM,OACtB,QACE,OAAO,IAIA,GACX,EACA,EAA6B,IAAI,KACjC,IAIW,CACX,IAAM,EAAW,IAAI,KAAK,EAAK,CACzB,EAAS,IAAI,KAAK,EAAG,CACrB,EAAO,GAAS,MAAQ,SAExB,EAAQ,EAAW,EAAU,EAAQ,EAAK,CAEhD,OAAO,IAAIA,EAAAA,WAAW,mBACpB,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,EACD,CAAC,OAAO,KAAK,MAAM,EAAM,CAAE,EAAK"}
1
+ {"version":3,"file":"relativeTime.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/relativeTime.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\ntype RelativeTimeUnit = Intl.RelativeTimeFormatUnit;\n\n/**\n * Calculate the difference between 2 dates in the given unit.\n */\nconst diffInUnit = (from: Date, to: Date, unit: RelativeTimeUnit): number => {\n const msDiff = to.getTime() - from.getTime();\n const sec = msDiff / 1000;\n\n switch (unit) {\n case 'second':\n return sec;\n case 'minute':\n return sec / 60;\n case 'hour':\n return sec / 3600;\n case 'day':\n return sec / 86400;\n case 'month':\n return sec / (30 * 86400); // approx\n case 'quarter':\n return sec / (3 * 30 * 86400); // 3 months approx\n case 'year':\n return sec / (365 * 86400); // approx\n default:\n return sec;\n }\n};\n\nexport const relativeTime = (\n from: Date | string | number,\n to: Date | string | number = new Date(),\n options?: Intl.RelativeTimeFormatOptions & {\n locale?: LocalesValues;\n unit?: RelativeTimeUnit;\n }\n): string => {\n const fromDate = new Date(from);\n const toDate = new Date(to);\n const unit = options?.unit ?? 'second';\n\n const value = diffInUnit(fromDate, toDate, unit);\n\n return new CachedIntl.RelativeTimeFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n options\n ).format(Math.round(value), unit);\n};\n"],"mappings":"4LASA,MAAM,GAAc,EAAY,EAAU,IAAmC,CAE3E,IAAM,GADS,EAAG,SAAS,CAAG,EAAK,SAAS,EACvB,IAErB,OAAQ,EAAR,CACE,IAAK,SACH,OAAO,EACT,IAAK,SACH,OAAO,EAAM,GACf,IAAK,OACH,OAAO,EAAM,KACf,IAAK,MACH,OAAO,EAAM,MACf,IAAK,QACH,OAAO,GAAO,GAAK,OACrB,IAAK,UACH,OAAO,GAAO,GAAS,OACzB,IAAK,OACH,OAAO,GAAO,IAAM,OACtB,QACE,OAAO,IAIA,GACX,EACA,EAA6B,IAAI,KACjC,IAIW,CACX,IAAM,EAAW,IAAI,KAAK,EAAK,CACzB,EAAS,IAAI,KAAK,EAAG,CACrB,EAAO,GAAS,MAAQ,SAExB,EAAQ,EAAW,EAAU,EAAQ,EAAK,CAEhD,OAAO,IAAIA,EAAAA,WAAW,mBACpB,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,EACD,CAAC,OAAO,KAAK,MAAM,EAAM,CAAE,EAAK"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e,r)=>new t.CachedIntl.NumberFormat(r?.locale??n.default?.internationalization?.defaultLocale,{style:`unit`,unit:r?.unit??`day`,unitDisplay:r?.unitDisplay??`short`,useGrouping:r?.useGrouping??!1}).format(Number(e));exports.units=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.t(n);const r=(e,r)=>new t.CachedIntl.NumberFormat(r?.locale??n.default?.internationalization?.defaultLocale,{style:`unit`,unit:r?.unit??`day`,unitDisplay:r?.unitDisplay??`short`,useGrouping:r?.useGrouping??!1}).format(Number(e));exports.units=r;
2
2
  //# sourceMappingURL=units.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"units.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/units.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value as a localized unit string.\n *\n * @example\n * units({ value: 5, unit: \"kilometer\", unitDisplay: \"long\", locale: \"en-GB\" })\n * // \"5 kilometers\"\n */\nexport const units = (\n value: number | string,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n style: 'unit',\n unit: options?.unit ?? 'day',\n unitDisplay: options?.unitDisplay ?? 'short',\n useGrouping: options?.useGrouping ?? false,\n }\n ).format(Number(value));\n"],"mappings":"8MAWA,MAAa,GACX,EACA,IAEA,IAAIA,EAAAA,WAAW,aACb,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,CACE,MAAO,OACP,KAAM,GAAS,MAAQ,MACvB,YAAa,GAAS,aAAe,QACrC,YAAa,GAAS,aAAe,GACtC,CACF,CAAC,OAAO,OAAO,EAAM,CAAC"}
1
+ {"version":3,"file":"units.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/units.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value as a localized unit string.\n *\n * @example\n * units({ value: 5, unit: \"kilometer\", unitDisplay: \"long\", locale: \"en-GB\" })\n * // \"5 kilometers\"\n */\nexport const units = (\n value: number | string,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n style: 'unit',\n unit: options?.unit ?? 'day',\n unitDisplay: options?.unitDisplay ?? 'short',\n useGrouping: options?.useGrouping ?? false,\n }\n ).format(Number(value));\n"],"mappings":"4LAWA,MAAa,GACX,EACA,IAEA,IAAIA,EAAAA,WAAW,aACb,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,CACE,MAAO,OACP,KAAM,GAAS,MAAQ,MACvB,YAAa,GAAS,aAAe,QACrC,YAAa,GAAS,aAAe,GACtC,CACF,CAAC,OAAO,OAAO,EAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./interpreter/getCondition.cjs`),n=require(`./interpreter/getContent/deepTransform.cjs`),r=require(`./interpreter/getEnumeration.cjs`),i=require(`./interpreter/getGender.cjs`),a=require(`./interpreter/getInsertion.cjs`),o=require(`./interpreter/getTranslation.cjs`);let s=require(`@intlayer/types/nodeType`),c=require(`@intlayer/config/built`);c=e.t(c);let l=require(`@intlayer/config/logger`),u=require(`@intlayer/dictionaries-entry`);const d=(e,t,n=S(t))=>{let r={dictionaryKey:e.key,dictionaryPath:e.filePath,keyPath:[],plugins:n};return C(e.content,r,n)},f=(e=``)=>new Proxy(()=>e,{get:(t,n)=>{if(n===`toJSON`||n===Symbol.toPrimitive||n===`toString`)return()=>e;if(n!==`then`)return f(e?`${e}.${String(n)}`:String(n))},apply:()=>e}),p=(e,t,n)=>{let r=(0,u.getDictionaries)()[e];return r?d(r,t,n):((0,l.getAppLogger)(c.default)(`Dictionary ${(0,l.colorizeKey)(e)} was not found. Using fallback proxy.`,{level:`warn`,isVerbose:!0}),process.env.NODE_ENV,f(e))},m=(e,t,n)=>{let r=p(e,n?.locale,n?.plugins);if(typeof t==`string`){let e=t.split(`.`),n=r;for(let t of e)if(n=n?.[t],n===void 0)return r;return n}return r},h=(e,t)=>({id:`translation-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===s.NodeType.Translation,transform:(n,r,i)=>{let a={...n[s.NodeType.Translation]??{}};for(let e in a){let t={...r,children:a[e],keyPath:[...r.keyPath,{type:s.NodeType.Translation,key:e}]};a[e]=i(a[e],t)}return o.getTranslation(a,e,t)}}),g={id:`enumeration-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===s.NodeType.Enumeration,transform:(e,t,n)=>{let i={...e[s.NodeType.Enumeration]};for(let e in i){let r=i[e];i[e]=n(r,{...t,children:r,keyPath:[...t.keyPath,{type:s.NodeType.Enumeration,key:e}]})}return e=>{let t=r.getEnumeration(i,typeof e==`number`?e:e.count);return typeof t==`function`&&typeof e==`object`?t(e):t}}},_={id:`condition-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===s.NodeType.Condition,transform:(e,n,r)=>{let i={...e[s.NodeType.Condition]};for(let e in i){let t=i[e];i[e]=r(t,{...n,children:t,keyPath:[...n.keyPath,{type:s.NodeType.Condition,key:e}]})}return e=>{let n=t.getCondition(i,typeof e==`boolean`?e:e.value);return typeof n==`function`&&typeof e==`object`?n(e):n}}},v={id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===s.NodeType.Insertion,transform:(e,t,n)=>{let r=[...t.keyPath,{type:s.NodeType.Insertion}],i=e[s.NodeType.Insertion],o={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,n,r)=>{let i=r(e,{...n,children:e,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]});return e=>{let o=a.getInsertion(i,e);return r(o,{...n,plugins:t.plugins,children:o})}}};return n(i,{...t,children:i,keyPath:r,plugins:[o,...t.plugins??[]]})}},y={id:`gender-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===s.NodeType.Gender,transform:(e,t,n)=>{let r={...e[s.NodeType.Gender]};for(let e in r){let i=r[e];r[e]=n(i,{...t,children:i,keyPath:[...t.keyPath,{type:s.NodeType.Gender,key:e}]})}return e=>i.getGender(r,e)}},b=e=>({id:`nested-plugin`,canHandle:e=>typeof e==`object`&&(e?.nodeType===s.NodeType.Nested||e?.nodeType===`nested`),transform:(t,n)=>m(t.nested.dictionaryKey,t.nested.path,{...n,locale:e??n.locale})}),x={id:`file-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===s.NodeType.File,transform:(e,t,n)=>n(e.content,{...t,children:e.content})},S=(e,t=!0)=>[h(e??c.default.internationalization.defaultLocale,t?c.default.internationalization.defaultLocale:void 0),g,_,v,b(e??c.default.internationalization.defaultLocale),x,y],C=(e,t,r=[])=>n.deepTransformNode(e,{...t,plugins:r});Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return m}});
2
+ //# sourceMappingURL=getContent-DrqM8pqO.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getContent-DrqM8pqO.cjs","names":["configuration","NodeType","getTranslation","getEnumeration","getCondition","getInsertion","getGender","configuration","deepTransformNode"],"sources":["../../src/interpreter/getDictionary.ts","../../src/interpreter/getIntlayer.ts","../../src/interpreter/getNesting.ts","../../src/interpreter/getContent/plugins.ts","../../src/interpreter/getContent/getContent.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport type {\n DeepTransformContent,\n IInterpreterPluginState,\n NodeProps,\n Plugins,\n} from './getContent';\nimport { getBasePlugins, getContent } from './getContent/getContent';\n\n/**\n * Transforms a dictionary in a single pass, applying each plugin as needed.\n *\n * @param dictionary The dictionary to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n * @param additionalPlugins An array of NodeTransformer that define how to transform recognized nodes.\n * If omitted, we’ll use a default set of plugins.\n */\nexport const getDictionary = <\n T extends Dictionary,\n L extends LocalesValues = DeclaredLocales,\n>(\n dictionary: T,\n locale?: L,\n plugins: Plugins[] = getBasePlugins(locale)\n): DeepTransformContent<T['content'], IInterpreterPluginState, L> => {\n const props: NodeProps = {\n dictionaryKey: dictionary.key,\n dictionaryPath: dictionary.filePath,\n keyPath: [],\n plugins,\n };\n\n return getContent(dictionary.content, props, plugins);\n};\n","import configuration from '@intlayer/config/built';\nimport { colorizeKey, getAppLogger } from '@intlayer/config/logger';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryContent,\n DictionaryRegistryElement,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport type {\n DeepTransformContent,\n IInterpreterPluginState,\n Plugins,\n} from './getContent';\nimport { getDictionary } from './getDictionary';\n\n/**\n * Creates a Recursive Proxy that returns the path of the accessed key\n * stringified. This prevents the app from crashing on undefined access.\n */\nconst createSafeFallback = (path = ''): any => {\n return new Proxy(\n // Target is a function so it can be called if the dictionary expects a function\n () => path,\n {\n get: (_target, prop) => {\n // Handle common object methods to prevent infinite recursion or weird behavior\n if (\n prop === 'toJSON' ||\n prop === Symbol.toPrimitive ||\n prop === 'toString'\n ) {\n return () => path;\n }\n if (prop === 'then') {\n return undefined; // Prevent it from being treated as a Promise\n }\n\n // Recursively build the path (e.g., \"myDictionary.home.title\")\n const nextPath = path ? `${path}.${String(prop)}` : String(prop);\n return createSafeFallback(nextPath);\n },\n // If the code tries to execute the missing key as a function: t.title()\n apply: () => {\n return path;\n },\n }\n );\n};\n\nexport const getIntlayer = <\n T extends DictionaryKeys,\n L extends LocalesValues = DeclaredLocales,\n>(\n key: T,\n locale?: L,\n plugins?: Plugins[]\n): DeepTransformContent<\n DictionaryRegistryContent<T>,\n IInterpreterPluginState,\n L\n> => {\n const dictionaries = getDictionaries();\n const dictionary = dictionaries[key as T] as DictionaryRegistryElement<T>;\n\n if (!dictionary) {\n // Log a warning instead of throwing (so developers know it's missing)\n const logger = getAppLogger(configuration);\n logger(\n `Dictionary ${colorizeKey(key as string)} was not found. Using fallback proxy.`,\n {\n level: 'warn',\n isVerbose: true,\n }\n );\n\n if (process.env.NODE_ENV === 'development') {\n // Return the Safe Proxy\n // We initialize it with the dictionary key name so the UI shows \"my-dictionary.someKey\"\n return createSafeFallback(key as string);\n }\n\n return createSafeFallback(key as string);\n }\n\n return getDictionary<DictionaryRegistryElement<T>, L>(\n dictionary,\n locale,\n plugins\n );\n};\n","import type { DictionaryKeys, DictionaryRegistryContent } from '@intlayer/types/module_augmentation';\nimport type { GetSubPath } from '@intlayer/types/dictionary';\nimport type { ValidDotPathsFor } from '../transpiler';\nimport type {\n DeepTransformContent,\n IInterpreterPluginState,\n NodeProps,\n} from './getContent';\nimport { getIntlayer } from './getIntlayer';\n\nexport type GetNestingResult<\n K extends DictionaryKeys,\n P = undefined,\n S = IInterpreterPluginState,\n> = GetSubPath<DeepTransformContent<DictionaryRegistryContent<K>, S>, P>;\n\n/**\n * Extracts content from another dictionary by its key and an optional path.\n *\n * This allows for reusing content across different dictionaries.\n *\n * @param dictionaryKey - The key of the dictionary to nest.\n * @param path - Optional dot-separated path to a specific field within the nested dictionary.\n * @param props - Optional properties like locale and plugins.\n * @returns The nested content.\n *\n * @example\n * ```ts\n * const content = getNesting(\"common\", \"buttons.save\");\n * // 'Save'\n * ```\n */\nexport const getNesting = <K extends DictionaryKeys, P>(\n dictionaryKey: K,\n path?: P extends ValidDotPathsFor<K> ? P : never,\n props?: NodeProps\n): GetNestingResult<K, P> => {\n const dictionary = getIntlayer(dictionaryKey, props?.locale, props?.plugins);\n\n if (typeof path === 'string') {\n const pathArray = (path as string).split('.');\n let current: any = dictionary;\n\n for (const key of pathArray) {\n // Safely traverse down the object using the path\n current = current?.[key];\n // If we cannot find the path, return the whole dictionary as a fallback\n if (current === undefined) {\n return dictionary as any;\n }\n }\n\n return current;\n }\n\n // Default or error handling if path is not a string or otherwise undefined\n return dictionary as any;\n};\n","import type { Locale } from '@intlayer/types/allLocales';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { NodeType } from '@intlayer/types/nodeType';\nimport type {\n ConditionContent,\n EnumerationContent,\n FileContent,\n Gender,\n GenderContent,\n InsertionContent,\n NestedContent,\n TranslationContent,\n} from '../../transpiler';\nimport { getCondition } from '../getCondition';\nimport { getEnumeration } from '../getEnumeration';\nimport { getGender } from '../getGender';\nimport { getInsertion } from '../getInsertion';\nimport { type GetNestingResult, getNesting } from '../getNesting';\nimport { getTranslation } from '../getTranslation';\n\n/** ---------------------------------------------\n * PLUGIN DEFINITION\n * --------------------------------------------- */\n\n/**\n * A plugin/transformer that can optionally transform a node during a single DFS pass.\n * - `canHandle` decides if the node is transformable by this plugin.\n * - `transform` returns the transformed node (and does not recurse further).\n *\n * > `transformFn` is a function that can be used to deeply transform inside the plugin.\n */\nexport type Plugins = {\n id: string;\n canHandle: (node: any) => boolean;\n transform: (\n node: any,\n props: NodeProps,\n transformFn: (node: any, props: NodeProps) => any\n ) => any;\n};\n\n/** ---------------------------------------------\n * TRANSLATION PLUGIN\n * --------------------------------------------- */\n\nexport type UnionKeys<T> = T extends unknown ? keyof T : never;\nexport type ValueAtKey<T, K> = T extends unknown\n ? K extends keyof T\n ? T[K]\n : never\n : never;\n\nexport type TranslationCond<T, S, L extends LocalesValues> = T extends {\n nodeType: NodeType | string;\n [NodeType.Translation]: infer U;\n}\n ? U extends Record<PropertyKey, unknown>\n ? U[keyof U] extends Record<PropertyKey, unknown>\n ? {\n [K in UnionKeys<U[keyof U]>]: L extends keyof U\n ? K extends keyof U[L]\n ? U[L][K]\n : ValueAtKey<U[keyof U], K>\n : ValueAtKey<U[keyof U], K>;\n } extends infer Content\n ? DeepTransformContent<Content, S>\n : never\n : (L extends keyof U ? U[L] : U[keyof U]) extends infer Content\n ? DeepTransformContent<Content, S>\n : never\n : never\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const translationPlugin = (\n locale: LocalesValues,\n fallback?: LocalesValues\n): Plugins => ({\n id: 'translation-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Translation,\n transform: (node: TranslationContent, props, deepTransformNode) => {\n const result = {\n ...(node[NodeType.Translation] ?? {}),\n };\n\n for (const key in result) {\n const childProps = {\n ...props,\n children: result[key as keyof typeof result],\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Translation, key } as KeyPath,\n ],\n };\n result[key as keyof typeof result] = deepTransformNode(\n result[key as keyof typeof result],\n childProps\n );\n }\n\n return getTranslation(result, locale, fallback);\n },\n});\n\n/** ---------------------------------------------\n * ENUMERATION PLUGIN\n * --------------------------------------------- */\n\nexport type EnumerationCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeType.Enumeration]: object;\n}\n ? (\n quantity: number\n ) => DeepTransformContent<\n T[NodeType.Enumeration][keyof T[NodeType.Enumeration]],\n S\n >\n : never;\n\n/** Enumeration plugin. Replaces node with a function that takes quantity => string. */\nexport const enumerationPlugin: Plugins = {\n id: 'enumeration-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Enumeration,\n transform: (node: EnumerationContent, props, deepTransformNode) => {\n const result = { ...node[NodeType.Enumeration] };\n\n for (const key in result) {\n const child = result[key as unknown as keyof typeof result];\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Enumeration, key } as KeyPath,\n ],\n };\n result[key as unknown as keyof typeof result] = deepTransformNode(\n child,\n childProps\n );\n }\n\n return (arg: number | { count: number }) => {\n const quantity = typeof arg === 'number' ? arg : arg.count;\n const subResult = getEnumeration(result, quantity);\n\n if (typeof subResult === 'function' && typeof arg === 'object') {\n return subResult(arg);\n }\n\n return subResult;\n };\n },\n};\n\n/** ---------------------------------------------\n * CONDITION PLUGIN\n * --------------------------------------------- */\n\nexport type ConditionCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeType.Condition]: object;\n}\n ? (\n value: boolean | { value: boolean }\n ) => DeepTransformContent<\n T[NodeType.Condition][keyof T[NodeType.Condition]],\n S\n >\n : never;\n\n/** Condition plugin. Replaces node with a function that takes boolean => string. */\nexport const conditionPlugin: Plugins = {\n id: 'condition-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Condition,\n transform: (node: ConditionContent, props, deepTransformNode) => {\n const result = { ...node[NodeType.Condition] };\n\n for (const key in result) {\n const child = result[key as keyof typeof result];\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Condition, key } as KeyPath,\n ],\n };\n result[key as unknown as keyof typeof result] = deepTransformNode(\n child,\n childProps\n );\n }\n\n return (arg: boolean | { value: boolean }) => {\n const value = typeof arg === 'boolean' ? arg : arg.value;\n const subResult = getCondition(result, value);\n\n if (typeof subResult === 'function' && typeof arg === 'object') {\n return subResult(arg);\n }\n\n return subResult;\n };\n },\n};\n\n/** ---------------------------------------------\n * INSERTION PLUGIN\n * --------------------------------------------- */\n\nexport type InsertionCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeType.Insertion]: string;\n fields: readonly string[];\n}\n ? (\n values: {\n [K in T['fields'][number]]: string | number;\n }\n ) => DeepTransformContent<string, S>\n : never;\n\n/** Insertion plugin. Replaces node with a function that takes quantity => string. */\nexport const insertionPlugin: Plugins = {\n id: 'insertion-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Insertion,\n transform: (node: InsertionContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeType.Insertion,\n },\n ];\n\n const children = node[NodeType.Insertion];\n\n /** Insertion string plugin. Replaces string node with a component that render the insertion. */\n const insertionStringPlugin: Plugins = {\n id: 'insertion-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, subProps, deepTransformNode) => {\n const transformedResult = deepTransformNode(node, {\n ...subProps,\n children: node,\n plugins: [\n ...(props.plugins ?? ([] as Plugins[])).filter(\n (plugin) => plugin.id !== 'intlayer-node-plugin'\n ),\n ],\n });\n\n return (\n values: {\n [K in InsertionContent['fields'][number]]: string | number;\n }\n ) => {\n const children = getInsertion(transformedResult, values);\n\n return deepTransformNode(children, {\n ...subProps,\n plugins: props.plugins,\n children,\n });\n };\n },\n };\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [insertionStringPlugin, ...(props.plugins ?? [])],\n });\n },\n};\n\n/** ---------------------------------------------\n * GENDER PLUGIN\n * --------------------------------------------- */\n\nexport type GenderCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeType.Gender]: object;\n}\n ? (\n value: Gender\n ) => DeepTransformContent<T[NodeType.Gender][keyof T[NodeType.Gender]], S>\n : never;\n\n/** Gender plugin. Replaces node with a function that takes gender => string. */\nexport const genderPlugin: Plugins = {\n id: 'gender-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Gender,\n transform: (node: GenderContent, props, deepTransformNode) => {\n const result = { ...node[NodeType.Gender] };\n\n for (const key in result) {\n const child = result[key as keyof typeof result];\n const childProps = {\n ...props,\n children: child,\n keyPath: [...props.keyPath, { type: NodeType.Gender, key } as KeyPath],\n };\n result[key as keyof typeof result] = deepTransformNode(child, childProps);\n }\n\n return (value: Gender) => getGender(result, value);\n },\n};\n\n/** ---------------------------------------------\n * NESTED PLUGIN\n * --------------------------------------------- */\n\nexport type NestedCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeType.Nested]: infer U;\n}\n ? U extends {\n dictionaryKey: infer K extends DictionaryKeys;\n path?: infer P;\n }\n ? GetNestingResult<K, P, S>\n : never\n : never;\n\n/** Nested plugin. Replaces node with the result of `getNesting`. */\nexport const nestedPlugin = (locale?: LocalesValues): Plugins => ({\n id: 'nested-plugin',\n canHandle: (node) =>\n typeof node === 'object' &&\n (node?.nodeType === NodeType.Nested || node?.nodeType === 'nested'),\n transform: (node: NestedContent, props) =>\n getNesting(node.nested.dictionaryKey, node.nested.path, {\n ...props,\n locale: (locale ?? props.locale) as Locale,\n }),\n});\n\n/** ---------------------------------------------\n * FILE PLUGIN\n * --------------------------------------------- */\n\nexport type FileCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeType.File]: string;\n content?: string;\n}\n ? string\n : never;\n\n/** File plugin. Replaces node with the result of `getNesting`. */\nexport const filePlugin: Plugins = {\n id: 'file-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.File,\n transform: (node: FileContent, props, deepTransform) =>\n deepTransform(node.content, {\n ...props,\n children: node.content,\n }),\n};\n\n/**\n * PLUGIN RESULT\n */\n\n/**\n * Interface that defines the properties of a node.\n * This interface can be augmented in other packages, such as `react-intlayer`.\n */\nexport interface NodeProps {\n dictionaryKey: string;\n keyPath: KeyPath[];\n plugins?: Plugins[];\n locale?: Locale;\n dictionaryPath?: string;\n children?: any;\n}\n\n/**\n * Interface that defines the plugins that can be used to transform a node.\n * This interface can be augmented in other packages, such as `react-intlayer`.\n */\nexport interface IInterpreterPlugin<T, S, L extends LocalesValues> {\n translation: TranslationCond<T, S, L>;\n enumeration: EnumerationCond<T, S, L>;\n condition: ConditionCond<T, S, L>;\n insertion: InsertionCond<T, S, L>;\n gender: GenderCond<T, S, L>;\n nested: NestedCond<T, S, L>;\n file: FileCond<T>;\n}\n\n/**\n * Allow to avoid overwriting import from `intlayer` package when `IInterpreterPlugin<T>` interface is augmented in another package, such as `react-intlayer`.\n */\nexport type IInterpreterPluginState = {\n translation: true;\n enumeration: true;\n condition: true;\n insertion: true;\n gender: true;\n nested: true;\n file: true;\n};\n\n/**\n * Utility type to check if a plugin can be applied to a node.\n */\ntype CheckApplyPlugin<\n T,\n K extends keyof IInterpreterPlugin<T, S, L>,\n S,\n L extends LocalesValues = DeclaredLocales,\n> = K extends keyof S // Test if the key is a key of S.\n ? // Test if the key of S is true. Then the plugin can be applied.\n S[K] extends true\n ? // Test if the key of S exist\n IInterpreterPlugin<T, S, L>[K] extends never\n ? never\n : // Test if the plugin condition is true (if it's not, the plugin is skipped for this node)\n IInterpreterPlugin<T, S, L>[K]\n : never\n : never;\n\n/**\n * Traverse recursively through an object or array, applying each plugin as needed.\n */\ntype Traverse<T, S, L extends LocalesValues = DeclaredLocales> =\n T extends ReadonlyArray<infer U> // Turn any read-only array into a plain mutable array\n ? Array<DeepTransformContent<U, S, L>>\n : T extends object\n ? { [K in keyof T]: DeepTransformContent<T[K], S, L> }\n : T;\n\nexport type IsAny<T> = 0 extends 1 & T ? true : false;\n\n/**\n * Traverse recursively through an object or array, applying each plugin as needed.\n */\nexport type DeepTransformContent<\n T,\n S = IInterpreterPluginState,\n L extends LocalesValues = DeclaredLocales,\n> =\n IsAny<T> extends true\n ? T\n : CheckApplyPlugin<T, keyof IInterpreterPlugin<T, S, L>, S, L> extends never // Check if there is a plugin for T:\n ? // No plugin was found, so try to transform T recursively:\n Traverse<T, S, L>\n : // A plugin was found – use the plugin’s transformation.\n CheckApplyPlugin<T, keyof IInterpreterPlugin<T, S, L>, S, L>;\n","import configuration from '@intlayer/config/built';\nimport type { ContentNode } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { deepTransformNode } from './deepTransform';\nimport {\n conditionPlugin,\n type DeepTransformContent,\n enumerationPlugin,\n filePlugin,\n genderPlugin,\n type IInterpreterPluginState,\n insertionPlugin,\n type NodeProps,\n nestedPlugin,\n type Plugins,\n translationPlugin,\n} from './plugins';\n\nexport const getBasePlugins = (\n locale?: LocalesValues,\n fallback: boolean = true\n): Plugins[] => [\n translationPlugin(\n locale ?? configuration.internationalization.defaultLocale,\n fallback ? configuration.internationalization.defaultLocale : undefined\n ),\n enumerationPlugin,\n conditionPlugin,\n insertionPlugin,\n nestedPlugin(locale ?? configuration.internationalization.defaultLocale),\n filePlugin,\n genderPlugin,\n];\n\n/**\n * Transforms a node in a single pass, applying each plugin as needed.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getContent = <\n T extends ContentNode,\n L extends LocalesValues = DeclaredLocales,\n>(\n node: T,\n nodeProps: NodeProps,\n plugins: Plugins[] = []\n) =>\n deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T, IInterpreterPluginState, L>;\n"],"mappings":"ueAqBA,MAAa,GAIX,EACA,EACA,EAAqB,EAAe,EAAO,GACwB,CACnE,IAAM,EAAmB,CACvB,cAAe,EAAW,IAC1B,eAAgB,EAAW,SAC3B,QAAS,EAAE,CACX,UACD,CAED,OAAO,EAAW,EAAW,QAAS,EAAO,EAAQ,ECfjD,GAAsB,EAAO,KAC1B,IAAI,UAEH,EACN,CACE,KAAM,EAAS,IAAS,CAEtB,GACE,IAAS,UACT,IAAS,OAAO,aAChB,IAAS,WAET,UAAa,EAEX,OAAS,OAMb,OAAO,EADU,EAAO,GAAG,EAAK,GAAG,OAAO,EAAK,GAAK,OAAO,EAAK,CAC7B,EAGrC,UACS,EAEV,CACF,CAGU,GAIX,EACA,EACA,IAKG,CAEH,IAAM,GAAA,EAAA,EAAA,kBADgC,CACN,GAsBhC,OApBK,EAoBE,EACL,EACA,EACA,EACD,GArBC,EAAA,EAAA,cAD4BA,EAAAA,QAAc,CAExC,eAAA,EAAA,EAAA,aAA0B,EAAc,CAAC,uCACzC,CACE,MAAO,OACP,UAAW,GACZ,CACF,CAEG,QAAQ,IAAI,SAGP,EAAmB,EAAc,GChDjC,GACX,EACA,EACA,IAC2B,CAC3B,IAAM,EAAa,EAAY,EAAe,GAAO,OAAQ,GAAO,QAAQ,CAE5E,GAAI,OAAO,GAAS,SAAU,CAC5B,IAAM,EAAa,EAAgB,MAAM,IAAI,CACzC,EAAe,EAEnB,IAAK,IAAM,KAAO,EAIhB,GAFA,EAAU,IAAU,GAEhB,IAAY,IAAA,GACd,OAAO,EAIX,OAAO,EAIT,OAAO,GCuBI,GACX,EACA,KACa,CACb,GAAI,qBACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAaC,EAAAA,SAAS,YAC1D,WAAY,EAA0B,EAAO,IAAsB,CACjE,IAAM,EAAS,CACb,GAAI,EAAKA,EAAAA,SAAS,cAAgB,EAAE,CACrC,CAED,IAAK,IAAM,KAAO,EAAQ,CACxB,IAAM,EAAa,CACjB,GAAG,EACH,SAAU,EAAO,GACjB,QAAS,CACP,GAAG,EAAM,QACT,CAAE,KAAMA,EAAAA,SAAS,YAAa,MAAK,CACpC,CACF,CACD,EAAO,GAA8B,EACnC,EAAO,GACP,EACD,CAGH,OAAOC,EAAAA,eAAe,EAAQ,EAAQ,EAAS,EAElD,EAmBY,EAA6B,CACxC,GAAI,qBACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAaD,EAAAA,SAAS,YAC1D,WAAY,EAA0B,EAAO,IAAsB,CACjE,IAAM,EAAS,CAAE,GAAG,EAAKA,EAAAA,SAAS,aAAc,CAEhD,IAAK,IAAM,KAAO,EAAQ,CACxB,IAAM,EAAQ,EAAO,GASrB,EAAO,GAAyC,EAC9C,EATiB,CACjB,GAAG,EACH,SAAU,EACV,QAAS,CACP,GAAG,EAAM,QACT,CAAE,KAAMA,EAAAA,SAAS,YAAa,MAAK,CACpC,CACF,CAIA,CAGH,MAAQ,IAAoC,CAE1C,IAAM,EAAYE,EAAAA,eAAe,EADhB,OAAO,GAAQ,SAAW,EAAM,EAAI,MACH,CAMlD,OAJI,OAAO,GAAc,YAAc,OAAO,GAAQ,SAC7C,EAAU,EAAI,CAGhB,IAGZ,CAmBY,EAA2B,CACtC,GAAI,mBACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAaF,EAAAA,SAAS,UAC1D,WAAY,EAAwB,EAAO,IAAsB,CAC/D,IAAM,EAAS,CAAE,GAAG,EAAKA,EAAAA,SAAS,WAAY,CAE9C,IAAK,IAAM,KAAO,EAAQ,CACxB,IAAM,EAAQ,EAAO,GASrB,EAAO,GAAyC,EAC9C,EATiB,CACjB,GAAG,EACH,SAAU,EACV,QAAS,CACP,GAAG,EAAM,QACT,CAAE,KAAMA,EAAAA,SAAS,UAAW,MAAK,CAClC,CACF,CAIA,CAGH,MAAQ,IAAsC,CAE5C,IAAM,EAAYG,EAAAA,aAAa,EADjB,OAAO,GAAQ,UAAY,EAAM,EAAI,MACN,CAM7C,OAJI,OAAO,GAAc,YAAc,OAAO,GAAQ,SAC7C,EAAU,EAAI,CAGhB,IAGZ,CAmBY,EAA2B,CACtC,GAAI,mBACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAaH,EAAAA,SAAS,UAC1D,WAAY,EAAwB,EAAO,IAAsB,CAC/D,IAAM,EAAwB,CAC5B,GAAG,EAAM,QACT,CACE,KAAMA,EAAAA,SAAS,UAChB,CACF,CAEK,EAAW,EAAKA,EAAAA,SAAS,WAGzB,EAAiC,CACrC,GAAI,0BACJ,UAAY,GAAS,OAAO,GAAS,SACrC,WAAY,EAAc,EAAU,IAAsB,CACxD,IAAM,EAAoB,EAAkB,EAAM,CAChD,GAAG,EACH,SAAU,EACV,QAAS,CACP,IAAI,EAAM,SAAY,EAAE,EAAgB,OACrC,GAAW,EAAO,KAAO,uBAC3B,CACF,CACF,CAAC,CAEF,MACE,IAGG,CACH,IAAM,EAAWI,EAAAA,aAAa,EAAmB,EAAO,CAExD,OAAO,EAAkB,EAAU,CACjC,GAAG,EACH,QAAS,EAAM,QACf,WACD,CAAC,GAGP,CAED,OAAO,EAAkB,EAAU,CACjC,GAAG,EACH,WACA,QAAS,EACT,QAAS,CAAC,EAAuB,GAAI,EAAM,SAAW,EAAE,CAAE,CAC3D,CAAC,EAEL,CAgBY,EAAwB,CACnC,GAAI,gBACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAaJ,EAAAA,SAAS,OAC1D,WAAY,EAAqB,EAAO,IAAsB,CAC5D,IAAM,EAAS,CAAE,GAAG,EAAKA,EAAAA,SAAS,QAAS,CAE3C,IAAK,IAAM,KAAO,EAAQ,CACxB,IAAM,EAAQ,EAAO,GAMrB,EAAO,GAA8B,EAAkB,EALpC,CACjB,GAAG,EACH,SAAU,EACV,QAAS,CAAC,GAAG,EAAM,QAAS,CAAE,KAAMA,EAAAA,SAAS,OAAQ,MAAK,CAAY,CACvE,CACwE,CAG3E,MAAQ,IAAkBK,EAAAA,UAAU,EAAQ,EAAM,EAErD,CAmBY,EAAgB,IAAqC,CAChE,GAAI,gBACJ,UAAY,GACV,OAAO,GAAS,WACf,GAAM,WAAaL,EAAAA,SAAS,QAAU,GAAM,WAAa,UAC5D,WAAY,EAAqB,IAC/B,EAAW,EAAK,OAAO,cAAe,EAAK,OAAO,KAAM,CACtD,GAAG,EACH,OAAS,GAAU,EAAM,OAC1B,CAAC,CACL,EAeY,EAAsB,CACjC,GAAI,cACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAaA,EAAAA,SAAS,KAC1D,WAAY,EAAmB,EAAO,IACpC,EAAc,EAAK,QAAS,CAC1B,GAAG,EACH,SAAU,EAAK,QAChB,CAAC,CACL,CChWY,GACX,EACA,EAAoB,KACN,CACd,EACE,GAAUM,EAAAA,QAAc,qBAAqB,cAC7C,EAAWA,EAAAA,QAAc,qBAAqB,cAAgB,IAAA,GAC/D,CACD,EACA,EACA,EACA,EAAa,GAAUA,EAAAA,QAAc,qBAAqB,cAAc,CACxE,EACA,EACD,CAQY,GAIX,EACA,EACA,EAAqB,EAAE,GAEvBC,EAAAA,kBAAkB,EAAM,CACtB,GAAG,EACH,UACD,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);let e=require(`@intlayer/config/client`);const t=t=>{let{name:n,path:r,expires:i,domain:a,secure:o,sameSite:s,httpOnly:c}=t??{};return{name:n??e.DefaultValues.Routing.COOKIE_NAME,attributes:{path:r,expires:i,domain:a,secure:o,sameSite:s,httpOnly:c}}},n=t=>{let{name:n}=t??{};return{name:n??e.DefaultValues.Routing.LOCALE_STORAGE_NAME}},r=t=>{let{name:n}=t??{};return{name:n??e.DefaultValues.Routing.HEADER_NAME}},i=e=>e.type===`cookie`||`sameSite`in e||`httpOnly`in e||`secure`in e,a=e=>e===`cookie`||e===`localStorage`||e===`sessionStorage`||e===`header`,o=e=>{if(typeof e==`string`){if(!a(e))return{cookies:[],localStorage:[],sessionStorage:[],headers:[]};if(e===`cookie`)return{cookies:[t()]};if(e===`localStorage`)return{localStorage:[n()]};if(e===`sessionStorage`)return{sessionStorage:[n()]};if(e===`header`)return{headers:[r()]}}if(typeof e==`object`&&e){let a=e;if(i(a))return{cookies:[t(a)]};if(`type`in a&&a.type===`localStorage`){let{name:e,...t}=a;return{localStorage:[n({name:e,...t})]}}if(`type`in a&&a.type===`sessionStorage`){let{name:e,...t}=a;return{sessionStorage:[n({name:e,...t})]}}if(`type`in a&&a.type===`header`){let{name:e,...t}=a;return{headers:[r({name:e,...t})]}}let{name:o,...s}=a;return{localStorage:[n({name:o,...s})]}}return{cookies:[],localStorage:[],sessionStorage:[],headers:[]}},s=(e,t)=>({cookies:[...e.cookies,...t.cookies??[]],localStorage:[...e.localStorage,...t.localStorage??[]],sessionStorage:[...e.sessionStorage,...t.sessionStorage??[]],headers:[...e.headers,...t.headers??[]]}),c=e=>{let t={cookies:[],localStorage:[],sessionStorage:[],headers:[]};return e===!1||e===void 0?t:Array.isArray(e)?e.reduce((e,t)=>s(e,o(t)),t):s(t,o(e))};exports.getStorageAttributes=c;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/config/client`);const t=t=>{let{name:n,path:r,expires:i,domain:a,secure:o,sameSite:s,httpOnly:c}=t??{};return{name:n??e.DefaultValues.Routing.COOKIE_NAME,attributes:{path:r,expires:i,domain:a,secure:o,sameSite:s,httpOnly:c}}},n=t=>{let{name:n}=t??{};return{name:n??e.DefaultValues.Routing.LOCALE_STORAGE_NAME}},r=t=>{let{name:n}=t??{};return{name:n??e.DefaultValues.Routing.HEADER_NAME}},i=e=>e.type===`cookie`||`sameSite`in e||`httpOnly`in e||`secure`in e,a=e=>e===`cookie`||e===`localStorage`||e===`sessionStorage`||e===`header`,o=e=>{if(typeof e==`string`){if(!a(e))return{cookies:[],localStorage:[],sessionStorage:[],headers:[]};if(e===`cookie`)return{cookies:[t()]};if(e===`localStorage`)return{localStorage:[n()]};if(e===`sessionStorage`)return{sessionStorage:[n()]};if(e===`header`)return{headers:[r()]}}if(typeof e==`object`&&e){let a=e;if(i(a))return{cookies:[t(a)]};if(`type`in a&&a.type===`localStorage`){let{name:e,...t}=a;return{localStorage:[n({name:e,...t})]}}if(`type`in a&&a.type===`sessionStorage`){let{name:e,...t}=a;return{sessionStorage:[n({name:e,...t})]}}if(`type`in a&&a.type===`header`){let{name:e,...t}=a;return{headers:[r({name:e,...t})]}}let{name:o,...s}=a;return{localStorage:[n({name:o,...s})]}}return{cookies:[],localStorage:[],sessionStorage:[],headers:[]}},s=(e,t)=>({cookies:[...e.cookies,...t.cookies??[]],localStorage:[...e.localStorage,...t.localStorage??[]],sessionStorage:[...e.sessionStorage,...t.sessionStorage??[]],headers:[...e.headers,...t.headers??[]]}),c=e=>{let t={cookies:[],localStorage:[],sessionStorage:[],headers:[]};return e===!1||e===void 0?t:Array.isArray(e)?e.reduce((e,t)=>s(e,o(t)),t):s(t,o(e))};exports.getStorageAttributes=c;
2
2
  //# sourceMappingURL=getStorageAttributes.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getStorageAttributes.cjs","names":["DefaultValues"],"sources":["../../src/getStorageAttributes.ts"],"sourcesContent":["import { DefaultValues } from '@intlayer/config/client';\nimport type { CookiesAttributes, IntlayerConfig, StorageAttributes } from '@intlayer/types/config';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ntype CookieEntry = {\n name: string;\n attributes: Omit<CookiesAttributes, 'type' | 'name'>;\n};\n\ntype WebStorageEntry = {\n name: string;\n};\n\ntype HeaderEntry = {\n name: string;\n};\n\nexport type ProcessedStorageAttributes = {\n cookies: CookieEntry[];\n localStorage: WebStorageEntry[];\n sessionStorage: WebStorageEntry[];\n headers: HeaderEntry[];\n};\n\ntype StorageEntry =\n | 'cookie'\n | 'localStorage'\n | 'sessionStorage'\n | 'header'\n | CookiesAttributes\n | StorageAttributes;\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Creates a cookie entry with default values for missing attributes\n */\nconst createCookieEntry = (\n options?: Partial<CookiesAttributes>\n): CookieEntry => {\n const { name, path, expires, domain, secure, sameSite, httpOnly } =\n options ?? {};\n\n return {\n name: name ?? DefaultValues.Routing.COOKIE_NAME,\n attributes: {\n path,\n expires,\n domain,\n secure,\n sameSite,\n httpOnly,\n },\n };\n};\n\n/**\n * Creates a web storage entry (localStorage or sessionStorage) with default name\n */\nconst createWebStorageEntry = (\n options?: Partial<StorageAttributes>\n): WebStorageEntry => {\n const { name } = options ?? {};\n\n return {\n name: name ?? DefaultValues.Routing.LOCALE_STORAGE_NAME,\n };\n};\n\n/**\n * Creates a header entry with default name\n */\nconst createHeaderEntry = (\n options?: Partial<StorageAttributes>\n): HeaderEntry => {\n const { name } = options ?? {};\n\n return {\n name: name ?? DefaultValues.Routing.HEADER_NAME,\n };\n};\n\n/**\n * Determines if a storage entry is a cookie based on its properties\n */\nconst isCookieEntry = (entry: any): boolean => {\n return (\n entry.type === 'cookie' ||\n 'sameSite' in entry ||\n 'httpOnly' in entry ||\n 'secure' in entry\n );\n};\n\n/**\n * Determines the storage type from a string literal\n */\nconst isStorageType = (\n value: string\n): value is 'cookie' | 'localStorage' | 'sessionStorage' | 'header' => {\n return (\n value === 'cookie' ||\n value === 'localStorage' ||\n value === 'sessionStorage' ||\n value === 'header'\n );\n};\n\n// ============================================================================\n// Main Function\n// ============================================================================\n\n/**\n * Processes a single storage entry and returns the appropriate storage attributes\n */\nconst processStorageEntry = (\n entry: StorageEntry\n): Partial<ProcessedStorageAttributes> => {\n // Handle string literals\n if (typeof entry === 'string') {\n if (!isStorageType(entry)) {\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n }\n\n if (entry === 'cookie') {\n return { cookies: [createCookieEntry()] };\n }\n\n if (entry === 'localStorage') {\n return { localStorage: [createWebStorageEntry()] };\n }\n\n if (entry === 'sessionStorage') {\n return { sessionStorage: [createWebStorageEntry()] };\n }\n\n if (entry === 'header') {\n return { headers: [createHeaderEntry()] };\n }\n }\n\n // Handle object entries\n if (typeof entry === 'object' && entry !== null) {\n const typedEntry = entry as CookiesAttributes | StorageAttributes;\n\n if (isCookieEntry(typedEntry)) {\n return { cookies: [createCookieEntry(typedEntry as CookiesAttributes)] };\n }\n\n // Handle localStorage\n if ('type' in typedEntry && typedEntry.type === 'localStorage') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { localStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n // Handle sessionStorage\n if ('type' in typedEntry && typedEntry.type === 'sessionStorage') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { sessionStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n // Handle header\n if ('type' in typedEntry && typedEntry.type === 'header') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { headers: [createHeaderEntry({ name, ...rest })] };\n }\n\n // Default to localStorage for ambiguous objects\n const { name, ...rest } = typedEntry as Omit<StorageAttributes, 'type'>;\n return { localStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n};\n\n/**\n * Merges multiple partial storage attributes into a single result\n */\nconst mergeStorageAttributes = (\n accumulated: ProcessedStorageAttributes,\n partial: Partial<ProcessedStorageAttributes>\n): ProcessedStorageAttributes => {\n return {\n cookies: [...accumulated.cookies, ...(partial.cookies ?? [])],\n localStorage: [\n ...accumulated.localStorage,\n ...(partial.localStorage ?? []),\n ],\n sessionStorage: [\n ...accumulated.sessionStorage,\n ...(partial.sessionStorage ?? []),\n ],\n headers: [...accumulated.headers, ...(partial.headers ?? [])],\n };\n};\n\n/**\n * Extracts and normalizes storage configuration into separate arrays for each storage type\n *\n * @param options - The storage configuration from IntlayerConfig\n * @returns An object containing arrays for cookies, localStorage, and sessionStorage\n */\nexport const getStorageAttributes = (\n options: IntlayerConfig['routing']['storage']\n): ProcessedStorageAttributes => {\n const emptyResult: ProcessedStorageAttributes = {\n cookies: [],\n localStorage: [],\n sessionStorage: [],\n headers: [],\n };\n\n // Storage is disabled\n if (options === false || options === undefined) {\n return emptyResult;\n }\n\n // Handle array of storage entries\n if (Array.isArray(options)) {\n return options.reduce<ProcessedStorageAttributes>((acc, entry) => {\n const partial = processStorageEntry(entry);\n return mergeStorageAttributes(acc, partial);\n }, emptyResult);\n }\n\n // Handle single storage entry\n const partial = processStorageEntry(options);\n\n return mergeStorageAttributes(emptyResult, partial);\n};\n"],"mappings":"wJA0CA,MAAM,EACJ,GACgB,CAChB,GAAM,CAAE,OAAM,OAAM,UAAS,SAAQ,SAAQ,WAAU,YACrD,GAAW,EAAE,CAEf,MAAO,CACL,KAAM,GAAQA,EAAAA,cAAc,QAAQ,YACpC,WAAY,CACV,OACA,UACA,SACA,SACA,WACA,WACD,CACF,EAMG,EACJ,GACoB,CACpB,GAAM,CAAE,QAAS,GAAW,EAAE,CAE9B,MAAO,CACL,KAAM,GAAQA,EAAAA,cAAc,QAAQ,oBACrC,EAMG,EACJ,GACgB,CAChB,GAAM,CAAE,QAAS,GAAW,EAAE,CAE9B,MAAO,CACL,KAAM,GAAQA,EAAAA,cAAc,QAAQ,YACrC,EAMG,EAAiB,GAEnB,EAAM,OAAS,UACf,aAAc,GACd,aAAc,GACd,WAAY,EAOV,EACJ,GAGE,IAAU,UACV,IAAU,gBACV,IAAU,kBACV,IAAU,SAWR,EACJ,GACwC,CAExC,GAAI,OAAO,GAAU,SAAU,CAC7B,GAAI,CAAC,EAAc,EAAM,CACvB,MAAO,CAAE,QAAS,EAAE,CAAE,aAAc,EAAE,CAAE,eAAgB,EAAE,CAAE,QAAS,EAAE,CAAE,CAG3E,GAAI,IAAU,SACZ,MAAO,CAAE,QAAS,CAAC,GAAmB,CAAC,CAAE,CAG3C,GAAI,IAAU,eACZ,MAAO,CAAE,aAAc,CAAC,GAAuB,CAAC,CAAE,CAGpD,GAAI,IAAU,iBACZ,MAAO,CAAE,eAAgB,CAAC,GAAuB,CAAC,CAAE,CAGtD,GAAI,IAAU,SACZ,MAAO,CAAE,QAAS,CAAC,GAAmB,CAAC,CAAE,CAK7C,GAAI,OAAO,GAAU,UAAY,EAAgB,CAC/C,IAAM,EAAa,EAEnB,GAAI,EAAc,EAAW,CAC3B,MAAO,CAAE,QAAS,CAAC,EAAkB,EAAgC,CAAC,CAAE,CAI1E,GAAI,SAAU,GAAc,EAAW,OAAS,eAAgB,CAC9D,GAAM,CAAE,OAAM,GAAG,GAAS,EAC1B,MAAO,CAAE,aAAc,CAAC,EAAsB,CAAE,OAAM,GAAG,EAAM,CAAC,CAAC,CAAE,CAIrE,GAAI,SAAU,GAAc,EAAW,OAAS,iBAAkB,CAChE,GAAM,CAAE,OAAM,GAAG,GAAS,EAC1B,MAAO,CAAE,eAAgB,CAAC,EAAsB,CAAE,OAAM,GAAG,EAAM,CAAC,CAAC,CAAE,CAIvE,GAAI,SAAU,GAAc,EAAW,OAAS,SAAU,CACxD,GAAM,CAAE,OAAM,GAAG,GAAS,EAC1B,MAAO,CAAE,QAAS,CAAC,EAAkB,CAAE,OAAM,GAAG,EAAM,CAAC,CAAC,CAAE,CAI5D,GAAM,CAAE,OAAM,GAAG,GAAS,EAC1B,MAAO,CAAE,aAAc,CAAC,EAAsB,CAAE,OAAM,GAAG,EAAM,CAAC,CAAC,CAAE,CAGrE,MAAO,CAAE,QAAS,EAAE,CAAE,aAAc,EAAE,CAAE,eAAgB,EAAE,CAAE,QAAS,EAAE,CAAE,EAMrE,GACJ,EACA,KAEO,CACL,QAAS,CAAC,GAAG,EAAY,QAAS,GAAI,EAAQ,SAAW,EAAE,CAAE,CAC7D,aAAc,CACZ,GAAG,EAAY,aACf,GAAI,EAAQ,cAAgB,EAAE,CAC/B,CACD,eAAgB,CACd,GAAG,EAAY,eACf,GAAI,EAAQ,gBAAkB,EAAE,CACjC,CACD,QAAS,CAAC,GAAG,EAAY,QAAS,GAAI,EAAQ,SAAW,EAAE,CAAE,CAC9D,EASU,EACX,GAC+B,CAC/B,IAAM,EAA0C,CAC9C,QAAS,EAAE,CACX,aAAc,EAAE,CAChB,eAAgB,EAAE,CAClB,QAAS,EAAE,CACZ,CAkBD,OAfI,IAAY,IAAS,IAAY,IAAA,GAC5B,EAIL,MAAM,QAAQ,EAAQ,CACjB,EAAQ,QAAoC,EAAK,IAE/C,EAAuB,EADd,EAAoB,EAAM,CACC,CAC1C,EAAY,CAMV,EAAuB,EAFd,EAAoB,EAAQ,CAEO"}
1
+ {"version":3,"file":"getStorageAttributes.cjs","names":["DefaultValues"],"sources":["../../src/getStorageAttributes.ts"],"sourcesContent":["import { DefaultValues } from '@intlayer/config/client';\nimport type { CookiesAttributes, IntlayerConfig, StorageAttributes } from '@intlayer/types/config';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ntype CookieEntry = {\n name: string;\n attributes: Omit<CookiesAttributes, 'type' | 'name'>;\n};\n\ntype WebStorageEntry = {\n name: string;\n};\n\ntype HeaderEntry = {\n name: string;\n};\n\nexport type ProcessedStorageAttributes = {\n cookies: CookieEntry[];\n localStorage: WebStorageEntry[];\n sessionStorage: WebStorageEntry[];\n headers: HeaderEntry[];\n};\n\ntype StorageEntry =\n | 'cookie'\n | 'localStorage'\n | 'sessionStorage'\n | 'header'\n | CookiesAttributes\n | StorageAttributes;\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Creates a cookie entry with default values for missing attributes\n */\nconst createCookieEntry = (\n options?: Partial<CookiesAttributes>\n): CookieEntry => {\n const { name, path, expires, domain, secure, sameSite, httpOnly } =\n options ?? {};\n\n return {\n name: name ?? DefaultValues.Routing.COOKIE_NAME,\n attributes: {\n path,\n expires,\n domain,\n secure,\n sameSite,\n httpOnly,\n },\n };\n};\n\n/**\n * Creates a web storage entry (localStorage or sessionStorage) with default name\n */\nconst createWebStorageEntry = (\n options?: Partial<StorageAttributes>\n): WebStorageEntry => {\n const { name } = options ?? {};\n\n return {\n name: name ?? DefaultValues.Routing.LOCALE_STORAGE_NAME,\n };\n};\n\n/**\n * Creates a header entry with default name\n */\nconst createHeaderEntry = (\n options?: Partial<StorageAttributes>\n): HeaderEntry => {\n const { name } = options ?? {};\n\n return {\n name: name ?? DefaultValues.Routing.HEADER_NAME,\n };\n};\n\n/**\n * Determines if a storage entry is a cookie based on its properties\n */\nconst isCookieEntry = (entry: any): boolean => {\n return (\n entry.type === 'cookie' ||\n 'sameSite' in entry ||\n 'httpOnly' in entry ||\n 'secure' in entry\n );\n};\n\n/**\n * Determines the storage type from a string literal\n */\nconst isStorageType = (\n value: string\n): value is 'cookie' | 'localStorage' | 'sessionStorage' | 'header' => {\n return (\n value === 'cookie' ||\n value === 'localStorage' ||\n value === 'sessionStorage' ||\n value === 'header'\n );\n};\n\n// ============================================================================\n// Main Function\n// ============================================================================\n\n/**\n * Processes a single storage entry and returns the appropriate storage attributes\n */\nconst processStorageEntry = (\n entry: StorageEntry\n): Partial<ProcessedStorageAttributes> => {\n // Handle string literals\n if (typeof entry === 'string') {\n if (!isStorageType(entry)) {\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n }\n\n if (entry === 'cookie') {\n return { cookies: [createCookieEntry()] };\n }\n\n if (entry === 'localStorage') {\n return { localStorage: [createWebStorageEntry()] };\n }\n\n if (entry === 'sessionStorage') {\n return { sessionStorage: [createWebStorageEntry()] };\n }\n\n if (entry === 'header') {\n return { headers: [createHeaderEntry()] };\n }\n }\n\n // Handle object entries\n if (typeof entry === 'object' && entry !== null) {\n const typedEntry = entry as CookiesAttributes | StorageAttributes;\n\n if (isCookieEntry(typedEntry)) {\n return { cookies: [createCookieEntry(typedEntry as CookiesAttributes)] };\n }\n\n // Handle localStorage\n if ('type' in typedEntry && typedEntry.type === 'localStorage') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { localStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n // Handle sessionStorage\n if ('type' in typedEntry && typedEntry.type === 'sessionStorage') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { sessionStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n // Handle header\n if ('type' in typedEntry && typedEntry.type === 'header') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { headers: [createHeaderEntry({ name, ...rest })] };\n }\n\n // Default to localStorage for ambiguous objects\n const { name, ...rest } = typedEntry as Omit<StorageAttributes, 'type'>;\n return { localStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n};\n\n/**\n * Merges multiple partial storage attributes into a single result\n */\nconst mergeStorageAttributes = (\n accumulated: ProcessedStorageAttributes,\n partial: Partial<ProcessedStorageAttributes>\n): ProcessedStorageAttributes => {\n return {\n cookies: [...accumulated.cookies, ...(partial.cookies ?? [])],\n localStorage: [\n ...accumulated.localStorage,\n ...(partial.localStorage ?? []),\n ],\n sessionStorage: [\n ...accumulated.sessionStorage,\n ...(partial.sessionStorage ?? []),\n ],\n headers: [...accumulated.headers, ...(partial.headers ?? [])],\n };\n};\n\n/**\n * Extracts and normalizes storage configuration into separate arrays for each storage type\n *\n * @param options - The storage configuration from IntlayerConfig\n * @returns An object containing arrays for cookies, localStorage, and sessionStorage\n */\nexport const getStorageAttributes = (\n options: IntlayerConfig['routing']['storage']\n): ProcessedStorageAttributes => {\n const emptyResult: ProcessedStorageAttributes = {\n cookies: [],\n localStorage: [],\n sessionStorage: [],\n headers: [],\n };\n\n // Storage is disabled\n if (options === false || options === undefined) {\n return emptyResult;\n }\n\n // Handle array of storage entries\n if (Array.isArray(options)) {\n return options.reduce<ProcessedStorageAttributes>((acc, entry) => {\n const partial = processStorageEntry(entry);\n return mergeStorageAttributes(acc, partial);\n }, emptyResult);\n }\n\n // Handle single storage entry\n const partial = processStorageEntry(options);\n\n return mergeStorageAttributes(emptyResult, partial);\n};\n"],"mappings":"4IA0CA,MAAM,EACJ,GACgB,CAChB,GAAM,CAAE,OAAM,OAAM,UAAS,SAAQ,SAAQ,WAAU,YACrD,GAAW,EAAE,CAEf,MAAO,CACL,KAAM,GAAQA,EAAAA,cAAc,QAAQ,YACpC,WAAY,CACV,OACA,UACA,SACA,SACA,WACA,WACD,CACF,EAMG,EACJ,GACoB,CACpB,GAAM,CAAE,QAAS,GAAW,EAAE,CAE9B,MAAO,CACL,KAAM,GAAQA,EAAAA,cAAc,QAAQ,oBACrC,EAMG,EACJ,GACgB,CAChB,GAAM,CAAE,QAAS,GAAW,EAAE,CAE9B,MAAO,CACL,KAAM,GAAQA,EAAAA,cAAc,QAAQ,YACrC,EAMG,EAAiB,GAEnB,EAAM,OAAS,UACf,aAAc,GACd,aAAc,GACd,WAAY,EAOV,EACJ,GAGE,IAAU,UACV,IAAU,gBACV,IAAU,kBACV,IAAU,SAWR,EACJ,GACwC,CAExC,GAAI,OAAO,GAAU,SAAU,CAC7B,GAAI,CAAC,EAAc,EAAM,CACvB,MAAO,CAAE,QAAS,EAAE,CAAE,aAAc,EAAE,CAAE,eAAgB,EAAE,CAAE,QAAS,EAAE,CAAE,CAG3E,GAAI,IAAU,SACZ,MAAO,CAAE,QAAS,CAAC,GAAmB,CAAC,CAAE,CAG3C,GAAI,IAAU,eACZ,MAAO,CAAE,aAAc,CAAC,GAAuB,CAAC,CAAE,CAGpD,GAAI,IAAU,iBACZ,MAAO,CAAE,eAAgB,CAAC,GAAuB,CAAC,CAAE,CAGtD,GAAI,IAAU,SACZ,MAAO,CAAE,QAAS,CAAC,GAAmB,CAAC,CAAE,CAK7C,GAAI,OAAO,GAAU,UAAY,EAAgB,CAC/C,IAAM,EAAa,EAEnB,GAAI,EAAc,EAAW,CAC3B,MAAO,CAAE,QAAS,CAAC,EAAkB,EAAgC,CAAC,CAAE,CAI1E,GAAI,SAAU,GAAc,EAAW,OAAS,eAAgB,CAC9D,GAAM,CAAE,OAAM,GAAG,GAAS,EAC1B,MAAO,CAAE,aAAc,CAAC,EAAsB,CAAE,OAAM,GAAG,EAAM,CAAC,CAAC,CAAE,CAIrE,GAAI,SAAU,GAAc,EAAW,OAAS,iBAAkB,CAChE,GAAM,CAAE,OAAM,GAAG,GAAS,EAC1B,MAAO,CAAE,eAAgB,CAAC,EAAsB,CAAE,OAAM,GAAG,EAAM,CAAC,CAAC,CAAE,CAIvE,GAAI,SAAU,GAAc,EAAW,OAAS,SAAU,CACxD,GAAM,CAAE,OAAM,GAAG,GAAS,EAC1B,MAAO,CAAE,QAAS,CAAC,EAAkB,CAAE,OAAM,GAAG,EAAM,CAAC,CAAC,CAAE,CAI5D,GAAM,CAAE,OAAM,GAAG,GAAS,EAC1B,MAAO,CAAE,aAAc,CAAC,EAAsB,CAAE,OAAM,GAAG,EAAM,CAAC,CAAC,CAAE,CAGrE,MAAO,CAAE,QAAS,EAAE,CAAE,aAAc,EAAE,CAAE,eAAgB,EAAE,CAAE,QAAS,EAAE,CAAE,EAMrE,GACJ,EACA,KAEO,CACL,QAAS,CAAC,GAAG,EAAY,QAAS,GAAI,EAAQ,SAAW,EAAE,CAAE,CAC7D,aAAc,CACZ,GAAG,EAAY,aACf,GAAI,EAAQ,cAAgB,EAAE,CAC/B,CACD,eAAgB,CACd,GAAG,EAAY,eACf,GAAI,EAAQ,gBAAkB,EAAE,CACjC,CACD,QAAS,CAAC,GAAG,EAAY,QAAS,GAAI,EAAQ,SAAW,EAAE,CAAE,CAC9D,EASU,EACX,GAC+B,CAC/B,IAAM,EAA0C,CAC9C,QAAS,EAAE,CACX,aAAc,EAAE,CAChB,eAAgB,EAAE,CAClB,QAAS,EAAE,CACZ,CAkBD,OAfI,IAAY,IAAS,IAAY,IAAA,GAC5B,EAIL,MAAM,QAAQ,EAAQ,CACjB,EAAQ,QAAoC,EAAK,IAE/C,EAAuB,EADd,EAAoB,EAAM,CACC,CAC1C,EAAY,CAMV,EAAuB,EAFd,EAAoB,EAAQ,CAEO"}
@@ -0,0 +1,2 @@
1
+ require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./transpiler/html/validateHTML.cjs`),t=require(`./transpiler/html/htmlTags.cjs`);let n=require(`@intlayer/types/nodeType`);const r=e=>{let t={};return!e||!e.trim()||[...e.matchAll(/([a-zA-Z0-9-:_@]+)(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))?/g)].forEach(e=>{let n=e[1];t[n]=`string`}),t},i=e=>{if(typeof e!=`string`)throw Error(`content must be a string`);let n=[...e.matchAll(/<(\/)?([a-zA-Z0-9.-]+)\s*([\s\S]*?)(\/?)>/g)],i={};return n.forEach(e=>{let n=!!e[1],a=e[2],o=e[3],s=!!e[4];if(t.HTML_TAGS.includes(a.toLowerCase())){i[a]=!0;return}if(i[a]||(i[a]={}),i[a]===!0||n)return;let c=r(o),l=i[a];Object.assign(l,c),s||(l.children=`string`)}),i},a=(t,r)=>(0,n.formatNodeType)(n.NodeType.HTML,t,{tags:(()=>{if(r)return r;if(typeof t==`string`){let{issues:n}=e.validateHTML(t);for(let e of n)e.type===`error`?console.error(`[intlayer/html] ${e.message}`):console.warn(`[intlayer/html] ${e.message}`);return i(t)}let n;if(typeof t==`function`?n=t():typeof t.then==`function`&&(n=async()=>i(await t)),typeof n==`string`)return i(n);try{return i(JSON.stringify(t))}catch{return[]}})()});Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
2
+ //# sourceMappingURL=html-CZ1N-VL0.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-CZ1N-VL0.cjs","names":["HTML_TAGS","validateHTML","NodeType"],"sources":["../../src/transpiler/html/getHTMLCustomComponents.ts","../../src/transpiler/html/html.ts"],"sourcesContent":["import { HTML_TAGS } from './index';\n\nconst parseAttributes = (attributesString: string): Record<string, string> => {\n const attributes: Record<string, string> = {};\n\n if (!attributesString || !attributesString.trim()) {\n return attributes;\n }\n\n // Regex to match attribute names\n // Matches: name=\"value\", name='value', name=value, or just name\n const attrRegex =\n /([a-zA-Z0-9-:_@]+)(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^>\\s]+))?/g;\n\n const matches = [...attributesString.matchAll(attrRegex)];\n\n matches.forEach((match) => {\n const attrName = match[1];\n attributes[attrName] = 'string';\n });\n\n return attributes;\n};\n\n/**\n * Extracts component names from an HTML string.\n * - Standard HTML tags are set to `true`.\n * - Custom components are parsed to extract their attributes/props.\n */\nexport const getHTMLCustomComponents = (\n content: string\n): Record<string, Record<string, string> | true> => {\n if (typeof content !== 'string') {\n throw new Error('content must be a string');\n }\n\n // Regex to match tags: <Tag ...>, </Tag>, or <Tag ... />\n // Captures: 1: Closing slash (if any), 2: Tag Name, 3: Attributes, 4: Self-closing slash (if any)\n const tagRegex = /<(\\/)?([a-zA-Z0-9.-]+)\\s*([\\s\\S]*?)(\\/?)>/g;\n const matches = [...content.matchAll(tagRegex)];\n\n const components: Record<string, Record<string, string> | true> = {};\n\n matches.forEach((match) => {\n const isClosing = !!match[1];\n const tagName = match[2];\n const attributesString = match[3];\n const isSelfClosing = !!match[4];\n\n // Component extraction logic\n if ((HTML_TAGS as readonly string[]).includes(tagName.toLowerCase())) {\n components[tagName] = true;\n return;\n }\n\n if (!components[tagName]) {\n components[tagName] = {};\n }\n\n // Safety check if we somehow have a collision or logic issue, though loop order handles it\n if (components[tagName] === true) {\n return;\n }\n\n if (isClosing) {\n return;\n }\n\n // Parse attributes for custom components\n const attributes = parseAttributes(attributesString);\n const componentDef = components[tagName] as Record<string, string>;\n Object.assign(componentDef, attributes);\n\n // If not self-closing, assume it has children\n if (!isSelfClosing) {\n componentDef.children = 'string';\n }\n });\n\n return components;\n};\n","import type { TypedNodeModel } from '@intlayer/types/nodeType';\nimport { formatNodeType, NodeType } from '@intlayer/types/nodeType';\nimport { getHTMLCustomComponents } from './getHTMLCustomComponents';\nimport { validateHTML } from './validateHTML';\n\ntype PropsType = 'number' | 'string' | 'node';\n\ntype ComponentName = string;\n\nexport type HTMLContentConstructor<\n Content = unknown,\n T extends Record<string, any> = {},\n> = TypedNodeModel<NodeType.HTML, Content, T>;\n\nexport type HTMLContent<\n Content = unknown,\n Components extends Record<ComponentName, PropsType> = Record<\n ComponentName,\n PropsType\n >,\n> = HTMLContentConstructor<\n Content,\n {\n tags: string[] | Components;\n }\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to parse HTML/JSX-like strings and replace tags with components during interpretation.\n *\n * Usage:\n *\n * ```ts\n * html('Hello <b>World</b>')\n * ```\n *\n */\nexport const html = <\n Components extends Record<string, any> = Record<string, any>,\n Content = unknown,\n>(\n content: Content,\n components?: Components\n): HTMLContent<Content, Components> => {\n const getComponents = () => {\n if (components) {\n return components;\n }\n\n if (typeof content === 'string') {\n const { issues } = validateHTML(content);\n\n for (const issue of issues) {\n if (issue.type === 'error') {\n console.error(`[intlayer/html] ${issue.message}`);\n } else {\n console.warn(`[intlayer/html] ${issue.message}`);\n }\n }\n\n return getHTMLCustomComponents(content);\n }\n\n let stringContent: any;\n\n if (typeof content === 'function') {\n stringContent = content();\n } else if (typeof (content as Promise<string>).then === 'function') {\n stringContent = async () =>\n getHTMLCustomComponents((await (content as Promise<string>)) as string);\n }\n\n if (typeof stringContent === 'string') {\n return getHTMLCustomComponents(stringContent);\n }\n\n try {\n return getHTMLCustomComponents(JSON.stringify(content));\n } catch (_e) {\n return [];\n }\n };\n\n return formatNodeType(NodeType.HTML, content, {\n tags: getComponents(),\n });\n};\n"],"mappings":"4KAEA,MAAM,EAAmB,GAAqD,CAC5E,IAAM,EAAqC,EAAE,CAkB7C,MAhBI,CAAC,GAAoB,CAAC,EAAiB,MAAM,EASjC,CAAC,GAAG,EAAiB,SAFnC,6DAEsD,CAAC,CAEjD,QAAS,GAAU,CACzB,IAAM,EAAW,EAAM,GACvB,EAAW,GAAY,UACvB,CAbO,GAuBE,EACX,GACkD,CAClD,GAAI,OAAO,GAAY,SACrB,MAAU,MAAM,2BAA2B,CAM7C,IAAM,EAAU,CAAC,GAAG,EAAQ,SADX,6CAC6B,CAAC,CAEzC,EAA4D,EAAE,CAsCpE,OApCA,EAAQ,QAAS,GAAU,CACzB,IAAM,EAAY,CAAC,CAAC,EAAM,GACpB,EAAU,EAAM,GAChB,EAAmB,EAAM,GACzB,EAAgB,CAAC,CAAC,EAAM,GAG9B,GAAKA,EAAAA,UAAgC,SAAS,EAAQ,aAAa,CAAC,CAAE,CACpE,EAAW,GAAW,GACtB,OAYF,GATK,EAAW,KACd,EAAW,GAAW,EAAE,EAItB,EAAW,KAAa,IAIxB,EACF,OAIF,IAAM,EAAa,EAAgB,EAAiB,CAC9C,EAAe,EAAW,GAChC,OAAO,OAAO,EAAc,EAAW,CAGlC,IACH,EAAa,SAAW,WAE1B,CAEK,GCxCI,GAIX,EACA,KAyCA,EAAA,EAAA,gBAAsBE,EAAAA,SAAS,KAAM,EAAS,CAC5C,UAxC0B,CAC1B,GAAI,EACF,OAAO,EAGT,GAAI,OAAO,GAAY,SAAU,CAC/B,GAAM,CAAE,UAAWD,EAAAA,aAAa,EAAQ,CAExC,IAAK,IAAM,KAAS,EACd,EAAM,OAAS,QACjB,QAAQ,MAAM,mBAAmB,EAAM,UAAU,CAEjD,QAAQ,KAAK,mBAAmB,EAAM,UAAU,CAIpD,OAAO,EAAwB,EAAQ,CAGzC,IAAI,EASJ,GAPI,OAAO,GAAY,WACrB,EAAgB,GAAS,CAChB,OAAQ,EAA4B,MAAS,aACtD,EAAgB,SACd,EAAyB,MAAO,EAAuC,EAGvE,OAAO,GAAkB,SAC3B,OAAO,EAAwB,EAAc,CAG/C,GAAI,CACF,OAAO,EAAwB,KAAK,UAAU,EAAQ,CAAC,MAC5C,CACX,MAAO,EAAE,KAKU,CACtB,CAAC"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./getStorageAttributes.cjs`),t=require(`./interpreter/getCondition.cjs`),n=require(`./interpreter/getContent/deepTransform.cjs`),r=require(`./interpreter/getEnumeration.cjs`),i=require(`./interpreter/getDictionary.cjs`),a=require(`./interpreter/getIntlayer.cjs`),ee=require(`./interpreter/getNesting.cjs`),o=require(`./interpreter/getTranslation.cjs`),s=require(`./interpreter/getContent/plugins.cjs`),c=require(`./interpreter/getContent/getContent.cjs`),l=require(`./interpreter/getHTML.cjs`),u=require(`./interpreter/splitAndJoinInsertion.cjs`),d=require(`./deepTransformPlugins/getFilteredLocalesContent.cjs`),f=require(`./transpiler/condition/condition.cjs`),p=require(`./transpiler/enumeration/enumeration.cjs`),te=require(`./transpiler/gender/gender.cjs`),m=require(`./transpiler/html/validateHTML.cjs`),ne=require(`./transpiler/html/html.cjs`),re=require(`./transpiler/html/htmlTags.cjs`),ie=require(`./transpiler/insertion/getInsertionValues.cjs`),ae=require(`./transpiler/insertion/insertion.cjs`),oe=require(`./utils/parseYaml.cjs`),se=require(`./transpiler/markdown/getMarkdownMetadata.cjs`),ce=require(`./transpiler/markdown/validateMarkdown.cjs`),le=require(`./transpiler/markdown/markdown.cjs`),ue=require(`./transpiler/nesting/nesting.cjs`),h=require(`./transpiler/translation/translation.cjs`),g=require(`./deepTransformPlugins/getFilterMissingTranslationsContent.cjs`),_=require(`./deepTransformPlugins/getFilterTranslationsOnlyContent.cjs`),v=require(`./deepTransformPlugins/getLocalizedContent.cjs`),y=require(`./deepTransformPlugins/getMaskContent.cjs`),b=require(`./deepTransformPlugins/getMissingLocalesContent.cjs`),x=require(`./deepTransformPlugins/getMultilingualDictionary.cjs`),S=require(`./deepTransformPlugins/getReplacedValuesContent.cjs`),C=require(`./deepTransformPlugins/getSplittedContent.cjs`),w=require(`./deepTransformPlugins/insertContentInDictionary.cjs`),T=require(`./dictionaryManipulator/editDictionaryByKeyPath.cjs`),E=require(`./dictionaryManipulator/getContentNodeByKeyPath.cjs`),D=require(`./dictionaryManipulator/getDefaultNode.cjs`),O=require(`./dictionaryManipulator/getEmptyNode.cjs`),k=require(`./dictionaryManipulator/getNodeChildren.cjs`),A=require(`./utils/isValidReactElement.cjs`),j=require(`./dictionaryManipulator/getNodeType.cjs`),M=require(`./dictionaryManipulator/mergeDictionaries.cjs`),N=require(`./dictionaryManipulator/orderDictionaries.cjs`),P=require(`./dictionaryManipulator/normalizeDictionary.cjs`),F=require(`./dictionaryManipulator/removeContentNodeByKeyPath.cjs`),I=require(`./dictionaryManipulator/renameContentNodeByKeyPath.cjs`),L=require(`./dictionaryManipulator/updateNodeChildren.cjs`),R=require(`./utils/intl.cjs`),z=require(`./formatters/compact.cjs`),B=require(`./formatters/currency.cjs`),V=require(`./formatters/date.cjs`),de=require(`./formatters/list.cjs`),H=require(`./formatters/number.cjs`),fe=require(`./formatters/percentage.cjs`),pe=require(`./formatters/relativeTime.cjs`),me=require(`./formatters/units.cjs`),he=require(`./utils/getCookie.cjs`),U=require(`./utils/localeStorage.cjs`),ge=require(`./localization/localeResolver.cjs`),_e=require(`./localization/localeDetector.cjs`),W=require(`./localization/getBrowserLocale.cjs`),ve=require(`./localization/getHTMLTextDir.cjs`),ye=require(`./localization/getLocale.cjs`),be=require(`./utils/checkIsURLAbsolute.cjs`),xe=require(`./localization/getLocaleFromPath.cjs`),Se=require(`./localization/getLocaleLang.cjs`),Ce=require(`./localization/getLocaleName.cjs`),we=require(`./localization/getPathWithoutLocale.cjs`),Te=require(`./localization/getPrefix.cjs`),G=require(`./localization/rewriteUtils.cjs`),Ee=require(`./localization/getLocalizedUrl.cjs`),De=require(`./localization/getMultilingualUrls.cjs`),K=require(`./localization/localeMapper.cjs`),Oe=require(`./localization/validatePrefix.cjs`),q=require(`./markdown/constants.cjs`),J=require(`./markdown/utils.cjs`),ke=require(`./markdown/parser.cjs`),Y=require(`./markdown/renderer.cjs`),X=require(`./markdown/compiler.cjs`),Z=require(`./messageFormat/ICU.cjs`),Q=require(`./messageFormat/i18next.cjs`),$=require(`./messageFormat/vue-i18n.cjs`),Ae=require(`./utils/isSameKeyPath.cjs`);exports.ATTRIBUTES_TO_SANITIZE=q.ATTRIBUTES_TO_SANITIZE,exports.ATTRIBUTE_TO_NODE_PROP_MAP=q.ATTRIBUTE_TO_NODE_PROP_MAP,exports.ATTR_EXTRACTOR_R=q.ATTR_EXTRACTOR_R,exports.BLOCKQUOTE_ALERT_R=q.BLOCKQUOTE_ALERT_R,exports.BLOCKQUOTE_R=q.BLOCKQUOTE_R,exports.BLOCKQUOTE_TRIM_LEFT_MULTILINE_R=q.BLOCKQUOTE_TRIM_LEFT_MULTILINE_R,exports.BLOCK_END_R=q.BLOCK_END_R,exports.BREAK_LINE_R=q.BREAK_LINE_R,exports.BREAK_THEMATIC_R=q.BREAK_THEMATIC_R,exports.CAPTURE_LETTER_AFTER_HYPHEN=q.CAPTURE_LETTER_AFTER_HYPHEN,exports.CODE_BLOCK_FENCED_R=q.CODE_BLOCK_FENCED_R,exports.CODE_BLOCK_R=q.CODE_BLOCK_R,exports.CODE_INLINE_R=q.CODE_INLINE_R,exports.CONSECUTIVE_NEWLINE_R=q.CONSECUTIVE_NEWLINE_R,exports.CR_NEWLINE_R=q.CR_NEWLINE_R,exports.CUSTOM_COMPONENT_R=q.CUSTOM_COMPONENT_R,exports.CachedIntl=R.CachedIntl,exports.Intl=R.CachedIntl,exports.DO_NOT_PROCESS_HTML_ELEMENTS=q.DO_NOT_PROCESS_HTML_ELEMENTS,exports.DURATION_DELAY_TRIGGER=q.DURATION_DELAY_TRIGGER,exports.FOOTNOTE_R=q.FOOTNOTE_R,exports.FOOTNOTE_REFERENCE_R=q.FOOTNOTE_REFERENCE_R,exports.FORMFEED_R=q.FORMFEED_R,exports.FRONT_MATTER_R=q.FRONT_MATTER_R,exports.GFM_TASK_R=q.GFM_TASK_R,exports.HEADING_ATX_COMPLIANT_R=q.HEADING_ATX_COMPLIANT_R,exports.HEADING_R=q.HEADING_R,exports.HEADING_SETEXT_R=q.HEADING_SETEXT_R,exports.HTML_BLOCK_ELEMENT_R=q.HTML_BLOCK_ELEMENT_R,exports.HTML_CHAR_CODE_R=q.HTML_CHAR_CODE_R,exports.HTML_COMMENT_R=q.HTML_COMMENT_R,exports.HTML_CUSTOM_ATTR_R=q.HTML_CUSTOM_ATTR_R,exports.HTML_LEFT_TRIM_AMOUNT_R=q.HTML_LEFT_TRIM_AMOUNT_R,exports.HTML_SELF_CLOSING_ELEMENT_R=q.HTML_SELF_CLOSING_ELEMENT_R,exports.HTML_TAGS=re.HTML_TAGS,exports.INLINE_SKIP_R=q.INLINE_SKIP_R,exports.INTERPOLATION_R=q.INTERPOLATION_R,exports.LINK_AUTOLINK_BARE_URL_R=q.LINK_AUTOLINK_BARE_URL_R,exports.LINK_AUTOLINK_R=q.LINK_AUTOLINK_R,exports.LIST_LOOKBEHIND_R=q.LIST_LOOKBEHIND_R,exports.LOOKAHEAD=q.LOOKAHEAD,exports.LocaleStorage=U.LocaleStorage,exports.NAMED_CODES_TO_UNICODE=q.NAMED_CODES_TO_UNICODE,exports.NP_TABLE_R=q.NP_TABLE_R,exports.ORDERED=q.ORDERED,exports.ORDERED_LIST_BULLET=q.ORDERED_LIST_BULLET,exports.ORDERED_LIST_ITEM_PREFIX=q.ORDERED_LIST_ITEM_PREFIX,exports.ORDERED_LIST_ITEM_PREFIX_R=q.ORDERED_LIST_ITEM_PREFIX_R,exports.ORDERED_LIST_ITEM_R=q.ORDERED_LIST_ITEM_R,exports.ORDERED_LIST_R=q.ORDERED_LIST_R,exports.PARAGRAPH_R=q.PARAGRAPH_R,exports.Priority=q.Priority,exports.REFERENCE_IMAGE_OR_LINK=q.REFERENCE_IMAGE_OR_LINK,exports.REFERENCE_IMAGE_R=q.REFERENCE_IMAGE_R,exports.REFERENCE_LINK_R=q.REFERENCE_LINK_R,exports.RuleType=q.RuleType,exports.SHORTCODE_R=q.SHORTCODE_R,exports.SHOULD_RENDER_AS_BLOCK_R=q.SHOULD_RENDER_AS_BLOCK_R,exports.TABLE_CENTER_ALIGN=q.TABLE_CENTER_ALIGN,exports.TABLE_LEFT_ALIGN=q.TABLE_LEFT_ALIGN,exports.TABLE_RIGHT_ALIGN=q.TABLE_RIGHT_ALIGN,exports.TABLE_TRIM_PIPES=q.TABLE_TRIM_PIPES,exports.TAB_R=q.TAB_R,exports.TEXT_BOLD_R=q.TEXT_BOLD_R,exports.TEXT_EMPHASIZED_R=q.TEXT_EMPHASIZED_R,exports.TEXT_ESCAPED_R=q.TEXT_ESCAPED_R,exports.TEXT_MARKED_R=q.TEXT_MARKED_R,exports.TEXT_PLAIN_R=q.TEXT_PLAIN_R,exports.TEXT_STRIKETHROUGHED_R=q.TEXT_STRIKETHROUGHED_R,exports.TRIM_STARTING_NEWLINES=q.TRIM_STARTING_NEWLINES,exports.UNESCAPE_R=q.UNESCAPE_R,exports.UNORDERED=q.UNORDERED,exports.UNORDERED_LIST_BULLET=q.UNORDERED_LIST_BULLET,exports.UNORDERED_LIST_ITEM_PREFIX=q.UNORDERED_LIST_ITEM_PREFIX,exports.UNORDERED_LIST_ITEM_PREFIX_R=q.UNORDERED_LIST_ITEM_PREFIX_R,exports.UNORDERED_LIST_ITEM_R=q.UNORDERED_LIST_ITEM_R,exports.UNORDERED_LIST_R=q.UNORDERED_LIST_R,exports.VOID_ELEMENTS=m.VOID_ELEMENTS,exports.allowInline=J.allowInline,exports.anyScopeRegex=J.anyScopeRegex,exports.attributeValueToNodePropValue=J.attributeValueToNodePropValue,exports.bindIntl=R.bindIntl,exports.blockRegex=J.blockRegex,exports.buildMaskPlugin=y.buildMaskPlugin,exports.captureNothing=J.captureNothing,exports.checkIsURLAbsolute=be.checkIsURLAbsolute,exports.checkMissingLocalesPlugin=b.checkMissingLocalesPlugin,exports.compact=z.compact,exports.compile=X.compile,exports.compileWithOptions=X.compileWithOptions,exports.cond=f.cond,exports.conditionPlugin=s.conditionPlugin,exports.createCachedIntl=R.createCachedIntl,exports.createCompiler=X.createCompiler,exports.createRenderer=Y.createRenderer,exports.currency=B.currency,exports.cx=J.cx,exports.date=V.date,exports.deepTransformNode=n.deepTransformNode,exports.editDictionaryByKeyPath=T.editDictionaryByKeyPath,exports.enu=p.enu,exports.enumerationPlugin=s.enumerationPlugin,exports.filePlugin=s.filePlugin,exports.filterMissingTranslationsOnlyPlugin=g.filterMissingTranslationsOnlyPlugin,exports.filterTranslationsOnlyPlugin=_.filterTranslationsOnlyPlugin,exports.findMatchingCondition=r.findMatchingCondition,exports.gender=te.gender,exports.genderPlugin=s.genderPlugin,exports.generateListItemPrefix=q.generateListItemPrefix,exports.generateListItemPrefixRegex=q.generateListItemPrefixRegex,exports.generateListItemRegex=q.generateListItemRegex,exports.generateListRegex=q.generateListRegex,exports.get=J.get,exports.getBasePlugins=c.getBasePlugins,exports.getBrowserLocale=W.getBrowserLocale,exports.getCanonicalPath=G.getCanonicalPath,exports.getCondition=t.getCondition,exports.getContent=c.getContent,exports.getContentNodeByKeyPath=E.getContentNodeByKeyPath,exports.getCookie=he.getCookie,exports.getDefaultNode=D.getDefaultNode,exports.getDictionary=i.getDictionary,exports.getEmptyNode=O.getEmptyNode,exports.getEnumeration=r.getEnumeration,exports.getFilterMissingTranslationsContent=g.getFilterMissingTranslationsContent,exports.getFilterMissingTranslationsDictionary=g.getFilterMissingTranslationsDictionary,exports.getFilterTranslationsOnlyContent=_.getFilterTranslationsOnlyContent,exports.getFilterTranslationsOnlyDictionary=_.getFilterTranslationsOnlyDictionary,exports.getFilteredLocalesContent=d.getFilteredLocalesContent,exports.getFilteredLocalesDictionary=d.getFilteredLocalesDictionary,exports.getHTML=l.getHTML,exports.getHTMLTextDir=ve.getHTMLTextDir,exports.getInsertionValues=ie.getInsertionValues,exports.getInternalPath=G.getInternalPath,exports.getIntlayer=a.getIntlayer,exports.getLocale=ye.getLocale,exports.getLocaleFromPath=xe.getLocaleFromPath,exports.getLocaleFromStorage=U.getLocaleFromStorage,exports.getLocaleLang=Se.getLocaleLang,exports.getLocaleName=Ce.getLocaleName,exports.getLocalizedContent=v.getLocalizedContent,exports.getLocalizedPath=G.getLocalizedPath,exports.getLocalizedUrl=Ee.getLocalizedUrl,exports.getMarkdownMetadata=se.getMarkdownMetadata,exports.getMaskContent=y.getMaskContent,exports.getMissingLocalesContent=b.getMissingLocalesContent,exports.getMissingLocalesContentFromDictionary=b.getMissingLocalesContentFromDictionary,exports.getMultilingualDictionary=x.getMultilingualDictionary,exports.getMultilingualUrls=De.getMultilingualUrls,exports.getNesting=ee.getNesting,exports.getNodeChildren=k.getNodeChildren,exports.getNodeType=j.getNodeType,exports.getPathWithoutLocale=we.getPathWithoutLocale,exports.getPerLocaleDictionary=v.getPerLocaleDictionary,exports.getPrefix=Te.getPrefix,exports.getReplacedValuesContent=S.getReplacedValuesContent,exports.getRewritePath=G.getRewritePath,exports.getRewriteRules=G.getRewriteRules,exports.getSplittedContent=C.getSplittedContent,exports.getSplittedDictionaryContent=C.getSplittedDictionaryContent,exports.getStorageAttributes=e.getStorageAttributes,exports.getTranslation=o.getTranslation,exports.html=ne.html,exports.i18nextToIntlayerFormatter=Q.i18nextToIntlayerFormatter,exports.icuToIntlayerFormatter=Z.icuToIntlayerFormatter,exports.inlineRegex=J.inlineRegex,exports.insert=ae.insert,exports.insertContentInDictionary=w.insertContentInDictionary,exports.insertionPlugin=s.insertionPlugin,exports.intlayerToI18nextFormatter=Q.intlayerToI18nextFormatter,exports.intlayerToICUFormatter=Z.intlayerToICUFormatter,exports.intlayerToVueI18nFormatter=$.intlayerToVueI18nFormatter,exports.isSameKeyPath=Ae.isSameKeyPath,exports.isValidElement=A.isValidElement,exports.list=de.list,exports.localeDetector=_e.localeDetector,exports.localeFlatMap=K.localeFlatMap,exports.localeMap=K.localeMap,exports.localeRecord=K.localeRecord,exports.localeResolver=ge.localeResolver,exports.localeStorageOptions=W.localeStorageOptions,exports.md=le.md,exports.mergeDictionaries=M.mergeDictionaries,exports.nest=ue.nest,exports.nestedPlugin=s.nestedPlugin,exports.normalizeAttributeKey=J.normalizeAttributeKey,exports.normalizeDictionaries=P.normalizeDictionaries,exports.normalizeDictionary=P.normalizeDictionary,exports.normalizeWhitespace=J.normalizeWhitespace,exports.number=H.number,exports.orderDictionaries=N.orderDictionaries,exports.parseBlock=J.parseBlock,exports.parseCaptureInline=J.parseCaptureInline,exports.parseInline=J.parseInline,exports.parseSimpleInline=J.parseSimpleInline,exports.parseStyleAttribute=J.parseStyleAttribute,exports.parseTableAlign=J.parseTableAlign,exports.parseTableAlignCapture=J.parseTableAlignCapture,exports.parseTableCells=J.parseTableCells,exports.parseTableRow=J.parseTableRow,exports.parseYaml=oe.parseYaml,exports.parserFor=ke.parserFor,exports.percentage=fe.percentage,exports.qualifies=J.qualifies,exports.relativeTime=pe.relativeTime,exports.removeContentNodeByKeyPath=F.removeContentNodeByKeyPath,exports.renameContentNodeByKeyPath=I.renameContentNodeByKeyPath,exports.renderFor=Y.renderFor,exports.renderNothing=J.renderNothing,exports.sanitizer=J.sanitizer,exports.setLocaleInStorage=U.setLocaleInStorage,exports.simpleInlineRegex=J.simpleInlineRegex,exports.slugify=J.slugify,exports.some=J.some,exports.splitInsertionTemplate=u.splitInsertionTemplate,exports.startsWith=J.startsWith,exports.t=h.t,exports.translationPlugin=s.translationPlugin,exports.trimEnd=J.trimEnd,exports.trimLeadingWhitespaceOutsideFences=J.trimLeadingWhitespaceOutsideFences,exports.unescapeString=J.unescapeString,exports.units=me.units,exports.unquote=J.unquote,exports.updateNodeChildren=L.updateNodeChildren,exports.validateHTML=m.validateHTML,exports.validateMarkdown=ce.validateMarkdown,exports.validatePrefix=Oe.validatePrefix,exports.vueI18nToIntlayerFormatter=$.vueI18nToIntlayerFormatter;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./getStorageAttributes.cjs`),t=require(`./interpreter/getCondition.cjs`),n=require(`./interpreter/getContent/deepTransform.cjs`),r=require(`./interpreter/getEnumeration.cjs`),i=require(`./getContent-DrqM8pqO.cjs`),a=require(`./interpreter/getTranslation.cjs`),ee=require(`./interpreter/getHTML.cjs`),te=require(`./interpreter/splitAndJoinInsertion.cjs`),o=require(`./deepTransformPlugins/getFilteredLocalesContent.cjs`),s=require(`./transpiler/condition/condition.cjs`),c=require(`./transpiler/enumeration/enumeration.cjs`),l=require(`./transpiler/gender/gender.cjs`),u=require(`./html-CZ1N-VL0.cjs`),d=require(`./transpiler/html/validateHTML.cjs`),ne=require(`./transpiler/html/htmlTags.cjs`),re=require(`./transpiler/insertion/getInsertionValues.cjs`),ie=require(`./transpiler/insertion/insertion.cjs`),ae=require(`./utils/parseYaml.cjs`),oe=require(`./transpiler/markdown/getMarkdownMetadata.cjs`),se=require(`./transpiler/markdown/validateMarkdown.cjs`),ce=require(`./transpiler/markdown/markdown.cjs`),le=require(`./transpiler/nesting/nesting.cjs`),ue=require(`./transpiler/translation/translation.cjs`),f=require(`./deepTransformPlugins/getFilterMissingTranslationsContent.cjs`),p=require(`./deepTransformPlugins/getFilterTranslationsOnlyContent.cjs`),m=require(`./deepTransformPlugins/getLocalizedContent.cjs`),h=require(`./deepTransformPlugins/getMaskContent.cjs`),g=require(`./deepTransformPlugins/getMissingLocalesContent.cjs`),_=require(`./deepTransformPlugins/getMultilingualDictionary.cjs`),v=require(`./deepTransformPlugins/getReplacedValuesContent.cjs`),y=require(`./deepTransformPlugins/getSplittedContent.cjs`),b=require(`./deepTransformPlugins/insertContentInDictionary.cjs`),x=require(`./dictionaryManipulator/editDictionaryByKeyPath.cjs`),S=require(`./dictionaryManipulator/getContentNodeByKeyPath.cjs`),C=require(`./dictionaryManipulator/getDefaultNode.cjs`),w=require(`./dictionaryManipulator/getEmptyNode.cjs`),T=require(`./dictionaryManipulator/getNodeChildren.cjs`),E=require(`./utils/isValidReactElement.cjs`),D=require(`./dictionaryManipulator/getNodeType.cjs`),O=require(`./dictionaryManipulator/mergeDictionaries.cjs`),k=require(`./dictionaryManipulator/orderDictionaries.cjs`),A=require(`./dictionaryManipulator/normalizeDictionary.cjs`),j=require(`./dictionaryManipulator/removeContentNodeByKeyPath.cjs`),M=require(`./dictionaryManipulator/renameContentNodeByKeyPath.cjs`),N=require(`./dictionaryManipulator/updateNodeChildren.cjs`);require(`./dictionaryManipulator/index.cjs`);const P=require(`./utils/intl.cjs`),F=require(`./formatters/compact.cjs`),I=require(`./formatters/currency.cjs`),L=require(`./formatters/date.cjs`),R=require(`./formatters/list.cjs`),z=require(`./formatters/number.cjs`),B=require(`./formatters/percentage.cjs`),de=require(`./formatters/relativeTime.cjs`),V=require(`./formatters/units.cjs`);require(`./formatters/index.cjs`);const H=require(`./utils/getCookie.cjs`),U=require(`./utils/localeStorage.cjs`),fe=require(`./localization/localeResolver.cjs`),pe=require(`./localization/localeDetector.cjs`),W=require(`./localization/getBrowserLocale.cjs`),me=require(`./localization/getHTMLTextDir.cjs`),he=require(`./localization/getLocale.cjs`),ge=require(`./utils/checkIsURLAbsolute.cjs`),_e=require(`./localization/getLocaleFromPath.cjs`),ve=require(`./localization/getLocaleLang.cjs`),ye=require(`./localization/getLocaleName.cjs`),be=require(`./localization/getPathWithoutLocale.cjs`),xe=require(`./localization/getPrefix.cjs`),G=require(`./localization/rewriteUtils.cjs`),Se=require(`./localization/getLocalizedUrl.cjs`),Ce=require(`./localization/getMultilingualUrls.cjs`),K=require(`./localization/localeMapper.cjs`),we=require(`./localization/validatePrefix.cjs`);require(`./localization/index.cjs`);const q=require(`./markdown/constants.cjs`),J=require(`./markdown/utils.cjs`),Te=require(`./markdown/parser.cjs`),Y=require(`./markdown/renderer.cjs`),X=require(`./markdown/compiler.cjs`);require(`./markdown/index.cjs`);const Z=require(`./messageFormat/ICU.cjs`),Q=require(`./messageFormat/i18next.cjs`),$=require(`./messageFormat/vue-i18n.cjs`);require(`./messageFormat/index.cjs`);const Ee=require(`./utils/isSameKeyPath.cjs`);require(`./utils/index.cjs`),exports.ATTRIBUTES_TO_SANITIZE=q.ATTRIBUTES_TO_SANITIZE,exports.ATTRIBUTE_TO_NODE_PROP_MAP=q.ATTRIBUTE_TO_NODE_PROP_MAP,exports.ATTR_EXTRACTOR_R=q.ATTR_EXTRACTOR_R,exports.BLOCKQUOTE_ALERT_R=q.BLOCKQUOTE_ALERT_R,exports.BLOCKQUOTE_R=q.BLOCKQUOTE_R,exports.BLOCKQUOTE_TRIM_LEFT_MULTILINE_R=q.BLOCKQUOTE_TRIM_LEFT_MULTILINE_R,exports.BLOCK_END_R=q.BLOCK_END_R,exports.BREAK_LINE_R=q.BREAK_LINE_R,exports.BREAK_THEMATIC_R=q.BREAK_THEMATIC_R,exports.CAPTURE_LETTER_AFTER_HYPHEN=q.CAPTURE_LETTER_AFTER_HYPHEN,exports.CODE_BLOCK_FENCED_R=q.CODE_BLOCK_FENCED_R,exports.CODE_BLOCK_R=q.CODE_BLOCK_R,exports.CODE_INLINE_R=q.CODE_INLINE_R,exports.CONSECUTIVE_NEWLINE_R=q.CONSECUTIVE_NEWLINE_R,exports.CR_NEWLINE_R=q.CR_NEWLINE_R,exports.CUSTOM_COMPONENT_R=q.CUSTOM_COMPONENT_R,exports.CachedIntl=P.CachedIntl,exports.Intl=P.CachedIntl,exports.DO_NOT_PROCESS_HTML_ELEMENTS=q.DO_NOT_PROCESS_HTML_ELEMENTS,exports.DURATION_DELAY_TRIGGER=q.DURATION_DELAY_TRIGGER,exports.FOOTNOTE_R=q.FOOTNOTE_R,exports.FOOTNOTE_REFERENCE_R=q.FOOTNOTE_REFERENCE_R,exports.FORMFEED_R=q.FORMFEED_R,exports.FRONT_MATTER_R=q.FRONT_MATTER_R,exports.GFM_TASK_R=q.GFM_TASK_R,exports.HEADING_ATX_COMPLIANT_R=q.HEADING_ATX_COMPLIANT_R,exports.HEADING_R=q.HEADING_R,exports.HEADING_SETEXT_R=q.HEADING_SETEXT_R,exports.HTML_BLOCK_ELEMENT_R=q.HTML_BLOCK_ELEMENT_R,exports.HTML_CHAR_CODE_R=q.HTML_CHAR_CODE_R,exports.HTML_COMMENT_R=q.HTML_COMMENT_R,exports.HTML_CUSTOM_ATTR_R=q.HTML_CUSTOM_ATTR_R,exports.HTML_LEFT_TRIM_AMOUNT_R=q.HTML_LEFT_TRIM_AMOUNT_R,exports.HTML_SELF_CLOSING_ELEMENT_R=q.HTML_SELF_CLOSING_ELEMENT_R,exports.HTML_TAGS=ne.HTML_TAGS,exports.INLINE_SKIP_R=q.INLINE_SKIP_R,exports.INTERPOLATION_R=q.INTERPOLATION_R,exports.LINK_AUTOLINK_BARE_URL_R=q.LINK_AUTOLINK_BARE_URL_R,exports.LINK_AUTOLINK_R=q.LINK_AUTOLINK_R,exports.LIST_LOOKBEHIND_R=q.LIST_LOOKBEHIND_R,exports.LOOKAHEAD=q.LOOKAHEAD,exports.LocaleStorage=U.LocaleStorage,exports.NAMED_CODES_TO_UNICODE=q.NAMED_CODES_TO_UNICODE,exports.NP_TABLE_R=q.NP_TABLE_R,exports.ORDERED=q.ORDERED,exports.ORDERED_LIST_BULLET=q.ORDERED_LIST_BULLET,exports.ORDERED_LIST_ITEM_PREFIX=q.ORDERED_LIST_ITEM_PREFIX,exports.ORDERED_LIST_ITEM_PREFIX_R=q.ORDERED_LIST_ITEM_PREFIX_R,exports.ORDERED_LIST_ITEM_R=q.ORDERED_LIST_ITEM_R,exports.ORDERED_LIST_R=q.ORDERED_LIST_R,exports.PARAGRAPH_R=q.PARAGRAPH_R,exports.Priority=q.Priority,exports.REFERENCE_IMAGE_OR_LINK=q.REFERENCE_IMAGE_OR_LINK,exports.REFERENCE_IMAGE_R=q.REFERENCE_IMAGE_R,exports.REFERENCE_LINK_R=q.REFERENCE_LINK_R,exports.RuleType=q.RuleType,exports.SHORTCODE_R=q.SHORTCODE_R,exports.SHOULD_RENDER_AS_BLOCK_R=q.SHOULD_RENDER_AS_BLOCK_R,exports.TABLE_CENTER_ALIGN=q.TABLE_CENTER_ALIGN,exports.TABLE_LEFT_ALIGN=q.TABLE_LEFT_ALIGN,exports.TABLE_RIGHT_ALIGN=q.TABLE_RIGHT_ALIGN,exports.TABLE_TRIM_PIPES=q.TABLE_TRIM_PIPES,exports.TAB_R=q.TAB_R,exports.TEXT_BOLD_R=q.TEXT_BOLD_R,exports.TEXT_EMPHASIZED_R=q.TEXT_EMPHASIZED_R,exports.TEXT_ESCAPED_R=q.TEXT_ESCAPED_R,exports.TEXT_MARKED_R=q.TEXT_MARKED_R,exports.TEXT_PLAIN_R=q.TEXT_PLAIN_R,exports.TEXT_STRIKETHROUGHED_R=q.TEXT_STRIKETHROUGHED_R,exports.TRIM_STARTING_NEWLINES=q.TRIM_STARTING_NEWLINES,exports.UNESCAPE_R=q.UNESCAPE_R,exports.UNORDERED=q.UNORDERED,exports.UNORDERED_LIST_BULLET=q.UNORDERED_LIST_BULLET,exports.UNORDERED_LIST_ITEM_PREFIX=q.UNORDERED_LIST_ITEM_PREFIX,exports.UNORDERED_LIST_ITEM_PREFIX_R=q.UNORDERED_LIST_ITEM_PREFIX_R,exports.UNORDERED_LIST_ITEM_R=q.UNORDERED_LIST_ITEM_R,exports.UNORDERED_LIST_R=q.UNORDERED_LIST_R,exports.VOID_ELEMENTS=d.VOID_ELEMENTS,exports.allowInline=J.allowInline,exports.anyScopeRegex=J.anyScopeRegex,exports.attributeValueToNodePropValue=J.attributeValueToNodePropValue,exports.bindIntl=P.bindIntl,exports.blockRegex=J.blockRegex,exports.buildMaskPlugin=h.buildMaskPlugin,exports.captureNothing=J.captureNothing,exports.checkIsURLAbsolute=ge.checkIsURLAbsolute,exports.checkMissingLocalesPlugin=g.checkMissingLocalesPlugin,exports.compact=F.compact,exports.compile=X.compile,exports.compileWithOptions=X.compileWithOptions,exports.cond=s.cond,exports.conditionPlugin=i.r,exports.createCachedIntl=P.createCachedIntl,exports.createCompiler=X.createCompiler,exports.createRenderer=Y.createRenderer,exports.currency=I.currency,exports.cx=J.cx,exports.date=L.date,exports.deepTransformNode=n.deepTransformNode,exports.editDictionaryByKeyPath=x.editDictionaryByKeyPath,exports.enu=c.enu,exports.enumerationPlugin=i.i,exports.filePlugin=i.a,exports.filterMissingTranslationsOnlyPlugin=f.filterMissingTranslationsOnlyPlugin,exports.filterTranslationsOnlyPlugin=p.filterTranslationsOnlyPlugin,exports.findMatchingCondition=r.findMatchingCondition,exports.gender=l.gender,exports.genderPlugin=i.o,exports.generateListItemPrefix=q.generateListItemPrefix,exports.generateListItemPrefixRegex=q.generateListItemPrefixRegex,exports.generateListItemRegex=q.generateListItemRegex,exports.generateListRegex=q.generateListRegex,exports.get=J.get,exports.getBasePlugins=i.t,exports.getBrowserLocale=W.getBrowserLocale,exports.getCanonicalPath=G.getCanonicalPath,exports.getCondition=t.getCondition,exports.getContent=i.n,exports.getContentNodeByKeyPath=S.getContentNodeByKeyPath,exports.getCookie=H.getCookie,exports.getDefaultNode=C.getDefaultNode,exports.getDictionary=i.f,exports.getEmptyNode=w.getEmptyNode,exports.getEnumeration=r.getEnumeration,exports.getFilterMissingTranslationsContent=f.getFilterMissingTranslationsContent,exports.getFilterMissingTranslationsDictionary=f.getFilterMissingTranslationsDictionary,exports.getFilterTranslationsOnlyContent=p.getFilterTranslationsOnlyContent,exports.getFilterTranslationsOnlyDictionary=p.getFilterTranslationsOnlyDictionary,exports.getFilteredLocalesContent=o.getFilteredLocalesContent,exports.getFilteredLocalesDictionary=o.getFilteredLocalesDictionary,exports.getHTML=ee.getHTML,exports.getHTMLTextDir=me.getHTMLTextDir,exports.getInsertionValues=re.getInsertionValues,exports.getInternalPath=G.getInternalPath,exports.getIntlayer=i.d,exports.getLocale=he.getLocale,exports.getLocaleFromPath=_e.getLocaleFromPath,exports.getLocaleFromStorage=U.getLocaleFromStorage,exports.getLocaleLang=ve.getLocaleLang,exports.getLocaleName=ye.getLocaleName,exports.getLocalizedContent=m.getLocalizedContent,exports.getLocalizedPath=G.getLocalizedPath,exports.getLocalizedUrl=Se.getLocalizedUrl,exports.getMarkdownMetadata=oe.getMarkdownMetadata,exports.getMaskContent=h.getMaskContent,exports.getMissingLocalesContent=g.getMissingLocalesContent,exports.getMissingLocalesContentFromDictionary=g.getMissingLocalesContentFromDictionary,exports.getMultilingualDictionary=_.getMultilingualDictionary,exports.getMultilingualUrls=Ce.getMultilingualUrls,exports.getNesting=i.u,exports.getNodeChildren=T.getNodeChildren,exports.getNodeType=D.getNodeType,exports.getPathWithoutLocale=be.getPathWithoutLocale,exports.getPerLocaleDictionary=m.getPerLocaleDictionary,exports.getPrefix=xe.getPrefix,exports.getReplacedValuesContent=v.getReplacedValuesContent,exports.getRewritePath=G.getRewritePath,exports.getRewriteRules=G.getRewriteRules,exports.getSplittedContent=y.getSplittedContent,exports.getSplittedDictionaryContent=y.getSplittedDictionaryContent,exports.getStorageAttributes=e.getStorageAttributes,exports.getTranslation=a.getTranslation,exports.html=u.t,exports.i18nextToIntlayerFormatter=Q.i18nextToIntlayerFormatter,exports.icuToIntlayerFormatter=Z.icuToIntlayerFormatter,exports.inlineRegex=J.inlineRegex,exports.insert=ie.insert,exports.insertContentInDictionary=b.insertContentInDictionary,exports.insertionPlugin=i.s,exports.intlayerToI18nextFormatter=Q.intlayerToI18nextFormatter,exports.intlayerToICUFormatter=Z.intlayerToICUFormatter,exports.intlayerToVueI18nFormatter=$.intlayerToVueI18nFormatter,exports.isSameKeyPath=Ee.isSameKeyPath,exports.isValidElement=E.isValidElement,exports.list=R.list,exports.localeDetector=pe.localeDetector,exports.localeFlatMap=K.localeFlatMap,exports.localeMap=K.localeMap,exports.localeRecord=K.localeRecord,exports.localeResolver=fe.localeResolver,exports.localeStorageOptions=W.localeStorageOptions,exports.md=ce.md,exports.mergeDictionaries=O.mergeDictionaries,exports.nest=le.nest,exports.nestedPlugin=i.c,exports.normalizeAttributeKey=J.normalizeAttributeKey,exports.normalizeDictionaries=A.normalizeDictionaries,exports.normalizeDictionary=A.normalizeDictionary,exports.normalizeWhitespace=J.normalizeWhitespace,exports.number=z.number,exports.orderDictionaries=k.orderDictionaries,exports.parseBlock=J.parseBlock,exports.parseCaptureInline=J.parseCaptureInline,exports.parseInline=J.parseInline,exports.parseSimpleInline=J.parseSimpleInline,exports.parseStyleAttribute=J.parseStyleAttribute,exports.parseTableAlign=J.parseTableAlign,exports.parseTableAlignCapture=J.parseTableAlignCapture,exports.parseTableCells=J.parseTableCells,exports.parseTableRow=J.parseTableRow,exports.parseYaml=ae.parseYaml,exports.parserFor=Te.parserFor,exports.percentage=B.percentage,exports.qualifies=J.qualifies,exports.relativeTime=de.relativeTime,exports.removeContentNodeByKeyPath=j.removeContentNodeByKeyPath,exports.renameContentNodeByKeyPath=M.renameContentNodeByKeyPath,exports.renderFor=Y.renderFor,exports.renderNothing=J.renderNothing,exports.sanitizer=J.sanitizer,exports.setLocaleInStorage=U.setLocaleInStorage,exports.simpleInlineRegex=J.simpleInlineRegex,exports.slugify=J.slugify,exports.some=J.some,exports.splitInsertionTemplate=te.splitInsertionTemplate,exports.startsWith=J.startsWith,exports.t=ue.t,exports.translationPlugin=i.l,exports.trimEnd=J.trimEnd,exports.trimLeadingWhitespaceOutsideFences=J.trimLeadingWhitespaceOutsideFences,exports.unescapeString=J.unescapeString,exports.units=V.units,exports.unquote=J.unquote,exports.updateNodeChildren=N.updateNodeChildren,exports.validateHTML=d.validateHTML,exports.validateMarkdown=se.validateMarkdown,exports.validatePrefix=we.validatePrefix,exports.vueI18nToIntlayerFormatter=$.vueI18nToIntlayerFormatter;