@unicom-cloud/utils 0.1.23 → 0.1.25

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 (1054) hide show
  1. package/case-name/index.js +8 -7
  2. package/caseName.js +8 -7
  3. package/class-name/index.js +1 -0
  4. package/className.js +1 -0
  5. package/clipboard-copy/index.js +8 -8
  6. package/clipboardCopy.js +3 -3
  7. package/constant/address.js +1 -0
  8. package/constant/chineseCharacters.js +1 -0
  9. package/constant/constellations.js +1 -0
  10. package/constant/domain.js +1 -0
  11. package/constant/emoji.js +1 -0
  12. package/constant/identity.js +1 -0
  13. package/constant/index.js +1 -0
  14. package/constant/keyboardCode.js +1 -0
  15. package/constant/licensePlate.js +1 -0
  16. package/constant/name.js +1 -0
  17. package/constant/platform.js +12 -11
  18. package/constant/protocol.js +1 -0
  19. package/constant/ui.js +1 -0
  20. package/constant.js +1 -0
  21. package/content-disposition/index.js +3 -3
  22. package/contentDisposition.js +6 -6
  23. package/cookie/index.js +1 -0
  24. package/cookie/src/index.js +1 -0
  25. package/cookie.js +1 -0
  26. package/date/convertTime.js +1 -0
  27. package/date/convertToDuration.js +18 -0
  28. package/date/index.js +10 -19
  29. package/date.js +8 -6
  30. package/decimal/decimal.js +24 -23
  31. package/decimal/index.js +1 -0
  32. package/decimal.js +1 -0
  33. package/dom-helpers/activeElement.js +13 -0
  34. package/dom-helpers/addClass.js +11 -0
  35. package/dom-helpers/addEventListener.js +34 -0
  36. package/dom-helpers/animate.js +51 -0
  37. package/dom-helpers/animationFrame.js +21 -0
  38. package/dom-helpers/attribute.js +11 -0
  39. package/dom-helpers/camelize.js +8 -0
  40. package/dom-helpers/camelizeStyle.js +9 -0
  41. package/dom-helpers/canUseDOM.js +5 -0
  42. package/dom-helpers/childElements.js +7 -0
  43. package/dom-helpers/childNodes.js +8 -0
  44. package/dom-helpers/clear.js +12 -0
  45. package/dom-helpers/closest.js +14 -0
  46. package/dom-helpers/collectElements.js +11 -0
  47. package/dom-helpers/collectSiblings.js +15 -0
  48. package/dom-helpers/contains.js +9 -0
  49. package/dom-helpers/css.js +16 -0
  50. package/dom-helpers/filterEventHandler.js +12 -0
  51. package/dom-helpers/getComputedStyle.js +8 -0
  52. package/dom-helpers/getScrollAccessor.js +15 -0
  53. package/dom-helpers/hasClass.js +9 -0
  54. package/dom-helpers/height.js +10 -0
  55. package/dom-helpers/hyphenate.js +8 -0
  56. package/dom-helpers/hyphenateStyle.js +9 -0
  57. package/dom-helpers/index.js +140 -0
  58. package/dom-helpers/insertAfter.js +7 -0
  59. package/dom-helpers/isDocument.js +7 -0
  60. package/dom-helpers/isInput.js +8 -0
  61. package/dom-helpers/isTransform.js +8 -0
  62. package/dom-helpers/isVisible.js +7 -0
  63. package/dom-helpers/isWindow.js +8 -0
  64. package/dom-helpers/listen.js +11 -0
  65. package/dom-helpers/matches.js +12 -0
  66. package/dom-helpers/nextUntil.js +8 -0
  67. package/dom-helpers/offset.js +19 -0
  68. package/dom-helpers/offsetParent.js +14 -0
  69. package/dom-helpers/ownerDocument.js +7 -0
  70. package/dom-helpers/ownerWindow.js +9 -0
  71. package/dom-helpers/parents.js +8 -0
  72. package/dom-helpers/position.js +29 -0
  73. package/dom-helpers/prepend.js +7 -0
  74. package/dom-helpers/querySelectorAll.js +8 -0
  75. package/dom-helpers/reflow.js +26 -0
  76. package/dom-helpers/remove.js +7 -0
  77. package/dom-helpers/removeClass.js +19 -0
  78. package/dom-helpers/removeEventListener.js +8 -0
  79. package/dom-helpers/scrollLeft.js +6 -0
  80. package/dom-helpers/scrollParent.js +17 -0
  81. package/dom-helpers/scrollTo.js +27 -0
  82. package/dom-helpers/scrollTop.js +6 -0
  83. package/dom-helpers/scrollbarSize.js +13 -0
  84. package/dom-helpers/siblings.js +11 -0
  85. package/dom-helpers/text.js +9 -0
  86. package/dom-helpers/toggleClass.js +10 -0
  87. package/dom-helpers/transitionEnd.js +34 -0
  88. package/dom-helpers/triggerEvent.js +10 -0
  89. package/dom-helpers/types.js +5 -0
  90. package/dom-helpers/width.js +10 -0
  91. package/domHelpers.js +94 -0
  92. package/emitter/index.js +1 -0
  93. package/emitter/src/index.js +1 -0
  94. package/emitter.js +1 -0
  95. package/file/fileToURL.js +11 -11
  96. package/file/index.js +1 -0
  97. package/file/saveAs.js +1 -0
  98. package/file.js +1 -0
  99. package/filesize/types/constants.d.ts +30 -0
  100. package/filesize/types/helpers.d.ts +130 -0
  101. package/idb/index.js +103 -0
  102. package/idb.js +5 -0
  103. package/index.js +1 -0
  104. package/invariant/index.js +1 -0
  105. package/invariant.js +1 -0
  106. package/is/index.js +119 -119
  107. package/is.js +38 -37
  108. package/js-cookie/index.js +1 -0
  109. package/js-cookie/src/api.js +1 -0
  110. package/js-cookie/src/assign.js +1 -0
  111. package/js-cookie/src/converter.js +1 -0
  112. package/jsCookie.js +1 -0
  113. package/lunar/index.js +1 -0
  114. package/lunar/lib/Holiday.js +1 -0
  115. package/lunar/lib/HolidayUtil.js +1 -0
  116. package/lunar/lib/I18n.js +1 -0
  117. package/lunar/lib/JieQi.js +1 -0
  118. package/lunar/lib/Lunar.js +1 -0
  119. package/lunar/lib/LunarMonth.js +1 -0
  120. package/lunar/lib/LunarTime.js +1 -0
  121. package/lunar/lib/LunarUtil.js +1 -0
  122. package/lunar/lib/LunarYear.js +1 -0
  123. package/lunar/lib/ShouXingUtil.js +1 -0
  124. package/lunar/lib/Solar.js +1 -0
  125. package/lunar/lib/SolarHalfYear.js +1 -0
  126. package/lunar/lib/SolarMonth.js +1 -0
  127. package/lunar/lib/SolarSeason.js +1 -0
  128. package/lunar/lib/SolarUtil.js +1 -0
  129. package/lunar/lib/SolarWeek.js +1 -0
  130. package/lunar/lib/SolarYear.js +1 -0
  131. package/lunar/lib/index.js +1 -0
  132. package/lunar.js +1 -0
  133. package/math/index.js +1 -0
  134. package/math.js +1 -0
  135. package/md5/index.js +1 -0
  136. package/md5.js +1 -0
  137. package/mock/MockWebSocket.js +1 -1
  138. package/mock/MockXMLHttpRequest.js +1 -1
  139. package/mock/index.js +1 -0
  140. package/mock.js +1 -0
  141. package/normalize-wheel/ExecutionEnvironment.js +4 -2
  142. package/normalize-wheel/UserAgent_DEPRECATED.js +1 -0
  143. package/normalize-wheel/index.js +1 -0
  144. package/normalize-wheel/isEventSupported.js +10 -13
  145. package/normalizeWheel.js +1 -0
  146. package/number-to-chinese/index.js +1 -0
  147. package/numberToChinese.js +1 -0
  148. package/nzh/cn.js +1 -0
  149. package/nzh/hk.js +1 -0
  150. package/nzh/index.js +1 -0
  151. package/nzh/nzh.js +1 -0
  152. package/nzh/src/autoGet.js +1 -0
  153. package/nzh/src/index.js +1 -0
  154. package/nzh/src/langs/cn_b.js +1 -0
  155. package/nzh/src/langs/cn_s.js +1 -0
  156. package/nzh/src/langs/hk_b.js +1 -0
  157. package/nzh/src/langs/hk_s.js +1 -0
  158. package/nzh/src/utils.js +1 -0
  159. package/nzh.js +1 -0
  160. package/object-keys-sort/index.js +1 -0
  161. package/objectKeysSort.js +1 -0
  162. package/package.json +1 -1
  163. package/pinyin/index.js +1 -0
  164. package/pinyin/simplified.js +1 -0
  165. package/pinyin/src/core.js +44 -42
  166. package/pinyin/src/simplified.js +6 -5
  167. package/pinyin/src/simplified_dict.js +3 -3
  168. package/pinyin/src/traditional.js +4 -3
  169. package/pinyin/src/traditional_dict.js +3 -3
  170. package/pinyin/traditional.js +1 -0
  171. package/pinyin.js +1 -0
  172. package/query-string/base.d.ts +102 -12
  173. package/query-string/base.js +76 -67
  174. package/query-string/index.js +1 -0
  175. package/query-string/splitOnFirst.js +1 -0
  176. package/queryString.js +1 -0
  177. package/random/address.js +1 -0
  178. package/random/constellation.js +1 -0
  179. package/random/image.js +1 -0
  180. package/random/index.js +6 -5
  181. package/random/licensePlate.js +1 -0
  182. package/random/name.js +1 -0
  183. package/random/number.js +1 -0
  184. package/random/text.js +1 -0
  185. package/random/time.js +1 -0
  186. package/random/web.js +1 -0
  187. package/random.js +1 -0
  188. package/screenfull/index.js +47 -117
  189. package/screenfull.js +1 -0
  190. package/sleep/index.js +7 -0
  191. package/sleep.js +5 -0
  192. package/snapdom/index.js +1 -0
  193. package/snapdom/src/api/preCache.js +70 -40
  194. package/snapdom/src/api/snapdom.js +189 -107
  195. package/snapdom/src/core/cache.js +28 -5
  196. package/snapdom/src/core/capture.js +358 -70
  197. package/snapdom/src/core/clone.js +330 -96
  198. package/snapdom/src/core/context.js +59 -0
  199. package/snapdom/src/core/plugins.js +69 -0
  200. package/snapdom/src/core/prepare.js +125 -126
  201. package/snapdom/src/exporters/download.js +16 -0
  202. package/snapdom/src/exporters/toBlob.js +21 -0
  203. package/snapdom/src/exporters/toCanvas.js +106 -0
  204. package/snapdom/src/exporters/toImg.js +36 -0
  205. package/snapdom/src/modules/CSSVar.js +87 -0
  206. package/snapdom/src/modules/background.js +67 -28
  207. package/snapdom/src/modules/changeCSS.js +61 -0
  208. package/snapdom/src/modules/counter.js +179 -0
  209. package/snapdom/src/modules/fonts.js +640 -179
  210. package/snapdom/src/modules/iconFonts.js +98 -13
  211. package/snapdom/src/modules/images.js +48 -13
  212. package/snapdom/src/modules/lineClamp.js +42 -0
  213. package/snapdom/src/modules/pseudo.js +205 -64
  214. package/snapdom/src/modules/rasterize.js +10 -0
  215. package/snapdom/src/modules/snapFetch.js +263 -0
  216. package/snapdom/src/modules/styles.js +144 -23
  217. package/snapdom/src/modules/svgDefs.js +86 -38
  218. package/snapdom/src/utils/browser.js +13 -0
  219. package/snapdom/src/utils/css.js +191 -0
  220. package/snapdom/src/utils/helpers.js +25 -234
  221. package/snapdom/src/utils/image.js +39 -0
  222. package/snapdom/types/snapdom.d.ts +353 -92
  223. package/snapdom.js +1 -0
  224. package/tinycolor/index.js +2 -1
  225. package/tinycolor/src/conversion.js +2 -1
  226. package/tinycolor/src/css-color-names.js +1 -0
  227. package/tinycolor/src/format-input.js +2 -1
  228. package/tinycolor/src/from-ratio.js +2 -1
  229. package/tinycolor/src/index.js +2 -1
  230. package/tinycolor/src/random.js +1 -0
  231. package/tinycolor/src/readability.js +1 -0
  232. package/tinycolor/src/to-ms-filter.js +1 -0
  233. package/tinycolor/src/{util.js → utils.js} +1 -0
  234. package/tinycolor.js +2 -1
  235. package/tree/index.js +69 -65
  236. package/tree/search/index.js +50 -57
  237. package/tree.js +11 -7
  238. package/tween/index.js +8 -0
  239. package/tween/src/easing.js +62 -0
  240. package/tween/src/tween.js +46 -0
  241. package/tween.js +8 -0
  242. package/types/date/convertToDuration.d.ts +2 -0
  243. package/types/date/index.d.ts +2 -2
  244. package/types/dom-helpers/activeElement.d.ts +6 -0
  245. package/types/dom-helpers/addClass.d.ts +7 -0
  246. package/types/dom-helpers/addEventListener.d.ts +16 -0
  247. package/types/dom-helpers/animate.d.ts +19 -0
  248. package/types/dom-helpers/animationFrame.d.ts +2 -0
  249. package/types/dom-helpers/attribute.d.ts +8 -0
  250. package/types/dom-helpers/camelize.d.ts +1 -0
  251. package/types/dom-helpers/camelizeStyle.d.ts +2 -0
  252. package/types/dom-helpers/canUseDOM.d.ts +2 -0
  253. package/types/dom-helpers/childElements.d.ts +6 -0
  254. package/types/dom-helpers/childNodes.d.ts +6 -0
  255. package/types/dom-helpers/clear.d.ts +6 -0
  256. package/types/dom-helpers/closest.d.ts +8 -0
  257. package/types/dom-helpers/collectElements.d.ts +3 -0
  258. package/types/dom-helpers/collectSiblings.d.ts +1 -0
  259. package/types/dom-helpers/contains.d.ts +7 -0
  260. package/types/dom-helpers/css.d.ts +3 -0
  261. package/types/dom-helpers/filterEventHandler.d.ts +2 -0
  262. package/types/dom-helpers/getComputedStyle.d.ts +7 -0
  263. package/types/dom-helpers/getScrollAccessor.d.ts +1 -0
  264. package/types/dom-helpers/hasClass.d.ts +7 -0
  265. package/types/dom-helpers/height.d.ts +7 -0
  266. package/types/dom-helpers/hyphenate.d.ts +1 -0
  267. package/types/dom-helpers/hyphenateStyle.d.ts +7 -0
  268. package/types/dom-helpers/index.d.ts +93 -0
  269. package/types/dom-helpers/insertAfter.d.ts +7 -0
  270. package/types/dom-helpers/isDocument.d.ts +1 -0
  271. package/types/dom-helpers/isInput.d.ts +6 -0
  272. package/types/dom-helpers/isTransform.d.ts +2 -0
  273. package/types/dom-helpers/isVisible.d.ts +6 -0
  274. package/types/dom-helpers/isWindow.d.ts +1 -0
  275. package/types/dom-helpers/listen.d.ts +3 -0
  276. package/types/dom-helpers/matches.d.ts +7 -0
  277. package/types/dom-helpers/nextUntil.d.ts +7 -0
  278. package/types/dom-helpers/offset.d.ts +11 -0
  279. package/types/dom-helpers/offsetParent.d.ts +1 -0
  280. package/types/dom-helpers/ownerDocument.d.ts +6 -0
  281. package/types/dom-helpers/ownerWindow.d.ts +6 -0
  282. package/types/dom-helpers/parents.d.ts +6 -0
  283. package/types/dom-helpers/position.d.ts +23 -0
  284. package/types/dom-helpers/prepend.d.ts +7 -0
  285. package/types/dom-helpers/querySelectorAll.d.ts +7 -0
  286. package/types/dom-helpers/reflow.d.ts +2 -0
  287. package/types/dom-helpers/remove.d.ts +6 -0
  288. package/types/dom-helpers/removeClass.d.ts +7 -0
  289. package/types/dom-helpers/removeEventListener.d.ts +11 -0
  290. package/types/dom-helpers/scrollLeft.d.ts +8 -0
  291. package/types/dom-helpers/scrollParent.d.ts +7 -0
  292. package/types/dom-helpers/scrollTo.d.ts +1 -0
  293. package/types/dom-helpers/scrollTop.d.ts +8 -0
  294. package/types/dom-helpers/scrollbarSize.d.ts +1 -0
  295. package/types/dom-helpers/siblings.d.ts +6 -0
  296. package/types/dom-helpers/text.d.ts +8 -0
  297. package/types/dom-helpers/toggleClass.d.ts +7 -0
  298. package/types/dom-helpers/transitionEnd.d.ts +2 -0
  299. package/types/dom-helpers/triggerEvent.d.ts +9 -0
  300. package/types/dom-helpers/types.d.ts +6 -0
  301. package/types/dom-helpers/width.d.ts +7 -0
  302. package/types/filesize/benchmarks/basic-performance.d.ts +1 -0
  303. package/types/filesize/benchmarks/index.d.ts +2 -0
  304. package/types/filesize/benchmarks/options-benchmark.d.ts +1 -0
  305. package/types/filesize/benchmarks/partial-benchmark.d.ts +1 -0
  306. package/types/filesize/benchmarks/stress-test.d.ts +1 -0
  307. package/types/filesize/src/constants.d.ts +5 -0
  308. package/types/filesize/src/helpers.d.ts +55 -0
  309. package/types/idb/index.d.ts +21 -0
  310. package/types/index.d.ts +1 -1
  311. package/types/is/index.d.ts +37 -37
  312. package/types/lodash/_DataView.d.ts +2 -0
  313. package/types/lodash/_Hash.d.ts +29 -0
  314. package/types/lodash/_LazyWrapper.d.ts +26 -0
  315. package/types/lodash/_ListCache.d.ts +29 -0
  316. package/types/lodash/_LodashWrapper.d.ts +24 -0
  317. package/types/lodash/_Map.d.ts +2 -0
  318. package/types/lodash/_MapCache.d.ts +29 -0
  319. package/types/lodash/_Promise.d.ts +2 -0
  320. package/types/lodash/_Set.d.ts +2 -0
  321. package/types/lodash/_SetCache.d.ts +28 -0
  322. package/types/lodash/_Stack.d.ts +32 -0
  323. package/types/lodash/_Symbol.d.ts +3 -0
  324. package/types/lodash/_Uint8Array.d.ts +3 -0
  325. package/types/lodash/_WeakMap.d.ts +2 -0
  326. package/types/lodash/_addMapEntry.d.ts +10 -0
  327. package/types/lodash/_addSetEntry.d.ts +10 -0
  328. package/types/lodash/_apply.d.ts +12 -0
  329. package/types/lodash/_arrayAggregator.d.ts +12 -0
  330. package/types/lodash/_arrayEach.d.ts +11 -0
  331. package/types/lodash/_arrayEachRight.d.ts +11 -0
  332. package/types/lodash/_arrayEvery.d.ts +12 -0
  333. package/types/lodash/_arrayFilter.d.ts +11 -0
  334. package/types/lodash/_arrayIncludes.d.ts +11 -0
  335. package/types/lodash/_arrayIncludesWith.d.ts +11 -0
  336. package/types/lodash/_arrayLikeKeys.d.ts +10 -0
  337. package/types/lodash/_arrayMap.d.ts +11 -0
  338. package/types/lodash/_arrayPush.d.ts +10 -0
  339. package/types/lodash/_arrayReduce.d.ts +14 -0
  340. package/types/lodash/_arrayReduceRight.d.ts +14 -0
  341. package/types/lodash/_arraySample.d.ts +9 -0
  342. package/types/lodash/_arraySampleSize.d.ts +10 -0
  343. package/types/lodash/_arrayShuffle.d.ts +9 -0
  344. package/types/lodash/_arraySome.d.ts +12 -0
  345. package/types/lodash/_asciiSize.d.ts +9 -0
  346. package/types/lodash/_asciiToArray.d.ts +9 -0
  347. package/types/lodash/_asciiWords.d.ts +9 -0
  348. package/types/lodash/_assignMergeValue.d.ts +11 -0
  349. package/types/lodash/_assignValue.d.ts +12 -0
  350. package/types/lodash/_assocIndexOf.d.ts +10 -0
  351. package/types/lodash/_baseAggregator.d.ts +13 -0
  352. package/types/lodash/_baseAssign.d.ts +11 -0
  353. package/types/lodash/_baseAssignIn.d.ts +11 -0
  354. package/types/lodash/_baseAssignValue.d.ts +11 -0
  355. package/types/lodash/_baseAt.d.ts +10 -0
  356. package/types/lodash/_baseClamp.d.ts +11 -0
  357. package/types/lodash/_baseClone.d.ts +18 -0
  358. package/types/lodash/_baseConforms.d.ts +9 -0
  359. package/types/lodash/_baseConformsTo.d.ts +10 -0
  360. package/types/lodash/_baseCreate.d.ts +2 -0
  361. package/types/lodash/_baseDelay.d.ts +12 -0
  362. package/types/lodash/_baseDifference.d.ts +13 -0
  363. package/types/lodash/_baseEach.d.ts +10 -0
  364. package/types/lodash/_baseEachRight.d.ts +10 -0
  365. package/types/lodash/_baseEvery.d.ts +11 -0
  366. package/types/lodash/_baseExtremum.d.ts +12 -0
  367. package/types/lodash/_baseFill.d.ts +12 -0
  368. package/types/lodash/_baseFilter.d.ts +10 -0
  369. package/types/lodash/_baseFindIndex.d.ts +13 -0
  370. package/types/lodash/_baseFindKey.d.ts +13 -0
  371. package/types/lodash/_baseFlatten.d.ts +13 -0
  372. package/types/lodash/_baseFor.d.ts +13 -0
  373. package/types/lodash/_baseForOwn.d.ts +10 -0
  374. package/types/lodash/_baseForOwnRight.d.ts +10 -0
  375. package/types/lodash/_baseForRight.d.ts +12 -0
  376. package/types/lodash/_baseFunctions.d.ts +11 -0
  377. package/types/lodash/_baseGet.d.ts +10 -0
  378. package/types/lodash/_baseGetAllKeys.d.ts +13 -0
  379. package/types/lodash/_baseGetTag.d.ts +9 -0
  380. package/types/lodash/_baseGt.d.ts +11 -0
  381. package/types/lodash/_baseHas.d.ts +10 -0
  382. package/types/lodash/_baseHasIn.d.ts +10 -0
  383. package/types/lodash/_baseInRange.d.ts +11 -0
  384. package/types/lodash/_baseIndexOf.d.ts +11 -0
  385. package/types/lodash/_baseIndexOfWith.d.ts +12 -0
  386. package/types/lodash/_baseIntersection.d.ts +12 -0
  387. package/types/lodash/_baseInverter.d.ts +13 -0
  388. package/types/lodash/_baseInvoke.d.ts +12 -0
  389. package/types/lodash/_baseIsArguments.d.ts +9 -0
  390. package/types/lodash/_baseIsArrayBuffer.d.ts +9 -0
  391. package/types/lodash/_baseIsDate.d.ts +9 -0
  392. package/types/lodash/_baseIsEqual.d.ts +16 -0
  393. package/types/lodash/_baseIsEqualDeep.d.ts +16 -0
  394. package/types/lodash/_baseIsMap.d.ts +9 -0
  395. package/types/lodash/_baseIsMatch.d.ts +12 -0
  396. package/types/lodash/_baseIsNaN.d.ts +9 -0
  397. package/types/lodash/_baseIsNative.d.ts +10 -0
  398. package/types/lodash/_baseIsRegExp.d.ts +9 -0
  399. package/types/lodash/_baseIsSet.d.ts +9 -0
  400. package/types/lodash/_baseIsTypedArray.d.ts +9 -0
  401. package/types/lodash/_baseIteratee.d.ts +9 -0
  402. package/types/lodash/_baseKeys.d.ts +9 -0
  403. package/types/lodash/_baseKeysIn.d.ts +9 -0
  404. package/types/lodash/_baseLodash.d.ts +7 -0
  405. package/types/lodash/_baseLt.d.ts +11 -0
  406. package/types/lodash/_baseMap.d.ts +10 -0
  407. package/types/lodash/_baseMatches.d.ts +9 -0
  408. package/types/lodash/_baseMatchesProperty.d.ts +10 -0
  409. package/types/lodash/_baseMean.d.ts +11 -0
  410. package/types/lodash/_baseMerge.d.ts +13 -0
  411. package/types/lodash/_baseMergeDeep.d.ts +17 -0
  412. package/types/lodash/_baseNth.d.ts +10 -0
  413. package/types/lodash/_baseOrderBy.d.ts +11 -0
  414. package/types/lodash/_basePick.d.ts +11 -0
  415. package/types/lodash/_basePickBy.d.ts +11 -0
  416. package/types/lodash/_baseProperty.d.ts +9 -0
  417. package/types/lodash/_basePropertyDeep.d.ts +9 -0
  418. package/types/lodash/_basePropertyOf.d.ts +9 -0
  419. package/types/lodash/_basePullAll.d.ts +13 -0
  420. package/types/lodash/_basePullAt.d.ts +11 -0
  421. package/types/lodash/_baseRandom.d.ts +11 -0
  422. package/types/lodash/_baseRange.d.ts +13 -0
  423. package/types/lodash/_baseReduce.d.ts +15 -0
  424. package/types/lodash/_baseRepeat.d.ts +10 -0
  425. package/types/lodash/_baseRest.d.ts +10 -0
  426. package/types/lodash/_baseSample.d.ts +9 -0
  427. package/types/lodash/_baseSampleSize.d.ts +10 -0
  428. package/types/lodash/_baseSet.d.ts +12 -0
  429. package/types/lodash/_baseSetData.d.ts +2 -0
  430. package/types/lodash/_baseSetToString.d.ts +2 -0
  431. package/types/lodash/_baseShuffle.d.ts +9 -0
  432. package/types/lodash/_baseSlice.d.ts +11 -0
  433. package/types/lodash/_baseSome.d.ts +11 -0
  434. package/types/lodash/_baseSortBy.d.ts +12 -0
  435. package/types/lodash/_baseSortedIndex.d.ts +14 -0
  436. package/types/lodash/_baseSortedIndexBy.d.ts +15 -0
  437. package/types/lodash/_baseSortedUniq.d.ts +11 -0
  438. package/types/lodash/_baseSum.d.ts +11 -0
  439. package/types/lodash/_baseTimes.d.ts +11 -0
  440. package/types/lodash/_baseToNumber.d.ts +10 -0
  441. package/types/lodash/_baseToPairs.d.ts +11 -0
  442. package/types/lodash/_baseToString.d.ts +10 -0
  443. package/types/lodash/_baseTrim.d.ts +9 -0
  444. package/types/lodash/_baseUnary.d.ts +9 -0
  445. package/types/lodash/_baseUniq.d.ts +11 -0
  446. package/types/lodash/_baseUnset.d.ts +10 -0
  447. package/types/lodash/_baseUpdate.d.ts +12 -0
  448. package/types/lodash/_baseValues.d.ts +12 -0
  449. package/types/lodash/_baseWhile.d.ts +13 -0
  450. package/types/lodash/_baseWrapperValue.d.ts +12 -0
  451. package/types/lodash/_baseXor.d.ts +12 -0
  452. package/types/lodash/_baseZipObject.d.ts +11 -0
  453. package/types/lodash/_cacheHas.d.ts +10 -0
  454. package/types/lodash/_castArrayLikeObject.d.ts +9 -0
  455. package/types/lodash/_castFunction.d.ts +9 -0
  456. package/types/lodash/_castPath.d.ts +10 -0
  457. package/types/lodash/_castRest.d.ts +11 -0
  458. package/types/lodash/_castSlice.d.ts +11 -0
  459. package/types/lodash/_charsEndIndex.d.ts +11 -0
  460. package/types/lodash/_charsStartIndex.d.ts +11 -0
  461. package/types/lodash/_cloneArrayBuffer.d.ts +9 -0
  462. package/types/lodash/_cloneBuffer.d.ts +10 -0
  463. package/types/lodash/_cloneDataView.d.ts +10 -0
  464. package/types/lodash/_cloneMap.d.ts +11 -0
  465. package/types/lodash/_cloneRegExp.d.ts +9 -0
  466. package/types/lodash/_cloneSet.d.ts +11 -0
  467. package/types/lodash/_cloneSymbol.d.ts +9 -0
  468. package/types/lodash/_cloneTypedArray.d.ts +10 -0
  469. package/types/lodash/_compareAscending.d.ts +10 -0
  470. package/types/lodash/_compareMultiple.d.ts +16 -0
  471. package/types/lodash/_composeArgs.d.ts +13 -0
  472. package/types/lodash/_composeArgsRight.d.ts +13 -0
  473. package/types/lodash/_copyArray.d.ts +10 -0
  474. package/types/lodash/_copyObject.d.ts +12 -0
  475. package/types/lodash/_copySymbols.d.ts +10 -0
  476. package/types/lodash/_copySymbolsIn.d.ts +10 -0
  477. package/types/lodash/_coreJsData.d.ts +3 -0
  478. package/types/lodash/_countHolders.d.ts +10 -0
  479. package/types/lodash/_createAggregator.d.ts +10 -0
  480. package/types/lodash/_createAssigner.d.ts +9 -0
  481. package/types/lodash/_createBaseEach.d.ts +10 -0
  482. package/types/lodash/_createBaseFor.d.ts +9 -0
  483. package/types/lodash/_createBind.d.ts +12 -0
  484. package/types/lodash/_createCaseFirst.d.ts +9 -0
  485. package/types/lodash/_createCompounder.d.ts +9 -0
  486. package/types/lodash/_createCtor.d.ts +10 -0
  487. package/types/lodash/_createCurry.d.ts +11 -0
  488. package/types/lodash/_createFind.d.ts +9 -0
  489. package/types/lodash/_createFlow.d.ts +9 -0
  490. package/types/lodash/_createHybrid.d.ts +21 -0
  491. package/types/lodash/_createInverter.d.ts +10 -0
  492. package/types/lodash/_createMathOperation.d.ts +10 -0
  493. package/types/lodash/_createOver.d.ts +9 -0
  494. package/types/lodash/_createPadding.d.ts +11 -0
  495. package/types/lodash/_createPartial.d.ts +14 -0
  496. package/types/lodash/_createRange.d.ts +9 -0
  497. package/types/lodash/_createRecurry.d.ts +19 -0
  498. package/types/lodash/_createRelationalOperation.d.ts +9 -0
  499. package/types/lodash/_createRound.d.ts +9 -0
  500. package/types/lodash/_createSet.d.ts +2 -0
  501. package/types/lodash/_createToPairs.d.ts +9 -0
  502. package/types/lodash/_createWrap.d.ts +27 -0
  503. package/types/lodash/_customDefaultsAssignIn.d.ts +14 -0
  504. package/types/lodash/_customDefaultsMerge.d.ts +16 -0
  505. package/types/lodash/_customOmitClone.d.ts +11 -0
  506. package/types/lodash/_deburrLetter.d.ts +10 -0
  507. package/types/lodash/_defineProperty.d.ts +2 -0
  508. package/types/lodash/_equalArrays.d.ts +15 -0
  509. package/types/lodash/_equalByTag.d.ts +19 -0
  510. package/types/lodash/_equalObjects.d.ts +15 -0
  511. package/types/lodash/_escapeHtmlChar.d.ts +9 -0
  512. package/types/lodash/_escapeStringChar.d.ts +9 -0
  513. package/types/lodash/_flatRest.d.ts +9 -0
  514. package/types/lodash/_freeGlobal.d.ts +3 -0
  515. package/types/lodash/_getAllKeys.d.ts +9 -0
  516. package/types/lodash/_getAllKeysIn.d.ts +10 -0
  517. package/types/lodash/_getData.d.ts +2 -0
  518. package/types/lodash/_getFuncName.d.ts +9 -0
  519. package/types/lodash/_getHolder.d.ts +9 -0
  520. package/types/lodash/_getMapData.d.ts +10 -0
  521. package/types/lodash/_getMatchData.d.ts +9 -0
  522. package/types/lodash/_getNative.d.ts +10 -0
  523. package/types/lodash/_getPrototype.d.ts +3 -0
  524. package/types/lodash/_getRawTag.d.ts +9 -0
  525. package/types/lodash/_getSymbols.d.ts +2 -0
  526. package/types/lodash/_getSymbolsIn.d.ts +2 -0
  527. package/types/lodash/_getTag.d.ts +10 -0
  528. package/types/lodash/_getValue.d.ts +10 -0
  529. package/types/lodash/_getView.d.ts +12 -0
  530. package/types/lodash/_getWrapDetails.d.ts +9 -0
  531. package/types/lodash/_hasPath.d.ts +11 -0
  532. package/types/lodash/_hasUnicode.d.ts +9 -0
  533. package/types/lodash/_hasUnicodeWord.d.ts +9 -0
  534. package/types/lodash/_hashClear.d.ts +13 -0
  535. package/types/lodash/_hashDelete.d.ts +12 -0
  536. package/types/lodash/_hashGet.d.ts +11 -0
  537. package/types/lodash/_hashHas.d.ts +11 -0
  538. package/types/lodash/_hashSet.d.ts +12 -0
  539. package/types/lodash/_initCloneArray.d.ts +9 -0
  540. package/types/lodash/_initCloneByTag.d.ts +14 -0
  541. package/types/lodash/_initCloneObject.d.ts +9 -0
  542. package/types/lodash/_insertWrapDetails.d.ts +10 -0
  543. package/types/lodash/_isFlattenable.d.ts +9 -0
  544. package/types/lodash/_isIndex.d.ts +10 -0
  545. package/types/lodash/_isIterateeCall.d.ts +12 -0
  546. package/types/lodash/_isKey.d.ts +10 -0
  547. package/types/lodash/_isKeyable.d.ts +9 -0
  548. package/types/lodash/_isLaziable.d.ts +10 -0
  549. package/types/lodash/_isMaskable.d.ts +10 -0
  550. package/types/lodash/_isMasked.d.ts +9 -0
  551. package/types/lodash/_isPrototype.d.ts +9 -0
  552. package/types/lodash/_isStrictComparable.d.ts +10 -0
  553. package/types/lodash/_iteratorToArray.d.ts +9 -0
  554. package/types/lodash/_lazyClone.d.ts +10 -0
  555. package/types/lodash/_lazyReverse.d.ts +10 -0
  556. package/types/lodash/_lazyValue.d.ts +10 -0
  557. package/types/lodash/_listCacheClear.d.ts +13 -0
  558. package/types/lodash/_listCacheDelete.d.ts +11 -0
  559. package/types/lodash/_listCacheGet.d.ts +11 -0
  560. package/types/lodash/_listCacheHas.d.ts +11 -0
  561. package/types/lodash/_listCacheSet.d.ts +12 -0
  562. package/types/lodash/_mapCacheClear.d.ts +18 -0
  563. package/types/lodash/_mapCacheDelete.d.ts +11 -0
  564. package/types/lodash/_mapCacheGet.d.ts +11 -0
  565. package/types/lodash/_mapCacheHas.d.ts +11 -0
  566. package/types/lodash/_mapCacheSet.d.ts +12 -0
  567. package/types/lodash/_mapToArray.d.ts +9 -0
  568. package/types/lodash/_matchesStrictComparable.d.ts +11 -0
  569. package/types/lodash/_memoizeCapped.d.ts +10 -0
  570. package/types/lodash/_mergeData.d.ts +18 -0
  571. package/types/lodash/_metaMap.d.ts +3 -0
  572. package/types/lodash/_nativeCreate.d.ts +2 -0
  573. package/types/lodash/_nativeKeys.d.ts +2 -0
  574. package/types/lodash/_nativeKeysIn.d.ts +11 -0
  575. package/types/lodash/_nodeUtil.d.ts +3 -0
  576. package/types/lodash/_objectToString.d.ts +9 -0
  577. package/types/lodash/_overArg.d.ts +10 -0
  578. package/types/lodash/_overRest.d.ts +11 -0
  579. package/types/lodash/_parent.d.ts +10 -0
  580. package/types/lodash/_reEscape.d.ts +3 -0
  581. package/types/lodash/_reEvaluate.d.ts +3 -0
  582. package/types/lodash/_reInterpolate.d.ts +3 -0
  583. package/types/lodash/_realNames.d.ts +3 -0
  584. package/types/lodash/_reorder.d.ts +12 -0
  585. package/types/lodash/_replaceHolders.d.ts +11 -0
  586. package/types/lodash/_root.d.ts +3 -0
  587. package/types/lodash/_safeGet.d.ts +10 -0
  588. package/types/lodash/_setCacheAdd.d.ts +12 -0
  589. package/types/lodash/_setCacheHas.d.ts +11 -0
  590. package/types/lodash/_setData.d.ts +16 -0
  591. package/types/lodash/_setToArray.d.ts +9 -0
  592. package/types/lodash/_setToPairs.d.ts +9 -0
  593. package/types/lodash/_setToString.d.ts +10 -0
  594. package/types/lodash/_setWrapToString.d.ts +12 -0
  595. package/types/lodash/_shortOut.d.ts +11 -0
  596. package/types/lodash/_shuffleSelf.d.ts +10 -0
  597. package/types/lodash/_stackClear.d.ts +14 -0
  598. package/types/lodash/_stackDelete.d.ts +24 -0
  599. package/types/lodash/_stackGet.d.ts +11 -0
  600. package/types/lodash/_stackHas.d.ts +11 -0
  601. package/types/lodash/_stackSet.d.ts +28 -0
  602. package/types/lodash/_strictIndexOf.d.ts +12 -0
  603. package/types/lodash/_strictLastIndexOf.d.ts +12 -0
  604. package/types/lodash/_stringSize.d.ts +9 -0
  605. package/types/lodash/_stringToArray.d.ts +9 -0
  606. package/types/lodash/_stringToPath.d.ts +9 -0
  607. package/types/lodash/_toKey.d.ts +9 -0
  608. package/types/lodash/_toSource.d.ts +9 -0
  609. package/types/lodash/_trimmedEndIndex.d.ts +10 -0
  610. package/types/lodash/_unescapeHtmlChar.d.ts +9 -0
  611. package/types/lodash/_unicodeSize.d.ts +9 -0
  612. package/types/lodash/_unicodeToArray.d.ts +9 -0
  613. package/types/lodash/_unicodeWords.d.ts +9 -0
  614. package/types/lodash/_updateWrapDetails.d.ts +10 -0
  615. package/types/lodash/_wrapperClone.d.ts +9 -0
  616. package/types/lodash/add.d.ts +17 -0
  617. package/types/lodash/after.d.ts +26 -0
  618. package/types/lodash/array.d.ts +66 -0
  619. package/types/lodash/array.default.d.ts +133 -0
  620. package/types/lodash/ary.d.ts +19 -0
  621. package/types/lodash/assign.d.ts +34 -0
  622. package/types/lodash/assignIn.d.ts +33 -0
  623. package/types/lodash/assignInWith.d.ts +31 -0
  624. package/types/lodash/assignWith.d.ts +30 -0
  625. package/types/lodash/at.d.ts +19 -0
  626. package/types/lodash/attempt.d.ts +24 -0
  627. package/types/lodash/before.d.ts +19 -0
  628. package/types/lodash/bind.d.ts +37 -0
  629. package/types/lodash/bindAll.d.ts +28 -0
  630. package/types/lodash/bindKey.d.ts +47 -0
  631. package/types/lodash/camelCase.d.ts +22 -0
  632. package/types/lodash/capitalize.d.ts +17 -0
  633. package/types/lodash/castArray.d.ts +35 -0
  634. package/types/lodash/ceil.d.ts +23 -0
  635. package/types/lodash/chain.d.ts +31 -0
  636. package/types/lodash/chunk.d.ts +23 -0
  637. package/types/lodash/clamp.d.ts +21 -0
  638. package/types/lodash/clone.d.ts +28 -0
  639. package/types/lodash/cloneDeep.d.ts +20 -0
  640. package/types/lodash/cloneDeepWith.d.ts +30 -0
  641. package/types/lodash/cloneWith.d.ts +33 -0
  642. package/types/lodash/collection.d.ts +29 -0
  643. package/types/lodash/collection.default.d.ts +59 -0
  644. package/types/lodash/commit.d.ts +28 -0
  645. package/types/lodash/compact.d.ts +17 -0
  646. package/types/lodash/concat.d.ts +24 -0
  647. package/types/lodash/cond.d.ts +31 -0
  648. package/types/lodash/conforms.d.ts +26 -0
  649. package/types/lodash/conformsTo.d.ts +26 -0
  650. package/types/lodash/constant.d.ts +21 -0
  651. package/types/lodash/countBy.d.ts +24 -0
  652. package/types/lodash/create.d.ts +36 -0
  653. package/types/lodash/curry.d.ts +46 -0
  654. package/types/lodash/curryRight.d.ts +43 -0
  655. package/types/lodash/date.d.ts +2 -0
  656. package/types/lodash/date.default.d.ts +5 -0
  657. package/types/lodash/debounce.d.ts +60 -0
  658. package/types/lodash/deburr.d.ts +20 -0
  659. package/types/lodash/defaultTo.d.ts +22 -0
  660. package/types/lodash/defaults.d.ts +23 -0
  661. package/types/lodash/defaultsDeep.d.ts +21 -0
  662. package/types/lodash/defer.d.ts +20 -0
  663. package/types/lodash/delay.d.ts +21 -0
  664. package/types/lodash/difference.d.ts +23 -0
  665. package/types/lodash/differenceBy.d.ts +28 -0
  666. package/types/lodash/differenceWith.d.ts +25 -0
  667. package/types/lodash/divide.d.ts +17 -0
  668. package/types/lodash/drop.d.ts +27 -0
  669. package/types/lodash/dropRight.d.ts +27 -0
  670. package/types/lodash/dropRightWhile.d.ts +37 -0
  671. package/types/lodash/dropWhile.d.ts +37 -0
  672. package/types/lodash/each.d.ts +1 -0
  673. package/types/lodash/eachRight.d.ts +1 -0
  674. package/types/lodash/endsWith.d.ts +25 -0
  675. package/types/lodash/entries.d.ts +1 -0
  676. package/types/lodash/entriesIn.d.ts +1 -0
  677. package/types/lodash/eq.d.ts +34 -0
  678. package/types/lodash/escape.d.ts +30 -0
  679. package/types/lodash/escapeRegExp.d.ts +17 -0
  680. package/types/lodash/every.d.ts +43 -0
  681. package/types/lodash/extend.d.ts +1 -0
  682. package/types/lodash/extendWith.d.ts +1 -0
  683. package/types/lodash/fill.d.ts +31 -0
  684. package/types/lodash/filter.d.ts +43 -0
  685. package/types/lodash/find.d.ts +38 -0
  686. package/types/lodash/findIndex.d.ts +37 -0
  687. package/types/lodash/findKey.d.ts +37 -0
  688. package/types/lodash/findLast.d.ts +21 -0
  689. package/types/lodash/findLastIndex.d.ts +37 -0
  690. package/types/lodash/findLastKey.d.ts +37 -0
  691. package/types/lodash/first.d.ts +1 -0
  692. package/types/lodash/flatMap.d.ts +23 -0
  693. package/types/lodash/flatMapDeep.d.ts +22 -0
  694. package/types/lodash/flatMapDepth.d.ts +23 -0
  695. package/types/lodash/flatten.d.ts +16 -0
  696. package/types/lodash/flattenDeep.d.ts +16 -0
  697. package/types/lodash/flattenDepth.d.ts +22 -0
  698. package/types/lodash/flip.d.ts +20 -0
  699. package/types/lodash/floor.d.ts +23 -0
  700. package/types/lodash/flow.d.ts +24 -0
  701. package/types/lodash/flowRight.d.ts +23 -0
  702. package/types/lodash/forEach.d.ts +32 -0
  703. package/types/lodash/forEachRight.d.ts +22 -0
  704. package/types/lodash/forIn.d.ts +30 -0
  705. package/types/lodash/forInRight.d.ts +28 -0
  706. package/types/lodash/forOwn.d.ts +30 -0
  707. package/types/lodash/forOwnRight.d.ts +28 -0
  708. package/types/lodash/fromPairs.d.ts +17 -0
  709. package/types/lodash/function.d.ts +24 -0
  710. package/types/lodash/function.default.d.ts +49 -0
  711. package/types/lodash/functions.d.ts +25 -0
  712. package/types/lodash/functionsIn.d.ts +25 -0
  713. package/types/lodash/get.d.ts +27 -0
  714. package/types/lodash/groupBy.d.ts +25 -0
  715. package/types/lodash/gt.d.ts +25 -0
  716. package/types/lodash/gte.d.ts +25 -0
  717. package/types/lodash/has.d.ts +29 -0
  718. package/types/lodash/hasIn.d.ts +28 -0
  719. package/types/lodash/head.d.ts +20 -0
  720. package/types/lodash/identity.d.ts +18 -0
  721. package/types/lodash/inRange.d.ts +40 -0
  722. package/types/lodash/includes.d.ts +32 -0
  723. package/types/lodash/index.d.ts +3 -0
  724. package/types/lodash/indexOf.d.ts +25 -0
  725. package/types/lodash/initial.d.ts +16 -0
  726. package/types/lodash/intersection.d.ts +19 -0
  727. package/types/lodash/intersectionBy.d.ts +25 -0
  728. package/types/lodash/intersectionWith.d.ts +23 -0
  729. package/types/lodash/invert.d.ts +20 -0
  730. package/types/lodash/invertBy.d.ts +28 -0
  731. package/types/lodash/invoke.d.ts +20 -0
  732. package/types/lodash/invokeMap.d.ts +25 -0
  733. package/types/lodash/isArguments.d.ts +2 -0
  734. package/types/lodash/isArray.d.ts +25 -0
  735. package/types/lodash/isArrayBuffer.d.ts +19 -0
  736. package/types/lodash/isArrayLike.d.ts +27 -0
  737. package/types/lodash/isArrayLikeObject.d.ts +27 -0
  738. package/types/lodash/isBoolean.d.ts +19 -0
  739. package/types/lodash/isBuffer.d.ts +19 -0
  740. package/types/lodash/isDate.d.ts +19 -0
  741. package/types/lodash/isElement.d.ts +19 -0
  742. package/types/lodash/isEmpty.d.ts +35 -0
  743. package/types/lodash/isEqual.d.ts +30 -0
  744. package/types/lodash/isEqualWith.d.ts +34 -0
  745. package/types/lodash/isError.d.ts +20 -0
  746. package/types/lodash/isFinite.d.ts +28 -0
  747. package/types/lodash/isFunction.d.ts +19 -0
  748. package/types/lodash/isInteger.d.ts +28 -0
  749. package/types/lodash/isLength.d.ts +28 -0
  750. package/types/lodash/isMap.d.ts +19 -0
  751. package/types/lodash/isMatch.d.ts +30 -0
  752. package/types/lodash/isMatchWith.d.ts +34 -0
  753. package/types/lodash/isNaN.d.ts +30 -0
  754. package/types/lodash/isNative.d.ts +28 -0
  755. package/types/lodash/isNil.d.ts +22 -0
  756. package/types/lodash/isNull.d.ts +19 -0
  757. package/types/lodash/isNumber.d.ts +28 -0
  758. package/types/lodash/isObject.d.ts +27 -0
  759. package/types/lodash/isObjectLike.d.ts +26 -0
  760. package/types/lodash/isPlainObject.d.ts +30 -0
  761. package/types/lodash/isPromise.d.ts +2 -0
  762. package/types/lodash/isRegExp.d.ts +19 -0
  763. package/types/lodash/isSafeInteger.d.ts +29 -0
  764. package/types/lodash/isSet.d.ts +19 -0
  765. package/types/lodash/isString.d.ts +19 -0
  766. package/types/lodash/isSymbol.d.ts +19 -0
  767. package/types/lodash/isTypedArray.d.ts +19 -0
  768. package/types/lodash/isUndefined.d.ts +19 -0
  769. package/types/lodash/isWeakMap.d.ts +19 -0
  770. package/types/lodash/isWeakSet.d.ts +19 -0
  771. package/types/lodash/iteratee.d.ts +44 -0
  772. package/types/lodash/join.d.ts +17 -0
  773. package/types/lodash/kebabCase.d.ts +23 -0
  774. package/types/lodash/keyBy.d.ts +30 -0
  775. package/types/lodash/keys.d.ts +30 -0
  776. package/types/lodash/keysIn.d.ts +25 -0
  777. package/types/lodash/lang.d.ts +57 -0
  778. package/types/lodash/lang.default.d.ts +115 -0
  779. package/types/lodash/last.d.ts +16 -0
  780. package/types/lodash/lastIndexOf.d.ts +23 -0
  781. package/types/lodash/lodash.d.ts +317 -0
  782. package/types/lodash/lodash.default.d.ts +2 -0
  783. package/types/lodash/lowerCase.d.ts +22 -0
  784. package/types/lodash/lowerFirst.d.ts +19 -0
  785. package/types/lodash/lt.d.ts +25 -0
  786. package/types/lodash/lte.d.ts +25 -0
  787. package/types/lodash/map.d.ts +44 -0
  788. package/types/lodash/mapKeys.d.ts +23 -0
  789. package/types/lodash/mapValues.d.ts +30 -0
  790. package/types/lodash/matches.d.ts +37 -0
  791. package/types/lodash/matchesProperty.d.ts +35 -0
  792. package/types/lodash/math.d.ts +16 -0
  793. package/types/lodash/math.default.d.ts +33 -0
  794. package/types/lodash/max.d.ts +20 -0
  795. package/types/lodash/maxBy.d.ts +25 -0
  796. package/types/lodash/mean.d.ts +16 -0
  797. package/types/lodash/meanBy.d.ts +25 -0
  798. package/types/lodash/memoize.d.ts +50 -0
  799. package/types/lodash/merge.d.ts +33 -0
  800. package/types/lodash/mergeWith.d.ts +33 -0
  801. package/types/lodash/method.d.ts +26 -0
  802. package/types/lodash/methodOf.d.ts +25 -0
  803. package/types/lodash/min.d.ts +20 -0
  804. package/types/lodash/minBy.d.ts +25 -0
  805. package/types/lodash/mixin.d.ts +40 -0
  806. package/types/lodash/multiply.d.ts +17 -0
  807. package/types/lodash/negate.d.ts +22 -0
  808. package/types/lodash/next.d.ts +27 -0
  809. package/types/lodash/noop.d.ts +14 -0
  810. package/types/lodash/now.d.ts +18 -0
  811. package/types/lodash/nth.d.ts +23 -0
  812. package/types/lodash/nthArg.d.ts +22 -0
  813. package/types/lodash/number.d.ts +4 -0
  814. package/types/lodash/number.default.d.ts +9 -0
  815. package/types/lodash/object.d.ts +48 -0
  816. package/types/lodash/object.default.d.ts +97 -0
  817. package/types/lodash/omit.d.ts +22 -0
  818. package/types/lodash/omitBy.d.ts +22 -0
  819. package/types/lodash/once.d.ts +20 -0
  820. package/types/lodash/orderBy.d.ts +31 -0
  821. package/types/lodash/over.d.ts +20 -0
  822. package/types/lodash/overArgs.d.ts +33 -0
  823. package/types/lodash/overEvery.d.ts +30 -0
  824. package/types/lodash/overSome.d.ts +33 -0
  825. package/types/lodash/pad.d.ts +25 -0
  826. package/types/lodash/padEnd.d.ts +25 -0
  827. package/types/lodash/padStart.d.ts +25 -0
  828. package/types/lodash/parseInt.d.ts +26 -0
  829. package/types/lodash/partial.d.ts +35 -0
  830. package/types/lodash/partialRight.d.ts +34 -0
  831. package/types/lodash/partition.d.ts +38 -0
  832. package/types/lodash/pick.d.ts +19 -0
  833. package/types/lodash/pickBy.d.ts +20 -0
  834. package/types/lodash/plant.d.ts +26 -0
  835. package/types/lodash/property.d.ts +24 -0
  836. package/types/lodash/propertyOf.d.ts +23 -0
  837. package/types/lodash/pull.d.ts +25 -0
  838. package/types/lodash/pullAll.d.ts +22 -0
  839. package/types/lodash/pullAllBy.d.ts +25 -0
  840. package/types/lodash/pullAllWith.d.ts +25 -0
  841. package/types/lodash/pullAt.d.ts +26 -0
  842. package/types/lodash/random.d.ts +33 -0
  843. package/types/lodash/range.d.ts +43 -0
  844. package/types/lodash/rangeRight.d.ts +38 -0
  845. package/types/lodash/rearg.d.ts +24 -0
  846. package/types/lodash/reduce.d.ts +39 -0
  847. package/types/lodash/reduceRight.d.ts +24 -0
  848. package/types/lodash/reject.d.ts +36 -0
  849. package/types/lodash/remove.d.ts +30 -0
  850. package/types/lodash/repeat.d.ts +24 -0
  851. package/types/lodash/replace.d.ts +21 -0
  852. package/types/lodash/rest.d.ts +27 -0
  853. package/types/lodash/result.d.ts +31 -0
  854. package/types/lodash/reverse.d.ts +25 -0
  855. package/types/lodash/round.d.ts +23 -0
  856. package/types/lodash/sample.d.ts +16 -0
  857. package/types/lodash/sampleSize.d.ts +22 -0
  858. package/types/lodash/seq.d.ts +15 -0
  859. package/types/lodash/seq.default.d.ts +31 -0
  860. package/types/lodash/set.d.ts +30 -0
  861. package/types/lodash/setWith.d.ts +26 -0
  862. package/types/lodash/shuffle.d.ts +17 -0
  863. package/types/lodash/size.d.ts +23 -0
  864. package/types/lodash/slice.d.ts +18 -0
  865. package/types/lodash/snakeCase.d.ts +23 -0
  866. package/types/lodash/some.d.ts +38 -0
  867. package/types/lodash/sortBy.d.ts +31 -0
  868. package/types/lodash/sortedIndex.d.ts +19 -0
  869. package/types/lodash/sortedIndexBy.d.ts +27 -0
  870. package/types/lodash/sortedIndexOf.d.ts +18 -0
  871. package/types/lodash/sortedLastIndex.d.ts +20 -0
  872. package/types/lodash/sortedLastIndexBy.d.ts +27 -0
  873. package/types/lodash/sortedLastIndexOf.d.ts +18 -0
  874. package/types/lodash/sortedUniq.d.ts +17 -0
  875. package/types/lodash/sortedUniqBy.d.ts +18 -0
  876. package/types/lodash/split.d.ts +21 -0
  877. package/types/lodash/spread.d.ts +36 -0
  878. package/types/lodash/startCase.d.ts +23 -0
  879. package/types/lodash/startsWith.d.ts +25 -0
  880. package/types/lodash/string.d.ts +32 -0
  881. package/types/lodash/string.default.d.ts +65 -0
  882. package/types/lodash/stubArray.d.ts +20 -0
  883. package/types/lodash/stubFalse.d.ts +15 -0
  884. package/types/lodash/stubObject.d.ts +20 -0
  885. package/types/lodash/stubString.d.ts +15 -0
  886. package/types/lodash/stubTrue.d.ts +15 -0
  887. package/types/lodash/subtract.d.ts +17 -0
  888. package/types/lodash/sum.d.ts +16 -0
  889. package/types/lodash/sumBy.d.ts +25 -0
  890. package/types/lodash/tail.d.ts +16 -0
  891. package/types/lodash/take.d.ts +27 -0
  892. package/types/lodash/takeRight.d.ts +27 -0
  893. package/types/lodash/takeRightWhile.d.ts +37 -0
  894. package/types/lodash/takeWhile.d.ts +37 -0
  895. package/types/lodash/tap.d.ts +25 -0
  896. package/types/lodash/template.d.ts +113 -0
  897. package/types/lodash/templateSettings.d.ts +11 -0
  898. package/types/lodash/throttle.d.ts +49 -0
  899. package/types/lodash/thru.d.ts +25 -0
  900. package/types/lodash/times.d.ts +21 -0
  901. package/types/lodash/toArray.d.ts +25 -0
  902. package/types/lodash/toFinite.d.ts +25 -0
  903. package/types/lodash/toInteger.d.ts +28 -0
  904. package/types/lodash/toIterator.d.ts +20 -0
  905. package/types/lodash/toJSON.d.ts +1 -0
  906. package/types/lodash/toLength.d.ts +29 -0
  907. package/types/lodash/toLower.d.ts +23 -0
  908. package/types/lodash/toNumber.d.ts +25 -0
  909. package/types/lodash/toPairs.d.ts +26 -0
  910. package/types/lodash/toPairsIn.d.ts +26 -0
  911. package/types/lodash/toPath.d.ts +19 -0
  912. package/types/lodash/toPlainObject.d.ts +26 -0
  913. package/types/lodash/toSafeInteger.d.ts +26 -0
  914. package/types/lodash/toString.d.ts +23 -0
  915. package/types/lodash/toUpper.d.ts +23 -0
  916. package/types/lodash/transform.d.ts +32 -0
  917. package/types/lodash/trim.d.ts +24 -0
  918. package/types/lodash/trimEnd.d.ts +21 -0
  919. package/types/lodash/trimStart.d.ts +21 -0
  920. package/types/lodash/truncate.d.ts +43 -0
  921. package/types/lodash/unary.d.ts +17 -0
  922. package/types/lodash/unescape.d.ts +21 -0
  923. package/types/lodash/union.d.ts +18 -0
  924. package/types/lodash/unionBy.d.ts +25 -0
  925. package/types/lodash/unionWith.d.ts +23 -0
  926. package/types/lodash/uniq.d.ts +20 -0
  927. package/types/lodash/uniqBy.d.ts +25 -0
  928. package/types/lodash/uniqWith.d.ts +22 -0
  929. package/types/lodash/uniqueId.d.ts +19 -0
  930. package/types/lodash/unset.d.ts +29 -0
  931. package/types/lodash/unzip.d.ts +21 -0
  932. package/types/lodash/unzipWith.d.ts +23 -0
  933. package/types/lodash/update.d.ts +29 -0
  934. package/types/lodash/updateWith.d.ts +26 -0
  935. package/types/lodash/upperCase.d.ts +22 -0
  936. package/types/lodash/upperFirst.d.ts +19 -0
  937. package/types/lodash/util.d.ts +33 -0
  938. package/types/lodash/util.default.d.ts +67 -0
  939. package/types/lodash/value.d.ts +1 -0
  940. package/types/lodash/valueOf.d.ts +1 -0
  941. package/types/lodash/values.d.ts +28 -0
  942. package/types/lodash/valuesIn.d.ts +26 -0
  943. package/types/lodash/without.d.ts +22 -0
  944. package/types/lodash/words.d.ts +21 -0
  945. package/types/lodash/wrap.d.ts +24 -0
  946. package/types/lodash/wrapperAt.d.ts +18 -0
  947. package/types/lodash/wrapperChain.d.ts +29 -0
  948. package/types/lodash/wrapperLodash.d.ts +239 -0
  949. package/types/lodash/wrapperReverse.d.ts +22 -0
  950. package/types/lodash/wrapperValue.d.ts +16 -0
  951. package/types/lodash/xor.d.ts +20 -0
  952. package/types/lodash/xorBy.d.ts +25 -0
  953. package/types/lodash/xorWith.d.ts +23 -0
  954. package/types/lodash/zip.d.ts +18 -0
  955. package/types/lodash/zipObject.d.ts +18 -0
  956. package/types/lodash/zipObjectDeep.d.ts +17 -0
  957. package/types/lodash/zipWith.d.ts +22 -0
  958. package/types/normalize-wheel/index.d.ts +1 -1
  959. package/types/random/index.d.ts +4 -4
  960. package/types/screenfull/index.d.ts +1 -7
  961. package/types/sleep/index.d.ts +2 -0
  962. package/types/snapdom/src/api/preCache.d.ts +26 -3
  963. package/types/snapdom/src/api/snapdom.d.ts +89 -20
  964. package/types/snapdom/src/core/cache.d.ts +27 -12
  965. package/types/snapdom/src/core/capture.d.ts +4 -2
  966. package/types/snapdom/src/core/clone.d.ts +1 -10
  967. package/types/snapdom/src/core/context.d.ts +67 -0
  968. package/types/snapdom/src/core/exporters.d.ts +33 -0
  969. package/types/snapdom/src/core/plugins.d.ts +59 -0
  970. package/types/snapdom/src/core/prepare.d.ts +1 -2
  971. package/types/snapdom/src/exporters/download.d.ts +16 -0
  972. package/types/snapdom/src/exporters/toBlob.d.ts +14 -0
  973. package/types/snapdom/src/exporters/toCanvas.d.ts +14 -0
  974. package/types/snapdom/src/exporters/toImg.d.ts +11 -0
  975. package/types/snapdom/src/modules/CSSVar.d.ts +5 -0
  976. package/types/snapdom/src/modules/background.d.ts +6 -1
  977. package/types/snapdom/src/modules/changeCSS.d.ts +14 -0
  978. package/types/snapdom/src/modules/counter.d.ts +72 -0
  979. package/types/snapdom/src/modules/fonts.d.ts +67 -11
  980. package/types/snapdom/src/modules/iconFonts.d.ts +34 -0
  981. package/types/snapdom/src/modules/images.d.ts +10 -4
  982. package/types/snapdom/src/modules/lineClamp.d.ts +13 -0
  983. package/types/snapdom/src/modules/pseudo.d.ts +4 -4
  984. package/types/snapdom/src/modules/rasterize.d.ts +16 -0
  985. package/types/snapdom/src/modules/snapFetch.d.ts +93 -0
  986. package/types/snapdom/src/modules/styles.d.ts +2 -1
  987. package/types/snapdom/src/modules/svgDefs.d.ts +9 -15
  988. package/types/snapdom/src/utils/browser.d.ts +12 -0
  989. package/types/snapdom/src/utils/css.d.ts +68 -0
  990. package/types/snapdom/src/utils/helpers.d.ts +0 -61
  991. package/types/snapdom/src/utils/image.d.ts +21 -0
  992. package/types/snapdom/src/utils/index.d.ts +4 -0
  993. package/types/tinycolor/src/public_api.d.ts +1 -1
  994. package/types/tree/index.d.ts +6 -6
  995. package/types/tween/index.d.ts +1 -0
  996. package/types/tween/src/easing.d.ts +22 -0
  997. package/types/tween/src/index.d.ts +3 -0
  998. package/types/tween/src/tween.d.ts +22 -0
  999. package/types/validate/index.d.ts +3 -0
  1000. package/types/validate/src/index.d.ts +39 -0
  1001. package/types/validate/src/interface.d.ts +53 -0
  1002. package/types/validate/src/locale/en-US.d.ts +47 -0
  1003. package/types/validate/src/locale/zh-CN.d.ts +47 -0
  1004. package/types/validate/src/message.d.ts +2 -0
  1005. package/types/validate/src/rules/array.d.ts +12 -0
  1006. package/types/validate/src/rules/base.d.ts +25 -0
  1007. package/types/validate/src/rules/boolean.d.ts +8 -0
  1008. package/types/validate/src/rules/custom.d.ts +7 -0
  1009. package/types/validate/src/rules/number.d.ts +12 -0
  1010. package/types/validate/src/rules/object.d.ts +9 -0
  1011. package/types/validate/src/rules/string.d.ts +12 -0
  1012. package/types/validate/src/rules/type.d.ts +9 -0
  1013. package/types/validate/src/utils.d.ts +3 -0
  1014. package/ui-color/compareColorByRange.js +1 -0
  1015. package/ui-color/index.js +1 -0
  1016. package/uiColor.js +1 -0
  1017. package/url-toolkit/index.js +1 -0
  1018. package/url-toolkit/src/url-toolkit.js +1 -0
  1019. package/urlToolkit.js +1 -0
  1020. package/validate/index.js +28 -0
  1021. package/validate/src/index.js +106 -0
  1022. package/validate/src/locale/en-US.js +50 -0
  1023. package/validate/src/locale/zh-CN.js +50 -0
  1024. package/validate/src/message.js +5 -0
  1025. package/validate/src/rules/array.js +73 -0
  1026. package/validate/src/rules/base.js +69 -0
  1027. package/validate/src/rules/boolean.js +29 -0
  1028. package/validate/src/rules/custom.js +26 -0
  1029. package/validate/src/rules/number.js +54 -0
  1030. package/validate/src/rules/object.js +39 -0
  1031. package/validate/src/rules/string.js +54 -0
  1032. package/validate/src/rules/type.js +35 -0
  1033. package/validate/src/utils.js +8 -0
  1034. package/validate.js +28 -0
  1035. package/version/index.js +1 -0
  1036. package/version.js +1 -0
  1037. package/filesize/index.js +0 -8
  1038. package/filesize/src/constants.js +0 -71
  1039. package/filesize/src/filesize.js +0 -87
  1040. package/filesize.js +0 -8
  1041. package/snapdom/src/utils/cssTools.js +0 -118
  1042. package/turbo-stream/index.js +0 -6
  1043. package/turbo-stream/src/decode.js +0 -284
  1044. package/turbo-stream/src/encode.js +0 -357
  1045. package/turbo-stream/src/shared.js +0 -267
  1046. package/turboStream.js +0 -6
  1047. package/types/filesize/index.d.ts +0 -2
  1048. package/types/snapdom/src/utils/cssTools.d.ts +0 -29
  1049. package/types/turbo-stream/index.d.ts +0 -1
  1050. package/types/turbo-stream/src/decode.d.ts +0 -7
  1051. package/types/turbo-stream/src/encode.d.ts +0 -27
  1052. package/types/turbo-stream/src/shared.d.ts +0 -107
  1053. package/types/turbo-stream/src/turbo-stream.d.ts +0 -4
  1054. /package/types/tinycolor/src/{util.d.ts → utils.d.ts} +0 -0
@@ -1,211 +1,672 @@
1
- import { cache as o } from "../core/cache.js";
2
- import { isIconFont as $ } from "./iconFonts.js";
3
- import { fetchResource as A, extractURL as v } from "../utils/helpers.js";
4
- async function H(h, d, c, y = 32, C = "#000") {
5
- d = d.replace(/^['"]+|['"]+$/g, "");
6
- const p = window.devicePixelRatio || 1;
7
- await document.fonts.ready;
8
- const i = document.createElement("span");
9
- i.textContent = h, i.style.position = "absolute", i.style.visibility = "hidden", i.style.fontFamily = `"${d}"`, i.style.fontWeight = c || "normal", i.style.fontSize = `${y}px`, i.style.lineHeight = "1", i.style.whiteSpace = "nowrap", i.style.padding = "0", i.style.margin = "0", document.body.appendChild(i);
10
- const m = i.getBoundingClientRect(), t = Math.ceil(m.width), n = Math.ceil(m.height);
11
- document.body.removeChild(i);
12
- const e = document.createElement("canvas");
13
- e.width = t * p, e.height = n * p;
14
- const a = e.getContext("2d");
15
- return a.scale(p, p), a.font = c ? `${c} ${y}px "${d}"` : `${y}px "${d}"`, a.textAlign = "left", a.textBaseline = "top", a.fillStyle = C, a.fillText(h, 0, 0), {
16
- dataUrl: e.toDataURL(),
17
- width: t,
18
- height: n
1
+ /* 2025-11-03 10:27:31 */
2
+ import { cache as g } from "../core/cache.js";
3
+ import { isIconFont as x } from "./iconFonts.js";
4
+ import { extractURL as X } from "../utils/helpers.js";
5
+ import { snapFetch as A } from "./snapFetch.js";
6
+ async function lt(o, e, r, a = 32, n = "#000") {
7
+ e = e.replace(/^['"]+|['"]+$/g, "");
8
+ const c = window.devicePixelRatio || 1;
9
+ try {
10
+ await document.fonts.ready;
11
+ } catch {
12
+ }
13
+ const t = document.createElement("span");
14
+ t.textContent = o, t.style.position = "absolute", t.style.visibility = "hidden", t.style.fontFamily = `"${e}"`, t.style.fontWeight = r || "normal", t.style.fontSize = `${a}px`, t.style.lineHeight = "1", t.style.whiteSpace = "nowrap", t.style.padding = "0", t.style.margin = "0", document.body.appendChild(t);
15
+ const f = t.getBoundingClientRect(), s = Math.ceil(f.width), u = Math.ceil(f.height);
16
+ document.body.removeChild(t);
17
+ const m = document.createElement("canvas");
18
+ m.width = Math.max(1, s * c), m.height = Math.max(1, u * c);
19
+ const d = m.getContext("2d");
20
+ return d.scale(c, c), d.font = r ? `${r} ${a}px "${e}"` : `${a}px "${e}"`, d.textAlign = "left", d.textBaseline = "top", d.fillStyle = n, d.fillText(o, 0, 0), {
21
+ dataUrl: m.toDataURL(),
22
+ width: s,
23
+ height: u
19
24
  };
20
25
  }
21
- function T(h) {
22
- return Array.from(document.styleSheets).some((d) => d.href === h);
26
+ const G = /* @__PURE__ */ new Set([
27
+ "serif",
28
+ "sans-serif",
29
+ "monospace",
30
+ "cursive",
31
+ "fantasy",
32
+ "system-ui",
33
+ "emoji",
34
+ "math",
35
+ "fangsong",
36
+ "ui-serif",
37
+ "ui-sans-serif",
38
+ "ui-monospace",
39
+ "ui-rounded"
40
+ ]);
41
+ function T(o) {
42
+ if (!o) return "";
43
+ for (let e of o.split(",")) {
44
+ let r = e.trim().replace(/^['"]+|['"]+$/g, "");
45
+ if (r && !G.has(r.toLowerCase()))
46
+ return r;
47
+ }
48
+ return "";
49
+ }
50
+ function N(o) {
51
+ const e = String(o ?? "400").trim().toLowerCase();
52
+ if (e === "normal") return 400;
53
+ if (e === "bold") return 700;
54
+ const r = parseInt(e, 10);
55
+ return Number.isFinite(r) ? Math.min(900, Math.max(100, r)) : 400;
56
+ }
57
+ function W(o) {
58
+ const e = String(o ?? "normal").trim().toLowerCase();
59
+ return e.startsWith("italic") ? "italic" : e.startsWith("oblique") ? "oblique" : "normal";
60
+ }
61
+ function Y(o) {
62
+ const e = String(o ?? "100%").match(/(\d+(?:\.\d+)?)\s*%/);
63
+ return e ? Math.max(50, Math.min(200, parseFloat(e[1]))) : 100;
64
+ }
65
+ function J(o) {
66
+ const e = String(o || "400").trim(), r = e.match(/^(\d{2,3})\s+(\d{2,3})$/);
67
+ if (r) {
68
+ const n = N(r[1]), c = N(r[2]);
69
+ return { min: Math.min(n, c), max: Math.max(n, c) };
70
+ }
71
+ const a = N(e);
72
+ return { min: a, max: a };
73
+ }
74
+ function K(o) {
75
+ const e = String(o || "normal").trim().toLowerCase();
76
+ return e === "italic" ? { kind: "italic" } : e.startsWith("oblique") ? { kind: "oblique" } : { kind: "normal" };
77
+ }
78
+ function Q(o) {
79
+ const e = String(o || "100%").trim(), r = e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);
80
+ if (r) {
81
+ const c = parseFloat(r[1]), t = parseFloat(r[2]);
82
+ return { min: Math.min(c, t), max: Math.max(c, t) };
83
+ }
84
+ const a = e.match(/(\d+(?:\.\d+)?)\s*%/), n = a ? parseFloat(a[1]) : 100;
85
+ return { min: n, max: n };
86
+ }
87
+ function Z(o, e) {
88
+ if (!o) return !1;
89
+ try {
90
+ const r = new URL(o, location.href);
91
+ if (r.origin === location.origin) return !0;
92
+ const n = r.host.toLowerCase();
93
+ if ([
94
+ "fonts.googleapis.com",
95
+ "fonts.gstatic.com",
96
+ "use.typekit.net",
97
+ "p.typekit.net",
98
+ "kit.fontawesome.com",
99
+ "use.fontawesome.com"
100
+ ].some((f) => n.endsWith(f))) return !0;
101
+ const t = (r.pathname + r.search).toLowerCase();
102
+ if (/\bfont(s)?\b/.test(t) || /\.woff2?(\b|$)/.test(t)) return !0;
103
+ for (const f of e) {
104
+ const s = f.toLowerCase().replace(/\s+/g, "+"), u = f.toLowerCase().replace(/\s+/g, "-");
105
+ if (t.includes(s) || t.includes(u)) return !0;
106
+ }
107
+ return !1;
108
+ } catch {
109
+ return !1;
110
+ }
111
+ }
112
+ function tt(o) {
113
+ const e = /* @__PURE__ */ new Set();
114
+ for (const r of o || []) {
115
+ const a = String(r).split("__")[0]?.trim();
116
+ a && e.add(a);
117
+ }
118
+ return e;
23
119
  }
24
- function I(h) {
25
- return new Promise((d) => {
26
- if (T(h)) return d(null);
27
- const c = document.createElement("link");
28
- c.rel = "stylesheet", c.href = h, c.setAttribute("data-snapdom", "injected-import"), c.onload = () => d(c), c.onerror = () => d(null), document.head.appendChild(c);
120
+ function q(o, e) {
121
+ return o && o.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g, (r, a, n) => {
122
+ const c = (n || "").trim();
123
+ if (!c || /^data:|^blob:|^https?:|^file:|^about:/i.test(c)) return r;
124
+ let t = c;
125
+ try {
126
+ t = new URL(c, e || location.href).href;
127
+ } catch {
128
+ }
129
+ return `url("${t}")`;
29
130
  });
30
131
  }
31
- async function N({
32
- preCached: h = !1,
33
- localFonts: d = [],
34
- useProxy: c = ""
35
- } = {}) {
36
- if (o.resource.has("fonts-embed-css")) {
37
- if (h) {
38
- const t = document.createElement("style");
39
- t.setAttribute("data-snapdom", "embedFonts"), t.textContent = o.resource.get("fonts-embed-css"), document.head.appendChild(t);
132
+ const v = /@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g, I = 4;
133
+ async function et(o, e, r) {
134
+ if (!o) return o;
135
+ const a = /* @__PURE__ */ new Set();
136
+ function n(f, s) {
137
+ try {
138
+ return new URL(f, s || location.href).href;
139
+ } catch {
140
+ return f;
141
+ }
142
+ }
143
+ async function c(f, s, u = 0) {
144
+ if (u > I)
145
+ return console.warn(
146
+ `[snapDOM] @import depth exceeded (${I}) at ${s}`
147
+ ), f;
148
+ let m = "", d = 0, p;
149
+ for (; p = v.exec(f); ) {
150
+ m += f.slice(d, p.index), d = v.lastIndex;
151
+ const L = (p[2] || p[4] || "").trim(), C = n(L, s);
152
+ if (a.has(C)) {
153
+ console.warn(`[snapDOM] Skipping circular @import: ${C}`);
154
+ continue;
155
+ }
156
+ a.add(C);
157
+ let i = "";
158
+ try {
159
+ const l = await A(C, {
160
+ as: "text",
161
+ useProxy: r,
162
+ silent: !0
163
+ });
164
+ l.ok && typeof l.data == "string" && (i = l.data);
165
+ } catch {
166
+ }
167
+ i ? (i = q(i, C), i = await c(i, C, u + 1), m += `
168
+ /* inlined: ${C} */
169
+ ${i}
170
+ `) : m += p[0];
40
171
  }
41
- return o.resource.get("fonts-embed-css");
172
+ return m += f.slice(d), m;
42
173
  }
43
- const y = /* @__PURE__ */ new Set();
174
+ let t = q(o, e || location.href);
175
+ return t = await c(t, e || location.href, 0), t;
176
+ }
177
+ const j = /url\((["']?)([^"')]+)\1\)/g, nt = /@font-face[^{}]*\{[^}]*\}/g;
178
+ function B(o) {
179
+ if (!o) return [];
180
+ const e = [], r = o.split(",").map((a) => a.trim()).filter(Boolean);
181
+ for (const a of r) {
182
+ const n = a.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);
183
+ if (!n) continue;
184
+ const c = n[1], t = n[2], f = (s) => {
185
+ if (!s.includes("?")) return parseInt(s, 16);
186
+ const u = parseInt(s.replace(/\?/g, "0"), 16), m = parseInt(s.replace(/\?/g, "F"), 16);
187
+ return [u, m];
188
+ };
189
+ if (t) {
190
+ const s = f(c), u = f(t), m = Array.isArray(s) ? s[0] : s, d = Array.isArray(u) ? u[1] : u;
191
+ e.push([Math.min(m, d), Math.max(m, d)]);
192
+ } else {
193
+ const s = f(c);
194
+ Array.isArray(s) ? e.push([s[0], s[1]]) : e.push([s, s]);
195
+ }
196
+ }
197
+ return e;
198
+ }
199
+ function V(o, e) {
200
+ if (!e.length || !o || o.size === 0) return !0;
201
+ for (const r of o)
202
+ for (const [a, n] of e) if (r >= a && r <= n) return !0;
203
+ return !1;
204
+ }
205
+ function P(o, e) {
206
+ const r = [];
207
+ if (!o) return r;
208
+ for (const a of o.matchAll(j)) {
209
+ let n = (a[2] || "").trim();
210
+ if (!(!n || n.startsWith("data:"))) {
211
+ if (!/^https?:/i.test(n))
212
+ try {
213
+ n = new URL(n, e || location.href).href;
214
+ } catch {
215
+ }
216
+ r.push(n);
217
+ }
218
+ }
219
+ return r;
220
+ }
221
+ async function z(o, e, r = "") {
222
+ let a = o;
223
+ for (const n of o.matchAll(j)) {
224
+ const c = X(n[0]);
225
+ if (!c) continue;
226
+ let t = c;
227
+ if (!t.startsWith("http") && !t.startsWith("data:"))
228
+ try {
229
+ t = new URL(t, e || location.href).href;
230
+ } catch {
231
+ }
232
+ if (!x(t)) {
233
+ if (g.resource?.has(t)) {
234
+ g.font?.add(t), a = a.replace(n[0], `url(${g.resource.get(t)})`);
235
+ continue;
236
+ }
237
+ if (!g.font?.has(t))
238
+ try {
239
+ const f = await A(t, { as: "dataURL", useProxy: r, silent: !0 });
240
+ if (f.ok && typeof f.data == "string") {
241
+ const s = f.data;
242
+ g.resource?.set(t, s), g.font?.add(t), a = a.replace(n[0], `url(${s})`);
243
+ }
244
+ } catch {
245
+ console.warn("[snapDOM] Failed to fetch font resource:", t);
246
+ }
247
+ }
248
+ }
249
+ return a;
250
+ }
251
+ function ot(o) {
252
+ if (!o.length) return null;
253
+ const e = (f, s) => o.some(([u, m]) => !(m < f || u > s)), r = e(0, 255) || e(305, 305), a = e(256, 591) || e(7680, 7935), n = e(880, 1023), c = e(1024, 1279);
254
+ return e(7840, 7929) || e(258, 259) || e(416, 417) || e(431, 432) ? "vietnamese" : c ? "cyrillic" : n ? "greek" : a ? "latin-ext" : r ? "latin" : null;
255
+ }
256
+ function D(o = {}) {
257
+ const e = new Set(
258
+ (o.families || []).map((n) => String(n).toLowerCase())
259
+ ), r = new Set(
260
+ (o.domains || []).map((n) => String(n).toLowerCase())
261
+ ), a = new Set(
262
+ (o.subsets || []).map((n) => String(n).toLowerCase())
263
+ );
264
+ return (n, c) => {
265
+ if (e.size && e.has(n.family.toLowerCase())) return !0;
266
+ if (r.size)
267
+ for (const t of n.srcUrls)
268
+ try {
269
+ if (r.has(new URL(t).host.toLowerCase())) return !0;
270
+ } catch {
271
+ }
272
+ if (a.size) {
273
+ const t = ot(c);
274
+ if (t && a.has(t)) return !0;
275
+ }
276
+ return !1;
277
+ };
278
+ }
279
+ function rt(o) {
280
+ if (!o) return o;
281
+ const e = /@font-face[^{}]*\{[^}]*\}/gi, r = /* @__PURE__ */ new Set(), a = [];
282
+ for (const c of o.match(e) || []) {
283
+ const t = c.match(/font-family:\s*([^;]+);/i)?.[1] || "", f = T(t), s = (c.match(/font-weight:\s*([^;]+);/i)?.[1] || "400").trim(), u = (c.match(/font-style:\s*([^;]+);/i)?.[1] || "normal").trim(), m = (c.match(/font-stretch:\s*([^;]+);/i)?.[1] || "100%").trim(), d = (c.match(/unicode-range:\s*([^;]+);/i)?.[1] || "").trim(), p = (c.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1] || "").trim(), L = P(p, location.href), C = L.length ? L.map((l) => String(l).toLowerCase()).sort().join("|") : p.toLowerCase(), i = [
284
+ String(f || "").toLowerCase(),
285
+ s,
286
+ u,
287
+ m,
288
+ d.toLowerCase(),
289
+ C
290
+ ].join("|");
291
+ r.has(i) || (r.add(i), a.push(c));
292
+ }
293
+ if (a.length === 0) return o;
294
+ let n = 0;
295
+ return o.replace(e, () => a[n++] || "");
296
+ }
297
+ function st(o, e, r, a) {
298
+ const n = Array.from(o || []).sort().join("|"), c = e ? JSON.stringify({
299
+ families: (e.families || []).map((s) => String(s).toLowerCase()).sort(),
300
+ domains: (e.domains || []).map((s) => String(s).toLowerCase()).sort(),
301
+ subsets: (e.subsets || []).map((s) => String(s).toLowerCase()).sort()
302
+ }) : "", t = (r || []).map(
303
+ (s) => `${(s.family || "").toLowerCase()}::${s.weight || "normal"}::${s.style || "normal"}::${s.src || ""}`
304
+ ).sort().join("|");
305
+ return `fonts-embed-css::req=${n}::ex=${c}::lf=${t}::px=${a || ""}`;
306
+ }
307
+ async function H(o, e, r, a) {
308
+ let n;
44
309
  try {
45
- for (const t of document.fonts)
46
- t.status === "loaded" && y.add(
47
- `${t.family}__${t.weight || "normal"}__${t.style || "normal"}`
48
- );
310
+ n = o.cssRules || [];
49
311
  } catch {
312
+ return;
313
+ }
314
+ const c = (t, f) => {
315
+ try {
316
+ return new URL(t, f || location.href).href;
317
+ } catch {
318
+ return t;
319
+ }
320
+ };
321
+ for (const t of n) {
322
+ if (t.type === CSSRule.IMPORT_RULE && t.styleSheet) {
323
+ const f = t.href ? c(t.href, e) : e;
324
+ if (a.depth >= I) {
325
+ console.warn(
326
+ `[snapDOM] CSSOM import depth exceeded (${I}) at ${f}`
327
+ );
328
+ continue;
329
+ }
330
+ if (f && a.visitedSheets.has(f)) {
331
+ console.warn(`[snapDOM] Skipping circular CSSOM import: ${f}`);
332
+ continue;
333
+ }
334
+ f && a.visitedSheets.add(f);
335
+ const s = { ...a, depth: (a.depth || 0) + 1 };
336
+ await H(
337
+ t.styleSheet,
338
+ f,
339
+ r,
340
+ s
341
+ );
342
+ continue;
343
+ }
344
+ if (t.type === CSSRule.FONT_FACE_RULE) {
345
+ const f = (t.style.getPropertyValue("font-family") || "").trim(), s = T(f);
346
+ if (!s || x(s)) continue;
347
+ const u = (t.style.getPropertyValue("font-weight") || "400").trim(), m = (t.style.getPropertyValue("font-style") || "normal").trim(), d = (t.style.getPropertyValue("font-stretch") || "100%").trim(), p = (t.style.getPropertyValue("src") || "").trim(), L = (t.style.getPropertyValue("unicode-range") || "").trim();
348
+ if (!a.faceMatchesRequired(s, m, u, d))
349
+ continue;
350
+ const C = B(L);
351
+ if (!V(a.usedCodepoints, C)) continue;
352
+ const i = {
353
+ family: s,
354
+ weightSpec: u,
355
+ styleSpec: m,
356
+ stretchSpec: d,
357
+ unicodeRange: L,
358
+ srcRaw: p,
359
+ srcUrls: P(p, e || location.href),
360
+ href: e || location.href
361
+ };
362
+ if (a.simpleExcluder && a.simpleExcluder(i, C)) continue;
363
+ if (/url\(/i.test(p)) {
364
+ const l = await z(
365
+ p,
366
+ e || location.href,
367
+ a.useProxy
368
+ );
369
+ await r(
370
+ `@font-face{font-family:${s};src:${l};font-style:${m};font-weight:${u};font-stretch:${d};${L ? `unicode-range:${L};` : ""}}`
371
+ );
372
+ } else
373
+ await r(
374
+ `@font-face{font-family:${s};src:${p};font-style:${m};font-weight:${u};font-stretch:${d};${L ? `unicode-range:${L};` : ""}}`
375
+ );
376
+ }
377
+ }
378
+ }
379
+ async function ut({
380
+ required: o,
381
+ usedCodepoints: e,
382
+ exclude: r = void 0,
383
+ localFonts: a = [],
384
+ useProxy: n = ""
385
+ } = {}) {
386
+ o instanceof Set || (o = /* @__PURE__ */ new Set()), e instanceof Set || (e = /* @__PURE__ */ new Set());
387
+ const c = /* @__PURE__ */ new Map();
388
+ for (const i of o) {
389
+ const [l, h, w, S] = String(i).split("__");
390
+ if (!l) continue;
391
+ const y = c.get(l) || [];
392
+ y.push({ w: parseInt(h, 10), s: w, st: parseInt(S, 10) }), c.set(l, y);
393
+ }
394
+ function t(i, l, h, w) {
395
+ if (!c.has(i)) return !1;
396
+ const S = c.get(i), y = J(h), R = K(l), b = Q(w), F = y.min !== y.max, M = y.min, E = ($) => R.kind === "normal" && $ === "normal" || R.kind !== "normal" && ($ === "italic" || $ === "oblique");
397
+ let k = !1;
398
+ for (const $ of S) {
399
+ const _ = F ? $.w >= y.min && $.w <= y.max : $.w === M, O = E(W($.s)), U = $.st >= b.min && $.st <= b.max;
400
+ if (_ && O && U) {
401
+ k = !0;
402
+ break;
403
+ }
404
+ }
405
+ if (k) return !0;
406
+ if (!F)
407
+ for (const $ of S) {
408
+ const _ = E(W($.s)), O = $.st >= b.min && $.st <= b.max;
409
+ if (Math.abs(M - $.w) <= 300 && _ && O) return !0;
410
+ }
411
+ return !1;
50
412
  }
51
- const C = /@import\s+url\(["']?([^"')]+)["']?\)/g, p = [];
52
- for (const t of document.querySelectorAll("style")) {
53
- const n = t.textContent || "", e = Array.from(n.matchAll(C));
54
- for (const a of e) {
55
- const r = a[1];
56
- $(r) || T(r) || p.push(r);
413
+ const f = D(r), s = st(o, r, a, n);
414
+ if (g.resource?.has(s))
415
+ return g.resource.get(s);
416
+ const u = tt(o), m = [], d = v;
417
+ for (const i of document.querySelectorAll("style")) {
418
+ const l = i.textContent || "";
419
+ for (const h of l.matchAll(d)) {
420
+ const w = (h[2] || h[4] || "").trim();
421
+ if (!w || x(w)) continue;
422
+ !!document.querySelector(
423
+ `link[rel="stylesheet"][href="${w}"]`
424
+ ) || m.push(w);
57
425
  }
58
426
  }
59
- await Promise.all(p.map(I));
60
- const i = Array.from(
427
+ m.length && await Promise.all(
428
+ m.map(
429
+ (i) => new Promise((l) => {
430
+ if (document.querySelector(`link[rel="stylesheet"][href="${i}"]`))
431
+ return l(null);
432
+ const h = document.createElement("link");
433
+ h.rel = "stylesheet", h.href = i, h.setAttribute("data-snapdom", "injected-import"), h.onload = () => l(h), h.onerror = () => l(null), document.head.appendChild(h);
434
+ })
435
+ )
436
+ );
437
+ let p = "";
438
+ const L = Array.from(
61
439
  document.querySelectorAll('link[rel="stylesheet"]')
62
- ).filter((t) => t.href);
63
- let m = "";
64
- for (const t of i)
440
+ ).filter((i) => !!i.href);
441
+ for (const i of L)
65
442
  try {
66
- const e = await (await A(t.href, { useProxy: c })).text();
67
- if ($(t.href) || $(e)) continue;
68
- const a = /@font-face[^{}]*{[^}]*}/g;
69
- let r = e;
70
- for (const s of e.match(a) || []) {
71
- const b = s.match(/font-family:\s*([^;]+);/i);
72
- if (!b) continue;
73
- const R = b[1].replace(/['"]/g, "").trim(), S = s.match(/font-weight:\s*([^;]+);/i), u = s.match(/font-style:\s*([^;]+);/i), F = S ? S[1].trim() : "normal", w = u ? u[1].trim() : "normal", k = `${R}__${F}__${w}`, x = /url\((["']?)([^"')]+)\1\)/g, L = /url\(/i.test(s), f = /local\(/i.test(s);
74
- if (!L && f)
75
- continue;
76
- if (!y.has(k)) {
77
- r = r.replace(s, "");
78
- continue;
79
- }
80
- let g = s;
81
- const E = Array.from(s.matchAll(x));
82
- for (const _ of E) {
83
- let U = v(_[0]);
84
- if (!U) continue;
85
- let l = U;
86
- if (!l.startsWith("http") && !l.startsWith("data:") && (l = new URL(l, t.href).href), !$(l)) {
87
- if (o.resource.has(l)) {
88
- o.font.add(l), g = g.replace(
89
- _[0],
90
- `url(${o.resource.get(l)})`
91
- );
92
- continue;
93
- }
94
- if (!o.font.has(l))
95
- try {
96
- const D = await (await A(l, { useProxy: c })).blob(), M = await new Promise((W) => {
97
- const P = new FileReader();
98
- P.onload = () => W(P.result), P.readAsDataURL(D);
99
- });
100
- o.resource.set(l, M), o.font.add(l), g = g.replace(_[0], `url(${M})`);
101
- } catch {
102
- console.warn("[snapdom] Failed to fetch font resource:", l);
103
- }
443
+ if (x(i.href)) continue;
444
+ let l = "", h = !1;
445
+ try {
446
+ h = new URL(i.href, location.href).origin === location.origin;
447
+ } catch {
448
+ }
449
+ if (!h && !Z(i.href, u))
450
+ continue;
451
+ if (h) {
452
+ const S = Array.from(document.styleSheets).find(
453
+ (y) => y.href === i.href
454
+ );
455
+ if (S)
456
+ try {
457
+ const y = S.cssRules || [];
458
+ l = Array.from(y).map((R) => R.cssText).join("");
459
+ } catch {
104
460
  }
105
- }
106
- r = r.replace(s, g);
107
461
  }
108
- m += r + `
109
- `;
462
+ if (!l && (l = (await A(i.href, { as: "text", useProxy: n })).data, x(i.href)))
463
+ continue;
464
+ l = await et(l, i.href, n);
465
+ let w = "";
466
+ for (const S of l.match(nt) || []) {
467
+ const y = (S.match(/font-family:\s*([^;]+);/i)?.[1] || "").trim(), R = T(y);
468
+ if (!R || x(R)) continue;
469
+ const b = (S.match(/font-weight:\s*([^;]+);/i)?.[1] || "400").trim(), F = (S.match(/font-style:\s*([^;]+);/i)?.[1] || "normal").trim(), M = (S.match(/font-stretch:\s*([^;]+);/i)?.[1] || "100%").trim(), E = (S.match(/unicode-range:\s*([^;]+);/i)?.[1] || "").trim(), k = (S.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1] || "").trim(), $ = P(k, i.href);
470
+ if (!t(R, F, b, M))
471
+ continue;
472
+ const _ = B(E);
473
+ if (!V(e, _)) continue;
474
+ const O = {
475
+ family: R,
476
+ weightSpec: b,
477
+ styleSpec: F,
478
+ stretchSpec: M,
479
+ unicodeRange: E,
480
+ srcRaw: k,
481
+ srcUrls: $,
482
+ href: i.href
483
+ };
484
+ if (r && f(O, _)) continue;
485
+ const U = /url\(/i.test(k) ? await z(S, i.href, n) : S;
486
+ w += U;
487
+ }
488
+ w.trim() && (p += w);
110
489
  } catch {
111
- console.warn("[snapdom] Failed to fetch CSS:", t.href);
490
+ console.warn("[snapDOM] Failed to process stylesheet:", i.href);
112
491
  }
113
- for (const t of document.styleSheets)
114
- try {
115
- if (!t.href || i.every((n) => n.href !== t.href)) {
116
- for (const n of t.cssRules)
117
- if (n.type === CSSRule.FONT_FACE_RULE) {
118
- const e = n.style.getPropertyValue("src"), a = n.style.getPropertyValue("font-family");
119
- if (!e || $(a)) continue;
120
- const r = n.style.getPropertyValue("font-weight") || "normal", s = n.style.getPropertyValue("font-style") || "normal", b = `${a}__${r}__${s}`, R = /url\((["']?)([^"')]+)\1\)/g, S = /local\((["']?)[^)]+?\1\)/g, u = !!e.match(R), F = !!e.match(S);
121
- if (!u && F) {
122
- m += `@font-face{font-family:${a};src:${e};font-style:${s};font-weight:${r};}`;
123
- continue;
124
- }
125
- if (!y.has(b)) continue;
126
- let w = e;
127
- const k = Array.from(e.matchAll(R));
128
- for (const x of k) {
129
- let L = x[2].trim();
130
- if (!L) continue;
131
- let f = L;
132
- if (!f.startsWith("http") && !f.startsWith("data:") && (f = new URL(f, t.href || location.href).href), !$(f)) {
133
- if (o.resource.has(f)) {
134
- o.font.add(f), w = w.replace(
135
- x[0],
136
- `url(${o.resource.get(f)})`
137
- );
138
- continue;
139
- }
140
- if (!o.font.has(f))
141
- try {
142
- const E = await (await A(f, { useProxy: c })).blob(), _ = await new Promise((U) => {
143
- const l = new FileReader();
144
- l.onload = () => U(l.result), l.readAsDataURL(E);
145
- });
146
- o.resource.set(f, _), o.font.add(f), w = w.replace(x[0], `url(${_})`);
147
- } catch {
148
- console.warn("[snapdom] Failed to fetch font URL:", f);
149
- }
150
- }
151
- }
152
- m += `@font-face{font-family:${a};src:${w};font-style:${s};font-weight:${r};}`;
153
- }
492
+ const C = {
493
+ requiredIndex: c,
494
+ usedCodepoints: e,
495
+ faceMatchesRequired: t,
496
+ simpleExcluder: r ? D(r) : null,
497
+ useProxy: n,
498
+ visitedSheets: /* @__PURE__ */ new Set(),
499
+ depth: 0
500
+ };
501
+ for (const i of document.styleSheets)
502
+ if (!(i.href && L.some((l) => l.href === i.href)))
503
+ try {
504
+ const l = i.href || location.href;
505
+ l && C.visitedSheets.add(l), await H(
506
+ i,
507
+ l,
508
+ async (h) => {
509
+ p += h;
510
+ },
511
+ C
512
+ );
513
+ } catch {
154
514
  }
155
- } catch (n) {
156
- console.warn("[snapdom] Cannot access stylesheet", t.href, n);
157
- }
158
- for (const t of document.fonts)
159
- if (t.family && t.status === "loaded" && t._snapdomSrc) {
160
- if ($(t.family)) continue;
161
- let n = t._snapdomSrc;
162
- if (!n.startsWith("data:")) {
163
- if (o.resource.has(t._snapdomSrc))
164
- n = o.resource.get(t._snapdomSrc), o.font.add(t._snapdomSrc);
165
- else if (!o.font.has(t._snapdomSrc))
515
+ try {
516
+ for (const i of document.fonts || []) {
517
+ if (!i || !i.family || i.status !== "loaded" || !i._snapdomSrc) continue;
518
+ const l = String(i.family).replace(/^['"]+|['"]+$/g, "");
519
+ if (x(l) || !c.has(l) || r?.families && r.families.some(
520
+ (w) => String(w).toLowerCase() === l.toLowerCase()
521
+ ))
522
+ continue;
523
+ let h = i._snapdomSrc;
524
+ if (!String(h).startsWith("data:")) {
525
+ if (g.resource?.has(i._snapdomSrc))
526
+ h = g.resource.get(i._snapdomSrc), g.font?.add(i._snapdomSrc);
527
+ else if (!g.font?.has(i._snapdomSrc))
166
528
  try {
167
- const a = await (await A(t._snapdomSrc, { useProxy: c })).blob();
168
- n = await new Promise((r) => {
169
- const s = new FileReader();
170
- s.onload = () => r(s.result), s.readAsDataURL(a);
171
- }), o.resource.set(t._snapdomSrc, n), o.font.add(t._snapdomSrc);
529
+ const w = await A(i._snapdomSrc, {
530
+ as: "dataURL",
531
+ useProxy: n,
532
+ silent: !0
533
+ });
534
+ if (w.ok && typeof w.data == "string")
535
+ h = w.data, g.resource?.set(i._snapdomSrc, h), g.font?.add(i._snapdomSrc);
536
+ else
537
+ continue;
172
538
  } catch {
173
539
  console.warn(
174
- "[snapdom] Failed to fetch dynamic font src:",
175
- t._snapdomSrc
540
+ "[snapDOM] Failed to fetch dynamic font src:",
541
+ i._snapdomSrc
176
542
  );
177
543
  continue;
178
544
  }
179
545
  }
180
- m += `@font-face{font-family:'${t.family}';src:url(${n});font-style:${t.style || "normal"};font-weight:${t.weight || "normal"};}`;
181
- }
182
- for (const t of d) {
183
- if (!t || typeof t != "object") continue;
184
- const { family: n, src: e, weight: a = "normal", style: r = "normal" } = t;
185
- if (!n || !e) continue;
186
- let s = e;
187
- if (s.startsWith("data:"))
188
- o.resource.set(e, s), o.font.add(e);
189
- else
190
- try {
191
- const R = await (await A(e, { useProxy: c })).blob();
192
- s = await new Promise((S) => {
193
- const u = new FileReader();
194
- u.onload = () => S(u.result), u.readAsDataURL(R);
195
- }), o.resource.set(e, s), o.font.add(e);
196
- } catch {
197
- console.warn("[snapdom] Failed to load local font:", e);
198
- continue;
546
+ p += `@font-face{font-family:'${l}';src:url(${h});font-style:${i.style || "normal"};font-weight:${i.weight || "normal"};}`;
547
+ }
548
+ } catch {
549
+ }
550
+ for (const i of a) {
551
+ if (!i || typeof i != "object") continue;
552
+ const l = String(i.family || "").replace(/^['"]+|['"]+$/g, "");
553
+ if (!l || x(l) || !c.has(l) || r?.families && r.families.some(
554
+ (b) => String(b).toLowerCase() === l.toLowerCase()
555
+ ))
556
+ continue;
557
+ const h = i.weight != null ? String(i.weight) : "normal", w = i.style != null ? String(i.style) : "normal", S = i.stretchPct != null ? `${i.stretchPct}%` : "100%", y = String(i.src || "");
558
+ let R = y;
559
+ if (!R.startsWith("data:")) {
560
+ if (g.resource?.has(y))
561
+ R = g.resource.get(y), g.font?.add(y);
562
+ else if (!g.font?.has(y))
563
+ try {
564
+ const b = await A(y, {
565
+ as: "dataURL",
566
+ useProxy: n,
567
+ silent: !0
568
+ });
569
+ if (b.ok && typeof b.data == "string")
570
+ R = b.data, g.resource?.set(y, R), g.font?.add(y);
571
+ else
572
+ continue;
573
+ } catch {
574
+ console.warn("[snapDOM] Failed to fetch localFonts src:", y);
575
+ continue;
576
+ }
577
+ }
578
+ p += `@font-face{font-family:'${l}';src:url(${R});font-style:${w};font-weight:${h};font-stretch:${S};}`;
579
+ }
580
+ return p && (p = rt(p), g.resource?.set(s, p)), p;
581
+ }
582
+ function mt(o) {
583
+ const e = /* @__PURE__ */ new Set();
584
+ if (!o) return e;
585
+ const r = document.createTreeWalker(o, NodeFilter.SHOW_ELEMENT, null), a = (t) => {
586
+ const f = T(t.fontFamily);
587
+ if (!f) return;
588
+ const s = (u, m, d) => `${f}__${N(u)}__${W(m)}__${Y(d)}`;
589
+ e.add(s(t.fontWeight, t.fontStyle, t.fontStretch));
590
+ };
591
+ a(getComputedStyle(o));
592
+ const n = getComputedStyle(o, "::before");
593
+ n && n.content && n.content !== "none" && a(n);
594
+ const c = getComputedStyle(o, "::after");
595
+ for (c && c.content && c.content !== "none" && a(c); r.nextNode(); ) {
596
+ const t = (
597
+ /** @type {Element} */
598
+ r.currentNode
599
+ ), f = getComputedStyle(t);
600
+ a(f);
601
+ const s = getComputedStyle(t, "::before");
602
+ s && s.content && s.content !== "none" && a(s);
603
+ const u = getComputedStyle(t, "::after");
604
+ u && u.content && u.content !== "none" && a(u);
605
+ }
606
+ return e;
607
+ }
608
+ function ht(o) {
609
+ const e = /* @__PURE__ */ new Set(), r = (n) => {
610
+ if (n)
611
+ for (const c of n) e.add(c.codePointAt(0));
612
+ }, a = document.createTreeWalker(
613
+ o,
614
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,
615
+ null
616
+ );
617
+ for (; a.nextNode(); ) {
618
+ const n = a.currentNode;
619
+ if (n.nodeType === Node.TEXT_NODE)
620
+ r(n.nodeValue || "");
621
+ else if (n.nodeType === Node.ELEMENT_NODE) {
622
+ const c = (
623
+ /** @type {Element} */
624
+ n
625
+ );
626
+ for (const t of ["::before", "::after"]) {
627
+ const s = getComputedStyle(c, t)?.getPropertyValue("content");
628
+ if (!(!s || s === "none"))
629
+ if (/^"/.test(s) || /^'/.test(s))
630
+ r(s.slice(1, -1));
631
+ else {
632
+ const u = s.match(/\\[0-9A-Fa-f]{1,6}/g);
633
+ if (u)
634
+ for (const m of u)
635
+ try {
636
+ e.add(parseInt(m.slice(1), 16));
637
+ } catch {
638
+ }
639
+ }
199
640
  }
200
- m += `@font-face{font-family:'${n}';src:url(${s});font-style:${r};font-weight:${a};}`;
641
+ }
201
642
  }
202
- if (m && (o.resource.set("fonts-embed-css", m), h)) {
203
- const t = document.createElement("style");
204
- t.setAttribute("data-snapdom", "embedFonts"), t.textContent = m, document.head.appendChild(t);
643
+ return e;
644
+ }
645
+ async function dt(o, e = 2) {
646
+ try {
647
+ await document.fonts.ready;
648
+ } catch {
205
649
  }
206
- return m;
650
+ const r = Array.from(o || []).filter(Boolean);
651
+ if (r.length === 0) return;
652
+ const a = () => {
653
+ const n = document.createElement("div");
654
+ n.style.cssText = "position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";
655
+ for (const c of r) {
656
+ const t = document.createElement("span");
657
+ t.textContent = "AaBbGg1234ÁÉÍÓÚçñ—∞", t.style.fontFamily = `"${c}"`, t.style.fontWeight = "700", t.style.fontStyle = "italic", t.style.fontSize = "32px", t.style.lineHeight = "1", t.style.whiteSpace = "nowrap", t.style.margin = "0", t.style.padding = "0", n.appendChild(t);
658
+ }
659
+ document.body.appendChild(n), n.offsetWidth, document.body.removeChild(n);
660
+ };
661
+ for (let n = 0; n < Math.max(1, e); n++)
662
+ a(), await new Promise(
663
+ (c) => requestAnimationFrame(() => requestAnimationFrame(c))
664
+ );
207
665
  }
208
666
  export {
209
- N as embedCustomFonts,
210
- H as iconToImage
667
+ ht as collectUsedCodepoints,
668
+ mt as collectUsedFontVariants,
669
+ ut as embedCustomFonts,
670
+ dt as ensureFontsReady,
671
+ lt as iconToImage
211
672
  };