@weasel-js/core 1.6.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1005) hide show
  1. package/CHANGELOG.md +1006 -0
  2. package/README.md +28 -9
  3. package/dist/WeaselProvider.js +15 -0
  4. package/dist/WeaselProvider.js.map +1 -0
  5. package/dist/affordances/composeAffordanceLayer.js +224 -0
  6. package/dist/affordances/composeAffordanceLayer.js.map +1 -0
  7. package/dist/affordances/cornerResize.js +69 -0
  8. package/dist/affordances/cornerResize.js.map +1 -0
  9. package/dist/affordances/hitAffordanceRegions.js +138 -0
  10. package/dist/affordances/hitAffordanceRegions.js.map +1 -0
  11. package/dist/affordances/pathAnchors.js +66 -0
  12. package/dist/affordances/pathAnchors.js.map +1 -0
  13. package/dist/affordances/rotationHandle.js +103 -0
  14. package/dist/affordances/rotationHandle.js.map +1 -0
  15. package/dist/animation/behaviors/momentum.js +118 -0
  16. package/dist/animation/behaviors/momentum.js.map +1 -0
  17. package/dist/animation/colorHelpers.js +135 -0
  18. package/dist/animation/colorHelpers.js.map +1 -0
  19. package/dist/animation/colorRegistry.js +37 -0
  20. package/dist/animation/colorRegistry.js.map +1 -0
  21. package/dist/animation/index.js +20 -0
  22. package/dist/animation/loop.js +62 -0
  23. package/dist/animation/loop.js.map +1 -0
  24. package/dist/animation/observe.js +23 -0
  25. package/dist/animation/observe.js.map +1 -0
  26. package/dist/animation/poseHelpers.js +50 -0
  27. package/dist/animation/poseHelpers.js.map +1 -0
  28. package/dist/animation/reflow.js +121 -0
  29. package/dist/animation/reflow.js.map +1 -0
  30. package/dist/animation/rig/bindRig.js +74 -0
  31. package/dist/animation/rig/bindRig.js.map +1 -0
  32. package/dist/animation/rig/blendPoses.js +43 -0
  33. package/dist/animation/rig/blendPoses.js.map +1 -0
  34. package/dist/animation/rig/mirrorPose.js +19 -0
  35. package/dist/animation/rig/mirrorPose.js.map +1 -0
  36. package/dist/animation/rig/resolveSkeleton.js +33 -0
  37. package/dist/animation/rig/resolveSkeleton.js.map +1 -0
  38. package/dist/animation/rig/solveIk.js +103 -0
  39. package/dist/animation/rig/solveIk.js.map +1 -0
  40. package/dist/animation/rig/types.js +12 -0
  41. package/dist/animation/rig/types.js.map +1 -0
  42. package/dist/animation/rig/useRig.js +23 -0
  43. package/dist/animation/rig/useRig.js.map +1 -0
  44. package/dist/animation/slew.js +27 -0
  45. package/dist/animation/slew.js.map +1 -0
  46. package/dist/animation/stagger.js +138 -0
  47. package/dist/animation/stagger.js.map +1 -0
  48. package/dist/animation/timeline/booking.js +106 -0
  49. package/dist/animation/timeline/booking.js.map +1 -0
  50. package/dist/animation/timeline/createTimeline.js +116 -0
  51. package/dist/animation/timeline/createTimeline.js.map +1 -0
  52. package/dist/animation/timeline/sampleTrack.js +29 -0
  53. package/dist/animation/timeline/sampleTrack.js.map +1 -0
  54. package/dist/animation/useAnimator.js +329 -0
  55. package/dist/animation/useAnimator.js.map +1 -0
  56. package/dist/animation/wrappers/animateLifecycle.js +40 -0
  57. package/dist/animation/wrappers/animateLifecycle.js.map +1 -0
  58. package/dist/animation/wrappers/animateOnSetPose.js +44 -0
  59. package/dist/animation/wrappers/animateOnSetPose.js.map +1 -0
  60. package/dist/{autoPoseDescriptor-_XOyF7t4.d.ts → autoPoseDescriptor-BT_vp9FO.d.ts} +2 -2
  61. package/dist/{builtins-HWyuLzE-.d.ts → builtins-BSUfH8nU.d.ts} +1301 -508
  62. package/dist/canvas/Canvas.js +608 -0
  63. package/dist/canvas/Canvas.js.map +1 -0
  64. package/dist/canvas/CanvasView.js +255 -0
  65. package/dist/canvas/CanvasView.js.map +1 -0
  66. package/dist/canvas/CursorCoordsHud.js +75 -0
  67. package/dist/canvas/CursorCoordsHud.js.map +1 -0
  68. package/dist/canvas/DrawCanvas.js +67 -0
  69. package/dist/canvas/DrawCanvas.js.map +1 -0
  70. package/dist/canvas/MinimapCanvas.js +139 -0
  71. package/dist/canvas/MinimapCanvas.js.map +1 -0
  72. package/dist/canvas/ModalityHud.js +66 -0
  73. package/dist/canvas/ModalityHud.js.map +1 -0
  74. package/dist/canvas/NodeShape.js +391 -0
  75. package/dist/canvas/NodeShape.js.map +1 -0
  76. package/dist/canvas/PickHud.js +93 -0
  77. package/dist/canvas/PickHud.js.map +1 -0
  78. package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js +10 -0
  79. package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js.map +1 -0
  80. package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js +10 -0
  81. package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js.map +1 -0
  82. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +51 -0
  83. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -0
  84. package/dist/canvas/SceneCanvas/contributionFrameHooks.js +42 -0
  85. package/dist/canvas/SceneCanvas/contributionFrameHooks.js.map +1 -0
  86. package/dist/canvas/SceneCanvas/defaultNodeProperties.js +549 -0
  87. package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -0
  88. package/dist/canvas/SceneCanvas/defaultNodeRouting.js +26 -0
  89. package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -0
  90. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js +69 -0
  91. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -0
  92. package/dist/canvas/SceneCanvas/features.js +97 -0
  93. package/dist/canvas/SceneCanvas/features.js.map +1 -0
  94. package/dist/canvas/SceneCanvas/poseGeometry.js +46 -0
  95. package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -0
  96. package/dist/canvas/SceneCanvas/useActionsPropResolver.js +48 -0
  97. package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -0
  98. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +70 -0
  99. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -0
  100. package/dist/canvas/SceneCanvas/useContributionRoles.js +75 -0
  101. package/dist/canvas/SceneCanvas/useContributionRoles.js.map +1 -0
  102. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +172 -0
  103. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -0
  104. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +69 -0
  105. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -0
  106. package/dist/canvas/SceneCanvas/useSceneSelectTool.js +127 -0
  107. package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -0
  108. package/dist/canvas/SceneCanvas/useViewportActions.js +30 -0
  109. package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -0
  110. package/dist/canvas/SceneCanvas.js +992 -0
  111. package/dist/canvas/SceneCanvas.js.map +1 -0
  112. package/dist/canvas/SceneViewCanvas.js +54 -0
  113. package/dist/canvas/SceneViewCanvas.js.map +1 -0
  114. package/dist/canvas/accentColor.js +9 -0
  115. package/dist/canvas/accentColor.js.map +1 -0
  116. package/dist/canvas/affordanceAt.js +63 -0
  117. package/dist/canvas/affordanceAt.js.map +1 -0
  118. package/dist/canvas/buildSceneTree.js +65 -0
  119. package/dist/canvas/buildSceneTree.js.map +1 -0
  120. package/dist/canvas/canvasRenderer.js +89 -0
  121. package/dist/canvas/canvasRenderer.js.map +1 -0
  122. package/dist/canvas/colorOverrides.js +16 -0
  123. package/dist/canvas/colorOverrides.js.map +1 -0
  124. package/dist/canvas/defaultDrawOne.js +43 -0
  125. package/dist/canvas/defaultDrawOne.js.map +1 -0
  126. package/dist/canvas/deps/areaSelect.js +19 -0
  127. package/dist/canvas/deps/areaSelect.js.map +1 -0
  128. package/dist/canvas/deps/debug.js +9 -0
  129. package/dist/canvas/deps/debug.js.map +1 -0
  130. package/dist/canvas/deps/dispatcher.js +11 -0
  131. package/dist/canvas/deps/dispatcher.js.map +1 -0
  132. package/dist/canvas/deps/editAnchors.js +101 -0
  133. package/dist/canvas/deps/editAnchors.js.map +1 -0
  134. package/dist/canvas/deps/geometryProjection.js +11 -0
  135. package/dist/canvas/deps/geometryProjection.js.map +1 -0
  136. package/dist/canvas/deps/hitTestArea.js +51 -0
  137. package/dist/canvas/deps/hitTestArea.js.map +1 -0
  138. package/dist/canvas/deps/ingestion.js +31 -0
  139. package/dist/canvas/deps/ingestion.js.map +1 -0
  140. package/dist/canvas/deps/insert.js +116 -0
  141. package/dist/canvas/deps/insert.js.map +1 -0
  142. package/dist/canvas/deps/lassoSelect.js +20 -0
  143. package/dist/canvas/deps/lassoSelect.js.map +1 -0
  144. package/dist/canvas/deps/layout.js +34 -0
  145. package/dist/canvas/deps/layout.js.map +1 -0
  146. package/dist/canvas/deps/nodeAtPoint.js +19 -0
  147. package/dist/canvas/deps/nodeAtPoint.js.map +1 -0
  148. package/dist/canvas/deps/poseComposition.js +11 -0
  149. package/dist/canvas/deps/poseComposition.js.map +1 -0
  150. package/dist/canvas/deps/poseDescriptor.js +12 -0
  151. package/dist/canvas/deps/poseDescriptor.js.map +1 -0
  152. package/dist/canvas/deps/resizePolicy.js +35 -0
  153. package/dist/canvas/deps/resizePolicy.js.map +1 -0
  154. package/dist/canvas/deps/slice.js +99 -0
  155. package/dist/canvas/deps/slice.js.map +1 -0
  156. package/dist/canvas/deps/snap.js +11 -0
  157. package/dist/canvas/deps/snap.js.map +1 -0
  158. package/dist/canvas/deps/textEdit.js +21 -0
  159. package/dist/canvas/deps/textEdit.js.map +1 -0
  160. package/dist/canvas/deps/view.js +43 -0
  161. package/dist/canvas/deps/view.js.map +1 -0
  162. package/dist/canvas/derivedPath.js +47 -0
  163. package/dist/canvas/derivedPath.js.map +1 -0
  164. package/dist/canvas/drawEnvelope.js +22 -0
  165. package/dist/canvas/drawEnvelope.js.map +1 -0
  166. package/dist/canvas/getNodeAtPoint.js +18 -0
  167. package/dist/canvas/getNodeAtPoint.js.map +1 -0
  168. package/dist/canvas/hostAnchor.js +29 -0
  169. package/dist/canvas/hostAnchor.js.map +1 -0
  170. package/dist/canvas/hud.module.js +18 -0
  171. package/dist/canvas/hud.module.js.map +1 -0
  172. package/dist/canvas/insertPreviewExtent.js +103 -0
  173. package/dist/canvas/insertPreviewExtent.js.map +1 -0
  174. package/dist/canvas/kitRequirements.js +177 -0
  175. package/dist/canvas/kitRequirements.js.map +1 -0
  176. package/dist/canvas/layerOrder.js +66 -0
  177. package/dist/canvas/layerOrder.js.map +1 -0
  178. package/dist/canvas/layerSlots.js +14 -0
  179. package/dist/canvas/layerSlots.js.map +1 -0
  180. package/dist/canvas/minimapMath.js +80 -0
  181. package/dist/canvas/minimapMath.js.map +1 -0
  182. package/dist/canvas/mountedCanvases.js +20 -0
  183. package/dist/canvas/mountedCanvases.js.map +1 -0
  184. package/dist/canvas/overlayRoleStrokes.js +17 -0
  185. package/dist/canvas/overlayRoleStrokes.js.map +1 -0
  186. package/dist/canvas/paintCull.js +20 -0
  187. package/dist/canvas/paintCull.js.map +1 -0
  188. package/dist/canvas/pickWalk.js +158 -0
  189. package/dist/canvas/pickWalk.js.map +1 -0
  190. package/dist/canvas/planeClips.js +30 -0
  191. package/dist/canvas/planeClips.js.map +1 -0
  192. package/dist/canvas/poseRotation.js +35 -0
  193. package/dist/canvas/poseRotation.js.map +1 -0
  194. package/dist/canvas/rasterToPng.js +21 -0
  195. package/dist/canvas/rasterToPng.js.map +1 -0
  196. package/dist/canvas/renderDebugSnapshot.js +32 -0
  197. package/dist/canvas/renderDebugSnapshot.js.map +1 -0
  198. package/dist/canvas/renderNeeds.js +25 -0
  199. package/dist/canvas/renderNeeds.js.map +1 -0
  200. package/dist/canvas/renderSceneToPixels.js +143 -0
  201. package/dist/canvas/renderSceneToPixels.js.map +1 -0
  202. package/dist/canvas/sceneAdapter.js +270 -0
  203. package/dist/canvas/sceneAdapter.js.map +1 -0
  204. package/dist/canvas/sceneLayerPaint.js +37 -0
  205. package/dist/canvas/sceneLayerPaint.js.map +1 -0
  206. package/dist/canvas/sceneSlotWiring.js +20 -0
  207. package/dist/canvas/sceneSlotWiring.js.map +1 -0
  208. package/dist/canvas/sceneViewRender.js +72 -0
  209. package/dist/canvas/sceneViewRender.js.map +1 -0
  210. package/dist/canvas/slopsDebugLayer.js +61 -0
  211. package/dist/canvas/slopsDebugLayer.js.map +1 -0
  212. package/dist/canvas/surfaceContribution.js +15 -0
  213. package/dist/canvas/surfaceContribution.js.map +1 -0
  214. package/dist/canvas/toolPreview.js +39 -0
  215. package/dist/canvas/toolPreview.js.map +1 -0
  216. package/dist/canvas/useCanvasRenderer.js +11 -0
  217. package/dist/canvas/useCanvasRenderer.js.map +1 -0
  218. package/dist/canvas/useFrameLoop.js +60 -0
  219. package/dist/canvas/useFrameLoop.js.map +1 -0
  220. package/dist/canvas/useHostAnchor.js +71 -0
  221. package/dist/canvas/useHostAnchor.js.map +1 -0
  222. package/dist/canvas/useLateContentRedraw.js +21 -0
  223. package/dist/canvas/useLateContentRedraw.js.map +1 -0
  224. package/dist/canvas/useRedrawOn.js +21 -0
  225. package/dist/canvas/useRedrawOn.js.map +1 -0
  226. package/dist/canvas/useViewHelpers.js +120 -0
  227. package/dist/canvas/useViewHelpers.js.map +1 -0
  228. package/dist/canvas/viewInputs.js +17 -0
  229. package/dist/canvas/viewInputs.js.map +1 -0
  230. package/dist/canvas/viewRegistry.js +61 -0
  231. package/dist/canvas/viewRegistry.js.map +1 -0
  232. package/dist/canvas/wrapNodeOutput.js +14 -0
  233. package/dist/canvas/wrapNodeOutput.js.map +1 -0
  234. package/dist/clipboard.d.ts +10 -5
  235. package/dist/clipboard.js +3 -5
  236. package/dist/clone.d.ts +3 -3
  237. package/dist/clone.js +2 -5
  238. package/dist/core/adapters/arrayAdapter.js +85 -0
  239. package/dist/core/adapters/arrayAdapter.js.map +1 -0
  240. package/dist/core/adapters/useArrayAdapter.js +13 -0
  241. package/dist/core/adapters/useArrayAdapter.js.map +1 -0
  242. package/dist/core/applyOps.js +12 -0
  243. package/dist/core/applyOps.js.map +1 -0
  244. package/dist/core/device/index.js +4 -0
  245. package/dist/core/device/targets.js +17 -0
  246. package/dist/core/device/targets.js.map +1 -0
  247. package/dist/core/device/useDeviceProfile.js +75 -0
  248. package/dist/core/device/useDeviceProfile.js.map +1 -0
  249. package/dist/core/fillInPoseFrame.js +102 -0
  250. package/dist/core/fillInPoseFrame.js.map +1 -0
  251. package/dist/core/geometry/poseDescriptor.js +98 -0
  252. package/dist/core/geometry/poseDescriptor.js.map +1 -0
  253. package/dist/core/geometry/poseRotation.js +58 -0
  254. package/dist/core/geometry/poseRotation.js.map +1 -0
  255. package/dist/core/geometry/regionHit.js +102 -0
  256. package/dist/core/geometry/regionHit.js.map +1 -0
  257. package/dist/core/geometry/unionBounds.js +60 -0
  258. package/dist/core/geometry/unionBounds.js.map +1 -0
  259. package/dist/core/gradient.js +136 -0
  260. package/dist/core/gradient.js.map +1 -0
  261. package/dist/core/isPlainObject.js +11 -0
  262. package/dist/core/isPlainObject.js.map +1 -0
  263. package/dist/core/layers/render.js +150 -0
  264. package/dist/core/layers/render.js.map +1 -0
  265. package/dist/core/markerInset.js +24 -0
  266. package/dist/core/markerInset.js.map +1 -0
  267. package/dist/core/mixed.js +6 -0
  268. package/dist/core/mixed.js.map +1 -0
  269. package/dist/core/ops/arrange.js +31 -0
  270. package/dist/core/ops/arrange.js.map +1 -0
  271. package/dist/core/ops/create.js +32 -0
  272. package/dist/core/ops/create.js.map +1 -0
  273. package/dist/core/ops/createHistory.js +20 -0
  274. package/dist/core/ops/createHistory.js.map +1 -0
  275. package/dist/core/ops/delete.js +89 -0
  276. package/dist/core/ops/delete.js.map +1 -0
  277. package/dist/core/ops/registry.js +17 -0
  278. package/dist/core/ops/registry.js.map +1 -0
  279. package/dist/core/ops/reorder/algorithms.js +55 -0
  280. package/dist/core/ops/reorder/algorithms.js.map +1 -0
  281. package/dist/core/ops/reorder/index.js +140 -0
  282. package/dist/core/ops/reorder/index.js.map +1 -0
  283. package/dist/core/ops/reparent.js +52 -0
  284. package/dist/core/ops/reparent.js.map +1 -0
  285. package/dist/core/ops/select.js +34 -0
  286. package/dist/core/ops/select.js.map +1 -0
  287. package/dist/core/ops/setData.js +34 -0
  288. package/dist/core/ops/setData.js.map +1 -0
  289. package/dist/core/ops/setLayer.js +34 -0
  290. package/dist/core/ops/setLayer.js.map +1 -0
  291. package/dist/core/ops/setLayout.js +31 -0
  292. package/dist/core/ops/setLayout.js.map +1 -0
  293. package/dist/core/ops/setPath.js +57 -0
  294. package/dist/core/ops/setPath.js.map +1 -0
  295. package/dist/core/ops/setText.js +34 -0
  296. package/dist/core/ops/setText.js.map +1 -0
  297. package/dist/core/ops/slot.js +37 -0
  298. package/dist/core/ops/slot.js.map +1 -0
  299. package/dist/core/ops/transform.js +42 -0
  300. package/dist/core/ops/transform.js.map +1 -0
  301. package/dist/core/paintKinds.js +156 -0
  302. package/dist/core/paintKinds.js.map +1 -0
  303. package/dist/core/scene/NodeProperties.js +20 -0
  304. package/dist/core/scene/NodeProperties.js.map +1 -0
  305. package/dist/core/scene/NodeRouting.js +24 -0
  306. package/dist/core/scene/NodeRouting.js.map +1 -0
  307. package/dist/core/scene/arrivals.js +12 -0
  308. package/dist/core/scene/arrivals.js.map +1 -0
  309. package/dist/core/scene/composeFrame.js +29 -0
  310. package/dist/core/scene/composeFrame.js.map +1 -0
  311. package/dist/core/scene/depMemo.js +18 -0
  312. package/dist/core/scene/depMemo.js.map +1 -0
  313. package/dist/core/scene/dependents.js +66 -0
  314. package/dist/core/scene/dependents.js.map +1 -0
  315. package/dist/core/scene/derivedPath.js +31 -0
  316. package/dist/core/scene/derivedPath.js.map +1 -0
  317. package/dist/core/scene/effectivePose.js +78 -0
  318. package/dist/core/scene/effectivePose.js.map +1 -0
  319. package/dist/core/scene/kitRegistry.js +33 -0
  320. package/dist/core/scene/kitRegistry.js.map +1 -0
  321. package/dist/core/scene/layoutPass.js +96 -0
  322. package/dist/core/scene/layoutPass.js.map +1 -0
  323. package/dist/core/scene/nodeFnFields.js +83 -0
  324. package/dist/core/scene/nodeFnFields.js.map +1 -0
  325. package/dist/core/scene/nodeMemo.js +28 -0
  326. package/dist/core/scene/nodeMemo.js.map +1 -0
  327. package/dist/core/scene/poseFeed.js +87 -0
  328. package/dist/core/scene/poseFeed.js.map +1 -0
  329. package/dist/core/scene/poseOverrides.js +52 -0
  330. package/dist/core/scene/poseOverrides.js.map +1 -0
  331. package/dist/core/scene/poseSnapshot.js +54 -0
  332. package/dist/core/scene/poseSnapshot.js.map +1 -0
  333. package/dist/core/scene/scene.js +1271 -0
  334. package/dist/core/scene/scene.js.map +1 -0
  335. package/dist/core/scene/types.js +6 -0
  336. package/dist/core/scene/types.js.map +1 -0
  337. package/dist/core/scene/useScene.js +32 -0
  338. package/dist/core/scene/useScene.js.map +1 -0
  339. package/dist/core/selection/chromeState.js +31 -0
  340. package/dist/core/selection/chromeState.js.map +1 -0
  341. package/dist/core/selection/selectionTarget.js +6 -0
  342. package/dist/core/selection/selectionTarget.js.map +1 -0
  343. package/dist/core/selection/useSelection.js +71 -0
  344. package/dist/core/selection/useSelection.js.map +1 -0
  345. package/dist/core/shapeKinds.js +54 -0
  346. package/dist/core/shapeKinds.js.map +1 -0
  347. package/dist/core/strokeMarkerShapes.js +139 -0
  348. package/dist/core/strokeMarkerShapes.js.map +1 -0
  349. package/dist/core/strokeMarkers.js +28 -0
  350. package/dist/core/strokeMarkers.js.map +1 -0
  351. package/dist/core/stylus/stylus.js +39 -0
  352. package/dist/core/stylus/stylus.js.map +1 -0
  353. package/dist/core/stylus/usePointerStylus.js +51 -0
  354. package/dist/core/stylus/usePointerStylus.js.map +1 -0
  355. package/dist/core/usePaintKinds.js +17 -0
  356. package/dist/core/usePaintKinds.js.map +1 -0
  357. package/dist/core/viewport/clampView.js +24 -0
  358. package/dist/core/viewport/clampView.js.map +1 -0
  359. package/dist/core/viewport/clientToWorld.js +8 -0
  360. package/dist/core/viewport/clientToWorld.js.map +1 -0
  361. package/dist/core/viewport/createVelocityTracker.js +39 -0
  362. package/dist/core/viewport/createVelocityTracker.js.map +1 -0
  363. package/dist/core/viewport/fitToBounds.js +18 -0
  364. package/dist/core/viewport/fitToBounds.js.map +1 -0
  365. package/dist/core/viewport/fitViewToBounds.js +36 -0
  366. package/dist/core/viewport/fitViewToBounds.js.map +1 -0
  367. package/dist/core/viewport/interpolateView.js +34 -0
  368. package/dist/core/viewport/interpolateView.js.map +1 -0
  369. package/dist/core/viewport/meanScale.js +8 -0
  370. package/dist/core/viewport/meanScale.js.map +1 -0
  371. package/dist/core/viewport/parallax.js +111 -0
  372. package/dist/core/viewport/parallax.js.map +1 -0
  373. package/dist/core/viewport/pxExtent.js +42 -0
  374. package/dist/core/viewport/pxExtent.js.map +1 -0
  375. package/dist/core/viewport/sceneNodeClientRect.js +18 -0
  376. package/dist/core/viewport/sceneNodeClientRect.js.map +1 -0
  377. package/dist/core/viewport/screenSlop.js +27 -0
  378. package/dist/core/viewport/screenSlop.js.map +1 -0
  379. package/dist/core/viewport/useAutoCenter.js +32 -0
  380. package/dist/core/viewport/useAutoCenter.js.map +1 -0
  381. package/dist/core/viewport/useCanvasSize.js +29 -0
  382. package/dist/core/viewport/useCanvasSize.js.map +1 -0
  383. package/dist/core/viewport/useDecayLoop.js +63 -0
  384. package/dist/core/viewport/useDecayLoop.js.map +1 -0
  385. package/dist/core/viewport/useVelocityTracker.js +10 -0
  386. package/dist/core/viewport/useVelocityTracker.js.map +1 -0
  387. package/dist/core/viewport/useViewAnimation.js +63 -0
  388. package/dist/core/viewport/useViewAnimation.js.map +1 -0
  389. package/dist/core/viewport/view.js +37 -0
  390. package/dist/core/viewport/view.js.map +1 -0
  391. package/dist/core/viewport/viewTransform.js +11 -0
  392. package/dist/core/viewport/viewTransform.js.map +1 -0
  393. package/dist/core/viewport/viewportWorldRect.js +13 -0
  394. package/dist/core/viewport/viewportWorldRect.js.map +1 -0
  395. package/dist/core/viewport/wheelHandler.js +30 -0
  396. package/dist/core/viewport/wheelHandler.js.map +1 -0
  397. package/dist/core/viewport/zoomAt.js +22 -0
  398. package/dist/core/viewport/zoomAt.js.map +1 -0
  399. package/dist/core/viewport/zoomBounds.js +20 -0
  400. package/dist/core/viewport/zoomBounds.js.map +1 -0
  401. package/dist/{pointSnapToGrid-7mCcm6qG.d.ts → cornerHandles-CDcZOV8h.d.ts} +54 -71
  402. package/dist/debug/createDebugOverlayLayer.js +358 -0
  403. package/dist/debug/createDebugOverlayLayer.js.map +1 -0
  404. package/dist/debug/createDebugSink.js +83 -0
  405. package/dist/debug/createDebugSink.js.map +1 -0
  406. package/dist/debug/defaultTheme.js +31 -0
  407. package/dist/debug/defaultTheme.js.map +1 -0
  408. package/dist/debug/flag.js +41 -0
  409. package/dist/debug/flag.js.map +1 -0
  410. package/dist/debug/frameStats.js +16 -0
  411. package/dist/debug/frameStats.js.map +1 -0
  412. package/dist/debug/parseDebugFlags.js +32 -0
  413. package/dist/debug/parseDebugFlags.js.map +1 -0
  414. package/dist/features/chrome-caps/buildChromeCtx.js +16 -0
  415. package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -0
  416. package/dist/features/chrome-caps/conditions.js +36 -0
  417. package/dist/features/chrome-caps/conditions.js.map +1 -0
  418. package/dist/features/chrome-caps/defaults.js +26 -0
  419. package/dist/features/chrome-caps/defaults.js.map +1 -0
  420. package/dist/features/chrome-caps/index.js +7 -0
  421. package/dist/features/chrome-caps/resolve.js +23 -0
  422. package/dist/features/chrome-caps/resolve.js.map +1 -0
  423. package/dist/features/chrome-caps/useHoverTracking.js +27 -0
  424. package/dist/features/chrome-caps/useHoverTracking.js.map +1 -0
  425. package/dist/features/cursor/paintedCursorLayer.js +60 -0
  426. package/dist/features/cursor/paintedCursorLayer.js.map +1 -0
  427. package/dist/features/focus/gateLayer.js +14 -0
  428. package/dist/features/focus/gateLayer.js.map +1 -0
  429. package/dist/features/focus/useCanvasFocus.js +29 -0
  430. package/dist/features/focus/useCanvasFocus.js.map +1 -0
  431. package/dist/features/groups/children.js +23 -0
  432. package/dist/features/groups/children.js.map +1 -0
  433. package/dist/features/groups/composePose.js +67 -0
  434. package/dist/features/groups/composePose.js.map +1 -0
  435. package/dist/features/groups/nestedHit.js +40 -0
  436. package/dist/features/groups/nestedHit.js.map +1 -0
  437. package/dist/features/groups/unionOfChildren.js +15 -0
  438. package/dist/features/groups/unionOfChildren.js.map +1 -0
  439. package/dist/features/images/imageCache.js +94 -0
  440. package/dist/features/images/imageCache.js.map +1 -0
  441. package/dist/features/ingestion/contentHandlers.js +37 -0
  442. package/dist/features/ingestion/contentHandlers.js.map +1 -0
  443. package/dist/features/ingestion/imageHandler.js +45 -0
  444. package/dist/features/ingestion/imageHandler.js.map +1 -0
  445. package/dist/features/ingestion/index.js +8 -0
  446. package/dist/features/ingestion/openFilePicker.js +15 -0
  447. package/dist/features/ingestion/openFilePicker.js.map +1 -0
  448. package/dist/features/ingestion/registerKitHandlers.js +26 -0
  449. package/dist/features/ingestion/registerKitHandlers.js.map +1 -0
  450. package/dist/features/ingestion/svgHandler.js +58 -0
  451. package/dist/features/ingestion/svgHandler.js.map +1 -0
  452. package/dist/features/ingestion/weaselJsonHandler.js +39 -0
  453. package/dist/features/ingestion/weaselJsonHandler.js.map +1 -0
  454. package/dist/features/longPress/longPressFeedback.js +96 -0
  455. package/dist/features/longPress/longPressFeedback.js.map +1 -0
  456. package/dist/features/meshPaint/bake.js +79 -0
  457. package/dist/features/meshPaint/bake.js.map +1 -0
  458. package/dist/features/meshPaint/bakeCache.js +59 -0
  459. package/dist/features/meshPaint/bakeCache.js.map +1 -0
  460. package/dist/features/meshPaint/handles.js +86 -0
  461. package/dist/features/meshPaint/handles.js.map +1 -0
  462. package/dist/features/meshPaint/lazyKind.js +1298 -0
  463. package/dist/features/meshPaint/lazyKind.js.map +1 -0
  464. package/dist/features/meshPaint/meshPaint.js +236 -0
  465. package/dist/features/meshPaint/meshPaint.js.map +1 -0
  466. package/dist/features/meshPaint/meshShader.js +6 -0
  467. package/dist/features/meshPaint/meshShader.js.map +1 -0
  468. package/dist/features/meshPaint/register.js +7 -0
  469. package/dist/features/meshPaint/register.js.map +1 -0
  470. package/dist/features/meshPaint/surface.js +110 -0
  471. package/dist/features/meshPaint/surface.js.map +1 -0
  472. package/dist/features/minimap/actions.js +53 -0
  473. package/dist/features/minimap/actions.js.map +1 -0
  474. package/dist/features/minimap/createMinimapContribution.js +96 -0
  475. package/dist/features/minimap/createMinimapContribution.js.map +1 -0
  476. package/dist/features/minimap/layers.js +103 -0
  477. package/dist/features/minimap/layers.js.map +1 -0
  478. package/dist/features/modes/modeLayers.js +113 -0
  479. package/dist/features/modes/modeLayers.js.map +1 -0
  480. package/dist/features/overlays/useNodeOverlayFrame.js +103 -0
  481. package/dist/features/overlays/useNodeOverlayFrame.js.map +1 -0
  482. package/dist/features/parallax/createParallaxLayer.js +26 -0
  483. package/dist/features/parallax/createParallaxLayer.js.map +1 -0
  484. package/dist/features/parallax/createParallaxPlane.js +26 -0
  485. package/dist/features/parallax/createParallaxPlane.js.map +1 -0
  486. package/dist/features/paths/anchorEdits.js +156 -0
  487. package/dist/features/paths/anchorEdits.js.map +1 -0
  488. package/dist/features/paths/anchors.js +154 -0
  489. package/dist/features/paths/anchors.js.map +1 -0
  490. package/dist/features/paths/booleans.js +2 -0
  491. package/dist/features/paths/index.js +15 -0
  492. package/dist/features/paths/markerCommands.js +116 -0
  493. package/dist/features/paths/markerCommands.js.map +1 -0
  494. package/dist/features/paths/markerSites.js +59 -0
  495. package/dist/features/paths/markerSites.js.map +1 -0
  496. package/dist/features/paths/markers.js +95 -0
  497. package/dist/features/paths/markers.js.map +1 -0
  498. package/dist/features/paths/nearestAnchor.js +36 -0
  499. package/dist/features/paths/nearestAnchor.js.map +1 -0
  500. package/dist/features/paths/originProjection.js +16 -0
  501. package/dist/features/paths/originProjection.js.map +1 -0
  502. package/dist/features/paths/pathEditingOverlayLayer.js +137 -0
  503. package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -0
  504. package/dist/features/paths/pathInWorld.js +41 -0
  505. package/dist/features/paths/pathInWorld.js.map +1 -0
  506. package/dist/features/paths/pathLayer.js +44 -0
  507. package/dist/features/paths/pathLayer.js.map +1 -0
  508. package/dist/features/paths/penPreviewLayer.js +220 -0
  509. package/dist/features/paths/penPreviewLayer.js.map +1 -0
  510. package/dist/features/paths/poseDescriptor.js +44 -0
  511. package/dist/features/paths/poseDescriptor.js.map +1 -0
  512. package/dist/features/paths/tessellate/stroke.js +230 -0
  513. package/dist/features/paths/tessellate/stroke.js.map +1 -0
  514. package/dist/features/patterns/index.js +23 -0
  515. package/dist/features/patterns/index.js.map +1 -0
  516. package/dist/features/patterns/patterns-builtin.js +38 -0
  517. package/dist/features/patterns/patterns-builtin.js.map +1 -0
  518. package/dist/features/patterns/resolveSpec.js +57 -0
  519. package/dist/features/patterns/resolveSpec.js.map +1 -0
  520. package/dist/features/patterns/tileGeometry.js +158 -0
  521. package/dist/features/patterns/tileGeometry.js.map +1 -0
  522. package/dist/features/pointer/PointerContext.js +45 -0
  523. package/dist/features/pointer/PointerContext.js.map +1 -0
  524. package/dist/features/poseRun/usePoseRun.js +70 -0
  525. package/dist/features/poseRun/usePoseRun.js.map +1 -0
  526. package/dist/features/selection/SelectionContext.js +46 -0
  527. package/dist/features/selection/SelectionContext.js.map +1 -0
  528. package/dist/features/selection/overlay.js +442 -0
  529. package/dist/features/selection/overlay.js.map +1 -0
  530. package/dist/features/simulation/createSimulation.js +61 -0
  531. package/dist/features/simulation/createSimulation.js.map +1 -0
  532. package/dist/features/simulation/types.js +6 -0
  533. package/dist/features/simulation/types.js.map +1 -0
  534. package/dist/features/simulation/useSimulation.js +74 -0
  535. package/dist/features/simulation/useSimulation.js.map +1 -0
  536. package/dist/features/text/domRuns.js +258 -0
  537. package/dist/features/text/domRuns.js.map +1 -0
  538. package/dist/features/text/fitTextPose.js +38 -0
  539. package/dist/features/text/fitTextPose.js.map +1 -0
  540. package/dist/features/text/hitTest.js +45 -0
  541. package/dist/features/text/hitTest.js.map +1 -0
  542. package/dist/features/text/renderLabel.js +14 -0
  543. package/dist/features/text/renderLabel.js.map +1 -0
  544. package/dist/features/text/runs/effectiveRangeStyle.js +66 -0
  545. package/dist/features/text/runs/effectiveRangeStyle.js.map +1 -0
  546. package/dist/features/text/runs/flagRange.js +53 -0
  547. package/dist/features/text/runs/flagRange.js.map +1 -0
  548. package/dist/features/text/runs/rangeStyle.js +135 -0
  549. package/dist/features/text/runs/rangeStyle.js.map +1 -0
  550. package/dist/features/text/textCommand.js +59 -0
  551. package/dist/features/text/textCommand.js.map +1 -0
  552. package/dist/features/text/textLayer.js +35 -0
  553. package/dist/features/text/textLayer.js.map +1 -0
  554. package/dist/features/text/textToPath.js +181 -0
  555. package/dist/features/text/textToPath.js.map +1 -0
  556. package/dist/features/text/useSceneTextEdit.js +138 -0
  557. package/dist/features/text/useSceneTextEdit.js.map +1 -0
  558. package/dist/features/text/useTextEdit.js +465 -0
  559. package/dist/features/text/useTextEdit.js.map +1 -0
  560. package/dist/features/tiling/createTiledLayer.js +63 -0
  561. package/dist/features/tiling/createTiledLayer.js.map +1 -0
  562. package/dist/features/tiling/tiledProject.js +14 -0
  563. package/dist/features/tiling/tiledProject.js.map +1 -0
  564. package/dist/features/viewports/viewResolver.js +59 -0
  565. package/dist/features/viewports/viewResolver.js.map +1 -0
  566. package/dist/features/viewports/viewportLayer.js +58 -0
  567. package/dist/features/viewports/viewportLayer.js.map +1 -0
  568. package/dist/icons/ArrowIcon.js +23 -0
  569. package/dist/icons/ArrowIcon.js.map +1 -0
  570. package/dist/icons/EllipseIcon.js +21 -0
  571. package/dist/icons/EllipseIcon.js.map +1 -0
  572. package/dist/icons/EyedropperIcon.js +49 -0
  573. package/dist/icons/EyedropperIcon.js.map +1 -0
  574. package/dist/icons/HandIcon.js +59 -0
  575. package/dist/icons/HandIcon.js.map +1 -0
  576. package/dist/icons/ImageIcon.js +34 -0
  577. package/dist/icons/ImageIcon.js.map +1 -0
  578. package/dist/icons/LassoIcon.js +22 -0
  579. package/dist/icons/LassoIcon.js.map +1 -0
  580. package/dist/icons/LineIcon.js +22 -0
  581. package/dist/icons/LineIcon.js.map +1 -0
  582. package/dist/icons/PenIcon.js +36 -0
  583. package/dist/icons/PenIcon.js.map +1 -0
  584. package/dist/icons/PencilIcon.js +25 -0
  585. package/dist/icons/PencilIcon.js.map +1 -0
  586. package/dist/icons/PolygonIcon.js +19 -0
  587. package/dist/icons/PolygonIcon.js.map +1 -0
  588. package/dist/icons/RectIcon.js +37 -0
  589. package/dist/icons/RectIcon.js.map +1 -0
  590. package/dist/icons/SelectIcon.js +20 -0
  591. package/dist/icons/SelectIcon.js.map +1 -0
  592. package/dist/icons/StarIcon.js +19 -0
  593. package/dist/icons/StarIcon.js.map +1 -0
  594. package/dist/icons/TextIcon.js +19 -0
  595. package/dist/icons/TextIcon.js.map +1 -0
  596. package/dist/icons/UnknownIcon.js +33 -0
  597. package/dist/icons/UnknownIcon.js.map +1 -0
  598. package/dist/icons/_base.js +12 -0
  599. package/dist/icons/_base.js.map +1 -0
  600. package/dist/index.css +2 -86
  601. package/dist/index.d.ts +2349 -2609
  602. package/dist/index.js +312 -13
  603. package/dist/input/keyState.js +76 -0
  604. package/dist/input/keyState.js.map +1 -0
  605. package/dist/input/useKeyState.js +22 -0
  606. package/dist/input/useKeyState.js.map +1 -0
  607. package/dist/interactions/actions/actionShortcuts.js +32 -0
  608. package/dist/interactions/actions/actionShortcuts.js.map +1 -0
  609. package/dist/interactions/actions/align/align.js +81 -0
  610. package/dist/interactions/actions/align/align.js.map +1 -0
  611. package/dist/interactions/actions/booleans/booleans.js +120 -0
  612. package/dist/interactions/actions/booleans/booleans.js.map +1 -0
  613. package/dist/interactions/actions/booleans/useBooleans.js +20 -0
  614. package/dist/interactions/actions/booleans/useBooleans.js.map +1 -0
  615. package/dist/interactions/actions/booleans/useBooleansAdapter.js +9 -0
  616. package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -0
  617. package/dist/interactions/actions/clipboard/clipboardOps.js +94 -0
  618. package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -0
  619. package/dist/interactions/actions/clipboard/materializePaste.js +25 -0
  620. package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -0
  621. package/dist/interactions/actions/clipboard/wireFormat.js +43 -0
  622. package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -0
  623. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js +26 -0
  624. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js.map +1 -0
  625. package/dist/interactions/actions/defaultCommitAdapter.js +42 -0
  626. package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -0
  627. package/dist/interactions/actions/defaults/align.js +71 -0
  628. package/dist/interactions/actions/defaults/align.js.map +1 -0
  629. package/dist/interactions/actions/defaults/anchorEditing.js +235 -0
  630. package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -0
  631. package/dist/interactions/actions/defaults/areaSelect.js +75 -0
  632. package/dist/interactions/actions/defaults/areaSelect.js.map +1 -0
  633. package/dist/interactions/actions/defaults/booleans.js +52 -0
  634. package/dist/interactions/actions/defaults/booleans.js.map +1 -0
  635. package/dist/interactions/actions/defaults/cancelGesture.js +24 -0
  636. package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -0
  637. package/dist/interactions/actions/defaults/clearSelection.js +19 -0
  638. package/dist/interactions/actions/defaults/clearSelection.js.map +1 -0
  639. package/dist/interactions/actions/defaults/clipboard.js +78 -0
  640. package/dist/interactions/actions/defaults/clipboard.js.map +1 -0
  641. package/dist/interactions/actions/defaults/clone.js +96 -0
  642. package/dist/interactions/actions/defaults/clone.js.map +1 -0
  643. package/dist/interactions/actions/defaults/createOutlines.js +47 -0
  644. package/dist/interactions/actions/defaults/createOutlines.js.map +1 -0
  645. package/dist/interactions/actions/defaults/createPaintAction.js +85 -0
  646. package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -0
  647. package/dist/interactions/actions/defaults/delete.js +61 -0
  648. package/dist/interactions/actions/defaults/delete.js.map +1 -0
  649. package/dist/interactions/actions/defaults/distribute.js +66 -0
  650. package/dist/interactions/actions/defaults/distribute.js.map +1 -0
  651. package/dist/interactions/actions/defaults/duplicate.js +83 -0
  652. package/dist/interactions/actions/defaults/duplicate.js.map +1 -0
  653. package/dist/interactions/actions/defaults/editAnchors.js +100 -0
  654. package/dist/interactions/actions/defaults/editAnchors.js.map +1 -0
  655. package/dist/interactions/actions/defaults/enterPathEdit.js +29 -0
  656. package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -0
  657. package/dist/interactions/actions/defaults/enterTextEdit.js +20 -0
  658. package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -0
  659. package/dist/interactions/actions/defaults/escape.js +26 -0
  660. package/dist/interactions/actions/defaults/escape.js.map +1 -0
  661. package/dist/interactions/actions/defaults/exitPathEdit.js +22 -0
  662. package/dist/interactions/actions/defaults/exitPathEdit.js.map +1 -0
  663. package/dist/interactions/actions/defaults/flip.js +119 -0
  664. package/dist/interactions/actions/defaults/flip.js.map +1 -0
  665. package/dist/interactions/actions/defaults/freshNodeId.js +10 -0
  666. package/dist/interactions/actions/defaults/freshNodeId.js.map +1 -0
  667. package/dist/interactions/actions/defaults/group.js +131 -0
  668. package/dist/interactions/actions/defaults/group.js.map +1 -0
  669. package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js +40 -0
  670. package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js.map +1 -0
  671. package/dist/interactions/actions/defaults/icons/actionGlyphs.js +10 -0
  672. package/dist/interactions/actions/defaults/icons/actionGlyphs.js.map +1 -0
  673. package/dist/interactions/actions/defaults/icons/alignIcons.js +173 -0
  674. package/dist/interactions/actions/defaults/icons/alignIcons.js.map +1 -0
  675. package/dist/interactions/actions/defaults/icons/booleanIcons.js +171 -0
  676. package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +1 -0
  677. package/dist/interactions/actions/defaults/icons/distributeIcons.js +63 -0
  678. package/dist/interactions/actions/defaults/icons/distributeIcons.js.map +1 -0
  679. package/dist/interactions/actions/defaults/icons/editIcons.js +280 -0
  680. package/dist/interactions/actions/defaults/icons/editIcons.js.map +1 -0
  681. package/dist/interactions/actions/defaults/icons/outlineIcons.js +53 -0
  682. package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +1 -0
  683. package/dist/interactions/actions/defaults/ingest.js +58 -0
  684. package/dist/interactions/actions/defaults/ingest.js.map +1 -0
  685. package/dist/interactions/actions/defaults/insert.js +288 -0
  686. package/dist/interactions/actions/defaults/insert.js.map +1 -0
  687. package/dist/interactions/actions/defaults/insertPathAnchor.js +50 -0
  688. package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -0
  689. package/dist/interactions/actions/defaults/lassoSelect.js +156 -0
  690. package/dist/interactions/actions/defaults/lassoSelect.js.map +1 -0
  691. package/dist/interactions/actions/defaults/move.js +656 -0
  692. package/dist/interactions/actions/defaults/move.js.map +1 -0
  693. package/dist/interactions/actions/defaults/nudge.js +110 -0
  694. package/dist/interactions/actions/defaults/nudge.js.map +1 -0
  695. package/dist/interactions/actions/defaults/pinchZoom.js +63 -0
  696. package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -0
  697. package/dist/interactions/actions/defaults/reorder.js +143 -0
  698. package/dist/interactions/actions/defaults/reorder.js.map +1 -0
  699. package/dist/interactions/actions/defaults/requiresSelection.js +10 -0
  700. package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -0
  701. package/dist/interactions/actions/defaults/resize.js +332 -0
  702. package/dist/interactions/actions/defaults/resize.js.map +1 -0
  703. package/dist/interactions/actions/defaults/rotate.js +181 -0
  704. package/dist/interactions/actions/defaults/rotate.js.map +1 -0
  705. package/dist/interactions/actions/defaults/selectAll.js +27 -0
  706. package/dist/interactions/actions/defaults/selectAll.js.map +1 -0
  707. package/dist/interactions/actions/defaults/setFill.js +27 -0
  708. package/dist/interactions/actions/defaults/setFill.js.map +1 -0
  709. package/dist/interactions/actions/defaults/setFillOpacity.js +15 -0
  710. package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -0
  711. package/dist/interactions/actions/defaults/setStroke.js +36 -0
  712. package/dist/interactions/actions/defaults/setStroke.js.map +1 -0
  713. package/dist/interactions/actions/defaults/setStrokeOpacity.js +21 -0
  714. package/dist/interactions/actions/defaults/setStrokeOpacity.js.map +1 -0
  715. package/dist/interactions/actions/defaults/slice.js +39 -0
  716. package/dist/interactions/actions/defaults/slice.js.map +1 -0
  717. package/dist/interactions/actions/defaults/sliceOps.js +60 -0
  718. package/dist/interactions/actions/defaults/sliceOps.js.map +1 -0
  719. package/dist/interactions/actions/defaults/toolActivate.js +35 -0
  720. package/dist/interactions/actions/defaults/toolActivate.js.map +1 -0
  721. package/dist/interactions/actions/defaults/toolResetToDefault.js +26 -0
  722. package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -0
  723. package/dist/interactions/actions/defaults/undoRedo.js +51 -0
  724. package/dist/interactions/actions/defaults/undoRedo.js.map +1 -0
  725. package/dist/interactions/actions/defaults/viewportDragPan.js +88 -0
  726. package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -0
  727. package/dist/interactions/actions/defaults/viewportWheelPan.js +57 -0
  728. package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -0
  729. package/dist/interactions/actions/defaults/viewportZoom.js +143 -0
  730. package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -0
  731. package/dist/interactions/actions/distribute/distribute.js +42 -0
  732. package/dist/interactions/actions/distribute/distribute.js.map +1 -0
  733. package/dist/interactions/actions/distribute/plan.js +29 -0
  734. package/dist/interactions/actions/distribute/plan.js.map +1 -0
  735. package/dist/interactions/actions/edit-anchors/geometry.js +61 -0
  736. package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -0
  737. package/dist/interactions/actions/edit-anchors/handles.js +43 -0
  738. package/dist/interactions/actions/edit-anchors/handles.js.map +1 -0
  739. package/dist/interactions/actions/flip/helpers.js +35 -0
  740. package/dist/interactions/actions/flip/helpers.js.map +1 -0
  741. package/dist/interactions/actions/geometryProjection.js +18 -0
  742. package/dist/interactions/actions/geometryProjection.js.map +1 -0
  743. package/dist/interactions/actions/gestureLifecycle.js +44 -0
  744. package/dist/interactions/actions/gestureLifecycle.js.map +1 -0
  745. package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +39 -0
  746. package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js.map +1 -0
  747. package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +36 -0
  748. package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js.map +1 -0
  749. package/dist/interactions/actions/move/behaviors/snapToContainer.js +67 -0
  750. package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -0
  751. package/dist/interactions/actions/move/gestureAdapter.js +37 -0
  752. package/dist/interactions/actions/move/gestureAdapter.js.map +1 -0
  753. package/dist/interactions/actions/outlines/createOutlines.js +84 -0
  754. package/dist/interactions/actions/outlines/createOutlines.js.map +1 -0
  755. package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js +9 -0
  756. package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js.map +1 -0
  757. package/dist/interactions/actions/planeInput.js +168 -0
  758. package/dist/interactions/actions/planeInput.js.map +1 -0
  759. package/dist/interactions/actions/poseDescriptorDep.js +9 -0
  760. package/dist/interactions/actions/poseDescriptorDep.js.map +1 -0
  761. package/dist/interactions/actions/poseFrame.js +38 -0
  762. package/dist/interactions/actions/poseFrame.js.map +1 -0
  763. package/dist/interactions/actions/previewOverrides.js +25 -0
  764. package/dist/interactions/actions/previewOverrides.js.map +1 -0
  765. package/dist/interactions/actions/resize/autoPoseDescriptor.js +32 -0
  766. package/dist/interactions/actions/resize/autoPoseDescriptor.js.map +1 -0
  767. package/dist/interactions/actions/resize/behaviors/clampMinSize.js +18 -0
  768. package/dist/interactions/actions/resize/behaviors/clampMinSize.js.map +1 -0
  769. package/dist/interactions/actions/resize/behaviors/index.js +8 -0
  770. package/dist/interactions/actions/resize/behaviors/index.js.map +1 -0
  771. package/dist/interactions/actions/resize/behaviors/lockAspect.js +24 -0
  772. package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +1 -0
  773. package/dist/interactions/actions/resize/cornerHandles.js +72 -0
  774. package/dist/interactions/actions/resize/cornerHandles.js.map +1 -0
  775. package/dist/interactions/actions/resolveOverlays.js +60 -0
  776. package/dist/interactions/actions/resolveOverlays.js.map +1 -0
  777. package/dist/interactions/actions/resolvePreviews.js +61 -0
  778. package/dist/interactions/actions/resolvePreviews.js.map +1 -0
  779. package/dist/interactions/actions/rotate/geometry.js +46 -0
  780. package/dist/interactions/actions/rotate/geometry.js.map +1 -0
  781. package/dist/interactions/actions/rotate/handle.js +27 -0
  782. package/dist/interactions/actions/rotate/handle.js.map +1 -0
  783. package/dist/interactions/actions/spatialReference.js +42 -0
  784. package/dist/interactions/actions/spatialReference.js.map +1 -0
  785. package/dist/interactions/actions/useStandardActions.js +142 -0
  786. package/dist/interactions/actions/useStandardActions.js.map +1 -0
  787. package/dist/interactions/gestures/dragGesture/dragGesture.js +111 -0
  788. package/dist/interactions/gestures/dragGesture/dragGesture.js.map +1 -0
  789. package/dist/interactions/gestures/dragRadial/dragRadial.js +117 -0
  790. package/dist/interactions/gestures/dragRadial/dragRadial.js.map +1 -0
  791. package/dist/interactions/gestures/dragRect/dragRect.js +164 -0
  792. package/dist/interactions/gestures/dragRect/dragRect.js.map +1 -0
  793. package/dist/interactions/gestures/handleDrag/handleDrag.js +46 -0
  794. package/dist/interactions/gestures/handleDrag/handleDrag.js.map +1 -0
  795. package/dist/interactions/gestures/pointerDrag/pointerDrag.js +118 -0
  796. package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -0
  797. package/dist/interactions/gestures/shared/originProjection.js +42 -0
  798. package/dist/interactions/gestures/shared/originProjection.js.map +1 -0
  799. package/dist/interactions/gestures/shared/screenTolerance.js +21 -0
  800. package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -0
  801. package/dist/interactions/gestures/shared/snap.js +24 -0
  802. package/dist/interactions/gestures/shared/snap.js.map +1 -0
  803. package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +30 -0
  804. package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js.map +1 -0
  805. package/dist/layout/arrivals.js +36 -0
  806. package/dist/layout/arrivals.js.map +1 -0
  807. package/dist/{math-MCQcf_gc.d.ts → math-CUMxmZzn.d.ts} +8 -116
  808. package/dist/math.d.ts +4 -5
  809. package/dist/math.js +6 -4
  810. package/dist/mesh.d.ts +268 -0
  811. package/dist/mesh.js +7 -0
  812. package/dist/move.d.ts +7 -48
  813. package/dist/move.js +3 -142
  814. package/dist/originProjection-BSn4xiEy.d.ts +57 -0
  815. package/dist/patterns-builtin.js +3 -3
  816. package/dist/{poseDescriptor-rZa9W5hJ.d.ts → poseDescriptor-CjSXMf8X.d.ts} +3 -3
  817. package/dist/registerProgram-ateHDGjw.d.ts +193 -0
  818. package/dist/renderer/DrawCommand.js +6 -0
  819. package/dist/renderer/DrawCommand.js.map +1 -0
  820. package/dist/renderer/WeaselRenderer.js +328 -0
  821. package/dist/renderer/WeaselRenderer.js.map +1 -0
  822. package/dist/renderer/cache/GLImageCache.js +64 -0
  823. package/dist/renderer/cache/GLImageCache.js.map +1 -0
  824. package/dist/renderer/cache/GLMeshCache.js +102 -0
  825. package/dist/renderer/cache/GLMeshCache.js.map +1 -0
  826. package/dist/renderer/cache/GLTextureCache.js +51 -0
  827. package/dist/renderer/cache/GLTextureCache.js.map +1 -0
  828. package/dist/renderer/cache/GradientRampAtlas.js +82 -0
  829. package/dist/renderer/cache/GradientRampAtlas.js.map +1 -0
  830. package/dist/renderer/cache/cache.js +13 -0
  831. package/dist/renderer/cache/cache.js.map +1 -0
  832. package/dist/renderer/cache/markerCommandCache.js +59 -0
  833. package/dist/renderer/cache/markerCommandCache.js.map +1 -0
  834. package/dist/renderer/cache/outlineMeshCache.js +15 -0
  835. package/dist/renderer/cache/outlineMeshCache.js.map +1 -0
  836. package/dist/renderer/cache/outlineStrokeMeshCache.js +31 -0
  837. package/dist/renderer/cache/outlineStrokeMeshCache.js.map +1 -0
  838. package/dist/renderer/cache/strokeMeshCache.js +44 -0
  839. package/dist/renderer/cache/strokeMeshCache.js.map +1 -0
  840. package/dist/renderer/cullDrawCommands.js +89 -0
  841. package/dist/renderer/cullDrawCommands.js.map +1 -0
  842. package/dist/renderer/draw.js +1109 -0
  843. package/dist/renderer/draw.js.map +1 -0
  844. package/dist/renderer/drawBatch.js +168 -0
  845. package/dist/renderer/drawBatch.js.map +1 -0
  846. package/dist/renderer/effects/EffectTargets.js +45 -0
  847. package/dist/renderer/effects/EffectTargets.js.map +1 -0
  848. package/dist/renderer/effects/builtins.js +31 -0
  849. package/dist/renderer/effects/builtins.js.map +1 -0
  850. package/dist/renderer/effects/composite.js +9 -0
  851. package/dist/renderer/effects/composite.js.map +1 -0
  852. package/dist/renderer/effects/effectPrelude.js +10 -0
  853. package/dist/renderer/effects/effectPrelude.js.map +1 -0
  854. package/dist/renderer/effects/types.js +10 -0
  855. package/dist/renderer/effects/types.js.map +1 -0
  856. package/dist/renderer/index.js +19 -0
  857. package/dist/renderer/math/color.js +341 -0
  858. package/dist/renderer/math/color.js.map +1 -0
  859. package/dist/renderer/math/mat3.js +71 -0
  860. package/dist/renderer/math/mat3.js.map +1 -0
  861. package/dist/renderer/math/patternSpace.js +22 -0
  862. package/dist/renderer/math/patternSpace.js.map +1 -0
  863. package/dist/renderer/math/viewToMat3.js +19 -0
  864. package/dist/renderer/math/viewToMat3.js.map +1 -0
  865. package/dist/renderer/paintResources.js +18 -0
  866. package/dist/renderer/paintResources.js.map +1 -0
  867. package/dist/renderer/paintScratch.js +37 -0
  868. package/dist/renderer/paintScratch.js.map +1 -0
  869. package/dist/renderer/shaders/ShaderProgram.js +74 -0
  870. package/dist/renderer/shaders/ShaderProgram.js.map +1 -0
  871. package/dist/renderer/shaders/batchFill.js +118 -0
  872. package/dist/renderer/shaders/batchFill.js.map +1 -0
  873. package/dist/renderer/shaders/customPrelude.js +34 -0
  874. package/dist/renderer/shaders/customPrelude.js.map +1 -0
  875. package/dist/renderer/shaders/extractUniformNames.js +184 -0
  876. package/dist/renderer/shaders/extractUniformNames.js.map +1 -0
  877. package/dist/renderer/shaders/glyphPaint.js +61 -0
  878. package/dist/renderer/shaders/glyphPaint.js.map +1 -0
  879. package/dist/renderer/shaders/gradFill.js +30 -0
  880. package/dist/renderer/shaders/gradFill.js.map +1 -0
  881. package/dist/renderer/shaders/imageFill.js +14 -0
  882. package/dist/renderer/shaders/imageFill.js.map +1 -0
  883. package/dist/renderer/shaders/pathFill.js +13 -0
  884. package/dist/renderer/shaders/pathFill.js.map +1 -0
  885. package/dist/renderer/shaders/patternFill.js +24 -0
  886. package/dist/renderer/shaders/patternFill.js.map +1 -0
  887. package/dist/renderer/shaders/registerProgram.js +18 -0
  888. package/dist/renderer/shaders/registerProgram.js.map +1 -0
  889. package/dist/renderer/spriteSheet.js +14 -0
  890. package/dist/renderer/spriteSheet.js.map +1 -0
  891. package/dist/renderer/state/GroupState.js +77 -0
  892. package/dist/renderer/state/GroupState.js.map +1 -0
  893. package/dist/renderer/syntheticItalic.js +6 -0
  894. package/dist/renderer/syntheticItalic.js.map +1 -0
  895. package/dist/renderer/textures/registerTexture.js +14 -0
  896. package/dist/renderer/textures/registerTexture.js.map +1 -0
  897. package/dist/renderer.d.ts +18 -20
  898. package/dist/renderer.js +18 -13
  899. package/dist/resize.d.ts +10 -46
  900. package/dist/resize.js +7 -5
  901. package/dist/routing.d.ts +1 -1
  902. package/dist/routing.js +2 -3
  903. package/dist/scheduling/useVisibleRaf.js +69 -0
  904. package/dist/scheduling/useVisibleRaf.js.map +1 -0
  905. package/dist/test-hook/createTestHook.js +39 -0
  906. package/dist/test-hook/createTestHook.js.map +1 -0
  907. package/dist/test-hook/install.js +12 -0
  908. package/dist/test-hook/install.js.map +1 -0
  909. package/dist/test-seams-fYf6m5pu.d.ts +356 -0
  910. package/dist/test-seams.d.ts +6 -0
  911. package/dist/test-seams.js +3 -0
  912. package/dist/tools/builtin/ellipse/useEllipseTool.js +33 -0
  913. package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -0
  914. package/dist/tools/builtin/eyedropper/useEyedropperTool.js +55 -0
  915. package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -0
  916. package/dist/tools/builtin/hand/dragPanContribution.js +17 -0
  917. package/dist/tools/builtin/hand/dragPanContribution.js.map +1 -0
  918. package/dist/tools/builtin/hand/useHandTool.js +31 -0
  919. package/dist/tools/builtin/hand/useHandTool.js.map +1 -0
  920. package/dist/tools/builtin/image/useImageTool.js +41 -0
  921. package/dist/tools/builtin/image/useImageTool.js.map +1 -0
  922. package/dist/tools/builtin/lasso/useLassoTool.js +42 -0
  923. package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -0
  924. package/dist/tools/builtin/line/useLineTool.js +33 -0
  925. package/dist/tools/builtin/line/useLineTool.js.map +1 -0
  926. package/dist/tools/builtin/pen/usePenTool.js +414 -0
  927. package/dist/tools/builtin/pen/usePenTool.js.map +1 -0
  928. package/dist/tools/builtin/pencil/usePencilTool.js +36 -0
  929. package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -0
  930. package/dist/tools/builtin/pickTopMostHit.js +45 -0
  931. package/dist/tools/builtin/pickTopMostHit.js.map +1 -0
  932. package/dist/tools/builtin/polygon/usePolygonTool.js +81 -0
  933. package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -0
  934. package/dist/tools/builtin/rect/useRectTool.js +32 -0
  935. package/dist/tools/builtin/rect/useRectTool.js.map +1 -0
  936. package/dist/tools/builtin/select/selectionContributions.js +109 -0
  937. package/dist/tools/builtin/select/selectionContributions.js.map +1 -0
  938. package/dist/tools/builtin/select/useSelectTool.js +162 -0
  939. package/dist/tools/builtin/select/useSelectTool.js.map +1 -0
  940. package/dist/tools/builtin/shared/insertToolOptions.js +8 -0
  941. package/dist/tools/builtin/shared/insertToolOptions.js.map +1 -0
  942. package/dist/tools/builtin/slice/useSliceTool.js +263 -0
  943. package/dist/tools/builtin/slice/useSliceTool.js.map +1 -0
  944. package/dist/tools/builtin/star/useStarTool.js +82 -0
  945. package/dist/tools/builtin/star/useStarTool.js.map +1 -0
  946. package/dist/tools/builtin/text/useTextTool.js +177 -0
  947. package/dist/tools/builtin/text/useTextTool.js.map +1 -0
  948. package/dist/tools/overlayBinding.js +8 -0
  949. package/dist/tools/overlayBinding.js.map +1 -0
  950. package/dist/tools/prefs.js +47 -0
  951. package/dist/tools/prefs.js.map +1 -0
  952. package/dist/tools/useKeybindings.js +66 -0
  953. package/dist/tools/useKeybindings.js.map +1 -0
  954. package/dist/{types-CxC8P6W0.d.ts → types-CA54-mAZ.d.ts} +188 -17
  955. package/dist/{types-D_74YlWs.d.ts → types-DSjd6W3n.d.ts} +35 -12
  956. package/dist/util/color.js +26 -0
  957. package/dist/util/color.js.map +1 -0
  958. package/dist/util/constrainTo45.js +17 -0
  959. package/dist/util/constrainTo45.js.map +1 -0
  960. package/dist/util/paint.js +72 -0
  961. package/dist/util/paint.js.map +1 -0
  962. package/dist/version.js +6 -0
  963. package/dist/version.js.map +1 -0
  964. package/package.json +31 -18
  965. package/dist/chunk-44EWMJV2.js +0 -128
  966. package/dist/chunk-44EWMJV2.js.map +0 -1
  967. package/dist/chunk-4RJP2N2L.js +0 -143
  968. package/dist/chunk-4RJP2N2L.js.map +0 -1
  969. package/dist/chunk-BJN5ZRIJ.js +0 -167
  970. package/dist/chunk-BJN5ZRIJ.js.map +0 -1
  971. package/dist/chunk-D4AAWR64.js +0 -28
  972. package/dist/chunk-D4AAWR64.js.map +0 -1
  973. package/dist/chunk-DOBSZOPR.js +0 -29
  974. package/dist/chunk-DOBSZOPR.js.map +0 -1
  975. package/dist/chunk-H6N2JSZ3.js +0 -248
  976. package/dist/chunk-H6N2JSZ3.js.map +0 -1
  977. package/dist/chunk-HPFJUUTF.js +0 -167
  978. package/dist/chunk-HPFJUUTF.js.map +0 -1
  979. package/dist/chunk-L5YNZYEG.js +0 -648
  980. package/dist/chunk-L5YNZYEG.js.map +0 -1
  981. package/dist/chunk-MZAIDI6D.js +0 -32492
  982. package/dist/chunk-MZAIDI6D.js.map +0 -1
  983. package/dist/chunk-PNNZSYRD.js +0 -318
  984. package/dist/chunk-PNNZSYRD.js.map +0 -1
  985. package/dist/chunk-RMR4QMM6.js +0 -250
  986. package/dist/chunk-RMR4QMM6.js.map +0 -1
  987. package/dist/clipboard.js.map +0 -1
  988. package/dist/clone.js.map +0 -1
  989. package/dist/grid-BXdz8GF2.d.ts +0 -158
  990. package/dist/index.css.map +0 -1
  991. package/dist/index.js.map +0 -1
  992. package/dist/insert.d.ts +0 -37
  993. package/dist/insert.js +0 -81
  994. package/dist/insert.js.map +0 -1
  995. package/dist/math.js.map +0 -1
  996. package/dist/move.js.map +0 -1
  997. package/dist/options-CzjxFoYZ.d.ts +0 -67
  998. package/dist/path-JEV2c5If.d.ts +0 -48
  999. package/dist/patterns-builtin.js.map +0 -1
  1000. package/dist/renderer.css +0 -86
  1001. package/dist/renderer.css.map +0 -1
  1002. package/dist/renderer.js.map +0 -1
  1003. package/dist/resize.js.map +0 -1
  1004. package/dist/routing.js.map +0 -1
  1005. package/dist/types-D2tTKEU0.d.ts +0 -18
@@ -0,0 +1,1109 @@
1
+ import { createPaintResources as e } from "./paintResources.js";
2
+ import { BATCH_TEXTURE_SLOTS as t, PAINT_MODE_CONIC as n, PAINT_MODE_PLAIN as r, PAINT_MODE_RADIAL as i } from "./shaders/batchFill.js";
3
+ import { resolveColor as a } from "./math/color.js";
4
+ import { mat3 as o } from "./math/mat3.js";
5
+ import { IDENTITY_COLOR_MATRIX as s } from "./state/GroupState.js";
6
+ import { getTexture as c } from "./textures/registerTexture.js";
7
+ import { getPaintKind as l } from "../core/paintKinds.js";
8
+ import { SPRITE_STRIDE as u } from "./DrawCommand.js";
9
+ import { patternTileSpace as d } from "./math/patternSpace.js";
10
+ import { getMesh as f } from "./cache/cache.js";
11
+ import { resolveStrokeWidth as p } from "../features/paths/tessellate/stroke.js";
12
+ import { outlineMesh as m } from "./cache/outlineMeshCache.js";
13
+ import { outlineStrokeMesh as h, quantizeEmWidth as g } from "./cache/outlineStrokeMeshCache.js";
14
+ import { resolveMarkerSize as _ } from "../core/markerInset.js";
15
+ import { quantizeStrokeScale as v, strokeMesh as y } from "./cache/strokeMeshCache.js";
16
+ import { cachedMarkerCommands as b } from "./cache/markerCommandCache.js";
17
+ import { COMPOSITE_PROGRAM_ID as ee } from "./effects/composite.js";
18
+ import { SYNTHETIC_ITALIC_RADIANS as x } from "./syntheticItalic.js";
19
+ import { GLYPH_MODE_MSDF as S, GLYPH_MODE_R8 as te, dynamicPageTextureId as C, ensureFontTexture as ne, glyphFieldScale as re, syncDynamicPageTexture as ie, textureCacheKey as ae } from "@weasel-js/font";
20
+ import { cachedLayoutRuns as oe, resolveTextStyle as se, verticalAlignOffset as ce } from "@weasel-js/text";
21
+ import { tessellate as le } from "@weasel-js/geom/tessellate";
22
+ //#region src/renderer/draw.ts
23
+ function w(e, t, n) {
24
+ e.gl.drawElements(e.gl.TRIANGLES, t, n, 0), e.stats && e.stats.drawCalls++;
25
+ }
26
+ var ue = /* @__PURE__ */ new WeakMap(), de = /* @__PURE__ */ new WeakMap();
27
+ function T(e, t) {
28
+ let n = ue.get(e);
29
+ n || (n = /* @__PURE__ */ new WeakMap(), ue.set(e, n));
30
+ let r = n.get(t);
31
+ return r || (r = {}, n.set(t, r)), r;
32
+ }
33
+ function E(e, t) {
34
+ if (e === void 0 || e.length !== t.length) return !1;
35
+ for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
36
+ return !0;
37
+ }
38
+ function fe(e, t, n, r, i, a) {
39
+ let o = t.uniform("u_color");
40
+ if (o === void 0) return;
41
+ let s = T(e, t), c = s.color;
42
+ (c === void 0 || c[0] !== n || c[1] !== r || c[2] !== i || c[3] !== a) && (e.gl.uniform4f(o, n, r, i, a), s.color = [
43
+ n,
44
+ r,
45
+ i,
46
+ a
47
+ ]);
48
+ }
49
+ function D(e, t, n) {
50
+ let r = t.uniform("u_alpha");
51
+ if (r === void 0) return;
52
+ let i = T(e, t);
53
+ i.alpha !== n && (e.gl.uniform1f(r, n), i.alpha = n);
54
+ }
55
+ var O = o.identity();
56
+ function pe(e) {
57
+ let t = de.get(e);
58
+ return t || (t = o.screenToClip(e.widthCss, e.heightCss), de.set(e, t)), t;
59
+ }
60
+ var k = /* @__PURE__ */ new Float32Array(16);
61
+ function A(e, t, n = e.state.colorMatrix) {
62
+ let r = e.gl, i = T(e, t), a = t.uniform("u_colorMatrix");
63
+ if (a !== void 0) {
64
+ for (let e = 0; e < 4; e++) for (let t = 0; t < 4; t++) k[t * 4 + e] = n[e * 5 + t];
65
+ E(i.colorMatrix, k) || (r.uniformMatrix4fv(a, !1, k), i.colorMatrix = Float32Array.from(k));
66
+ }
67
+ let o = t.uniform("u_colorBias");
68
+ if (o !== void 0) {
69
+ let e = [
70
+ n[4],
71
+ n[9],
72
+ n[14],
73
+ n[19]
74
+ ];
75
+ E(i.colorBias, e) || (r.uniform4f(o, e[0], e[1], e[2], e[3]), i.colorBias = Float32Array.from(e));
76
+ }
77
+ }
78
+ function me(e, t) {
79
+ return e.flattenTolerance === void 0 ? f(t) : le(t, { flattenTolerance: e.flattenTolerance });
80
+ }
81
+ function he(e, t) {
82
+ return e.flattenTolerance === void 0 ? e.meshCache.handleFor(t) : e.meshCache.uploadTransient(t);
83
+ }
84
+ function ge(e, t) {
85
+ return he(e, me(e, t));
86
+ }
87
+ function j(e, t) {
88
+ switch (t.kind) {
89
+ case "group": return Oe(e, t);
90
+ case "path": return ke(e, t);
91
+ case "text": return bt(e, t);
92
+ case "image": return Lt(e, t);
93
+ case "sprites": return Rt(e, t);
94
+ case "shader": return H(e), we(e, t);
95
+ }
96
+ }
97
+ var _e = /* @__PURE__ */ new Set();
98
+ function ve(e, t) {
99
+ let n = `${e}:${t}`;
100
+ _e.has(n) || (_e.add(n), (typeof process > "u" || process.env.NODE_ENV !== "production") && console.warn(`weasel drawShader: uniform "${t}" not found in program "${e}". Check spelling, ensure it's used in the shader (unused uniforms are optimized away by the driver).`));
101
+ }
102
+ function ye(e, t, n, r, i) {
103
+ if (typeof n == "object" && n && !Array.isArray(n) && !(n instanceof Float32Array) && "id" in n && typeof n.id == "string") {
104
+ let a = n, o = c(a.id);
105
+ if (!o) {
106
+ (typeof process > "u" || process.env.NODE_ENV !== "production") && console.warn(`weasel setUniform: TextureHandle "${a.id}" not registered`);
107
+ return;
108
+ }
109
+ let s = i.value++;
110
+ r.upload(a.id, o.source), r.bind(a.id, s), e.uniform1i(t, s);
111
+ return;
112
+ }
113
+ if (n instanceof Float32Array) {
114
+ if (n.length === 9) e.uniformMatrix3fv(t, !1, n);
115
+ else if (n.length === 16) e.uniformMatrix4fv(t, !1, n);
116
+ else if (typeof process > "u" || process.env.NODE_ENV !== "production") throw TypeError(`weasel setUniform: Float32Array must be length 9 (mat3) or 16 (mat4), got ${n.length}`);
117
+ return;
118
+ }
119
+ if (Array.isArray(n)) {
120
+ let r = n;
121
+ switch (r.length) {
122
+ case 2:
123
+ e.uniform2fv(t, r);
124
+ break;
125
+ case 3:
126
+ e.uniform3fv(t, r);
127
+ break;
128
+ case 4:
129
+ e.uniform4fv(t, r);
130
+ break;
131
+ default: if (typeof process > "u" || process.env.NODE_ENV !== "production") throw TypeError(`weasel setUniform: array length ${r.length} not supported`);
132
+ }
133
+ return;
134
+ }
135
+ if (typeof n == "number") {
136
+ e.uniform1f(t, n);
137
+ return;
138
+ }
139
+ }
140
+ var be = {
141
+ float: {
142
+ fn: "uniform1fv",
143
+ n: 1
144
+ },
145
+ vec2: {
146
+ fn: "uniform2fv",
147
+ n: 2
148
+ },
149
+ vec3: {
150
+ fn: "uniform3fv",
151
+ n: 3
152
+ },
153
+ vec4: {
154
+ fn: "uniform4fv",
155
+ n: 4
156
+ },
157
+ int: {
158
+ fn: "uniform1iv",
159
+ n: 1
160
+ },
161
+ ivec2: {
162
+ fn: "uniform2iv",
163
+ n: 2
164
+ },
165
+ ivec3: {
166
+ fn: "uniform3iv",
167
+ n: 3
168
+ },
169
+ ivec4: {
170
+ fn: "uniform4iv",
171
+ n: 4
172
+ },
173
+ bool: {
174
+ fn: "uniform1iv",
175
+ n: 1
176
+ },
177
+ bvec2: {
178
+ fn: "uniform2iv",
179
+ n: 2
180
+ },
181
+ bvec3: {
182
+ fn: "uniform3iv",
183
+ n: 3
184
+ },
185
+ bvec4: {
186
+ fn: "uniform4iv",
187
+ n: 4
188
+ },
189
+ uint: {
190
+ fn: "uniform1uiv",
191
+ n: 1
192
+ },
193
+ uvec2: {
194
+ fn: "uniform2uiv",
195
+ n: 2
196
+ },
197
+ uvec3: {
198
+ fn: "uniform3uiv",
199
+ n: 3
200
+ },
201
+ uvec4: {
202
+ fn: "uniform4uiv",
203
+ n: 4
204
+ },
205
+ mat2: {
206
+ fn: "uniformMatrix2fv",
207
+ n: 4,
208
+ matrix: !0
209
+ },
210
+ mat3: {
211
+ fn: "uniformMatrix3fv",
212
+ n: 9,
213
+ matrix: !0
214
+ },
215
+ mat4: {
216
+ fn: "uniformMatrix4fv",
217
+ n: 16,
218
+ matrix: !0
219
+ },
220
+ mat2x2: {
221
+ fn: "uniformMatrix2fv",
222
+ n: 4,
223
+ matrix: !0
224
+ },
225
+ mat3x3: {
226
+ fn: "uniformMatrix3fv",
227
+ n: 9,
228
+ matrix: !0
229
+ },
230
+ mat4x4: {
231
+ fn: "uniformMatrix4fv",
232
+ n: 16,
233
+ matrix: !0
234
+ },
235
+ mat2x3: {
236
+ fn: "uniformMatrix2x3fv",
237
+ n: 6,
238
+ matrix: !0
239
+ },
240
+ mat2x4: {
241
+ fn: "uniformMatrix2x4fv",
242
+ n: 8,
243
+ matrix: !0
244
+ },
245
+ mat3x2: {
246
+ fn: "uniformMatrix3x2fv",
247
+ n: 6,
248
+ matrix: !0
249
+ },
250
+ mat3x4: {
251
+ fn: "uniformMatrix3x4fv",
252
+ n: 12,
253
+ matrix: !0
254
+ },
255
+ mat4x2: {
256
+ fn: "uniformMatrix4x2fv",
257
+ n: 8,
258
+ matrix: !0
259
+ },
260
+ mat4x3: {
261
+ fn: "uniformMatrix4x3fv",
262
+ n: 12,
263
+ matrix: !0
264
+ }
265
+ };
266
+ function xe(e) {
267
+ return Array.isArray(e) || e instanceof Float32Array || e instanceof Int32Array || e instanceof Uint32Array;
268
+ }
269
+ function Se(e, t, n, r) {
270
+ let i = typeof process < "u" ? process.env.NODE_ENV !== "production" : !0, a = be[n.type];
271
+ if (!a) {
272
+ i && console.warn(`weasel setUniform: array uniform "${t}" has type ${n.type}, which cannot be written as a whole`);
273
+ return;
274
+ }
275
+ if (r.length % a.n !== 0 || r.length > a.n * n.size) {
276
+ if (i) throw TypeError(`weasel setUniform: "${t}" is ${n.type}[${n.size}], so its value must hold a multiple of ${a.n} numbers, at most ${a.n * n.size}; got ${r.length}`);
277
+ return;
278
+ }
279
+ if (r.length === 0) return;
280
+ let o = e[a.fn];
281
+ a.matrix ? o.call(e, n.location, !1, r) : o.call(e, n.location, r);
282
+ }
283
+ function Ce(e, t, n, r, i, a) {
284
+ for (let [o, s] of Object.entries(r)) {
285
+ let r = t.uniformArray(o);
286
+ if (r && xe(s)) {
287
+ Se(e, o, r, s);
288
+ continue;
289
+ }
290
+ let c = t.uniform(o);
291
+ if (c === void 0) {
292
+ ve(n, o);
293
+ continue;
294
+ }
295
+ ye(e, c, s, i, a);
296
+ }
297
+ }
298
+ function we(e, t) {
299
+ let { gl: n, programRegistry: r, quadVbo: i, quadIbo: a, textureCache: s } = e, c = r.get(t.program.id);
300
+ if (!c) {
301
+ console.warn(`weasel drawShader: program "${t.program.id}" not compiled on this renderer. Call renderer.registerProgram(handle) after the module-level registerProgram().`);
302
+ return;
303
+ }
304
+ if (!i || !a) {
305
+ console.warn("weasel drawShader: quad geometry not initialized");
306
+ return;
307
+ }
308
+ n.useProgram(c.handle);
309
+ let l = c.attribute("a_position"), u = c.attribute("a_uv");
310
+ n.bindBuffer(n.ARRAY_BUFFER, i), l !== void 0 && (n.enableVertexAttribArray(l), n.vertexAttribPointer(l, 2, n.FLOAT, !1, 16, 0)), u !== void 0 && (n.enableVertexAttribArray(u), n.vertexAttribPointer(u, 2, n.FLOAT, !1, 16, 8)), n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, a);
311
+ let d = o.screenToClip(e.widthCss, e.heightCss), f = c.uniform("u_proj");
312
+ f !== void 0 && n.uniformMatrix3fv(f, !1, d);
313
+ let p = c.uniform("u_bounds");
314
+ p !== void 0 && n.uniform4f(p, t.bounds.x, t.bounds.y, t.bounds.w, t.bounds.h);
315
+ let m = c.uniform("u_view");
316
+ m !== void 0 && n.uniformMatrix3fv(m, !1, e.state.transform), Ce(n, c, t.program.id, t.uniforms, s, { value: 1 }), Y(e), w(e, 6, e.gl.UNSIGNED_SHORT), l !== void 0 && n.disableVertexAttribArray(l), u !== void 0 && n.disableVertexAttribArray(u), n.bindBuffer(n.ARRAY_BUFFER, null), n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, null);
317
+ }
318
+ function Te(e, t, n, r, i) {
319
+ let a = e.gl;
320
+ H(e);
321
+ let o = e.renderTarget ?? null, s = e.clipDepth, c = a.isEnabled(a.SCISSOR_TEST), l = n.acquire(r, i), u = e.state.pushIsolated({ transform: t.transform });
322
+ e.clipDepth = 0, a.bindFramebuffer(a.FRAMEBUFFER, l.fbo), e.renderTarget = l, a.viewport(0, 0, r, i), a.disable(a.SCISSOR_TEST), a.stencilMask(255), a.clear(a.COLOR_BUFFER_BIT | a.STENCIL_BUFFER_BIT);
323
+ for (let n of t.children) j(e, n);
324
+ H(e), a.disable(a.BLEND);
325
+ for (let o of t.effects) {
326
+ let t = e.ensureProgram?.(o.program.id) ?? null;
327
+ if (!t) {
328
+ ve(o.program.id, "(program)");
329
+ continue;
330
+ }
331
+ let s = n.acquire(r, i);
332
+ a.bindFramebuffer(a.FRAMEBUFFER, s.fbo), a.viewport(0, 0, r, i), a.clear(a.COLOR_BUFFER_BIT), De(e, t, l.texture, r, i, o.uniforms, void 0, o.program.id), n.release(l), l = s;
333
+ }
334
+ a.enable(a.BLEND), e.state.pop(), e.clipDepth = s, e.renderTarget = o, Ee(e, r, i, c);
335
+ let d = e.ensureProgram?.(ee) ?? null;
336
+ d && (Y(e), De(e, d, l.texture, r, i, void 0, {
337
+ alpha: u.alpha,
338
+ colorMatrix: u.colorMatrix
339
+ })), n.release(l);
340
+ }
341
+ function Ee(e, t, n, r) {
342
+ let i = e.gl, a = e.renderTarget ?? null;
343
+ i.bindFramebuffer(i.FRAMEBUFFER, a ? a.fbo : null), a ? i.viewport(0, 0, t, n) : (e.restoreTargetRect?.(), r && i.enable(i.SCISSOR_TEST));
344
+ }
345
+ function De(e, t, n, r, i, a, o, s) {
346
+ let c = e.gl;
347
+ c.useProgram(t.handle);
348
+ let l = t.attribute("a_position"), u = t.attribute("a_uv");
349
+ c.bindBuffer(c.ARRAY_BUFFER, e.quadVbo), c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, e.quadIbo), l !== void 0 && l >= 0 && (c.enableVertexAttribArray(l), c.vertexAttribPointer(l, 2, c.FLOAT, !1, 16, 0)), u !== void 0 && u >= 0 && (c.enableVertexAttribArray(u), c.vertexAttribPointer(u, 2, c.FLOAT, !1, 16, 8)), c.activeTexture(c.TEXTURE0), c.bindTexture(c.TEXTURE_2D, n);
350
+ let d = t.uniform("u_source");
351
+ d !== void 0 && c.uniform1i(d, 0);
352
+ let f = t.uniform("u_resolution");
353
+ f !== void 0 && c.uniform2f(f, r, i);
354
+ let p = t.uniform("u_texel");
355
+ if (p !== void 0 && c.uniform2f(p, 1 / r, 1 / i), o) {
356
+ let n = t.uniform("u_alpha");
357
+ n !== void 0 && c.uniform1f(n, o.alpha), A(e, t, o.colorMatrix);
358
+ }
359
+ a && Ce(c, t, s ?? "effect", a, e.textureCache, { value: 1 }), w(e, 6, e.gl.UNSIGNED_SHORT), l !== void 0 && l >= 0 && c.disableVertexAttribArray(l), u !== void 0 && u >= 0 && c.disableVertexAttribArray(u), c.bindBuffer(c.ARRAY_BUFFER, null), c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, null);
360
+ }
361
+ function Oe(e, t) {
362
+ if (t.effects && t.effects.length > 0 && e.effectTargets && e.deviceWidth && e.deviceHeight) {
363
+ Te(e, t, e.effectTargets, e.deviceWidth, e.deviceHeight);
364
+ return;
365
+ }
366
+ if (e.state.push({
367
+ transform: t.transform,
368
+ alpha: t.alpha,
369
+ colorMatrix: t.colorMatrix
370
+ }), t.clip) {
371
+ let n = e.clipDepth + 1;
372
+ if (n > 7) throw e.state.pop(), Error("weasel: clip nesting depth exceeded (max 7). You can't nest more than 7 levels of clipped containers in a single draw tree. Flatten the hierarchy or compose poses outside the scene graph.");
373
+ lt(e, t.clip, n), e.clipDepth = n;
374
+ }
375
+ for (let n of t.children) j(e, n);
376
+ t.clip && (ut(e, t.clip, e.clipDepth - 1), --e.clipDepth), e.state.pop();
377
+ }
378
+ function ke(e, t) {
379
+ t.fill && Ae(e, t), t.stroke?.paint && pt(e, t);
380
+ }
381
+ function Ae(e, t) {
382
+ let n = t.fill, r = n.fill === void 0 || n.fill === "solid", i = !!(t.vertexColors && t.vertexColors.length > 0), a = n, o = z(e, n, i);
383
+ if (o === null) return;
384
+ if (o !== void 0 && t.path.kind === "rect") {
385
+ o.kind === "ramp" ? Je(e, t.path, o) : Ve(e, t.path, o);
386
+ return;
387
+ }
388
+ let s = me(e, t.path);
389
+ if (V(e, s, o)) return;
390
+ let c = he(e, s);
391
+ r && i ? Xe(e, t, a, c) : c.requiresStencil ? dt(e, n, c) : q(e, n, c);
392
+ }
393
+ var je = new Int32Array(Array.from({ length: t }, (e, t) => t)), M = new Float32Array(2 * t);
394
+ function Me(e) {
395
+ return e === s || E(s, e);
396
+ }
397
+ function N(e, t, n, r, i = 0) {
398
+ if (t.clipDepth !== e.clipDepth || t.synthBold !== i || !t.foldsAlpha && t.alpha !== e.state.alpha || n !== void 0 && Ne(t, n, r) < 0) return !1;
399
+ let a = e.state.colorMatrix;
400
+ return t.colorMatrix === a || E(t.colorMatrix, a);
401
+ }
402
+ function Ne(e, t, n) {
403
+ for (let r = 0; r < e.textures.length; r++) {
404
+ let i = e.textures[r];
405
+ if (i.kind === "bitmap" && i.image === t) return i.sampling === n ? r + 1 : -1;
406
+ }
407
+ return P(e);
408
+ }
409
+ function Pe(e) {
410
+ for (let t = 0; t < e.textures.length; t++) if (e.textures[t].kind === "ramps") return t + 1;
411
+ return P(e);
412
+ }
413
+ function Fe(e, t) {
414
+ for (let n = 0; n < e.textures.length; n++) {
415
+ let r = e.textures[n];
416
+ if (r.kind === "atlas" && r.id === t) return n + 1;
417
+ }
418
+ return P(e);
419
+ }
420
+ function P(e) {
421
+ return e.textures.length + 1 < t ? e.textures.length + 1 : -1;
422
+ }
423
+ var Ie = 256;
424
+ function Le(e) {
425
+ return !e.requiresStencil && e.vertices.length >> 1 <= Ie;
426
+ }
427
+ function F(e, t) {
428
+ return e.batchState !== void 0 && !N(e, e.batchState) && H(e), e.drawBatch.wouldOverflow(t) && H(e), I(e);
429
+ }
430
+ function I(e) {
431
+ if (e.batchState === void 0) {
432
+ let t = e.state.colorMatrix, n = Me(t);
433
+ e.batchState = {
434
+ alpha: n ? 1 : e.state.alpha,
435
+ colorMatrix: t,
436
+ clipDepth: e.clipDepth,
437
+ synthBold: 0,
438
+ foldsAlpha: n,
439
+ textures: []
440
+ };
441
+ }
442
+ return e.batchState;
443
+ }
444
+ function L(e, t, n) {
445
+ e.batchState !== void 0 && !N(e, e.batchState, t, n) && H(e), e.drawBatch.wouldOverflow(4) && H(e);
446
+ let r = I(e), i = Ne(r, t, n);
447
+ return i > r.textures.length && (r.textures.push({
448
+ kind: "bitmap",
449
+ image: t,
450
+ sampling: n
451
+ }), i = r.textures.length), {
452
+ staged: r,
453
+ slot: i
454
+ };
455
+ }
456
+ function Re(e, t, n, r) {
457
+ e.batchState !== void 0 && (!N(e, e.batchState, void 0, void 0, r) || Fe(e.batchState, t) < 0) && H(e), e.drawBatch.wouldOverflow(4) && H(e);
458
+ let i = I(e);
459
+ i.synthBold = r;
460
+ let a = Fe(i, t);
461
+ return a > i.textures.length && (i.textures.push({
462
+ kind: "atlas",
463
+ id: t,
464
+ fieldScale: n
465
+ }), a = i.textures.length), {
466
+ staged: i,
467
+ slot: a
468
+ };
469
+ }
470
+ function ze(e, t, n, r) {
471
+ e.gradRamps.wouldReshape(t, n) && H(e), e.batchState !== void 0 && (!N(e, e.batchState) || Pe(e.batchState) < 0) && H(e), e.drawBatch.wouldOverflow(r) && H(e);
472
+ let i = I(e), a = Pe(i);
473
+ return a > i.textures.length && (i.textures.push({ kind: "ramps" }), a = i.textures.length), {
474
+ staged: i,
475
+ slot: a,
476
+ rowV: e.gradRamps.rowV(e.gradRamps.upload(t, n))
477
+ };
478
+ }
479
+ function R(e, t, n) {
480
+ return (n ?? 1) * (t.foldsAlpha ? e.state.alpha : 1);
481
+ }
482
+ function Be(e, t, n) {
483
+ let [r, i, o, s] = a(n.color);
484
+ return [
485
+ r,
486
+ i,
487
+ o,
488
+ s * R(e, t, n.opacity)
489
+ ];
490
+ }
491
+ function Ve(e, t, n) {
492
+ let [r, i, a, o] = Be(e, F(e, 4), n);
493
+ e.drawBatch.pushRect(t.x, t.y, t.width, t.height, e.state.transform, r, i, a, o);
494
+ }
495
+ function He(e, t, n) {
496
+ let [r, i, a, o] = Be(e, F(e, t.vertices.length >> 1), n);
497
+ e.drawBatch.pushMesh(t, e.state.transform, r, i, a, o);
498
+ }
499
+ function z(e, t, a) {
500
+ if (a) return;
501
+ let o = t.fill ?? "solid";
502
+ if (o === "solid") {
503
+ let e = t;
504
+ return {
505
+ kind: "solid",
506
+ color: e.color,
507
+ opacity: e.opacity
508
+ };
509
+ }
510
+ if (o !== "linear-gradient" && o !== "radial-gradient" && o !== "conic-gradient") return;
511
+ let s = t, c = Ue(e, s.units);
512
+ return c ? s.fill === "linear-gradient" ? B(s, r, We(c, s)) : s.fill === "radial-gradient" ? B(s, i, Ge(c, s)) : B(s, n, Ke(c, s)) : null;
513
+ }
514
+ function B(e, t, n) {
515
+ return {
516
+ kind: "ramp",
517
+ stops: e.stops,
518
+ space: e.interpolate ?? "rgb",
519
+ opacity: e.opacity,
520
+ mode: t,
521
+ uv: n
522
+ };
523
+ }
524
+ function Ue(e, t) {
525
+ let n = J(e, t);
526
+ return n && o.multiply(n, e.state.transform);
527
+ }
528
+ function We(e, t) {
529
+ let n = t.to.x - t.from.x, r = t.to.y - t.from.y, i = Math.hypot(n, r) || 1, a = 1 / (i * i);
530
+ return {
531
+ ux: (e[0] * n + e[1] * r) * a,
532
+ uy: (e[3] * n + e[4] * r) * a,
533
+ u0: ((e[6] - t.from.x) * n + (e[7] - t.from.y) * r) * a,
534
+ vx: 0,
535
+ vy: 0,
536
+ v0: 0
537
+ };
538
+ }
539
+ function Ge(e, t) {
540
+ let n = 1 / Math.max(t.radius, 1e-4);
541
+ return {
542
+ ux: e[0] * n,
543
+ uy: e[3] * n,
544
+ u0: (e[6] - t.center.x) * n,
545
+ vx: e[1] * n,
546
+ vy: e[4] * n,
547
+ v0: (e[7] - t.center.y) * n
548
+ };
549
+ }
550
+ function Ke(e, t) {
551
+ let n = Math.cos(t.angle), r = Math.sin(t.angle), i = e[6] - t.center.x, a = e[7] - t.center.y;
552
+ return {
553
+ ux: n * e[0] + r * e[1],
554
+ uy: n * e[3] + r * e[4],
555
+ u0: n * i + r * a,
556
+ vx: n * e[1] - r * e[0],
557
+ vy: n * e[4] - r * e[3],
558
+ v0: n * a - r * i
559
+ };
560
+ }
561
+ function qe(e, t) {
562
+ return e.mode === r ? {
563
+ uv: {
564
+ ...e.uv,
565
+ v0: t
566
+ },
567
+ post: 1
568
+ } : {
569
+ uv: e.uv,
570
+ post: t
571
+ };
572
+ }
573
+ function Je(e, t, n) {
574
+ let { staged: r, slot: i, rowV: a } = ze(e, n.stops, n.space, 4), { uv: o, post: s } = qe(n, a);
575
+ e.drawBatch.pushGradientRect(t.x, t.y, t.width, t.height, e.state.transform, o, s, i, n.mode, 1, 1, 1, R(e, r, n.opacity));
576
+ }
577
+ function Ye(e, t, n) {
578
+ let { staged: r, slot: i, rowV: a } = ze(e, n.stops, n.space, t.vertices.length >> 1), { uv: o, post: s } = qe(n, a);
579
+ e.drawBatch.pushGradientMesh(t, e.state.transform, o, s, i, n.mode, 1, 1, 1, R(e, r, n.opacity));
580
+ }
581
+ function V(e, t, n) {
582
+ return n !== void 0 && Le(t) ? (n.kind === "ramp" ? Ye(e, t, n) : He(e, t, n), !0) : (H(e), !1);
583
+ }
584
+ function H(e) {
585
+ let t = e.drawBatch, n = e.batchState;
586
+ if (t.length === 0 || n === void 0) return;
587
+ let r = e.gl, i = e.batchFill;
588
+ r.useProgram(i.handle);
589
+ let a = t.uploadAndBind();
590
+ W(e, i, O), fe(e, i, 1, 1, 1, 1), D(e, i, n.alpha), r.uniform1f(i.uniform("u_synthBold"), n.synthBold), A(e, i, n.colorMatrix), r.activeTexture(r.TEXTURE0), r.bindTexture(r.TEXTURE_2D, e.whiteTexture);
591
+ for (let t = 0; t < n.textures.length; t++) {
592
+ let i = n.textures[t];
593
+ if (i.kind === "atlas") {
594
+ e.textureCache.bind(i.id, t + 1), M[2 * (t + 1)] = i.fieldScale[0], M[2 * (t + 1) + 1] = i.fieldScale[1];
595
+ continue;
596
+ }
597
+ if (i.kind === "ramps") {
598
+ e.gradRamps.bind(t + 1);
599
+ continue;
600
+ }
601
+ e.imageCache.bind(i.image, t + 1), e.imageCache.setMagFilter(i.image, i.sampling === "nearest" ? r.NEAREST : r.LINEAR);
602
+ }
603
+ r.uniform1iv(i.uniform("u_samplers"), je), r.uniform2fv(i.uniform("u_fieldScale"), M), Y(e, n.clipDepth), w(e, a, e.gl.UNSIGNED_INT), r.activeTexture(r.TEXTURE0), r.bindVertexArray(null), t.reset(), e.batchState = void 0;
604
+ }
605
+ function U(e, t) {
606
+ let n = t.anchorA, r = t.anchorB, i = t.anchorT;
607
+ if (!n || !r || !i) return new Float32Array(e);
608
+ let a = n.length, o = new Float32Array(a * 4);
609
+ for (let t = 0; t < a; t++) {
610
+ let a = n[t] * 4, s = r[t] * 4, c = i[t];
611
+ o[t * 4 + 0] = e[a + 0] + (e[s + 0] - e[a + 0]) * c, o[t * 4 + 1] = e[a + 1] + (e[s + 1] - e[a + 1]) * c, o[t * 4 + 2] = e[a + 2] + (e[s + 2] - e[a + 2]) * c, o[t * 4 + 3] = e[a + 3] + (e[s + 3] - e[a + 3]) * c;
612
+ }
613
+ return o;
614
+ }
615
+ function Xe(e, t, n, r) {
616
+ let i = e.gl, a = e.pathFillVColor;
617
+ i.useProgram(a.handle), i.bindVertexArray(r.vao), W(e, a), G(e, a, n.color, n.opacity), A(e, a);
618
+ let o = U(t.vertexColors, r), s = i.createBuffer();
619
+ if (!s) throw Error("drawPathFillVColor: createBuffer (color VBO) returned null");
620
+ i.bindBuffer(i.ARRAY_BUFFER, s), i.bufferData(i.ARRAY_BUFFER, o, i.DYNAMIC_DRAW);
621
+ let c = a.attribute("a_vertexColor");
622
+ c !== void 0 && (i.enableVertexAttribArray(c), i.vertexAttribPointer(c, 4, i.FLOAT, !1, 0, 0)), Y(e), w(e, r.indexCount, e.gl.UNSIGNED_INT), i.bindVertexArray(null), i.deleteBuffer(s);
623
+ }
624
+ function W(e, t, n = e.state.transform, r = pe(e)) {
625
+ let i = e.gl, a = T(e, t);
626
+ E(a.proj, r) || (i.uniformMatrix3fv(t.uniform("u_proj"), !1, r), a.proj = Float32Array.from(r)), E(a.model, n) || (i.uniformMatrix3fv(t.uniform("u_model"), !1, n), a.model = Float32Array.from(n));
627
+ }
628
+ function G(e, t, n, r) {
629
+ let [i, o, s, c] = a(n);
630
+ fe(e, t, i, o, s, c * (r ?? 1)), D(e, t, e.state.alpha);
631
+ }
632
+ function K(e, t) {
633
+ let n = t.fill ?? "solid";
634
+ if (n === "solid") return tt(e, t);
635
+ if (n === "pattern") return nt(e, t);
636
+ if (n === "linear-gradient" || n === "radial-gradient" || n === "conic-gradient") return ot(e, t);
637
+ let r = l(n)?.bind;
638
+ return r ? r(Ze(e), t) : null;
639
+ }
640
+ function Ze(e) {
641
+ let t = Qe.get(e);
642
+ if (t) return t;
643
+ let n = {
644
+ gl: e.gl,
645
+ get alpha() {
646
+ return e.state.alpha;
647
+ },
648
+ program: (t) => e.ensureProgram?.(t) ?? e.programRegistry.get(t) ?? null,
649
+ setProjAndModel: (t) => W(e, t),
650
+ spaceInverse: (t) => J(e, t),
651
+ spaceToDevice: (t) => at(e, t),
652
+ get maxTextureSize() {
653
+ return e.imageCache.maxTextureSide;
654
+ },
655
+ resources: e.paintResources ?? et(e.gl),
656
+ bindRamp: (t, n, r) => {
657
+ let i = e.gradRamps.upload(t, r);
658
+ return e.gradRamps.bind(n), e.gradRamps.rowV(i);
659
+ }
660
+ };
661
+ return Qe.set(e, n), n;
662
+ }
663
+ var Qe = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap();
664
+ function et(t) {
665
+ let n = $e.get(t);
666
+ return n || (n = e(), $e.set(t, n)), n;
667
+ }
668
+ function q(e, t, n) {
669
+ if (!K(e, t)) return;
670
+ let r = e.gl;
671
+ r.bindVertexArray(n.vao), Y(e), w(e, n.indexCount, e.gl.UNSIGNED_INT), r.bindVertexArray(null);
672
+ }
673
+ function tt(e, t) {
674
+ let n = e.pathFill;
675
+ return e.gl.useProgram(n.handle), W(e, n), G(e, n, t.color, t.opacity), A(e, n), n;
676
+ }
677
+ function nt(e, t) {
678
+ return rt(e, e.patternFill, t, e.state.transform);
679
+ }
680
+ function rt(e, t, n, r) {
681
+ let i = n.pattern, a = c(i.id);
682
+ if (!a) return (typeof process > "u" || process.env.NODE_ENV !== "production") && console.warn(`weasel: pattern TextureHandle "${i.id}" not registered`), null;
683
+ let o = J(e, n.units);
684
+ if (!o) return null;
685
+ let s = d(o, n.origin ?? {
686
+ x: 0,
687
+ y: 0
688
+ }, n.transform);
689
+ if (!s) return null;
690
+ e.textureCache.upload(i.id, a.source, "repeat");
691
+ let l = e.gl;
692
+ l.useProgram(t.handle), W(e, t, r), A(e, t), l.uniformMatrix3fv(t.uniform("u_worldInv"), !1, s);
693
+ let [u, f] = it(a.source);
694
+ return l.uniform2f(t.uniform("u_tileSize"), u, f), e.textureCache.bind(i.id, 0), l.uniform1i(t.uniform("u_sampler"), 0), l.uniform1f(t.uniform("u_opacity"), n.opacity ?? 1), D(e, t, e.state.alpha), t;
695
+ }
696
+ function it(e) {
697
+ let t = "naturalWidth" in e ? e.naturalWidth : e.width, n = "naturalHeight" in e ? e.naturalHeight : e.height;
698
+ return [t || 1, n || 1];
699
+ }
700
+ function J(e, t) {
701
+ return t === "local" ? o.invert(e.state.transform) : t === "world" && e.viewMatrix ? o.invert(e.viewMatrix) : o.identity();
702
+ }
703
+ function at(e, t) {
704
+ let n = J(e, t), r = n && o.invert(n);
705
+ if (!r) return null;
706
+ let i = e.deviceWidth && e.widthCss > 0 ? e.deviceWidth / e.widthCss : 1;
707
+ return o.multiply(o.scaled(o.identity(), i, i), r);
708
+ }
709
+ function ot(e, t) {
710
+ return st(e, e.gradFill, t, e.state.transform);
711
+ }
712
+ function st(e, t, n, r) {
713
+ let i = J(e, n.units);
714
+ if (!i) return null;
715
+ let a = e.gl, o = e.gradRamps.upload(n.stops, n.interpolate ?? "rgb");
716
+ if (a.useProgram(t.handle), W(e, t, r), a.uniformMatrix3fv(t.uniform("u_worldInv"), !1, i), A(e, t), e.gradRamps.bind(0), a.uniform1i(t.uniform("u_ramp"), 0), a.uniform1f(t.uniform("u_rampV"), e.gradRamps.rowV(o)), D(e, t, e.state.alpha), a.uniform1f(t.uniform("u_opacity"), n.opacity ?? 1), n.fill === "linear-gradient") {
717
+ a.uniform1i(t.uniform("u_gradKind"), 0);
718
+ let e = n.to.x - n.from.x, r = n.to.y - n.from.y, i = Math.hypot(e, r) || 1;
719
+ a.uniform2f(t.uniform("u_gradP0"), n.from.x, n.from.y), a.uniform2f(t.uniform("u_gradDir"), e / i, r / i), a.uniform1f(t.uniform("u_gradLen"), i), a.uniform1f(t.uniform("u_gradRadius"), 0), a.uniform1f(t.uniform("u_gradAngle"), 0);
720
+ } else n.fill === "radial-gradient" ? (a.uniform1i(t.uniform("u_gradKind"), 1), a.uniform2f(t.uniform("u_gradP0"), n.center.x, n.center.y), a.uniform2f(t.uniform("u_gradDir"), 0, 0), a.uniform1f(t.uniform("u_gradLen"), 0), a.uniform1f(t.uniform("u_gradRadius"), n.radius), a.uniform1f(t.uniform("u_gradAngle"), 0)) : (a.uniform1i(t.uniform("u_gradKind"), 2), a.uniform2f(t.uniform("u_gradP0"), n.center.x, n.center.y), a.uniform2f(t.uniform("u_gradDir"), 0, 0), a.uniform1f(t.uniform("u_gradLen"), 0), a.uniform1f(t.uniform("u_gradRadius"), 0), a.uniform1f(t.uniform("u_gradAngle"), n.angle));
721
+ return t;
722
+ }
723
+ function Y(e, t = e.clipDepth) {
724
+ let n = e.gl;
725
+ if (t === 0) {
726
+ n.disable(n.STENCIL_TEST);
727
+ return;
728
+ }
729
+ let r = X(t);
730
+ n.enable(n.STENCIL_TEST), n.stencilFunc(n.EQUAL, r, r), n.stencilOp(n.KEEP, n.KEEP, n.KEEP);
731
+ }
732
+ function X(e) {
733
+ return e === 0 ? 0 : (1 << e + 1) - 1 & 254;
734
+ }
735
+ function ct(e, t) {
736
+ let n = e.gl, r = ge(e, t);
737
+ n.useProgram(e.pathFill.handle), n.bindVertexArray(r.vao), W(e, e.pathFill), w(e, r.indexCount, e.gl.UNSIGNED_INT), n.bindVertexArray(null);
738
+ }
739
+ function lt(e, t, n) {
740
+ H(e);
741
+ let r = e.gl, i = X(n - 1), a = 1 << n, o = i | a;
742
+ r.enable(r.STENCIL_TEST), r.colorMask(!1, !1, !1, !1), r.stencilMask(a), r.stencilFunc(r.EQUAL, o, i), r.stencilOp(r.KEEP, r.KEEP, r.REPLACE), ct(e, t), r.colorMask(!0, !0, !0, !0), r.stencilMask(255);
743
+ }
744
+ function ut(e, t, n) {
745
+ H(e);
746
+ let r = e.gl;
747
+ r.enable(r.STENCIL_TEST);
748
+ let i = 1 << n + 1, a = X(n) | i;
749
+ r.colorMask(!1, !1, !1, !1), r.stencilMask(i), r.stencilFunc(r.EQUAL, a, a), r.stencilOp(r.KEEP, r.KEEP, r.ZERO), ct(e, t), r.colorMask(!0, !0, !0, !0), r.stencilMask(255);
750
+ }
751
+ function dt(e, t, n) {
752
+ let r = e.gl;
753
+ r.useProgram(e.pathFill.handle), r.bindVertexArray(n.vao), W(e, e.pathFill), r.enable(r.STENCIL_TEST), r.colorMask(!1, !1, !1, !1), r.stencilMask(1), r.stencilFunc(r.ALWAYS, 0, 1), r.stencilOp(r.KEEP, r.KEEP, r.INVERT), w(e, n.indexCount, e.gl.UNSIGNED_INT);
754
+ let i = X(e.clipDepth);
755
+ r.colorMask(!0, !0, !0, !0), r.stencilFunc(r.EQUAL, i | 1, i | 1), r.stencilOp(r.KEEP, r.KEEP, r.KEEP), K(e, t) && w(e, n.indexCount, e.gl.UNSIGNED_INT), r.stencilMask(1), r.clear(r.STENCIL_BUFFER_BIT), r.disable(r.STENCIL_TEST), r.bindVertexArray(null);
756
+ }
757
+ function ft(e, t) {
758
+ let n = t.stroke, { markerStart: r, markerMid: i, markerEnd: a } = n;
759
+ if (typeof n.width != "object" && !Z(r) && !Z(i) && !Z(a)) return t;
760
+ let s = o.meanScaleOf(e.state.transform), c = { ...n };
761
+ return typeof n.width == "object" && (c.width = p(n.width, v(n.width.px, s))), Z(r) && (c.markerStart = Q(r, s)), Z(i) && (c.markerMid = Q(i, s)), Z(a) && (c.markerEnd = Q(a, s)), {
762
+ ...t,
763
+ stroke: c
764
+ };
765
+ }
766
+ function Z(e) {
767
+ return typeof e == "object" && typeof e.size == "object";
768
+ }
769
+ function Q(e, t) {
770
+ return {
771
+ ...e,
772
+ size: _(e, 0, v(e.size.px, t))
773
+ };
774
+ }
775
+ function pt(e, t) {
776
+ let n = ft(e, t), r = n.stroke, i = r.align ?? "center";
777
+ n.path.kind === "polygon" && i !== "center" ? (H(e), _t(e, n, i)) : mt(e, n);
778
+ let a = p(r.width ?? 1, 1);
779
+ for (let i of b(n.path, t.stroke, r, a, e.flattenTolerance)) ke(e, i);
780
+ }
781
+ function mt(e, t) {
782
+ let n = t.stroke, r = n.paint, i = r.fill === void 0 || r.fill === "solid", a = r, o = y(t.path, n, e.flattenTolerance);
783
+ if (o.indices.length === 0) return;
784
+ let s = !!(n.vertexColors && n.vertexColors.length > 0), c = z(e, r, s);
785
+ if (c === null || V(e, o, c)) return;
786
+ let l = s ? e.meshCache.uploadTransient(o) : e.meshCache.uploadRecurring(o);
787
+ if (!i && !s) {
788
+ q(e, r, l);
789
+ return;
790
+ }
791
+ let u = e.gl;
792
+ if (s) {
793
+ let t = e.pathFillVColor;
794
+ u.useProgram(t.handle), u.bindVertexArray(l.vao), W(e, t), G(e, t, i ? a.color : "#ffffff", r.opacity), A(e, t);
795
+ let o = U(n.vertexColors, l), s = u.createBuffer();
796
+ if (!s) throw Error("drawPathStrokeUnclipped: createBuffer (color VBO) returned null");
797
+ u.bindBuffer(u.ARRAY_BUFFER, s), u.bufferData(u.ARRAY_BUFFER, o, u.DYNAMIC_DRAW);
798
+ let c = t.attribute("a_vertexColor");
799
+ c !== void 0 && (u.enableVertexAttribArray(c), u.vertexAttribPointer(c, 4, u.FLOAT, !1, 0, 0)), Y(e), w(e, l.indexCount, e.gl.UNSIGNED_INT), u.bindVertexArray(null), u.deleteBuffer(s);
800
+ return;
801
+ }
802
+ u.useProgram(e.pathFill.handle), u.bindVertexArray(l.vao), W(e, e.pathFill), G(e, e.pathFill, a.color, a.opacity), A(e, e.pathFill), Y(e), w(e, l.indexCount, e.gl.UNSIGNED_INT), u.bindVertexArray(null);
803
+ }
804
+ var ht = /* @__PURE__ */ new WeakMap();
805
+ function gt(e) {
806
+ let t = ht.get(e);
807
+ return t === void 0 && (t = e.map((e) => e * 2), ht.set(e, t)), t;
808
+ }
809
+ function _t(e, t, n) {
810
+ let r = t.stroke, i = r.paint, a = i.fill === void 0 || i.fill === "solid", o = i, s = {
811
+ ...r,
812
+ width: p(r.width ?? 1, 1) * 2,
813
+ ...r.vertexWidths ? { vertexWidths: gt(r.vertexWidths) } : {},
814
+ align: "center"
815
+ }, c = !!(r.vertexColors && r.vertexColors.length > 0), l = ge(e, t.path), u = y(t.path, s, e.flattenTolerance);
816
+ if (u.indices.length === 0) return;
817
+ let d = c ? e.meshCache.uploadTransient(u) : e.meshCache.uploadRecurring(u), f = e.gl, m = c ? e.pathFillVColor : e.pathFill;
818
+ f.useProgram(m.handle), W(e, m), f.enable(f.STENCIL_TEST), f.colorMask(!1, !1, !1, !1), f.stencilMask(1), f.stencilFunc(f.ALWAYS, 1, 1), f.stencilOp(f.KEEP, f.KEEP, f.REPLACE), f.bindVertexArray(l.vao), w(e, l.indexCount, e.gl.UNSIGNED_INT);
819
+ let h = X(e.clipDepth);
820
+ f.colorMask(!0, !0, !0, !0), n === "inner" ? f.stencilFunc(f.EQUAL, h | 1, h | 1) : f.stencilFunc(f.EQUAL, h, h | 1), f.stencilOp(f.KEEP, f.KEEP, f.KEEP);
821
+ let g = m;
822
+ if (c ? (G(e, m, a ? o.color : "#ffffff", i.opacity), A(e, m)) : g = K(e, i), !g) {
823
+ f.stencilMask(1), f.clear(f.STENCIL_BUFFER_BIT), f.disable(f.STENCIL_TEST), f.bindVertexArray(null);
824
+ return;
825
+ }
826
+ f.bindVertexArray(d.vao);
827
+ let _ = null;
828
+ if (c) {
829
+ let e = U(r.vertexColors, d);
830
+ if (_ = f.createBuffer(), !_) throw Error("drawPathStrokeStenciled: createBuffer (color VBO) returned null");
831
+ f.bindBuffer(f.ARRAY_BUFFER, _), f.bufferData(f.ARRAY_BUFFER, e, f.DYNAMIC_DRAW);
832
+ let t = g.attribute("a_vertexColor");
833
+ t !== void 0 && (f.enableVertexAttribArray(t), f.vertexAttribPointer(t, 4, f.FLOAT, !1, 0, 0));
834
+ }
835
+ w(e, d.indexCount, e.gl.UNSIGNED_INT), f.stencilMask(1), f.clear(f.STENCIL_BUFFER_BIT), f.disable(f.STENCIL_TEST), f.bindVertexArray(null), _ && f.deleteBuffer(_);
836
+ }
837
+ var vt = 48;
838
+ function yt(e) {
839
+ let t = Math.hypot(e[0], e[1]), n = Math.hypot(e[3], e[4]);
840
+ return Math.sqrt(t * n) || 1;
841
+ }
842
+ function bt(e, t) {
843
+ let n = se(t.style), r = n.lineHeight, i = t.align ?? n.align, a = t.maxWidth ?? Infinity, o = e.textOutlineMinScreenSize ?? vt, s = Number.isFinite(o) ? o / yt(e.state.transform) : void 0, c = oe(t.runs, {
844
+ maxWidth: a,
845
+ alignWidth: t.width,
846
+ lineHeight: r,
847
+ align: i,
848
+ justify: t.justify,
849
+ outlineMinSize: s
850
+ });
851
+ if (c.groups.length === 0 && c.decorations.length === 0) return;
852
+ let l = t.x, u = t.y + ce(t.verticalAlign, t.height, c.bounds.height);
853
+ for (let t of c.groups) t.source === "outline" ? xt(e, t, l, u) : kt(e, t, l, u);
854
+ Et(e, c.decorations, l, u);
855
+ }
856
+ function xt(e, t, n, r) {
857
+ let i = t.fill;
858
+ if (i !== null) {
859
+ let a = Ct(t, n, r);
860
+ a && St(e, i, a);
861
+ }
862
+ let a = t.stroke?.paint;
863
+ if (!a) return;
864
+ let s = wt(t, n, r, o.meanScaleOf(e.state.transform));
865
+ s && St(e, a, s);
866
+ }
867
+ function St(e, t, n) {
868
+ let r = z(e, t, !1);
869
+ r !== null && (V(e, n, r) || q(e, t, e.meshCache.uploadTransient(n)));
870
+ }
871
+ function Ct(e, t, n) {
872
+ return Tt(e, t, n, (e) => m(e.key, e.d));
873
+ }
874
+ function wt(e, t, n, r) {
875
+ let i = e.stroke;
876
+ if (!i) return null;
877
+ let a = p(i.width ?? 1, r);
878
+ return a > 0 ? Tt(e, t, n, (e) => e.scale > 0 ? h(e.key, e.d, g(a / e.scale), i) : null) : null;
879
+ }
880
+ function Tt(e, t, n, r) {
881
+ let i = [], a = 0, o = 0;
882
+ for (let t of e.glyphs) {
883
+ let e = r(t);
884
+ e && e.indices.length !== 0 && (i.push({
885
+ mesh: e,
886
+ glyph: t
887
+ }), a += e.vertices.length, o += e.indices.length);
888
+ }
889
+ if (i.length === 0) return null;
890
+ let s = e.synthetic.italic ? Math.tan(x) : 0, c = new Float32Array(a), l = new Uint32Array(o), u = 0, d = 0, f = 0;
891
+ for (let { mesh: e, glyph: r } of i) {
892
+ let { x: i, baselineY: a, scale: o } = r;
893
+ for (let r = 0; r < e.vertices.length; r += 2) {
894
+ let l = e.vertices[r], d = e.vertices[r + 1];
895
+ c[u++] = i + t + (l - d * s) * o, c[u++] = a + n + d * o;
896
+ }
897
+ for (let t = 0; t < e.indices.length; t++) l[d++] = f + e.indices[t];
898
+ f += e.vertices.length / 2;
899
+ }
900
+ return {
901
+ vertices: c,
902
+ indices: l
903
+ };
904
+ }
905
+ function Et(e, t, n, r) {
906
+ for (let i of t) {
907
+ if (At(i.fill) !== null) {
908
+ St(e, i.fill, Dt(i.x0 + n, i.y0 + r, i.x1 + n, i.y1 + r));
909
+ continue;
910
+ }
911
+ let [t, o, s, c] = "color" in i.fill ? a(i.fill.color) : [
912
+ 0,
913
+ 0,
914
+ 0,
915
+ 1
916
+ ], l = F(e, 4);
917
+ e.drawBatch.pushRect(i.x0 + n, i.y0 + r, i.x1 - i.x0, i.y1 - i.y0, e.state.transform, t, o, s, c * (l.foldsAlpha ? e.state.alpha : 1));
918
+ }
919
+ }
920
+ function Dt(e, t, n, r) {
921
+ return {
922
+ vertices: new Float32Array([
923
+ e,
924
+ t,
925
+ n,
926
+ t,
927
+ n,
928
+ r,
929
+ e,
930
+ r
931
+ ]),
932
+ indices: new Uint32Array([
933
+ 0,
934
+ 1,
935
+ 2,
936
+ 0,
937
+ 2,
938
+ 3
939
+ ])
940
+ };
941
+ }
942
+ var Ot = .08;
943
+ function kt(e, t, n, r) {
944
+ if (t.source === "canvas") {
945
+ if (!ie(e.textureCache, t.page)) return;
946
+ } else if (!ne(t.family, t.weight, t.style, e.textureCache)) return;
947
+ if (t.quads.length === 0) return;
948
+ let i = t.source === "canvas" ? C(t.page) : ae(t.family, t.weight, t.style), o = t.source === "canvas" ? te : S, s = re(t.source === "canvas" ? "canvas" : "atlas", t.family, t.weight, t.style);
949
+ if (!s) return;
950
+ let c = t.synthetic.bold ? Ot : 0, l = t.synthetic.italic ? Math.tan(x) : 0, u = At(t.fill);
951
+ if (u !== null) {
952
+ jt(e, t, n, r, u, i, o, c, l, s);
953
+ return;
954
+ }
955
+ let d = t.fill !== null && "color" in t.fill ? a(t.fill.color) : [
956
+ 0,
957
+ 0,
958
+ 0,
959
+ 1
960
+ ], f = e.drawBatch, p = e.state.transform, { staged: m, slot: h } = Re(e, i, s, c), g = d[3] * (m.foldsAlpha ? e.state.alpha : 1);
961
+ for (let a of t.quads) f.wouldOverflow(4) && (H(e), {staged: m, slot: h} = Re(e, i, s, c), g = d[3] * (m.foldsAlpha ? e.state.alpha : 1)), f.pushGlyph(a.x0 + n, a.y0 + r, a.x1 + n, a.y1 + r, a.baselineY + r, l, p, a.u0, a.v0, a.u1, a.v1, d[0], d[1], d[2], g, h, o);
962
+ }
963
+ function At(e) {
964
+ let t = e?.fill ?? "solid";
965
+ return t === "pattern" ? "pattern" : t === "linear-gradient" || t === "radial-gradient" || t === "conic-gradient" ? "gradient" : t === "solid" ? null : "texture";
966
+ }
967
+ var $ = 1;
968
+ function jt(e, t, n, r, i, a, o, s, c, l) {
969
+ let u = e.glyphPaintProgram?.(i);
970
+ if (!u) return;
971
+ H(e);
972
+ let d = t.fill, f = e.state.transform, p;
973
+ if (i === "pattern") p = rt(e, u, d, O);
974
+ else if (i === "gradient") p = st(e, u, d, O);
975
+ else {
976
+ let i = Ft(e, d, Nt(t, n, r, c, f));
977
+ p = i && It(e, u, i);
978
+ }
979
+ if (!p) return;
980
+ let m = e.gl;
981
+ e.textureCache.bind(a, $), m.uniform1i(u.uniform("u_atlas"), $), m.uniform1f(u.uniform("u_synthBold"), s), m.uniform2f(u.uniform("u_fieldScale"), l[0], l[1]), Y(e);
982
+ let h = e.drawBatch;
983
+ for (let i of t.quads) h.wouldOverflow(4) && Mt(e), h.pushGlyph(i.x0 + n, i.y0 + r, i.x1 + n, i.y1 + r, i.baselineY + r, c, f, i.u0, i.v0, i.u1, i.v1, 1, 1, 1, 1, $, o);
984
+ Mt(e), m.activeTexture(m.TEXTURE0), m.bindVertexArray(null);
985
+ }
986
+ function Mt(e) {
987
+ let t = e.drawBatch;
988
+ t.length !== 0 && (w(e, t.uploadAndBind(), e.gl.UNSIGNED_INT), t.reset());
989
+ }
990
+ function Nt(e, t, n, r, i) {
991
+ let a = {
992
+ x0: Infinity,
993
+ y0: Infinity,
994
+ x1: -Infinity,
995
+ y1: -Infinity
996
+ }, o = (e, t) => {
997
+ let n = i[0] * e + i[3] * t + i[6], r = i[1] * e + i[4] * t + i[7];
998
+ n < a.x0 && (a.x0 = n), n > a.x1 && (a.x1 = n), r < a.y0 && (a.y0 = r), r > a.y1 && (a.y1 = r);
999
+ };
1000
+ for (let i of e.quads) {
1001
+ let e = i.x0 + t, a = i.x1 + t, s = i.y0 + n, c = i.y1 + n, l = i.baselineY + n, u = (l - s) * r, d = (l - c) * r;
1002
+ o(e + u, s), o(a + u, s), o(a + d, c), o(e + d, c);
1003
+ }
1004
+ return a;
1005
+ }
1006
+ var Pt = {
1007
+ vertices: new Float32Array([
1008
+ 0,
1009
+ 0,
1010
+ 1,
1011
+ 0,
1012
+ 1,
1013
+ 1,
1014
+ 0,
1015
+ 1
1016
+ ]),
1017
+ indices: new Uint32Array([
1018
+ 0,
1019
+ 1,
1020
+ 2,
1021
+ 0,
1022
+ 2,
1023
+ 3
1024
+ ])
1025
+ };
1026
+ function Ft(e, t, n) {
1027
+ let r = e.paintScratch, i = l(t.fill)?.bind;
1028
+ if (!r || !i) return null;
1029
+ let a = e.deviceWidth && e.widthCss > 0 ? e.deviceWidth / e.widthCss : 1, o = e.deviceWidth ?? Math.round(e.widthCss), s = e.deviceHeight ?? Math.round(e.heightCss), c = Math.max(0, Math.floor(n.x0 * a)), u = Math.max(0, Math.floor(n.y0 * a)), d = e.imageCache.maxTextureSide, f = Math.min(d, Math.min(o, Math.ceil(n.x1 * a)) - c), p = Math.min(d, Math.min(s, Math.ceil(n.y1 * a)) - u);
1030
+ if (!(f > 0 && p > 0)) return null;
1031
+ let m = c / a, h = u / a, g = f / a, _ = p / a, v = new Float32Array([
1032
+ g,
1033
+ 0,
1034
+ 0,
1035
+ 0,
1036
+ _,
1037
+ 0,
1038
+ m,
1039
+ h,
1040
+ 1
1041
+ ]), y = new Float32Array([
1042
+ 2 / g,
1043
+ 0,
1044
+ 0,
1045
+ 0,
1046
+ 2 / _,
1047
+ 0,
1048
+ -1 - 2 * m / g,
1049
+ -1 - 2 * h / _,
1050
+ 1
1051
+ ]), b = Ze(e), ee = {
1052
+ ...b,
1053
+ alpha: e.state.alpha,
1054
+ maxTextureSize: b.maxTextureSize,
1055
+ setProjAndModel: (t) => W(e, t, v, y)
1056
+ }, x = e.gl, S = r.acquire(f, p), te = x.isEnabled(x.SCISSOR_TEST);
1057
+ x.activeTexture(x.TEXTURE0), x.bindTexture(x.TEXTURE_2D, null), x.bindFramebuffer(x.FRAMEBUFFER, S.fbo), x.viewport(0, 0, f, p), x.disable(x.SCISSOR_TEST), x.disable(x.STENCIL_TEST), x.clear(x.COLOR_BUFFER_BIT), x.disable(x.BLEND);
1058
+ let C = i(ee, t);
1059
+ return C && (x.bindVertexArray(e.meshCache.uploadRecurring(Pt).vao), w(e, Pt.indices.length, x.UNSIGNED_INT), x.bindVertexArray(null)), x.enable(x.BLEND), Ee(e, o, s, te), C ? {
1060
+ texture: S.texture,
1061
+ uvFromScreen: new Float32Array([
1062
+ a / S.width,
1063
+ 0,
1064
+ 0,
1065
+ 0,
1066
+ a / S.height,
1067
+ 0,
1068
+ -c / S.width,
1069
+ -u / S.height,
1070
+ 1
1071
+ ])
1072
+ } : null;
1073
+ }
1074
+ function It(e, t, n) {
1075
+ let r = e.gl;
1076
+ return r.useProgram(t.handle), W(e, t, O), r.uniformMatrix3fv(t.uniform("u_worldInv"), !1, n.uvFromScreen), r.activeTexture(r.TEXTURE0), r.bindTexture(r.TEXTURE_2D, n.texture), r.uniform1i(t.uniform("u_sampler"), 0), t;
1077
+ }
1078
+ function Lt(e, t) {
1079
+ e.imageCache.upload(t.image, t.image);
1080
+ let { staged: n, slot: r } = L(e, t.image, t.sampling ?? "linear"), i = t.source, a = 0, o = 0, s = 1, c = 1;
1081
+ if (i) {
1082
+ let e = t.image.width, n = t.image.height;
1083
+ a = i.x / e, s = (i.x + i.w) / e, o = i.y / n, c = (i.y + i.h) / n;
1084
+ }
1085
+ if (t.flipX) {
1086
+ let e = a;
1087
+ a = s, s = e;
1088
+ }
1089
+ if (t.flipY) {
1090
+ let e = o;
1091
+ o = c, c = e;
1092
+ }
1093
+ e.drawBatch.pushQuad(t.x, t.y, t.w, t.h, e.state.transform, a, o, s, c, (t.opacity ?? 1) * (n.foldsAlpha ? e.state.alpha : 1), r);
1094
+ }
1095
+ function Rt(e, t) {
1096
+ let n = t.sprites, r = Math.floor(n.length / u);
1097
+ if (r === 0) return;
1098
+ e.imageCache.upload(t.image, t.image);
1099
+ let i = t.sampling ?? "linear", { staged: a, slot: o } = L(e, t.image, i), s = e.drawBatch, c = e.state.transform, l = a.foldsAlpha ? e.state.alpha : 1, d = t.image.width, f = t.image.height;
1100
+ for (let p = 0, m = 0; p < r; p++, m += u) {
1101
+ s.wouldOverflow(4) && (H(e), {staged: a, slot: o} = L(e, t.image, i), l = a.foldsAlpha ? e.state.alpha : 1);
1102
+ let r = n[m + 4], u = n[m + 5], p = n[m + 6], h = n[m + 7];
1103
+ s.pushQuad(n[m], n[m + 1], n[m + 2], n[m + 3], c, r / d, u / f, (r + p) / d, (u + h) / f, n[m + 8] * l, o);
1104
+ }
1105
+ }
1106
+ //#endregion
1107
+ export { vt as OUTLINE_MIN_SCREEN_PX, j as dispatch, Oe as drawGroup, H as flushBatch, f as getMesh, o as mat3, ut as popClip, lt as pushClip, ye as setUniform, V as tryStageFill };
1108
+
1109
+ //# sourceMappingURL=draw.js.map