ranuts 0.4.1-alpha.1 → 0.5.0

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 (331) hide show
  1. package/CLAUDE.md +178 -26
  2. package/README.de.md +62 -0
  3. package/README.es.md +62 -0
  4. package/README.fa.md +62 -0
  5. package/README.ja.md +62 -0
  6. package/README.ko.md +62 -0
  7. package/README.md +35 -90
  8. package/README.pt.md +62 -0
  9. package/README.zh-CN.md +35 -89
  10. package/dist/iife/index.iife.js +4 -0
  11. package/dist/iife/utils.iife.js +4 -0
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js +306 -1
  14. package/dist/src/_virtual/_rolldown/runtime/index.js +12 -0
  15. package/dist/src/conversation/engine.d.ts +109 -0
  16. package/dist/src/conversation/engine.js +101 -0
  17. package/dist/src/conversation/index.d.ts +12 -0
  18. package/dist/src/conversation/index.js +4 -0
  19. package/dist/src/conversation/types.d.ts +99 -0
  20. package/dist/src/stream/accumulator.d.ts +51 -0
  21. package/dist/src/stream/accumulator.js +79 -0
  22. package/dist/src/stream/budget.d.ts +89 -0
  23. package/dist/src/stream/budget.js +45 -0
  24. package/dist/src/stream/index.d.ts +25 -0
  25. package/dist/src/stream/index.js +11 -0
  26. package/dist/src/stream/sse.d.ts +51 -0
  27. package/dist/src/stream/sse.js +61 -0
  28. package/dist/src/stream/types.d.ts +106 -0
  29. package/dist/src/sw/index.js +52 -1
  30. package/dist/src/utils/async.js +49 -0
  31. package/dist/src/utils/audioRecorder.js +1121 -0
  32. package/dist/src/utils/behavior.js +9 -0
  33. package/dist/src/utils/binary.js +89 -0
  34. package/dist/src/utils/bom.d.ts +31 -9
  35. package/dist/src/utils/bom.js +165 -0
  36. package/dist/src/utils/bridge.js +310 -0
  37. package/dist/src/utils/canvas.d.ts +1 -0
  38. package/dist/src/utils/canvas.js +103 -0
  39. package/dist/src/utils/chain.js +76 -0
  40. package/dist/src/utils/color.d.ts +0 -1
  41. package/dist/src/utils/color.js +312 -0
  42. package/dist/src/utils/compose.js +22 -0
  43. package/dist/src/utils/console.js +22 -0
  44. package/dist/src/utils/debounce.js +18 -0
  45. package/dist/src/utils/device.d.ts +0 -9
  46. package/dist/src/utils/device.js +31 -0
  47. package/dist/src/utils/diff.d.ts +51 -0
  48. package/dist/src/utils/diff.js +110 -0
  49. package/dist/src/utils/dom.d.ts +1 -1
  50. package/dist/src/utils/dom.js +89 -0
  51. package/dist/src/utils/error.js +11 -0
  52. package/dist/src/utils/event.d.ts +3 -3
  53. package/dist/src/utils/event.js +39 -0
  54. package/dist/src/utils/file.js +14 -0
  55. package/dist/src/utils/func.js +4 -0
  56. package/dist/src/utils/i18n/index.js +79 -1
  57. package/dist/src/utils/idb.js +177 -0
  58. package/dist/src/utils/img.d.ts +1 -1
  59. package/dist/src/utils/img.js +68 -0
  60. package/dist/src/utils/index.d.ts +81 -77
  61. package/dist/src/utils/index.js +306 -1
  62. package/dist/src/utils/lang.d.ts +23 -6
  63. package/dist/src/utils/lang.js +42 -0
  64. package/dist/src/utils/localePath.js +48 -0
  65. package/dist/src/utils/memoize.d.ts +1 -7
  66. package/dist/src/utils/memoize.js +16 -0
  67. package/dist/src/utils/mimeType.js +841 -0
  68. package/dist/src/utils/monitor.js +84 -0
  69. package/dist/src/utils/network.js +117 -0
  70. package/dist/src/utils/noop.js +5 -0
  71. package/dist/src/utils/number.d.ts +20 -0
  72. package/dist/src/utils/number.js +185 -0
  73. package/dist/src/utils/obj.d.ts +2 -2
  74. package/dist/src/utils/obj.js +140 -0
  75. package/dist/src/utils/paginate.js +93 -0
  76. package/dist/src/utils/performance.js +26 -0
  77. package/dist/src/utils/placement.d.ts +42 -5
  78. package/dist/src/utils/placement.js +37 -0
  79. package/dist/src/utils/prefetch.js +69 -0
  80. package/dist/src/utils/queue.js +46 -0
  81. package/dist/src/utils/report.js +44 -0
  82. package/dist/src/utils/request.js +35 -0
  83. package/dist/src/utils/script.d.ts +1 -1
  84. package/dist/src/utils/script.js +46 -0
  85. package/dist/src/utils/scroll.d.ts +93 -0
  86. package/dist/src/utils/scroll.js +62 -0
  87. package/dist/src/utils/secure.js +36 -0
  88. package/dist/src/utils/segment.js +43 -0
  89. package/dist/src/utils/signal.d.ts +1 -1
  90. package/dist/src/utils/signal.js +13 -0
  91. package/dist/src/utils/speech.js +59 -0
  92. package/dist/src/utils/storage.js +53 -0
  93. package/dist/src/utils/str.d.ts +0 -6
  94. package/dist/src/utils/str.js +395 -0
  95. package/dist/src/utils/style.js +29 -0
  96. package/dist/src/utils/subscribe.js +58 -0
  97. package/dist/src/utils/throttle.js +17 -0
  98. package/dist/src/utils/time.d.ts +0 -21
  99. package/dist/src/utils/time.js +97 -0
  100. package/dist/src/utils/totp/sha/common.d.ts +1 -1
  101. package/dist/src/utils/totp/sha/common.js +201 -0
  102. package/dist/src/utils/totp/sha/converters.d.ts +1 -1
  103. package/dist/src/utils/totp/sha/converters.js +188 -0
  104. package/dist/src/utils/totp/sha/primitives_32.js +55 -0
  105. package/dist/src/utils/totp/sha/primitives_64.js +85 -0
  106. package/dist/src/utils/totp/sha/sha.d.ts +1 -1
  107. package/dist/src/utils/totp/sha/sha.js +30 -0
  108. package/dist/src/utils/totp/sha/sha1.d.ts +2 -2
  109. package/dist/src/utils/totp/sha/sha1.js +51 -0
  110. package/dist/src/utils/totp/sha/sha256.d.ts +2 -2
  111. package/dist/src/utils/totp/sha/sha256.js +56 -0
  112. package/dist/src/utils/totp/sha/sha3.d.ts +3 -3
  113. package/dist/src/utils/totp/sha/sha3.js +253 -0
  114. package/dist/src/utils/totp/sha/sha512.d.ts +3 -3
  115. package/dist/src/utils/totp/sha/sha512.js +177 -0
  116. package/dist/src/utils/totp/totp.js +49 -0
  117. package/dist/src/utils/tween.js +59 -0
  118. package/dist/src/utils/visual/application.d.ts +4 -4
  119. package/dist/src/utils/visual/application.js +42 -0
  120. package/dist/src/utils/visual/enums.js +19 -0
  121. package/dist/src/utils/visual/event/boundary.d.ts +2 -2
  122. package/dist/src/utils/visual/event/boundary.js +93 -0
  123. package/dist/src/utils/visual/event/event.d.ts +1 -1
  124. package/dist/src/utils/visual/event/event.js +34 -0
  125. package/dist/src/utils/visual/event/index.d.ts +4 -4
  126. package/dist/src/utils/visual/event/types.d.ts +2 -2
  127. package/dist/src/utils/visual/event/types.js +23 -0
  128. package/dist/src/utils/visual/graphics/graphics.d.ts +8 -8
  129. package/dist/src/utils/visual/graphics/graphics.js +168 -0
  130. package/dist/src/utils/visual/graphics/graphicsData.d.ts +3 -3
  131. package/dist/src/utils/visual/graphics/graphicsData.js +12 -0
  132. package/dist/src/utils/visual/graphics/graphicsGeometry.d.ts +7 -7
  133. package/dist/src/utils/visual/graphics/graphicsGeometry.js +39 -0
  134. package/dist/src/utils/visual/graphics/index.d.ts +3 -3
  135. package/dist/src/utils/visual/index.d.ts +8 -8
  136. package/dist/src/utils/visual/index.js +20 -1
  137. package/dist/src/utils/visual/math/bezier.js +15 -0
  138. package/dist/src/utils/visual/math/enums.js +6 -0
  139. package/dist/src/utils/visual/math/index.d.ts +4 -4
  140. package/dist/src/utils/visual/math/matrix.d.ts +1 -1
  141. package/dist/src/utils/visual/math/matrix.js +59 -0
  142. package/dist/src/utils/visual/math/transform.d.ts +2 -2
  143. package/dist/src/utils/visual/math/transform.js +50 -0
  144. package/dist/src/utils/visual/render/batchRenderer.d.ts +4 -4
  145. package/dist/src/utils/visual/render/batchRenderer.js +59 -0
  146. package/dist/src/utils/visual/render/canvasRenderer.d.ts +3 -3
  147. package/dist/src/utils/visual/render/canvasRenderer.js +17 -0
  148. package/dist/src/utils/visual/render/filter.d.ts +1 -1
  149. package/dist/src/utils/visual/render/filter.js +92 -0
  150. package/dist/src/utils/visual/render/index.d.ts +2 -2
  151. package/dist/src/utils/visual/render/index.js +20 -0
  152. package/dist/src/utils/visual/render/render.d.ts +4 -4
  153. package/dist/src/utils/visual/render/render.js +19 -0
  154. package/dist/src/utils/visual/render/renderTarget.js +28 -0
  155. package/dist/src/utils/visual/render/utils/batch/index.d.ts +4 -4
  156. package/dist/src/utils/visual/render/utils/batch/index.js +88 -0
  157. package/dist/src/utils/visual/render/utils/earcut.js +328 -0
  158. package/dist/src/utils/visual/render/utils/float.js +65 -0
  159. package/dist/src/utils/visual/render/utils/index.js +50 -0
  160. package/dist/src/utils/visual/render/utils/verticy.d.ts +2 -2
  161. package/dist/src/utils/visual/render/utils/verticy.js +162 -0
  162. package/dist/src/utils/visual/render/utils/webgl/initShader.d.ts +1 -1
  163. package/dist/src/utils/visual/render/utils/webgl/initShader.js +31 -0
  164. package/dist/src/utils/visual/render/utils/webgl/shaders.js +22 -0
  165. package/dist/src/utils/visual/render/utils/webgpu/shaders.js +32 -0
  166. package/dist/src/utils/visual/render/webGPURenderer.d.ts +2 -2
  167. package/dist/src/utils/visual/render/webGPURenderer.js +185 -0
  168. package/dist/src/utils/visual/render/webGlRenderer.d.ts +2 -2
  169. package/dist/src/utils/visual/render/webGlRenderer.js +88 -0
  170. package/dist/src/utils/visual/shape/circle.d.ts +3 -3
  171. package/dist/src/utils/visual/shape/circle.js +17 -0
  172. package/dist/src/utils/visual/shape/ellipse.d.ts +3 -3
  173. package/dist/src/utils/visual/shape/ellipse.js +18 -0
  174. package/dist/src/utils/visual/shape/index.d.ts +6 -6
  175. package/dist/src/utils/visual/shape/polygon.d.ts +3 -3
  176. package/dist/src/utils/visual/shape/polygon.js +29 -0
  177. package/dist/src/utils/visual/shape/rectangle.d.ts +3 -3
  178. package/dist/src/utils/visual/shape/rectangle.js +18 -0
  179. package/dist/src/utils/visual/shape/roundedRectangle.d.ts +3 -3
  180. package/dist/src/utils/visual/shape/roundedRectangle.js +32 -0
  181. package/dist/src/utils/visual/shape/shape.d.ts +2 -2
  182. package/dist/src/utils/visual/shape/shape.js +5 -0
  183. package/dist/src/utils/visual/style/fill.js +18 -0
  184. package/dist/src/utils/visual/style/index.d.ts +2 -2
  185. package/dist/src/utils/visual/style/line.d.ts +2 -2
  186. package/dist/src/utils/visual/style/line.js +18 -0
  187. package/dist/src/utils/visual/types.d.ts +1 -1
  188. package/dist/src/utils/visual/vertex/container.d.ts +5 -5
  189. package/dist/src/utils/visual/vertex/container.js +54 -0
  190. package/dist/src/utils/visual/vertex/point.js +37 -0
  191. package/dist/src/utils/visual/vertex/vertex.d.ts +7 -7
  192. package/dist/src/utils/visual/vertex/vertex.js +76 -0
  193. package/dist/src/utils/worker.js +89 -0
  194. package/dist/src/utils/zip.js +161 -0
  195. package/dist/src/vnode/h.d.ts +1 -1
  196. package/dist/src/vnode/h.js +22 -0
  197. package/dist/src/vnode/hooks.d.ts +1 -1
  198. package/dist/src/vnode/htmlDomApi.js +94 -0
  199. package/dist/src/vnode/index.d.ts +16 -16
  200. package/dist/src/vnode/index.js +28 -1
  201. package/dist/src/vnode/init.d.ts +1 -1
  202. package/dist/src/vnode/init.js +104 -0
  203. package/dist/src/vnode/is.d.ts +1 -1
  204. package/dist/src/vnode/is.js +20 -0
  205. package/dist/src/vnode/modules/attributes.d.ts +1 -1
  206. package/dist/src/vnode/modules/attributes.js +21 -0
  207. package/dist/src/vnode/modules/class.d.ts +1 -1
  208. package/dist/src/vnode/modules/class.js +18 -0
  209. package/dist/src/vnode/modules/index.js +15 -0
  210. package/dist/src/vnode/modules/listeners.d.ts +1 -1
  211. package/dist/src/vnode/modules/listeners.js +36 -0
  212. package/dist/src/vnode/modules/props.d.ts +1 -1
  213. package/dist/src/vnode/modules/props.js +17 -0
  214. package/dist/src/vnode/modules/style.d.ts +1 -1
  215. package/dist/src/vnode/modules/style.js +52 -0
  216. package/dist/src/vnode/vnode.d.ts +6 -6
  217. package/dist/src/vnode/vnode.js +13 -0
  218. package/dist/third-party/jschardet/LICENSE.txt +504 -0
  219. package/dist/third-party/jschardet/NOTICE.txt +33 -0
  220. package/docs/API.md +86 -65
  221. package/package.json +20 -15
  222. package/dist/bin/generate-api-docs.d.ts +0 -1
  223. package/dist/build/build.es.d.ts +0 -2
  224. package/dist/build/build.umd.d.ts +0 -2
  225. package/dist/build/build.umd.node.d.ts +0 -2
  226. package/dist/build/build.umd.utils.d.ts +0 -2
  227. package/dist/chain-CTywmh_H.js +0 -1
  228. package/dist/color-B_KMM8UX.js +0 -1
  229. package/dist/enums-BAgbyGdH.js +0 -1
  230. package/dist/examples/clone-deep-example.d.ts +0 -1
  231. package/dist/examples/is-equal-example.d.ts +0 -1
  232. package/dist/i18n-BJIS1fR1.js +0 -1
  233. package/dist/plugins/vite-plugins-banner.d.ts +0 -2
  234. package/dist/rolldown-runtime-I3TIJKkN.js +0 -1
  235. package/dist/src/node/appendFile.d.ts +0 -7
  236. package/dist/src/node/body.d.ts +0 -9
  237. package/dist/src/node/color.d.ts +0 -7
  238. package/dist/src/node/command.d.ts +0 -8
  239. package/dist/src/node/ctx2req.d.ts +0 -5
  240. package/dist/src/node/fileInfo.d.ts +0 -7
  241. package/dist/src/node/fs.d.ts +0 -7
  242. package/dist/src/node/get.d.ts +0 -10
  243. package/dist/src/node/getIPAdress.d.ts +0 -1
  244. package/dist/src/node/index.d.ts +0 -25
  245. package/dist/src/node/index.js +0 -1
  246. package/dist/src/node/isColorSupported.d.ts +0 -2
  247. package/dist/src/node/paresUrl.d.ts +0 -19
  248. package/dist/src/node/readDir.d.ts +0 -6
  249. package/dist/src/node/readFile.d.ts +0 -9
  250. package/dist/src/node/router.d.ts +0 -42
  251. package/dist/src/node/send.d.ts +0 -7
  252. package/dist/src/node/server.d.ts +0 -18
  253. package/dist/src/node/startTask.d.ts +0 -2
  254. package/dist/src/node/stream.d.ts +0 -15
  255. package/dist/src/node/taskEnd.d.ts +0 -2
  256. package/dist/src/node/traverse.d.ts +0 -17
  257. package/dist/src/node/watchFile.d.ts +0 -8
  258. package/dist/src/node/writeFile.d.ts +0 -8
  259. package/dist/src/node/ws.d.ts +0 -8
  260. package/dist/src/utils/visual/render/utils/batch/index.test.d.ts +0 -1
  261. package/dist/src/utils/visual/render/utils/index.test.d.ts +0 -1
  262. package/dist/test/binary.test.d.ts +0 -1
  263. package/dist/test/bridge.test.d.ts +0 -1
  264. package/dist/test/canvas.test.d.ts +0 -1
  265. package/dist/test/clearBr.test.d.ts +0 -1
  266. package/dist/test/cloneDeep.test.d.ts +0 -1
  267. package/dist/test/color.test.d.ts +0 -1
  268. package/dist/test/command.test.d.ts +0 -1
  269. package/dist/test/encodeUrl.test.d.ts +0 -1
  270. package/dist/test/escapeHtml.test.d.ts +0 -1
  271. package/dist/test/is-equal.test.d.ts +0 -1
  272. package/dist/test/mimeType.test.d.ts +0 -1
  273. package/dist/test/package-exports.test.d.ts +0 -1
  274. package/dist/test/server.test.d.ts +0 -1
  275. package/dist/test/status.test.d.ts +0 -1
  276. package/dist/test/sw.test.d.ts +0 -1
  277. package/dist/test/totp.test.d.ts +0 -1
  278. package/dist/test/tween.test.d.ts +0 -1
  279. package/dist/test/utils/async.test.d.ts +0 -1
  280. package/dist/test/utils/autosize.test.d.ts +0 -1
  281. package/dist/test/utils/color-grade.test.d.ts +0 -1
  282. package/dist/test/utils/compose.test.d.ts +0 -1
  283. package/dist/test/utils/event.test.d.ts +0 -1
  284. package/dist/test/utils/file-read.test.d.ts +0 -1
  285. package/dist/test/utils/format.test.d.ts +0 -1
  286. package/dist/test/utils/i18n.test.d.ts +0 -1
  287. package/dist/test/utils/idb-collection.test.d.ts +0 -1
  288. package/dist/test/utils/idb.test.d.ts +0 -1
  289. package/dist/test/utils/instrumentation.test.d.ts +0 -1
  290. package/dist/test/utils/interp.test.d.ts +0 -1
  291. package/dist/test/utils/lang.test.d.ts +0 -1
  292. package/dist/test/utils/locale-path.test.d.ts +0 -1
  293. package/dist/test/utils/media-query.test.d.ts +0 -1
  294. package/dist/test/utils/mergeObj.test.d.ts +0 -1
  295. package/dist/test/utils/number-parse.test.d.ts +0 -1
  296. package/dist/test/utils/paginate.test.d.ts +0 -1
  297. package/dist/test/utils/placement.test.d.ts +0 -1
  298. package/dist/test/utils/prefetch.test.d.ts +0 -1
  299. package/dist/test/utils/query-storage.test.d.ts +0 -1
  300. package/dist/test/utils/queue.test.d.ts +0 -1
  301. package/dist/test/utils/report-config.test.d.ts +0 -1
  302. package/dist/test/utils/report-image.test.d.ts +0 -1
  303. package/dist/test/utils/secure.test.d.ts +0 -1
  304. package/dist/test/utils/segment.test.d.ts +0 -1
  305. package/dist/test/utils/signal-once.test.d.ts +0 -1
  306. package/dist/test/utils/single-flight.test.d.ts +0 -1
  307. package/dist/test/utils/speech.test.d.ts +0 -1
  308. package/dist/test/utils/text-boundary.test.d.ts +0 -1
  309. package/dist/test/utils/time.test.d.ts +0 -1
  310. package/dist/test/utils/timing.test.d.ts +0 -1
  311. package/dist/test/utils/truncate.test.d.ts +0 -1
  312. package/dist/test/utils/visual/filter.test.d.ts +0 -1
  313. package/dist/test/utils/worker-client.test.d.ts +0 -1
  314. package/dist/test/utils/worker-serve.test.d.ts +0 -1
  315. package/dist/test/utils/zip.test.d.ts +0 -1
  316. package/dist/test/visual/math.test.d.ts +0 -1
  317. package/dist/test/visual-application.test.d.ts +0 -1
  318. package/dist/test/visual-batch.test.d.ts +0 -1
  319. package/dist/test/visual-math.test.d.ts +0 -1
  320. package/dist/test/vnode/index.d.ts +0 -1
  321. package/dist/test/vnode/server.d.ts +0 -2
  322. package/dist/test/vnode/vnode.d.ts +0 -1
  323. package/dist/test/vnode.test.d.ts +0 -1
  324. package/dist/test/websocket.test.d.ts +0 -1
  325. package/dist/test/writeFile.test.d.ts +0 -1
  326. package/dist/umd/index.umd.cjs +0 -1
  327. package/dist/umd/node/node.umd.cjs +0 -1
  328. package/dist/umd/utils/utils.umd.cjs +0 -1
  329. package/dist/utils-BNwhohXq.js +0 -1
  330. package/dist/vite.config.d.ts +0 -8
  331. package/dist/vitest.config.d.ts +0 -2
@@ -0,0 +1,88 @@
1
+ import "../../../enums.js";
2
+ var g = (t, s) => {
3
+ if (s.worldAlpha <= 0 || !s.visible) return;
4
+ s.buildBatches(t);
5
+ const r = s.children;
6
+ for (let e = 0; e < r.length; e++) g(t, r[e]);
7
+ }, b = (t, s) => {
8
+ if (s.worldAlpha <= 0 || !s.visible) return;
9
+ s.updateBatches(t);
10
+ const r = s.children;
11
+ for (let e = 0; e < r.length; e++) b(t, r[e]);
12
+ }, y = class {
13
+ vertexCount = 0;
14
+ indexCount = 0;
15
+ rgba = 0;
16
+ vertexStart = 0;
17
+ indexStart = 0;
18
+ }, E = class {
19
+ style;
20
+ vertexStart = 0;
21
+ indexStart = 0;
22
+ vertexCount = 0;
23
+ indexCount = 0;
24
+ constructor(t) {
25
+ this.style = t;
26
+ }
27
+ start(t, s) {
28
+ this.vertexStart = t, this.indexStart = s;
29
+ }
30
+ end(t, s) {
31
+ this.vertexCount = t, this.indexCount = s;
32
+ }
33
+ }, S = class {
34
+ idx = 0;
35
+ reset() {
36
+ this.idx = 0;
37
+ }
38
+ }, B = class extends S {
39
+ batches = [];
40
+ constructor() {
41
+ super();
42
+ }
43
+ getOne() {
44
+ return this.batches[this.idx] || (this.batches[this.idx] = new C()), this.batches[this.idx++];
45
+ }
46
+ }, C = class extends y {
47
+ vertexOffset = 0;
48
+ indexOffset = 0;
49
+ graphics;
50
+ packVertices(t, s) {
51
+ const e = this.graphics.geometry.vertices.data, c = this.vertexOffset;
52
+ for (let i = 0; i < this.vertexCount; i++) {
53
+ const h = e[(c + i) * 2], o = e[(c + i) * 2 + 1], { a: l, b: v, c: a, d: n, tx: d, ty: x } = this.graphics.worldTransform, f = l * h + a * o + d, u = v * h + n * o + x, p = (this.vertexStart + i) * 3;
54
+ t[p] = f, t[p + 1] = u, s[p + 2] = this.rgba;
55
+ }
56
+ }
57
+ packIndices(t) {
58
+ const s = this.graphics.geometry.indices.data, r = this.indexOffset;
59
+ for (let e = 0; e < this.indexCount; e++) t[this.indexStart + e] = s[e + r] + this.vertexStart;
60
+ }
61
+ updateVertices(t) {
62
+ const r = this.graphics.geometry.vertices.data, e = this.vertexOffset, { a: c, b: i, c: h, d: o, tx: l, ty: v } = this.graphics.worldTransform;
63
+ for (let a = 0; a < this.vertexCount; a++) {
64
+ const n = r[(e + a) * 2], d = r[(e + a) * 2 + 1], x = (this.vertexStart + a) * 3;
65
+ t[x] = c * n + h * d + l, t[x + 1] = i * n + o * d + v;
66
+ }
67
+ }
68
+ }, O = class {
69
+ batchesMap = { graphics: new B() };
70
+ get(t) {
71
+ return this.batchesMap[t].getOne();
72
+ }
73
+ reset() {
74
+ Object.values(this.batchesMap).forEach((t) => {
75
+ t.reset();
76
+ });
77
+ }
78
+ }, w = new O();
79
+ export {
80
+ y as Batch,
81
+ E as BatchPart,
82
+ S as BatchPool,
83
+ C as GraphicsBatch,
84
+ B as GraphicsBatchPool,
85
+ w as batchPool,
86
+ g as buildArray,
87
+ b as updateArray
88
+ };
@@ -0,0 +1,328 @@
1
+ var L = /* @__PURE__ */ new Set(), C = !1;
2
+ function ge(e, n, t = 2) {
3
+ const r = n && n.length, o = r ? n[0] * t : e.length;
4
+ L.size && L.clear();
5
+ let x = G(e, 0, o, t, !0);
6
+ const i = [];
7
+ if (!x || x.next === x.prev) return i;
8
+ let f = 0, l = 0, c = 0;
9
+ if (r && (x = ne(e, n, x, t)), e.length > 80 * t) {
10
+ f = e[0], l = e[1];
11
+ let y = f, m = l;
12
+ for (let h = t; h < o; h += t) {
13
+ const s = e[h], u = e[h + 1];
14
+ s < f && (f = s), u < l && (l = u), s > y && (y = s), u > m && (m = u);
15
+ }
16
+ c = Math.max(y - f, m - l), c = c !== 0 ? 32767 / c : 0;
17
+ }
18
+ return F(x, i, f, l, c), i;
19
+ }
20
+ function G(e, n, t, r, o) {
21
+ let x = null;
22
+ if (o === pe(e, n, t, r) > 0) for (let i = n; i < t; i += r) x = d(i / r | 0, e[i], e[i + 1], x);
23
+ else for (let i = t - r; i >= n; i -= r) x = d(i / r | 0, e[i], e[i + 1], x);
24
+ return x && I(x, x.next) && (Y(x), x = x.next), x;
25
+ }
26
+ function A(e, n = e) {
27
+ const t = n === e;
28
+ let r = e, o;
29
+ do
30
+ o = !1, r !== r.next && (L.size === 0 || !L.has(r)) && (I(r, r.next) || p(r.prev, r, r.next) === 0) ? ((t || r === n) && (n = r.prev), C = !0, Y(r), r = r.prev, o = !0) : (t || r !== n) && (r = r.next, o = !t);
31
+ while (o || r !== n);
32
+ return n;
33
+ }
34
+ function F(e, n, t, r, o) {
35
+ o && ue(e, t, r, o);
36
+ let x = e, i = !1;
37
+ for (; e.prev !== e.next; ) {
38
+ const f = e.prev, l = e.next;
39
+ if (p(f, e, l) < 0 && (o ? q(e, t, r, o) : b(e))) {
40
+ n.push(f.i, e.i, l.i), Y(e), e = l, x = l;
41
+ continue;
42
+ }
43
+ if (e = l, e === x) {
44
+ if (C = !1, e = A(e), C) {
45
+ x = e;
46
+ continue;
47
+ }
48
+ if (!i) {
49
+ e = ee(e, n), x = e, i = !0;
50
+ continue;
51
+ }
52
+ te(e, n, t, r, o);
53
+ break;
54
+ }
55
+ }
56
+ }
57
+ function b(e) {
58
+ const n = e.prev, t = e, r = e.next, o = n.x, x = t.x, i = r.x, f = n.y, l = t.y, c = r.y, y = Math.min(o, x, i), m = Math.min(f, l, c), h = Math.max(o, x, i), s = Math.max(f, l, c);
59
+ let u = r.next;
60
+ for (; u !== n; ) {
61
+ if (u.x >= y && u.x <= h && u.y >= m && u.y <= s && !(o === u.x && f === u.y) && X(o, f, x, l, i, c, u.x, u.y) && p(u.prev, u, u.next) >= 0) return !1;
62
+ u = u.next;
63
+ }
64
+ return !0;
65
+ }
66
+ function q(e, n, t, r) {
67
+ const o = e.prev, x = e, i = e.next, f = o.x, l = x.x, c = i.x, y = o.y, m = x.y, h = i.y, s = Math.min(f, l, c), u = Math.min(y, m, h), M = Math.max(f, l, c), j = Math.max(y, m, h), _ = R(s, u, n, t, r), $ = R(M, j, n, t, r);
68
+ let g = e.prevZ;
69
+ for (; g && g.z >= _; ) {
70
+ if (g.x >= s && g.x <= M && g.y >= u && g.y <= j && g !== i && !(f === g.x && y === g.y) && X(f, y, l, m, c, h, g.x, g.y) && p(g.prev, g, g.next) >= 0) return !1;
71
+ g = g.prevZ;
72
+ }
73
+ let w = e.nextZ;
74
+ for (; w && w.z <= $; ) {
75
+ if (w.x >= s && w.x <= M && w.y >= u && w.y <= j && w !== i && !(f === w.x && y === w.y) && X(f, y, l, m, c, h, w.x, w.y) && p(w.prev, w, w.next) >= 0) return !1;
76
+ w = w.nextZ;
77
+ }
78
+ return !0;
79
+ }
80
+ function ee(e, n) {
81
+ let t = e, r = !1;
82
+ do {
83
+ const o = t.prev, x = t.next.next;
84
+ Q(o, t, t.next, x, !1) && U(o, x) && U(x, o) && (n.push(o.i, t.i, x.i), Y(t), Y(t.next), t = e = x, r = !0), t = t.next;
85
+ } while (t !== e);
86
+ return r ? A(t) : t;
87
+ }
88
+ function te(e, n, t, r, o) {
89
+ let x = e;
90
+ do {
91
+ let i = x.next.next;
92
+ for (; i !== x.prev; ) {
93
+ if (x.i !== i.i && se(x, i)) {
94
+ let f = W(x, i);
95
+ x = A(x, x.next), f = A(f, f.next), F(x, n, t, r, o), F(f, n, t, r, o);
96
+ return;
97
+ }
98
+ i = i.next;
99
+ }
100
+ x = x.next;
101
+ } while (x !== e);
102
+ }
103
+ var O = !1;
104
+ function ne(e, n, t, r) {
105
+ const o = [];
106
+ for (let x = 0, i = n.length; x < i; x++) {
107
+ const f = G(e, n[x] * r, x < i - 1 ? n[x + 1] * r : e.length, r, !1);
108
+ f === f.next && L.add(f), o.push(ye(f));
109
+ }
110
+ o.sort(xe), ie(e.length / r, n.length), N(t, t), O = !0;
111
+ for (let x = 0; x < o.length; x++) t = re(o[x], t);
112
+ return O = !1, A(t);
113
+ }
114
+ function xe(e, n) {
115
+ return e.x - n.x || e.y - n.y || (e.next.y - e.y) / (e.next.x - e.x) - (n.next.y - n.y) / (n.next.x - n.x);
116
+ }
117
+ function re(e, n) {
118
+ const t = fe(e, n);
119
+ if (!t) return n;
120
+ const r = W(t, e), o = r.next;
121
+ return N(t, o.next), A(r, r.next), A(t, t.next);
122
+ }
123
+ var J = 16, v = /* @__PURE__ */ new Float64Array(0), E = 0, D = [], K = [];
124
+ function ie(e, n) {
125
+ const t = Math.ceil((e + 2 * n) / J) + n + 2;
126
+ v.length < t * 4 && (v = new Float64Array(t * 4)), E = 0;
127
+ }
128
+ function N(e, n) {
129
+ let t = e;
130
+ do {
131
+ const r = E++;
132
+ D[r] = t;
133
+ let o = 1 / 0, x = 1 / 0, i = -1 / 0, f = -1 / 0, l = 0;
134
+ do {
135
+ const y = t.next;
136
+ t.z = r, t.x < o && (o = t.x), t.x > i && (i = t.x), t.y < x && (x = t.y), t.y > f && (f = t.y), y.x < o && (o = y.x), y.x > i && (i = y.x), y.y < x && (x = y.y), y.y > f && (f = y.y), t = y;
137
+ } while (++l < J && t !== n);
138
+ K[r] = t;
139
+ const c = r * 4;
140
+ v[c] = o, v[c + 1] = x, v[c + 2] = i, v[c + 3] = f;
141
+ } while (t !== n);
142
+ }
143
+ function oe(e, n) {
144
+ const t = e.z * 4;
145
+ n.x < v[t] && (v[t] = n.x), n.y < v[t + 1] && (v[t + 1] = n.y), n.x > v[t + 2] && (v[t + 2] = n.x), n.y > v[t + 3] && (v[t + 3] = n.y);
146
+ }
147
+ function T(e) {
148
+ let n = K[e];
149
+ for (; n.prev.next !== n; ) n = n.next;
150
+ return K[e] = n, n;
151
+ }
152
+ function V(e) {
153
+ let n = D[e];
154
+ for (; n.prev.next !== n; ) n = n.next;
155
+ return D[e] = n, n;
156
+ }
157
+ function fe(e, n) {
158
+ let t = n;
159
+ const r = e.x, o = e.y;
160
+ let x = -1 / 0, i;
161
+ if (I(e, t)) return t;
162
+ for (let h = 0, s = 0; h < E; h++, s += 4) {
163
+ if (o < v[s + 1] || o > v[s + 3] || v[s] > r || v[s + 2] <= x) continue;
164
+ const u = T(h);
165
+ t = V(h);
166
+ do {
167
+ if (t.prev.next === t) {
168
+ if (I(e, t.next)) return t.next;
169
+ if (o <= t.y && o >= t.next.y && t.next.y !== t.y) {
170
+ const M = t.x + (o - t.y) * (t.next.x - t.x) / (t.next.y - t.y);
171
+ if (M <= r && M > x && (x = M, i = t.x < t.next.x ? t : t.next, M === r))
172
+ return i;
173
+ }
174
+ }
175
+ t = t.next;
176
+ } while (t !== u);
177
+ }
178
+ if (!i) return null;
179
+ const f = i.x, l = i.y, c = Math.min(o, l), y = Math.max(o, l);
180
+ let m = 1 / 0;
181
+ for (let h = 0, s = 0; h < E; h++, s += 4) {
182
+ if (v[s + 2] < f || v[s] > r || v[s + 3] < c || v[s + 1] > y) continue;
183
+ const u = T(h);
184
+ t = V(h);
185
+ do {
186
+ if (t.prev.next === t && r >= t.x && t.x >= f && r !== t.x && X(o < l ? r : x, o, f, l, o < l ? x : r, o, t.x, t.y)) {
187
+ const M = Math.abs(o - t.y) / (r - t.x);
188
+ (U(t, e) || t.y === o && t.next.y === o && t.next.x > r) && (M < m || M === m && (t.x > i.x || t.x === i.x && le(i, t))) && (i = t, m = M);
189
+ }
190
+ t = t.next;
191
+ } while (t !== u);
192
+ }
193
+ return i;
194
+ }
195
+ function le(e, n) {
196
+ return p(e.prev, e, n.prev) < 0 && p(n.next, e, e.next) < 0;
197
+ }
198
+ var Z = [], z = [], k = /* @__PURE__ */ new Uint32Array(0), B = /* @__PURE__ */ new Uint32Array(0), H = /* @__PURE__ */ new Uint32Array(256);
199
+ function ue(e, n, t, r) {
200
+ let o = e, x = 0;
201
+ do
202
+ o.z = R(o.x, o.y, n, t, r), Z[x++] = o, o = o.next;
203
+ while (o !== e);
204
+ ce(x);
205
+ let i = null;
206
+ for (let f = 0; f < x; f++) {
207
+ const l = Z[f];
208
+ l.prevZ = i, i && (i.nextZ = l), i = l;
209
+ }
210
+ i.nextZ = null;
211
+ }
212
+ function ce(e) {
213
+ if (e <= 32) {
214
+ for (let n = 1; n < e; n++) {
215
+ const t = Z[n], r = t.z;
216
+ let o = n - 1;
217
+ for (; o >= 0 && Z[o].z > r; )
218
+ Z[o + 1] = Z[o], o--;
219
+ Z[o + 1] = t;
220
+ }
221
+ return;
222
+ }
223
+ k.length < e && (k = new Uint32Array(e), B = new Uint32Array(e), z = Array.from({ length: e }));
224
+ for (let n = 0; n < e; n++) k[n] = Z[n].z;
225
+ P(e, Z, k, z, B, 0), P(e, z, B, Z, k, 8), P(e, Z, k, z, B, 16), P(e, z, B, Z, k, 24);
226
+ }
227
+ function P(e, n, t, r, o, x) {
228
+ H.fill(0);
229
+ for (let f = 0; f < e; f++) H[t[f] >>> x & 255]++;
230
+ let i = 0;
231
+ for (let f = 0; f < 256; f++) {
232
+ const l = H[f];
233
+ H[f] = i, i += l;
234
+ }
235
+ for (let f = 0; f < e; f++) {
236
+ const l = t[f], c = H[l >>> x & 255]++;
237
+ r[c] = n[f], o[c] = l;
238
+ }
239
+ }
240
+ function R(e, n, t, r, o) {
241
+ let x = (e - t) * o | 0, i = (n - r) * o | 0;
242
+ return x = (x | x << 8) & 16711935, x = (x | x << 4) & 252645135, x = (x | x << 2) & 858993459, x = (x | x << 1) & 1431655765, i = (i | i << 8) & 16711935, i = (i | i << 4) & 252645135, i = (i | i << 2) & 858993459, i = (i | i << 1) & 1431655765, x | i << 1;
243
+ }
244
+ function ye(e) {
245
+ let n = e, t = e;
246
+ do
247
+ (n.x < t.x || n.x === t.x && n.y < t.y) && (t = n), n = n.next;
248
+ while (n !== e);
249
+ return t;
250
+ }
251
+ function X(e, n, t, r, o, x, i, f) {
252
+ return (o - i) * (n - f) >= (e - i) * (x - f) && (e - i) * (r - f) >= (t - i) * (n - f) && (t - i) * (x - f) >= (o - i) * (r - f);
253
+ }
254
+ function se(e, n) {
255
+ const t = I(e, n) && p(e.prev, e, e.next) > 0 && p(n.prev, n, n.next) > 0;
256
+ return e.next.i !== n.i && (t || U(e, n) && U(n, e) && (p(e.prev, e, n.prev) !== 0 || p(e, n.prev, n) !== 0)) && !ve(e, n) && (t || he(e, n));
257
+ }
258
+ function p(e, n, t) {
259
+ return (n.y - e.y) * (t.x - n.x) - (n.x - e.x) * (t.y - n.y);
260
+ }
261
+ function I(e, n) {
262
+ return e.x === n.x && e.y === n.y;
263
+ }
264
+ function Q(e, n, t, r, o = !0) {
265
+ const x = p(e, n, t), i = p(e, n, r), f = p(t, r, e), l = p(t, r, n);
266
+ return (x > 0 && i < 0 || x < 0 && i > 0) && (f > 0 && l < 0 || f < 0 && l > 0) ? !0 : o ? !!(x === 0 && a(e, t, n) || i === 0 && a(e, r, n) || f === 0 && a(t, e, r) || l === 0 && a(t, n, r)) : !1;
267
+ }
268
+ function a(e, n, t) {
269
+ return n.x <= Math.max(e.x, t.x) && n.x >= Math.min(e.x, t.x) && n.y <= Math.max(e.y, t.y) && n.y >= Math.min(e.y, t.y);
270
+ }
271
+ function ve(e, n) {
272
+ const t = Math.min(e.x, n.x), r = Math.max(e.x, n.x), o = Math.min(e.y, n.y), x = Math.max(e.y, n.y);
273
+ let i = e;
274
+ do {
275
+ const f = i.next;
276
+ if (i.x > r && f.x > r || i.x < t && f.x < t || i.y > x && f.y > x || i.y < o && f.y < o) {
277
+ i = f;
278
+ continue;
279
+ }
280
+ if (i.i !== e.i && f.i !== e.i && i.i !== n.i && f.i !== n.i && Q(i, f, e, n)) return !0;
281
+ i = f;
282
+ } while (i !== e);
283
+ return !1;
284
+ }
285
+ function U(e, n) {
286
+ return p(e.prev, e, e.next) < 0 ? p(e, n, e.next) >= 0 && p(e, e.prev, n) >= 0 : p(e, n, e.prev) < 0 || p(e, e.next, n) < 0;
287
+ }
288
+ function he(e, n) {
289
+ let t = e, r = !1;
290
+ const o = (e.x + n.x) / 2, x = (e.y + n.y) / 2;
291
+ do {
292
+ const i = t.next;
293
+ t.y > x != i.y > x && o < (i.x - t.x) * (x - t.y) / (i.y - t.y) + t.x && (r = !r), t = i;
294
+ } while (t !== e);
295
+ return r;
296
+ }
297
+ function W(e, n) {
298
+ const t = S(e.i, e.x, e.y), r = S(n.i, n.x, n.y), o = e.next, x = n.prev;
299
+ return e.next = n, n.prev = e, t.next = o, o.prev = t, r.next = t, t.prev = r, x.next = r, r.prev = x, r;
300
+ }
301
+ function d(e, n, t, r) {
302
+ const o = S(e, n, t);
303
+ return r ? (o.next = r.next, o.prev = r, r.next.prev = o, r.next = o) : (o.prev = o, o.next = o), o;
304
+ }
305
+ function Y(e) {
306
+ e.next.prev = e.prev, e.prev.next = e.next, e.prevZ && (e.prevZ.nextZ = e.nextZ), e.nextZ && (e.nextZ.prevZ = e.prevZ), O && oe(e.prev, e.next);
307
+ }
308
+ function S(e, n, t) {
309
+ return {
310
+ i: e,
311
+ x: n,
312
+ y: t,
313
+ prev: null,
314
+ next: null,
315
+ z: 0,
316
+ prevZ: null,
317
+ nextZ: null
318
+ };
319
+ }
320
+ function pe(e, n, t, r) {
321
+ let o = 0;
322
+ for (let x = n, i = t - r; x < t; x += r)
323
+ o += (e[i] - e[x]) * (e[x + 1] + e[i + 1]), i = x;
324
+ return o;
325
+ }
326
+ export {
327
+ ge as default
328
+ };
@@ -0,0 +1,65 @@
1
+ var e = 16, i = class {
2
+ _oldLength = -1;
3
+ _length = 0;
4
+ curMaxLen = e;
5
+ float32 = new Float32Array(e);
6
+ _data;
7
+ get length() {
8
+ return this._length;
9
+ }
10
+ concat(t) {
11
+ const n = this._length + t.length;
12
+ for (; n > this.curMaxLen; ) this.expandCapacity();
13
+ for (let h = 0; h < t.length; h++)
14
+ this.float32[this._length] = t[h], this._length++;
15
+ }
16
+ push(t) {
17
+ this._length >= this.curMaxLen && this.expandCapacity(), this.float32[this._length] = t, this._length++;
18
+ }
19
+ expandCapacity() {
20
+ this.curMaxLen *= 2;
21
+ const t = new Float32Array(this.curMaxLen);
22
+ t.set(this.float32), this.float32 = t;
23
+ }
24
+ get data() {
25
+ return this._oldLength !== this._length && (this._data = new Float32Array(this.float32.buffer, 0, this._length), this._oldLength = this._length), this._data;
26
+ }
27
+ clear() {
28
+ this._length = 0;
29
+ }
30
+ }, a = class {
31
+ _oldLength = -1;
32
+ _length = 0;
33
+ curMaxLen = 8;
34
+ int32 = /* @__PURE__ */ new Uint32Array(8);
35
+ _data;
36
+ get length() {
37
+ return this._length;
38
+ }
39
+ concat(t) {
40
+ const n = this.length + t.length;
41
+ for (; n > this.curMaxLen; ) this.expandCapacity();
42
+ for (let h = 0; h < t.length; h++)
43
+ this.int32[this._length] = t[h], this._length++;
44
+ }
45
+ concatUInt16(t) {
46
+ const n = this.length + t.length;
47
+ for (; n > this.curMaxLen; ) this.expandCapacity();
48
+ this.int32.set(t, this._length), this._length = n;
49
+ }
50
+ expandCapacity() {
51
+ this.curMaxLen *= 2;
52
+ const t = new Uint32Array(this.curMaxLen);
53
+ t.set(this.int32), this.int32 = t;
54
+ }
55
+ get data() {
56
+ return this._oldLength !== this._length && (this._data = new Uint32Array(this.int32.buffer, 0, this._length), this._oldLength = this._length), this._data;
57
+ }
58
+ clear() {
59
+ this._length = 0;
60
+ }
61
+ };
62
+ export {
63
+ i as CustomFloatArray,
64
+ a as CustomIntArray
65
+ };
@@ -0,0 +1,50 @@
1
+ var l = /* @__PURE__ */ new Map(), n, i = (t) => {
2
+ if (n === void 0 && (n = typeof document < "u" ? document.createElement("canvas").getContext("2d") : null), !n) return [
3
+ 0,
4
+ 0,
5
+ 0
6
+ ];
7
+ n.fillStyle = "#000", n.fillStyle = t, n.fillRect(0, 0, 1, 1);
8
+ const [a, r, e] = n.getImageData(0, 0, 1, 1).data;
9
+ return [
10
+ a,
11
+ r,
12
+ e
13
+ ];
14
+ }, c = (t) => {
15
+ const a = l.get(t);
16
+ if (a) return a;
17
+ let r;
18
+ if (/^#?[0-9a-fA-F]{3}$/.test(t)) {
19
+ const e = t.replace("#", "");
20
+ r = [
21
+ parseInt(e[0] + e[0], 16),
22
+ parseInt(e[1] + e[1], 16),
23
+ parseInt(e[2] + e[2], 16)
24
+ ];
25
+ } else if (/^#?[0-9a-fA-F]{6}$/.test(t)) {
26
+ const e = parseInt(t.replace("#", ""), 16);
27
+ r = [
28
+ e >> 16 & 255,
29
+ e >> 8 & 255,
30
+ e & 255
31
+ ];
32
+ } else r = i(t);
33
+ return l.set(t, r), r;
34
+ }, u = (t, a) => {
35
+ const [r, e, o] = c(t).map((g) => Math.round(g * a)), f = Math.round(a * 255);
36
+ let s = 0;
37
+ return s += f << 24, s += o << 16, s += e << 8, s += r, s;
38
+ }, d = (t) => {
39
+ const [a, r, e] = c(t);
40
+ return [
41
+ a / 255,
42
+ r / 255,
43
+ e / 255
44
+ ];
45
+ };
46
+ export {
47
+ c as getRgb,
48
+ d as toRgbArray,
49
+ u as toRgbaLittleEndian
50
+ };
@@ -1,5 +1,5 @@
1
- import type { GraphicsData } from '@/utils/visual/graphics/graphicsData';
2
- import type { GraphicsGeometry } from '@/utils/visual/graphics/graphicsGeometry';
1
+ import type { GraphicsData } from "../../graphics/graphicsData.js";
2
+ import type { GraphicsGeometry } from "../../graphics/graphicsGeometry.js";
3
3
  /**
4
4
  * Turn a shape into vertices
5
5
  * @param data the sub-shape's data