@sprawlify/primitives 0.0.6 → 0.0.8

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 (329) hide show
  1. package/dist/anatomy.d.cts +1 -1
  2. package/dist/anatomy.d.mts +1 -1
  3. package/dist/anatomy.mjs +1 -1
  4. package/dist/{aria-hidden-Dvvxh8vn.mjs → aria-hidden-DIoJxbA3.mjs} +1 -1
  5. package/dist/aria-hidden.mjs +2 -2
  6. package/dist/{auto-resize-jPNnPyMJ.mjs → auto-resize-L6Oqa0lE.mjs} +1 -1
  7. package/dist/auto-resize.mjs +2 -2
  8. package/dist/{collection-Bxz7UdDS.mjs → collection-0DmMA3br.mjs} +2 -2
  9. package/dist/collection.d.cts +4 -4
  10. package/dist/collection.d.mts +4 -4
  11. package/dist/collection.mjs +2 -2
  12. package/dist/{color-utils-DbSDg6nI.mjs → color-utils-D0Lo5X-u.mjs} +2 -2
  13. package/dist/color-utils.d.cts +1 -1
  14. package/dist/color-utils.d.mts +1 -1
  15. package/dist/color-utils.mjs +2 -2
  16. package/dist/{core-Bap2tV4J.d.cts → core-75kSaDJc.d.mts} +3 -3
  17. package/dist/{core-1JwD9Bth.d.mts → core-D_pI64vx.d.cts} +3 -3
  18. package/dist/{core-C77LsUvk.mjs → core-qHH8MshY.mjs} +2 -2
  19. package/dist/core.d.cts +2 -2
  20. package/dist/core.d.mts +2 -2
  21. package/dist/core.mjs +3 -3
  22. package/dist/date-utils.d.cts +6 -6
  23. package/dist/date-utils.d.mts +1 -1
  24. package/dist/date-utils.mjs +1 -1
  25. package/dist/{dismissable-WpM6GqPg.mjs → dismissable-C-6M-juU.mjs} +3 -3
  26. package/dist/{dismissable-layer-DwFMEm4o.d.mts → dismissable-layer-2TW8ZBcS.d.cts} +2 -2
  27. package/dist/{dismissable-layer-BHdxdWFo.d.cts → dismissable-layer-CllXZ1N9.d.mts} +2 -2
  28. package/dist/dismissable.d.cts +2 -2
  29. package/dist/dismissable.d.mts +2 -2
  30. package/dist/dismissable.mjs +4 -4
  31. package/dist/{dom-query-DlipWdON.mjs → dom-query-Bwyyt0Vp.mjs} +1 -1
  32. package/dist/dom-query.d.cts +6 -6
  33. package/dist/dom-query.d.mts +6 -6
  34. package/dist/dom-query.mjs +1 -1
  35. package/dist/file-utils-5E6-AtJ9.mjs +210 -0
  36. package/dist/file-utils-G9_tYexo.cjs +270 -0
  37. package/dist/file-utils.cjs +12 -220
  38. package/dist/file-utils.d.cts +2 -12
  39. package/dist/file-utils.d.mts +2 -12
  40. package/dist/file-utils.mjs +1 -208
  41. package/dist/{focus-trap-BY0WXiLZ.mjs → focus-trap-BG22frp5.mjs} +2 -2
  42. package/dist/focus-trap.cjs +1 -1
  43. package/dist/focus-trap.mjs +2 -2
  44. package/dist/{focus-visible-C8Gu5QYM.mjs → focus-visible-BKLakzc7.mjs} +1 -1
  45. package/dist/focus-visible.cjs +1 -1
  46. package/dist/focus-visible.mjs +2 -2
  47. package/dist/hotkeys.mjs +1 -1
  48. package/dist/i18n-utils-B8IY1mOh.cjs +505 -0
  49. package/dist/i18n-utils-DCz8B6DF.mjs +440 -0
  50. package/dist/i18n-utils.cjs +14 -450
  51. package/dist/i18n-utils.mjs +2 -438
  52. package/dist/{index-CNyu_Zzq.d.mts → index-DYzqCFaj.d.mts} +5 -5
  53. package/dist/{interact-outside-JTrDIgHe.mjs → interact-outside-BtY3-DVp.mjs} +2 -2
  54. package/dist/interact-outside.d.cts +1 -1
  55. package/dist/interact-outside.d.mts +1 -1
  56. package/dist/interact-outside.mjs +3 -3
  57. package/dist/{list-collection-BQSMBg4X.d.mts → list-collection-BvMwDNHf.d.cts} +1 -1
  58. package/dist/{list-collection-DrnwYduc.d.cts → list-collection-CTt1eong.d.mts} +1 -1
  59. package/dist/live-region.cjs +1 -1
  60. package/dist/live-region.d.cts +1 -1
  61. package/dist/live-region.d.mts +1 -1
  62. package/dist/live-region.mjs +1 -1
  63. package/dist/machines/accordion/index.cjs +1 -1
  64. package/dist/machines/accordion/index.d.cts +3 -3
  65. package/dist/machines/accordion/index.d.mts +3 -3
  66. package/dist/machines/accordion/index.mjs +5 -5
  67. package/dist/machines/angle-slider/index.cjs +2 -2
  68. package/dist/machines/angle-slider/index.d.cts +4 -4
  69. package/dist/machines/angle-slider/index.d.mts +4 -4
  70. package/dist/machines/angle-slider/index.mjs +6 -6
  71. package/dist/machines/async-list/index.d.cts +1 -1
  72. package/dist/machines/async-list/index.d.mts +1 -1
  73. package/dist/machines/async-list/index.mjs +3 -3
  74. package/dist/machines/avatar/index.cjs +1 -1
  75. package/dist/machines/avatar/index.d.cts +3 -3
  76. package/dist/machines/avatar/index.d.mts +3 -3
  77. package/dist/machines/avatar/index.mjs +5 -5
  78. package/dist/machines/bottom-sheet/index.cjs +3 -3
  79. package/dist/machines/bottom-sheet/index.d.cts +6 -6
  80. package/dist/machines/bottom-sheet/index.d.mts +6 -6
  81. package/dist/machines/bottom-sheet/index.mjs +11 -11
  82. package/dist/machines/carousel/index.cjs +2 -2
  83. package/dist/machines/carousel/index.d.cts +4 -4
  84. package/dist/machines/carousel/index.d.mts +4 -4
  85. package/dist/machines/carousel/index.mjs +6 -6
  86. package/dist/machines/checkbox/index.cjs +2 -2
  87. package/dist/machines/checkbox/index.d.cts +4 -4
  88. package/dist/machines/checkbox/index.d.mts +4 -4
  89. package/dist/machines/checkbox/index.mjs +6 -6
  90. package/dist/machines/clipboard/index.cjs +1 -1
  91. package/dist/machines/clipboard/index.d.cts +4 -4
  92. package/dist/machines/clipboard/index.d.mts +4 -4
  93. package/dist/machines/clipboard/index.mjs +5 -5
  94. package/dist/machines/collapsible/index.cjs +1 -1
  95. package/dist/machines/collapsible/index.d.cts +4 -4
  96. package/dist/machines/collapsible/index.d.mts +4 -4
  97. package/dist/machines/collapsible/index.mjs +5 -5
  98. package/dist/machines/color-picker/index.cjs +2 -2
  99. package/dist/machines/color-picker/index.d.cts +7 -7
  100. package/dist/machines/color-picker/index.d.mts +7 -7
  101. package/dist/machines/color-picker/index.mjs +9 -9
  102. package/dist/machines/combobox/index.cjs +2 -2
  103. package/dist/machines/combobox/index.d.cts +8 -8
  104. package/dist/machines/combobox/index.d.mts +8 -8
  105. package/dist/machines/combobox/index.mjs +9 -9
  106. package/dist/machines/date-picker/index.cjs +3 -3
  107. package/dist/machines/date-picker/index.d.cts +8 -8
  108. package/dist/machines/date-picker/index.d.mts +8 -8
  109. package/dist/machines/date-picker/index.mjs +10 -10
  110. package/dist/machines/dialog/index.cjs +3 -3
  111. package/dist/machines/dialog/index.d.cts +6 -6
  112. package/dist/machines/dialog/index.d.mts +6 -6
  113. package/dist/machines/dialog/index.mjs +10 -10
  114. package/dist/machines/editable/index.cjs +1 -1
  115. package/dist/machines/editable/index.d.cts +5 -5
  116. package/dist/machines/editable/index.d.mts +5 -5
  117. package/dist/machines/editable/index.mjs +6 -6
  118. package/dist/machines/file-upload/index.cjs +627 -0
  119. package/dist/machines/file-upload/index.d.cts +145 -0
  120. package/dist/machines/file-upload/index.d.mts +145 -0
  121. package/dist/machines/file-upload/index.mjs +621 -0
  122. package/dist/machines/floating-panel/index.cjs +3 -3
  123. package/dist/machines/floating-panel/index.d.cts +5 -5
  124. package/dist/machines/floating-panel/index.d.mts +5 -5
  125. package/dist/machines/floating-panel/index.mjs +7 -7
  126. package/dist/machines/hover-card/index.cjs +2 -2
  127. package/dist/machines/hover-card/index.d.cts +6 -6
  128. package/dist/machines/hover-card/index.d.mts +6 -6
  129. package/dist/machines/hover-card/index.mjs +8 -8
  130. package/dist/machines/image-cropper/index.cjs +1 -1
  131. package/dist/machines/image-cropper/index.d.cts +3 -3
  132. package/dist/machines/image-cropper/index.d.mts +3 -3
  133. package/dist/machines/image-cropper/index.mjs +5 -5
  134. package/dist/machines/listbox/index.cjs +2 -2
  135. package/dist/machines/listbox/index.d.cts +8 -8
  136. package/dist/machines/listbox/index.d.mts +8 -8
  137. package/dist/machines/listbox/index.mjs +7 -7
  138. package/dist/machines/marquee/index.cjs +1 -1
  139. package/dist/machines/marquee/index.d.cts +6 -6
  140. package/dist/machines/marquee/index.d.mts +6 -6
  141. package/dist/machines/marquee/index.mjs +5 -5
  142. package/dist/machines/menu/index.cjs +3 -3
  143. package/dist/machines/menu/index.d.cts +9 -9
  144. package/dist/machines/menu/index.d.mts +9 -9
  145. package/dist/machines/menu/index.mjs +9 -9
  146. package/dist/machines/navigation-menu/index.cjs +1 -1
  147. package/dist/machines/navigation-menu/index.d.cts +4 -4
  148. package/dist/machines/navigation-menu/index.d.mts +4 -4
  149. package/dist/machines/navigation-menu/index.mjs +7 -7
  150. package/dist/machines/number-input/index.cjs +1 -1
  151. package/dist/machines/number-input/index.d.cts +4 -4
  152. package/dist/machines/number-input/index.d.mts +4 -4
  153. package/dist/machines/number-input/index.mjs +5 -5
  154. package/dist/machines/pagination/index.cjs +1 -1
  155. package/dist/machines/pagination/index.d.cts +4 -4
  156. package/dist/machines/pagination/index.d.mts +4 -4
  157. package/dist/machines/pagination/index.mjs +5 -5
  158. package/dist/machines/password-input/index.cjs +1 -1
  159. package/dist/machines/password-input/index.d.cts +4 -4
  160. package/dist/machines/password-input/index.d.mts +4 -4
  161. package/dist/machines/password-input/index.mjs +5 -5
  162. package/dist/machines/pin-input/index.cjs +1 -1
  163. package/dist/machines/pin-input/index.d.cts +4 -4
  164. package/dist/machines/pin-input/index.d.mts +4 -4
  165. package/dist/machines/pin-input/index.mjs +5 -5
  166. package/dist/machines/popover/index.cjs +4 -4
  167. package/dist/machines/popover/index.d.cts +7 -7
  168. package/dist/machines/popover/index.d.mts +7 -7
  169. package/dist/machines/popover/index.mjs +11 -11
  170. package/dist/machines/presence/index.cjs +1 -1
  171. package/dist/machines/presence/index.d.cts +2 -2
  172. package/dist/machines/presence/index.d.mts +2 -2
  173. package/dist/machines/presence/index.mjs +4 -4
  174. package/dist/machines/progress/index.cjs +1 -1
  175. package/dist/machines/progress/index.d.cts +4 -4
  176. package/dist/machines/progress/index.d.mts +4 -4
  177. package/dist/machines/progress/index.mjs +5 -5
  178. package/dist/machines/qr-code/index.cjs +1 -1
  179. package/dist/machines/qr-code/index.d.cts +4 -4
  180. package/dist/machines/qr-code/index.d.mts +4 -4
  181. package/dist/machines/qr-code/index.mjs +5 -5
  182. package/dist/machines/radio-group/index.cjs +2 -2
  183. package/dist/machines/radio-group/index.d.cts +4 -4
  184. package/dist/machines/radio-group/index.d.mts +4 -4
  185. package/dist/machines/radio-group/index.mjs +6 -6
  186. package/dist/machines/rating-group/index.cjs +1 -1
  187. package/dist/machines/rating-group/index.d.cts +4 -4
  188. package/dist/machines/rating-group/index.d.mts +4 -4
  189. package/dist/machines/rating-group/index.mjs +5 -5
  190. package/dist/machines/scroll-area/index.cjs +1 -1
  191. package/dist/machines/scroll-area/index.d.cts +4 -4
  192. package/dist/machines/scroll-area/index.d.mts +4 -4
  193. package/dist/machines/scroll-area/index.mjs +6 -6
  194. package/dist/machines/select/index.cjs +2 -2
  195. package/dist/machines/select/index.d.cts +9 -9
  196. package/dist/machines/select/index.d.mts +9 -9
  197. package/dist/machines/select/index.mjs +9 -9
  198. package/dist/machines/signature-pad/index.cjs +1 -1
  199. package/dist/machines/signature-pad/index.d.cts +4 -4
  200. package/dist/machines/signature-pad/index.d.mts +4 -4
  201. package/dist/machines/signature-pad/index.mjs +5 -5
  202. package/dist/machines/slider/index.cjs +1 -1
  203. package/dist/machines/slider/index.d.cts +4 -4
  204. package/dist/machines/slider/index.d.mts +4 -4
  205. package/dist/machines/slider/index.mjs +5 -5
  206. package/dist/machines/splitter/index.cjs +1 -1
  207. package/dist/machines/splitter/index.d.cts +3 -3
  208. package/dist/machines/splitter/index.d.mts +3 -3
  209. package/dist/machines/splitter/index.mjs +5 -5
  210. package/dist/machines/steps/index.cjs +1 -1
  211. package/dist/machines/steps/index.d.cts +4 -4
  212. package/dist/machines/steps/index.d.mts +4 -4
  213. package/dist/machines/steps/index.mjs +5 -5
  214. package/dist/machines/switch/index.cjs +2 -2
  215. package/dist/machines/switch/index.d.cts +3 -3
  216. package/dist/machines/switch/index.d.mts +3 -3
  217. package/dist/machines/switch/index.mjs +6 -6
  218. package/dist/machines/tabs/index.cjs +1 -1
  219. package/dist/machines/tabs/index.d.cts +4 -4
  220. package/dist/machines/tabs/index.d.mts +4 -4
  221. package/dist/machines/tabs/index.mjs +5 -5
  222. package/dist/machines/tags-input/index.cjs +2 -2
  223. package/dist/machines/tags-input/index.d.cts +6 -6
  224. package/dist/machines/tags-input/index.d.mts +6 -6
  225. package/dist/machines/tags-input/index.mjs +8 -8
  226. package/dist/machines/timer/index.cjs +1 -1
  227. package/dist/machines/timer/index.d.cts +4 -4
  228. package/dist/machines/timer/index.d.mts +4 -4
  229. package/dist/machines/timer/index.mjs +5 -5
  230. package/dist/machines/toast/index.d.cts +5 -5
  231. package/dist/machines/toast/index.d.mts +5 -5
  232. package/dist/machines/toast/index.mjs +6 -6
  233. package/dist/machines/toggle/index.cjs +1 -1
  234. package/dist/machines/toggle/index.d.cts +3 -3
  235. package/dist/machines/toggle/index.d.mts +3 -3
  236. package/dist/machines/toggle/index.mjs +5 -5
  237. package/dist/machines/toggle-group/index.cjs +1 -1
  238. package/dist/machines/toggle-group/index.d.cts +3 -3
  239. package/dist/machines/toggle-group/index.d.mts +3 -3
  240. package/dist/machines/toggle-group/index.mjs +5 -5
  241. package/dist/machines/tooltip/index.cjs +3 -3
  242. package/dist/machines/tooltip/index.d.cts +5 -5
  243. package/dist/machines/tooltip/index.d.mts +5 -5
  244. package/dist/machines/tooltip/index.mjs +7 -7
  245. package/dist/machines/tour/index.cjs +3 -3
  246. package/dist/machines/tour/index.d.cts +7 -7
  247. package/dist/machines/tour/index.d.mts +7 -7
  248. package/dist/machines/tour/index.mjs +9 -9
  249. package/dist/machines/tree-view/index.cjs +1 -1
  250. package/dist/machines/tree-view/index.d.cts +7 -7
  251. package/dist/machines/tree-view/index.d.mts +7 -7
  252. package/dist/machines/tree-view/index.mjs +6 -6
  253. package/dist/{popper-MxgCIf_4.mjs → popper-4MZcEna4.mjs} +2 -2
  254. package/dist/popper.cjs +1 -1
  255. package/dist/popper.d.cts +1 -1
  256. package/dist/popper.d.mts +1 -1
  257. package/dist/popper.mjs +3 -3
  258. package/dist/{rect-utils-BENI97My.mjs → rect-utils-j6C9uZk1.mjs} +1 -1
  259. package/dist/rect-utils.cjs +1 -1
  260. package/dist/rect-utils.d.cts +1 -1
  261. package/dist/rect-utils.d.mts +1 -1
  262. package/dist/rect-utils.mjs +1 -1
  263. package/dist/{remove-scroll-BL1SJPHq.mjs → remove-scroll-C73TLIgr.mjs} +1 -1
  264. package/dist/{scroll-snap-D-BtyzPh.mjs → scroll-snap-D4hJV_c8.mjs} +1 -1
  265. package/dist/scroll-snap.cjs +1 -1
  266. package/dist/scroll-snap.mjs +2 -2
  267. package/dist/{selection-BerN7Dvw.d.mts → selection-JDFmyke7.d.mts} +2 -2
  268. package/dist/{selection-Bm0boSA-.d.cts → selection-vng1guNc.d.cts} +2 -2
  269. package/dist/store.cjs +1 -1
  270. package/dist/store.mjs +1 -1
  271. package/dist/{tree-collection-Ders6toe.d.mts → tree-collection-DYIVkVee.d.mts} +1 -1
  272. package/dist/{tree-collection-CcgKezAi.d.cts → tree-collection-Dlv1BAsc.d.cts} +1 -1
  273. package/dist/types-CsK6JMut.d.mts +13 -0
  274. package/dist/types-xyuh-a2-.d.cts +13 -0
  275. package/dist/types.cjs +1 -1
  276. package/dist/types.d.cts +1 -1
  277. package/dist/types.d.mts +1 -1
  278. package/dist/types.mjs +1 -1
  279. package/dist/{utils-BxXp67XU.mjs → utils-hFKGi-oS.mjs} +1 -1
  280. package/dist/utils.d.cts +1 -1
  281. package/dist/utils.d.mts +1 -1
  282. package/dist/utils.mjs +1 -1
  283. package/package.json +11 -1
  284. /package/dist/{color-DMmL1Ky0.d.cts → color-CIaXnwJx.d.mts} +0 -0
  285. /package/dist/{color-blKFMqAz.d.mts → color-_pKYh-E2.d.cts} +0 -0
  286. /package/dist/{create-anatomy-Df7y5SsP.mjs → create-anatomy-CArN8dVu.mjs} +0 -0
  287. /package/dist/{create-anatomy-B1eclDhe.d.cts → create-anatomy-DHVOqZET.d.mts} +0 -0
  288. /package/dist/{create-anatomy-B9oniNA9.d.mts → create-anatomy-smWrirg1.d.cts} +0 -0
  289. /package/dist/{create-props-BML_gpX0.mjs → create-props-SRSjdUTq.mjs} +0 -0
  290. /package/dist/{create-props-YKy7JIKj.cjs → create-props-l5q5b8Wo.cjs} +0 -0
  291. /package/dist/{data-url-B5BT_GnT.d.mts → data-url-BqpiKO1L.d.mts} +0 -0
  292. /package/dist/{data-url-p1B_RG_H.d.cts → data-url-og2AwQaU.d.cts} +0 -0
  293. /package/dist/{date-utils-DftsV7SR.mjs → date-utils-d1Jt6z5f.mjs} +0 -0
  294. /package/dist/{defineProperty-DxNiKPNe.mjs → defineProperty-Cql4jybt.mjs} +0 -0
  295. /package/dist/{focus-trap-D4i52S9A.cjs → focus-trap-DMoa9bOi.cjs} +0 -0
  296. /package/dist/{focus-visible-DYTWdWpa.cjs → focus-visible-BVOZnp76.cjs} +0 -0
  297. /package/dist/{functions-D3G3aWHL.d.mts → functions-DFnYr-gp.d.cts} +0 -0
  298. /package/dist/{functions-DtSGq3MR.d.cts → functions-i_nVCRW0.d.mts} +0 -0
  299. /package/dist/{index-CefB9yps.d.mts → index-9OlOKr2i.d.mts} +0 -0
  300. /package/dist/{index-DQnU976_.d.cts → index-BBTkH09t.d.cts} +0 -0
  301. /package/dist/{index-CuONGeOw.d.mts → index-BVcPBg7R.d.mts} +0 -0
  302. /package/dist/{index-WDB45Zqi.d.mts → index-C9ajBf1B.d.mts} +0 -0
  303. /package/dist/{index-DvpM-Mfi.d.cts → index-DFiQyzeW.d.cts} +0 -0
  304. /package/dist/{index-pPMoFaB-.d.mts → index-DikGG00a.d.mts} +0 -0
  305. /package/dist/{index-PMpGStDQ.d.cts → index-UNyqrBDu.d.cts} +0 -0
  306. /package/dist/{live-region-CcZPGo89.cjs → live-region-2RiuzOr-.cjs} +0 -0
  307. /package/dist/{live-region-BjruYEJ2.mjs → live-region-BcSdQIM8.mjs} +0 -0
  308. /package/dist/{node-Cs9VjvUL.d.cts → node-BecR7gec.d.cts} +0 -0
  309. /package/dist/{node-R56TVizn.d.mts → node-v8Pyrj9P.d.mts} +0 -0
  310. /package/dist/{popper-D0FAW_p7.cjs → popper-CWip5FHB.cjs} +0 -0
  311. /package/dist/{raf-BBPHUdcb.d.mts → raf-BF2VrckK.d.cts} +0 -0
  312. /package/dist/{raf-DiJ6_y_m.d.cts → raf-DX52LaVy.d.mts} +0 -0
  313. /package/dist/{rect-utils-DKLRhP8G.cjs → rect-utils-Dp9Wvl7-.cjs} +0 -0
  314. /package/dist/{remove-scroll-Uvzg1L9r.cjs → remove-scroll-Dh9PjZFE.cjs} +0 -0
  315. /package/dist/{scroll-snap-zyiZLv7W.cjs → scroll-snap-BsPbmOTg.cjs} +0 -0
  316. /package/dist/{store-D6DXvVrK.mjs → store-CpMJ6RZR.mjs} +0 -0
  317. /package/dist/{store-BZcXv49B.cjs → store-DDjfrUhd.cjs} +0 -0
  318. /package/dist/{typeahead-DoNxux_s.d.mts → typeahead-BWyD_KIb.d.cts} +0 -0
  319. /package/dist/{typeahead-JQJrD3Fg.d.cts → typeahead-BX-BWYjD.d.mts} +0 -0
  320. /package/dist/{types-BrAcjFWl.d.cts → types-BIy26Uwn.d.cts} +0 -0
  321. /package/dist/{types-BLWhvNQm.d.cts → types-ByFp2QfD.d.mts} +0 -0
  322. /package/dist/{types-BXIZOjVE.d.mts → types-CADkcKtr.d.cts} +0 -0
  323. /package/dist/{types-YxEXuJrz.d.mts → types-CaxzY9yP.d.cts} +0 -0
  324. /package/dist/{types-DwwrI0dI.d.cts → types-Df8ZhdY-.d.mts} +0 -0
  325. /package/dist/{types-oXs2YVjs.d.cts → types-PjLoIczn.d.cts} +0 -0
  326. /package/dist/{types-D9XpvNCK.d.mts → types-jyV564Ip.d.mts} +0 -0
  327. /package/dist/{types-D3yZIhlx.d.cts → types-oh90SH45.d.cts} +0 -0
  328. /package/dist/{wait-for-CdgWKT7N.d.mts → wait-for-C9QyzQj2.d.cts} +0 -0
  329. /package/dist/{wait-for-kzsbN3VT.d.cts → wait-for-Pn6RmrHX.d.mts} +0 -0
@@ -0,0 +1,270 @@
1
+
2
+ //#region src/shared/file-utils/data-transfer.ts
3
+ const getItemEntry = (item) => typeof item.getAsEntry === "function" ? item.getAsEntry() : typeof item.webkitGetAsEntry === "function" ? item.webkitGetAsEntry() : null;
4
+ const isDirectoryEntry = (entry) => entry.isDirectory;
5
+ const isFileEntry = (entry) => entry.isFile;
6
+ const addRelativePath = (file, path) => {
7
+ Object.defineProperty(file, "relativePath", { value: path ? `${path}/${file.name}` : file.name });
8
+ return file;
9
+ };
10
+ const getFileEntries = (items, traverseDirectories) => Promise.all(Array.from(items).filter((item) => item.kind === "file").map((item) => {
11
+ const entry = getItemEntry(item);
12
+ if (!entry) return null;
13
+ if (isDirectoryEntry(entry) && traverseDirectories) return getDirectoryFiles(entry.createReader(), `${entry.name}`);
14
+ if (isFileEntry(entry) && typeof item.getAsFile === "function") {
15
+ const file = item.getAsFile();
16
+ return Promise.resolve(file ? addRelativePath(file, "") : null);
17
+ }
18
+ if (isFileEntry(entry)) return new Promise((resolve) => {
19
+ entry.file((file) => {
20
+ resolve(addRelativePath(file, ""));
21
+ });
22
+ });
23
+ }).filter((b) => b));
24
+ const getDirectoryFiles = (reader, path = "") => new Promise((resolve) => {
25
+ const entryPromises = [];
26
+ const readDirectoryEntries = () => {
27
+ reader.readEntries((entries) => {
28
+ if (entries.length === 0) {
29
+ resolve(Promise.all(entryPromises).then((entries$1) => entries$1.flat()));
30
+ return;
31
+ }
32
+ const promises = entries.map((entry) => {
33
+ if (!entry) return null;
34
+ if (isDirectoryEntry(entry)) return getDirectoryFiles(entry.createReader(), `${path}${entry.name}`);
35
+ if (isFileEntry(entry)) return new Promise((resolve$1) => {
36
+ entry.file((file) => {
37
+ resolve$1(addRelativePath(file, path));
38
+ });
39
+ });
40
+ }).filter((b) => b);
41
+ entryPromises.push(Promise.all(promises));
42
+ readDirectoryEntries();
43
+ });
44
+ };
45
+ readDirectoryEntries();
46
+ });
47
+
48
+ //#endregion
49
+ //#region src/shared/file-utils/data-url-to-blob.ts
50
+ function dataURItoBlob(uri) {
51
+ const binary = atob(uri.split(",")[1]);
52
+ const mimeString = uri.split(",")[0].split(":")[1].split(";")[0];
53
+ const buffer = new ArrayBuffer(binary.length);
54
+ const intArray = new Uint8Array(buffer);
55
+ for (let i = 0; i < binary.length; i++) intArray[i] = binary.charCodeAt(i);
56
+ return new Blob([buffer], { type: mimeString });
57
+ }
58
+
59
+ //#endregion
60
+ //#region src/shared/file-utils/download-file.ts
61
+ const BOM_REGEX = /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i;
62
+ const MAC_REGEX = /Macintosh/;
63
+ const APPLE_WEBKIT_REGEX = /AppleWebKit/;
64
+ const SAFARI_REGEX = /Safari/;
65
+ function getBlob(blobOrString, type, appendBOM) {
66
+ let blob = typeof blobOrString === "string" ? new Blob([blobOrString], { type }) : blobOrString;
67
+ if (appendBOM && BOM_REGEX.test(blob.type)) return new Blob([String.fromCharCode(65279), blob], { type: blob.type });
68
+ return blob;
69
+ }
70
+ function isMSEdge(win) {
71
+ return Boolean(win.navigator && win.navigator.msSaveOrOpenBlob);
72
+ }
73
+ function isWebView(win) {
74
+ return win.navigator && MAC_REGEX.test(win.navigator.userAgent) && APPLE_WEBKIT_REGEX.test(win.navigator.userAgent) && !SAFARI_REGEX.test(win.navigator.userAgent);
75
+ }
76
+ function downloadFile(options) {
77
+ const { file, win = window, type, name, appendBOM, revokeTimeout = 0 } = options;
78
+ const doc = win.document;
79
+ const blob = getBlob(file, type, appendBOM);
80
+ const fileName = (file instanceof File ? name || file.name : name) || "file-download";
81
+ if (isMSEdge(win)) {
82
+ win.navigator.msSaveOrOpenBlob(blob, fileName);
83
+ return;
84
+ }
85
+ const isMacOSWebView = isWebView(win);
86
+ const anchor = doc.createElement("a");
87
+ if ("download" in anchor && !isMacOSWebView) {
88
+ const url$1 = win.URL.createObjectURL(blob);
89
+ anchor.href = url$1;
90
+ anchor.rel = "noopener";
91
+ anchor.download = fileName;
92
+ anchor.style.display = "none";
93
+ doc.body.appendChild(anchor);
94
+ anchor.dispatchEvent(new win.MouseEvent("click"));
95
+ setTimeout(() => {
96
+ win.URL.revokeObjectURL(url$1);
97
+ anchor.remove();
98
+ }, revokeTimeout);
99
+ return;
100
+ }
101
+ const url = win.URL.createObjectURL(blob);
102
+ if (!win.open(url, "_blank")) win.location.href = url;
103
+ setTimeout(() => {
104
+ win.URL.revokeObjectURL(url);
105
+ }, revokeTimeout);
106
+ }
107
+
108
+ //#endregion
109
+ //#region src/shared/file-utils/get-accept-attr.ts
110
+ function isMIMEType(v) {
111
+ return v === "audio/*" || v === "video/*" || v === "image/*" || v === "text/*" || /\w+\/[-+.\w]+/g.test(v);
112
+ }
113
+ function isExt(v) {
114
+ return /^.*\.[\w]+$/.test(v);
115
+ }
116
+ const isValidMIME = (v) => isMIMEType(v) || isExt(v);
117
+ function getAcceptAttrString(accept) {
118
+ if (accept == null) return;
119
+ if (typeof accept === "string") return accept;
120
+ if (Array.isArray(accept)) return accept.filter(isValidMIME).join(",");
121
+ return Object.entries(accept).reduce((a, [mimeType, ext]) => [
122
+ ...a,
123
+ mimeType,
124
+ ...ext
125
+ ], []).filter(isValidMIME).join(",");
126
+ }
127
+
128
+ //#endregion
129
+ //#region src/shared/file-utils/get-file-data-url.ts
130
+ const getFileDataUrl = async (file) => {
131
+ const reader = new FileReader();
132
+ return new Promise((resolve, reject) => {
133
+ reader.onerror = () => {
134
+ reader.abort();
135
+ reject(/* @__PURE__ */ new Error("There was an error reading a file"));
136
+ };
137
+ reader.onloadend = () => {
138
+ const { result } = reader;
139
+ if (result instanceof ArrayBuffer) reject(/* @__PURE__ */ new Error("Expected DataURL as string from Blob/File, got ArrayBuffer"));
140
+ else resolve(result || void 0);
141
+ };
142
+ reader.readAsDataURL(file);
143
+ });
144
+ };
145
+
146
+ //#endregion
147
+ //#region src/shared/file-utils/get-total-file-size.ts
148
+ const getTotalFileSize = (files) => {
149
+ return files.reduce((acc, file) => acc + file.size, 0);
150
+ };
151
+
152
+ //#endregion
153
+ //#region src/shared/file-utils/is-file-equal.ts
154
+ const isFileEqual = (file1, file2) => {
155
+ return file1.name === file2.name && file1.size === file2.size && file1.type === file2.type;
156
+ };
157
+
158
+ //#endregion
159
+ //#region src/shared/file-utils/is-valid-file-size.ts
160
+ const isDefined = (v) => v !== void 0 && v !== null;
161
+ function isValidFileSize(file, minSize, maxSize) {
162
+ if (isDefined(file.size)) {
163
+ if (isDefined(minSize) && isDefined(maxSize)) {
164
+ if (file.size > maxSize) return [false, "FILE_TOO_LARGE"];
165
+ if (file.size < minSize) return [false, "FILE_TOO_SMALL"];
166
+ } else if (isDefined(minSize) && file.size < minSize) return [false, "FILE_TOO_SMALL"];
167
+ else if (isDefined(maxSize) && file.size > maxSize) return [false, "FILE_TOO_LARGE"];
168
+ }
169
+ return [true, null];
170
+ }
171
+
172
+ //#endregion
173
+ //#region src/shared/file-utils/mime-types.ts
174
+ const mimeTypes = "3g2_video/3gpp2[3gp,3gpp_video/3gpp[3mf_model/3mf[7z_application/x-7z-compressed[aac_audio/aac[ac_application/pkix-attr-cert[adp_audio/adpcm[adts_audio/aac[ai_application/postscript[aml_application/automationml-aml+xml[amlx_application/automationml-amlx+zip[amr_audio/amr[apk_application/vnd.android.package-archive[apng_image/apng[appcache,manifest_text/cache-manifest[appinstaller_application/appinstaller[appx_application/appx[appxbundle_application/appxbundle[asc_application/pgp-keys[atom_application/atom+xml[atomcat_application/atomcat+xml[atomdeleted_application/atomdeleted+xml[atomsvc_application/atomsvc+xml[au,snd_audio/basic[avi_video/x-msvideo[avci_image/avci[avcs_image/avcs[avif_image/avif[aw_application/applixware[bdoc_application/bdoc[bin,bpk,buffer,deb,deploy,dist,distz,dll,dmg,dms,dump,elc,exe,img,iso,lrf,mar,msi,msm,msp,pkg,so_application/octet-stream[bmp,dib_image/bmp[btf,btif_image/prs.btif[bz2_application/x-bzip2[c_text/x-c[ccxml_application/ccxml+xml[cdfx_application/cdfx+xml[cdmia_application/cdmi-capability[cdmic_application/cdmi-container[cdmid_application/cdmi-domain[cdmio_application/cdmi-object[cdmiq_application/cdmi-queue[cer_application/pkix-cert[cgm_image/cgm[cjs_application/node[class_application/java-vm[coffee,litcoffee_text/coffeescript[conf,def,in,ini,list,log,text,txt_text/plain[cpp,cxx,cc_text/x-c++src[cpl_application/cpl+xml[cpt_application/mac-compactpro[crl_application/pkix-crl[css_text/css[csv_text/csv[cu_application/cu-seeme[cwl_application/cwl[cww_application/prs.cww[davmount_application/davmount+xml[dbk_application/docbook+xml[doc_application/msword[docx_application/vnd.openxmlformats-officedocument.wordprocessingml.document[dsc_text/prs.lines.tag[dssc_application/dssc+der[dtd_application/xml-dtd[dwd_application/atsc-dwd+xml[ear,jar,war_application/java-archive[ecma_application/ecmascript[emf_image/emf[eml,mime_message/rfc822[emma_application/emma+xml[emotionml_application/emotionml+xml[eot_application/vnd.ms-fontobject[eps,ps_application/postscript[epub_application/epub+zip[exi_application/exi[exp_application/express[exr_image/aces[ez_application/andrew-inset[fdf_application/fdf[fdt_application/fdt+xml[fits_image/fits[flac_audio/flac[flv_video/x-flv[g3_image/g3fax[geojson_application/geo+json[gif_image/gif[glb_model/gltf-binary[gltf_model/gltf+json[gml_application/gml+xml[go_text/x-go[gpx_application/gpx+xml[gz_application/gzip[h_text/x-h[h261_video/h261[h263_video/h263[h264_video/h264[heic_image/heic[heics_image/heic-sequence[heif_image/heif[heifs_image/heif-sequence[htm,html,shtml_text/html[ico_image/x-icon[icns_image/x-icns[ics,ifb_text/calendar[iges,igs_model/iges[ink,inkml_application/inkml+xml[ipa_application/octet-stream[java_text/x-java-source[jp2,jpg2_image/jp2[jpeg,jpe,jpg_image/jpeg[jpf,jpx_image/jpx[jpm,jpgm_image/jpm[jpgv_video/jpeg[jph_image/jph[js,mjs_text/javascript[json_application/json[json5_application/json5[jsonld_application/ld+json[jsx_text/jsx[jxl_image/jxl[jxr_image/jxr[ktx_image/ktx[ktx2_image/ktx2[less_text/less[m1v,m2v,mpe,mpeg,mpg_video/mpeg[m4a_audio/mp4[m4v_video/x-m4v[md,markdown_text/markdown[mid,midi,kar,rmi_audio/midi[mkv_video/x-matroska[mp2,mp2a,mp3,mpga,m3a,m2a_audio/mpeg[mp4,mp4v,mpg4_video/mp4[mp4a_audio/mp4[mp4s,m4p_application/mp4[odp_application/vnd.oasis.opendocument.presentation[oda_application/oda[ods_application/vnd.oasis.opendocument.spreadsheet[odt_application/vnd.oasis.opendocument.text[oga,ogg,opus,spx_audio/ogg[ogv_video/ogg[ogx_application/ogg[otf_font/otf[p12,pfx_application/x-pkcs12[pdf_application/pdf[pem_application/x-pem-file[php_text/x-php[png_image/png[ppt_application/vnd.ms-powerpoint[pptx_application/vnd.openxmlformats-officedocument.presentationml.presentation[pskcxml_application/pskc+xml[psd_image/vnd.adobe.photoshop[py_text/x-python[qt,mov_video/quicktime[rar_application/vnd.rar[rdf_application/rdf+xml[rtf_text/rtf[sass_text/x-sass[scss_text/x-scss[sgm,sgml_text/sgml[sh_application/x-sh[svg,svgz_image/svg+xml[swf_application/x-shockwave-flash[tar_application/x-tar[tif,tiff_image/tiff[toml_application/toml[ts_video/mp2t[tsx_text/tsx[tsv_text/tab-separated-values[ttc_font/collection[ttf_font/ttf[vtt_text/vtt[wasm_application/wasm[wav_audio/wav[weba_audio/webm[webm_video/webm[webmanifest_application/manifest+json[webp_image/webp[wma_audio/x-ms-wma[wmv_video/x-ms-wmv[woff_font/woff[woff2_font/woff2[xls_application/vnd.ms-excel[xlsx_application/vnd.openxmlformats-officedocument.spreadsheetml.sheet[xml_application/xml[xz_application/x-xz[yaml,yml_text/yaml[zip_application/zip";
175
+ const mimeTypesMap = new Map(mimeTypes.split("[").flatMap((mime) => {
176
+ const [extensions, mimeType] = mime.split("_");
177
+ return extensions.split(",").map((ext) => [ext, mimeType]);
178
+ }));
179
+
180
+ //#endregion
181
+ //#region src/shared/file-utils/get-file-mime-type.ts
182
+ function getFileMimeType(name) {
183
+ const extension = name.split(".").pop();
184
+ return extension ? mimeTypesMap.get(extension) || null : null;
185
+ }
186
+
187
+ //#endregion
188
+ //#region src/shared/file-utils/is-valid-file-type.ts
189
+ function isFileAccepted(file, accept) {
190
+ if (file && accept) {
191
+ const types = Array.isArray(accept) ? accept : typeof accept === "string" ? accept.split(",") : [];
192
+ if (types.length === 0) return true;
193
+ const fileName = file.name || "";
194
+ const mimeType = (file.type || getFileMimeType(fileName) || "").toLowerCase();
195
+ const baseMimeType = mimeType.replace(/\/.*$/, "");
196
+ return types.some((type) => {
197
+ const validType = type.trim().toLowerCase();
198
+ if (validType.charAt(0) === ".") return fileName.toLowerCase().endsWith(validType);
199
+ if (validType.endsWith("/*")) return baseMimeType === validType.replace(/\/.*$/, "");
200
+ return mimeType === validType;
201
+ });
202
+ }
203
+ return true;
204
+ }
205
+ function isValidFileType(file, accept) {
206
+ const isAcceptable = file.type === "application/x-moz-file" || isFileAccepted(file, accept);
207
+ return [isAcceptable, isAcceptable ? null : "FILE_INVALID_TYPE"];
208
+ }
209
+
210
+ //#endregion
211
+ Object.defineProperty(exports, 'dataURItoBlob', {
212
+ enumerable: true,
213
+ get: function () {
214
+ return dataURItoBlob;
215
+ }
216
+ });
217
+ Object.defineProperty(exports, 'downloadFile', {
218
+ enumerable: true,
219
+ get: function () {
220
+ return downloadFile;
221
+ }
222
+ });
223
+ Object.defineProperty(exports, 'getAcceptAttrString', {
224
+ enumerable: true,
225
+ get: function () {
226
+ return getAcceptAttrString;
227
+ }
228
+ });
229
+ Object.defineProperty(exports, 'getFileDataUrl', {
230
+ enumerable: true,
231
+ get: function () {
232
+ return getFileDataUrl;
233
+ }
234
+ });
235
+ Object.defineProperty(exports, 'getFileEntries', {
236
+ enumerable: true,
237
+ get: function () {
238
+ return getFileEntries;
239
+ }
240
+ });
241
+ Object.defineProperty(exports, 'getFileMimeType', {
242
+ enumerable: true,
243
+ get: function () {
244
+ return getFileMimeType;
245
+ }
246
+ });
247
+ Object.defineProperty(exports, 'getTotalFileSize', {
248
+ enumerable: true,
249
+ get: function () {
250
+ return getTotalFileSize;
251
+ }
252
+ });
253
+ Object.defineProperty(exports, 'isFileEqual', {
254
+ enumerable: true,
255
+ get: function () {
256
+ return isFileEqual;
257
+ }
258
+ });
259
+ Object.defineProperty(exports, 'isValidFileSize', {
260
+ enumerable: true,
261
+ get: function () {
262
+ return isValidFileSize;
263
+ }
264
+ });
265
+ Object.defineProperty(exports, 'isValidFileType', {
266
+ enumerable: true,
267
+ get: function () {
268
+ return isValidFileType;
269
+ }
270
+ });
@@ -1,220 +1,12 @@
1
-
2
- //#region src/shared/file-utils/data-transfer.ts
3
- const getItemEntry = (item) => typeof item.getAsEntry === "function" ? item.getAsEntry() : typeof item.webkitGetAsEntry === "function" ? item.webkitGetAsEntry() : null;
4
- const isDirectoryEntry = (entry) => entry.isDirectory;
5
- const isFileEntry = (entry) => entry.isFile;
6
- const addRelativePath = (file, path) => {
7
- Object.defineProperty(file, "relativePath", { value: path ? `${path}/${file.name}` : file.name });
8
- return file;
9
- };
10
- const getFileEntries = (items, traverseDirectories) => Promise.all(Array.from(items).filter((item) => item.kind === "file").map((item) => {
11
- const entry = getItemEntry(item);
12
- if (!entry) return null;
13
- if (isDirectoryEntry(entry) && traverseDirectories) return getDirectoryFiles(entry.createReader(), `${entry.name}`);
14
- if (isFileEntry(entry) && typeof item.getAsFile === "function") {
15
- const file = item.getAsFile();
16
- return Promise.resolve(file ? addRelativePath(file, "") : null);
17
- }
18
- if (isFileEntry(entry)) return new Promise((resolve) => {
19
- entry.file((file) => {
20
- resolve(addRelativePath(file, ""));
21
- });
22
- });
23
- }).filter((b) => b));
24
- const getDirectoryFiles = (reader, path = "") => new Promise((resolve) => {
25
- const entryPromises = [];
26
- const readDirectoryEntries = () => {
27
- reader.readEntries((entries) => {
28
- if (entries.length === 0) {
29
- resolve(Promise.all(entryPromises).then((entries$1) => entries$1.flat()));
30
- return;
31
- }
32
- const promises = entries.map((entry) => {
33
- if (!entry) return null;
34
- if (isDirectoryEntry(entry)) return getDirectoryFiles(entry.createReader(), `${path}${entry.name}`);
35
- if (isFileEntry(entry)) return new Promise((resolve$1) => {
36
- entry.file((file) => {
37
- resolve$1(addRelativePath(file, path));
38
- });
39
- });
40
- }).filter((b) => b);
41
- entryPromises.push(Promise.all(promises));
42
- readDirectoryEntries();
43
- });
44
- };
45
- readDirectoryEntries();
46
- });
47
-
48
- //#endregion
49
- //#region src/shared/file-utils/data-url-to-blob.ts
50
- function dataURItoBlob(uri) {
51
- const binary = atob(uri.split(",")[1]);
52
- const mimeString = uri.split(",")[0].split(":")[1].split(";")[0];
53
- const buffer = new ArrayBuffer(binary.length);
54
- const intArray = new Uint8Array(buffer);
55
- for (let i = 0; i < binary.length; i++) intArray[i] = binary.charCodeAt(i);
56
- return new Blob([buffer], { type: mimeString });
57
- }
58
-
59
- //#endregion
60
- //#region src/shared/file-utils/download-file.ts
61
- const BOM_REGEX = /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i;
62
- const MAC_REGEX = /Macintosh/;
63
- const APPLE_WEBKIT_REGEX = /AppleWebKit/;
64
- const SAFARI_REGEX = /Safari/;
65
- function getBlob(blobOrString, type, appendBOM) {
66
- let blob = typeof blobOrString === "string" ? new Blob([blobOrString], { type }) : blobOrString;
67
- if (appendBOM && BOM_REGEX.test(blob.type)) return new Blob([String.fromCharCode(65279), blob], { type: blob.type });
68
- return blob;
69
- }
70
- function isMSEdge(win) {
71
- return Boolean(win.navigator && win.navigator.msSaveOrOpenBlob);
72
- }
73
- function isWebView(win) {
74
- return win.navigator && MAC_REGEX.test(win.navigator.userAgent) && APPLE_WEBKIT_REGEX.test(win.navigator.userAgent) && !SAFARI_REGEX.test(win.navigator.userAgent);
75
- }
76
- function downloadFile(options) {
77
- const { file, win = window, type, name, appendBOM, revokeTimeout = 0 } = options;
78
- const doc = win.document;
79
- const blob = getBlob(file, type, appendBOM);
80
- const fileName = (file instanceof File ? name || file.name : name) || "file-download";
81
- if (isMSEdge(win)) {
82
- win.navigator.msSaveOrOpenBlob(blob, fileName);
83
- return;
84
- }
85
- const isMacOSWebView = isWebView(win);
86
- const anchor = doc.createElement("a");
87
- if ("download" in anchor && !isMacOSWebView) {
88
- const url$1 = win.URL.createObjectURL(blob);
89
- anchor.href = url$1;
90
- anchor.rel = "noopener";
91
- anchor.download = fileName;
92
- anchor.style.display = "none";
93
- doc.body.appendChild(anchor);
94
- anchor.dispatchEvent(new win.MouseEvent("click"));
95
- setTimeout(() => {
96
- win.URL.revokeObjectURL(url$1);
97
- anchor.remove();
98
- }, revokeTimeout);
99
- return;
100
- }
101
- const url = win.URL.createObjectURL(blob);
102
- if (!win.open(url, "_blank")) win.location.href = url;
103
- setTimeout(() => {
104
- win.URL.revokeObjectURL(url);
105
- }, revokeTimeout);
106
- }
107
-
108
- //#endregion
109
- //#region src/shared/file-utils/get-accept-attr.ts
110
- function isMIMEType(v) {
111
- return v === "audio/*" || v === "video/*" || v === "image/*" || v === "text/*" || /\w+\/[-+.\w]+/g.test(v);
112
- }
113
- function isExt(v) {
114
- return /^.*\.[\w]+$/.test(v);
115
- }
116
- const isValidMIME = (v) => isMIMEType(v) || isExt(v);
117
- function getAcceptAttrString(accept) {
118
- if (accept == null) return;
119
- if (typeof accept === "string") return accept;
120
- if (Array.isArray(accept)) return accept.filter(isValidMIME).join(",");
121
- return Object.entries(accept).reduce((a, [mimeType, ext]) => [
122
- ...a,
123
- mimeType,
124
- ...ext
125
- ], []).filter(isValidMIME).join(",");
126
- }
127
-
128
- //#endregion
129
- //#region src/shared/file-utils/get-file-data-url.ts
130
- const getFileDataUrl = async (file) => {
131
- const reader = new FileReader();
132
- return new Promise((resolve, reject) => {
133
- reader.onerror = () => {
134
- reader.abort();
135
- reject(/* @__PURE__ */ new Error("There was an error reading a file"));
136
- };
137
- reader.onloadend = () => {
138
- const { result } = reader;
139
- if (result instanceof ArrayBuffer) reject(/* @__PURE__ */ new Error("Expected DataURL as string from Blob/File, got ArrayBuffer"));
140
- else resolve(result || void 0);
141
- };
142
- reader.readAsDataURL(file);
143
- });
144
- };
145
-
146
- //#endregion
147
- //#region src/shared/file-utils/get-total-file-size.ts
148
- const getTotalFileSize = (files) => {
149
- return files.reduce((acc, file) => acc + file.size, 0);
150
- };
151
-
152
- //#endregion
153
- //#region src/shared/file-utils/is-file-equal.ts
154
- const isFileEqual = (file1, file2) => {
155
- return file1.name === file2.name && file1.size === file2.size && file1.type === file2.type;
156
- };
157
-
158
- //#endregion
159
- //#region src/shared/file-utils/is-valid-file-size.ts
160
- const isDefined = (v) => v !== void 0 && v !== null;
161
- function isValidFileSize(file, minSize, maxSize) {
162
- if (isDefined(file.size)) {
163
- if (isDefined(minSize) && isDefined(maxSize)) {
164
- if (file.size > maxSize) return [false, "FILE_TOO_LARGE"];
165
- if (file.size < minSize) return [false, "FILE_TOO_SMALL"];
166
- } else if (isDefined(minSize) && file.size < minSize) return [false, "FILE_TOO_SMALL"];
167
- else if (isDefined(maxSize) && file.size > maxSize) return [false, "FILE_TOO_LARGE"];
168
- }
169
- return [true, null];
170
- }
171
-
172
- //#endregion
173
- //#region src/shared/file-utils/mime-types.ts
174
- const mimeTypes = "3g2_video/3gpp2[3gp,3gpp_video/3gpp[3mf_model/3mf[7z_application/x-7z-compressed[aac_audio/aac[ac_application/pkix-attr-cert[adp_audio/adpcm[adts_audio/aac[ai_application/postscript[aml_application/automationml-aml+xml[amlx_application/automationml-amlx+zip[amr_audio/amr[apk_application/vnd.android.package-archive[apng_image/apng[appcache,manifest_text/cache-manifest[appinstaller_application/appinstaller[appx_application/appx[appxbundle_application/appxbundle[asc_application/pgp-keys[atom_application/atom+xml[atomcat_application/atomcat+xml[atomdeleted_application/atomdeleted+xml[atomsvc_application/atomsvc+xml[au,snd_audio/basic[avi_video/x-msvideo[avci_image/avci[avcs_image/avcs[avif_image/avif[aw_application/applixware[bdoc_application/bdoc[bin,bpk,buffer,deb,deploy,dist,distz,dll,dmg,dms,dump,elc,exe,img,iso,lrf,mar,msi,msm,msp,pkg,so_application/octet-stream[bmp,dib_image/bmp[btf,btif_image/prs.btif[bz2_application/x-bzip2[c_text/x-c[ccxml_application/ccxml+xml[cdfx_application/cdfx+xml[cdmia_application/cdmi-capability[cdmic_application/cdmi-container[cdmid_application/cdmi-domain[cdmio_application/cdmi-object[cdmiq_application/cdmi-queue[cer_application/pkix-cert[cgm_image/cgm[cjs_application/node[class_application/java-vm[coffee,litcoffee_text/coffeescript[conf,def,in,ini,list,log,text,txt_text/plain[cpp,cxx,cc_text/x-c++src[cpl_application/cpl+xml[cpt_application/mac-compactpro[crl_application/pkix-crl[css_text/css[csv_text/csv[cu_application/cu-seeme[cwl_application/cwl[cww_application/prs.cww[davmount_application/davmount+xml[dbk_application/docbook+xml[doc_application/msword[docx_application/vnd.openxmlformats-officedocument.wordprocessingml.document[dsc_text/prs.lines.tag[dssc_application/dssc+der[dtd_application/xml-dtd[dwd_application/atsc-dwd+xml[ear,jar,war_application/java-archive[ecma_application/ecmascript[emf_image/emf[eml,mime_message/rfc822[emma_application/emma+xml[emotionml_application/emotionml+xml[eot_application/vnd.ms-fontobject[eps,ps_application/postscript[epub_application/epub+zip[exi_application/exi[exp_application/express[exr_image/aces[ez_application/andrew-inset[fdf_application/fdf[fdt_application/fdt+xml[fits_image/fits[flac_audio/flac[flv_video/x-flv[g3_image/g3fax[geojson_application/geo+json[gif_image/gif[glb_model/gltf-binary[gltf_model/gltf+json[gml_application/gml+xml[go_text/x-go[gpx_application/gpx+xml[gz_application/gzip[h_text/x-h[h261_video/h261[h263_video/h263[h264_video/h264[heic_image/heic[heics_image/heic-sequence[heif_image/heif[heifs_image/heif-sequence[htm,html,shtml_text/html[ico_image/x-icon[icns_image/x-icns[ics,ifb_text/calendar[iges,igs_model/iges[ink,inkml_application/inkml+xml[ipa_application/octet-stream[java_text/x-java-source[jp2,jpg2_image/jp2[jpeg,jpe,jpg_image/jpeg[jpf,jpx_image/jpx[jpm,jpgm_image/jpm[jpgv_video/jpeg[jph_image/jph[js,mjs_text/javascript[json_application/json[json5_application/json5[jsonld_application/ld+json[jsx_text/jsx[jxl_image/jxl[jxr_image/jxr[ktx_image/ktx[ktx2_image/ktx2[less_text/less[m1v,m2v,mpe,mpeg,mpg_video/mpeg[m4a_audio/mp4[m4v_video/x-m4v[md,markdown_text/markdown[mid,midi,kar,rmi_audio/midi[mkv_video/x-matroska[mp2,mp2a,mp3,mpga,m3a,m2a_audio/mpeg[mp4,mp4v,mpg4_video/mp4[mp4a_audio/mp4[mp4s,m4p_application/mp4[odp_application/vnd.oasis.opendocument.presentation[oda_application/oda[ods_application/vnd.oasis.opendocument.spreadsheet[odt_application/vnd.oasis.opendocument.text[oga,ogg,opus,spx_audio/ogg[ogv_video/ogg[ogx_application/ogg[otf_font/otf[p12,pfx_application/x-pkcs12[pdf_application/pdf[pem_application/x-pem-file[php_text/x-php[png_image/png[ppt_application/vnd.ms-powerpoint[pptx_application/vnd.openxmlformats-officedocument.presentationml.presentation[pskcxml_application/pskc+xml[psd_image/vnd.adobe.photoshop[py_text/x-python[qt,mov_video/quicktime[rar_application/vnd.rar[rdf_application/rdf+xml[rtf_text/rtf[sass_text/x-sass[scss_text/x-scss[sgm,sgml_text/sgml[sh_application/x-sh[svg,svgz_image/svg+xml[swf_application/x-shockwave-flash[tar_application/x-tar[tif,tiff_image/tiff[toml_application/toml[ts_video/mp2t[tsx_text/tsx[tsv_text/tab-separated-values[ttc_font/collection[ttf_font/ttf[vtt_text/vtt[wasm_application/wasm[wav_audio/wav[weba_audio/webm[webm_video/webm[webmanifest_application/manifest+json[webp_image/webp[wma_audio/x-ms-wma[wmv_video/x-ms-wmv[woff_font/woff[woff2_font/woff2[xls_application/vnd.ms-excel[xlsx_application/vnd.openxmlformats-officedocument.spreadsheetml.sheet[xml_application/xml[xz_application/x-xz[yaml,yml_text/yaml[zip_application/zip";
175
- const mimeTypesMap = new Map(mimeTypes.split("[").flatMap((mime) => {
176
- const [extensions, mimeType] = mime.split("_");
177
- return extensions.split(",").map((ext) => [ext, mimeType]);
178
- }));
179
-
180
- //#endregion
181
- //#region src/shared/file-utils/get-file-mime-type.ts
182
- function getFileMimeType(name) {
183
- const extension = name.split(".").pop();
184
- return extension ? mimeTypesMap.get(extension) || null : null;
185
- }
186
-
187
- //#endregion
188
- //#region src/shared/file-utils/is-valid-file-type.ts
189
- function isFileAccepted(file, accept) {
190
- if (file && accept) {
191
- const types = Array.isArray(accept) ? accept : typeof accept === "string" ? accept.split(",") : [];
192
- if (types.length === 0) return true;
193
- const fileName = file.name || "";
194
- const mimeType = (file.type || getFileMimeType(fileName) || "").toLowerCase();
195
- const baseMimeType = mimeType.replace(/\/.*$/, "");
196
- return types.some((type) => {
197
- const validType = type.trim().toLowerCase();
198
- if (validType.charAt(0) === ".") return fileName.toLowerCase().endsWith(validType);
199
- if (validType.endsWith("/*")) return baseMimeType === validType.replace(/\/.*$/, "");
200
- return mimeType === validType;
201
- });
202
- }
203
- return true;
204
- }
205
- function isValidFileType(file, accept) {
206
- const isAcceptable = file.type === "application/x-moz-file" || isFileAccepted(file, accept);
207
- return [isAcceptable, isAcceptable ? null : "FILE_INVALID_TYPE"];
208
- }
209
-
210
- //#endregion
211
- exports.dataURItoBlob = dataURItoBlob;
212
- exports.downloadFile = downloadFile;
213
- exports.getAcceptAttrString = getAcceptAttrString;
214
- exports.getFileDataUrl = getFileDataUrl;
215
- exports.getFileEntries = getFileEntries;
216
- exports.getFileMimeType = getFileMimeType;
217
- exports.getTotalFileSize = getTotalFileSize;
218
- exports.isFileEqual = isFileEqual;
219
- exports.isValidFileSize = isValidFileSize;
220
- exports.isValidFileType = isValidFileType;
1
+ const require_file_utils = require('./file-utils-G9_tYexo.cjs');
2
+
3
+ exports.dataURItoBlob = require_file_utils.dataURItoBlob;
4
+ exports.downloadFile = require_file_utils.downloadFile;
5
+ exports.getAcceptAttrString = require_file_utils.getAcceptAttrString;
6
+ exports.getFileDataUrl = require_file_utils.getFileDataUrl;
7
+ exports.getFileEntries = require_file_utils.getFileEntries;
8
+ exports.getFileMimeType = require_file_utils.getFileMimeType;
9
+ exports.getTotalFileSize = require_file_utils.getTotalFileSize;
10
+ exports.isFileEqual = require_file_utils.isFileEqual;
11
+ exports.isValidFileSize = require_file_utils.isValidFileSize;
12
+ exports.isValidFileType = require_file_utils.isValidFileType;
@@ -1,3 +1,5 @@
1
+ import { a as FileMimeTypeGroup, c as TextFileMimeType, i as FileMimeType, l as VideoFileMimeType, n as AudioFileMimeType, o as FontFileMimeType, r as FileError, s as ImageFileMimeType, t as ApplicationFileMimeType } from "./types-xyuh-a2-.cjs";
2
+
1
3
  //#region src/shared/file-utils/data-transfer.d.ts
2
4
  declare const getFileEntries: (items: DataTransferItemList, traverseDirectories: boolean | undefined) => Promise<(File | (File | null)[] | null | undefined)[]>;
3
5
  //#endregion
@@ -27,18 +29,6 @@ declare const getTotalFileSize: (files: File[]) => number;
27
29
  //#region src/shared/file-utils/is-file-equal.d.ts
28
30
  declare const isFileEqual: (file1: File, file2: File) => boolean;
29
31
  //#endregion
30
- //#region src/shared/file-utils/types.d.ts
31
- type AnyString = string & {};
32
- type FileError = "TOO_MANY_FILES" | "FILE_INVALID_TYPE" | "FILE_TOO_LARGE" | "FILE_TOO_SMALL" | "FILE_INVALID" | "FILE_EXISTS" | AnyString;
33
- type ImageFileMimeType = "image/png" | "image/gif" | "image/jpeg" | "image/svg+xml" | "image/webp" | "image/avif" | "image/heic" | "image/bmp";
34
- type ApplicationFileMimeType = "application/pdf" | "application/zip" | "application/json" | "application/xml" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/rtf" | "application/x-rar" | "application/x-7z-compressed" | "application/x-tar" | "application/vnd.microsoft.portable-executable";
35
- type TextFileMimeType = "text/css" | "text/csv" | "text/html" | "text/markdown" | "text/plain";
36
- type FontFileMimeType = "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "font/eot" | "font/svg";
37
- type VideoFileMimeType = "video/mp4" | "video/webm" | "video/ogg" | "video/quicktime" | "video/x-msvideo";
38
- type AudioFileMimeType = "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "audio/aac" | "audio/flac" | "audio/x-m4a";
39
- type FileMimeTypeGroup = "image/*" | "audio/*" | "video/*" | "text/*" | "application/*" | "font/*";
40
- type FileMimeType = ImageFileMimeType | ApplicationFileMimeType | TextFileMimeType | FontFileMimeType | VideoFileMimeType | AudioFileMimeType | FileMimeTypeGroup | AnyString;
41
- //#endregion
42
32
  //#region src/shared/file-utils/is-valid-file-size.d.ts
43
33
  declare function isValidFileSize(file: File, minSize?: number, maxSize?: number): [boolean, FileError | null];
44
34
  //#endregion
@@ -1,3 +1,5 @@
1
+ import { a as FileMimeTypeGroup, c as TextFileMimeType, i as FileMimeType, l as VideoFileMimeType, n as AudioFileMimeType, o as FontFileMimeType, r as FileError, s as ImageFileMimeType, t as ApplicationFileMimeType } from "./types-CsK6JMut.mjs";
2
+
1
3
  //#region src/shared/file-utils/data-transfer.d.ts
2
4
  declare const getFileEntries: (items: DataTransferItemList, traverseDirectories: boolean | undefined) => Promise<(File | (File | null)[] | null | undefined)[]>;
3
5
  //#endregion
@@ -27,18 +29,6 @@ declare const getTotalFileSize: (files: File[]) => number;
27
29
  //#region src/shared/file-utils/is-file-equal.d.ts
28
30
  declare const isFileEqual: (file1: File, file2: File) => boolean;
29
31
  //#endregion
30
- //#region src/shared/file-utils/types.d.ts
31
- type AnyString = string & {};
32
- type FileError = "TOO_MANY_FILES" | "FILE_INVALID_TYPE" | "FILE_TOO_LARGE" | "FILE_TOO_SMALL" | "FILE_INVALID" | "FILE_EXISTS" | AnyString;
33
- type ImageFileMimeType = "image/png" | "image/gif" | "image/jpeg" | "image/svg+xml" | "image/webp" | "image/avif" | "image/heic" | "image/bmp";
34
- type ApplicationFileMimeType = "application/pdf" | "application/zip" | "application/json" | "application/xml" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/rtf" | "application/x-rar" | "application/x-7z-compressed" | "application/x-tar" | "application/vnd.microsoft.portable-executable";
35
- type TextFileMimeType = "text/css" | "text/csv" | "text/html" | "text/markdown" | "text/plain";
36
- type FontFileMimeType = "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "font/eot" | "font/svg";
37
- type VideoFileMimeType = "video/mp4" | "video/webm" | "video/ogg" | "video/quicktime" | "video/x-msvideo";
38
- type AudioFileMimeType = "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "audio/aac" | "audio/flac" | "audio/x-m4a";
39
- type FileMimeTypeGroup = "image/*" | "audio/*" | "video/*" | "text/*" | "application/*" | "font/*";
40
- type FileMimeType = ImageFileMimeType | ApplicationFileMimeType | TextFileMimeType | FontFileMimeType | VideoFileMimeType | AudioFileMimeType | FileMimeTypeGroup | AnyString;
41
- //#endregion
42
32
  //#region src/shared/file-utils/is-valid-file-size.d.ts
43
33
  declare function isValidFileSize(file: File, minSize?: number, maxSize?: number): [boolean, FileError | null];
44
34
  //#endregion