flo-mat 4.0.2 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/__tests__/find-2-prong/get-medial/dd-get-medial-point-coeffs-same-curve.spec.ts +106 -0
  2. package/__tests__/find-2-prong/get-medial/dd-get-medial-point-coeffs.spec.ts +73 -0
  3. package/__tests__/find-2-prong/get-medial/get-closest-points.spec.ts +5 -2
  4. package/__tests__/helpers/close-to.ts +5 -5
  5. package/__tests__/specific-cases/load-svg/load-svg.ts +30 -0
  6. package/__tests__/specific-cases/specific-cases.spec.ts +170 -0
  7. package/__tests__/specific-cases/test-svgs/achispado.svg +5052 -0
  8. package/browser/index.js +5129 -8785
  9. package/browser/index.min.js +1 -1
  10. package/{jest.config.cjs → jest.config.ts} +8 -3
  11. package/node/closest-boundary-point/get-close-boundary-points-certified.js +3 -2
  12. package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -1
  13. package/node/corner/get-corner.js +1 -1
  14. package/node/corner/get-corner.js.map +1 -1
  15. package/node/cp-node/fs/get-all-on-loop-by-loop.d.ts +11 -0
  16. package/node/cp-node/fs/get-all-on-loop-by-loop.js +42 -0
  17. package/node/cp-node/fs/get-all-on-loop-by-loop.js.map +1 -0
  18. package/node/cp-node/fs/get-boundary-beziers-to-next.d.ts +1 -0
  19. package/node/cp-node/fs/get-boundary-beziers-to-next.js +1 -59
  20. package/node/cp-node/fs/get-boundary-beziers-to-next.js.map +1 -1
  21. package/node/cp-node/fs/get-edge-direction.d.ts +3 -1
  22. package/node/cp-node/fs/get-edge-direction.js +5 -3
  23. package/node/cp-node/fs/get-edge-direction.js.map +1 -1
  24. package/node/cp-node/fs/get-mat-curve-between.js +6 -6
  25. package/node/cp-node/fs/get-mat-curve-between.js.map +1 -1
  26. package/node/cp-node/fs/is-fully-terminating.js +12 -0
  27. package/node/cp-node/fs/is-fully-terminating.js.map +1 -1
  28. package/node/cp-node/fs/is-on-same-loop.d.ts +3 -0
  29. package/node/cp-node/fs/is-on-same-loop.js +6 -0
  30. package/node/cp-node/fs/is-on-same-loop.js.map +1 -0
  31. package/node/debug/debug.d.ts +8 -22
  32. package/node/debug/debug.js +12 -50
  33. package/node/debug/debug.js.map +1 -1
  34. package/node/find-2-prong/add-1-prong.js +1 -4
  35. package/node/find-2-prong/add-1-prong.js.map +1 -1
  36. package/node/find-2-prong/find-2-prong.js +24 -10
  37. package/node/find-2-prong/find-2-prong.js.map +1 -1
  38. package/node/find-2-prong/get-medial/get-antipodal-points.d.ts +1 -1
  39. package/node/find-2-prong/get-medial/get-antipodal-points.js +2 -2
  40. package/node/find-2-prong/get-medial/get-antipodal-points.js.map +1 -1
  41. package/node/find-2-prong/get-medial/get-closest-points.d.ts +7 -1
  42. package/node/find-2-prong/get-medial/get-closest-points.js +60 -14
  43. package/node/find-2-prong/get-medial/get-closest-points.js.map +1 -1
  44. package/node/find-2-prong/reduce-radius.d.ts +3 -1
  45. package/node/find-2-prong/reduce-radius.js +8 -6
  46. package/node/find-2-prong/reduce-radius.js.map +1 -1
  47. package/node/find-3-prong/calc-better-x.js +1 -3
  48. package/node/find-3-prong/calc-better-x.js.map +1 -1
  49. package/node/find-3-prong/calc-initial-3-prong-center.js +1 -2
  50. package/node/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
  51. package/node/find-3-prong/find-3-prong-for-delta3s.js +1 -4
  52. package/node/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
  53. package/node/find-3-prong/find-3-prong.js.map +1 -1
  54. package/node/find-3-prong/find-and-add-3-prong.js +0 -14
  55. package/node/find-3-prong/find-and-add-3-prong.js.map +1 -1
  56. package/node/find-mat/find-mat.js +2 -2
  57. package/node/find-mat/find-mat.js.map +1 -1
  58. package/node/find-mat/find-mats.js.map +1 -1
  59. package/node/find-mat/get-dull-corners-on-loop.js +3 -2
  60. package/node/find-mat/get-dull-corners-on-loop.js.map +1 -1
  61. package/node/find-mat/get-for-1-prongs-on-loop.js +6 -3
  62. package/node/find-mat/get-for-1-prongs-on-loop.js.map +1 -1
  63. package/node/find-mat/get-for-2-prongs-on-loop.js +5 -1
  64. package/node/find-mat/get-for-2-prongs-on-loop.js.map +1 -1
  65. package/node/find-mat/get-meta.d.ts +4 -6
  66. package/node/find-mat/get-meta.js +12 -26
  67. package/node/find-mat/get-meta.js.map +1 -1
  68. package/node/find-mat/get-sharp-corners.js +4 -2
  69. package/node/find-mat/get-sharp-corners.js.map +1 -1
  70. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.d.ts +21 -0
  71. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.js +46 -0
  72. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.js.map +1 -0
  73. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.d.ts +28 -0
  74. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.js +97 -0
  75. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.js.map +1 -0
  76. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.d.ts +28 -0
  77. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.js +109 -0
  78. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.js.map +1 -0
  79. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.d.ts +29 -0
  80. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.js +123 -0
  81. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.js.map +1 -0
  82. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.d.ts +30 -0
  83. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.js +177 -0
  84. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.js.map +1 -0
  85. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.d.ts +29 -0
  86. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.js +156 -0
  87. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.js.map +1 -0
  88. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs.d.ts +28 -0
  89. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs.js +40 -0
  90. package/node/get-medial-points/double-double/dd-get-medial-point-coeffs.js.map +1 -0
  91. package/node/index.d.ts +6 -10
  92. package/node/index.js +5 -6
  93. package/node/index.js.map +1 -1
  94. package/node/point-on-shape/point-on-shape.d.ts +2 -0
  95. package/node/point-on-shape/to-p.d.ts +1 -1
  96. package/node/point-on-shape/to-p.js +1 -1
  97. package/node/point-on-shape/to-p.js.map +1 -1
  98. package/node/reconstruct-from-mat/get-cp-nodess-for-sat.d.ts +4 -0
  99. package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js +15 -0
  100. package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js.map +1 -0
  101. package/node/reconstruct-from-mat/reconstruct-from-mat.d.ts +10 -0
  102. package/node/reconstruct-from-mat/reconstruct-from-mat.js +160 -0
  103. package/node/reconstruct-from-mat/reconstruct-from-mat.js.map +1 -0
  104. package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.d.ts +12 -0
  105. package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js +46 -0
  106. package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js.map +1 -0
  107. package/node/sat/add-debug-info.js +1 -2
  108. package/node/sat/add-debug-info.js.map +1 -1
  109. package/node/svg/get-loop-bounds.js +6 -2
  110. package/node/svg/get-loop-bounds.js.map +1 -1
  111. package/node/utils/map-deep.d.ts +15 -0
  112. package/node/utils/map-deep.js +34 -0
  113. package/node/utils/map-deep.js.map +1 -0
  114. package/package.json +14 -8
  115. package/src/closest-boundary-point/get-close-boundary-points-certified.ts +3 -2
  116. package/src/corner/get-corner.ts +1 -1
  117. package/src/cp-node/fs/get-all-on-loop-by-loop.ts +56 -0
  118. package/src/cp-node/fs/get-all-on-loop.ts +1 -1
  119. package/src/cp-node/fs/get-boundary-beziers-to-next.ts +1 -72
  120. package/src/cp-node/fs/get-edge-direction.ts +8 -4
  121. package/src/cp-node/fs/get-mat-curve-between.ts +6 -6
  122. package/src/cp-node/fs/is-fully-terminating.ts +16 -0
  123. package/src/cp-node/fs/is-on-same-loop.ts +15 -0
  124. package/src/debug/debug.ts +27 -87
  125. package/src/find-2-prong/add-1-prong.ts +1 -5
  126. package/src/find-2-prong/find-2-prong.ts +37 -14
  127. package/src/find-2-prong/get-medial/get-antipodal-points.ts +3 -2
  128. package/src/find-2-prong/get-medial/get-closest-points-d.ts +213 -0
  129. package/src/find-2-prong/get-medial/get-closest-points.ts +74 -13
  130. package/src/find-2-prong/reduce-radius.ts +8 -5
  131. package/src/find-3-prong/calc-better-x.ts +1 -3
  132. package/src/find-3-prong/calc-initial-3-prong-center.ts +1 -2
  133. package/src/find-3-prong/find-3-prong-for-delta3s.ts +1 -4
  134. package/src/find-3-prong/find-3-prong.ts +0 -1
  135. package/src/find-3-prong/find-and-add-3-prong.ts +1 -15
  136. package/src/find-mat/find-mat.ts +3 -2
  137. package/src/find-mat/find-mats.ts +0 -1
  138. package/src/find-mat/get-dull-corners-on-loop.ts +4 -3
  139. package/src/find-mat/get-for-1-prongs-on-loop.ts +8 -3
  140. package/src/find-mat/get-for-2-prongs-on-loop.ts +6 -1
  141. package/src/find-mat/get-meta.ts +14 -38
  142. package/src/find-mat/get-sharp-corners.ts +5 -1
  143. package/src/get-medial-curve/__pycache__/get-cubic-self-medial-curve.cpython-313.pyc +0 -0
  144. package/src/get-medial-curve/get-cubic-self-medial-curve.py +419 -0
  145. package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0-with-running-err.ts +76 -0
  146. package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.ts +61 -0
  147. package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.ts +116 -0
  148. package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.ts +129 -0
  149. package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.ts +142 -0
  150. package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.ts +199 -0
  151. package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.ts +177 -0
  152. package/src/get-medial-points/double-double/dd-get-medial-point-coeffs.ts +48 -0
  153. package/src/get-medial-points/double-double/error-bound-calc.txt +72 -0
  154. package/src/index.ts +7 -11
  155. package/src/point-on-shape/point-on-shape.ts +3 -0
  156. package/src/point-on-shape/to-p.ts +2 -2
  157. package/src/reconstruct-from-mat/get-cp-nodess-for-sat.ts +24 -0
  158. package/src/reconstruct-from-mat/reconstruct-from-mat.ts +226 -0
  159. package/src/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.ts +62 -0
  160. package/src/sat/add-debug-info.ts +1 -2
  161. package/src/svg/get-loop-bounds.ts +11 -3
  162. package/src/utils/clip.ts +13 -0
  163. package/src/utils/map-deep.ts +75 -0
  164. package/src/utils/map-map.ts +33 -0
  165. package/wallaby.mjs +4 -4
  166. package/node/debug/debug-elem-types.d.ts +0 -26
  167. package/node/debug/debug-elem-types.js +0 -22
  168. package/node/debug/debug-elem-types.js.map +0 -1
  169. package/node/debug/functions/draw/draw-beziers-as-single-path.d.ts +0 -2
  170. package/node/debug/functions/draw/draw-beziers-as-single-path.js +0 -30
  171. package/node/debug/functions/draw/draw-beziers-as-single-path.js.map +0 -1
  172. package/node/debug/functions/draw/xmlns.d.ts +0 -2
  173. package/node/debug/functions/draw/xmlns.js +0 -3
  174. package/node/debug/functions/draw/xmlns.js.map +0 -1
  175. package/node/debug/functions/draw-elem/bounding-hull.d.ts +0 -3
  176. package/node/debug/functions/draw-elem/bounding-hull.js +0 -8
  177. package/node/debug/functions/draw-elem/bounding-hull.js.map +0 -1
  178. package/node/debug/functions/draw-elem/draw-branch.d.ts +0 -4
  179. package/node/debug/functions/draw-elem/draw-branch.js +0 -26
  180. package/node/debug/functions/draw-elem/draw-branch.js.map +0 -1
  181. package/node/debug/functions/draw-elem/draw-circle-percent.d.ts +0 -3
  182. package/node/debug/functions/draw-elem/draw-circle-percent.js +0 -13
  183. package/node/debug/functions/draw-elem/draw-circle-percent.js.map +0 -1
  184. package/node/debug/functions/draw-elem/draw-cp-node.d.ts +0 -4
  185. package/node/debug/functions/draw-elem/draw-cp-node.js +0 -26
  186. package/node/debug/functions/draw-elem/draw-cp-node.js.map +0 -1
  187. package/node/debug/functions/draw-elem/draw-cull.d.ts +0 -3
  188. package/node/debug/functions/draw-elem/draw-cull.js +0 -9
  189. package/node/debug/functions/draw-elem/draw-cull.js.map +0 -1
  190. package/node/debug/functions/draw-elem/draw-dull-corner.d.ts +0 -4
  191. package/node/debug/functions/draw-elem/draw-dull-corner.js +0 -10
  192. package/node/debug/functions/draw-elem/draw-dull-corner.js.map +0 -1
  193. package/node/debug/functions/draw-elem/draw-elem.d.ts +0 -10
  194. package/node/debug/functions/draw-elem/draw-elem.js +0 -39
  195. package/node/debug/functions/draw-elem/draw-elem.js.map +0 -1
  196. package/node/debug/functions/draw-elem/draw-leaves.d.ts +0 -4
  197. package/node/debug/functions/draw-elem/draw-leaves.js +0 -34
  198. package/node/debug/functions/draw-elem/draw-leaves.js.map +0 -1
  199. package/node/debug/functions/draw-elem/draw-loop.d.ts +0 -4
  200. package/node/debug/functions/draw-elem/draw-loop.js +0 -11
  201. package/node/debug/functions/draw-elem/draw-loop.js.map +0 -1
  202. package/node/debug/functions/draw-elem/draw-loops.d.ts +0 -4
  203. package/node/debug/functions/draw-elem/draw-loops.js +0 -6
  204. package/node/debug/functions/draw-elem/draw-loops.js.map +0 -1
  205. package/node/debug/functions/draw-elem/draw-loose-bounding-box.d.ts +0 -3
  206. package/node/debug/functions/draw-elem/draw-loose-bounding-box.js +0 -10
  207. package/node/debug/functions/draw-elem/draw-loose-bounding-box.js.map +0 -1
  208. package/node/debug/functions/draw-elem/draw-mat.d.ts +0 -4
  209. package/node/debug/functions/draw-elem/draw-mat.js +0 -34
  210. package/node/debug/functions/draw-elem/draw-mat.js.map +0 -1
  211. package/node/debug/functions/draw-elem/draw-max-vertex.d.ts +0 -4
  212. package/node/debug/functions/draw-elem/draw-max-vertex.js +0 -9
  213. package/node/debug/functions/draw-elem/draw-max-vertex.js.map +0 -1
  214. package/node/debug/functions/draw-elem/draw-min-y.d.ts +0 -4
  215. package/node/debug/functions/draw-elem/draw-min-y.js +0 -10
  216. package/node/debug/functions/draw-elem/draw-min-y.js.map +0 -1
  217. package/node/debug/functions/draw-elem/draw-one-prong-at-dull-corner.d.ts +0 -4
  218. package/node/debug/functions/draw-elem/draw-one-prong-at-dull-corner.js +0 -22
  219. package/node/debug/functions/draw-elem/draw-one-prong-at-dull-corner.js.map +0 -1
  220. package/node/debug/functions/draw-elem/draw-one-prong.d.ts +0 -4
  221. package/node/debug/functions/draw-elem/draw-one-prong.js +0 -13
  222. package/node/debug/functions/draw-elem/draw-one-prong.js.map +0 -1
  223. package/node/debug/functions/draw-elem/draw-sharp-corner.d.ts +0 -4
  224. package/node/debug/functions/draw-elem/draw-sharp-corner.js +0 -10
  225. package/node/debug/functions/draw-elem/draw-sharp-corner.js.map +0 -1
  226. package/node/debug/functions/draw-elem/draw-three-prong.d.ts +0 -4
  227. package/node/debug/functions/draw-elem/draw-three-prong.js +0 -26
  228. package/node/debug/functions/draw-elem/draw-three-prong.js.map +0 -1
  229. package/node/debug/functions/draw-elem/draw-tight-bounding-box.d.ts +0 -3
  230. package/node/debug/functions/draw-elem/draw-tight-bounding-box.js +0 -8
  231. package/node/debug/functions/draw-elem/draw-tight-bounding-box.js.map +0 -1
  232. package/node/debug/functions/draw-elem/draw-two-prong.d.ts +0 -4
  233. package/node/debug/functions/draw-elem/draw-two-prong.js +0 -49
  234. package/node/debug/functions/draw-elem/draw-two-prong.js.map +0 -1
  235. package/node/debug/functions/draw-elem/draw-vertex.d.ts +0 -4
  236. package/node/debug/functions/draw-elem/draw-vertex.js +0 -13
  237. package/node/debug/functions/draw-elem/draw-vertex.js.map +0 -1
  238. package/node/debug/functions/general.d.ts +0 -48
  239. package/node/debug/functions/general.js +0 -53
  240. package/node/debug/functions/general.js.map +0 -1
  241. package/node/find-3-prong/timed-cc.d.ts +0 -3
  242. package/node/find-3-prong/timed-cc.js +0 -5
  243. package/node/find-3-prong/timed-cc.js.map +0 -1
  244. package/node/point-on-shape/pos-to-human-string.d.ts +0 -8
  245. package/node/point-on-shape/pos-to-human-string.js +0 -12
  246. package/node/point-on-shape/pos-to-human-string.js.map +0 -1
  247. package/node/utils/time-function-call.d.ts +0 -14
  248. package/node/utils/time-function-call.js +0 -32
  249. package/node/utils/time-function-call.js.map +0 -1
  250. package/src/debug/debug-elem-types.ts +0 -43
  251. package/src/debug/elem-type-two-prong.ts +0 -8
  252. package/src/debug/functions/cmp-cp-on-delta.ts +0 -54
  253. package/src/debug/functions/draw-elem/bounding-hull.ts +0 -18
  254. package/src/debug/functions/draw-elem/culls.ts +0 -39
  255. package/src/debug/functions/draw-elem/draw-branch.ts +0 -37
  256. package/src/debug/functions/draw-elem/draw-circle-percent.ts +0 -23
  257. package/src/debug/functions/draw-elem/draw-cp-node.ts +0 -46
  258. package/src/debug/functions/draw-elem/draw-cull.ts +0 -21
  259. package/src/debug/functions/draw-elem/draw-dull-corner.ts +0 -21
  260. package/src/debug/functions/draw-elem/draw-elem.ts +0 -64
  261. package/src/debug/functions/draw-elem/draw-leaves.ts +0 -51
  262. package/src/debug/functions/draw-elem/draw-loop.ts +0 -16
  263. package/src/debug/functions/draw-elem/draw-loops.ts +0 -10
  264. package/src/debug/functions/draw-elem/draw-loose-bounding-box.ts +0 -21
  265. package/src/debug/functions/draw-elem/draw-mat.ts +0 -43
  266. package/src/debug/functions/draw-elem/draw-max-vertex.ts +0 -15
  267. package/src/debug/functions/draw-elem/draw-min-y.ts +0 -18
  268. package/src/debug/functions/draw-elem/draw-one-prong-at-dull-corner.ts +0 -40
  269. package/src/debug/functions/draw-elem/draw-one-prong.ts +0 -25
  270. package/src/debug/functions/draw-elem/draw-sharp-corner.ts +0 -21
  271. package/src/debug/functions/draw-elem/draw-three-prong.ts +0 -44
  272. package/src/debug/functions/draw-elem/draw-tight-bounding-box.ts +0 -18
  273. package/src/debug/functions/draw-elem/draw-two-prong.ts +0 -68
  274. package/src/debug/functions/draw-elem/draw-vertex.ts +0 -27
  275. package/src/debug/functions/draw-elem/dull-corner.ts +0 -21
  276. package/src/debug/functions/draw-elem/leaves.ts +0 -20
  277. package/src/debug/functions/draw-elem/loop.ts +0 -16
  278. package/src/debug/functions/draw-elem/loops.ts +0 -10
  279. package/src/debug/functions/draw-elem/loose-bounding-box.ts +0 -21
  280. package/src/debug/functions/draw-elem/mat.ts +0 -47
  281. package/src/debug/functions/draw-elem/max-vertex.ts +0 -15
  282. package/src/debug/functions/draw-elem/min-y.ts +0 -18
  283. package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +0 -26
  284. package/src/debug/functions/draw-elem/one-prong.ts +0 -23
  285. package/src/debug/functions/draw-elem/sharp-corner.ts +0 -20
  286. package/src/debug/functions/draw-elem/three-prong.ts +0 -30
  287. package/src/debug/functions/draw-elem/tight-bounding-box.ts +0 -18
  288. package/src/debug/functions/draw-elem/two-prong.ts +0 -50
  289. package/src/debug/functions/draw-elem/vertex.ts +0 -51
  290. package/src/debug/functions/general.ts +0 -79
  291. package/src/debug/functions/three-prong.ts +0 -249
  292. package/src/debug/functions/two-prong.ts +0 -203
  293. package/src/find-2-prong/add-debug-info.ts +0 -45
  294. package/src/find-3-prong/timed-cc.ts +0 -9
@@ -1 +1 @@
1
- function t(t=[],e){const r=[],o={beziers:t,curves:r,idx:e};if(0===t.length)return o;let i,c=0;for(let e=0;e<t.length;e++){if(n(t[e]))continue;const s={loop:o,ps:t[e],prev:i,next:void 0,idx:c};i&&(i.next=s),i=s,r.push(s),c++}const s=r[r.length-1];return r[0].prev=s,s.next=r[0],s.ps[s.ps.length-1]=r[0].ps[0],o}function n(t){return 2===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]:3===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]:t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]&&t[2][1]===t[3][1]&&t[2][1]===t[3][1]}function e(t){const n=[];for(let e=0;e<t.length;e++){const r=t[e];0===e&&n.push("M "+r[0][0].toString()+" "+r[0][1].toString()),4===r.length?n.push("C "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "+r[3][0].toString()+" "+r[3][1].toString()+" "):3===r.length?n.push("Q "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "):2===r.length&&n.push("L "+r[1][0].toString()+" "+r[1][1].toString()+" ")}return n.push(" z"),n.join("\n")}class r{initialPoint=void 0;p;vals=void 0;prev2ndCubicControlPoint=void 0;prev2ndQuadraticControlPoint=void 0;constructor(){this.p=[0,0]}}function o(t){const n=[t.p,t.initialPoint];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n}function i(t){t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0;const n=(e=t.p,t.vals[0],t.vals[1],t.vals[2],t.vals[3],t.vals[4],[[e,[t.vals[5],t.vals[6]]]]);var e;const r=n[n.length-1];return t.p=r[r.length-1],n}const c={c:function(t){const n=[t.p,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]],[t.vals[4],t.vals[5]]];return t.prev2ndCubicControlPoint=n[2],t.prev2ndQuadraticControlPoint=void 0,n},h:function(t){const n=[t.p,[t.vals[0],t.p[1]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},l:function(t){const n=[t.p,t.vals];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},q:function(t){const n=[t.vals[0],t.vals[1]],e=[t.vals[2],t.vals[3]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},s:function(t){const n=t.prev2ndCubicControlPoint?[t.p[0]-t.prev2ndCubicControlPoint[0]+t.p[0],t.p[1]-t.prev2ndCubicControlPoint[1]+t.p[1]]:t.p,e=[t.p,n,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]]];return t.prev2ndCubicControlPoint=e[2],t.prev2ndQuadraticControlPoint=void 0,e},t:function(t){const n=t.prev2ndQuadraticControlPoint?[t.p[0]-t.prev2ndQuadraticControlPoint[0]+t.p[0],t.p[1]-t.prev2ndQuadraticControlPoint[1]+t.p[1]]:t.p,e=[t.vals[0],t.vals[1]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},v:function(t){const n=[t.p,[t.p[0],t.vals[0]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},z:o};function s(t){let n=0,e=0,r=1,o=0,i=1,c=1;const s=t._currentIndex;t._skipOptionalSpaces();let u=t._currentIndex;u<t._endIndex&&"+"===t._string[u]?(t._currentIndex+=1,u+=1):u<t._endIndex&&"-"===t._string[u]&&(t._currentIndex+=1,u+=1,i=-1);const f=t._string[u];if(u===t._endIndex||(f<"0"||f>"9")&&"."!==f)throw new Error(`The first character of a number must be one of [0-9+-.]. Found '${f}' at index ${u}.`);const l=t._currentIndex;for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)t._currentIndex+=1,u+=1;if(u!==l){let n=u-1,r=1;for(;n>=l;)e+=r*(Number(t._string[n])-0),n-=1,r*=10}if(u<t._endIndex&&"."===t._string[u]){if(t._currentIndex+=1,u+=1,u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be a least one digit following the .");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)r*=10,o+=Number(t._string.charAt(u))/r,t._currentIndex+=1,u+=1}if(u!==s&&u+1<t._endIndex&&("e"===t._string[u]||"E"===t._string[u])&&"x"!==t._string[u+1]&&"m"!==t._string[u+1]){if(t._currentIndex+=1,u+=1,"+"===t._string[u]?(t._currentIndex+=1,u+=1):"-"===t._string[u]&&(t._currentIndex+=1,u+=1,c=-1),u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be an exponent.");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)n*=10,n+=Number(t._string[u]),t._currentIndex+=1,u+=1}let a=e+o;if(a*=i,n&&(a*=Math.pow(10,c*n)),s===u)throw new Error("Internal error: startIndex === source._currentIndex");return t._skipOptionalSpacesOrDelimiter(),a}const u={Z:"Z",M:"M",L:"L",C:"C",Q:"Q",A:"A",H:"H",V:"V",S:"S",T:"T",z:"Z",m:"m",l:"l",c:"c",q:"q",a:"a",h:"h",v:"v",s:"s",t:"t"};class f{_string;_currentIndex;_endIndex;_prevCommand;constructor(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._prevCommand=void 0,this._skipOptionalSpaces()}parseSegment(){const t=this._string[this._currentIndex];let n,e=u[t];if(void 0===e){if(void 0===this._prevCommand)throw new Error("Implicit command not allowed for first commands.");if(!("+"===t||"-"===t||"."===t||t>="0"&&t<="9")||"Z"===this._prevCommand)throw new Error("Remaining coordinates not found for implicit command");e="M"===this._prevCommand?"L":"m"===this._prevCommand?"l":this._prevCommand}else this._currentIndex+=1;this._prevCommand=e;const r=e.toUpperCase();if("H"===r||"V"===r?n=[s(this)]:"M"===r||"L"===r||"T"===r?n=[s(this),s(this)]:"S"===r||"Q"===r?n=[s(this),s(this),s(this),s(this)]:"C"===r?n=[s(this),s(this),s(this),s(this),s(this),s(this)]:"A"===r?n=[s(this),s(this),s(this),this._parseArcFlag(),this._parseArcFlag(),s(this),s(this)]:"Z"===r&&(this._skipOptionalSpaces(),n=[]),void 0===n)throw new Error("Unknown command");return{type:e,values:n}}hasMoreData(){return this._currentIndex<this._endIndex}initialCommandIsMoveTo(){if(!this.hasMoreData())return!0;const t=u[this._string[this._currentIndex]];return"M"===t||"m"===t}_isCurrentSpace(){const t=this._string[this._currentIndex];return t<=" "&&(" "===t||"\n"===t||"\t"===t||"\r"===t||"\f"===t)}_skipOptionalSpaces(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex+=1;return this._currentIndex<this._endIndex}_skipOptionalSpacesOrDelimiter(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!==this._string[this._currentIndex])&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","===this._string[this._currentIndex]&&(this._currentIndex+=1,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)}_parseArcFlag(){if(this._currentIndex>=this._endIndex)throw new Error("Unable to parse arc flag");let t;const n=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===n)t=0;else{if("1"!==n)throw new Error("Unable to parse arc flag - arc flag must be 0 or 1");t=1}return this._skipOptionalSpacesOrDelimiter(),t}}function l(t){return function(t){if(0===t.length)return[];if("m"!==t[0].type.toLowerCase())throw new Error("Invalid SVG - every new path must start with an M or m.");const n=new r,e=[];let s,u=[];for(let r=0;r<t.length;r++){const f=t[r],l=f.type.toLowerCase();if(n.vals=f.values,f.type===l)if("v"===l)n.vals[0]+=n.p[1];else if("a"===l)n.vals[5]+=n.p[0],n.vals[6]+=n.p[1];else for(let t=0;t<n.vals.length;t++)n.vals[t]+=n.p[t%2];if("m"!==l){if("a"===l)u.push(...i(n));else{const t=c[l];if(!t)throw new Error("Invalid SVG - command not recognized.");const e=t(n);n.p=e[e.length-1],u.push(e)}s=l}else u.length&&("z"!==s&&u.push(o(n)),e.push(u),u=[]),n.initialPoint=n.p=n.vals,s=l}return u.length>0&&("z"!==s&&u.push(o(n)),e.push(u)),e}(function(t){if(!t.length)return[];const n=new f(t),e=[];if(!n.initialCommandIsMoveTo())throw new Error("Path must start with m or M");for(;n.hasMoreData();)e.push(n.parseSegment());return e}(t))}function a(t,n,e="thin10 red nofill",r=0){if(0===n.length)return[];let o=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];if(e.length<=1)continue;const[,r,i,c]=e;o+=2===e.length?`L ${r[0]} ${r[1]} `:3===e.length?`Q ${r[0]} ${r[1]} ${i[0]} ${i[1]} `:`C ${r[0]} ${r[1]} ${i[0]} ${i[1]} ${c[0]} ${c[1]} `}const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d",o),i.setAttributeNS(null,"class",e),t.appendChild(i),[i]}function p(t){const n=t.length,e=Array.from(Array(n),()=>new Array(n).fill(0));for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][o]=t[r][o];for(let t=0;t<n;t++)for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][t]+e[t][o]<e[r][o]&&(e[r][o]=e[r][t]+e[t][o]);return e}function h(t){const n=t,e=[];do{e.push(t),t=t.next}while(t!==n);return e}function d(t){return h(t).filter(t=>t.isHoleClosing)}function g(t){const n=t.pointOnShape;return{idx:n.curve.idx,t:n.t,order:n.order,order2:n.order2}}function v(t){const n=t;let e=n,r=0;do{r++,e=e.nextOnCircle}while(e!==n);return r}function m(t,n=!1){const e=t,r=n?[]:[t];let o=t.nextOnCircle;for(;o!==e;)r.push(o),o=o.nextOnCircle;return r}function x(t){return t===t.next.prevOnCircle}function b(t){return m(t).filter(t=>!x(t)).length}function w(t){return m(t.prevOnCircle,!0).every(x)}function _(t){return 0===t.pointOnShape.circle.radius}function M(t){const n=t.pointOnShape,e=n.curve;return{...t,pos:n,p:n.p,t:n.t,isTerminating:x(t),isFullyTerminating:w(t),isSharp:_(t),prongCount:v(t),getRealProngCount:b(t),ordering:g(t),curve:e,loop:e.loop}}function S(t){let n=t;if(x(n))return[n];const e=[];do{e.push(n);const t=n.next.prevOnCircle;n=n=n===t?n.next.next:t}while(n!==t);return e}function N(t,n){const e=h(t),r=new Set;for(t of e)x(t)||r.has(t.next.prevOnCircle)||n(t),r.add(t)}function I(t){const n=[],e=t;let r=e;for(;r!==e.prevOnCircle;)x(r)||n.push(r.next),r=r.nextOnCircle;return n}function y(t,n){n(t);const e=m(t).filter(t=>!x(t)).map(t=>t.next);for(const t of e){const e=[t];for(;e.length;){const t=e.pop();n(t),e.push(...I(t))}}}const E=["prev","next","prevOnCircle","nextOnCircle","holeCloserTwin"];function O(t){const n=new Map,e=C(t);n.set(t,e);const r=[{cpNode:t,newCpNode:e}];for(;r.length;){const{cpNode:t,newCpNode:e}=r.pop();for(const o of E){const i=t[o];if(void 0===i)continue;let c=n.get(i);c||(c=C(i),n.set(i,c),r.push({cpNode:i,newCpNode:c})),e[o]=c}}return e}function C(t){return{...t,prev:void 0,next:void 0,prevOnCircle:void 0,nextOnCircle:void 0,holeCloserTwin:void 0}}function T(t){const n=t,e=t.next,r=n.pointOnShape,o=e.pointOnShape,i=r.curve,c=o.curve;if(i.loop!==c.loop)return[];const s=[];return c===i?s.push({ps:r.curve.ps,ts:[r.t,o.t]}):(s.push({ps:r.curve.ps,ts:[r.t,1]}),function(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({ps:o.ps,ts:[0,n]})}while(o!==e)}(s,r.curve,o.curve,o.t)),s}function P(t,n,e){if(4===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,N=u-l,I=p-l,y=N+I,E=n*N,O=e*N,C=c[1]-u-3*I;return[[d*S+(3*n*(n*w-x)+s),d*C+(3*n*(n*y-N)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*C+2*y)+(h*y+u-(O+2*E))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*C+2*y)+(g*y+u-(2*O+E))],[v*S+(3*e*(e*w-x)+s),v*C+(3*e*(e*y-N)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[e,[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function A(t){return T(t).map(t=>P(t.ps,t.ts[0],t.ts[1]))}function k(t,n){const{cpTrees:e}=n,r=t.prev,o=t.next;r.next=o,o.prev=r,e.get(t.pointOnShape.curve.loop).remove(t,!1)}function B(t,n){const e=v(t);if(2!==e)throw new Error(`Cannot delete \`CpNode\` on ${e}-prong`);m(t).forEach(t=>k(t,n))}function z(t){const n=[],e=t.next;let r=e;do{n.push(r),r=r.nextOnCircle}while(r.nextOnCircle!==e);return n}function F(t,n,e){if(void 0===t.size||void 0===e)return;const r=e[n];if(t.size>r&&void 0!==r)for(const[n]of t){t.delete(n);break}}const Y=[function(t,n){let e,r=!1;return function(){return r||(e=t(),r=!0),e}},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t){return"object"!=typeof t&&"function"!=typeof t||null===t?o:r}const c=function(r){let c;const s=i(r);return s.has(r)?(e&&console.log("cache hit"),c=s.get(r)):(e&&console.log("cache miss"),c=t(r),s.set(r,c),F(o,0,n)),c};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e){const r=i(e);r.set(e,t),F(r,1,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o){const i=("object"==typeof o||"function"==typeof o)&&null!==o;let c="object"!=typeof t&&"function"!=typeof t||null===t?r:e,s=c.get(t);return void 0===s&&(s={weakMap:new WeakMap,map:new Map},c.set(t,s),F(c,0,n)),i?s.weakMap:s.map}function i(e,r){const i=o(e,r);let c;return i.has(r)?c=i.get(r):(c=t(e,r),i.set(r,c),F(i,1,n)),c}return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r){const i=o(e,r);i.set(r,t),F(i,1,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i){const c=("object"==typeof o||"function"==typeof o)&&null!==o,s=("object"==typeof i||"function"==typeof i)&&null!==i;let u="object"!=typeof t&&"function"!=typeof t||null===t?r:e,f=u.get(t);void 0===f&&(f={weakMap:new WeakMap,map:new Map},u.set(t,f),F(u,0,n));const l=c?f.weakMap:f.map;let a=l.get(o);return void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(o,a),F(l,1,n)),s?a.weakMap:a.map}const i=function(e,r,i){const c=o(e,r,i);let s;return c.has(i)?s=c.get(i):(s=t(e,r,i),c.set(i,s),F(c,2,n)),s};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i){const c=o(e,r,i);c.set(i,t),F(c,2,n)},i},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t,e,i,c){const s=("object"==typeof e||"function"==typeof e)&&null!==e,u=("object"==typeof i||"function"==typeof i)&&null!==i,f=("object"==typeof c||"function"==typeof c)&&null!==c;let l="object"!=typeof t&&"function"!=typeof t||null===t?o:r,a=l.get(t);void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(t,a),F(l,0,n));const p=s?a.weakMap:a.map;let h=p.get(e);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(e,h),F(p,1,n));const d=u?h.weakMap:h.map;let g=d.get(i);return void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(i,g),F(d,2,n)),f?g.weakMap:g.map}const c=function(r,o,c,s){const u=i(r,o,c,s);let f;return u.has(s)?(e&&console.log("cache hit"),f=u.get(s)):(e&&console.log("cache miss"),f=t(r,o,c,s),u.set(s,f),F(u,3,n)),f};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,r,o,c){const s=i(e,r,o,c);s.set(c,t),F(s,3,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s){const u=("object"==typeof o||"function"==typeof o)&&null!==o,f=("object"==typeof i||"function"==typeof i)&&null!==i,l=("object"==typeof c||"function"==typeof c)&&null!==c,a=("object"==typeof s||"function"==typeof s)&&null!==s;let p="object"!=typeof t&&"function"!=typeof t||null===t?r:e,h=p.get(t);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(t,h),F(p,0,n));const d=u?h.weakMap:h.map;let g=d.get(o);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(o,g),F(d,1,n));const v=f?g.weakMap:g.map;let m=v.get(i);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(i,m),F(v,2,n));const x=l?m.weakMap:m.map;let b=x.get(c);return void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(c,b),F(x,3,n)),a?b.weakMap:b.map}const i=function(e,r,i,c,s){const u=o(e,r,i,c,s);let f;return u.has(s)?f=u.get(s):(f=t(e,r,i,c,s),u.set(s,f),F(u,4,n)),f};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s){const u=o(e,r,i,c,s);u.set(s,t),F(u,4,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u){const f=("object"==typeof o||"function"==typeof o)&&null!==o,l=("object"==typeof i||"function"==typeof i)&&null!==i,a=("object"==typeof c||"function"==typeof c)&&null!==c,p=("object"==typeof s||"function"==typeof s)&&null!==s,h=("object"==typeof u||"function"==typeof u)&&null!==u;let d="object"!=typeof t&&"function"!=typeof t||null===t?r:e,g=d.get(t);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(t,g),F(d,0,n));const v=f?g.weakMap:g.map;let m=v.get(o);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(o,m),F(v,1,n));const x=l?m.weakMap:m.map;let b=x.get(i);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(i,b),F(x,2,n));const w=a?b.weakMap:b.map;let _=w.get(c);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(c,_),F(w,3,n));const M=p?_.weakMap:_.map;let S=M.get(s);return void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(s,S),F(M,4,n)),h?S.weakMap:S.map}const i=function(e,r,i,c,s,u){const f=o(e,r,i,c,s,u);let l;return f.has(u)?l=f.get(u):(l=t(e,r,i,c,s,u),f.set(u,l),F(f,5,n)),l};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u){const f=o(e,r,i,c,s,u);f.set(u,t),F(f,5,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f){const l=("object"==typeof o||"function"==typeof o)&&null!==o,a=("object"==typeof i||"function"==typeof i)&&null!==i,p=("object"==typeof c||"function"==typeof c)&&null!==c,h=("object"==typeof s||"function"==typeof s)&&null!==s,d=("object"==typeof u||"function"==typeof u)&&null!==u,g=("object"==typeof f||"function"==typeof f)&&null!==f;let v="object"!=typeof t&&"function"!=typeof t||null===t?r:e,m=v.get(t);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(t,m),F(v,0,n));const x=l?m.weakMap:m.map;let b=x.get(o);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(o,b),F(x,1,n));const w=a?b.weakMap:b.map;let _=w.get(i);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(i,_),F(w,2,n));const M=p?_.weakMap:_.map;let S=M.get(c);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(c,S),F(M,3,n));const N=h?S.weakMap:S.map;let I=N.get(s);void 0===I&&(I={weakMap:new WeakMap,map:new Map},N.set(s,I),F(N,4,n));const y=d?I.weakMap:I.map;let E=y.get(u);return void 0===E&&(E={weakMap:new WeakMap,map:new Map},y.set(u,E),F(y,5,n)),g?E.weakMap:E.map}const i=function(e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);let a;return l.has(f)?a=l.get(f):(a=t(e,r,i,c,s,u,f),l.set(f,a),F(l,6,n)),a};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);l.set(f,t),F(l,6,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f,l){const a=("object"==typeof o||"function"==typeof o)&&null!==o,p=("object"==typeof i||"function"==typeof i)&&null!==i,h=("object"==typeof c||"function"==typeof c)&&null!==c,d=("object"==typeof s||"function"==typeof s)&&null!==s,g=("object"==typeof u||"function"==typeof u)&&null!==u,v=("object"==typeof f||"function"==typeof f)&&null!==f,m=("object"==typeof l||"function"==typeof l)&&null!==l;let x="object"!=typeof t&&"function"!=typeof t||null===t?r:e,b=x.get(t);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(t,b),F(x,0,n));const w=a?b.weakMap:b.map;let _=w.get(o);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(o,_),F(w,1,n));const M=p?_.weakMap:_.map;let S=M.get(i);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(i,S),F(M,2,n));const N=h?S.weakMap:S.map;let I=N.get(c);void 0===I&&(I={weakMap:new WeakMap,map:new Map},N.set(c,I),F(N,3,n));const y=d?I.weakMap:I.map;let E=y.get(s);void 0===E&&(E={weakMap:new WeakMap,map:new Map},y.set(s,E),F(y,4,n));const O=g?E.weakMap:E.map;let C=O.get(u);void 0===C&&(C={weakMap:new WeakMap,map:new Map},O.set(u,C),F(O,5,n));const T=v?C.weakMap:C.map;let P=T.get(f);return void 0===P&&(P={weakMap:new WeakMap,map:new Map},T.set(f,P),F(T,6,n)),m?P.weakMap:P.map}const i=function(e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);let p;return a.has(l)?p=a.get(l):(p=t(e,r,i,c,s,u,f,l),a.set(l,p),F(a,7,n)),p};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);a.set(l,t),F(a,7,n)},i}];function L(t,n,e=!1){const r=t.length;if(r>8)throw new Error("A maximum of 8 formal parameters are supported");return(0,Y[r])(t,n,e)}function X(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=o-e,a=i-r,p=u-c,h=f-s,d=p*a-h*l;if(0===d)return;const g=((s-r)*l-(c-e)*a)/d;return[c+g*p,s+g*h]}function H(t,n){return[n[0]-t[0],n[1]-t[1]]}function D(t,n){return t[0]*n[0]+t[1]*n[1]}function V(t){return[-t[1],t[0]]}function $(t,n){return t[0]*n[1]-t[1]*n[0]}function q(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function j(t,n){function e(n){return[t[0]+n[0],t[1]+n[1]]}return void 0===n?e:e(n)}function W(t){const n=1/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]*n,t[1]*n]}function Q(t,n,e){function r(e){return[e[0]*n-e[1]*t,e[0]*t+e[1]*n]}return void 0===e?r:r(e)}function R(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+t[r];return e}function G(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function U(t,n){const[e,r]=G(t);return[R(e,n),R(r,n)]}function Z(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function J(t,n){const e=t.length,r=n.length;let o=0,i=0;const c=[];for(;o<e&&i<r;)0!==t[o]?0!==n[i]?Math.abs(t[o])<=Math.abs(n[i])?(c.push(t[o]),o++):(c.push(n[i]),i++):i++:o++;for(;o<e;)c.push(t[o]),o++;for(;i<r;)c.push(n[i]),i++;if(0===c.length)return[0];const s=c.length;if(1===s)return c;const u=[],f=c[1],l=c[0];let a=f+l;const p=l-(a-f);0!==p&&u.push(p),i=0;for(let t=2;t<s;t++){const n=c[t],e=a+n,r=e-a,o=a-(e-r)+(n-r);0!==o&&u.push(o),a=e}return 0===a&&0!==u.length||u.push(a),u}const K=134217729;function tt(t,n){const e=t.length;let r;const o=t[0];let i=o*n;const c=K*o,s=c-(c-o),u=o-s,f=K*n,l=f-(f-n),a=n-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=t[o],c=e*n,s=K*e,u=s-(s-e),f=e-u,l=K*n,a=l-(l-n),h=n-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function nt(t,n){const e=n.length;let r;const o=n[0];let i=o*t;const c=K*o,s=c-(c-o),u=o-s,f=K*t,l=f-(f-t),a=t-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=n[o],c=e*t,s=K*e,u=s-(s-e),f=e-u,l=K*t,a=l-(l-t),h=t-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function et(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(e,tt(n,t[r]));return e}function rt(t){let n=t[0];for(let e=1;e<t.length;e++)n+=t[e];return n}function ot(t){const n=t.length,e=new Array(n);for(let r=0;r<n;r++)e[r]=-t[r];return e}function it(t,n){return J(t,ot(n))}function ct(t){return t[t.length-1]}const st=Z,ut=nt;function ft(t){if(4===t.length){const[[n,e],[r,o]]=t;return[ut(3,st(r,n)),ut(3,st(o,e))]}if(3===t.length){const[[n,e],[r,o]]=t;return[st(2*r,2*n),st(2*o,2*e)]}if(2===t.length){const[[n,e],[r,o]]=t;return[st(r,n),st(o,e)]}if(1===t.length)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function lt(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}function at(t,n){const e=t.length;let r=n;const o=[];for(let n=0;n<e;n++){const e=t[n],i=r+e,c=i-r,s=r-(i-c)+(e-c);0!==s&&o.push(s),r=i}return 0===r&&0!==o.length||o.push(r),o}const pt=lt,ht=nt,dt=at;function gt(t){if(4===t.length){const[[n,e],[r,o],[i,c]]=t;return[ht(6,dt(pt(i,n),-2*r)),ht(6,dt(pt(c,e),-2*o))]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[dt(pt(2*i,2*n),-4*r),dt(pt(2*c,2*e),-4*o)]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3")}const vt=Z,mt=nt,xt=J;function bt(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[mt(6,xt(vt(s,n),mt(3,vt(r,i))))],[mt(6,xt(vt(u,e),mt(3,vt(o,c))))]]}if(t.length<=3)return[[[0]],[[0]]];throw new Error("The given bezier curve must be of order <= 3.")}const{sign:wt}=Math;function _t(t,n){const[e,r]=ft(t),[o,i]=gt(t),[c,s]=ft(n),[u,f]=gt(n),l=it(et(e,i),et(r,o)),a=it(et(c,f),et(s,u)),p=ct(l),h=ct(a);if(wt(p)!==wt(h))return p-h;const d=J(et(c,c),et(s,s)),g=J(et(e,e),et(r,r)),v=et(d,d),m=et(v,d),x=et(g,g),b=et(x,g);if(0!==p||0!==h){const t=et(l,l),n=et(a,a),e=ct(it(et(t,m),et(n,b)));if(0!==e)return p>0?e:-e}const[[w],[_]]=bt(t),[[M],[S]]=bt(n),N=it(et(e,_),et(r,w)),I=J(et(e,o),et(r,i)),y=it(et(c,S),et(s,M)),E=J(et(c,u),et(s,f)),O=it(et(g,N),tt(et(l,I),3)),C=it(et(d,y),tt(et(a,E),3)),T=ct(O),P=ct(C);if(T!==P)return T-P;if(0===T&&0===P)return 0;const A=et(O,O),k=et(v,m),B=et(C,C),z=et(x,b),F=ct(it(et(A,k),et(B,z)));return T>0?F:-F}function Mt(t,n){return t[0]===n[0]&&t[1]===n[1]}function St(t,n){const{ccw:e,tangentI:r,tangentO:o,dotTangents:i}=function(t,n){const e=t.length;let r=t[e-2],o=n[0],i=n[1];Mt(r,o)&&(r=t[e-3]),Mt(o,i)&&(i=n[2]);const c=function(t,n,e){const r=Z(t[0],e[0]),o=Z(n[1],e[1]),i=Z(t[1],e[1]),c=Z(n[0],e[0]);return rt(J(et(r,o),ot(et(i,c))))}(r,o,i),s=[Z(o[0],r[0]),Z(o[1],r[1])],u=[Z(i[0],o[0]),Z(i[1],o[1])],f=function(t,n){return rt(J(et(t[0],n[0]),et(t[1],n[1])))}(s,u);return 0!==c||f>0?{ccw:c,tangentI:s,tangentO:u,dotTangents:f}:{ccw:_t(t.slice().reverse(),n),tangentI:s,tangentO:u,dotTangents:f}}(t,n),c=e<0,s=e>0,u=[W(r.map(t=>t[1])),W(o.map(t=>t[1]))],f=$(u[0],u[1]);let l,a;return i>0?(l=f<-.0698,a=f>.0698):(l=c,a=s),{tangents:u,isSharp:c,isDull:s,isQuiteSharp:l,isQuiteDull:a}}const Nt=L(function(t){const{t:n,curve:e}=t;return St(1===n?e.ps:e.prev.ps,1===n?e.next.ps:e.ps)});function It(t){return 0===t.t||1===t.t}function yt(t){return!!It(t)&&Nt(t).isSharp}function Et(t){const n=t.pointOnShape.circle.center,e=t,r=t.nextOnCircle,o=e.pointOnShape,i=r.pointOnShape,c=o.p,s=i.p;let u;if(yt(o)){let t,n;0===o.t?(t=o.curve,n=o.curve.prev):1===o.t&&(t=o.curve.next,n=o.curve);const e=W(U(t.ps,0)),r=[-(f=W(U(n.ps,1)))[0],-f[1]],i=D(e,r),c=Math.sqrt((1+i)/2);u=Q(Math.sqrt((1-i)/2),c,r)}else u=c[0]===s[0]&&c[1]===s[1]?H(c,n):V(H(c,s));var f;return[n,j(W(u),n)]}const{abs:Ot}=Math,Ct=1e-4;function Tt(t,n){const e=t.pointOnShape.circle.center,r=Et(t),o=n.pointOnShape.circle.center,i=Et(n.prevOnCircle),c=X(r,i),s=H(e,o);let u;if(c){const t=H(e,c),n=H(o,c);u=D(t,s)<0||D(n,s)>0}else u=!0;if(!u)return[e,c,o];const f=V(s),l=H(r[0],r[1]),a=H(i[0],i[1]),p=Ot($(s,l))/9,h=Ot($(s,a))/9;if(p>.01||h>.01)return[e,o];if(p>Ct||h>Ct){const t=q(e,o,1/3),n=q(e,o,2/3),c=j(f,t),s=[n,j(f,n)];return[e,X(r,[t,c]),X(i,s),o]}return[e,o]}function Pt(t){return Tt(t,t.next)}function At(t){const n=t;let e=n;for(;e.next===e.prevOnCircle;)if(e=e.next,e===n)return;return e}function kt(t,n){return m(t).indexOf(n)>=0}function Bt(t){return 1===b(t)&&!t.isHoleClosing}function zt(t){return 2===b(t)}function Ft(t){return m(t).every(x)}function Yt(t){if(Ft(t))return[];for(;x(t);)t=t.nextOnCircle;for(t=t.next;2===b(t);)t=t.next;t=t.prevOnCircle;const n=[];do{n.push(t),t=t.next}while(!w(t)&&2===b(t));return n}function Lt(t){return Yt(t).map(t=>Pt(t))}function Xt(t,n){const e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function Ht(t,n){const[e,r]=t,[[o,i],[c,s]]=n;return Xt([o+e*(c-o),i+e*(s-i)],[o+r*(c-o),i+r*(s-i)])}function Dt(t,n,e=16){if(n[0]===n[1])return 0;const{weights:r,abscissas:o}=Vt[e],[i,c]=n;let s=0;const u=(c-i)/2,f=(c+i)/2;for(let n=0;n<=e-1;n++)s+=r[n]*t(u*o[n]+f);return u*s}L(Pt);const Vt={2:{weights:[1,1],abscissas:[-.5773502691896257,.5773502691896257]},4:{weights:[.6521451548625461,.6521451548625461,.3478548451374538,.3478548451374538],abscissas:[-.3399810435848563,.3399810435848563,-.8611363115940526,.8611363115940526]},8:{weights:[.362683783378362,.362683783378362,.3137066458778873,.3137066458778873,.2223810344533745,.2223810344533745,.1012285362903763,.1012285362903763],abscissas:[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363]},16:{weights:[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685,.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096],abscissas:[-.9894009349916499,-.9445750230732326,-.8656312023878318,-.755404408355003,-.6178762444026438,-.45801677765722737,-.2816035507792589,-.09501250983763744,.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]},64:{weights:[.048690957009139724,.048690957009139724,.04857546744150343,.04857546744150343,.048344762234802954,.048344762234802954,.04799938859645831,.04799938859645831,.04754016571483031,.04754016571483031,.04696818281621002,.04696818281621002,.046284796581314416,.046284796581314416,.04549162792741814,.04549162792741814,.044590558163756566,.044590558163756566,.04358372452932345,.04358372452932345,.04247351512365359,.04247351512365359,.04126256324262353,.04126256324262353,.03995374113272034,.03995374113272034,.038550153178615626,.038550153178615626,.03705512854024005,.03705512854024005,.035472213256882386,.035472213256882386,.033805161837141606,.033805161837141606,.03205792835485155,.03205792835485155,.030234657072402478,.030234657072402478,.028339672614259483,.028339672614259483,.02637746971505466,.02637746971505466,.024352702568710874,.024352702568710874,.022270173808383253,.022270173808383253,.02013482315353021,.02013482315353021,.017951715775697343,.017951715775697343,.015726030476024718,.015726030476024718,.013463047896718643,.013463047896718643,.011168139460131128,.011168139460131128,.008846759826363947,.008846759826363947,.006504457968978363,.006504457968978363,.004147033260562468,.004147033260562468,.001783280721696433,.001783280721696433],abscissas:[-.024350292663424433,.024350292663424433,-.07299312178779904,.07299312178779904,-.12146281929612056,.12146281929612056,-.16964442042399283,.16964442042399283,-.21742364374000708,.21742364374000708,-.2646871622087674,.2646871622087674,-.31132287199021097,.31132287199021097,-.3572201583376681,.3572201583376681,-.4022701579639916,.4022701579639916,-.4463660172534641,.4463660172534641,-.48940314570705296,.48940314570705296,-.5312794640198946,.5312794640198946,-.571895646202634,.571895646202634,-.6111553551723933,.6111553551723933,-.6489654712546573,.6489654712546573,-.6852363130542333,.6852363130542333,-.7198818501716109,.7198818501716109,-.7528199072605319,.7528199072605319,-.7839723589433414,.7839723589433414,-.8132653151227975,.8132653151227975,-.8406292962525803,.8406292962525803,-.8659993981540928,.8659993981540928,-.8893154459951141,.8893154459951141,-.9105221370785028,.9105221370785028,-.9295691721319396,.9295691721319396,-.9464113748584028,.9464113748584028,-.9610087996520538,.9610087996520538,-.973326827789911,.973326827789911,-.983336253884626,.983336253884626,-.9910133714767443,.9910133714767443,-.9963401167719553,.9963401167719553,-.9993050417357722,.9993050417357722]}},{sqrt:$t}=Math;function qt(t){const[n,e]=G(t);return function(t){const r=R(n,t),o=R(e,t);return $t(r*r+o*o)}}const{abs:jt}=Math,Wt=[[0,0],[0,0],[0,0]];function Qt(t,n,e){return 0===n?1===e?{ps:t,_ps:Wt}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],g=jt(n),v=jt(i),m=jt(s),x=jt(f),b=v+m,w=jt(c),_=jt(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+(jt(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=jt(n),x=jt(i),b=jt(s),w=x+b,_=jt(f)+b,M=jt(c),S=jt(u),N=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(N+(jt(l)+S))+(2*m*N+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),N=h*x-(2*e*m-s),I=jt(n),y=jt(e),E=jt(d),O=jt(c),C=jt(u),T=O+C,P=T+jt(l)+C,A=jt(s),k=jt(f),B=A+k,z=B+jt(a)+k;return{ps:[[b,M],[w,S],[_,N]],_ps:[[p*P+(2*I*T+O),p*z+(2*I*B+A)],[E*P+(T*(y+I)+O),E*x+(B*(y+I)+A)],[h*P+(2*y*T+O),h*z+(2*y*B+A)]]}}(t,n,e)}const Rt=134217729;function Gt(t,n){const e=t*n,r=Rt*t,o=r-(r-t),i=t-o,c=Rt*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}function Ut(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r+i,s=c-r,u=e+o,f=u-e,l=r-(c-s)+(i-s)+u,a=c+l,p=e-(u-f)+(o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}function Zt(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r-i,s=c-r,u=e-o,f=u-e,l=r-(c-s)+(-i-s)+u,a=c+l,p=e-(u-f)+(-o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}const{atan2:Jt}=Math,Kt=Gt;function tn(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=Zt(Kt(i,e),Kt(o,r))[1],s=Ut(Kt(o,e),Kt(i,r))[1];return Jt(c,s)}const{abs:nn}=Math;function en(t){const n=[];for(let e=0;e<t.length-1;e++){const r=[t[e+1][0]-t[e][0],t[e+1][1]-t[e][1]];0!==(0!==r[0]||r[1])&&n.push(r)}const e=n.length;let r=0;for(let t=0;t<e-1;t++)r+=nn(tn(n[t],n[t+1]));return r}function rn(t,n=.4,e=2**-16){const r=[0],o=[1];for(;;){const i=r[r.length-1],c=o[o.length-1];if(en(P(t,i,c))<=n||c-i<=e){if(r.push(o.pop()),1===c)return r;continue}const s=(i+c)/2;o.push(s)}}const{sqrt:on,log:cn}=Math;function sn(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a]]=n;if(c===u&&u===l&&s===f&&f===a)return 0;const p=Qt(n,o,i).ps,h=rn(p,e);let d=0;for(let t=0;t<h.length-1;t++){const n=h[t],e=h[t+1];d+=Dt(qt(p),[n,e],r)}return d}const{abs:un}=Math,fn=[[0,0],[0,0],[0,0],[0,0]];function ln(t,n,e){return 0===n?1===e?{ps:t,_ps:fn}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=un(n),S=un(c),N=un(u),I=un(l),y=un(p),E=un(s),O=un(f),C=un(a),T=S+M*(S+N),P=N+M*(N+I),A=T+M*(T+P),k=E+M*(E+O),B=O+M*(O+C),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[A,z],[A+M*(A+(P+M*(P+(I+M*(I+y))))),z+M*(z+(B+M*(B+(C+M*(C+un(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=l-n*(l-p),m=d-n*(d-g),x=g-n*(g-v),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=w-n*(w-_),N=_-n*(_-M),I=S-n*(S-N),y=un(n),E=un(c),O=un(u),C=un(l),T=un(p),P=un(s),A=un(f),k=un(a),B=E+y*(E+O),z=O+y*(O+C),F=C+y*(C+T),Y=B+y*(B+z),L=z+y*(z+F),X=P+y*(P+A),H=A+y*(A+k),D=k+y*(k+un(h)),V=X+y*(X+H),$=H+y*(H+D);return{ps:[[b,I],[x,N],[v,M],[p,h]],_ps:[[Y+y*(Y+L),V+y*(V+$)],[L,$],[F,D],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=c[0]-s,_=x+b,M=n*x,S=e*x,N=w-3*b,I=u-l,y=p-l,E=c[1]-u,O=I+y,C=n*I,T=e*I,P=E-3*y,A=d*N+(3*n*(n*_-x)+s),k=m*(n*N+2*_)+(h*_+s-(S+2*M)),B=m*(e*N+2*_)+(g*_+s-(2*S+M)),z=v*N+(3*e*(e*_-x)+s),F=d*P+(3*n*(n*O-I)+u),Y=m*(n*P+2*O)+(h*O+u-(T+2*C)),L=m*(e*P+2*O)+(g*O+u-(2*T+C)),X=v*P+(3*e*(e*O-I)+u),H=un(n),D=un(e),V=un(m),$=un(d),q=un(v),j=un(s),W=un(f),Q=j+W,R=un(a)+W,G=Q+R,U=H*Q,Z=D*Q,J=un(w)+3*R,K=un(u),tt=un(l),nt=K+tt,et=un(p)+tt,rt=nt+et,ot=H*nt,it=D*nt,ct=un(E)+3*et;return{ps:[[A,F],[k,Y],[B,L],[z,X]],_ps:[[$*J+(3*H*(H*G+Q)+j),$*ct+(3*H*(H*rt+nt)+K)],[V*(H*J+2*G)+(h*G+j+(Z+2*U)),V*(H*ct+2*rt)+(h*rt+K+(it+2*ot))],[V*(D*J+2*G)+(g*G+j+(2*Z+U)),V*(D*ct+2*rt)+(g*rt+K+(2*it+ot))],[q*J+(3*D*(D*G+Q)+j),q*ct+(3*D*(D*rt+nt)+K)]]}}(t,n,e)}function an(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a],[p,h]]=n;if(c===u&&u===l&&l===p&&s===f&&f===a&&a===h)return 0;const d=ln(n,o,i).ps,g=rn(d,e);let v=0;for(let t=0;t<g.length-1;t++){const n=g[t],e=g[t+1];v+=Dt(qt(d),[n,e],r)}return v}function pn(t,n=.4,e=16){if(4===t.length)return an([0,1],t,n,e);if(3===t.length)return sn([0,1],t,n,e);if(2===t.length)return Ht([0,1],t);if(1===t.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}function hn(t,n,e=!0){const{cpNodes:r,hasHoleCloser:o}=function(t,n,e=!0){if(!e&&t===n)return{cpNodes:[],hasHoleCloser:!1};const r=t,o=[r];let i=t.next,c=r.isHoleClosing;for(;i!==n&&i!==r;)i.isHoleClosing&&(c=!0),o.push(i),i=i.next;return{cpNodes:o,hasHoleCloser:c}}(t,n,e);return{pss:r.flatMap(A),hasHoleCloser:o}}function dn(t){const n=t,e=t.nextOnCircle,r=Xt(n.pointOnShape.p,e.pointOnShape.p),{pss:o,hasHoleCloser:i}=hn(n,e),c=function(t){let n=0;for(let e of t)n+=e;return n}(o.map(t=>pn(t)));return i?1/0:c/r}function gn(t,n){let e=t;const r=[];for(;e!==n;){const t=Tt(e,e.next);r.push(t),e=e.next}return r}function vn(t,n){const e=$(W(U(Pt(t),0)),W(U(Pt(n),0)));return Math.abs(Math.asin(e)*(180/Math.PI))}function mn(t){const n=[];return y(t,t=>{n.push(t)}),n}function xn(t,n){let e;return e=t.curve.idx-n.curve.idx,0!==e||(e=t.t-n.t,0!==e||(e=t.order-n.order,0!==e||(e=t.order2-n.order2))),e}function bn(t,n){return xn(t.pointOnShape,n.pointOnShape)}const wn={getChildren:z,getVertexForwardChildren:I,getAllOnLoop:h,getAllOnCircle:m,isOnSameCircle:kt,isTerminating:x,isFullyTerminating:w,getFirstExit:At,isSharp:_,isOneProng:Bt,getProngCount:v,getRealProngCount:b,cpNodeComparator:bn,enhanceCpNode:M,traverseCp:S,traverseEdges:N,traverseVertices:y,clone:O,getBoundaryBezierPartsToNext:T,getBoundaryBeziersToNext:A,removeVertex:B,getMatCurveToNext:Pt,isTwoProng:zt,getBranch:Yt,getBranchBeziers:Lt,getSalience:dn,getMatCurveBetween:Tt,getEdgeDirection:Et,getBoundaryBeziersBetween:hn,getMatCurvesBetween:gn,getHoleClosers:d,getInitialDegAngleBetweenMatCurves:vn,getAllVertices:mn};function _n(t){return n=>m(n).some(t)}const Mn=_n(function(t){return 2!==b(t)&&!t.isHoleClosing});function Sn(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=-t[e];return n}function Nn(t){return n=>1/t(n.toReversed())}function In(t){const n=t.length-1;if(n<1)return 0;t[0]<0&&(t=Sn(t));const e=[];for(let t=0;t<n;t++)e.push(1);let r=0;for(let o=0;o<=n;o++){if(t[o]>=0)continue;let n=1/0,i=!1;for(let r=0;r<o;r++){if(t[r]<=0)continue;const c=(-t[o]/(t[r]/2**e[r]))**(1/(o-r));e[r]++,n>c&&(n=c),i=!0}i&&r<n&&(r=n)}return r}Nn(In);const yn=(En=In,t=>-En(function(t){const n=t.length-1;if(n<0)return[];const e=t.slice();for(let t=0;t<n+1;t++)t%2==(n-1)%2&&(e[t]=-e[t]);return e}(t)));var En;Nn(yn);const{min:On,max:Cn}=Math,{abs:Tn}=Math;function Pn(t){const n=t.slice(),e=n.length;if(1===e)return n;let r=n[e-1],o=e;for(let t=e-2;t>=0;--t){const e=r,i=n[t];r=e+i;const c=i-(r-e);c&&(n[--o]=r,r=c)}let i=0;for(let t=o;t<e;++t){const e=n[t],o=r;r=e+o;const c=o-(r-e);c&&(n[i++]=c)}return n[i++]=r,n.length=i,n}const An=Number.EPSILON,kn=Number.EPSILON/2,Bn=kn*kn,zn=Yn(1),Fn=function(){const t=3*Bn;return t/(1-t)}();function Yn(t){const n=t*kn;return n/(1-n)}new Array(20).fill(0).map((t,n)=>Yn(n));const{abs:Ln}=Math,{abs:Xn}=Math,Hn=134217729;function Dn(t,n){const e=n[0],r=n[1],o=r*t,i=Hn*r,c=i-(i-r),s=r-c,u=Hn*t,f=u-(u-t),l=t-f,a=s*l-(o-c*f-s*f-c*l)+e*t,p=o+a;return[a-(p-o),p]}const{abs:Vn}=Math;function $n(t,n,e){const r=t.length-1;if(r<0)return[[],[]];const o=Vn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=i[e-1],r=c[e-1],s=Dn(n,t),u=o*r+Vn(s[1]),f=i[e];i[e]=Ut(f,s),c[e]=c[e]+u+Vn(i[e][1])}return[i,c]}const qn=2**27+1;function jn(t,n){const e=t[1],r=n[1],o=e*r,i=qn*e,c=i-(i-e),s=e-c,u=qn*r,f=u-(u-r),l=r-f,a=s*l-(o-c*f-s*f-c*l)+(e*n[0]+t[0]*r),p=o+a;return[a-(p-o),p]}const{abs:Wn}=Math;function Qn(t,n){const e=t.length-1;if(e<0)return[];const r=t.slice();for(let t=0;t<=e;t++)for(let o=1;o<=e-t;o++)r[o]=Pn(J(r[o],tt(r[o-1],n)));return r}function Rn(t,n){const e=t.length-1;if(e<0)return[];const r=new Array(e+1);r[e]=t[e];let o=[1];for(let i=1;i<=e;i++)o=tt(o,n),r[e-i]=et(t[e-i],o);return r}const{abs:Gn,sign:Un}=Math;const Zn=134217729;function Jn(t,n){const e=t*n,r=Zn*t,o=r-(r-t),i=t-o,c=Zn*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}const{abs:Kn}=Math;function te(t,n){const e=Kn(n);let r=t[0],o=.5*Kn(r);for(let i=1;i<t.length;i++)r=r*n+t[i],o=o*e+Kn(r);return o=kn*(2*o-Kn(r)),[r,o]}const ne=Math.abs,{abs:ee}=Math,re=Yn(1),oe=Yn(2);function ie(t,n,e=void 0,r=1){const o=t[0],[i,c]=te(o,n),s=oe*function(t,n){const e=ne(n);let r=0;for(let n=0;n<t.length;n++)r=r*e+ne(t[n]);return r}(o,n),u=void 0!==e?R(e,ee(n)):0;if((c+s+u)*r<Math.abs(i))return i;const f=function(t,n){const e=[],r=[];let o,i=t[0];for(let c=1;c<t.length;c++){const[s,u]=Jn(i,n);[o,i]=lt(u,t[c]),e.push(s),r.push(o)}return{r̂:i,pπ:e,pσ:r}}(o,n),{pπ:l,pσ:a}=f;let{r̂:p}=f;const[h,d]=te(l,n),[g,v]=te(a,n),[m,x]=te(t[1],n);let b=d+v+x+u;return p=h+g+m+p,b+=re*p,b*r<Math.abs(p)?p:0}function ce(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(t[r],tt(e,n));return e}const{abs:se,min:ue,max:fe,log2:le,ceil:ae}=Math;function pe(t,n,e,r,o,i,c,s){let u=e,f=r,l=u,a=o,p=f-u,h=p;for(;;){let d;se(a)<se(i)&&(u=f,f=l,l=u,o=i,i=a,a=o);const g=fe(se(u),se(f));d=g<=1?An:An*2**ae(le(g));const v=.5*(l-f);if(se(v)<=d)return f<l?[f,l,f]:[l,f,f];if(se(p)<d||se(o)<=se(i))p=v,h=p;else{let t,n,e=i/o;if(u===l)t=2*v*e,n=1-e;else{n=o/a;const r=i/a;t=e*(2*v*n*(n-r)-(f-u)*(r-1)),n=(n-1)*(r-1)*(e-1)}0<t?n=-n:t=-t,e=p,p=h,2*t<3*v*n-se(d*n)&&t<se(.5*e*n)?h=t/n:(p=v,h=p)}if(u=f,o=i,d<se(h)?f+=h:0<v?f+=d:f-=d,0===(i=s?rt(ce(c(),f)):ie(t,f,n))){if(s)return[f,f,f];const o=fe(e,f-d),u=ue(r,f+d);if(ie(t,o,n)*ie(t,u,n)!==0)return[o,u,f];if(s=!0,0===(i=rt(ce(c(),f))))return[f,f,f]}(0<i&&0<a||i<=0&&a<=0)&&(l=u,a=o,p=f-u,h=p)}}const{abs:he}=Math;function de(t,n,e){const r=he(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=o*n;o=s+t[c],i=i*r+he(s)+e[c]+he(o)}return[o,i]}function ge(t){const n=t[0].length,e=[];for(let r=0;r<n;r++){const o=[];for(let e=0;e<t.length;e++)o.push(t[e][n-(r+1)]);e.push(o)}return e}const ve=Ut,me=Dn,{abs:xe}=Math;function be(t,n,e){const r=xe(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=me(n,o);o=ve(s,t[c]),i=i*r+xe(s[1])+e[c]+xe(o[1])}return[o,i]}const{abs:we,min:_e,max:Me,log2:Se,ceil:Ne}=Math,Ie=Fn/zn;function ye(t,n,e,r,o,i,c){const s=t.length-1;let u=0,f=1;for(;;){f*=2;for(let l=1;l<f;l+=2){u++;const a=o+(i-o)*(f+2*l)/(4*f),[p,h]=de(t,a,n);if(we(p)>h*zn)return[a,p];if(u>s)return Ee(e,r,o,i,c)}}}function Ee(t,n,e,r,o){const i=t.length-1;let c=0,s=1;for(;;){s*=2;for(let u=1;u<s;u+=2){c++;const f=e+(r-e)*(s+2*u)/(4*s),[l,a]=be(t,f,n);if(we(l[1])>a*Fn)return[f,l[1]];if(c>i)return Oe(o(),e,r)}}}function Oe(t,n,e){const r=t.length-1;let o=1;for(;;){o*=2;for(let i=1;i<o;i+=2){const c=n+(e-n)*(o+2*i)/(4*o),s=Pn(ce(t,c)),u=s[s.length-1];if(0!==u)return[c,u];if(0>r)throw new Error("Cannot resolve root even in Shewchuk expansion precision")}}}function Ce(t,n=-1/0,e=1/0,r,o,i=!1){let c;"number"==typeof t[0]&&(t=t.map(t=>[0,t]));const s=()=>void 0===o?t:(void 0===c&&(c=o()),c);if(r=r||new Array(t.length).fill(0),({pDd:t,pDd_:r,pExact:c}=function(t,n,e,r){let o;for(;t.length>0&&Tn(t[0][1])<=r*n[0]&&(o=o||e(),0===ct(o[0]));)(t=t.slice()).shift(),(n=n.slice()).shift(),o.shift();return{pDd:t,pDd_:n,pExact:o}}(t,r,s,Fn)),0===t.length)return;if(1===t.length)return[];const u=t.map(t=>t[0]+t[1]);return!i&&n!==-1/0&&e!==1/0||([n,e]=function(t,n,e){return[t=Cn(t,yn(e)),n=On(n,In(e))]}(n,e,u),n!==e)?function(t,n,e,r,o,i){const c=e.map((n,e)=>n*Ie+we(t[e])),s=r,u=o;let f,l,a,p,h=o-r;for(;[f,l]=de(t,r,c),!(we(f)>l*zn);)r-=h/2,h*=2;for(;[a,p]=de(t,o,c),!(we(a)>p*zn);)o+=h/2,h*=2;const d=[[r,o,f,a,0]],g=[],v=function(t,n,e,r,o){return function(i,c,s,u,f){let[l,a]=function(t,n,e){const r=t.length-1,o=Ln(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=n*i[e-1],r=o*c[e-1]+Ln(t);i[e]=i[e]+t,c[e]=c[e]+r+Ln(i[e])}return[i,c]}(t,i,n);!function(t,n,e){const r=t.length-1;if(r<0)return;let o=n,i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Xn(u),l=e[s],a=u*o;t[s]=a,e[s]=l*o+f*i+Xn(a);const p=o*n;i=i*n+p,o=p}}(l,c-i,a),l.reverse(),a.reverse(),function(t,n){const e=t.length-1;for(let r=0;r<=e;r++)for(let o=1;o<=e-r;o++){const e=t[o-1],r=n[o-1]+Ln(e);t[o]=t[o]+e,n[o]=n[o]+r+Ln(t[o])}}(l,a);let p=0,h=0,d=Un(s);for(let t=1;t<l.length-1;t++){let n=Un(l[t]);const e=l[t],r=a[t]*zn;Gn(e)<=r&&(h++,n=-d),n!==d&&(p++,d=n)}return Un(u)!==d&&p++,1===h&&1===p?1:h>0?function(t,n,e,r,o,i,c,s){let[u,f]=$n(t,e,n);(function(t,n,e){const r=t.length-1;if(r<0)return;let o=[0,n],i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Wn(u[1]),l=e[s],a=jn(o,u);t[s]=a,e[s]=l*o[1]+f*i+Wn(a[1]);const p=jn(o,[0,n]);i=i*n+p[1],o=p}})(u,r-e,f),u.reverse(),f.reverse(),[u,f]=$n(u,1,f);let l=0,a=0,p=Un(o);for(let t=0;t<u.length-1;t++){let n=Un(u[t][1]);const e=f[t]*Fn,r=u[t];e>=Gn(r[1])&&(a++,n=-p),n!==p&&(l++,p=n)}return Un(i)!==p&&l++,1===a&&1===l?1:0===a?l:c>1?function(t,n,e,r,o){let i=Qn(t(),n);i=Rn(i,e-n),i.reverse(),i=Qn(i,1);let c=0,s=Un(r);for(let t=1;t<i.length-1;t++){const n=i[t];let e=Un(n[n.length-1]);e!==s&&0!==e&&(c++,s=e)}return Un(o)!==s&&c++,c}(s,e,r,o,i):-l}(e,r,i,c,s,u,f,o):p}}(t,c,n,e,i);let m,x;for(;d.length>0;){const r=d.pop(),[o,s,u,f,l]=r,a=v(o,s,u,f,l);if(0===a)continue;if(1===a){m=m||e.map(t=>t*Fn),x=x||ge(n);const[t,r,c]=pe(x,m,o,s,u,f,i,!1);g.push({t:c,tS:t,tE:r,multiplicity:1});continue}let p=a<0?l+1:0;if(s-o<=2*we(a)*An*Me(1,2**Ne(Se(Me(we(o),we(s)))))){if(0===p){g.push({t:(o+s)/2,tS:o,tE:s,multiplicity:we(a)});continue}p=1/0}const[h,b]=ye(t,c,n,e,o,s,i);d.push([o,h,u,b,p]),d.push([h,s,b,f,p])}return g.reverse(),g.filter(t=>{const{tS:n,tE:e}=t;return!(e<s||n>u)})}(u,t,r,n,e,s):[{t:n,tS:n,tE:e,multiplicity:u.length-1}]}function Te(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}const Pe=Math.abs;function Ae(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Pe(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=Pe(n),a=Pe(r),p=Pe(o),h=Pe(i),d=Pe(c),g=Pe(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(Pe(u)+d)*e+m)*e+x)*e,_+(w+(g+(Pe(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=Pe(n),f=Pe(r),l=Pe(o),a=Pe(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(Pe(c)+l)*e+p)*e,h+(a+(Pe(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=Pe(n),s=Pe(r);return[c+(Pe(o)+c)*e,s+(Pe(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}Number.EPSILON;const ke=Number.EPSILON/2,Be=ke*ke,ze=(Fe(1),Ye(3));function Fe(t){const n=t*ke;return n/(1-n)}function Ye(t){const n=t*Be;return n/(1-n)}const Le=Math.abs,Xe=[[0,0],[0,0],[0,0],[0,0]];function He(t,n,e){return 0===n?1===e?{ps:t,_ps:Xe}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=Le(n),S=Le(c),N=Le(u),I=Le(l),y=Le(p),E=Le(s),O=Le(f),C=Le(a),T=S+M*(S+N),P=N+M*(N+I),A=T+M*(T+P),k=E+M*(E+O),B=O+M*(O+C),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[A,z],[A+M*(A+(P+M*(P+(I+M*(I+y))))),z+M*(z+(B+M*(B+(C+M*(C+Le(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=l-n*(l-p),m=d-n*(d-g),x=g-n*(g-v),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=w-n*(w-_),N=_-n*(_-M),I=S-n*(S-N),y=Le(n),E=Le(c),O=Le(u),C=Le(l),T=Le(p),P=Le(s),A=Le(f),k=Le(a),B=E+y*(E+O),z=O+y*(O+C),F=C+y*(C+T),Y=B+y*(B+z),L=z+y*(z+F),X=P+y*(P+A),H=A+y*(A+k),D=k+y*(k+Le(h)),V=X+y*(X+H),$=H+y*(H+D);return{ps:[[b,I],[x,N],[v,M],[p,h]],_ps:[[Y+y*(Y+L),V+y*(V+$)],[L,$],[F,D],[0,0]]}}(t,n):function(t,n,e){const r=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(i),m=De(s),x=De(f),b=v+m,w=De(c),_=De(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+(De(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=De(n),x=De(i),b=De(s),w=x+b,_=De(f)+b,M=De(c),S=De(u),N=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(N+(De(l)+S))+(2*m*N+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),N=h*x-(2*e*m-s),I=De(n),y=De(e),E=De(d),O=De(c),C=De(u),T=O+C,P=T+De(l)+C,A=De(s),k=De(f),B=A+k,z=B+De(a)+k;return{ps:[[b,M],[w,S],[_,N]],_ps:[[p*P+(2*I*T+O),p*z+(2*I*B+A)],[E*P+(T*(y+I)+O),E*x+(B*(y+I)+A)],[h*P+(2*y*T+O),h*z+(2*y*B+A)]]}}(t,n,e)}const qe=Math.abs,je=[[0,0],[0,0]];const We=Number.EPSILON/2,Qe=Fe(1);function Re(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=He(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*We*r[0][0],f=9*We*r[1][0],l=9*We*r[2][0],a=9*We*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*We*r[0][1],m=9*We*r[1][1],x=9*We*r[2][1],b=9*We*r[3][1],w=Math.min(o-u,i-f,c-l,s-a),_=Math.max(o+u,i+f,c+l,s+a);return[[w,Math.min(p-v,h-m,d-x,g-b)],[_,Math.max(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=$e(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*We*r[0][0],u=5*We*r[1][0],f=5*We*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*We*r[0][1],d=5*We*r[1][1],g=5*We*r[2][1],v=Math.min(o-s,i-u,c-f),m=Math.max(o+s,i+u,c+f);return[[v,Math.min(l-h,a-d,p-g)],[m,Math.max(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:je}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=qe(n),l=qe(o),a=qe(c),p=qe(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(qe(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=qe(n),l=qe(o),a=qe(c),p=qe(i);return{ps:u,_ps:[[f*(a+l)+l,f*(qe(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=qe(n),a=qe(e),p=qe(i),h=qe(s),d=qe(c),g=qe(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*We*r[0][0],s=3*We*r[1][0],u=e[0][1],f=e[1][1],l=3*We*r[0][1],a=3*We*r[1][1],p=Math.min(o-c,i-s),h=Math.max(o+c,i+s);return[[p,Math.min(u-l,f-a)],[h,Math.max(u+l,f+a)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Te(t,n);let i;if(4===t.length)i=Ae(t,[0,n]).map(t=>8*Qe*t);else if(3===t.length)i=Ae(t,[0,n]).map(t=>5*Qe*t);else if(2===t.length)i=Ae(t,[0,n]).map(t=>2*Qe*t);else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}function Ge(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}const Ue=Z,Ze=Number.EPSILON;function Je(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function Ke(t){return[2*t[0],2*t[1]]}function tr(t){return[4*t[0],4*t[1]]}const nr=Je,er=Ut,rr=Dn,or=jn,ir=Ke,cr=tr,sr=Zt;function ur(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=nr(c,d),m=nr(u,d),x=nr(l,d),b=nr(p,d),w=nr(s,g),_=nr(f,g),M=nr(a,g),S=nr(h,g),N=or(v,v),I=rr(6,or(v,m)),y=rr(6,or(v,x)),E=ir(or(v,b)),O=rr(9,or(m,m)),C=rr(18,or(m,x)),T=rr(6,or(m,b)),P=rr(9,or(x,x)),A=rr(6,or(x,b)),k=or(b,b),B=or(w,w),z=rr(6,or(w,_)),F=rr(6,or(w,M)),Y=ir(or(w,S)),L=rr(9,or(_,_)),X=rr(18,or(_,M)),H=rr(6,or(_,S)),D=rr(9,or(M,M)),V=rr(6,or(M,S)),$=or(S,S),q=er(T,P),j=er(E,C),W=er(y,O),Q=er(H,D),R=er(Y,X),G=er(F,L);return[rr(6,er(er(er(er(sr(k,A),sr(N,I)),q),sr(W,j)),er(er(er(sr($,V),sr(B,z)),Q),sr(G,R)))),rr(5,er(sr(er(er(A,rr(5,I)),rr(3,j)),ir(er(er(q,ir(W)),rr(3,N)))),sr(er(er(V,rr(5,z)),rr(3,R)),ir(er(er(Q,ir(G)),rr(3,B)))))),cr(er(sr(sr(q,rr(3,sr(j,ir(W)))),rr(5,sr(ir(I),rr(3,N)))),sr(sr(Q,rr(3,sr(R,ir(G)))),rr(5,sr(ir(z),rr(3,B)))))),rr(3,er(sr(j,ir(sr(ir(W),rr(5,sr(I,ir(N)))))),sr(R,ir(sr(ir(G),rr(5,sr(z,ir(B)))))))),ir(er(sr(W,rr(5,sr(I,rr(3,N)))),sr(G,rr(5,sr(z,rr(3,B)))))),er(sr(I,rr(6,N)),sr(z,rr(6,B)))]}const fr=Je,lr=Ut,ar=Dn,pr=jn,hr=Ke,dr=Zt,gr=tr;function vr(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=fr(e,u),a=fr(o,u),p=fr(c,u),h=fr(r,f),d=fr(i,f),g=fr(s,f),v=pr(l,l),m=pr(l,a),x=pr(l,p),b=pr(a,a),w=pr(a,p),_=pr(p,p),M=pr(h,h),S=pr(h,d),N=pr(h,g),I=pr(d,d),y=pr(d,g),E=pr(g,g),O=lr(N,hr(I)),C=lr(x,hr(b));return[lr(dr(lr(lr(E,M),hr(O)),gr(lr(y,S))),dr(lr(lr(_,v),hr(C)),gr(lr(w,m)))),ar(3,lr(lr(dr(y,O),dr(ar(3,S),M)),lr(dr(w,C),dr(ar(3,m),v)))),lr(dr(O,ar(3,dr(hr(S),M))),dr(C,ar(3,dr(hr(m),v)))),lr(dr(S,M),dr(m,v))]}function mr(t){return[-2*t[0],-2*t[1]]}const xr=Gt,br=Ut,wr=mr;function _r(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=xr(u,u),h=xr(u,f),d=xr(f,f),g=xr(l,l),v=xr(l,a),m=xr(a,a),x=br(h,v),b=br(g,p);return[br(br(d,m),br(b,wr(x))),Zt(x,b)]}function Mr(t){const n=[];for(let e=0;e<t.length;e++)n.push(2*t[e]);return n}function Sr(t){const n=[];for(let e=0;e<t.length;e++)n.push(-2*t[e]);return n}const Nr=Z,Ir=nt,yr=Mr,Er=Sr,Or=Z,Cr=nt,Tr=Mr;function Pr(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const Ar=Z,kr=Sr,Br=Math.abs;function zr(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=Br(e[0]),s=Br(e[1]),u=Br(r[0]),f=Br(r[1]),l=Br(o[0]),a=Br(o[1]),p=Br(i[0]),h=Br(i[1]),d=Br(n[0]),g=Br(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,O=6*w*_,C=6*M*S,T=6*m*b+9*x*x,P=2*v*b+18*m*x,A=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(N+I)+T+(A+P)+(S*S+C+(E+O)+k+(z+B))),5*(y+5*I+3*P+2*(T+2*A+3*N)+(C+5*O+3*B+2*(k+2*z+3*E))),4*(T+3*(P+2*A)+5*(2*I+3*N)+(k+3*(B+2*z)+5*(2*O+3*E))),3*(P+2*(2*A+5*(I+2*N))+(B+2*(2*z+5*(O+2*E)))),2*(A+5*(I+3*N)+(z+5*(O+3*E))),I+6*N+(O+6*E)]}function Fr(t,n){const e=t[0],r=t[1],o=t[2],i=Br(e[0]),c=Br(e[1]),s=Br(r[0]),u=Br(r[1]),f=Br(o[0]),l=Br(o[1]),a=Br(n[0]),p=Br(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I+4*(N+S)+(g*g+b+2*y+4*(_+w)),3*(N+I+(3*S+M)+(_+y+(3*w+b))),I+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function Yr(t,n){const e=t[0],r=t[1],o=Br(e[0]),i=Br(e[1]),c=Br(r[0]),s=Br(r[1]),u=Br(n[0]),f=Br(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}Ye(6);const{sqrt:Lr}=Math;function Xr(t,n,e=0,r=1){const{polyDd:o,polyE:i,getPolyExact:c}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:ur(t,n),polyE:zr(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=Nr(c,d),m=Nr(u,d),x=Nr(l,d),b=Nr(p,d),w=Nr(s,g),_=Nr(f,g),M=Nr(a,g),S=Nr(h,g),N=et(v,v),I=Ir(6,et(v,m)),y=Ir(6,et(v,x)),E=yr(et(v,b)),O=Ir(9,et(m,m)),C=Ir(18,et(m,x)),T=Ir(6,et(m,b)),P=Ir(9,et(x,x)),A=Ir(6,et(x,b)),k=et(b,b),B=et(w,w),z=Ir(6,et(w,_)),F=Ir(6,et(w,M)),Y=yr(et(w,S)),L=Ir(9,et(_,_)),X=Ir(18,et(_,M)),H=Ir(6,et(_,S)),D=Ir(9,et(M,M)),V=Ir(6,et(M,S)),$=et(S,S),q=J(T,P),j=J(E,C),W=J(y,O),Q=J(H,D),R=J(Y,X),G=J(F,L),U=it(J(J(k,N),J(q,W)),J(J(j,A),I)),Z=it(J(J($,B),J(Q,G)),J(J(R,V),z)),K=Ir(6,J(U,Z)),tt=J(Er(J(J(q,yr(W)),Ir(3,N))),J(J(A,Ir(3,j)),Ir(5,I))),nt=J(Er(J(J(Q,yr(G)),Ir(3,B))),J(J(V,Ir(3,R)),Ir(5,z))),rt=Ir(5,J(tt,nt)),ot=J(J(q,Ir(3,it(yr(W),j))),Ir(5,it(Ir(3,N),yr(I)))),ct=J(J(Q,Ir(3,it(yr(G),R))),Ir(5,it(Ir(3,B),yr(z)))),st=Ir(4,J(ot,ct)),ut=it(j,yr(it(yr(W),Ir(5,it(I,yr(N)))))),ft=it(R,yr(it(yr(G),Ir(5,it(z,yr(B)))))),lt=Ir(3,J(ut,ft)),at=it(W,Ir(5,it(I,Ir(3,N)))),pt=it(G,Ir(5,it(z,Ir(3,B))));return[K,rt,st,lt,yr(J(at,pt)),J(it(I,Ir(6,N)),it(z,Ir(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:vr(t,n),polyE:Fr(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=Or(e,u),a=Or(o,u),p=Or(c,u),h=Or(r,f),d=Or(i,f),g=Or(s,f),v=et(l,l),m=et(l,a),x=et(l,p),b=et(a,a),w=et(a,p),_=et(p,p),M=et(h,h),S=et(h,d),N=et(h,g),I=et(d,d),y=et(d,g),E=et(g,g),O=J(N,Tr(I)),C=J(x,Tr(b)),T=J(it(J(_,Tr(C)),Pr(J(w,m))),v),P=J(it(J(E,Tr(O)),Pr(J(y,S))),M),A=J(T,P),k=J(it(w,C),it(Cr(3,m),v)),B=J(it(y,O),it(Cr(3,S),M));return[A,Cr(3,J(k,B)),J(it(O,Cr(3,it(Tr(S),M))),it(C,Cr(3,it(Tr(m),v)))),J(it(S,M),it(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:_r(t,n),polyE:Yr(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=Ar(e,c),f=Ar(o,c),l=Ar(r,s),a=Ar(i,s),p=et(u,u),h=et(u,f),d=et(f,f),g=et(l,l),v=et(l,a),m=et(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(kr(x),b)),it(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}(t,n),s=Ce(o,e,r,i,c)||[];s.push({t:e,tS:e,tE:e,multiplicity:1}),s.push({t:r,tS:r,tE:r,multiplicity:1});const u=s.map(e=>{const r=Re(t,[e.tS,e.tE]),o=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=Ue(t,u),r=Ue(n,f),o=rt(J(et(e,e),et(r,r))),i=o*(1-Ze),c=o*(1+Ze);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(r,n);return{p:Ge(r),t:e.t,d:(Lr(o[0])+Lr(o[1]))/2,dSquaredI:o,box:r,ri:e}});let f=Number.POSITIVE_INFINITY;for(let t=0;t<u.length;t++){const n=u[t].dSquaredI[1];n<f&&(f=n)}const l=[];for(let t=0;t<u.length;t++){const n=u[t];n.dSquaredI[0]<=f&&l.push(n)}return l}function Hr(t){return(t.tS+t.tE)/2}function Dr(t){const n=t.xs;if(4===n.length){let t=0,e=0;for(let r=0;r<n.length;r++)0===n[r].x.kind&&t++,4===n[r].x.kind&&e++;if(2===t&&2===e)return!0}return n.length<=2&&7!==n[0].x.kind}function Vr(t){const n=(t=Pn(t)).length;return 2===n?t:n<=1?[0,t[0]]:[t[n-2],t[n-1]]}const{abs:$r,min:qr,max:jr,log2:Wr,ceil:Qr}=Math;function Rr(t,n){const{tS:e,tE:r}=t,o=r-e;if(0===o)return[{tS:[0,e],tE:[0,e],multiplicity:t.multiplicity}];const i=2**Qr(Wr(o)),c=function(t,n,e){return Rn(Qn(t,e),n)}(n,i,e),s=c.map(Vr),u=s.map(t=>t[1]*An**2),f=Ce(s,0,1,u,()=>c),l=[];for(const t of f)l.push({tS:lt(e,t.tS*i),tE:lt(e,t.tE*i),multiplicity:t.multiplicity});return l}function Gr(t,n){return ct(it(t,n))}const{abs:Ur}=Math;function Zr(t,n){const e=t.inOuts;e.sort(function(t){return(n,e)=>{let r=n.side-e.side;if(0!==r)return r;const o=n.sideX,i=e.sideX;r=o.ri.tS-i.ri.tS;const c=8*Number.EPSILON;return Ur(r)>=c?r:(o.compensated||(o.compensated=1,o.riExp=Rr(o.ri,o.getPExact())[0]),i.compensated||(i.compensated=1,i.riExp=Rr(i.ri,i.getPExact())[0]),r=Gr(o.riExp.tS,i.riExp.tS),0!==r?r:(r=n.dir-e.dir,0!==r?t*r:1===n.dir?n.idx-e.idx:e.idx-n.idx))}}(n));let r=e[e.length-1];for(let t=0;t<e.length;t++){const n=e[t];n.prevAround=r,r.nextAround=n,r=n}}function Jr(t,n,e,r){const o=function(t,n){return(e,r,o)=>{t.has(e)||(e.orientation=r,e.parent=o,e.windingNum=o.windingNum+e.orientation,n.push(e))}}(r,e);Zr(t.container,n.orientation);let i,c,s=1,u=t,f=n.orientation;for(;u=1===n.orientation?u.nextAround:u.prevAround,u!==t;){const t=s;s-=u.dir,1===s&&(f*=-1),-1!==u.dir&&(i?1===t&&0===s?o(u,n.orientation,n.parent):0===t&&-1===s&&o(u,-n.orientation,n.parent):0===s?i=u:1===s&&o(u,n.orientation,n))}return Dr(t.container)||(c=[t.p,i.p]),{inOutToUse:i,additionalBezier:c}}function Kr(t,n){const e=t._x_,r=n._x_,o=e.curve,i=e.x.ri.tS,c=r.curve,s=r.x.ri.tS;let u=o,f=i;Dr(t.container)||(f=Hr(Xr(o.ps,t.p)[0].ri));const l=[];for(;;){if(u===c&&(f<s||f===s&&0!==l.length)){const t=u.ps,n=[f,s];return l.push({ps:t,ts:n}),l}{const t=u.ps,n=[f,1];l.push({ps:t,ts:n})}f=0,u=u.next}}function to(t,n){const e=n._x_,r=t._x_,o=r.curve,i=r.x.ri.tS,c=e.curve,s=e.x.ri.tS;let u=o,f=i;Dr(t.container)||(f=Hr(Xr(u.ps,t.p)[0].ri));const l=[];for(;;){const t=u.ps;if(u===c&&(f>s||f===s&&0!==l.length)){const n=[f,s];return l.push({ps:t,ts:n}),l}{const n=[f,0];l.push({ps:t,ts:n})}f=1,u=u.prev}}function no(t,n,e,r){const o=function(t,n,e){return(r,o,i,c)=>{n.has(r)||1!==r.dir||(r.loopsIdxs=new Set(c),r.orientation=o*t.orientation,r.parent=i.parent,r.windingNum=i.windingNum+r.orientation,e.unshift(r))}}(n,r,e);Zr(t.container,1);let i=t.nextAround,c=t;const s=[],u=new Set(n.loopsIdxs);for(;c=c.nextAround,c!==t;)o(c,n.dir,n,u),s.push(c.idx),-1===c.dir?u?.add(c._x_?.curve.loop.idx):u.delete(c._x_?.curve.loop.idx);let f;return Dr(t.container)||(f=[t.p,i.p]),{inOutToUse:i,additionalBezier:f}}function eo(t){const{ps:n,ts:e}=t;return function(t,n,e){if(4===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,N=u-l,I=p-l,y=N+I,E=n*N,O=e*N,C=c[1]-u-3*I;return[[d*S+(3*n*(n*w-x)+s),d*C+(3*n*(n*y-N)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*C+2*y)+(h*y+u-(O+2*E))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*C+2*y)+(g*y+u-(2*O+E))],[v*S+(3*e*(e*w-x)+s),v*C+(3*e*(e*y-N)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[e,[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}(n,e[0],e[1])}function ro(t,n,e){const r=[],o=[];let i,c=n;const s=e?no:Jr,u=[];do{t.add(c),u.push(c);const e=c.nextOrPrev;t.add(e);const f=1===c.dir?Kr(c,e):to(c,e);o.push(...f);const l=s(e,n,r,t);if(({inOutToUse:c,additionalBezier:i}=l),void 0!==i){const t=eo(o[o.length-1]),n={ps:t,ts:[0,Hr(Xr(t,i[0])[0].ri)]};o.pop(),o.push(n),o.push({ps:i,ts:[0,1]})}}while(c!==n);return"undefined"!=typeof _debug_&&_debug_.verbose&&function(t){const n=[],e=[];for(let r of t)e.push(1===r.dir?"color: blue;":"color: red"),n.push(`%c${r.idx}`)}(u),{bezierPieces:o,additionalOutsToCheck:r}}function oo(t,n,e,r){const o=[t];for(;o.length;){const t=o.pop();if(n.add(t._x_.curve.loop),e.has(t))continue;t.children=new Set;const{bezierPieces:i,additionalOutsToCheck:c}=ro(e,t,r);t.bezierPieces=i,t.parent.children=t.parent.children||new Set,t.parent.children.add(t);for(let t=0;t<c.length;t++)o.push(c[t])}}function io(t){if(4===t.length)return co(t);if(3===t.length)return so(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n,n],[o-e,e]]}(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[n],[e]]}(t);throw new Error("The given bezier curve must be of order <= 3.")}function co(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[s-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-c),3*(c+e-2*o),3*(o-e),e]]}function so(t){const[[n,e],[r,o],[i,c]]=t;return[[i+n-2*r,2*(r-n),n],[c+e-2*o,2*(o-e),e]]}function uo(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function fo(t,n){const[e,r]=uo(t);return[R(e,n),R(r,n)]}function lo(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=uo(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Re(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}return{minY:r,maxY:o}}function ao(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=uo(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Re(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}return{minX:r,maxX:o}}(t),e=lo(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const po=L(ao),ho=L(function(t){const n=uo(t),e=Ce(n[0],0,1)?.map(t=>t.t)||[],r=Ce(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=Te(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Te(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}),{min:go,max:vo}=Math;function mo(t){const n=t.map(ho);return{minX:go(...n.map(t=>t.box[0][0])),maxX:vo(...n.map(t=>t.box[1][0])),minY:go(...n.map(t=>t.box[0][1])),maxY:vo(...n.map(t=>t.box[1][1]))}}const xo=new Function("try {return this===window;}catch(e){ return false;}")()?function(t){const n=window.atob(t),e=n.length,r=new Uint8Array(e);for(let t=0;t<e;t++)r[t]=n.charCodeAt(t);return r.buffer}:function(t){return function(t){const n=new ArrayBuffer(t.length),e=new Uint8Array(n);for(let n=0;n<t.length;++n)e[n]=t[n];return n}(Buffer.from(t,"base64"))},bo=xo("AGFzbQEAAAABBgFgAX8BfAMDAgAABQMBAAAHHwMGbWVtb3J5AgAHc3F1YXJlcwAACHNxdWFyZXM0AAEKjgECPwECfiAArULHuuXf9tjQm2p+IgEgASABfnxCIIoiAiACfiABQse65d/22NCbanx8QiCKIgIgAn4gAXxCIIi6C0wBAn4gAK1Cx7rl3/bY0JtqfiIBQse65d/22NCbanwiAiABIAIgASABIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiLoL"),wo=new WebAssembly.Module(bo),_o=new WebAssembly.Instance(wo),Mo=_o.exports.squares;_o.exports.squares4;const So=1e-6;function No(t,n){let e;const r=[t];for(;r.length;)o(r.pop());return e;function o(o){if(o===t||function(t,n){let e=0;do{e++;const o=Mo(e)/4294967296,i=r(t,n,Te(t[Mo(e+1e3)%t.length],o));if(void 0!==i)return i}while(e<100);return;function r(t,n,e){if(function(t,n){const e=mo(t),r=mo(n);return e.minX<r.minX||e.maxX>r.maxX||e.minY<r.minY||e.maxY>r.maxY}(t,n))return!1;const r=function(t,n){const[e,r]=n;let o=0;for(let i=0;i<t.length;i++){const c=t[i],[[s,u],[f,l]]=po(c);let a=u>r||l<r||!1;if(a=a||s>e||!1,a)continue;const p=[];let h,d,g;const v=!0;h=t=>io(t)[1],d=[0,-r],g=0;const m=c.map(j(d)),x=h(m),b=Ce(x,0-So,1+So)?.map(t=>t.t)||[];for(let t=0;t<b.length;t++){const e=b[t];if(Math.abs(e)<So||Math.abs(e-1)<So)return;const r=Te(m,e);(v&&n[g]>=r[g]||!v&&n[g]<=r[g])&&p.push(e)}if(1===p.length||3===p.length)for(const t of p){const n=W(fo(c,t));if(Math.abs(n[1])<So)return}o+=p.length}return o}(n,e);return void 0!==r?r%2!=0:void 0}}(n.beziers,o.bezierPieces.map(eo))){e=o;for(const t of o.children)r.push(t)}}}function Io(t,n){return yo(t)-yo(n)}function yo(t){let n=Number.POSITIVE_INFINITY;for(const e of t){const t=ho(e).box[0][1];t<n&&(n=t)}return n}const{abs:Eo,sign:Oo}=Math;function Co(t){let n=t.parent;for(;;){if(void 0===n)return!1;if(n.used)return!0;n=n.parent}}function To(t,n,e){let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;o>c&&([o,c]=[c,o]),u>l&&([u,l]=[l,u]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]);const a=t||r===i&&s===f,p=t||o===c&&u===l;return(a?r<=f:r<f)&&(a?i>=s:i>s)&&(p?u<=c:u<c)&&(p?l>=o:l>o)}function Po(t,n){return To(!0,t.box,n.box)}function Ao(t,n){for(let e=0;e<n.length;e++){const r=n[e];ko(t,[r.a,r.b])}}function ko(t,n){const[e,r]=n;let o=t.get(e);o||(o=[],t.set(e,o));let i=t.get(r);i||(i=[],t.set(r,i)),o.push(r),i.push(e)}function Bo(t,n,e,r){e.add(n),r.push(n);const o=t.get(n);for(let n=0;n<o.length;n++){const i=o[n];e.has(i)||Bo(t,i,e,r)}}function zo(t){const n=[],e=new Set;for(const r of t){const o=r[0];e.has(o)||(n.push([]),Bo(t,o,e,n[n.length-1]))}return n}function Fo(t,n){const e=new Set;for(const t of n)for(const n of t)e.add(n);const r=[];for(let n=0;n<t.length;n++){const o=t[n];e.has(o)||r.push(o)}return r}function Yo(t){const n=[];for(const e of t){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const c=[];for(const n of e){const[[e,s],[u,f]]=n.box;e<t&&(t=e),s<r&&(r=s),u>o&&(o=u),f>i&&(i=f),c.push(...n.xs)}const s={box:[[t,r],[o,i]],xs:c,inOuts:void 0};n.push(s)}return n}function Lo(t){return{tS:[0,t.tS],tE:[0,t.tE],multiplicity:t.multiplicity}}function Xo(t,n){const e=t[0],r=t[1],o=r+n,i=o-r,c=e+(r-(o-i)+(n-i)),s=o+c;return[c-(s-o),s]}const Ho=Je,Do=Dn,Vo=Ut,$o=Xo,qo=Math.abs;function jo(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Ho(s,n),l=Ho(r,i),a=3*(r-i),p=Do(3,l),h=qo(a),d=Vo(f,p),g=h+qo(s-n+a),v=Ho(i,2*r),m=$o(v,n),x=qo(i-2*r+n),b=Do(3,m),w=6*x,_=Ho(r,n),M=Do(3,_),S=qo(3*(r-n)),N=Ho(u,e),I=Ho(o,c),y=3*(o-c),E=Do(3,I),O=qo(y),C=Vo(N,E),T=O+qo(u-e+y),P=Ho(c,2*o),A=$o(P,e),k=qo(c-2*o+e),B=Do(3,A),z=6*k,F=Ho(o,e);return{coeffs:[[d,b,M,[0,n]],[C,B,Do(3,F),[0,e]]],errorBound:[[g,w,S,0],[T,z,qo(3*(o-e)),0]]}}function Wo(t){const[[n,e],[r,o],[i,c]]=t,s=i-2*r,u=Ho(i,2*r),f=$o(u,n),l=qo(s+n),a=Ho(2*r,2*n),p=c-2*o,h=Ho(c,2*o),d=$o(h,e),g=qo(p+e);return{coeffs:[[f,a,[0,n]],[d,Ho(2*o,2*e),[0,e]]],errorBound:[[l,0,0],[g,0,0]]}}function Qo(t){const[[n,e],[r,o]]=t;return[[Ho(r,n),[0,n]],[Ho(o,e),[0,e]]]}const Ro=Zt,Go=Dn,Uo=ot,Zo=Math.abs;function Jo(t){const[[n,[,e]],[r,[,o]]]=Qo(t),i=Uo(r),c=n,s=Go(o,n),u=Zo(s[1]),f=Go(e,r),l=Zo(f[1]),a=Ro(f,s);return{coeffs:{vₓ:i,vᵧ:c,v:a},errorBound:{v_:u+l+Zo(a[1])}}}const{abs:Ko}=Math,ti=Ut,ni=Dn,ei=jn;function ri(t){return[-t[0],-t[1]]}const oi=ri,ii=Ke,ci=Dn,si=jn,ui=Zt,fi=Math.abs;function li(t){const{coeffs:[[n,e,[,r]],[o,i,[,c]]],errorBound:[[s],[u]]}=Wo(t),f=n[1],l=e[1],a=o[1],p=i[1],h=fi(r),d=fi(l),g=fi(f),v=fi(c),m=fi(p),x=fi(a),b=si(n,i),w=s*m+2*fi(f*p),_=si(e,o),M=d*u+2*fi(l*a),S=ci(c,n),N=v*s+fi(c*f),I=ci(r,o),y=h*u+fi(r*a),E=ci(c,e),O=fi(c*l),C=ci(r,i),T=fi(r*p),P=si(n,n),A=2*(s*g+fi(f*f)),k=si(n,o),B=s*x+g*u+2*fi(f*a),z=si(o,o),F=2*(u*x+fi(a*a)),Y=f*p-l*a,L=f*c-r*a,X=l*c-r*p,H=ui(b,_),D=fi(Y),V=w+M+D,$=ui(S,I),q=fi(L),j=N+y+q,W=ui(E,C),Q=fi(X),R=O+T+Q,G=oi(z),U=F,Z=ii(k),J=2*B,K=oi(P),tt=A,nt=p*Y,et=si(i,H),rt=m*V+2*fi(nt),ot=2*L*a,it=ii(si(o,$)),ct=2*(u*q+x*j+2*fi(ot)),st=nt-ot,ut=ui(et,it),ft=rt+ct+fi(st),lt=2*f*L,at=ii(si(n,$)),pt=2*(s*q+g*j+2*fi(lt)),ht=l*Y,dt=si(e,H),gt=d*V+2*fi(ht),vt=lt-ht,mt=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Ii=Gt,yi=Ke,Ei=Dn,Oi=jn,Ci=Ut,{abs:Ti}=Math,Pi=Ut,Ai=Dn,ki=jn,{abs:Bi}=Math,zi=Gt,Fi=Ke,Yi=Dn,Li=jn,Xi=Ut,{abs:Hi}=Math,Di=Gt,Vi=Ke,$i=Dn,qi=jn,ji=Ut,{abs:Wi}=Math,Qi=Ut,Ri=Dn,Gi=jn,{abs:Ui}=Math,Zi=Gt,Ji=Ke,Ki=Dn,tc=jn,nc=Ut,{abs:ec}=Math,rc=Gt,oc=Ke,ic=Dn,cc=jn,sc=Ut,{abs:uc}=Math,fc=Z,lc=lt,ac=nt,pc=at;function hc(t){if(4===t.length)return dc(t);if(3===t.length)return gc(t);if(2===t.length)return vc(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[[n]],[[e]]]}(t);throw new Error("The given bezier curve must be of order <= cubic.")}function dc(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[J(fc(s,n),ac(3,fc(r,i))),ac(3,pc(lc(i,n),-2*r)),ac(3,fc(r,n)),[n]].map(Pn),[J(fc(u,e),ac(3,fc(o,c))),ac(3,pc(lc(c,e),-2*o)),ac(3,fc(o,e)),[e]].map(Pn)]}function gc(t){const[[n,e],[r,o],[i,c]]=t;return[[pc(lc(i,n),-2*r),fc(2*r,2*n),[n]],[pc(lc(c,e),-2*o),fc(2*o,2*e),[e]]]}function vc(t){const[[n,e],[r,o]]=t;return[[fc(r,n),[n]],[fc(o,e),[e]]]}const mc=nt,xc=ot;function bc(t){const[[n,[e]],[r,[o]]]=t;if(0!==ct(n)||0!==ct(r))return{vₓ:xc(r),vᵧ:n,v:Pn(it(mc(e,r),mc(o,n)))}}const wc=nt,_c=et,Mc=J;function Sc(t,n){const e=vc(t),[[r,[o]],[i,[c]]]=vc(n),{vₓ:s,vᵧ:u,v:f}=bc(e),l=_c(r,s),a=_c(i,u),p=Mc(l,a),h=wc(o,s),d=wc(c,u),g=Mc(h,d);return[p,Mc(g,f)].map(Pn)}const Nc=nt,Ic=Mr,yc=it,Ec=et,Oc=ot;function Cc(t){const[[n,e,[r]],[o,i,[c]]]=t;if(0===ct(n)&&0===ct(o))return bc([[e,[r]],[i,[c]]]);const s=Ec(n,i),u=Ec(e,o),f=Nc(c,n),l=Nc(r,o),a=Nc(c,e),p=Nc(r,i),h=Ec(n,n),d=Ec(n,o),g=Ec(o,o),v=yc(s,u),m=yc(f,l),x=yc(a,p),b=Pn(Oc(g)),w=Pn(Ic(d)),_=Pn(Oc(h)),M=Ec(i,v),S=Ic(Ec(o,m)),N=Pn(yc(M,S)),I=Ic(Ec(n,m)),y=Ec(e,v),E=Pn(yc(I,y)),O=Ec(v,x),C=Ec(m,m);return{vₓₓ:b,vₓᵧ:w,vᵧᵧ:_,vₓ:N,vᵧ:E,v:Pn(yc(O,C))}}const Tc=Jn,Pc=nt,Ac=et,kc=J,Bc=Mr;function zc(t,n){const e=gc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return Sc([t[0],t[2]],n);const[[r,[o]],[i,[c]]]=vc(n),{vₓₓ:s,vₓᵧ:u,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=Cc(e),h=Tc(o,o),d=Pc(o,r),g=Tc(o,c),v=Pc(o,i),m=Ac(r,r),x=Pc(c,r),b=Ac(r,i),w=Tc(c,c),_=Pc(c,i),M=Ac(i,i),S=Ac(m,s),N=Ac(M,f),I=Ac(b,u),y=kc(S,N),E=kc(y,I),O=Ac(d,s),C=Ac(_,f),T=kc(v,x),P=Ac(T,u),A=Bc(kc(O,C)),k=kc(A,P),B=Ac(r,l),z=Ac(i,a),F=kc(B,z),Y=kc(k,F),L=Ac(h,s),X=Ac(g,u),H=Ac(w,f),D=kc(L,X),V=kc(D,H),$=Pc(o,l),q=Pc(c,a),j=kc($,q),W=kc(V,j);return[E,Y,kc(W,p)].map(Pn)}const Fc=et,Yc=Z,Lc=tt,Xc=lt;function Hc(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[rt(it(Lc(Xc(c/4,u/4),3),Xc(t/4,l/4))),rt(it(Lc(Xc(s/4,f/4),3),Xc(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Yc(o,e),a=Yc(i,r),p=Yc(u,c),h=Yc(f,s),d=it(Fc(p,a),Fc(h,l));if(0===ct(d))return;const g=Yc(c,e),v=Yc(s,r),m=rt(it(Fc(v,l),Fc(g,a)))/rt(d);return[c+m*rt(p),s+m*rt(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}const Dc=nt,Vc=et,$c=J,qc=it,jc=ot,Wc=Mr;function Qc(t){const[[n,e,r,[o]],[i,c,s,[u]]]=t;if(0===ct(n)&&0===ct(i))return Cc([[e,r,[o]],[c,s,[u]]]);const f=Vc(n,s),l=Vc(r,i),a=Vc(n,c),p=Vc(e,c),h=Vc(e,i),d=Vc(n,n),g=Vc(c,c),v=Vc(i,i),m=Vc(r,n),x=Vc(e,e),b=Vc(s,i),w=Vc(c,i),_=Vc(e,n),M=Vc(n,i),S=Dc(u,n),N=Dc(o,i),I=Dc(u,e),y=Dc(o,c),E=Vc(e,s),O=Vc(r,c),C=Dc(u,r),T=Dc(o,s),P=qc(S,N),A=qc(f,l),k=qc(a,h),B=qc(I,y),z=qc(E,O),F=qc(C,T),Y=qc(b,g),L=qc(m,x),X=$c(h,a),H=$c(l,f),D=Wc(A),V=Vc(P,P),$=Vc(P,A),q=Vc(P,k),j=Vc(P,z),W=Vc(A,A),Q=Vc(D,B),R=Vc(k,B),G=Vc(k,z),U=Vc(k,F),Z=Pn(Vc(jc(i),v)),J=Pn(Vc(Dc(3,n),v)),K=Pn(Vc(Dc(-3,i),d)),tt=Pn(Vc(n,d)),nt=qc(Dc(-3,P),z),et=Vc(nt,v),rt=Vc(k,Y),ot=$c(et,rt),it=Vc(D,w),st=Pn($c(ot,it)),ut=Vc(nt,d),ft=Vc(k,L),lt=$c(ut,ft),at=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(z,Y),H=Zc(F,L),D=Uc(_,X),V=Uc(y,H),$=Zc(D,V),q=Zc(O,T),j=Jc(Zc(C,A)),W=Zc(P,B),Q=Zc(q,a),R=Zc(j,p),G=Zc(W,h),U=Uc(_,Q),Z=Uc(S,R),J=Uc(y,G),K=Zc(U,Z),tt=Zc(K,J),nt=Jc(Zc(T,a)),et=Jc(Zc(P,h)),rt=Zc(O,nt),ot=Zc(B,et),it=Zc(C,p),st=Zc(A,p),ut=Uc(x,rt),ft=Uc(I,ot),lt=Uc(w,it),at=Uc(M,st),pt=Uc(r,d),ht=Uc(i,g),dt=Zc(ut,ft),gt=Zc(lt,at),vt=Zc(dt,gt),mt=Zc(pt,ht),xt=Zc(vt,mt),bt=Zc(E,T),wt=Zc(k,P),_t=Zc(bt,a),Mt=Zc(wt,h),St=Uc(m,_t),Nt=Uc(N,Mt),It=Uc(b,p),yt=Zc(St,Nt),Et=Zc(yt,It),Ot=Gc(o,d),Ct=Gc(c,g),Tt=Zc(Ot,Ct),Pt=Zc(Et,Tt);return[$,tt,xt,Zc(Pt,v)].map(Pn)}const ts=nt,ns=et,es=J;function rs(t,n){const e=vc(t),[[r,o,[i]],[c,s,[u]]]=gc(n);if(0===ct(r)&&0===ct(c))return Sc(t,[n[0],n[2]]);const{vₓ:f,vᵧ:l,v:a}=bc(e),p=ns(r,f),h=ns(c,l),d=es(p,h),g=ns(o,f),v=ns(s,l),m=es(g,v),x=ts(i,f),b=ts(u,l),w=es(x,b);return[d,m,es(w,a)].map(Pn)}const os=Jn,is=nt,cs=et,ss=J,us=Mr;function fs(t,n){const e=gc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return rs([t[0],t[2]],n);const[[r,o,[i]],[c,s,[u]]]=gc(n);if(0===ct(r)&&0===ct(c))return zc(t,[n[0],n[2]]);const{vₓₓ:f,vₓᵧ:l,vᵧᵧ:a,vₓ:p,vᵧ:h,v:d}=Cc(e),g=os(i,i),v=is(i,o),m=is(i,r),x=os(i,u),b=is(i,s),w=is(i,c),_=cs(o,o),M=cs(o,r),S=is(u,o),N=cs(o,s),I=cs(o,c),y=cs(r,s),E=cs(r,r),O=is(u,r),C=cs(r,c),T=os(u,u),P=is(u,s),A=is(u,c),k=cs(s,s),B=cs(s,c),z=cs(c,c),F=cs(E,f),Y=cs(C,l),L=cs(z,a),X=ss(F,Y),H=ss(X,L),D=cs(M,f),V=cs(B,a),$=ss(I,y),q=cs($,l),j=us(ss(D,V)),W=ss(j,q),Q=ss(us(m),_),R=ss(us(A),k),G=ss(w,N),U=ss(G,O),Z=cs(Q,f),J=cs(R,a),K=cs(U,l),tt=cs(r,p),nt=cs(c,h),et=ss(Z,J),rt=ss(et,K),ot=ss(tt,nt),it=ss(rt,ot),st=cs(v,f),ut=cs(P,a),ft=ss(b,S),lt=cs(ft,l),at=us(ss(st,ut)),pt=cs(o,p),ht=cs(s,h),dt=ss(at,lt),gt=ss(pt,ht),vt=ss(dt,gt),mt=cs(g,f),xt=cs(x,l),bt=cs(T,a),wt=is(i,p),_t=is(u,h),Mt=ss(mt,xt),St=ss(Mt,bt),Nt=ss(wt,_t),It=ss(St,Nt);return[H,W,it,vt,ss(It,d)].map(Pn)}const ls=Jn,as=nt,ps=et,hs=J,ds=Mr;function gs(t,n){const e=dc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return fs(Hc(t),n);const[[r,o,[i]],[c,s,[u]]]=gc(n);if(0===ct(r)&&0===ct(c))return Kc(t,[n[0],n[2]]);const{vₓₓₓ:f,vₓₓᵧ:l,vₓᵧᵧ:a,vᵧᵧᵧ:p,vₓₓ:h,vₓᵧ:d,vᵧᵧ:g,vₓ:v,vᵧ:m,v:x}=Qc(e),b=ls(i,i),w=as(i,o),_=as(i,r),M=ls(i,u),S=as(i,s),N=as(i,c),I=ps(o,o),y=ps(o,r),E=as(u,o),O=ps(o,s),C=ps(o,c),T=ps(r,s),P=ps(r,r),A=as(u,r),k=ps(r,c),B=ls(u,u),z=as(u,s),F=as(u,c),Y=ps(s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K),_n=hs(mn,bn),Mn=hs(xn,wn),Sn=ps(gn,f),Nn=ps(vn,p),In=ps(_n,l),yn=ps(Mn,a),En=ps(Z,h),On=ps(J,g),Cn=ps(lt,d),Tn=ps(r,v),An=ps(c,m),kn=hs(Sn,Nn),Bn=hs(In,yn),zn=hs(En,On),Fn=hs(kn,Bn),Yn=hs(zn,Cn),Ln=hs(Tn,An),Xn=hs(Fn,Yn),Hn=hs(Xn,Ln),Dn=ps(ls(3,i),w),Vn=ps(ls(3,u),z),$n=as(i,st),qn=as(u,ut),jn=ps(w,h),Wn=ps(z,g),Qn=ps(S,d),Rn=ps(E,d),Gn=ds(hs(jn,Wn)),Un=hs(Qn,Rn),Zn=ps(o,v),Jn=ps(s,m),Kn=ps(Dn,f),te=ps(Vn,p),ne=ps($n,l),ee=ps(qn,a),re=hs(Kn,te),oe=hs(ne,ee),ie=hs(re,oe),ce=hs(Gn,Un),se=hs(Zn,Jn),ue=hs(ie,ce),fe=hs(ue,se),le=as(i,f),ae=as(i,a),pe=as(u,l),he=as(u,p),de=hs(le,pe),ge=hs(ae,he),ve=hs(de,h),me=hs(ge,g),xe=ps(b,ve),be=ps(B,me),we=ps(M,d),_e=as(i,v),Me=as(u,m),Se=hs(xe,be),Ne=hs(Se,we),Ie=hs(_e,Me),ye=hs(Ne,Ie);return[R,It,Wt,dn,Hn,fe,hs(ye,x)].map(Pn)}const vs=nt,ms=et,xs=J;function bs(t,n){const e=vc(t),[[r,o,i,[c]],[s,u,f,[l]]]=dc(n);if(0===ct(r)&&0===ct(s))return rs(t,Hc(n));const{vₓ:a,vᵧ:p,v:h}=bc(e),d=ms(r,a),g=ms(s,p),v=xs(d,g),m=ms(o,a),x=ms(u,p),b=xs(m,x),w=ms(i,a),_=ms(f,p),M=xs(w,_),S=vs(c,a),N=vs(l,p),I=xs(S,N);return[v,b,M,xs(I,h)].map(Pn)}const ws=Jn,_s=nt,Ms=et,Ss=J,Ns=Mr;function Is(t,n){const e=gc(t);if(0===ct(e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const o=t[0],i=t[1],c=n[0],s=n[1],u=Fs(t,n),f=Math.abs(o+i),l=Math.abs(c+s),a=l-Ys*l-r;return a<=0?{est:u,err:Number.POSITIVE_INFINITY}:{est:u,err:(l*e+f*r)/a**2+9*Ls*Math.abs(f/l)}},nu=function(t,n){return Xs(t,n)[1]>0?n:t},eu=function(t,n){return Hs(t,n)[1]>0?t:n};function ru(t,n){return n[0][0]!==n[1][0]||n[0][1]!==n[1][1]?4===t.length?function([[t,n],[e,r],[o,i],[c,s]],[u,f]){const l=Rs(f,u),a=3*Be*Ws(l[1]),p=Rs(Qs,u),h=3*Be*Ws(p[1]),d=tu(l,p,a,h);f=Gs(d.est,d.err);const g=Rs(Qs,u),v=Zs(u,u),m=Zs(u,g),x=Zs(g,g),b=Zs(v,u),w=Zs(v,g),_=Zs(x,u),M=Zs(x,g),S=Rs(Qs,f),N=Zs(f,f),I=Zs(f,S),y=Zs(S,S),E=Zs(N,f),O=Zs(N,S),C=Zs(y,f),T=Zs(y,S),P=Ws(u[1]),A=Ws(g[1]),k=Ws(v[1]),B=Ws(m[1]),z=Ws(x[1]),F=Ws(b[1]),Y=Ws(w[1]),L=Ws(_[1]),X=Ws(M[1]),H=Ws(f[1]),D=Ws(S[1]),V=Ws(N[1]),$=Ws(I[1]),q=Ws(y[1]),j=Ws(E[1]),W=Ws(O[1]),Q=Ws(C[1]),R=Ws(T[1]);let G=Ws(t),U=Ws(n),Z=Ws(e),J=Ws(r),K=Ws(o),tt=Ws(i),nt=Ws(c),et=Ws(s);const rt=Us(Js(c,u),Js(o,g)),ot=Us(Us(Js(c,v),Js(2*o,m)),Js(e,x)),it=Us(Us(Js(c,b),Js(t,M)),Js(3,Us(Js(o,w),Js(e,_)))),ct=Us(Zs(ot,f),Zs(it,S)),st=Us(Us(Zs(rt,N),Zs(it,y)),Zs(Ks(ot),I)),ut=Us(Us(Js(c,E),Zs(it,T)),Js(3,Us(Zs(rt,O),Zs(ot,C)))),ft=Ws(it[1]),lt=nt*P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-b)),y=eu(Gs(_,+m),Gs(M,+b));return[[I,nu(Gs(S,-x),Gs(N,-w))],[y,eu(Gs(S,+x),Gs(N,+w))]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n[0]&&0===n[1]){const t=[0,e[0]],n=[0,e[1]];return[[t,n],[t,n]]}if(0===n[0]&&1===n[1]){const t=[0,r[0]],n=[0,r[1]];return[[t,n],[t,n]]}const o=function(t,n){if(0===n[0]&&0===n[1])return t[0].map(t=>[0,t]);if(0===n[0]&&1===n[1])return t[t.length-1].map(t=>[0,t]);if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=js(Ds(qs(o,e),n),e),a=js(Ds(qs(c,o),n),o),p=js(Ds(qs(u,c),n),c),h=Vs(l,Ds($s(a,l),n)),d=Vs(a,Ds($s(p,a),n)),g=Vs(h,Ds($s(d,h),n)),v=js(Ds(qs(i,r),n),r),m=js(Ds(qs(s,i),n),i),x=js(Ds(qs(f,s),n),s),b=Vs(v,Ds($s(m,v),n)),w=Vs(m,Ds($s(x,m),n));return[g,Vs(b,Ds($s(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=Vs([0,e],Ds(qs(o,e),n)),f=Vs([0,o],Ds(qs(c,o),n)),l=Vs(u,Ds($s(f,u),n)),a=Vs([0,r],Ds(qs(i,r),n)),p=Vs([0,i],Ds(qs(s,i),n));return[l,Vs(a,Ds($s(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[js(Ds(qs(o,e),n),e),js(Ds(qs(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}(t,n);let i;if(4===t.length)i=Ae(t,n).map(t=>16*ze*t);else if(3===t.length)i=Ae(t,n).map(t=>10*ze*t);else if(2===t.length)i=Ae(t,n).map(t=>4*ze*t);else if(1===t.length)return[o,o];return[[Gs(o[0],-i[0]),Gs(o[1],-i[1])],[Gs(o[0],+i[0]),Gs(o[1],+i[1])]]}(t,n[0])}function ou(t){return(n,e)=>{let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;return(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])&&([o,c]=[c,o]),(u[1]>l[1]||u[1]===l[1]&&u[0]>l[0])&&([u,l]=[l,u]),(r[1]>i[1]||r[1]===i[1]&&r[0]>i[0])&&([r,i]=[i,r]),(s[1]>f[1]||s[1]===f[1]&&s[0]>f[0])&&([s,f]=[f,s]),t?(r[1]<f[1]||r[1]===f[1]&&r[0]<=f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>=s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<=c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>=o[0]):(r[1]<f[1]||r[1]===f[1]&&r[0]<f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>o[0])}}function iu(t){return[((n=t.x.box)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];var n}function cu(t,n){const e=ks(t,n);if(void 0===e)return;const{coeffs:r,errBound:o,getPExact:i}=e,c=Ce(r,0,1,o,i)||[];return 0!==c.length?{ris:c.map(Lo),getPExact:i}:void 0}function su(t){const n=rt(t.tS);return{t:n,tS:n,tE:rt(t.tE),multiplicity:t.multiplicity}}function uu(t,n){const e=cu(t,n);if(void 0===e)return[];const{getPExact:r}=e;let o,{ris:i}=e;const c=()=>(o=o||r(),o),s=cu(n,t);if(void 0===s)return[];let{ris:u}=s;const{getPExact:f}=s;let l;const a=()=>(l=l||f(),l);let p;p=1;let h,d=0;t:for(;d<p;){h=u.map(n=>ru(t,[n.tS,n.tE]));for(let t=0;t<u.length;t++){const n=h[t];for(let e=t+1;e<u.length;e++){const t=h[e];if(ou(!0)(n,t)){const t=[];for(const n of u)t.push(...Rr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},a()));u=t,d++;continue t}}}break t}p=1;let g,v=0;t:for(;v<p;){g=i.map(t=>ru(n,[t.tS,t.tE]));for(let t=0;t<i.length;t++){const n=g[t];for(let e=t+1;e<i.length;e++){const t=g[e];if(ou(!0)(n,t)){const t=[];for(const n of i)t.push(...Rr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},c()));i=t,v++;continue t}}}break t}const m=[];for(let t=0;t<u.length;t++){const n=h[t];for(let e=0;e<i.length;e++){const o=g[e];if(ou(!0)(n,o)){const c={compensated:d,ri:su(u[t]),riExp:d?u[t]:void 0,getPExact:d?void 0:f,kind:1,box:fu(n)},s={compensated:v,ri:su(i[e]),riExp:v?i[e]:void 0,getPExact:v?void 0:r,kind:1,box:fu(o)};m.push({psX:c,sideX:s})}}}return m}function fu(t){return t.map(t=>t.map(rt))}function lu(t,n){return function(t,n){const e=t.xs,r=[],o=new Map;for(const t of e){const n=t.curve,e=o.get(n);e?e.push(t):o.set(n,[t])}const i=function(t){const[[n,e],[r,o]]=t.box,i=[[[r,e],[n,e]],[[n,e],[n,o]],[[n,o],[r,o]],[[r,o],[r,e]]];return(n,e,r)=>{const o=n.ps,c=e.slice();for(let t=0;t<i.length;t++){const n=uu(o,i[t]);for(const{psX:e,sideX:r}of n)c.push({x:e,side:t,sideX:r,curve:void 0})}c.sort((t,n)=>t.x.ri.tS-n.x.ri.tS);const s=[],u=[];let f,l;for(const n of c)void 0!==n.side?(!0===l&&(u.push({idx:++r,dir:1,p:iu(n),_x_:f,container:t,side:n.side,sideX:n.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),f.out=u[u.length-1]),l=!1):(!1===l&&(s.push({idx:++r,dir:-1,p:iu(f),_x_:n,container:t,side:f.side,sideX:f.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),n.in_=s[s.length-1]),l=!0),f=n;return{ins:s,outs:u,ioIdx:r}}}(t);for(const t of o){const[e,o]=t;let c,s;({ins:c,outs:s,ioIdx:n}=i(e,o,n)),r.push(...c),r.push(...s)}return{inOuts:r,ioIdx:n}}(t,n)}function au(t,n,e,r){const o=[];for(const r of t)o.push({type:-1,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(pu);const i=new Set,c=[];for(const t of o){const{item:n,type:e}=t;if(-1===e){for(const t of i){const e=r(n,t);e&&c.push({a:n,b:t,u:e})}i.add(n)}else 1===e&&i.delete(n)}return c}function pu(t,n){const e=t.x-n.x;return 0!==e?e:t.type}function hu(t,n,e){const r=(t[0]-e[0])*(n[1]-e[1]),o=(t[1]-e[1])*(n[0]-e[0]),i=r-o;let c;if(r>0){if(o<=0)return i;c=r+o}else{if(!(r<0))return i;if(o>=0)return i;c=-r-o}return Math.abs(i)>=3330669073875472e-31*c?i:function(t,n,e,r){const o=t[0]-e[0],i=n[0]-e[0],c=t[1]-e[1],s=n[1]-e[1],u=it(Jn(o,s),Jn(c,i));let f=rt(u);if(Math.abs(f)>=2220446049250315e-31*r)return f;const l=Z(t[0],e[0])[0],a=Z(n[0],e[0])[0],p=Z(t[1],e[1])[0],h=Z(n[1],e[1])[0];if(0===l&&0===p&&0===a&&0===h)return f;const d=1109335647967049e-46*r+3330669073875471e-31*Math.abs(f);if(f+=o*h+s*l-(c*a+i*p),Math.abs(f)>=d)return f;const g=J(u,it(Jn(l,s),Jn(p,i))),v=J(g,it(Jn(o,h),Jn(c,a)));let m=J(v,it(Jn(l,h),Jn(p,a)));return m=Pn(m),m[m.length-1]}(t,n,e,c)}function du(t,n){const e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function gu(t,n){if(0===t.length)return;const e=t.slice(),r=function(t){let n,e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r=0;r<t.length;r++){const o=t[r][1];(o<e[1]||o===e[1]&&t[r][0]<e[0])&&(n=r,e=t[r])}return n}(e),[o]=e.splice(r,1);e.sort((t,n)=>{let e=-hu(o,t,n);return 0!==e?e:(e=t[1]-n[1],0!==e?e:t[0]-n[0])}),e.unshift(o);const i=function(t){const n=[t[0]],e=t.length;for(let r=1;r<t.length;r++){const o=t[(r+e-1)%e],i=t[r];o[0]===i[0]&&o[1]===i[1]||n.push(i)}return n}(e),c=[];for(const t of i){for(;c.length>=2&&hu(c[c.length-2],c[c.length-1],t)<0;)c.pop();c.push(t)}if(n||c.length<3)return c;const s=[];{const t=c.length;for(let n=0;n<t;n++){const e=(n+1)%t,r=c[(n+t-1)%t],o=c[n],i=c[e];(0!==hu(r,o,i)||vu(r,o,i)<0)&&s.push(o)}}return s}function vu(t,n,e){const r=n[0]-t[0],o=n[1]-t[1];return r*(e[0]-n[0])+o*(e[1]-n[1])}const mu=gu,xu=Ut,bu=et,wu=J,_u=jn,Mu=Math.abs,Su=Ye(3);const Nu=Math.abs;const Iu=Math.abs,yu=jn,Eu=Ut,Ou=et,Cu=J,Tu=Math.abs,Pu=Fe(1),Au=Ye(3);function ku(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓ:n,vₓᵧ:e,vᵧᵧ:r,vₓ:o,vᵧ:i,v:f}=function(t){const[[n,e,r],[o,i,c]]=so(t),s=n*i-e*o,u=n*c-r*o;return{vₓₓ:-o*o,vₓᵧ:2*n*o,vᵧᵧ:-n*n,vₓ:i*s-2*o*u,vᵧ:2*n*u-e*s,v:s*(e*c-r*i)-u*u}}(t),{vₓₓ_:l,vₓᵧ_:a,vᵧᵧ_:p,vₓ_:h,vᵧ_:d,v_:g}=function(t){const[n,e]=t[0],[[r,o],[i,c]]=function(t){const[[n,e],[r,o],[i,c]]=t,s=Nu(n),u=Nu(r),f=Nu(i),l=Nu(e),a=Nu(o);return[[f+s+2*u,2*(u+s),0],[Nu(c)+l+2*a,2*(a+l),0]]}(t),s=Iu(n),u=Iu(e),f=r*c+o*i,l=r*u+s*i;return{vₓₓ_:i*i,vₓᵧ_:2*r*i,vᵧᵧ_:r*r,vₓ_:c*f+2*i*l,v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,Yu=et,Lu=J,Xu=Math.abs,Hu=Fe(1),Du=Ye(3);function Vu(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓₓ:n,vₓₓᵧ:e,vₓᵧᵧ:r,vᵧᵧᵧ:o,vₓₓ:i,vₓᵧ:f,vᵧᵧ:l,vₓ:a,vᵧ:p,v:h}=function(t){const[[n,e,r,o],[i,c,s,u]]=co(t),f=n*s,l=r*i,a=n*c,p=e*i,h=n*n,d=i*i,g=n*u-o*i,v=f-l,m=a-p,x=e*u-o*c,b=e*s-r*c,w=r*u-o*s,_=2*v,M=g*g,S=g*b,N=_*x,I=m*x,y=-3*g-b,E=-3*M-2*S+(N+m*w),O=2*(g*v-I),C=g*m-v*v+m*b;return{vₓₓₓ:-i*d,vₓₓᵧ:3*n*d,vₓᵧᵧ:-3*i*h,vᵧᵧᵧ:n*h,vₓₓ:y*d+m*(s*i-c*c)+_*c*i,vₓᵧ:2*(m*(e*c-(l+f)/2)-(y*n*i+v*(p+a))),vᵧᵧ:y*h+m*(r*n-e*e)+_*e*n,vₓ:i*E+(c*O+s*C),vᵧ:-n*E-(e*O+r*C),v:g*(N-M-S)+(C*w-I*x)}}(t),{vₓₓₓ_:d,vₓₓᵧ_:g,vₓᵧᵧ_:v,vᵧᵧᵧ_:m,vₓₓ_:x,vₓᵧ_:b,vᵧᵧ_:w,vₓ_:_,vᵧ_:M,v_:S}=function(t){const[n,e]=t[0],[[r,o,i],[c,s,u]]=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Nu(n),l=Nu(r),a=Nu(i),p=Nu(s),h=Nu(e),d=Nu(o),g=Nu(c);return[[p+f+3*(l+a),3*(a+f+2*l),3*(l+f),0],[Nu(u)+h+3*(d+g),3*(g+h+2*d),3*(d+h),0]]}(t),f=Bu(n),l=Bu(e),a=r*u,p=i*c,h=r*s,d=o*c,g=r*r,v=c*c,m=r*l+f*c,x=a+p,b=h+d,w=o*l+f*s,_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u(e,m),b=Yu(r,r),w=Yu(r,b),_=Yu(r,m),M=Yu(e,b),S=Yu(e,r),N=Yu(o,x),I=Yu(i,_),y=Yu(f,M),E=Yu(l,w),O=Yu(a,m),C=Yu(p,S),T=Yu(h,b),P=Yu(e,d),A=Yu(r,g),k=Lu(N,I),B=Lu(y,E),z=Lu(k,B),F=Lu(O,C),Y=Lu(F,T),L=Lu(z,Y),X=Lu(P,A),H=Lu(X,v);return 0===ct(Lu(L,H))}}function $u(t,n){const{coeffs:e,errBound:r,getPExact:o}=ks(t,n);return Ce(e,0,1,r,o)}const qu=Math.min,ju=Math.max;function Wu(t,n){let[[e,r],[o,i]]=t,[[c,s],[u,f]]=n;if(e>o&&([e,o]=[o,e]),c>u&&([c,u]=[u,c]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]),e<=u&&o>=c&&s<=i&&f>=r)return[[ju(e,c),ju(r,s)],[qu(o,u),qu(i,f)]]}function Qu(t,n,e){if(void 0===e)return;if(0===e.length)return[];const r=$u(n,t);if(void 0===r)return;if(0===r.length)return[];const o=r.map(n=>Re(t,[n.tS,n.tE])),i=e.map(t=>Re(n,[t.tS,t.tE])),c=[];for(let t=0;t<r.length;t++){const n=o[t];for(let o=0;o<e.length;o++){const s=Wu(n,i[o]);if(void 0!==s){const n={ri:r[t],box:s,kind:1},i={ri:e[o],box:s,kind:1};c.push([n,i])}}}return c}function Ru(t,n,e){for(const r of[t,n]){const o=r.length;for(let i=1;i<o+1;i++){const c=r[i-1],s=r[i%o],u=[s[1]-c[1],c[0]-s[0]];let f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let n=0;n<t.length;n++){const e=u[0]*t[n][0]+u[1]*t[n][1];e<f&&(f=e),e>l&&(l=e)}let a=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;for(let t=0;t<n.length;t++){const e=u[0]*n[t][0]+u[1]*n[t][1];e<a&&(a=e),e>p&&(p=e)}if(e&&(l<a||p<f))return!1;if(!e&&(l<=a||p<=f))return!1}}return!0}const Gu=Jn,Uu=J,Zu=Number.EPSILON/2,Ju=Math.abs;function Ku(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=Ju(3*r)+Ju(f)+(Ju(3*i)+Ju(l))+Ju(a);if(Ju(a)-Zu*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=Ju(3*o)+Ju(h)+(Ju(3*c)+Ju(d))+Ju(g);return!(Ju(g)-Zu*v>0)&&0===ct(it(Uu([s],Gu(3,r)),Uu([n],Gu(3,i))))&&0===ct(it(Uu([u],Gu(3,o)),Uu([e],Gu(3,c))))}const tf=lt,{abs:nf}=Math;function ef(t){const[[n,e],[r,o],[i,c]]=t,s=n+i,u=s-2*r,f=nf(s)+nf(u);if(nf(u)-f>0)return!1;const l=e+c,a=l-2*o,p=nf(l)+nf(a);return!(nf(a)-p>0)&&0===ct(it(tf(n,i),[2*r]))&&0===ct(it(tf(e,c),[2*o]))}function rf(t){const n=t[0][0],e=t[0][1];for(let r=1;r<t.length;r++)if(n!==t[r][0]||e!==t[r][1])return!1;return!0}function of(t){return 4===t.length&&Ku(t)&&(t=Hc(t)),3===t.length&&ef(t)&&(t=[t[0],t[2]]),2===t.length&&rf(t)&&(t=[t[0]]),t}const cf=Number.EPSILON,sf=cf/2;function uf(t,n){return n<0?t<1?t:1-sf:0===n?1:t>1?t:1+cf}function ff(t){const n=function(t){const n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!1),Array.from(new Uint8Array(n))}(t),e=n[0],r=n[1],o=e>>7,i=((127&e)<<4)+((240&r)>>4),c=0===i?0:16,s=0===i?i-1022:i-1023,u=n.slice(1);return u[0]=(15&r)+c,{sign:o,exponent:s,significand:u}}function lf(t){return ff(t).significand}function af(t){return Math.log2(t&-t)}function pf(t){if(0===t||!Number.isFinite(t))return NaN;const n=lf(t),e=n.length;for(let t=e-1;t>=0;t--){if(0===n[t])continue;const r=af(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function hf(t){return t>=128?7:t>=64?6:t>=32?5:t>=16?4:t>=8?3:t>=4?2:t>=2?1:t>=1?0:NaN}function df(t){if(0===t||!Number.isFinite(t))return NaN;const n=lf(t),e=n.length;for(let t=0;t<e;t++){const r=hf(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function gf(t){return ff(t).exponent}function vf(t){if(0===t||!Number.isFinite(t))return NaN;const n=gf(t);return df(t)-52+n}function mf(t,n){const e=(2**(53-n)+1)*t;return e-(e-t)}function xf(t,n){if(0===ct(t=Pn(t)))return[0];const e=vf(t[t.length-1]);let r=e,o=t.length-1;for(;o>0;){const i=vf(t[o-1]);if(e-i>n)break;r=i,o--}const i=Math.min(n-(e-r),53);let c=t[o];c=mf(c,i);const s=t.slice(o);return s[0]=c,s}function bf(t){return 0===t?0:df(t)-pf(t)+1}function wf(t){const n=Pn(t);if(0===ct(n))return 0;const e=n[n.length-1],r=n[0];return gf(e)-gf(r)+(53-pf(r))}function _f(t){return rt(function(t,n,e){let r=n,o=t,i=!1,c=0;e||(c=wf(o)-wf(r)+1,e=c/53+1,i=!0);let s=[1/rt(r)],u=1;for(;;){if(o=et(o,s),u>e)return i?(o=xf(o,c),o):o.slice(o.length-e,o.length);r=et(r,s),s=it([2],r),u*=2}}(t[0],t[1],2))}function Mf(t){return ct(t[0])*ct(t[1])}function Sf(t){return(n,e)=>{const r=hc(n),o=hc(e),i=hc(n.slice().reverse()),c=hc(e.slice().reverse()),s=t(r,o),u=t(i,o),f=t(r,c),l=t(i,c),a=-Mf(u),p=-Mf(l),h=_f(s),d=_f(f);return[uf(h,a),uf(d,p)]}}const Nf=Sf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[,o]=n;return[it(o,r),e]}(t[e],n[e])});function If(t,n){return Gr(et(t[0],n[1]),et(t[1],n[0]))*ct(t[1])*ct(n[1])}function yf(t){let n=-1024;for(let e=0;e<t.length;e++){const r=t[e];for(let t=0;t<r.length;t++){const e=r[t];if(0===e)continue;const o=-gf(e)+bf(e)-1;o>n&&(n=o)}}return 0===n?t.map(t=>t.map(t=>BigInt(t))):n>0?t.map(t=>t.map(t=>{if(0===t)return 0n;const e=-gf(t)+bf(t)-1;return BigInt(t*2**e)*2n**BigInt(n-e)})):t.map(t=>t.map(t=>BigInt(t*2**n)))}function Ef(t,n){if(n=n<0n?-n:n,0n===(t=t<0n?-t:t))return n;if(0n===n)return t;for(;0n!==n;){const e=n;n=t%n,t=e}return t}const Of=BigInt(2**53);function Cf(t){if(0n===t)return[0];const n=[];let e=0,r=t;for(;0n!==r;){r=t/Of;const o=t%Of;n.push(Number(o)*2**(53*e)),t=r,e++}return Pn(n)}const{round:Tf,sqrt:Pf}=Math;function Af(t){if(t<=1n){if(t<0n)throw new Error("square root of negative numbers are not allowed");return t}let n=BigInt(Tf(Pf(Number(t))));for(;;){const e=n+t/n>>1n;if(e===n)return n;n=e}}function kf(t){return t<0n?-t:t}function Bf(t){let n=0n;for(let e=0;e<t.length;e++)n+=t[e];return n}function zf(t,n){const[e,r]=Ff(t[0],n[0]),[o,i]=Ff(t[1],n[1]);if(0===If(e,o)||0===If(e,i))return e;if(0===If(r,o)||0===If(r,i))return r;throw new Error("An unexpected error occured.")}function Ff(t,n){const[e,r]=t,[o,i]=n,[c,s]=function(t){const[n,e]=yf(t).map(Bf),r=Ef(n,e);return[Cf(Af(kf(n/r))),Cf(Af(kf(e/r)))]}([o,e]);return[[it(et(i,s),et(r,c)),et(c,Mr(e))],[it(et(i,ot(s)),et(r,c)),et(c,Mr(e))]].sort(If)}function Yf(t,n){const e=hc(t),r=0===ct(e[0][0])?0:0===ct(e[1][0])?1:-1;if(-1!==r){const e=t[0][r],o=t[2][r],i=n[0][r],c=n[2][r];return Nf([[e,e],[o,o]],[[i,i],[c,c]])}return Sf(zf)(t,n)}const{round:Lf,cbrt:Xf}=Math;function Hf(t){const n=(e=t)>0n?1n:e<0n?-1n:0n;var e;if((t=kf(t))<=1n)return n*t;let r=BigInt(Lf(Xf(Number(t))));for(;;){const e=(2n*r+t/(r*r))/3n;if(e===r)return n*r;r=e}}function Df(t){return et(t,t)}const Vf=Sf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[o,i]=n,c=function(t){const[n,e]=yf(t).map(Bf),r=Ef(n,e);return[Cf(Hf(n/r)),Cf(Hf(e/r))]}([o,e]),s=Df(c[0]);return[it(et(i,Df(c[1])),et(r,s)),et(nt(3,e),s)]}(t[e],n[e])}),{EPSILON:$f}=Number,qf=$f/2+$f**2/2;function jf(t){return t>0?t-t*qf:t+t*qf}const{EPSILON:Wf}=Number,Qf=Wf/2+Wf**2/2;function Rf(t){return t>0?t+t*Qf:t-t*Qf}function Gf(t){if(0===t||1===t)return[t,t];const n=jf(jf(t)),e=function(t){return Rf(Rf(t))}(t);return[n,e]}function Uf(t,n,e,r){const o=t.ps,i=n.ps,c=[];let s=$u(o,i);if(void 0===s){const r=2**(e-47),s=function(t,n,e=!1){e||(t=of(t),n=of(n));const r=[,,Nf,Yf,Vf],[o,i]=r[t.length](t,n),[c,s]=r[t.length](n,t),u=[{tA:o,tB:0,bez:"B",start:!0},{tA:i,tB:1,bez:"B",start:!1},{tA:0,tB:c,bez:"A",start:!0},{tA:1,tB:s,bez:"A",start:!1}].sort((t,n)=>t.tA-n.tA);if(u[1].tA===u[2].tA){const n=u[1],e=n.tA,r=n.tB,o=Re(t,[e,e]);return[{p:o[0],kind:4,box:o,t1:e,ri1:{t:e,tS:e,tE:e,multiplicity:1},t2:r,ri2:{t:r,tS:r,tE:r,multiplicity:1}}]}if(u[0].bez===u[1].bez)return[];const f=u[1],l=u[2],[a,p]=Gf(f.tA),[h,d]=Gf(f.tB),[g,v]=Gf(l.tA),[m,x]=Gf(l.tB),b=Re(t,[a,p]),w=Re(n,[h,d]),_=Re(t,[g,v]),M=Re(n,[m,x]),S=Wu(b,w),N=Wu(_,M),I={t:a,tS:a,tE:p,multiplicity:1},y={t:h,tS:h,tE:d,multiplicity:1},E={t:g,tS:g,tE:v,multiplicity:1},O={t:m,tS:m,tE:x,multiplicity:1};return[{p:Ge(S),kind:5,box:S,t1:Hr(I),ri1:I,t2:Hr(y),ri2:y},{p:Ge(N),kind:5,box:N,t1:Hr(E),ri1:E,t2:Hr(O),ri2:O}]}(o,i);for(const e of s){const i=Te(o,e.ri1.tS),s=[[i[0]-r,i[1]-r],[i[0]+r,i[1]+r]],u={x:{ri:e.ri1,kind:5,box:s},curve:t},f={x:{ri:e.ri2,kind:5,box:s},curve:n};c.push([u,f])}return c}if(r&&(s=s.filter(t=>t.tS>0)),0===s.length)return[];const u=Qu(o,i,s);if(void 0===u||0===u.length)return[];for(const e of u){const r={x:e[0],curve:t},o={x:e[1],curve:n};c.push([r,o])}return c}const Zf=Fe(1);function Jf(t,n,e){const r=n.ps;if(0===t)return r[0],{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[r[0],r[0]],kind:e},curve:n};if(1===t){const o=r[r.length-1];return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[o,o],kind:e},curve:n}}const{p:o,pE:i}=function(t,n){const e=Te(t,n),r=Ae(t,[0,n]);if(4===t.length)return{p:e,pE:r.map(t=>9*Zf*t)};if(3===t.length)return{p:e,pE:r.map(t=>6*Zf*t)};if(2===t.length)return{p:e,pE:r.map(t=>3*Zf*t)};if(1===t.length)return{p:t[0],pE:[0,0]};throw new Error("The given bezier curve must be of order <= 3.")}(r,t);return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]],kind:e},curve:n}}function Kf(t,n){if(n.next===t){if(t.next===n)return;[t,n]=[n,t]}const e=t.ps,r=n.ps;if(function(t,n){if(4===t.length)return Vu(t,n);if(3===t.length)return ku(t,n);if(2===t.length)return function(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{coeffs:{vₓ:n,vᵧ:o,v:i},errorBound:{v_:u}}=Jo(t),f=Vr(e),l=Vr(r),a=Mu(c),p=Mu(s),h=Mu(n[1]),d=Mu(o[1]),g=a/3,v=p/3,m=n[1]*c,x=_u(f,n),b=h*g+2*Mu(m),w=o[1]*s,_=_u(l,o),M=d*v+2*Mu(w),S=xu(x,_),N=b+M+Mu(S[1]),I=xu(S,i),y=N+u+Mu(I[1]);if(Su*y<Mu(rt(I)))return!1}{const n=function(t){return bc(vc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];const{vₓ:o,vᵧ:i,v:f}=n,l=bu(e,o),a=bu(r,i);return 0===ct(wu(wu(l,a),f))}}(t,n);if(1===t.length){const e=Pn(n[0]),r=Pn(n[1]);return 1===e.length&&1===r.length&&e[0]===t[0][0]&&r[0]===t[0][1]}throw new Error("The given bezier curve must be of order <= 3")}(e,r[r.length-1].map(t=>[t]))){const i=Qu(e,r,[(o=1,{t:o,tS:o,tE:o,multiplicity:1})]);if(void 0===i||0===i.length)return;return[[{x:i[0][0],curve:t},Jf(1,n,1)]]}var o}function tl(t){return t[t.length-1]<0?ot(t):t}function nl(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}Number.EPSILON;const el=Number.EPSILON/2;function rl(t,n,e,r){const o=t/n,i=Math.abs(t),c=Math.abs(n),s=c-r;return s<=0?{est:o,err:Number.POSITIVE_INFINITY}:{est:o,err:(c*e+i*r)/s**2+el*Math.abs(i/c)}}function ol(t){const n=t[0],e=t[1];if(0===e)return[0,0];const r=Math.sqrt(e),o=r*r,i=134217729*r,c=i-(i-r),s=r-c,u=.5*(e-o-(s*s-(o-c*c-c*s*2))+n)/r;return[u-(r+u-r),r+u]}const{abs:il}=Math;const cl=Math.abs,sl=Fe(1);function ul(t){const{coeffs:[[n,e,r],[o,i,c]],errorBound:[[s,u],[f,l]]}=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s-n,l=r-i,a=f+3*l,p=i+n,h=p-2*r,d=r-n,g=u-e,v=o-c,m=g+3*v,x=c+e,b=x-2*o,w=o-e;return{coeffs:[[a,3*h,3*d,n],[m,3*b,3*w,e]],errorBound:[[il(f)+6*il(l)+il(a),6*(il(p)+il(h)),6*il(d),0],[il(g)+6*il(v)+il(m),6*(il(x)+il(b)),6*il(w),0]]}}(t),a=cl(n),p=cl(e),h=cl(r),d=cl(o),g=cl(i),v=cl(c),m=e*o,x=n*i,b=n*c,w=r*o,_=e*c,M=r*i,S=u*d+p*f+cl(m),N=s*g+a*l+cl(x),I=s*v+cl(b),y=h*f+cl(w),E=u*v+cl(_),O=h*l+cl(M),C=m-x,T=cl(C),P=S+N+T,A=w-b,k=cl(A),B=y+I+k,z=_-M,F=cl(z),Y=E+O+F,L=C*C,X=C*A,H=z*C,D=A*A,V=H+D;return{coeffs:[L,X,V],errBound:[2*P*T+cl(L),P*k+T*B+cl(X),Y*T+F*P+cl(H)+(2*k*B+cl(D))+cl(V)].map(t=>sl*t)}}const fl=et,ll=J;function al(t){const[[n,e,r],[o,i,c]]=dc(t),s=fl(e,o),u=fl(n,i),f=fl(n,c),l=fl(r,o),a=fl(e,c),p=fl(r,i),h=it(s,u),d=it(l,f),g=it(a,p),v=fl(h,h),m=fl(h,d),x=fl(h,g),b=fl(d,d);return[v,m,ll(x,b)]}const pl=it,hl=et,dl=nt,gl=Je,vl=nl,ml=ri,xl=Ut,bl=Ke,wl=zs,_l=J,Ml=at,Sl=2*Number.EPSILON,Nl=Math.abs,Il=Fe(1);function yl(t,n=!0){if(t.length<4)return[];const{coeffs:[e,r,o],errBound:[i,c,s]}=ul(t);if(Nl(e)<=i){const[[n,e],[r,o],[i,c],[s,u]]=t,f=_l(gl(s,n),dl(3,gl(r,i))),l=Ml(vl(i,n),-2*r),a=_l(gl(u,e),dl(3,gl(o,c))),p=Ml(vl(c,e),-2*o);if(0===Gr(hl(l,a),hl(f,p)))return[]}const u=r*r,f=4*e*o,l=u-f,a=2*c*Nl(r)+Il*u+(4*(i*Nl(o)+Nl(e)*s)+Il*Nl(f))+Il*Nl(l);if(l<-a)return[];if(l>a){const{est:t,err:u}=function(t,n){if(t-n<=0){const e=t>0?Math.sqrt(t):0;return{est:e,err:Math.max(Math.sqrt(t+n)-e,e)}}const e=Math.sqrt(t),r=Math.sqrt(t-n),o=Math.sqrt(t+n);return{est:e,err:Math.max(Math.abs(r-e),Math.abs(o-e))}}(l,a);let f;f=r>=0?-r-t:-r+t;const p=c+u+Il*Nl(f),{est:h,err:d}=rl(f,2*e,p,2*i),{est:g,err:v}=rl(2*o,f,2*s,p);if(n){if(h+d<0||h-d>1||g+v<0||g-v>1)return[]}else if((h+d<0||h-d>1)&&(g+v<0||g-v>1))return[]}let[p,h,d]=al(t);const g=pl(hl(h,h),dl(4,hl(p,d))),v=ct(g);if(v<0)return[];if(v>0){const t=ol(Vr(g));let e;p=Vr(p),h=Vr(h),d=Vr(d),e=ct(h)>=0?ml(xl(h,t)):xl(ml(h),t);let r=rt(wl(e,bl(p))),o=rt(wl(bl(d),e));if(n){if(r<-Sl||r>1+Sl||o<-Sl||o>1+Sl)return[]}else if((r<-Sl||r>1+Sl)&&(o<-Sl||o>1+Sl))return[];return[r,o]=r<o?[r,o]:[o,r],r>=0-Sl&&r<=1+Sl?o>=0-Sl&&o<=1+Sl?[r,o]:[r]:o>=0-Sl&&o<=1+Sl?[o]:[]}const m=Sr(p);if(ct(h)*ct(m)<0)return[];if(Gr(tl(h),tl(m))>0)return[];const x=Vr(h),b=Vr(m),w=wl(x,b),_=w[1]+w[0];return[_,_]}const El=Number.EPSILON;function Ol(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i)),6*(i+n-2*r)],[6*(u-e+3*(o-c)),6*(c+e-2*o)]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[2*(i-2*r+n)],[2*(c-2*o+e)]]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function Cl(t){if(4===t.length)return 0===hu(t[0],t[1],t[2])&&0===hu(t[1],t[2],t[3])&&0===hu(t[0],t[2],t[3]);if(3===t.length)return 0===hu(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}function Tl(t){if(Cl(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&Ku(t)&&(t=Hc(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=i-r,u=s-(r-n),f=c-o,l=f-(o-e);return[u*u+l*l,-(n*(u-r)-r*(s-r)+e*(l-o)-o*(f-o))]}(t);return{minima:[],maxima:Ce(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=uo(t),[[s,u],[f,l]]=Ol(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i))],[6*(u-e+3*(o-c))]]}if(t.length<=3)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=a*i,d=p*e,g=u*c,v=u*i,m=f*f,x=s*c,b=l*r,w=l*e,_=f*r,M=r*e,S=r*n,N=r*o,I=e*e,y=e*n,E=e*i,O=n*c,C=n*o,T=n*n,P=c*i,A=c*o,k=i*i,B=i*o,z=o*o,F=a*c-p*r,Y=u*r+l*c,L=g-b,X=r*r+c*c,H=E+O,D=A+k,V=S+I,$=e*o+n*i,q=T-z,j=y-B,W=M-P,Q=r*i+e*c,R=A+D,G=S+V,U=N+H,Z=E+H,J=G-R,K=H+O,tt=N+E+O,nt=2*w+_;return{inflectionPoly:[s*o-f*n,u*o+s*i-l*n-f*e,v+x-w-_,g-b],otherExtremaPoly:[T*(h-3*d)+z*(3*h-d)+2*(C*(a*e-p*i+3*(l*f-u*s))+3*s*f*j)+3*($*(m-s*s)+q*(u*f+l*s)),a*(o*(G+3*D)+n*Z)-p*(r*(3*T+z)+e*(3*y+2*B)+n*R)+3*(u*(l*q-u*C+2*(f*j-s*$))+s*(2*l*j+f*(2*(S-A)+(I-k))-s*tt)+l*(l*C+2*f*$)+m*U),a*(2*r*$+e*K+i*(4*A+R))-p*(2*r*(3*y+B)+e*(I+2*A)+i*K)+3*(u*(2*(l*j-s*tt)+f*J-u*$)+s*(2*f*W-s*Q)+l*(l*$+2*f*U+s*J)+m*Q),a*(r*(N+2*H)+c*(I+3*D))-p*(r*(3*V+R)+c*Z)+3*(u*(l*J-u*U+2*(f*W-s*Q))+s*(r*(nt-s*c)-c*(2*l*i+f*c))+l*(l*H+r*(2*f*i+l*o))+f*c*nt),X*(h-d)+2*(M+P)*F-3*(Y*(v+x-w-_)+(u*e+s*r+l*i+f*c)*L),F*X-3*Y*L]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Ce(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=(n-r)*t[r];return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=R(i,n);R(e,n)*r>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Ce(e,0,1)?.map(t=>t.t)||[]}}function Pl(t,n){const[e,r]=uo(t),[o,i]=Ol(t),c=R(e,n),s=R(r,n),u=R(o,n);return(c*R(i,n)-s*u)/Math.sqrt((c*c+s*s)**3)}const{abs:Al}=Math,kl=L(function(t){const{curves:n}=t;let e=lo(n[0].ps).minY,r=n[0];for(let t=1;t<n.length;t++){const o=lo(n[t].ps).minY,i=o.box[0][1],c=e.box[0][1];(i<c||i===c&&o.ts[0]>e.ts[0])&&(e=o,r=n[t])}return{curve:r,y:e}});function Bl(t){const{curve:n,y:e}=kl(t),r=e.ts;return r[0]<=0?[Jf(0,n,0),Jf(1,n.prev,0)]:r[1]>=1?[Jf(1,n,0),Jf(0,n.next,0)]:[{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n},{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n}]}function zl(t,n,e){const r=e-(n-Math.floor(Math.log2(Math.abs(t))))+1;return r<=0?0:e>=53?t:mf(t,r)}function Fl(t,n,e){const r=function(t,n){const e=[];for(const n of t)for(const t of n.curves)e.push(t);const r=au(e,t=>po(t.ps)[0][0],t=>po(t.ps)[1][0],function(t){return(n,e)=>{const r=n.ps,o=e.ps;if(2===r.length&&2===o.length)return function(t,n,e){let r=t.ps,o=n.ps;const i=po(r),c=po(o);if(t.next!==n&&n.next!==t){if(To(!0,i,c)){const r=Uf(t,n,e,!1);return r.length?r:void 0}return}if(n.next===t&&([t,n]=[n,t],[r,o]=[o,r]),0!==hu(r[0],r[1],o[1]))return;if(!To(!1,i,c))return;let s;return s=du(r[0],r[1])>du(o[0],o[1])?[Hr(Xr(r,o[1])[0].ri),1]:[0,Hr(Xr(o,r[0])[0].ri)],[[Jf(1,t,5),Jf(0,n,5)],[Jf(s[0],t,5),Jf(s[1],n,5)]]}(n,e,t);if(n.next===e||e.next===n)return To(!1,po(r),po(o))&&Ru(mu(r,!1),mu(o,!1),!1)?e.next===n?Uf(e,n,t,!0):Uf(n,e,t,!0):Kf(n,e);let i=To(!0,po(r),po(o));return i?(i=Ru(mu(r,!1),mu(o,!1),!0),i?Uf(n,e,t,!1):void 0):void 0}}(n)),o=[];for(const t of r)for(const n of t.u)o.push(n);return o}(t,e),o=function(t){const n=[];for(const e of t)for(const t of e.curves){const e=t.ps,r=yl(e);if(0===r.length)continue;const o=r[0]===r[1]?3:2,i=r[0]-El,c=r[0]+El,s=r[1]-El,u=r[1]+El,f=Re(e,[i,c]),l=Re(e,[s,u]);n.push([{x:{ri:{t:i,tS:i,tE:c,multiplicity:1},box:f,kind:o},curve:t},{x:{ri:{t:s,tS:s,tE:u,multiplicity:1},box:l,kind:o},curve:t}])}return n}(t),i=function(t){const n=[];for(const e of t)for(const t of e.curves)n.push([Jf(1,t,4),Jf(0,t.next,4)]);return n}(t),{extremes:c,xs:s}=function(t){const n=new Map,e=[];for(const r of t){const t=Bl(r);e.push(t),n.set(r,t)}return{extremes:n,xs:e}}(t),u=function(t,n){const e=[];for(const r of n)for(const n of r.curves){const r=n.ps,o=Tl(r),{minima:i,maxima:c}=o,s=[0,1,...i,...c];for(let o of s)Al(Pl(r,o))>1e7*2**-t&&e.push([Jf(o,n,7),Jf(o,n,7)])}return e}(e,t);let f=[...r,...o,...i,...s,...u];if("undefined"!=typeof _debug_){for(const t of r)_debug_.generated.elems.intersection.push(...t);for(const t of o)_debug_.generated.elems.intersection.push(...t);for(const t of i)_debug_.generated.elems.intersection.push(...t);for(const t of s)_debug_.generated.elems.intersection.push(...t);for(const t of u)_debug_.generated.elems.intersection.push(...t)}let l=f.map(t=>({xs:t,box:[[t[0].x.box[0][0]-n,t[0].x.box[0][1]-n],[t[0].x.box[1][0]+n,t[0].x.box[1][1]+n]],inOuts:void 0}));for(;;){const t=au(l,Yl,Ll,Po);if(!t.length)break;const n=new Map;Ao(n,t);const e=zo(n),r=Fo(l,e);l=[...Yo(e),...r]}l=function(t){return t.filter(t=>{const n=t.xs;if(2===t.xs.length){const t=n[0];if(1===t.x.kind&&t.x.ri.multiplicity%2==0)return!1}for(const n of t.xs)if(4!==n.x.kind)return!0;return!1})}(l),l=function(t,n,e){const r=Math.log2(e)-3;return t.map(t=>{const e=t.box.map(t=>t.map(t=>zl(t,n,n-r)));return{...t,box:e}})}(l,e,n),"undefined"!=typeof _debug_&&(_debug_.generated.elems.container=l);let a=0;for(const t of l){for(const n of t.xs)n.container=t;let n;({inOuts:n,ioIdx:a}=lu(t,a)),t.inOuts=n}f=f.filter(t=>void 0!==t[0].container),function(t){const n=new Map;for(const e of t)for(const t of e){const e=t.curve.loop,r=n.get(e)||[];r.length||n.set(e,r),r.push(t)}for(const t of n){const n=t[1];if(!n||!n.length)continue;n.sort((t,n)=>{let e=t.curve.idx-n.curve.idx;return 0!==e?e:(e=t.x.ri.tS-n.x.ri.tS,0!==e?e:void 0!==t.in_?-1:1)});const e=n.length;for(let t=0;t<e;t++)n[t].next=n[(t+1)%e],n[t].prev=n[(t-1+e)%e]}}(f);for(const t of l)for(const n of t.inOuts){if(-1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.next,void 0===e.in_;);t.nextOrPrev=e.in_,t.idx=t.nextOrPrev.idx}for(const t of l)for(const n of t.inOuts){if(1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.prev,void 0===e.out;);t.nextOrPrev=e.out,t.idx=t.nextOrPrev.idx}return{extremes:c,containers:l}}function Yl(t){return t.box[0][0]}function Ll(t){return t.box[1][0]}function Xl(t,n,e){Zr(t,1);const r=t.inOuts,o=r[0],i=r[r.length-1],c=1===o.dir?o:i,s=i.dir,u=0===n.idx?new Set:1===n.orientation?n.loopsIdxs:new Set;return o.orientation=s,o.parent=n,o.windingNum=n.windingNum+s,o.loopsIdxs=new Set(u),o.children=new Set,1===s&&o.loopsIdxs?.add(e.idx),i.orientation=s,i.parent=n,i.windingNum=n.windingNum+s,i.loopsIdxs=new Set(u),i.children=new Set,1===s&&i.loopsIdxs?.add(e.idx),c}function Hl(t){if(!Cl(t))return!1;const n=t.map(t=>t[0]),e=t.map(t=>t[1]);return!(Dl(n)&&Dl(e))}function Dl(t){return function(t){for(let n=1;n<t.length;n++)if(t[n-1]>t[n])return!1;return!0}(t)||function(t){for(let n=1;n<t.length;n++)if(t[n-1]<t[n])return!1;return!0}(t)}function Vl(t,n){const e=n/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[e*t[0],e*t[1]]}function $l(t){for(let n=0;n<t.length-1;n++)for(let e=n+1;e<t.length;e++)if(t[n][0]===t[e][0]&&t[n][1]===t[e][1])return!1;return!0}const{abs:ql}=Math;function jl(t,n,e){if(void 0!==t&&!rf(t)){if(2===t.length)return t;if(3===t.length){if($l(t))return Cl(t)?[t[0],t[2]]:t;if(Ql(t[0],t[2]))return;return[t[0],t[2]]}if($l(t)){const r=Wl(t);if(void 0===r)return;return function(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e][0]!==n[e][0]||t[e][1]!==n[e][1])return!1;return!0}(r,t)?t:jl(r,n,e)}if(Ql(t[0],t[3])){if(Cl(t))return;return t}if(Cl(t))return[t[0],t[3]];if(Ql(t[0],t[1])&&Ql(t[1],t[2])||Ql(t[1],t[2])&&Ql(t[2],t[3])||Ql(t[0],t[1])&&Ql(t[2],t[3]))return jl([t[0],t[t.length-1]],n,e);if(Ql(t[0],t[2])||Ql(t[1],t[3])||Ql(t[1],t[2]))return t;if(Ql(t[0],t[1])){if(du(t[1],t[2])<4*n)return[t[0],t[2],t[2],t[3]];{const r=Vl(H(t[1],t[2]),2*n),o=j(t[1],r);return Wl([t[0],e(o),t[2],t[3]])}}if(Ql(t[2],t[3])){if(du(t[2],t[1])<4*n)return[t[0],t[1],t[1],t[3]];{const r=Vl(H(t[2],t[1]),2*n),o=j(t[2],r);return Wl([t[0],t[1],e(o),t[3]])}}}}function Wl(t){return Cl(t)?[t[0],t[3]]:Ku(t)?Hc(t):t}function Ql(t,n){return t[0]===n[0]&&t[1]===n[1]}function Rl(t){return t}function Gl(t,n,e,r=!1,o=!0){const i=function(t,n,e=!0){const r=2**t*2**-n,o=e?function(t,n){return e=>{const r=zl(e[0],t,n),o=zl(e[1],t,n);return r===e[0]&&o===e[1]?e:[r,o]}}(t,n):Rl;return t=>{const n=[];for(let e=0;e<t.length;e++){let i=t[e].slice();const c=n[n.length-1],s=c?c[c.length-1]:o(t[0][0]);i[0]=s,i=i.map(t=>o(t)),Hl(i)&&(i=[i[0],i[i.length-1]]),i=jl(i,r,o),void 0!==i&&n.push(i)}const e=n.length;if(!e)return[];const i=n[e-1];return i[i.length-1]=n[0][0],n}}(e,n,o);let c=t.slice();return c=r?function(t,n,e,r=.02){const o=[];for(const i of t){const t=[];for(const o of i){const i=o.map(t=>t.map(t=>{let o,i=0,c=0,s=0;for(;!(++c>10);){i=(t+Math.random())*(1+(Math.random()-.7)*r),i=zl(i,e,n);const c=bf(i);c>s&&(s=c,o=i)}return o}));t.push(i)}o.push(t)}return o}(c,n,e,1):c,c=c.map(i),c=c.filter(t=>t.length>0),c}const Ul=L(t=>{let n=0;for(const e of t)for(const t of e)for(const e of t)for(const t of e){const e=Math.abs(t);e>n&&(n=e)}return n});function Zl(t){let n=0;for(let e=0;e<=t.length-1&&0===t[e];e++)n++;return 0!==n&&(t=t.slice(n)),t}const{max:Jl}=Math;function Kl(t,n){const e=t.length-1,r=n.length-1;if(e<0||r<0)return[];const o=e+r,i=new Array(o+1).fill(0);for(let c=0;c<e+1;c++)for(let s=0;s<r+1;s++)i[o-(c+s)]+=t[e-c]*n[r-s];return Zl(i)}function ta(t,n){const e=t.length-1,r=new Array(e+2);for(let n=0;n<e+1;n++)r[n]=t[n]/(e+1-n);return r[e+1]=n,r}const{min:na,max:ea}=Math;function ra(t,n){const e=t.length-1,r=n.length-1,o=ea(e,r),i=new Array(o+1),c=na(e,r);for(let s=0;s<=c;s++)i[o-s]=t[e-s]+n[r-s];for(let n=c+1;n<=e;n++)i[o-n]=t[e-n];for(let t=c+1;t<=r;t++)i[o-t]=n[r-t];return Zl(i)}function oa(t){let n=0;for(const e of t){const[t,r]=io(e),[o,i]=uo(e);n+=R(ta(ra(Kl(t,i),Sn(Kl(r,o))),0),1)}return n/2}function ia(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Xt(t[e],t[e+1]);return n}function ca(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=ia(t);if(256*du(t[0],t[t.length-1])<s*s){const[r,o]=Te(t,.5),s=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return ao(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function sa(t){return{ps:t,ts:[0,1]}}const{atan2:ua}=Math,fa=Gt;function la(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=Zt(fa(i,e),fa(o,r))[1],s=Ut(fa(o,e),fa(i,r))[1];return ua(c,s)}const aa=tt,pa=it,ha=lt,da=ct,ga=it,va=et,ma=nt,xa=Je,ba=nl,wa=J,_a=at,Ma=Math.abs,Sa=Fe(1),Na={order:0,realOrder:0,collinear:!0,nodeType:"n/a"},Ia={order:1,realOrder:1,collinear:!0,nodeType:"n/a"},ya={order:1,realOrder:0,collinear:!0,nodeType:"n/a"},Ea={order:2,realOrder:2,collinear:!1,nodeType:"n/a"},Oa={order:2,realOrder:2,collinear:!0,nodeType:"n/a"},Ca={order:2,realOrder:1,collinear:!0,nodeType:"n/a"},Ta={order:2,realOrder:0,collinear:!0,nodeType:"n/a"},Pa={order:3,realOrder:3,collinear:!1,nodeType:"crunode"},Aa={order:3,realOrder:3,collinear:!1,nodeType:"acnode"},ka={order:3,realOrder:3,collinear:!1,nodeType:"cusp"},Ba={order:3,realOrder:3,collinear:!1,nodeType:"explicit"},za={order:3,realOrder:3,collinear:!0,nodeType:"n/a"},Fa={order:3,realOrder:2,collinear:!1,nodeType:"n/a"},Ya={order:3,realOrder:2,collinear:!0,nodeType:"n/a"},La={order:3,realOrder:1,collinear:!0,nodeType:"n/a"},Xa={order:3,realOrder:0,collinear:!0,nodeType:"n/a"};const{abs:Ha,PI:Da}=Math;function Va(t,n=[0,1]){if(t.length<=2)return 0;const[e,r]=n;if(e===r)return 0;if(3===t.length){const n=$e(t,e,r).ps,[[o,i],[c,s],[u,f]]=n;return la([c-o,s-i],[u-c,f-s])}if(4===t.length){const n=He(t,e,r).ps,o=function(t){if(4===t.length)return Ku(t)?function(t){if(!Cl(t))return!1;const[n,e,r,o]=t,[i,c]=n,[s,u]=e,[f,l]=r,[a,p]=o,h=pa(aa(ha(s/4,f/4),3),ha(i/4,a/4)),d=pa(aa(ha(u/4,l/4),3),ha(c/4,p/4));return 0===da(pa(ha(i/2,a/2),h))&&0===da(pa(ha(c/2,p/2),d))}(t)?rf(t)?Xa:La:Cl(t)?Ya:Fa:Cl(t)?za:function(t){const{coeffs:[n,e,r],errBound:[o,i,c]}=ul(t);if(Ma(n)<=o){const[[n,e],[r,o],[i,c],[s,u]]=t,f=wa(xa(s,n),ma(3,xa(r,i))),l=_a(ba(i,n),-2*r),a=wa(xa(u,e),ma(3,xa(o,c))),p=_a(ba(c,e),-2*o);if(0===Gr(va(l,a),va(f,p)))return Ba}const s=e*e,u=4*n*r,f=s-u,l=2*i*Ma(e)+Sa*s+(4*(o*Ma(r)+Ma(n)*c)+Sa*Ma(u))+Sa*Ma(f);if(f<-l)return Aa;if(f>l)return Pa;const[a,p,h]=al(t),d=ct(ga(va(p,p),ma(4,va(a,h))));return d<0?Aa:d>0?Pa:ka}(t);if(3===t.length)return Cl(t)?ef(t)?rf(t)?Ta:Ca:Oa:Ea;if(2===t.length)return rf(t)?ya:Ia;if(1===t.length)return Na;throw new Error("The given bezier curve must be of order <= 3")}(n),[[i,c],[s,u],[f,l],[a,p]]=n,h=[s-i,u-c],d=[f-s,l-u],g=[a-f,p-l];if(0===d[0]&&0===d[1]||o.realOrder<=2)return la(h,g);const v=la(h,d)+la(d,g);return"acnode"===o.nodeType||"cusp"===o.nodeType?v<=-Da?v+2*Da:v>=+Da?v-2*Da:v:v}throw new Error("The given bezier curve must be of order <= 3.")}const{round:$a,PI:qa}=Math;const{abs:ja,max:Wa,ceil:Qa,log2:Ra}=Math;function Ga(n,e,r={}){let o;"undefined"!=typeof _debug_&&(o=performance.now()),e=e||Ul(n);const i=Qa(Ra(e)),{inclMicroCorners:c=!0,minLoopArea:s=(2**i*2**-12)**2,forceOrientationNegative:u=!1,booleanOp:f="OR",containerSizeMultiplier:l=16}=r,a=2**i*2**-46*l;(function(t){if("undefined"!=typeof _debug_)for(const n of t){_debug_.generated.elems.loopPre.push(...t),_debug_.generated.elems.loopsPre.push(t);for(const t of n){const n=po(t),e=ca(t),r=mu(t,!1);_debug_.generated.elems.bezier_.push(t),_debug_.generated.elems.looseBoundingBox_.push(n),_debug_.generated.elems.tightBoundingBox_.push(e),_debug_.generated.elems.boundingHull_.push(r)}}})(n=Gl(n,46,i,!1,!0)),n.sort(Io);const p=n.map((n,e)=>t(n,e)),{extremes:h,containers:d}=Fl(p,a,i),g={dir:void 0,idx:0,parent:void 0,children:new Set,windingNum:0,p:void 0,_x_:void 0,container:void 0,loopsIdxs:new Set,orientation:-1},v=new Set,m=new Set;for(const t of p){if(v.has(t))continue;v.add(t);const n=No(g,t),e=h.get(t)[0].container;if(0===e.inOuts.length)continue;const r=Xl(e,n,t),o=2===e.inOuts.length&&2===e.xs.length;if(o&&e.inOuts[0].nextOrPrev===e.inOuts[1])r.bezierPieces=t.beziers.map(sa),r.parent.children=r.parent.children||new Set,r.parent.children.add(r);else if(oo(r,v,m,!1),o&&void 0!==r.bezierPieces){const{bezierPieces:t}=r,n=t[t.length-1],e=t[0];if(n.ps===e.ps){const r={ps:n.ps,ts:[n.ts[0],e.ts[1]]};t.shift(),t.pop(),t.unshift(r)}}}"undefined"!=typeof _debug_&&_debug_.verbose;const x=function(t){const n=[],e=[t];for(;e.length;){const t=e.pop();0===t.windingNum&&n.push(...t.children),e.push(...t.children),0===t.windingNum&&(t.children=new Set)}return n}(g);"undefined"!=typeof _debug_&&_debug_.verbose;const b=function(t){return n=>{const e="OR"===t||"XOR"===t?[n]:[];n.used="OR"===t||"XOR"===t;const r=Array.from(n.children);for(;r.length;){const n=r.pop();if("OR"===t&&0===n.windingNum&&e.push(n),"AND"===t){const t=Co(n);(0===n.windingNum&&t||Eo(n.windingNum)>=2&&!t)&&(e.push(n),n.used=!0)}if("XOR"===t){const t=Co(n);(0===n.windingNum&&t||Eo(n.windingNum)>=2&&t)&&(e.push(n),n.used=!0)}for(const t of n.children)r.push(t)}return e}}(f),w=x.map(b).filter(t=>0!==t.length).map(n=>{const e=n[0].orientation;return n.map((n,r)=>function(n,e,r,o){const i=n.bezierPieces?.map(eo);if(void 0===i)return t([],r);const{orientation:c}=n,s=o?-1:e;return t((0===r?s:-s)*c>0?i:i.map(t=>t.toReversed()).toReversed(),r)}(n,e,r,u))}),_=[];for(let t=0;t<w.length;t++){const n=w[t].filter(t=>ja(oa(t.beziers))>s);n.length&&(n.sort((t,n)=>Io(t.beziers,n.beziers)),_.push(n))}"undefined"!=typeof _debug_&&(_debug_.generated.timing.simplifyPaths=performance.now()-o);const M=c?_:_.map(n=>n.map(n=>{const{beziers:e}=n,r=function(t,n){!function(t){$a(function(t){const n=t.length;let e=0;for(let r=0;r<n;r++){const o=t[(r-1+n)%n],i=t[r];e+=Va(i,[0,1])+la(fo(o,1),fo(i,0))}return e}(t)/(2*qa))}(t);const e=t.map(t=>t.map(t=>[t[0],t[1]])).filter(t=>ia(t)>n),r=e.length;for(let t=0;t<r;t++){const n=e[t],o=e[(t+1)%r],i=n[n.length-1],c=o[0];c[0]===i[0]&&c[1]===i[1]||(i[0]=c[0],i[1]=c[1])}return e}(e,Wa(...d.map(t=>ja(t.box[0][0]-t.box[1][0])),...d.map(t=>ja(t.box[0][1]-t.box[1][1]))));return t(r,n.idx)}));return function(t){if("undefined"!=typeof _debug_)for(const n of t)_debug_.generated.elems.loop.push(...n),_debug_.generated.elems.loops.push(n)}(M),M}const{max:Ua,abs:Za}=Math;function Ja(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Xt(t[e],t[e+1]);return n}function Ka(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}function tp(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=n[0],g=n[1],v=c-d,m=u-d,x=l-d,b=p-d,w=s-g,_=f-g,M=a-g,S=h-g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,O=6*w*_,C=6*M*S,T=6*m*b+9*x*x,P=2*v*b+18*m*x,A=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b-y+(N-I)+T+(A-P)+(S*S-C+(E-O)+k+(z-B))),5*(y+5*I+3*P-2*(T+2*A+3*N)+(C+5*O+3*B-2*(k+2*z+3*E))),4*(T-3*(P-2*A)-5*(2*I-3*N)+(k-3*(B-2*z)-5*(2*O-3*E))),3*(P-2*(2*A-5*(I-2*N))+(B-2*(2*z-5*(O-2*E)))),2*(A-5*(I-3*N)+(z-5*(O-3*E))),I-6*N+(O-6*E)]}function np(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n[0],p=n[1],h=i-a,d=s-a,g=f-a,v=c-p,m=u-p,x=l-p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I-4*(N+S)+(g*g+b+2*y-4*(_+w)),3*(N-I+(3*S-M)+(_-y+(3*w-b))),I-3*(2*S-M)+(y-3*(2*w-b)),S-M+(w-b)]}function ep(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=u*f+l*a,h=l*l+u*u;return[f*f+a*a+(h-2*p),p-h]}const{sqrt:rp}=Math;function op(t,n,e=!0){let r;if(4===t.length)r=tp(t,n);else if(3===t.length)r=np(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Xt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}r=ep(t,n)}const o=Ce(r,0,1)?.map(t=>t.t)||[];e&&(o.push(0),o.push(1));let i,c=Number.POSITIVE_INFINITY;for(const e of o){const r=Ka(t,e),o=du(r,n);o<c&&(c=o,i={p:r,t:e,d:rp(o)})}return i}const{sqrt:ip}=Math,{abs:cp}=Math;function sp(t){let n=Number.NEGATIVE_INFINITY;for(let e=0;e<t.length;e++){const r=t[e],o=cp(r[0]),i=cp(r[1]);o>n&&(n=o),i>n&&(n=i)}return n}const{max:up}=Math;function fp(t){return up(t.hL+t.hEL,t.hR+t.hER)}function lp(t,n){const e=fp(t)-fp(n);return 0!==e?e:t.tS-n.tS}class ap{compare;heap=[];constructor(t){this.compare=t}insert(t){const n=this.heap;n.push(t);let e=n.length-1;for(;;){const r=(e-1-(e+1)%2)/2;if(-1===r)return;const o=n[r];if(this.compare(t,o)<0)break;n[r]=t,n[e]=o,e=r}}popMax(){const t=this.heap,n=t[0];return t[0]=t[t.length-1],t.length--,this.swimDown(),n}swimDown(){const t=this.heap,n=t.length;let e=0;for(;;){const r=2*e+1;if(r>=n)break;const o=2*e+2,i=o>=n||this.compare(t[r],t[o])>0?r:o,c=t[i],s=t[e];if(this.compare(s,c)>0)break;t[i]=s,t[e]=c,e=i}}swapMinOrMax(t){this.heap[0]=t,this.swimDown()}static getParentIdx(t){return(t-1-(t+1)%2)/2}static getLeftChild(t){return 2*t+1}static getRightChild(t){return 2*t+2}}const{max:pp}=Math;function hp(t,n,e,r=50){if(1===t.length)return op(n,t[0]).d;if(1===n.length)return function(t,n){let e;if(4===t.length)e=tp(t,n);else if(3===t.length)e=np(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Xt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=ep(t,n)}const r=Ce(e,0,1)?.map(t=>t.t)||[];r.push(0),r.push(1);let o,i=Number.NEGATIVE_INFINITY;for(const e of r){const r=Ka(t,e),c=du(r,n);c>i&&(i=c,o={p:r,t:e,d:ip(c)})}return o}(t,n[0]).d;if(2===t.length&&2===n.length){const e=op(n,t[0]).d,r=op(n,t[t.length-1]).d;return e>r?e:r}const o=pp(sp(t),sp(n));e=e||o/1e6;const[i,c]=dp(t,0,1),s={tS:0,tE:1,hL:op(n,t[0]).d,hR:op(n,t[t.length-1]).d,hEL:i,hER:c},u=new ap(lp);u.insert(s);let f=0,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(;;){const o=u.heap[0],{tS:i,tE:c,hL:s,hR:p}=o,h=(i+c)/2,[d,g]=dp(t,i,h),[v,m]=dp(t,h,c),x=Ka(t,h),b=Xt(x,op(n,x).p),w=pp(s,b,p);if(w>a&&(a=w),l=fp(o),l-a<e)return a;if(f++>r)return a;const _={tS:i,tE:h,hL:s,hR:b,hEL:d,hER:g},M={tS:h,tE:c,hL:b,hR:p,hEL:v,hER:m};u.swapMinOrMax(_),u.insert(M)}}function dp(t,n,e){const r=(e+n)/2,o=P(t,n,r),i=P(t,r,e);return[Ja(o),Ja(i)]}function gp(t,n=!1){const e=t;let r=e;const o=[];do{n&&r===e||x(r)||o.push(r),r=r.nextOnCircle}while(r!==e);return o}function vp(t){const n=[],e=[t],r=new Set;for(;e.length>0;){const t=Yt(e.pop());if(0===t.length)continue;n.push(t);const o=t[0],i=t[t.length-1].next.prevOnCircle;r.add(o),r.add(i);const c=gp(o,!0),s=gp(i,!0),u=c.filter(t=>!r.has(t)),f=s.filter(t=>!r.has(t));for(const t of u)r.add(t);for(const t of f)r.add(t);e.push(...u,...f)}return n}class mp{datum;color=0;parent;left;right;constructor(t){this.datum=t}}class xp{compare;root;constructor(t){this.compare=t,this.root=void 0}isEmpty(){return void 0===this.root}find(t){let n=this.root;for(;n;){const e=this.compare(t,n.datum);if(0===e)return n;n=e<0?n.left:n.right}}insert(t){if(void 0===this.root)return this.root=new mp(t),void(this.root.color=1);let n,e=this.root;for(;e;){n=e;const r=this.compare(t,e.datum);if(0===r)return void(e.datum=t);e=r<0?e.left:e.right}const r=new mp(t);r.parent=n,this.compare(t,n.datum)<0?n.left=r:n.right=r,this.fixInsert(r)}remove(t,n=!1,e){const r=this.find(t);if(void 0===r)return;const o=r.datum;return this.removeNode(r),o}findBounds(t){let n=this.root;const e=[void 0,void 0];for(;n;)this.compare(t,n.datum)>=0?(e[0]=n,n=n.right):(e[1]=n,n=n.left);return e}getMinNode(t){let n=void 0===t?this.root:t;for(;n&&n.left;)n=n.left;return n}getMaxNode(t){let n=void 0===t?this.root:t;for(;n&&n.right;)n=n.right;return n}removeNode(t){let n,e,r=t,o=r.color;void 0===t.left?(n=t.right,e=t.parent,this.transplant(t,t.right)):void 0===t.right?(n=t.left,e=t.parent,this.transplant(t,t.left)):(r=this.getMinNode(t.right),o=r.color,n=r.right,r.parent===t?(e=r,n&&(n.parent=r)):(e=r.parent,this.transplant(r,r.right),r.right=t.right,r.right.parent=r),this.transplant(t,r),r.left=t.left,r.left.parent=r,r.color=t.color),1===o&&this.fixDelete(n,e)}fixInsert(t){let n=t;for(;n.parent&&0===n.parent.color;){const t=n.parent,e=t.parent;if(t===e.left){const r=e.right;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.right&&(n=t,this.rotateLeft(n)),n.parent.color=1,e.color=0,this.rotateRight(e))}else{const r=e.left;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.left&&(n=t,this.rotateRight(n)),n.parent.color=1,e.color=0,this.rotateLeft(e))}}this.root.color=1}fixDelete(t,n){let e=t,r=n;for(;e!==this.root&&1===this.colorOf(e)&&void 0!==r;)if(e===r?.left){let t=r.right;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateLeft(r),t=r.right),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=e?.parent):(1===this.colorOf(t?.right)&&(t?.left&&(t.left.color=1),t&&(t.color=0,this.rotateRight(t)),t=r.right),t&&(t.color=r.color),r.color=1,t?.right&&(t.right.color=1),this.rotateLeft(r),e=this.root,r=void 0)}else{let t=r?.left;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateRight(r),t=r.left),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=r?.parent):(1===this.colorOf(t?.left)&&(t?.right&&(t.right.color=1),t&&(t.color=0,this.rotateLeft(t)),t=r?.left),t&&(t.color=r.color),r.color=1,t?.left&&(t.left.color=1),this.rotateRight(r),e=this.root,r=void 0)}e&&(e.color=1)}transplant(t,n){void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n&&(n.parent=t.parent)}rotateLeft(t){const n=t.right;t.right=n.left,n.left&&(n.left.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}rotateRight(t){const n=t.left;t.left=n.right,n.right&&(n.right.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}colorOf(t){return t?t.color:1}}function bp(t){const n=new Map;return h(t).forEach(function(t){const e=t.pointOnShape.curve.loop;let r=n.get(e);r||(r=new xp(bn),n.set(e,r)),r.insert(t)}),n}const{max:wp}=Math;function _p(t,n=.125,e=50){let r=O(t.cpNode);for(;!x(r);)r=r.next;const o=vp(r),i=new Set;for(let t=0;t<o.length;t++){const r=o[t];let c=0;for(;c<r.length;){const t=c;for(;(c++,c!==r.length)&&!(Mp(t,c,r,e)>n);)i.add(r[c])}}r=function(t,n){const e=n;do{if(t(n))return n;n=n.next}while(n!==e)}(x,r);for(const n of i)_n(t=>2!==v(t)&&!t.isHoleClosing)(n)||B(n,t.meta);return{cpNode:r,meta:{...t.meta,cpTrees:bp(r)}}}function Mp(t,n,e,r){const o=[],i=Tt(e[t],e[n].next);for(;t<n+1;t++)o.push(hp(Pt(e[t]),i,r));return wp(...o)}function Sp(t){const n=[],e=h(t);for(const t of e)w(t)&&!t.isHoleClosing&&n.push(t);return n}const Np=function(t,n,e){const r=t.get(n);return void 0!==r&&r.has(e)},Ip=function(t,n,e){let r=t.get(n);void 0===r&&(r=new Set,t.set(n,r)),r.add(e)};function yp(t){let n=t,e=t.prevOnCircle;for(;x(e);)e=e.prevOnCircle;const r=[];do{x(n)||r.push(n),n=n.nextOnCircle}while(n!==e);return r}function Ep(t,n){const e=new Map,r=new Map;return N(t,function(t){const o=r.get(t)||n*t.pointOnShape.circle.radius,i=t.next,c=function(t,n,e=.4,r=16){if(4===n.length)return an(t,n,e,r);if(3===n.length)return sn(t,n,e,r);if(2===n.length)return Ht(t,n);if(1===n.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}([0,1],Pt(t)),s=i.pointOnShape.circle.radius;if(o-c>n*s)for(const t of m(i))if(r.set(t,o-c),!i.isHoleClosing){const{center:t}=i.pointOnShape.circle;Ip(e,t[0],t[1])}}),e}function Op(t,n){let e=0;"undefined"!=typeof _debug_&&(e=performance.now());const r=function(t){const n=h(t);return n.reduce(function(t,n){return t.pointOnShape.circle.radius>=n.pointOnShape.circle.radius?t:n},n[0])}(O(t.cpNode));!function(t,n){const e=Sp(n);for(;e.length;){const r=e.pop(),{center:o}=r.pointOnShape.circle;if(!Np(t,o[0],o[1])||r.isIntersection)continue;let i=r.prevOnCircle,c=!1;for(;!c;){i=i.next;const{center:e}=i.pointOnShape.circle;if(Np(t,e[0],e[1]))if(kt(i,n))c=!0;else{if(1===yp(i).length)continue;c=!0}else{for(;x(i.prevOnCircle);)i=i.prevOnCircle;c=!0}}if(c){const t=i.prevOnCircle;t.next=i,i.prev=t,t.nextOnCircle=i,i.prevOnCircle=t}}}(Ep(r,n),r);const o={cpNode:r,meta:{...t.meta,cpTrees:bp(r)}};return function(t){"undefined"!=typeof _debug_&&(_debug_.generated.timing.sats=performance.now()-t)}(e),o}const Cp={maxCurviness:.05,maxLength:40,applySat:!0,satScale:2,simplify:!0,simplifyTolerance:2**-4,minBezLength:2**-6,angleIncrement:15},Tp={maxCurviness:{range:[.01,3],scaleByMaxCoordinate:!1},maxLength:{range:[1,1024],scaleByMaxCoordinate:!0},angleIncrement:{range:[.1,360],scaleByMaxCoordinate:!1},satScale:{range:[1,1/0],scaleByMaxCoordinate:!1},simplifyTolerance:{range:[2**-20,2**20],scaleByMaxCoordinate:!0},minBezLength:{range:[2**-20,2],scaleByMaxCoordinate:!0}};function Pp(t){return[t[1],-t[0]]}function Ap(t,n){if(!It(n))return 0;const e=Nt(n);return e.isDull?-D(Pp(e.tangents[0]),W(H(n.p,t))):0}function kp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Bp(t){return t[0]*t[0]+t[1]*t[1]}function zp(t,n,e){return t[0]*(n[1]*e[2]-n[2]*e[1])-t[1]*(n[0]*e[2]-n[2]*e[0])+t[2]*(n[0]*e[1]-n[1]*e[0])}const Fp=function(t){const n=t[0],e=t[1],r=t[2],o=Bp,i=.5*zp([o(n),n[1],1],[o(e),e[1],1],[o(r),r[1],1]),c=.5*zp([n[0],o(n),1],[e[0],o(e),1],[r[0],o(r),1]),s=zp([n[0],n[1],1],[e[0],e[1],1],[r[0],r[1],1]);return[i/s,c/s]},Yp=Je,Lp=Ut,Xp=Dn,Hp=jn,Dp=Ke,Vp=tr,$p=Zt;function qp(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=Yp(c,d),m=Yp(u,d),x=Yp(l,d),b=Yp(p,d),w=Yp(s,g),_=Yp(f,g),M=Yp(a,g),S=Yp(h,g),N=Hp(v,v),I=Xp(6,Hp(v,m)),y=Xp(6,Hp(v,x)),E=Dp(Hp(v,b)),O=Xp(9,Hp(m,m)),C=Xp(18,Hp(m,x)),T=Xp(6,Hp(m,b)),P=Xp(9,Hp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Wp(N,Gp(I)),C=Wp(x,Gp(b));return[Wp(Up(Wp(Wp(E,M),Gp(O)),Zp(Wp(y,S))),Up(Wp(Wp(_,v),Gp(C)),Zp(Wp(w,m)))),Qp(3,Wp(Wp(Up(y,O),Up(Qp(3,S),M)),Wp(Up(w,C),Up(Qp(3,m),v)))),Wp(Up(O,Qp(3,Up(Gp(S),M))),Up(C,Qp(3,Up(Gp(m),v)))),Wp(Up(S,M),Up(m,v))]}const Kp=Gt,th=Ut,nh=mr;function eh(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=Kp(u,u),h=Kp(u,f),d=Kp(f,f),g=Kp(l,l),v=Kp(l,a),m=Kp(a,a),x=th(h,v),b=th(g,p);return[th(th(d,m),th(b,nh(x))),Zt(x,b)]}const rh=Z,oh=nt,ih=Mr,ch=Sr,sh=Z,uh=nt,fh=Mr;function lh(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const ah=Z,ph=Sr,{abs:hh}=Math;function dh(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=hh(e[0]),s=hh(e[1]),u=hh(r[0]),f=hh(r[1]),l=hh(o[0]),a=hh(o[1]),p=hh(i[0]),h=hh(i[1]),d=hh(n[0]),g=hh(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,O=6*w*_,C=6*M*S,T=6*m*b+9*x*x,P=2*v*b+18*m*x,A=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(N+I)+T+(A+P)+(S*S+C+(E+O)+k+(z+B))),5*(y+5*I+3*P+2*(T+2*A+3*N)+(C+5*O+3*B+2*(k+2*z+3*E))),4*(T+3*(P+2*A)+5*(2*I+3*N)+(k+3*(B+2*z)+5*(2*O+3*E))),3*(P+2*(2*A+5*(I+2*N))+(B+2*(2*z+5*(O+2*E)))),2*(A+5*(I+3*N)+(z+5*(O+3*E))),I+6*N+(O+6*E)]}function gh(t,n){const e=t[0],r=t[1],o=t[2],i=hh(e[0]),c=hh(e[1]),s=hh(r[0]),u=hh(r[1]),f=hh(o[0]),l=hh(o[1]),a=hh(n[0]),p=hh(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I+4*(N+S)+(g*g+b+2*y+4*(_+w)),3*(N+I+(3*S+M)+(_+y+(3*w+b))),I+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function vh(t,n){const e=t[0],r=t[1],o=hh(e[0]),i=hh(e[1]),c=hh(r[0]),s=hh(r[1]),u=hh(n[0]),f=hh(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}const{abs:mh}=Math;function xh(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=mh(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=mh(n),a=mh(r),p=mh(o),h=mh(i),d=mh(c),g=mh(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(mh(u)+d)*e+m)*e+x)*e,_+(w+(g+(mh(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=mh(n),f=mh(r),l=mh(o),a=mh(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(mh(c)+l)*e+p)*e,h+(a+(mh(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=mh(n),s=mh(r);return[c+(mh(o)+c)*e,s+(mh(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}Number.EPSILON;const bh=Number.EPSILON/2,wh=function(){const t=1*bh;return t/(1-t)}(),{abs:_h}=Math,Mh=[[0,0],[0,0]];const{min:Sh,max:Nh}=Math;function Ih(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=ln(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*bh*r[0][0],f=9*bh*r[1][0],l=9*bh*r[2][0],a=9*bh*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*bh*r[0][1],m=9*bh*r[1][1],x=9*bh*r[2][1],b=9*bh*r[3][1],w=Sh(o-u,i-f,c-l,s-a),_=Nh(o+u,i+f,c+l,s+a);return[[w,Sh(p-v,h-m,d-x,g-b)],[_,Nh(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=Qt(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*bh*r[0][0],u=5*bh*r[1][0],f=5*bh*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*bh*r[0][1],d=5*bh*r[1][1],g=5*bh*r[2][1],v=Sh(o-s,i-u,c-f),m=Nh(o+s,i+u,c+f);return[[v,Sh(l-h,a-d,p-g)],[m,Nh(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:Mh}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=_h(n),l=_h(o),a=_h(c),p=_h(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(_h(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=_h(n),l=_h(o),a=_h(c),p=_h(i);return{ps:u,_ps:[[f*(a+l)+l,f*(_h(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=_h(n),a=_h(e),p=_h(i),h=_h(s),d=_h(c),g=_h(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*bh*r[0][0],s=3*bh*r[1][0],u=e[0][1],f=e[1][1],l=3*bh*r[0][1],a=3*bh*r[1][1],p=Sh(o-c,i-s),h=Nh(o+c,i+s);return[[p,Sh(u-l,f-a)],[h,Nh(u+l,f+a)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Ka(t,n);let i;if(4===t.length)i=xh(t,[0,n]).map(t=>8*wh*t);else if(3===t.length)i=xh(t,[0,n]).map(t=>5*wh*t);else if(2===t.length)i=xh(t,[0,n]).map(t=>2*wh*t);else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}const yh=jn,Eh=Ut,Oh=Zt,Ch=Je,Th=Xo;function Ph(t,n){if(0===n[0]&&0===n[1])return t[0].map(t=>[0,t]);if(0===n[0]&&1===n[1])return t[t.length-1].map(t=>[0,t]);if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=Th(yh(Ch(o,e),n),e),a=Th(yh(Ch(c,o),n),o),p=Th(yh(Ch(u,c),n),c),h=Eh(l,yh(Oh(a,l),n)),d=Eh(a,yh(Oh(p,a),n)),g=Eh(h,yh(Oh(d,h),n)),v=Th(yh(Ch(i,r),n),r),m=Th(yh(Ch(s,i),n),i),x=Th(yh(Ch(f,s),n),s),b=Eh(v,yh(Oh(m,v),n)),w=Eh(m,yh(Oh(x,m),n));return[g,Eh(b,yh(Oh(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=Eh([0,e],yh(Ch(o,e),n)),f=Eh([0,o],yh(Ch(c,o),n)),l=Eh(u,yh(Oh(f,u),n)),a=Eh([0,r],yh(Ch(i,r),n)),p=Eh([0,i],yh(Ch(s,i),n));return[l,Eh(a,yh(Oh(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Th(yh(Ch(o,e),n),e),Th(yh(Ch(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}const Ah=Je,kh=jn,Bh=Ut,zh=Number.EPSILON;function Fh(t,n){const[e,r]=t,[o,i]=n,c=Je(e,o),s=Je(r,i);return Ut(jn(c,c),jn(s,s))[1]}const Yh=Number.EPSILON;function Lh(t,n,e){const[r,o]=e,{ps:i}=t,c=[];if(r!==o){const{polyDd:e,polyE:s,getPolyExact:u}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:qp(t,n),polyE:dh(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=rh(c,d),m=rh(u,d),x=rh(l,d),b=rh(p,d),w=rh(s,g),_=rh(f,g),M=rh(a,g),S=rh(h,g),N=et(v,v),I=oh(6,et(v,m)),y=oh(6,et(v,x)),E=ih(et(v,b)),O=oh(9,et(m,m)),C=oh(18,et(m,x)),T=oh(6,et(m,b)),P=oh(9,et(x,x)),A=oh(6,et(x,b)),k=et(b,b),B=et(w,w),z=oh(6,et(w,_)),F=oh(6,et(w,M)),Y=ih(et(w,S)),L=oh(9,et(_,_)),X=oh(18,et(_,M)),H=oh(6,et(_,S)),D=oh(9,et(M,M)),V=oh(6,et(M,S)),$=et(S,S),q=J(T,P),j=J(E,C),W=J(y,O),Q=J(H,D),R=J(Y,X),G=J(F,L),U=it(J(J(k,N),J(q,W)),J(J(j,A),I)),Z=it(J(J($,B),J(Q,G)),J(J(R,V),z)),K=oh(6,J(U,Z)),tt=J(ch(J(J(q,ih(W)),oh(3,N))),J(J(A,oh(3,j)),oh(5,I))),nt=J(ch(J(J(Q,ih(G)),oh(3,B))),J(J(V,oh(3,R)),oh(5,z))),rt=oh(5,J(tt,nt)),ot=J(J(q,oh(3,it(ih(W),j))),oh(5,it(oh(3,N),ih(I)))),ct=J(J(Q,oh(3,it(ih(G),R))),oh(5,it(oh(3,B),ih(z)))),st=oh(4,J(ot,ct)),ut=it(j,ih(it(ih(W),oh(5,it(I,ih(N)))))),ft=it(R,ih(it(ih(G),oh(5,it(z,ih(B)))))),lt=oh(3,J(ut,ft)),at=it(W,oh(5,it(I,oh(3,N)))),pt=it(G,oh(5,it(z,oh(3,B))));return[K,rt,st,lt,ih(J(at,pt)),J(it(I,oh(6,N)),it(z,oh(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:Jp(t,n),polyE:gh(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=sh(e,u),a=sh(o,u),p=sh(c,u),h=sh(r,f),d=sh(i,f),g=sh(s,f),v=et(l,l),m=et(l,a),x=et(l,p),b=et(a,a),w=et(a,p),_=et(p,p),M=et(h,h),S=et(h,d),N=et(h,g),I=et(d,d),y=et(d,g),E=et(g,g),O=J(N,fh(I)),C=J(x,fh(b)),T=J(it(J(_,fh(C)),lh(J(w,m))),v),P=J(it(J(E,fh(O)),lh(J(y,S))),M),A=J(T,P),k=J(it(w,C),it(uh(3,m),v)),B=J(it(y,O),it(uh(3,S),M));return[A,uh(3,J(k,B)),J(it(O,uh(3,it(fh(S),M))),it(C,uh(3,it(fh(m),v)))),J(it(S,M),it(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:eh(t,n),polyE:vh(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=ah(e,c),f=ah(o,c),l=ah(r,s),a=ah(i,s),p=et(u,u),h=et(u,f),d=et(f,f),g=et(l,l),v=et(l,a),m=et(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(ph(x),b)),it(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}(i,n),f=Ce(e,r,o,s,u)||[];c.push(...f.map(e=>{const{tS:r,tE:o,t:c}=e,s=c<0?0:c>1?1:c,u=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=1/0,a=-1/0;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=Ah(t,u),r=Ah(n,f),o=Bh(kh(e,e),kh(r,r))[1],i=o*(1-zh),c=o*(1+zh);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(Ih(i,[r,o]),n),f=0===s?1:s;return{curve:0===s?t.prev:t,t:f,dSquaredI:u}}))}const s=e.slice();return r===o&&s.push(r),c.push(...s.map(e=>{const r=Fh(Ph(i,[0,e]).map(t=>t[0]+t[1]),n),o=[r*(1-Yh),r*(1+Yh)],c=0===e?1:e;return{curve:0===e?t.prev:t,t:c,dSquaredI:o}})),c}const{min:Xh}=Math,Hh=1+2**-20;function Dh(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];return u<o?f<i?du(t[0],n):f>s?du([o,s],n):(o-u)**2:u>c?f<i?du([c,i],n):f>s?du(t[1],n):(u-c)**2:f<i?(i-f)**2:f>s?(f-s)**2:0}function Vh(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=G(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Ih(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}return{minX:r,maxX:o}}(t),e=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=G(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Ih(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}return{minY:r,maxY:o}}(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const $h=L(Vh),{sqrt:qh}=Math;function jh(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=Ja(t);if(256*du(t[0],t[t.length-1])<s*s){const[r,o]=Ka(t,.5),s=qh((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=qh((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return Vh(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function Wh(t,n){const e=[0,1,2,3].map(e=>function(t,n){const e=du,r=n[0],o=n[1],i=e(r,o);if(0==i)return e(t,r);let c=((t[0]-r[0])*(o[0]-r[0])+(t[1]-r[1])*(o[1]-r[1]))/i;return c=Math.max(0,Math.min(1,c)),e(t,[r[0]+c*(o[0]-r[0]),r[1]+c*(o[1]-r[1])])}(n,[t[e],t[(e+1)%4]])),r=du(t[0],t[1]),o=du(t[0],t[3]);return e[0]<=o&&e[2]<=o&&e[1]<=r&&e[3]<=r?0:Math.min(...e)}const Qh=L(jh);function Rh(t,n){return Ph(t,[0,n]).map(t=>t[0]+t[1])}function Gh(t,n){t=function(t,n){const e=function(t,n){let e=1/0;for(let r=0;r<t.length;r++){const o=t[r],{curve:{ps:i},ts:c}=o,s=Ka(i,c[0]),u=Ka(i,c[1]);e=Xh(e,du(n,s),du(n,u))}return Hh*e}(t,n);return t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Dh($h(c),n)<=e&&r.push(i)}return r}(t,n,e),t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],c=i.curve.ps;Wh(Qh(c),n)<=e&&r.push(i)}return r}(t,n,e),t}(t,n);const e=[];for(let r=0;r<t.length;r++){const o=t[r],i=Lh(o.curve,n,o.ts);e.push(...i)}let r=1/0;for(let t=0;t<e.length;t++){const n=e[t].dSquaredI[1];n<r&&(r=n)}const o=[];for(let t=0;t<e.length;t++){const n=e[t];n.dSquaredI[0]<=r&&o.push(n)}return o.map(t=>{const{curve:n,t:e}=t,{ps:r}=n;return{p:Rh(r,e),t:e,curve:n,isSource:!1}})}function Uh(t,n){return n.map(n=>Gh(n,t)[0])}function Zh(t,n){return[n*t[0],n*t[1]]}function Jh(t,n,e){const r=kp(e);let o,i,c,s,u=1,f=0;do{i=j(Zh(e,u),n),c=t.map(t=>Gh(t,n)[0]),s=kp(H(i,Fp(c.map(t=>t.p)))),o=s<r,u/=2,f++}while(!o&&f<3);return{newX:i,newV:s,newPoss:c}}const{min:Kh,abs:td,asin:nd}=Math;function ed(t,n,e,r,o){const i=2**(o-32),c=[t[0],t[n],t[t.length-1]],s=[r[0],r[n],r[t.length-1]],u=[[c[0],c[1],c[2]],[c[1],c[2],c[0]],[c[2],c[0],c[1]]][e],f=[[s[0],s[1],s[2]],[s[1],s[2],s[0]],[s[2],s[0],s[1]]][e];if(_(u[0][0]))return;let l,a=0,p=function(t,n){const e=t[0][0].pointOnShape.circle.center,r=Gh(n[1],e)[0],o=[t[0][0].pointOnShape.p,r.p,t[2][1].pointOnShape.p];return Fp(o)}(u,f),h=1/0;for(;h>i&&a<10;){if(a++,l=Uh(p,f),!Number.isFinite(p[0])||!Number.isFinite(p[1]))return;const t=Fp(l.map(t=>t.p)),n=H(p,t);if(!Number.isFinite(n[0])||!Number.isFinite(n[1]))return;const e=Jh(f,p,n);p=e.newX,l=e.newPoss;const r=kp(n);h=td(r-e.newV)}const d=(Xt(p,l[0].p)+Xt(p,l[1].p)+Xt(p,l[2].p))/3,g={center:p,radius:d};let v=0;for(let t=0;t<3;t++){const n=l[t],e=W(H(n.p,p)),r=V(e);if(It(n)&&Nt(n).isDull){const t=St(n.curve.ps,n.curve.next.ps).tangents.map(V),r=nd($(t[0],e)),o=nd($(e,t[1]));let i=0;r>0&&(i+=r),o>0&&(i+=o),v+=i}else{const t=W(U(n.curve.ps,n.t));v+=td(nd($(r,t)))}}const m=[];for(let t=0;t<r.length;t++){const n=Gh(r[t],p)[0];m.push(Xt(n.p,p))}const x=Kh(...m);return{threeProngInfo:{poss:l,circle:g,δ3s:u},error:1*td(d-x)+1*v}}function rd(t){let n=t[0];const e=t[1],r=[];let o=!0;do{const t=n.pointOnShape,e=n.next.pointOnShape,i=t.curve,c=e.curve;if(o)if(o=!1,c===i&&xn(e,t)>0)r.push({curve:i,ts:[t.t,e.t]}),n=n.next;else{if(i.loop===c.loop){const n={curve:i,ts:[t.t,1]};r.push(n),od(r,i,c,e.t)}n=n.next}else o=!0,n=n.prevOnCircle}while(n!==e);return r}function od(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({curve:o,ts:[0,n]})}while(o!==e)}function id(t,n,e,r){const o={...n,order:e,order2:r},i=t.findBounds({pointOnShape:o});if(void 0!==i[0]||void 0!==i[1])return void 0===i[0]||void 0===i[1]?t.getMaxNode()?.datum:i[0].datum}function cd(t,n,e,r,o,i,c){if(void 0!==i&&!function(t,n,e){const r=xn(n,e.pointOnShape);if(r<0)return!0;if(0===r)return!1;const o=t.getMinNode();if(void 0===o)return!0;const i=o.datum;return xn(t.getMaxNode().datum.pointOnShape,n)<0&&i===e}(r,o,i.next)&&!t)return;const s={pointOnShape:o,isHoleClosing:n,isIntersection:e,id:c.id,next:void 0,prev:void 0,nextOnCircle:void 0,prevOnCircle:void 0};c.id++;const u=void 0===i?s:i,f=void 0===i?s:u.next;return f.prev=s,u.next=s,s.prev=u,s.next=f,r.insert(s),s}function sd(t,n,e,r,o,i,c){const{cpTrees:s}=o;let u=!1;const f=i.map((i,f)=>{const l=r[f],a=s.get(i.curve.loop),p={...i,circle:e,order:l,order2:0},h=void 0===c?id(a,i,l,0):c[f],d=cd(t,n,!1,a,p,h,o.lastInsertId);return void 0===d&&(u=!0),d});return u||function(t,n){n=n.slice().sort(function(t){const n=t.center;return function(t,e){let r=t.pointOnShape.p,o=e.pointOnShape.p;r=[r[0]-n[0],r[1]-n[1]],o=[o[0]-n[0],o[1]-n[1]];const i=Math.atan2(r[1],r[0]);return Math.atan2(o[1],o[0])-i}}(t));const e=n.length;for(let t=0;t<e;t++){const r=n[t];r.nextOnCircle=n[(t+1)%e],r.prevOnCircle=n[(t-1+e)%e]}}(e,f),{anyFailed:u,cpNodes:f}}const ud=Math.cos(Math.PI/180*1);function fd(t,n,e,r,o,i){const{cpTrees:c,maxCoordPowerOf2:s}=t,u=2**(s-40),f=2**(s-46),l=id(c.get(n.curve.loop),n,r,o);if(!l)return;const a=[l,l.next],{p,t:h}=n;for(const t of a){const n=t.pointOnShape.p,r=Xt(p,n);if(!(r>u)&&(D(W(H(n,t.pointOnShape.circle.center)),W(H(p,e.center)))>ud||r<f&&0!==h&&1!==h))return t}}function ld(t,n){const e=[];for(const t of n)e.push([t,t.next]);const r=function(t,n){const e=t.map(rd);let r,o=1/0;for(let i=1;i<t.length-1;i++)for(let c=0;c<3;c++){const s=ed(t,i,c,e,n);if(void 0===s)continue;const{error:u,threeProngInfo:f}=s;u<o&&(o=u,r=f)}return r}(e,t.maxCoordPowerOf2),{circle:o,poss:i,δ3s:c}=r,s=[];for(let t=0;t<3;t++)s.push(Ap(o.center,i[t]));const u=[];for(let n=0;n<i.length;n++){const e=fd(t,i[n],o,s[n],0);void 0!==e&&v(e)<=2&&!e.isHoleClosing&&u.push(e)}return{closeBysFor3Prong:u,cpNodes:0===u.length?sd(!0,!1,o,s,t,i,c.map(t=>t[0])).cpNodes:[]}}let ad=0;function pd(t,n){if(yt(n.pointOnShape))return{closeBysFor3Prong:void 0,addedCpNodes:[]};const e=[];for(;;){if(void 0===n)continue;const r=S(n);if(r.length<=2)break;const{closeBysFor3Prong:o,cpNodes:i}=ld(t,r);if(e.push(i),o.length>0)return{closeBysFor3Prong:o,addedCpNodes:e};if("undefined"!=typeof _debug_&&++ad===_debug_.directives.stopAfterThreeProngsNum)return}return{closeBysFor3Prong:void 0,addedCpNodes:e}}function hd(t){for(const n of t)return n}function dd(t,n,e,r){const o=n[0];m(o).forEach(t=>{e.delete(t),r.delete(t)}),B(o,t)}function gd(t,n,e){const r=new Map;for(let o=0;o<n.length;o++){const i=new xp(bn);r.set(t[o],i);const c=n[o];let s,u;for(const t of c){const n={center:t.p,radius:0},{curve:r}=t,o={...t,curve:r,t:1,circle:n,order:-1,order2:0},c={...t,curve:r.next,t:0,circle:n,order:1,order2:0};s=cd(!0,!1,!1,i,o,u,e),u=cd(!0,!1,!1,i,c,s,e),s.prevOnCircle=u,u.prevOnCircle=s,s.nextOnCircle=u,u.nextOnCircle=s}}return r}const vd=gu;let md;function xd(t,n){md=performance.now()}function bd(t){const n=[],e=[],r=[],o=[],i=[];for(const c of t)for(const t of c.curves){const c=t.ps,s=vd(c,!0);r.push(s);const u=$h(c);n.push(u);const f=jh(c);e.push(f);const l=St(t.ps,t.next.ps);l.isQuiteSharp?o.push(t):l.isQuiteDull&&i.push(t)}return{looseBoundingBoxes:n,tightBoundingBoxes:e,boundingHulls:r,sharpCorners:o,dullCorners:i}}function wd(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Ja(o.ps)<t||St(o.ps,o.next.ps).isQuiteSharp&&e.push({curve:o,t:1,isSource:!0,p:Rh(o.ps,1)})}return e}}function _d(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[s-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-c),3*(c+e-2*o),3*(o-e),e]]}function Md(t){const[[n,e],[r,o],[i,c]]=t;return[[i+n-2*r,2*(r-n),n],[c+e-2*o,2*(o-e),e]]}function Sd(t,n,e){const[r,o]=t,[i,c]=n,[s,u]=e,f=r-s,l=o-u;return{a0:2*(i*f+c*l),b0:f*f+l*l}}const Nd=[,,function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u],[f,l]]=e,a=f-s,p=l-u,h=r-s,d=o-u,g=i*a+c*p,v=-(a*a+p*p),m=a*h+p*d,x=2*(i*h+c*d),b=-v,w=h*h+d*d;return{A:[-2*g,x],B:[b,-2*m,w],C:[g],D:[v,m],H:[b*g,x*v,x*m-w*g]}},function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u]]=e,[[f,l],[a,p]]=Md(e),h=r-s,d=o-u,g=2*(i*f+c*a),v=i*l+c*p,m=i*h+c*d,x=f*f+a*a,b=f*l+a*p,w=h*l+d*p,_=h*h+d*d,M=2*(h*f+d*a)-(l*l+p*p),S=-M;return{A:[-g,-2*v,2*m],B:[x,2*b,S,-2*w,_],C:[g,v],D:[-2*x,-3*b,M,w],H:[x*g,b*g+3*x*v,4*(b*v-m*x),g*w+v*S-6*m*b,-2*m*S-g*_,2*m*w-v*_]}},function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u,f,l],[a,p,h,d]]=_d(e),g=r-l,v=o-d,m=i*s+c*a,x=i*u+c*p,b=i*f+c*h,w=i*g+c*v,_=s*s+a*a,M=s*u+a*p,S=s*f+a*h,N=u*u+p*p,I=u*f+p*h,y=f*f+h*h,E=s*g+a*v,O=u*g+p*v,C=f*g+h*v,T=g*g+v*v,P=2*S+N,A=2*I-2*E,k=y-2*O,B=-2*C;return{A:[-2*m,-2*x,-2*b,2*w],B:[_,2*M,P,A,k,B,T],C:[3*m,2*x,b],D:[-3*_,-5*M,-4*S-2*N,3*E-3*I,2*O-y,C],H:[3*m*_,4*(m*M+x*_),m*P+6*x*M+5*b*_,2*x*P+8*b*M-6*w*_,-m*k+x*A+3*b*P-10*w*M,-2*m*B+2*b*A-4*w*P,b*k-x*B-3*w*A-3*m*T,-2*w*k-2*x*T,-w*B-b*T]}}],{sqrt:Id,abs:yd,max:Ed}=Math;function Od(t,n,e,r,o,i){const{curve:c,ts:[s,u]}=i,{ps:f}=c,{curve:l,t:a,p}=e,h=c===l,d=0===o&&h,g=[];let v,m=!1,x=!1;if(!(s===u||d&&2===f.length||h&&3===f.length&&r)){const{A:e,B:r,H:o}=d?3===f.length?function(t,n,e){const[[r,o],[i,c]]=Md(e),[s,u]=n,f=r*t+o,l=i*t+c,a=r*r+i*i,p=2*(s*r+u*i);return{A:[-p],B:[a,2*(r*f+i*l),f*f+l*l],H:[a*p,p*(a*t+(r*o+i*c))]}}(a,n,f):function(t,n,e){const[r,o]=n,[[i,c,s],[u,f,l]]=_d(e),a=r*i+o*u,p=r*c+o*f,h=r*s+o*l,d=i*i+u*u,g=i*c+u*f,v=i*s+u*l,m=c*c+f*f,x=c*s+f*l,b=s*s+l*l,w=t*(t*(t*a+p)+h),_=t*(t*(t*d+g)+v),M=t*(t*(t*g+m)+x),S=3*a,N=-3*d,I=-5*g+t*N,y=-4*v-2*m+t*I,E=-3*x+3*_+t*y,O=-2*a,C=2*v+m,T=2*x-2*_,P=b-2*M,A=2*g+2*t*d,k=C+t*(2*A-t*d),B=T+t*(2*k-t*A),z=3*a*d,F=4*(a*g+p*d)+4*t*z,Y=a*C+6*p*g+5*h*d+t*(4*F-6*t*z),L=2*p*C+8*h*g-6*w*d+t*(4*Y+t*(-6*F+4*t*z));return{A:[O,-2*p+2*t*O],B:[d,A,k,B,P+t*(2*B-t*k)],C:[S,2*p+t*S],D:[N,I,y,E,2*M-b+t*E],H:[z,F,Y,L,-a*P+p*T+3*h*C-10*w*g+t*(4*L+t*(-6*Y+t*(4*F-t*z)))]}}(a,n,f):function(t,n,e){if(1===e.length){const{a0:r,b0:o}=Sd(t,n,e[0]);return{A:[r],B:[o],C:[],D:[],H:[]}}return Nd[e.length](t,n,e)}(p,n,f);v=Ce(o,s,u)||[];for(let o=0;o<v.length;o++){const i=v[o],{tS:f,tE:l,t:a}=i;if(i.multiplicity>1)continue;if(l<s||f>u)continue;if(f<0)continue;const h=l>1?1:a,d=R(e,h),b=R(r,h),w=yd(d);if(Ed(w)<2**-40)continue;const _=-b/d;if(_<=0)continue;const M=[_*n[0],_*n[1]],S=Id(Bp(M));if(S<=2**(t-40))continue;const N=[p[0]+M[0],p[1]+M[1]];i.tS<=s&&i.tE>=s&&(m=!0),i.tS<=u&&i.tE>=u&&(x=!0);const I=0===h?1:h,y={curve:0===h?c.prev:c,s:I,d:S,x:N};g.push(y)}}const b=f[f.length-1];let w=0===a&&c===l.prev||1===a&&c===l;const _=[];if(0===s);else if(1===s)w||m||_.push({P:b,t:1});else if(!m){const t=Ka(f,s);_.push({P:t,t:s})}if(s!==u)if(0===u);else if(1===u)w||x||(_.push({P:b,t:1}),w=!0);else if(!x){const t=Ka(f,u);_.push({P:t,t:u})}for(let t=0;t<_.length;t++){const{P:e,t:r}=_[t],{a0:o,b0:i}=Sd(p,n,e);if(yd(o)<=2**-40||yd(i)<=2**-40)continue;const s=-i/o;if(s<2**-40)continue;const u=[s*n[0],s*n[1]],f=Id(Bp(u)),l=[p[0]+u[0],p[1]+u[1]],a=0===r?1:r,h={curve:0===r?c.prev:c,s:a,d:f,x:l};g.push(h)}return g}const{abs:Cd}=Math,Td=1+2**-20,Pd=1+2**-20,Ad=L(jh),kd=Gt,Bd=Ut,zd=Zt,Fd=function(t,n){const e=n[0],r=n[1],o=r*t,i=Hn*r,c=i-(i-r),s=r-c,u=Hn*t,f=u-(u-t),l=t-f,a=e*t,p=o+a,h=a-(p-o)+(s*l-(o-c*f-s*f-c*l)),d=p+h;return[h-(d-p),d]},{acos:Yd}=Math;function Ld(t,n){let e=[0,0];for(let r=0;r<t.length;r++)e=Ut(t[r],Dn(n,e));return e}const Xd=nl,Hd=Je,Dd=Dn,Vd=Ut,$d=Xo;function qd(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Dd(3,Vd(Hd(s,n),Dd(3,Hd(r,i)))),Dd(6,$d(Xd(i,n),-2*r)),Dd(3,Hd(r,n))],[Dd(3,Vd(Hd(u,e),Dd(3,Hd(o,c)))),Dd(6,$d(Xd(c,e),-2*o)),Dd(3,Hd(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[$d(Xd(2*i,2*n),-4*r),Hd(2*r,2*n)],[$d(Xd(2*c,2*e),-4*o),Hd(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[Hd(r,n)],[Hd(o,e)]]}(t);if(1===t.length)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const jd=Je,Wd=Ut,Qd=Dn,Rd=Xo;function Gd(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Qd(6,Wd(jd(s,n),Qd(3,jd(r,i)))),Qd(6,Rd(jd(i,2*r),n))],[Qd(6,Wd(jd(u,e),Qd(3,jd(o,c)))),Qd(6,Rd(jd(c,2*o),e))]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[Rd(jd(2*i,4*r),2*n)],[Rd(jd(2*c,4*o),2*e)]]}if(t.length<=2)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Ud=jn,Zd=Ut,Jd=Zt;const{sqrt:Kd}=Math;function tg(t,n,e){const{curve:r,p:o,t:i}=n,{ps:c}=r,s=1/t,u=function(t,n){const[e,r]=function(t,n){const[e,r]=qd(t),[o,i]=Gd(t),c=Ld(e,n),s=Ld(r,n),u=Ld(o,n),f=Ld(i,n),l=Jd(Ud(c,f),Ud(s,u)),a=Zd(Ud(c,c),Ud(s,s));return[l,ol(Ud(a,Ud(a,a)))]}(t,n);return zs(e,r)}(c,i),f=-(u[0]+u[1]),l=f<s?s:f,[a,p]=e,h=Kd(a*a+p*p)*l;return[[o[0]+a/h,o[1]+p/h],1/l]}const{sqrt:ng}=Math,{sin:eg,cos:rg,max:og,sqrt:ig}=Math;function cg(t){const{loops:n,maxCoordPowerOf2:e,squaredDiagonalLength:r}=t,o=(2**(e-21))**2,i=2**(e-46),c=ig(r),s=2**(e-32);return function(r,u,f,l){const{curve:{loop:a,ps:p},t:h,p:d}=l,g=function(t,n){const[e,r]=qd(t),o=Ld(r,n);return[[-o[0],-o[1]],Ld(e,n)]}(p,h),v=[-g[0][1],-g[1][1]],m=r?[0,-c]:0!==f?Q(eg(f),rg(f))(v):v;let[x,b]=function(t,n,e,r,o){let i,c;const{p:s}=r;if(n)return[[s[0],s[1]-e],e];if(0===t)return tg(e,r,o);const{p:u}=r,[f,l]=o,a=e/ng(f*f+l*l),p=[f*a,l*a];return i=[u[0]+p[0],u[1]+p[1]],c=e,[i,c]}(f,r,c,l,m);const w=function(t,n,e,r,o,i,c){const{cpTrees:s}=o;if(n)return r.filter(t=>t!==e).flatMap(t=>t.curves.map(t=>({curve:t,ts:[0,1]})));const u=It(i)&&Nt(i).isDull?1===i.t&&0===t?-1:0===i.t?1:Ap(c,i):0,f=id(s.get(e),i,u,0);return f&&f!==f.next.next?rd([f,f]):e.curves.map(t=>({curve:t,ts:[0,1]}))}(f,r,a,n,t,l,x),_=function(t,n,e,r){let o=1/0,i=[e[0]+r[0],e[1]+r[1]];for(let t=0;t<n.length;t++){const c=n[t],{ps:s}=c.curve,u=s[0],f=s[s.length-1];for(const t of[u,f]){if(du(i,t)>o)continue;const{a0:n,b0:c}=Sd(e,r,t);if(Cd(n)<=2**-40||Cd(c)<=2**-40)continue;const s=-c/n;if(s<2**-40)continue;const u=[s*r[0],s*r[1]],f=Bp(u);f<o&&(o=f,i=[e[0]+u[0],e[1]+u[1]])}}return Td*o}(0,w,d,m),M=ig(_),S=ig(m[0]**2+m[1]**2);x=[d[0]+m[0]/S*M,d[1]+m[1]/S*M],function(t,n,e){if(t.length<=2)return t;let r=0;for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Dh($h(c),n)<=Pd*e&&Wh(Ad(c),n)<=Pd*e&&(t[r]=i,r++)}t.length=r}(w,x,_);const N=function(t,n,e,r,o,i){const c=[];for(let s=0;s<i.length;s++){const u=Od(t,n,e,r,o,i[s]);c.push(...u)}let s=1/0;for(let t=0;t<c.length;t++){const n=c[t].d*(1+2**-46);n<s&&(s=n)}const u=[];for(let t=0;t<c.length;t++){const n=c[t];n.d*(1-2**-46)<=s&&u.push(n)}return u}(e,m,l,u,f,w);if(1!==N.length){if(0===N.length)return;if(!function(t){const{curve:n,s:e}=t[0];for(let r=1;r<t.length;r++){const{curve:o,s:i}=t[r];if(n!==o||e!==i)return!1}return!0}(N))return}const{x:I,d:y,curve:E,s:O}=N[0];if(u&&b<(1-s)*y)return void function(t,n,e,r){if(It(r)&&Nt(r).isDull)return;const o={radius:n,center:e};if(fd(t,r,o,Ap(o.center,r),0))return;const{anyFailed:i,cpNodes:c}=sd(!1,!1,o,[-.5,.5],t,[r,r])}(t,b,x,l);const C={curve:E,t:O,isSource:!1,p:Rh(E.ps,O)},T={center:I,radius:y},P=Fh(l.p,C.p),A=Fh(I,C.p);if(!r){if(0===P)return;if(P<=og(function(t,n,e){if(n+e>=t)return 1/0;const r=Je(t,n),o=Fd(n,r),i=t-n,c=n*i,s=(c-n*e-e*e/2)/(c+i*e),u=zs(zd(zd(o,kd(n,e)),kd(e,e/2)),Bd(o,Fd(e,r)))[1];return Yd(s),n*Yd(u)}(b,ig(A),4*i),o))return}return{circle:T,z:C}}}function sg(t,n,e,r,o){e=0===e.t?{...e,curve:e.curve.prev,t:1}:e;const i=Ap(n.center,e),c=Ap(n.center,r),s={...r,circle:n,order:c,order2:0},u={...e,circle:n,order:i,order2:0};if(fd(t,e,n,i,0))return;if(fd(t,r,n,c,0))return;const{anyFailed:f,cpNodes:l}=sd(o,o,n,[i,c],t,[u,s]);if(!f)return o&&function(t,n){const{cpTrees:e}=t,[r,o]=n,i=o.pointOnShape,c=cd(!0,!0,!1,e.get(i.curve.loop),{...i,order2:1},o,t.lastInsertId);c.holeCloserTwin=o,o.holeCloserTwin=c;const s=r.pointOnShape,u=cd(!0,!0,!1,e.get(s.curve.loop),{...r.pointOnShape,order2:-1},r.prev,t.lastInsertId);u.holeCloserTwin=r,r.holeCloserTwin=u,u.prevOnCircle=c,u.nextOnCircle=c,c.prevOnCircle=u,c.nextOnCircle=u,o.next=r,r.prev=o,u.next=c,c.prev=u}(t,l),l[0];l.forEach(n=>{void 0!==n&&k(n,t)})}const{PI:ug,atan2:fg}=Math;function lg(t,n,e,r){let o;const i=cg(t),c=n*ug/180;for(let n=0;n<e.length;n++){const s=e[n],u=ag(c,s);for(const e of u){const c=i(!1,r,e,s);if(c){const{circle:n,z:e}=c,r=sg(t,n,s,e,!1);o=o||r}if("undefined"!=typeof _debug_&&n+1===_debug_.directives.stopAfterTwoProngsNum)return}}return o}function ag(t,n){const e=[0];if(1===n.t){const{curve:r}=n,o=St(r.ps,r.next.ps);if(o.isQuiteDull){const n=Pp(o.tangents[0]),r=Pp(o.tangents[1]),i=(fg(n[1],n[0])+2*ug)%(2*ug),c=((fg(r[1],r[0])+2*ug)%(2*ug)-i+2*ug)%(2*ug);let s=t;for(;s<=c-t/2;)e.push(s),s+=t}}return e}function pg(t,n,e,r){let o;for(let i=0;i<e.length;i++){const c=lg(t,n,e[i],r);o=void 0===o?c:o}return o}function hg(t,n=.4,e=10,r=2**-16){const o=[0],i=[1];for(;;){const c=o[o.length-1],s=i[i.length-1],u=P(t,c,s),f=Ja(u),l=en(u);if(f<=e&&l<=n||s-c<=r){if(o.push(i.pop()),1===s)return o;continue}const a=(c+s)/2;i.push(a)}}function dg(t){if(t.length<4)return[];const[[n,e],[r,o],[i,c],[s,u]]=t,f=r-n,l=o-e,a=i-r-f,p=c-o-l,h=s-i-f-2*a,d=u-c-l-2*p,g=a*d-p*h,v=f*d-l*h,m=f*p-l*a;return Ce([g,v,m],0,1)?.map(t=>t.t)||[]}function gg(t,n,e){return function(r){const o=[],i=r.curves;for(let r=0;r<i.length;r++){const c=i[r],s=c.ps;if(Ja(s)<t)continue;let u=hg(s,n,e);u=2===u.length?[.5]:u,u.push(...dg(s)),u=u.filter(t=>0!==t&&1!==t);const f=u.map(t=>({curve:c,t,isSource:!0,p:Rh(c.ps,t)}));o.push(...f)}return o}}const vg=Je,mg=Ut,xg=Dn,bg=Ke,wg=tr,_g=Dn,Mg=jn,Sg=Ut,Ng=Zt;const Ig=Jn,yg=J,{abs:Eg}=Math,Og=et,Cg=Z,Tg=tt,Pg=lt;const Ag=Je,kg=Dn,Bg=jn,zg=Ut,Fg=Zt;function Yg(t){if(function(t){if(4===t.length)return 0===hu(t[0],t[1],t[2])&&0===hu(t[1],t[2],t[3])&&0===hu(t[0],t[2],t[3]);if(3===t.length)return 0===hu(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=Eg(3*r)+Eg(f)+(Eg(3*i)+Eg(l))+Eg(a);if(Eg(a)-bh*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=Eg(3*o)+Eg(h)+(Eg(3*c)+Eg(d))+Eg(g);return!(Eg(g)-bh*v>0)&&0===ct(it(yg([s],Ig(3,r)),yg([n],Ig(3,i))))&&0===ct(it(yg([u],Ig(3,o)),yg([e],Ig(3,c))))}(t)&&(t=function(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[rt(it(Tg(Pg(c/4,u/4),3),Pg(t/4,l/4))),rt(it(Tg(Pg(s/4,f/4),3),Pg(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Cg(o,e),a=Cg(i,r),p=Cg(u,c),h=Cg(f,s),d=it(Og(p,a),Og(h,l));if(0===ct(d))return;const g=Cg(c,e),v=Cg(s,r),m=rt(it(Og(v,l),Og(g,a)))/rt(d);return[c+m*rt(p),s+m*rt(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=Ag(r,n),u=Ag(i,r),f=Fg(u,s),l=Ag(o,e),a=Ag(c,o),p=Fg(a,l),h=zg(Fg(kg(n,Fg(f,[0,r])),kg(r,Fg(u,[0,r]))),Fg(kg(e,Fg(p,[0,o])),kg(o,Fg(a,[0,o]))));return[zg(Bg(f,f),Bg(p,p)),ri(h)]}(t);return{minima:[],maxima:Ce(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=qd(t),[[s,u],[f,l]]=Gd(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[xg(6,mg(vg(s,n),xg(3,vg(r,i))))],[xg(6,mg(vg(u,e),xg(3,vg(o,c))))]]}if(t.length<=3)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=Mg(a,i),d=Mg(p,e),g=Mg(u,c),v=Mg(u,i),m=Mg(f,f),x=Mg(s,c),b=Mg(l,r),w=Mg(l,e),_=Mg(f,r),M=Mg(r,e),S=Mg(r,n),N=Mg(r,o),I=Mg(e,e),y=Mg(e,n),E=Mg(e,i),O=Mg(n,c),C=Mg(n,o),T=Mg(n,n),P=Mg(c,i),A=Mg(c,o),k=Mg(i,i),B=Mg(i,o),z=Mg(o,o),F=Ng(Mg(a,c),Mg(p,r)),Y=Ng(h,d),L=Sg(Mg(u,r),Mg(l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Sg(bg(Ng(Mg(l,G),Mg(s,it))),Mg(f,rt)),Mg(u,Q))),Mg(s,Ng(bg(Mg(f,Z)),Mg(s,J)))),Sg(Mg(l,Sg(Sg(Mg(l,Q),bg(Mg(f,nt))),Mg(s,rt))),Mg(m,J)))),bt=Sg(Ng(vt,mt),xt),wt=Mg(a,Sg(Mg(r,Sg(N,bg(q))),Mg(c,Sg(I,_g(3,j))))),_t=Mg(p,Sg(Mg(r,Sg(_g(3,W),K)),Mg(c,et))),Mt=_g(3,Sg(Sg(Mg(u,Sg(Ng(Mg(l,rt),Mg(u,nt)),bg(Ng(Mg(f,Z),Mg(s,J))))),Mg(s,Ng(Mg(r,Ng(ct,Mg(s,c))),Mg(c,Sg(bg(Mg(l,i)),Mg(f,c)))))),Sg(Mg(l,Sg(Mg(l,q),Mg(r,Sg(bg(Mg(f,i)),Mg(l,o))))),Mg(f,Mg(c,ct))))),St=Sg(Ng(wt,_t),Mt),Nt=Ng(Sg(Mg(V,Y),bg(Mg($,F))),_g(3,Sg(Mg(L,D),Mg(X,H)))),It=Ng(Mg(F,V),_g(3,Mg(L,H)));return{inflectionPoly:[Ng(Mg(s,o),Mg(f,n)),Ng(Sg(Mg(u,o),Mg(s,i)),Sg(Mg(l,n),Mg(f,e))),Ng(Sg(v,x),Sg(w,_)),Ng(g,b)],otherExtremaPoly:[at,gt,bt,St,Nt,It]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Ce(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=Dn(n-r,t[r]);return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=ce(i,n);ct(et(ce(e,n),r))>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Ce(e,0,1)?.map(t=>t.t)||[]}}function Lg(t){return{curve:t.curve,t:t.t,isSource:!0,p:Rh(t.curve.ps,t.t)}}function Xg(t,n,e,r,o){(o&&(r>t.val||r===t.val&&e>t.t)||!o&&(r<t.val||r===t.val&&e>t.t))&&(t.curve=n,t.t=e,t.val=r)}const Hg=L(function(t){const n=[{curve:void 0,t:void 0,val:1/0},{curve:void 0,t:void 0,val:1/0}],e=[{curve:void 0,t:void 0,val:-1/0},{curve:void 0,t:void 0,val:-1/0}];return t.curves.forEach(function(t){const r=function(t){const n=G(t),e=Ce(n[0],0,1)?.map(t=>t.t)||[],r=Ce(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=Ka(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Ka(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}(t.ps);for(let o=0;o<2;o++)Xg(n[o],t,r.ts[0][o],r.box[0][o],!1),Xg(e[o],t,r.ts[1][o],r.box[1][o],!0)}),{minX:Lg(n[0]),minY:Lg(n[1]),maxX:Lg(e[0]),maxY:Lg(e[1])}});function Dg(t){return Hg(t).minY}function Vg(t){const{loops:n}=t,e=n.map(Dg);let r;const o=cg(t);for(let n=1;n<e.length;n++){const i=e[n],c=o(!0,!1,0,i);if(!c)throw new Error("Unable to find hole-closing 2-prong");const{circle:s,z:u}=c,f=sg(t,s,i,u,!0);r=void 0===r?f:r}return r}const $g=L(function(t){let n,e,r,o,i=1/0,c=-1/0,s=1/0,u=-1/0;for(const f of t){const t=Hg(f);t.minX.p[0]<i&&(n=t.minX,i=t.minX.p[0]),t.maxX.p[0]>c&&(e=t.maxX,c=t.maxX.p[0]),t.minY.p[1]<s&&(r=t.minY,s=t.minY.p[1]),t.maxY.p[1]>u&&(o=t.maxY,u=t.maxY.p[1])}return{minX:n,minY:r,maxX:e,maxY:o}});function qg(t,n,e){const{minBezLength:r,maxCurviness:o,maxLength:i,angleIncrement:c}=e,s=wd(r),u=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(Ja(o.ps)<t)continue;const{next:i,ps:c}=o;if(St(c,i.ps).isQuiteDull){const t=c[c.length-1];e.push({curve:o,t:1,isSource:!0,p:t}),e.push({curve:i,t:0,isSource:!0,p:t})}}return e}}(r),f=gg(r,o,i),l=function(t){return function(n){const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Ja(o.ps)<t||e.push(...Yg(o.ps).maxima.map(t=>({curve:o,t,isSource:!0,p:Rh(o.ps,t)})))}return e}}(r),a=$g(t),p=(a.maxX.p[0]-a.minX.p[0])**2+(a.maxY.p[1]-a.minY.p[1])**2,d=t.map(s),g={id:0},v=gd(t,d,g),m=bd(t),x=(xd(),{maxCoordPowerOf2:n,squaredDiagonalLength:p,loops:t,cpTrees:v,lastInsertId:g,...m});let b;if(b=Vg(x),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterHoleClosers)return{cpNode:b,meta:x};if(function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.holeClosers+=n-md,md=n}(),b=pg(x,c,t.map(u),!1)||b,b=pg(x,c,t.map(l),!0)||b,b=pg(x,c,t.map(f),!1)||b,function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.oneAnd2Prongs+=n-md,md=n}(),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterTwoProngs)return{cpNode:b,meta:x};if(b=function(t,n){if(void 0===n)return;const e=new Set;let r=!0;for(;r;){r=!1;const o=new Set(h(n));for(const n of o){const{closeBysFor3Prong:i,addedCpNodes:c}=pd(t,n);c.length>0&&(r=!0),void 0===i?e.add(n):(r=!0,dd(t,i,o,e)),c.forEach(t=>t.forEach(t=>e.add(t)))}n=hd(e)}return n}(x,b),void 0===b)return;if("undefined"!=typeof _debug_&&_debug_.directives.stopAfterThreeProngs)return{cpNode:b,meta:x};const w={cpNode:b,meta:x};return"undefined"!=typeof _debug_&&(_debug_.generated.timing.threeProngs+=performance.now()-md),w}const{ceil:jg,log2:Wg}=Math;function Qg(t,n){const{maxCoordinate:e}=function(t){let n=0,e=1/0,r=-1/0,o=1/0,i=-1/0;for(const c of t)for(const t of c)for(const c of t){const t=c[0],s=c[1],u=Ua(Za(t),Za(s));u>n&&(n=u),t<e&&(e=t),t>r&&(r=t),s<o&&(o=s),s>i&&(i=s)}return{maxCoordinate:n,width:r-e,height:i-o}}(t),r=jg(Wg(e)),o=function(t,n){const e={...n};for(const n in Tp){const r=n;let o=e[r];const i=Tp[r],{range:c,scaleByMaxCoordinate:s}=i;o<c[0]&&(o=c[0]),o>c[1]&&(o=c[1]),s&&(o*=2**(t-10)),e[r]=o}return e}(r,{...Cp,...n||{}}),{applySat:i,simplify:c,satScale:s,simplifyTolerance:u}=o,f=Ga(t,void 0,{forceOrientationNegative:!0}),l=[];for(const t of f){let n=qg(t,r,o);void 0!==n&&(i&&(n=Op(n,s)),c&&(n=_p(n,u,50)),l.push(n))}return l}function Rg(t){const n=function(t){let n=t;const e=Sp(t);for(;e.length;){const r=e.pop();if(r.isHoleClosing||r.isIntersection)continue;let o=r.next;for(;;){o=o.next;let e=!1;const r=o.prevOnCircle;if(v(o)>2){const n=o.nextOnCircle;kt(o,t)?e=!0:o.next===n?o=n:n.next!==r&&(e=!0)}else if(x(o)&&!o.isIntersection)return void(n=o);if(e){r.next=o,o.prev=r,n=o;break}}}return n}(O(t.cpNode));if(n)return{cpNode:n,meta:{...t.meta,cpTrees:bp(n)}}}let Gg=0;function Ug(t){return t.map(t=>{return(n=t.pointOnShape).p[0]+", "+n.p[1]+" | bz: "+n.curve.idx+" | t: "+n.t;var n})}function Zg(t,n=3){return t[0].toFixed(n)+", "+t[1].toFixed(n)}const Jg={δToString:Ug,δsToString:function(t){return t.map(Ug)},pointToStr:Zg,pointsToStr:function(t,n=3){return t.map(t=>Zg(t,n))},nameObj:function(t,n=""){t.name=""+n+Gg++}},Kg="red thin10 nofill ",tv="http://www.w3.org/2000/svg";function nv(t,n,e=Kg,r){const o=n.center,i=n.radius,c=document.createElementNS(tv,"circle");return c.setAttributeNS(null,"cx",o[0].toString()),c.setAttributeNS(null,"cy",o[1].toString()),c.setAttributeNS(null,"r",i.toString()),c.setAttributeNS(null,"class",e),t.appendChild(c),r&&setTimeout(()=>c.remove(),r),[c]}function ev(t,n,e=3,r="red",o){const[i]=nv(t,{center:n,radius:e},"dot "+r,o);return o&&setTimeout(()=>i.remove(),o),[i]}function rv(t,n,e=Kg,r=0,o=void 0,i=0){const c=document.createElementNS(tv,"line");c.setAttributeNS(null,"x1",n[0][0].toString()),c.setAttributeNS(null,"y1",n[0][1].toString()),c.setAttributeNS(null,"x2",n[1][0].toString()),c.setAttributeNS(null,"y2",n[1][1].toString()),c.setAttributeNS(null,"class",e),t.appendChild(c);let s=[];if(void 0!==o)for(const e of n)s.push(...ev(t,e,i,o,r));for(const n of s)t.appendChild(n);const u=[c,...s];return r&&setTimeout(()=>{for(const t of u)t.remove()},r),u}function ov(t,n,e=Kg,r=3,o){const i=nv(t,{center:n,radius:r},e),c=[[n[0]-r,n[1]],[n[0]+r,n[1]]],s=[[n[0],n[1]-r],[n[0],n[1]+r]],u=rv(t,c,e),f=rv(t,s,e);return o&&setTimeout(()=>{i.forEach(t=>t.remove()),u.forEach(t=>t.remove()),f.forEach(t=>t.remove())},o),[...i,...u,...f]}function iv(t){return 2===t?"L":3===t?"Q":4===t?"C":void 0}function cv(t,n,e=Kg,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p]]=n,h=document.createElementNS(tv,"path");h.setAttributeNS(null,"d",`M${s} ${u} Q${f} ${l} ${a} ${p}`),e&&h.setAttributeNS(null,"class",e);let d=[];if(void 0!==o)for(const e of n)d.push(...ev(t,e,i,o,r));let g=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)g.push(...rv(t,[n[e],n[e+1]],c,r));const v=[h,...d,...g];for(const n of v)t.appendChild(n);return r&&setTimeout(()=>{for(const t of v)t.remove()},r),v}function sv(t,n,e=Kg,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p],[h,d]]=n;if(s===h&&f===h&&a===h&&u===d&&l===d&&p===d)return ov(t,[s,u],e,.2,r);const g=document.createElementNS(tv,"path");g.setAttributeNS(null,"d",`M${s} ${u} C${f} ${l} ${a} ${p} ${h} ${d}`),g.setAttributeNS(null,"class",e);let v=[];if(void 0!==o)for(const e of n)v.push(...ev(t,e,i,o,r));let m=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)m.push(...rv(t,[n[e],n[e+1]],c,r));const x=[g,...v,...m];for(const n of x)t.appendChild(n);return r&&setTimeout(()=>{for(const t of x)t.remove()},r),x}function uv(t,n,e=Kg,r=0,o=void 0,i=0,c=void 0){return 2===n.length?rv(t,n,e,r,o,i):3===n.length?cv(t,n,e,r,o,i,c):4===n.length?sv(t,n,e,r,o,i,c):[]}const fv=["red","green","cyan","blue"];function lv(t,n){const e=1-n;if(4===t.length){const[[r,o],[i,c],[s,u],[f,l]]=t;return[r*e**3+3*i*e**2*n+3*s*e*n**2+f*n**3,o*e**3+3*c*e**2*n+3*u*e*n**2+l*n**3]}if(3===t.length){const[[r,o],[i,c],[s,u]]=t;return[r*e**2+2*i*e*n+s*n**2,o*e**2+2*c*e*n+u*n**2]}if(2===t.length){const[[r,o],[i,c]]=t;return[r*e+i*n,o*e+c*n]}return[NaN,NaN]}function av(t,n){return 2===t.length?function(t,n){const[[e,r],[o,i]]=t,c=1-n,s=[c*e+n*o,c*r+n*i];return[[[e,r],s],[s,[o,i]]]}(t,n):3===t.length?function(t,n){const[[e,r],[o,i],[c,s]]=t,u=1-n,f=[u*u*e+2*u*n*o+n*n*c,u*u*r+2*u*n*i+n*n*s];return[[[e,r],[u*e+n*o,u*r+n*i],f],[f,[u*o+n*c,u*i+n*s],[c,s]]]}(t,n):4===t.length?function(t,n){const[[e,r],[o,i],[c,s],[u,f]]=t,l=1-n,a=n*n,p=a*n,h=l*l,d=h*l,g=[p*u+3*l*a*c+3*h*n*o+d*e,p*f+3*l*a*s+3*h*n*i+d*r];return[[[e,r],[n*o+l*e,n*i+l*r],[a*c+2*l*n*o+h*e,a*s+2*l*n*i+h*r],g],[g,[a*u+2*n*l*c+h*o,a*f+2*n*l*s+h*i],[n*u+l*c,n*f+l*s],[u,f]]]}(t,n):[]}const pv={circle:nv,crossHair:ov,dot:ev,line:rv,rect:function(t,n,e=Kg,r){const[[o,i],[c,s]]=n,u=o<c?o:c,f=i<s?i:s,l=Math.abs(o-c),a=Math.abs(i-s),p=document.createElementNS(tv,"rect");return p.setAttributeNS(null,"x",u.toString()),p.setAttributeNS(null,"y",f.toString()),p.setAttributeNS(null,"width",l.toString()),p.setAttributeNS(null,"height",a.toString()),e&&p.setAttributeNS(null,"class",e),t.appendChild(p),r&&setTimeout(()=>p.remove(),r),[p]},beziers:function(t,n,e,r){const o=void 0===e,i=[];for(let r=0;r<n.length;r++){const c=n[r],s=o?"thin5 nofill "+fv[r%fv.length]:e;i.push(...uv(t,c,s))}return r&&setTimeout(()=>i.forEach(t=>t.remove()),r),i},bezier:uv,bezierPiece:function(t,n,e,r=Kg,o){const i=e[0]===e[1]?ov(t,lv(n,e[0]),r,1.5):uv(t,function(t,n){if(0===n[0]&&1===n[1])return t;if(n[0]===n[1]){const e=lv(t,n[0]);return[e,e,e,e]}return 0===n[0]?av(t,n[1])[0]:1===n[1]?av(t,n[0])[1]:av(av(t,n[0])[1],(n[1]-n[0])/(1-n[0]))[0]}(n,e),r);return o&&setTimeout(()=>i.forEach(t=>t.remove()),o),i},quadBezier:cv,cubicBezier:sv,polygon:function(t,n,e=Kg,r){const o=document.createElementNS(tv,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},loop:function(t,n,e=Kg,r){if(!n.length)return[];const o=document.createElementNS(tv,"path");let i=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];i+=`${iv(e.length)} `;for(let t=1;t<e.length;t++)i+=`${e[t][0]} ${e[t][1]} `}return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},polyline:function(t,n,e=Kg,r){if(n.length<2)return[];const o=document.createElementNS(tv,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},text:function(t,n,e,r,o=Kg,i){const c=document.createElementNS(tv,"text");return c.setAttributeNS(null,"x",n[0].toString()),c.setAttributeNS(null,"y",n[1].toString()),c.setAttributeNS(null,"font-size",r.toString()),c.setAttributeNS(null,"class",o),c.textContent=e,t.appendChild(c),i&&setTimeout(()=>c.remove(),i),[c]}};function hv(t,n){return(n,e,r,o=0,i=1)=>{let c,s;switch(e.isHoleClosing){case!1:c="red ",s="2";break;case!0:c="cyan ",s="10"}const{pointOnShape:u}=e,{circle:f}=u,{center:l,radius:a}=f,{isSource:p,p:h}=u,d=e.nextOnCircle.pointOnShape.p,g=p?h:d,v=p?d:h,{line:m,dot:x,circle:b,crossHair:w}=pv,_=x(n,f.center,.02*i,"yellow",o);return[...b(n,f,c+"thin"+s+" nofill",o),...x(n,g,.005*i,c,o),...x(n,v,.01*i,c,o),...t?w(n,f.center,"red thin2 nofill",.002*i,o):[],..._]}}function dv(t,n){return{center:t.center,radius:n*t.radius}}const gv=["thin10 blue nofill","thin10 red nofill"];function vv(t,n,e,r=0,o=1){let i=n.cpNode;if(!i)return[];for(;!x(i);)i=i.next;const c=[];let s=0;return N(i,n=>{if(x(n))return;const e=Pt(n);e&&(c.push(...pv.bezier(t,e,gv[s%2],r)),s++)}),c}function mv(t,n,e,r){const o=document.createElementNS("http://www.w3.org/2000/svg","circle");return o.setAttributeNS(null,"cx",n[0].toString()),o.setAttributeNS(null,"cy",n[1].toString()),o.setAttributeNS(null,"r",e.toString()+"%"),o.setAttributeNS(null,"class",r),t.appendChild(o),o}function xv(t,n,e="thin5 purple nofill",r=0,o=1){const i=[],c=[];for(const t of n){if(x(t))continue;const n=Pt(t);n&&c.push(n)}return i.push(...a(t,c,e,r)),i}const bv={oneProng:function(t,n,e,r=0,o=1){const{pointOnShape:i}=n,{circle:c}=i;return[...pv.dot(t,i.p,.02*o,"deeppink",r),...pv.dot(t,c.center,.01*o,"deeppink",r),...pv.circle(t,c,"deeppink thin5 nofill",r)]},twoProng:hv(!1),threeProng:function(t,n,e,r=0,o=1){const i=dv(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=m(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=pv,p=l(t,i,"blue thin2 nofill",r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...pv.line(t,[e,c],"thin5 red",r))}const g=a(t,i.center,"red thin2 nofill",.02*o,r);return[...h,...d,...p,...g]},boundingHull:function(t,n,e="thin5 black nofill",r=0,o=1){return pv.polygon(t,n,e,r)},looseBoundingBox:function(t,n,e="thin5 brown nofill",r=0,o=1){const[[i,c],[s,u]]=n;return n=[[i,c],[s,c],[s,u],[i,u]],pv.polygon(t,n,e,r)},tightBoundingBox:function(t,n,e="thin5 pinker nofill",r=0,o=1){return pv.polygon(t,n,"thin5 pinker nofill",r)},vertex:function(t,n,e,r=0,o=1){const i=n.pointOnShape.circle;let c=[];return c=[...pv.dot(t,i.center,.01*o,"darkgreen",r)],c},mat:vv,maxVertex:function(t,n){const e=n.pointOnShape.circle;return pv.circle(t,e,"brown thin10 nofill")},leaves:function(t,n,e="thin10 deeppink nofill",r=0,o=1){const i=[],{line:c,dot:s,circle:u}=pv;for(const f of n){const n=f.pointOnShape,{circle:l}=n,{center:a,radius:p}=l,h=[mv(t,a,.5,"pinker thin5 nofill")],d=m(f).map(t=>t.pointOnShape),g=[],v=[];for(let n=0;n<d.length;n++){const e=d[n].p;v.push(...s(t,e,.01*(n+1)*o,"pinker",r)),g.push(...c(t,[e,a],"thin5 red",r))}const x=u(t,l,e,r);i.push(...x,...v,...g,...h)}return i},cull:function(t,n,e="thin10 cyan nofill",r=0,o=1){const i=[];return i.push(...pv.crossHair(t,n,e,.1*o,r)),i},cpNode:function(t,n,e="blue thin2 nofill",r=0,o=1){const i=dv(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=m(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=pv,p=l(t,i,e,r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...pv.line(t,[e,c],"thin5 red",r))}const g=a(t,c,"orange thin10 nofill",2*o,r);return[...h,...d,...p,...g]},branch:xv,holeCloser:hv(!1)},wv={...bv,twoProng:hv(!0)};function _v(t){if(!t)return void(window._debug_=void 0);let n=window._debug_;n={...n,generated:{...n&&n.generated?n.generated:{},elems:{...n&&n.generated&&n.generated.elems?n.generated.elems:{},oneProng:[],twoProng:[],looseBoundingBox:[],tightBoundingBox:[],vertex:[],threeProng:[],boundingHull:[],mat:[],cpNode:[],maxVertex:[],leaves:[]},timing:{...n&&n.generated&&n.generated.timing?n.generated.timing:{},holeClosers:0,oneAnd2Prongs:0,threeProngs:0,sats:0,simplifyMat:0}},fs:{...n&&n.fs?n.fs:{},drawElem:{...n&&n.fs&&n.fs.drawElem?n.fs.drawElem:{},...bv},...Jg},directives:{...n&&n.directives?n.directives:{},stopAfterHoleClosers:!1,stopAfterHoleClosersNum:void 0,stopAfterTwoProngs:!1,stopAfterTwoProngsNum:void 0,stopAfterThreeProngs:!1,stopAfterThreeProngsNum:void 0}},window._debug_=n}const Mv={oneProng:[],twoProng:[],threeProng:[],looseBoundingBox:[],tightBoundingBox:[],boundingHull:[],vertex:[],mat:[],maxVertex:[],leaves:[],cull:[],cpNode:[],branch:[],holeCloser:[]},Sv=Object.keys(Mv);function Nv(t,n,e,r){const o=[];for(const r of t)o.push({type:0,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(Iv);const i=new Set,c=[];for(const t of o){const{item:n}=t;if(0===t.type){for(const t of i.values())r(n,t)&&c.push([n,t]);i.add(n)}else 1===t.type&&i.delete(t.item)}return c}function Iv(t,n){const e=t.x-n.x;return 0!==e?e:0===t.type?-1:1}const yv=1e-4;function Ev(t,n){const e=t.pointOnShape,r=n.pointOnShape;let{curve:o,p:i,t:c}=e,{curve:s,p:u,t:f}=r;if(i[0]===u[0]&&i[1]===u[1])return[i];1===c&&(c=0,o=o.next),0===f&&(f=1,s=s.prev);const{ps:l}=o,{ps:a}=s,p=[i,j(i)(W(U(l,c)))],h=[u,j(u)(W(U(a,f)))],d=X(p,h),g=H(i,u);let v;if(d){const t=H(i,d),n=H(u,d);v=D(t,g)<0||D(n,g)>0}else v=!0;if(!v)return[i,d,u];const m=H(p[0],p[1]),x=H(h[0],h[1]),b=Math.abs($(g,m))/9,w=Math.abs($(g,x))/9;return b>.01||w>.01||b>yv||w>yv?void 0:[i,u]}const Ov=L(function(t){return pn(Pt(t))});function Cv(t,n){const e=function(t){const n=new Map;for(let e of t)for(let r of t){const t=e.pointOnShape.circle.center,o=r.pointOnShape.circle.center,i=e.pointOnShape.p,c=r.pointOnShape.p;r!==e&&t[0]===o[0]&&t[1]===o[1]&&i[0]===c[0]&&i[1]===c[1]&&n.set(e,r)}return n}(n),r=t.length,o=[];for(let n=0;n<r;n++){const i=t[n],c=[];for(let o=0;o<r;o++){const r=t[o];if(n===o){c.push(0);continue}let s=1/0;for(const t of m(i)){let n=Ov(t),o=t.next;for(;!kt(o,r);)if(o.isHoleClosing)o=Tv(e,o);else{if(Mn(o)){n=1/0;break}n+=Ov(o),o=o.next}n<s&&(s=n)}c.push(s)}o.push(c)}return o}function Tv(t,n){return t.get(n).next}export{wn as CpNodeFs,e as beziersToSvgPathStr,O as clone,bn as cpNodeComparator,gd as createInitialCpTree,Sv as debugElemNames,a as drawBeziersAsSinglePath,xv as drawBranch,bv as drawElemFs,wv as drawElemFsDetailed,vv as drawMat,Mv as emptyDebugElems,_v as enableDebugForMat,M as enhanceCpNode,cg as find2Prong,Vg as findAndAddHoleClosing2Prongs,Qg as findMats,p as floydWarshall,m as getAllOnCircle,h as getAllOnLoop,mn as getAllVertices,T as getBoundaryBezierPartsToNext,hn as getBoundaryBeziersBetween,A as getBoundaryBeziersToNext,rd as getBoundaryPieceBeziers,Yt as getBranch,Lt as getBranchBeziers,vp as getBranches,z as getChildren,Gh as getCloseBoundaryPointsCertified,Dh as getClosestSquareDistanceToRect,Et as getEdgeDirection,At as getFirstExit,gg as getFor2ProngsOnLoop,Cv as getGraph,d as getHoleClosers,Ev as getImpliedBoundaryBezierBetween,vn as getInitialDegAngleBetweenMatCurves,Tt as getMatCurveBetween,Pt as getMatCurveToNext,gn as getMatCurvesBetween,bd as getPartialMeta,l as getPathsFromStr,xd as getPointToCpNode,Lh as getPotentialClosestPointsOnCurveCertified,v as getProngCount,b as getRealProngCount,dn as getSalience,Ep as getSatCulls,$g as getShapeBounds,wd as getSharpCornersOnLoop,I as getVertexForwardChildren,w as isFullyTerminating,kt as isOnSameCircle,Bt as isOneProng,_ as isSharp,x as isTerminating,Ft as isTrivial,zt as isTwoProng,Mn as isVertexSpecial,t as loopFromBeziers,B as removeVertex,dv as scaleCircle,_p as simplifyMat,Nv as sweepLine,Op as toScaleAxis,S as traverseCp,N as traverseEdges,y as traverseVertices,Rg as trimMat};
1
+ function t(t=[],e){const r=[],o={beziers:t,curves:r,idx:e};if(0===t.length)return o;let i,c=0;for(let e=0;e<t.length;e++){if(n(t[e]))continue;const s={loop:o,ps:t[e],prev:i,next:void 0,idx:c};i&&(i.next=s),i=s,r.push(s),c++}const s=r[r.length-1];return r[0].prev=s,s.next=r[0],s.ps[s.ps.length-1]=r[0].ps[0],o}function n(t){return 2===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]:3===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]:t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]&&t[2][1]===t[3][1]&&t[2][1]===t[3][1]}function e(t){const n=[];for(let e=0;e<t.length;e++){const r=t[e];0===e&&n.push("M "+r[0][0].toString()+" "+r[0][1].toString()),4===r.length?n.push("C "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "+r[3][0].toString()+" "+r[3][1].toString()+" "):3===r.length?n.push("Q "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "):2===r.length&&n.push("L "+r[1][0].toString()+" "+r[1][1].toString()+" ")}return n.push(" z"),n.join("\n")}class r{initialPoint=void 0;p;vals=void 0;prev2ndCubicControlPoint=void 0;prev2ndQuadraticControlPoint=void 0;constructor(){this.p=[0,0]}}function o(t){const n=[t.p,t.initialPoint];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n}function i(t){t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0;const n=(e=t.p,t.vals[0],t.vals[1],t.vals[2],t.vals[3],t.vals[4],[[e,[t.vals[5],t.vals[6]]]]);var e;const r=n[n.length-1];return t.p=r[r.length-1],n}const c={c:function(t){const n=[t.p,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]],[t.vals[4],t.vals[5]]];return t.prev2ndCubicControlPoint=n[2],t.prev2ndQuadraticControlPoint=void 0,n},h:function(t){const n=[t.p,[t.vals[0],t.p[1]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},l:function(t){const n=[t.p,t.vals];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},q:function(t){const n=[t.vals[0],t.vals[1]],e=[t.vals[2],t.vals[3]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},s:function(t){const n=t.prev2ndCubicControlPoint?[t.p[0]-t.prev2ndCubicControlPoint[0]+t.p[0],t.p[1]-t.prev2ndCubicControlPoint[1]+t.p[1]]:t.p,e=[t.p,n,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]]];return t.prev2ndCubicControlPoint=e[2],t.prev2ndQuadraticControlPoint=void 0,e},t:function(t){const n=t.prev2ndQuadraticControlPoint?[t.p[0]-t.prev2ndQuadraticControlPoint[0]+t.p[0],t.p[1]-t.prev2ndQuadraticControlPoint[1]+t.p[1]]:t.p,e=[t.vals[0],t.vals[1]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},v:function(t){const n=[t.p,[t.p[0],t.vals[0]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},z:o};function s(t){let n=0,e=0,r=1,o=0,i=1,c=1;const s=t._currentIndex;t._skipOptionalSpaces();let u=t._currentIndex;u<t._endIndex&&"+"===t._string[u]?(t._currentIndex+=1,u+=1):u<t._endIndex&&"-"===t._string[u]&&(t._currentIndex+=1,u+=1,i=-1);const f=t._string[u];if(u===t._endIndex||(f<"0"||f>"9")&&"."!==f)throw new Error(`The first character of a number must be one of [0-9+-.]. Found '${f}' at index ${u}.`);const l=t._currentIndex;for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)t._currentIndex+=1,u+=1;if(u!==l){let n=u-1,r=1;for(;n>=l;)e+=r*(Number(t._string[n])-0),n-=1,r*=10}if(u<t._endIndex&&"."===t._string[u]){if(t._currentIndex+=1,u+=1,u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be a least one digit following the .");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)r*=10,o+=Number(t._string.charAt(u))/r,t._currentIndex+=1,u+=1}if(u!==s&&u+1<t._endIndex&&("e"===t._string[u]||"E"===t._string[u])&&"x"!==t._string[u+1]&&"m"!==t._string[u+1]){if(t._currentIndex+=1,u+=1,"+"===t._string[u]?(t._currentIndex+=1,u+=1):"-"===t._string[u]&&(t._currentIndex+=1,u+=1,c=-1),u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be an exponent.");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)n*=10,n+=Number(t._string[u]),t._currentIndex+=1,u+=1}let a=e+o;if(a*=i,n&&(a*=Math.pow(10,c*n)),s===u)throw new Error("Internal error: startIndex === source._currentIndex");return t._skipOptionalSpacesOrDelimiter(),a}const u={Z:"Z",M:"M",L:"L",C:"C",Q:"Q",A:"A",H:"H",V:"V",S:"S",T:"T",z:"Z",m:"m",l:"l",c:"c",q:"q",a:"a",h:"h",v:"v",s:"s",t:"t"};class f{_string;_currentIndex;_endIndex;_prevCommand;constructor(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._prevCommand=void 0,this._skipOptionalSpaces()}parseSegment(){const t=this._string[this._currentIndex];let n,e=u[t];if(void 0===e){if(void 0===this._prevCommand)throw new Error("Implicit command not allowed for first commands.");if(!("+"===t||"-"===t||"."===t||t>="0"&&t<="9")||"Z"===this._prevCommand)throw new Error("Remaining coordinates not found for implicit command");e="M"===this._prevCommand?"L":"m"===this._prevCommand?"l":this._prevCommand}else this._currentIndex+=1;this._prevCommand=e;const r=e.toUpperCase();if("H"===r||"V"===r?n=[s(this)]:"M"===r||"L"===r||"T"===r?n=[s(this),s(this)]:"S"===r||"Q"===r?n=[s(this),s(this),s(this),s(this)]:"C"===r?n=[s(this),s(this),s(this),s(this),s(this),s(this)]:"A"===r?n=[s(this),s(this),s(this),this._parseArcFlag(),this._parseArcFlag(),s(this),s(this)]:"Z"===r&&(this._skipOptionalSpaces(),n=[]),void 0===n)throw new Error("Unknown command");return{type:e,values:n}}hasMoreData(){return this._currentIndex<this._endIndex}initialCommandIsMoveTo(){if(!this.hasMoreData())return!0;const t=u[this._string[this._currentIndex]];return"M"===t||"m"===t}_isCurrentSpace(){const t=this._string[this._currentIndex];return t<=" "&&(" "===t||"\n"===t||"\t"===t||"\r"===t||"\f"===t)}_skipOptionalSpaces(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex+=1;return this._currentIndex<this._endIndex}_skipOptionalSpacesOrDelimiter(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!==this._string[this._currentIndex])&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","===this._string[this._currentIndex]&&(this._currentIndex+=1,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)}_parseArcFlag(){if(this._currentIndex>=this._endIndex)throw new Error("Unable to parse arc flag");let t;const n=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===n)t=0;else{if("1"!==n)throw new Error("Unable to parse arc flag - arc flag must be 0 or 1");t=1}return this._skipOptionalSpacesOrDelimiter(),t}}function l(t){return function(t){if(0===t.length)return[];if("m"!==t[0].type.toLowerCase())throw new Error("Invalid SVG - every new path must start with an M or m.");const n=new r,e=[];let s,u=[];for(let r=0;r<t.length;r++){const f=t[r],l=f.type.toLowerCase();if(n.vals=f.values,f.type===l)if("v"===l)n.vals[0]+=n.p[1];else if("a"===l)n.vals[5]+=n.p[0],n.vals[6]+=n.p[1];else for(let t=0;t<n.vals.length;t++)n.vals[t]+=n.p[t%2];if("m"!==l){if("a"===l)u.push(...i(n));else{const t=c[l];if(!t)throw new Error("Invalid SVG - command not recognized.");const e=t(n);n.p=e[e.length-1],u.push(e)}s=l}else u.length&&("z"!==s&&u.push(o(n)),e.push(u),u=[]),n.initialPoint=n.p=n.vals,s=l}return u.length>0&&("z"!==s&&u.push(o(n)),e.push(u)),e}(function(t){if(!t.length)return[];const n=new f(t),e=[];if(!n.initialCommandIsMoveTo())throw new Error("Path must start with m or M");for(;n.hasMoreData();)e.push(n.parseSegment());return e}(t))}function a(t){const n=t.length,e=Array.from(Array(n),()=>new Array(n).fill(0));for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][o]=t[r][o];for(let t=0;t<n;t++)for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][t]+e[t][o]<e[r][o]&&(e[r][o]=e[r][t]+e[t][o]);return e}function p(t){const n=t,e=[];do{e.push(t),t=t.next}while(t!==n);return e}function h(t){return p(t).filter(t=>t.isHoleClosing)}function d(t){const n=t.pointOnShape;return{idx:n.curve.idx,t:n.t,order:n.order,order2:n.order2}}function v(t){const n=t;let e=n,r=0;do{r++,e=e.nextOnCircle}while(e!==n);return r}function g(t,n=!1){const e=t,r=n?[]:[t];let o=t.nextOnCircle;for(;o!==e;)r.push(o),o=o.nextOnCircle;return r}function m(t){return t===t.next.prevOnCircle}function x(t){return g(t).filter(t=>!m(t)).length}function b(t){return g(t).every(m)}function w(t){if(!m(t))return!1;if(b(t))return!0;for(;t.prev===t.prevOnCircle;)t=t.prev;return g(t.prevOnCircle,!0).every(m)}function _(t){return 0===t.pointOnShape.circle.radius}function M(t){const n=t.pointOnShape,e=n.curve;return{...t,pos:n,p:n.p,t:n.t,isTerminating:m(t),isFullyTerminating:w(t),isSharp:_(t),prongCount:v(t),getRealProngCount:x(t),ordering:d(t),curve:e,loop:e.loop}}function I(t){let n=t;if(m(n))return[n];const e=[];do{e.push(n);const t=n.next.prevOnCircle;n=n=n===t?n.next.next:t}while(n!==t);return e}function S(t,n){const e=p(t),r=new Set;for(t of e)m(t)||r.has(t.next.prevOnCircle)||n(t),r.add(t)}function y(t){const n=[],e=t;let r=e;for(;r!==e.prevOnCircle;)m(r)||n.push(r.next),r=r.nextOnCircle;return n}function O(t,n){n(t);const e=g(t).filter(t=>!m(t)).map(t=>t.next);for(const t of e){const e=[t];for(;e.length;){const t=e.pop();n(t),e.push(...y(t))}}}const C=["prev","next","prevOnCircle","nextOnCircle","holeCloserTwin"];function N(t){const n=new Map,e=E(t);n.set(t,e);const r=[{cpNode:t,newCpNode:e}];for(;r.length;){const{cpNode:t,newCpNode:e}=r.pop();for(const o of C){const i=t[o];if(void 0===i)continue;let c=n.get(i);c||(c=E(i),n.set(i,c),r.push({cpNode:i,newCpNode:c})),e[o]=c}}return e}function E(t){return{...t,prev:void 0,next:void 0,prevOnCircle:void 0,nextOnCircle:void 0,holeCloserTwin:void 0}}function T(t){const n=t,e=t.next,r=n.pointOnShape,o=e.pointOnShape,i=r.curve,c=o.curve;if(i.loop!==c.loop)return[];const s=[];return c===i?s.push({ps:r.curve.ps,ts:[r.t,o.t]}):(s.push({ps:r.curve.ps,ts:[r.t,1]}),function(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({ps:o.ps,ts:[0,n]})}while(o!==e)}(s,r.curve,o.curve,o.t)),s}function P(t,n,e){if(4===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),v=s-n*(s-f),g=f-n*(f-a),m=v-n*(v-g);return[e,[p,v],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(g-n*(g-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),v=p-n*(p-h),g=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[v-n*(v-g),w-n*(w-_)],[g,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,v=e*e,g=e*v,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,I=c[0]-s-3*b,S=u-l,y=p-l,O=S+y,C=n*S,N=e*S,E=c[1]-u-3*y;return[[d*I+(3*n*(n*w-x)+s),d*E+(3*n*(n*O-S)+u)],[m*(n*I+2*w)+(h*w+s-(M+2*_)),m*(n*E+2*O)+(h*O+u-(N+2*C))],[m*(e*I+2*w)+(v*w+s-(2*M+_)),m*(e*E+2*O)+(v*O+u-(2*N+C))],[g*I+(3*e*(e*w-x)+s),g*E+(3*e*(e*O-S)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),v=s-f,g=v+(i[1]-f);return[[l*d-(2*n*h-c),l*g-(2*n*v-s)],[p*d-(h*(e+n)-c),p*g-(v*(e+n)-s)],[a*d-(2*e*h-c),a*g-(2*e*v-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[e,[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function k(t){return T(t).map(t=>P(t.ps,t.ts[0],t.ts[1]))}function A(t,n){const{cpTrees:e}=n,r=t.prev,o=t.next;r.next=o,o.prev=r,e.get(t.pointOnShape.curve.loop).remove(t,!1)}function B(t,n){const e=v(t);if(2!==e)throw new Error(`Cannot delete \`CpNode\` on ${e}-prong`);g(t).forEach(t=>A(t,n))}function z(t){const n=[],e=t.next;let r=e;do{n.push(r),r=r.nextOnCircle}while(r.nextOnCircle!==e);return n}function F(t,n,e){if(void 0===t.size||void 0===e)return;const r=e[n];if(t.size>r&&void 0!==r)for(const[n]of t){t.delete(n);break}}const Y=[function(t,n){let e,r=!1;return function(){return r||(e=t(),r=!0),e}},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t){return"object"!=typeof t&&"function"!=typeof t||null===t?o:r}const c=function(r){let c;const s=i(r);return s.has(r)?(e&&console.log("cache hit"),c=s.get(r)):(e&&console.log("cache miss"),c=t(r),s.set(r,c),F(o,0,n)),c};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e){const r=i(e);r.set(e,t),F(r,1,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o){const i=("object"==typeof o||"function"==typeof o)&&null!==o;let c="object"!=typeof t&&"function"!=typeof t||null===t?r:e,s=c.get(t);return void 0===s&&(s={weakMap:new WeakMap,map:new Map},c.set(t,s),F(c,0,n)),i?s.weakMap:s.map}function i(e,r){const i=o(e,r);let c;return i.has(r)?c=i.get(r):(c=t(e,r),i.set(r,c),F(i,1,n)),c}return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r){const i=o(e,r);i.set(r,t),F(i,1,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i){const c=("object"==typeof o||"function"==typeof o)&&null!==o,s=("object"==typeof i||"function"==typeof i)&&null!==i;let u="object"!=typeof t&&"function"!=typeof t||null===t?r:e,f=u.get(t);void 0===f&&(f={weakMap:new WeakMap,map:new Map},u.set(t,f),F(u,0,n));const l=c?f.weakMap:f.map;let a=l.get(o);return void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(o,a),F(l,1,n)),s?a.weakMap:a.map}const i=function(e,r,i){const c=o(e,r,i);let s;return c.has(i)?s=c.get(i):(s=t(e,r,i),c.set(i,s),F(c,2,n)),s};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i){const c=o(e,r,i);c.set(i,t),F(c,2,n)},i},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t,e,i,c){const s=("object"==typeof e||"function"==typeof e)&&null!==e,u=("object"==typeof i||"function"==typeof i)&&null!==i,f=("object"==typeof c||"function"==typeof c)&&null!==c;let l="object"!=typeof t&&"function"!=typeof t||null===t?o:r,a=l.get(t);void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(t,a),F(l,0,n));const p=s?a.weakMap:a.map;let h=p.get(e);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(e,h),F(p,1,n));const d=u?h.weakMap:h.map;let v=d.get(i);return void 0===v&&(v={weakMap:new WeakMap,map:new Map},d.set(i,v),F(d,2,n)),f?v.weakMap:v.map}const c=function(r,o,c,s){const u=i(r,o,c,s);let f;return u.has(s)?(e&&console.log("cache hit"),f=u.get(s)):(e&&console.log("cache miss"),f=t(r,o,c,s),u.set(s,f),F(u,3,n)),f};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,r,o,c){const s=i(e,r,o,c);s.set(c,t),F(s,3,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s){const u=("object"==typeof o||"function"==typeof o)&&null!==o,f=("object"==typeof i||"function"==typeof i)&&null!==i,l=("object"==typeof c||"function"==typeof c)&&null!==c,a=("object"==typeof s||"function"==typeof s)&&null!==s;let p="object"!=typeof t&&"function"!=typeof t||null===t?r:e,h=p.get(t);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(t,h),F(p,0,n));const d=u?h.weakMap:h.map;let v=d.get(o);void 0===v&&(v={weakMap:new WeakMap,map:new Map},d.set(o,v),F(d,1,n));const g=f?v.weakMap:v.map;let m=g.get(i);void 0===m&&(m={weakMap:new WeakMap,map:new Map},g.set(i,m),F(g,2,n));const x=l?m.weakMap:m.map;let b=x.get(c);return void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(c,b),F(x,3,n)),a?b.weakMap:b.map}const i=function(e,r,i,c,s){const u=o(e,r,i,c,s);let f;return u.has(s)?f=u.get(s):(f=t(e,r,i,c,s),u.set(s,f),F(u,4,n)),f};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s){const u=o(e,r,i,c,s);u.set(s,t),F(u,4,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u){const f=("object"==typeof o||"function"==typeof o)&&null!==o,l=("object"==typeof i||"function"==typeof i)&&null!==i,a=("object"==typeof c||"function"==typeof c)&&null!==c,p=("object"==typeof s||"function"==typeof s)&&null!==s,h=("object"==typeof u||"function"==typeof u)&&null!==u;let d="object"!=typeof t&&"function"!=typeof t||null===t?r:e,v=d.get(t);void 0===v&&(v={weakMap:new WeakMap,map:new Map},d.set(t,v),F(d,0,n));const g=f?v.weakMap:v.map;let m=g.get(o);void 0===m&&(m={weakMap:new WeakMap,map:new Map},g.set(o,m),F(g,1,n));const x=l?m.weakMap:m.map;let b=x.get(i);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(i,b),F(x,2,n));const w=a?b.weakMap:b.map;let _=w.get(c);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(c,_),F(w,3,n));const M=p?_.weakMap:_.map;let I=M.get(s);return void 0===I&&(I={weakMap:new WeakMap,map:new Map},M.set(s,I),F(M,4,n)),h?I.weakMap:I.map}const i=function(e,r,i,c,s,u){const f=o(e,r,i,c,s,u);let l;return f.has(u)?l=f.get(u):(l=t(e,r,i,c,s,u),f.set(u,l),F(f,5,n)),l};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u){const f=o(e,r,i,c,s,u);f.set(u,t),F(f,5,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f){const l=("object"==typeof o||"function"==typeof o)&&null!==o,a=("object"==typeof i||"function"==typeof i)&&null!==i,p=("object"==typeof c||"function"==typeof c)&&null!==c,h=("object"==typeof s||"function"==typeof s)&&null!==s,d=("object"==typeof u||"function"==typeof u)&&null!==u,v=("object"==typeof f||"function"==typeof f)&&null!==f;let g="object"!=typeof t&&"function"!=typeof t||null===t?r:e,m=g.get(t);void 0===m&&(m={weakMap:new WeakMap,map:new Map},g.set(t,m),F(g,0,n));const x=l?m.weakMap:m.map;let b=x.get(o);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(o,b),F(x,1,n));const w=a?b.weakMap:b.map;let _=w.get(i);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(i,_),F(w,2,n));const M=p?_.weakMap:_.map;let I=M.get(c);void 0===I&&(I={weakMap:new WeakMap,map:new Map},M.set(c,I),F(M,3,n));const S=h?I.weakMap:I.map;let y=S.get(s);void 0===y&&(y={weakMap:new WeakMap,map:new Map},S.set(s,y),F(S,4,n));const O=d?y.weakMap:y.map;let C=O.get(u);return void 0===C&&(C={weakMap:new WeakMap,map:new Map},O.set(u,C),F(O,5,n)),v?C.weakMap:C.map}const i=function(e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);let a;return l.has(f)?a=l.get(f):(a=t(e,r,i,c,s,u,f),l.set(f,a),F(l,6,n)),a};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);l.set(f,t),F(l,6,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f,l){const a=("object"==typeof o||"function"==typeof o)&&null!==o,p=("object"==typeof i||"function"==typeof i)&&null!==i,h=("object"==typeof c||"function"==typeof c)&&null!==c,d=("object"==typeof s||"function"==typeof s)&&null!==s,v=("object"==typeof u||"function"==typeof u)&&null!==u,g=("object"==typeof f||"function"==typeof f)&&null!==f,m=("object"==typeof l||"function"==typeof l)&&null!==l;let x="object"!=typeof t&&"function"!=typeof t||null===t?r:e,b=x.get(t);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(t,b),F(x,0,n));const w=a?b.weakMap:b.map;let _=w.get(o);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(o,_),F(w,1,n));const M=p?_.weakMap:_.map;let I=M.get(i);void 0===I&&(I={weakMap:new WeakMap,map:new Map},M.set(i,I),F(M,2,n));const S=h?I.weakMap:I.map;let y=S.get(c);void 0===y&&(y={weakMap:new WeakMap,map:new Map},S.set(c,y),F(S,3,n));const O=d?y.weakMap:y.map;let C=O.get(s);void 0===C&&(C={weakMap:new WeakMap,map:new Map},O.set(s,C),F(O,4,n));const N=v?C.weakMap:C.map;let E=N.get(u);void 0===E&&(E={weakMap:new WeakMap,map:new Map},N.set(u,E),F(N,5,n));const T=g?E.weakMap:E.map;let P=T.get(f);return void 0===P&&(P={weakMap:new WeakMap,map:new Map},T.set(f,P),F(T,6,n)),m?P.weakMap:P.map}const i=function(e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);let p;return a.has(l)?p=a.get(l):(p=t(e,r,i,c,s,u,f,l),a.set(l,p),F(a,7,n)),p};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);a.set(l,t),F(a,7,n)},i}];function D(t,n,e=!1){const r=t.length;if(r>8)throw new Error("A maximum of 8 formal parameters are supported");return(0,Y[r])(t,n,e)}function L(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=o-e,a=i-r,p=u-c,h=f-s,d=p*a-h*l;if(0===d)return;const v=((s-r)*l-(c-e)*a)/d;return[c+v*p,s+v*h]}function X(t,n){return[n[0]-t[0],n[1]-t[1]]}function q(t,n){return t[0]*n[0]+t[1]*n[1]}function W(t){return[-t[1],t[0]]}function j(t,n){return t[0]*n[1]-t[1]*n[0]}function H(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function V(t,n){function e(n){return[t[0]+n[0],t[1]+n[1]]}return void 0===n?e:e(n)}function Q(t){const n=1/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]*n,t[1]*n]}function R(t,n,e){function r(e){return[e[0]*n-e[1]*t,e[0]*t+e[1]*n]}return void 0===e?r:r(e)}function G(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+t[r];return e}function U(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function $(t,n){const[e,r]=U(t);return[G(e,n),G(r,n)]}function Z(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function J(t,n){const e=t.length,r=n.length;let o=0,i=0;const c=[];for(;o<e&&i<r;)0!==t[o]?0!==n[i]?Math.abs(t[o])<=Math.abs(n[i])?(c.push(t[o]),o++):(c.push(n[i]),i++):i++:o++;for(;o<e;)c.push(t[o]),o++;for(;i<r;)c.push(n[i]),i++;if(0===c.length)return[0];const s=c.length;if(1===s)return c;const u=[],f=c[1],l=c[0];let a=f+l;const p=l-(a-f);0!==p&&u.push(p),i=0;for(let t=2;t<s;t++){const n=c[t],e=a+n,r=e-a,o=a-(e-r)+(n-r);0!==o&&u.push(o),a=e}return 0===a&&0!==u.length||u.push(a),u}const K=134217729;function tt(t,n){const e=t.length;let r;const o=t[0];let i=o*n;const c=K*o,s=c-(c-o),u=o-s,f=K*n,l=f-(f-n),a=n-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=t[o],c=e*n,s=K*e,u=s-(s-e),f=e-u,l=K*n,a=l-(l-n),h=n-a,d=f*h-(c-u*a-f*a-u*h),v=i+d,g=v-i,m=i-(v-g)+(d-g);0!==m&&p.push(m),r=v;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function nt(t,n){const e=n.length;let r;const o=n[0];let i=o*t;const c=K*o,s=c-(c-o),u=o-s,f=K*t,l=f-(f-t),a=t-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=n[o],c=e*t,s=K*e,u=s-(s-e),f=e-u,l=K*t,a=l-(l-t),h=t-a,d=f*h-(c-u*a-f*a-u*h),v=i+d,g=v-i,m=i-(v-g)+(d-g);0!==m&&p.push(m),r=v;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function et(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(e,tt(n,t[r]));return e}function rt(t){let n=t[0];for(let e=1;e<t.length;e++)n+=t[e];return n}function ot(t){const n=t.length,e=new Array(n);for(let r=0;r<n;r++)e[r]=-t[r];return e}function it(t,n){return J(t,ot(n))}function ct(t){return t[t.length-1]}const st=Z,ut=nt;function ft(t){if(4===t.length){const[[n,e],[r,o]]=t;return[ut(3,st(r,n)),ut(3,st(o,e))]}if(3===t.length){const[[n,e],[r,o]]=t;return[st(2*r,2*n),st(2*o,2*e)]}if(2===t.length){const[[n,e],[r,o]]=t;return[st(r,n),st(o,e)]}if(1===t.length)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function lt(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}function at(t,n){const e=t.length;let r=n;const o=[];for(let n=0;n<e;n++){const e=t[n],i=r+e,c=i-r,s=r-(i-c)+(e-c);0!==s&&o.push(s),r=i}return 0===r&&0!==o.length||o.push(r),o}const pt=lt,ht=nt,dt=at;function vt(t){if(4===t.length){const[[n,e],[r,o],[i,c]]=t;return[ht(6,dt(pt(i,n),-2*r)),ht(6,dt(pt(c,e),-2*o))]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[dt(pt(2*i,2*n),-4*r),dt(pt(2*c,2*e),-4*o)]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3")}const gt=Z,mt=nt,xt=J;function bt(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[mt(6,xt(gt(s,n),mt(3,gt(r,i))))],[mt(6,xt(gt(u,e),mt(3,gt(o,c))))]]}if(t.length<=3)return[[[0]],[[0]]];throw new Error("The given bezier curve must be of order <= 3.")}const{sign:wt}=Math;function _t(t,n){const[e,r]=ft(t),[o,i]=vt(t),[c,s]=ft(n),[u,f]=vt(n),l=it(et(e,i),et(r,o)),a=it(et(c,f),et(s,u)),p=ct(l),h=ct(a);if(wt(p)!==wt(h))return p-h;const d=J(et(c,c),et(s,s)),v=J(et(e,e),et(r,r)),g=et(d,d),m=et(g,d),x=et(v,v),b=et(x,v);if(0!==p||0!==h){const t=et(l,l),n=et(a,a),e=ct(it(et(t,m),et(n,b)));if(0!==e)return p>0?e:-e}const[[w],[_]]=bt(t),[[M],[I]]=bt(n),S=it(et(e,_),et(r,w)),y=J(et(e,o),et(r,i)),O=it(et(c,I),et(s,M)),C=J(et(c,u),et(s,f)),N=it(et(v,S),tt(et(l,y),3)),E=it(et(d,O),tt(et(a,C),3)),T=ct(N),P=ct(E);if(T!==P)return T-P;if(0===T&&0===P)return 0;const k=et(N,N),A=et(g,m),B=et(E,E),z=et(x,b),F=ct(it(et(k,A),et(B,z)));return T>0?F:-F}function Mt(t,n){return t[0]===n[0]&&t[1]===n[1]}function It(t,n){const{ccw:e,tangentI:r,tangentO:o,dotTangents:i}=function(t,n){const e=t.length;let r=t[e-2],o=n[0],i=n[1];Mt(r,o)&&(r=t[e-3]),Mt(o,i)&&(i=n[2]);const c=function(t,n,e){const r=Z(t[0],e[0]),o=Z(n[1],e[1]),i=Z(t[1],e[1]),c=Z(n[0],e[0]);return rt(J(et(r,o),ot(et(i,c))))}(r,o,i),s=[Z(o[0],r[0]),Z(o[1],r[1])],u=[Z(i[0],o[0]),Z(i[1],o[1])],f=function(t,n){return rt(J(et(t[0],n[0]),et(t[1],n[1])))}(s,u);return 0!==c||f>0?{ccw:c,tangentI:s,tangentO:u,dotTangents:f}:{ccw:_t(t.slice().reverse(),n),tangentI:s,tangentO:u,dotTangents:f}}(t,n),c=e<0,s=e>0,u=[Q(r.map(t=>t[1])),Q(o.map(t=>t[1]))],f=j(u[0],u[1]);let l,a;return i>0?(l=f<-.0698,a=f>.0698):(l=c,a=s),{tangents:u,isSharp:c,isDull:s,isQuiteSharp:l,isQuiteDull:a}}const St=D(function(t){const{t:n,curve:e}=t;return It(1===n?e.ps:e.prev.ps,1===n?e.next.ps:e.ps)});function yt(t){return 0===t.t||1===t.t}function Ot(t){return!!yt(t)&&St(t).isSharp}function Ct(t){const n=t.pointOnShape.circle.center,e=t,r=t.nextOnCircle,o=e.pointOnShape,i=r.pointOnShape,c=o.p,s=i.p;let u;if(Ot(o)){let t,n;0===o.t?(t=o.curve,n=o.curve.prev):1===o.t&&(t=o.curve.next,n=o.curve);const e=Q($(t.ps,0)),r=[-(f=Q($(n.ps,1)))[0],-f[1]],i=q(e,r),c=Math.sqrt((1+i)/2);u=R(Math.sqrt((1-i)/2),c,r)}else u=c[0]===s[0]&&c[1]===s[1]?X(c,n):W(X(c,s));var f;return[n,V(Q(u),n)]}const{abs:Nt}=Math,Et=1e-4;function Tt(t,n){const e=t.pointOnShape.circle.center,r=Ct(t),o=n.pointOnShape.circle.center,i=Ct(n.prevOnCircle),c=L(r,i),s=X(e,o);let u;if(c){const t=X(e,c),n=X(o,c);u=q(t,s)<0||q(n,s)>0}else u=!0;if(!u)return[e,c,o];const f=W(s),l=X(r[0],r[1]),a=X(i[0],i[1]),p=Nt(j(s,l))/9,h=Nt(j(s,a))/9;if(p>.01||h>.01)return[e,o];if(p>Et||h>Et){const t=H(e,o,1/3),n=H(e,o,2/3),c=V(f,t),s=[n,V(f,n)];return[e,L(r,[t,c]),L(i,s),o]}return[e,o]}function Pt(t){return Tt(t,t.next)}function kt(t){const n=t;let e=n;for(;e.next===e.prevOnCircle;)if(e=e.next,e===n)return;return e}function At(t,n){return g(t).indexOf(n)>=0}function Bt(t){return 1===x(t)&&!t.isHoleClosing}function zt(t){return 2===x(t)}function Ft(t){if(b(t))return[];for(;m(t);)t=t.nextOnCircle;for(t=t.next;2===x(t);)t=t.next;t=t.prevOnCircle;const n=[];do{n.push(t),t=t.next}while(!w(t)&&2===x(t));return n}function Yt(t){return Ft(t).map(t=>Pt(t))}function Dt(t,n){const e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function Lt(t,n){const[e,r]=t,[[o,i],[c,s]]=n;return Dt([o+e*(c-o),i+e*(s-i)],[o+r*(c-o),i+r*(s-i)])}function Xt(t,n,e=16){if(n[0]===n[1])return 0;const{weights:r,abscissas:o}=qt[e],[i,c]=n;let s=0;const u=(c-i)/2,f=(c+i)/2;for(let n=0;n<=e-1;n++)s+=r[n]*t(u*o[n]+f);return u*s}D(Pt);const qt={2:{weights:[1,1],abscissas:[-.5773502691896257,.5773502691896257]},4:{weights:[.6521451548625461,.6521451548625461,.3478548451374538,.3478548451374538],abscissas:[-.3399810435848563,.3399810435848563,-.8611363115940526,.8611363115940526]},8:{weights:[.362683783378362,.362683783378362,.3137066458778873,.3137066458778873,.2223810344533745,.2223810344533745,.1012285362903763,.1012285362903763],abscissas:[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363]},16:{weights:[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685,.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096],abscissas:[-.9894009349916499,-.9445750230732326,-.8656312023878318,-.755404408355003,-.6178762444026438,-.45801677765722737,-.2816035507792589,-.09501250983763744,.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]},64:{weights:[.048690957009139724,.048690957009139724,.04857546744150343,.04857546744150343,.048344762234802954,.048344762234802954,.04799938859645831,.04799938859645831,.04754016571483031,.04754016571483031,.04696818281621002,.04696818281621002,.046284796581314416,.046284796581314416,.04549162792741814,.04549162792741814,.044590558163756566,.044590558163756566,.04358372452932345,.04358372452932345,.04247351512365359,.04247351512365359,.04126256324262353,.04126256324262353,.03995374113272034,.03995374113272034,.038550153178615626,.038550153178615626,.03705512854024005,.03705512854024005,.035472213256882386,.035472213256882386,.033805161837141606,.033805161837141606,.03205792835485155,.03205792835485155,.030234657072402478,.030234657072402478,.028339672614259483,.028339672614259483,.02637746971505466,.02637746971505466,.024352702568710874,.024352702568710874,.022270173808383253,.022270173808383253,.02013482315353021,.02013482315353021,.017951715775697343,.017951715775697343,.015726030476024718,.015726030476024718,.013463047896718643,.013463047896718643,.011168139460131128,.011168139460131128,.008846759826363947,.008846759826363947,.006504457968978363,.006504457968978363,.004147033260562468,.004147033260562468,.001783280721696433,.001783280721696433],abscissas:[-.024350292663424433,.024350292663424433,-.07299312178779904,.07299312178779904,-.12146281929612056,.12146281929612056,-.16964442042399283,.16964442042399283,-.21742364374000708,.21742364374000708,-.2646871622087674,.2646871622087674,-.31132287199021097,.31132287199021097,-.3572201583376681,.3572201583376681,-.4022701579639916,.4022701579639916,-.4463660172534641,.4463660172534641,-.48940314570705296,.48940314570705296,-.5312794640198946,.5312794640198946,-.571895646202634,.571895646202634,-.6111553551723933,.6111553551723933,-.6489654712546573,.6489654712546573,-.6852363130542333,.6852363130542333,-.7198818501716109,.7198818501716109,-.7528199072605319,.7528199072605319,-.7839723589433414,.7839723589433414,-.8132653151227975,.8132653151227975,-.8406292962525803,.8406292962525803,-.8659993981540928,.8659993981540928,-.8893154459951141,.8893154459951141,-.9105221370785028,.9105221370785028,-.9295691721319396,.9295691721319396,-.9464113748584028,.9464113748584028,-.9610087996520538,.9610087996520538,-.973326827789911,.973326827789911,-.983336253884626,.983336253884626,-.9910133714767443,.9910133714767443,-.9963401167719553,.9963401167719553,-.9993050417357722,.9993050417357722]}},{sqrt:Wt}=Math;function jt(t){const[n,e]=U(t);return function(t){const r=G(n,t),o=G(e,t);return Wt(r*r+o*o)}}const{abs:Ht}=Math,Vt=[[0,0],[0,0],[0,0]];function Qt(t,n,e){return 0===n?1===e?{ps:t,_ps:Vt}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],v=Ht(n),g=Ht(i),m=Ht(s),x=Ht(f),b=g+m,w=Ht(c),_=Ht(u),M=w+_;return{ps:d,_ps:[[0,0],[v*b+g,v*M+w],[a*(b+(x+m))+(2*v*b+g),a*(M+(Ht(l)+_))+(2*v*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,v=l-u,g=[[a*(p+h)-(2*n*p-i),a*(d+v)-(2*n*d-c)],[n*h+s,n*v+u],[f,l]],m=Ht(n),x=Ht(i),b=Ht(s),w=x+b,_=Ht(f)+b,M=Ht(c),I=Ht(u),S=M+I;return{ps:g,_ps:[[a*(w+_)+(2*m*w+x),a*(S+(Ht(l)+I))+(2*m*S+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,v=c-u,g=v+(l-u),m=s-f,x=m+(a-f),b=p*g-(2*n*v-c),w=d*g-(v*(e+n)-c),_=h*g-(2*e*v-c),M=p*x-(2*n*m-s),I=d*x-(m*(e+n)-s),S=h*x-(2*e*m-s),y=Ht(n),O=Ht(e),C=Ht(d),N=Ht(c),E=Ht(u),T=N+E,P=T+Ht(l)+E,k=Ht(s),A=Ht(f),B=k+A,z=B+Ht(a)+A;return{ps:[[b,M],[w,I],[_,S]],_ps:[[p*P+(2*y*T+N),p*z+(2*y*B+k)],[C*P+(T*(O+y)+N),C*x+(B*(O+y)+k)],[h*P+(2*O*T+N),h*z+(2*O*B+k)]]}}(t,n,e)}const Rt=134217729;function Gt(t,n){const e=t*n,r=Rt*t,o=r-(r-t),i=t-o,c=Rt*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}function Ut(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r+i,s=c-r,u=e+o,f=u-e,l=r-(c-s)+(i-s)+u,a=c+l,p=e-(u-f)+(o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}function $t(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r-i,s=c-r,u=e-o,f=u-e,l=r-(c-s)+(-i-s)+u,a=c+l,p=e-(u-f)+(-o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}const{atan2:Zt}=Math,Jt=Gt;function Kt(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=$t(Jt(i,e),Jt(o,r))[1],s=Ut(Jt(o,e),Jt(i,r))[1];return Zt(c,s)}const{abs:tn}=Math;function nn(t){const n=[];for(let e=0;e<t.length-1;e++){const r=[t[e+1][0]-t[e][0],t[e+1][1]-t[e][1]];0!==(0!==r[0]||r[1])&&n.push(r)}const e=n.length;let r=0;for(let t=0;t<e-1;t++)r+=tn(Kt(n[t],n[t+1]));return r}function en(t,n=.4,e=2**-16){const r=[0],o=[1];for(;;){const i=r[r.length-1],c=o[o.length-1];if(nn(P(t,i,c))<=n||c-i<=e){if(r.push(o.pop()),1===c)return r;continue}const s=(i+c)/2;o.push(s)}}const{sqrt:rn,log:on}=Math;function cn(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a]]=n;if(c===u&&u===l&&s===f&&f===a)return 0;const p=Qt(n,o,i).ps,h=en(p,e);let d=0;for(let t=0;t<h.length-1;t++){const n=h[t],e=h[t+1];d+=Xt(jt(p),[n,e],r)}return d}const{abs:sn}=Math,un=[[0,0],[0,0],[0,0],[0,0]];function fn(t,n,e){return 0===n?1===e?{ps:t,_ps:un}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),v=u-n*(u-l),g=d-n*(d-v),m=g-n*(g-(v-n*(v-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=sn(n),I=sn(c),S=sn(u),y=sn(l),O=sn(p),C=sn(s),N=sn(f),E=sn(a),T=I+M*(I+S),P=S+M*(S+y),k=T+M*(T+P),A=C+M*(C+N),B=N+M*(N+E),z=A+M*(A+B);return{ps:[[c,s],[d,x],[g,w],[m,_]],_ps:[[0,0],[T,A],[k,z],[k+M*(k+(P+M*(P+(y+M*(y+O))))),z+M*(z+(B+M*(B+(E+M*(E+sn(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),v=u-n*(u-l),g=l-n*(l-p),m=d-n*(d-v),x=v-n*(v-g),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),I=w-n*(w-_),S=_-n*(_-M),y=I-n*(I-S),O=sn(n),C=sn(c),N=sn(u),E=sn(l),T=sn(p),P=sn(s),k=sn(f),A=sn(a),B=C+O*(C+N),z=N+O*(N+E),F=E+O*(E+T),Y=B+O*(B+z),D=z+O*(z+F),L=P+O*(P+k),X=k+O*(k+A),q=A+O*(A+sn(h)),W=L+O*(L+X),j=X+O*(X+q);return{ps:[[b,y],[x,S],[g,M],[p,h]],_ps:[[Y+O*(Y+D),W+O*(W+j)],[D,j],[F,q],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,v=e*e,g=e*v,m=n*e,x=s-f,b=a-f,w=c[0]-s,_=x+b,M=n*x,I=e*x,S=w-3*b,y=u-l,O=p-l,C=c[1]-u,N=y+O,E=n*y,T=e*y,P=C-3*O,k=d*S+(3*n*(n*_-x)+s),A=m*(n*S+2*_)+(h*_+s-(I+2*M)),B=m*(e*S+2*_)+(v*_+s-(2*I+M)),z=g*S+(3*e*(e*_-x)+s),F=d*P+(3*n*(n*N-y)+u),Y=m*(n*P+2*N)+(h*N+u-(T+2*E)),D=m*(e*P+2*N)+(v*N+u-(2*T+E)),L=g*P+(3*e*(e*N-y)+u),X=sn(n),q=sn(e),W=sn(m),j=sn(d),H=sn(g),V=sn(s),Q=sn(f),R=V+Q,G=sn(a)+Q,U=R+G,$=X*R,Z=q*R,J=sn(w)+3*G,K=sn(u),tt=sn(l),nt=K+tt,et=sn(p)+tt,rt=nt+et,ot=X*nt,it=q*nt,ct=sn(C)+3*et;return{ps:[[k,F],[A,Y],[B,D],[z,L]],_ps:[[j*J+(3*X*(X*U+R)+V),j*ct+(3*X*(X*rt+nt)+K)],[W*(X*J+2*U)+(h*U+V+(Z+2*$)),W*(X*ct+2*rt)+(h*rt+K+(it+2*ot))],[W*(q*J+2*U)+(v*U+V+(2*Z+$)),W*(q*ct+2*rt)+(v*rt+K+(2*it+ot))],[H*J+(3*q*(q*U+R)+V),H*ct+(3*q*(q*rt+nt)+K)]]}}(t,n,e)}function ln(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a],[p,h]]=n;if(c===u&&u===l&&l===p&&s===f&&f===a&&a===h)return 0;const d=fn(n,o,i).ps,v=en(d,e);let g=0;for(let t=0;t<v.length-1;t++){const n=v[t],e=v[t+1];g+=Xt(jt(d),[n,e],r)}return g}function an(t,n=.4,e=16){if(4===t.length)return ln([0,1],t,n,e);if(3===t.length)return cn([0,1],t,n,e);if(2===t.length)return Lt([0,1],t);if(1===t.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}function pn(t,n,e=!0){const{cpNodes:r,hasHoleCloser:o}=function(t,n,e=!0){if(!e&&t===n)return{cpNodes:[],hasHoleCloser:!1};const r=t,o=[r];let i=t.next,c=r.isHoleClosing;for(;i!==n&&i!==r;)i.isHoleClosing&&(c=!0),o.push(i),i=i.next;return{cpNodes:o,hasHoleCloser:c}}(t,n,e);return{pss:r.flatMap(k),hasHoleCloser:o}}function hn(t){const n=t,e=t.nextOnCircle,r=Dt(n.pointOnShape.p,e.pointOnShape.p),{pss:o,hasHoleCloser:i}=pn(n,e),c=function(t){let n=0;for(let e of t)n+=e;return n}(o.map(t=>an(t)));return i?1/0:c/r}function dn(t,n){let e=t;const r=[];for(;e!==n;){const t=Tt(e,e.next);r.push(t),e=e.next}return r}function vn(t,n){const e=j(Q($(Pt(t),0)),Q($(Pt(n),0)));return Math.abs(Math.asin(e)*(180/Math.PI))}function gn(t){const n=[];return O(t,t=>{n.push(t)}),n}function mn(t,n){let e;return e=t.curve.idx-n.curve.idx,0!==e||(e=t.t-n.t,0!==e||(e=t.order-n.order,0!==e||(e=t.order2-n.order2))),e}function xn(t,n){return mn(t.pointOnShape,n.pointOnShape)}const bn={getChildren:z,getVertexForwardChildren:y,getAllOnLoop:p,getAllOnCircle:g,isOnSameCircle:At,isTerminating:m,isFullyTerminating:w,getFirstExit:kt,isSharp:_,isOneProng:Bt,getProngCount:v,getRealProngCount:x,cpNodeComparator:xn,enhanceCpNode:M,traverseCp:I,traverseEdges:S,traverseVertices:O,clone:N,getBoundaryBezierPartsToNext:T,getBoundaryBeziersToNext:k,removeVertex:B,getMatCurveToNext:Pt,isTwoProng:zt,getBranch:Ft,getBranchBeziers:Yt,getSalience:hn,getMatCurveBetween:Tt,getEdgeDirection:Ct,getBoundaryBeziersBetween:pn,getMatCurvesBetween:dn,getHoleClosers:h,getInitialDegAngleBetweenMatCurves:vn,getAllVertices:gn};function wn(t){return n=>g(n).some(t)}const _n=wn(function(t){return 2!==x(t)&&!t.isHoleClosing});function Mn(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=-t[e];return n}const{abs:In}=Math,{abs:Sn}=Math;function yn(t,n){if(t.length!==n.length)throw new Error("`p` and `p_` must be of equal length.");for(let e=0;e<t.length;e++){const r=Sn(n[e]);if(t[e]-r>=0)continue;let o=!1,i=!1;for(let r=0;r<e;r++){const e=Sn(n[r]),c=t[r]-e,s=t[r]+e;if(c>0){o=!0;break}s>0&&(i=!0)}if(!o&&i)return 1/0}return function(t){const n=t.length-1;if(n<1)return 0;t[0]<0&&(t=Mn(t));const e=[];for(let t=0;t<n;t++)e.push(1);let r=0;for(let o=0;o<=n;o++){if(t[o]>=0)continue;let n=1/0,i=!1;for(let r=0;r<o;r++){if(t[r]<=0)continue;const c=(-t[o]/(t[r]/2**e[r]))**(1/(o-r));e[r]++,n>c&&(n=c),i=!0}i&&r<n&&(r=n)}return r}(function(t,n){if(t.length!==n.length)throw new Error("`p` and `p_` must be of equal length.");const e=new Array(t.length);for(let r=0;r<t.length;r++){const o=In(n[r]),i=t[r]-o,c=t[r]+o;e[r]=i>0||c<0?i:0}return e}(t,n))}const On=(Cn=yn,(t,n)=>-Cn(function(t){const n=t.length-1;if(n<0)return[];const e=t.slice();for(let t=0;t<n+1;t++)t%2==(n-1)%2&&(e[t]=-e[t]);return e}(t),n));var Cn;const{min:Nn,max:En,abs:Tn}=Math,Pn=17976931348623157e292,kn=Number.EPSILON,An=kn/2,Bn=An*An,zn=Yn(1),Fn=function(){const t=3*Bn;return t/(1-t)}();function Yn(t){const n=t*An;return n/(1-n)}new Array(20).fill(0).map((t,n)=>Yn(n));const{abs:Dn}=Math;function Ln(t){const n=t.slice(),e=n.length;if(1===e)return n;let r=n[e-1],o=e;for(let t=e-2;t>=0;--t){const e=r,i=n[t];r=e+i;const c=i-(r-e);c&&(n[--o]=r,r=c)}let i=0;for(let t=o;t<e;++t){const e=n[t],o=r;r=e+o;const c=o-(r-e);c&&(n[i++]=c)}return n[i++]=r,n.length=i,n}const{abs:Xn}=Math,{abs:qn}=Math,Wn=134217729;function jn(t,n){const e=n[0],r=n[1],o=r*t,i=Wn*r,c=i-(i-r),s=r-c,u=Wn*t,f=u-(u-t),l=t-f,a=e*t,p=o+a,h=a-(p-o)+(s*l-(o-c*f-s*f-c*l)),d=p+h;return[h-(d-p),d]}function Hn(t,n){const e=n[0],r=n[1],o=r*t,i=Wn*r,c=i-(i-r),s=r-c,u=Wn*t,f=u-(u-t),l=t-f,a=s*l-(o-c*f-s*f-c*l)+e*t,p=o+a;return[a-(p-o),p]}const{abs:Vn}=Math;function Qn(t,n,e){const r=t.length-1;if(r<0)return[[],[]];const o=Vn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=i[e-1],r=c[e-1],s=Hn(n,t),u=o*r+Vn(s[1]),f=i[e];i[e]=Ut(f,s),c[e]=c[e]+u+Vn(i[e][1])}return[i,c]}const Rn=2**27+1;function Gn(t,n){const e=t[1],r=n[1],o=e*r,i=Rn*e,c=i-(i-e),s=e-c,u=Rn*r,f=u-(u-r),l=r-f,a=s*l-(o-c*f-s*f-c*l)+(e*n[0]+t[0]*r),p=o+a;return[a-(p-o),p]}const{abs:Un}=Math;function $n(t,n){const e=t.length-1;if(e<0)return[];const r=t.slice();for(let t=0;t<=e;t++)for(let o=1;o<=e-t;o++)r[o]=Ln(J(r[o],tt(r[o-1],n)));return r}function Zn(t,n){const e=t.length-1;if(e<0)return[];const r=new Array(e+1);r[e]=t[e];let o=[1];for(let i=1;i<=e;i++)o=tt(o,n),r[e-i]=et(t[e-i],o);return r}const{abs:Jn,sign:Kn}=Math;const te=134217729;function ne(t,n){const e=t*n,r=te*t,o=r-(r-t),i=t-o,c=te*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}const{abs:ee}=Math;function re(t,n){const e=ee(n);let r=t[0],o=.5*ee(r);for(let i=1;i<t.length;i++)r=r*n+t[i],o=o*e+ee(r);return o=An*(2*o-ee(r)),[r,o]}const oe=Math.abs,{abs:ie}=Math,ce=Yn(1),se=Yn(2);function ue(t,n,e=void 0,r=1){const o=t[0],[i,c]=re(o,n),s=se*function(t,n){const e=oe(n);let r=0;for(let n=0;n<t.length;n++)r=r*e+oe(t[n]);return r}(o,n),u=void 0!==e?G(e,ie(n)):0;if((c+s+u)*r<Math.abs(i))return i;const f=function(t,n){const e=[],r=[];let o,i=t[0];for(let c=1;c<t.length;c++){const[s,u]=ne(i,n);[o,i]=lt(u,t[c]),e.push(s),r.push(o)}return{r̂:i,pπ:e,pσ:r}}(o,n),{pπ:l,pσ:a}=f;let{r̂:p}=f;const[h,d]=re(l,n),[v,g]=re(a,n),[m,x]=re(t[1],n);let b=d+g+x+u;return p=h+v+m+p,b+=ce*p,b*r<Math.abs(p)?p:0}function fe(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(t[r],tt(e,n));return e}const{abs:le,min:ae,max:pe,log2:he,ceil:de}=Math;function ve(t,n,e,r,o,i,c,s){let u=e,f=r,l=u,a=o,p=f-u,h=p;for(;;){let d;le(a)<le(i)&&(u=f,f=l,l=u,o=i,i=a,a=o);const v=pe(le(u),le(f));d=v<=1?kn:kn*2**de(he(v));const g=.5*(l-f);if(le(g)<=d)return f<l?[f,l,f]:[l,f,f];if(le(p)<d||le(o)<=le(i))p=g,h=p;else{let t,n,e=i/o;if(u===l)t=2*g*e,n=1-e;else{n=o/a;const r=i/a;t=e*(2*g*n*(n-r)-(f-u)*(r-1)),n=(n-1)*(r-1)*(e-1)}0<t?n=-n:t=-t,e=p,p=h,2*t<3*g*n-le(d*n)&&t<le(.5*e*n)?h=t/n:(p=g,h=p)}if(u=f,o=i,d<le(h)?f+=h:0<g?f+=d:f-=d,0===(i=s?rt(fe(c(),f)):ue(t,f,n))){if(s)return[f,f,f];const o=pe(e,f-d),u=ae(r,f+d);if(ue(t,o,n)*ue(t,u,n)!==0)return[o,u,f];if(s=!0,0===(i=rt(fe(c(),f))))return[f,f,f]}(0<i&&0<a||i<=0&&a<=0)&&(l=u,a=o,p=f-u,h=p)}}const{abs:ge}=Math;function me(t,n,e){const r=ge(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=o*n;o=s+t[c],i=i*r+ge(s)+e[c]+ge(o)}return[o,i]}function xe(t){const n=t[0].length,e=[];for(let r=0;r<n;r++){const o=[];for(let e=0;e<t.length;e++)o.push(t[e][n-(r+1)]);e.push(o)}return e}const be=Ut,we=Hn,{abs:_e}=Math;function Me(t,n,e){const r=_e(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=we(n,o);o=be(s,t[c]),i=i*r+_e(s[1])+e[c]+_e(o[1])}return[o,i]}const{abs:Ie,min:Se,max:ye,log2:Oe,ceil:Ce}=Math,Ne=Fn/zn;function Ee(t,n,e,r,o,i,c){const s=t.length-1;let u=0,f=1;for(;;){f*=2;for(let l=1;l<f;l+=2){u++;const a=o+(i-o)*(f+2*l)/(4*f),[p,h]=me(t,a,n);if(Ie(p)>h*zn)return[a,p];if(u>s)return Te(e,r,o,i,c)}}}function Te(t,n,e,r,o){const i=t.length-1;let c=0,s=1;for(;;){s*=2;for(let u=1;u<s;u+=2){c++;const f=e+(r-e)*(s+2*u)/(4*s),[l,a]=Me(t,f,n);if(Ie(l[1])>a*Fn)return[f,l[1]];if(c>i)return Pe(o(),e,r)}}}function Pe(t,n,e){const r=t.length-1;let o=1;for(;;){o*=2;for(let i=1;i<o;i+=2){const c=n+(e-n)*(o+2*i)/(4*o),s=Ln(fe(t,c)),u=s[s.length-1];if(0!==u)return[c,u];if(0>r)throw new Error("Cannot resolve root even in Shewchuk expansion precision")}}}const{abs:ke,max:Ae,log2:Be,ceil:ze}=Math;function Fe(t,n=-1/0,e=1/0,r,o,i=!1){let c;"number"==typeof t[0]&&(t=t.map(t=>[0,t]));const s=()=>void 0===o?t:(void 0===c&&(c=o()),c);r=r||new Array(t.length).fill(0),({pDd:t,pDd_:r,pExact:c}=function(t,n,e,r){let o;if(0===t.length||Dn(t[0][1])>r*n[0])return{pDd:t,pDd_:n,pExact:o};o=o||e();for(let e=0;e<o.length;e++){const i=o[e],c=t[e];c[1]=i[i.length-1],c[0]=i[i.length-2]??0,n[e]=Dn(c[1])*(Fn/r)}let i=0;for(;i<t.length&&0===t[i][1];)i++;return t=t.slice(i),n=n.slice(i),o=o.slice(i),{pDd:t,pDd_:n,pExact:o}}(t,r,s,Fn));const u=t.map(t=>t[0]+t[1]);if((i||ke(n)>2**20||ke(e)>2**20)&&([n,e]=function(t,n,e,r,o){t=En(t,On(e,r.map(t=>t*o))),n=Nn(n,yn(e,r.map(t=>t*o)));const i=2**(-2*(e.length-1));for(Number.isFinite(t)||(t=-i*Pn),Number.isFinite(n)||(n=i*Pn);;){const r=Tn(G(e,t)),o=Tn(G(e,n));if(r>i*Pn)t/=2;else{if(!(o>i*Pn))break;n/=2}}return[t,n]}(n,e,u,r,Fn)),0!==t.length){if(1===t.length)return[];if(n===e){const t=2*kn*Ae(1,2**ze(Be(Ae(ke(n),ke(e)))));n-=t,e+=t}return function(t,n,e,r,o,i){const c=e.map((n,e)=>n*Ne+Ie(t[e])),s=r,u=o;let f,l,a,p,h=o-r;for(;[f,l]=me(t,r,c),!(Ie(f)>l*zn);)r-=h/2,h*=2;for(;[a,p]=me(t,o,c),!(Ie(a)>p*zn);)o+=h/2,h*=2;const d=[[r,o,f,a,0]],v=[],g=function(t,n,e,r,o){return function(i,c,s,u,f){let[l,a]=function(t,n,e){const r=t.length-1,o=Xn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=n*i[e-1],r=o*c[e-1]+Xn(t);i[e]=i[e]+t,c[e]=c[e]+r+Xn(i[e])}return[i,c]}(t,i,n);!function(t,n,e){const r=t.length-1;if(r<0)return;let o=n,i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=qn(u),l=e[s],a=u*o;t[s]=a,e[s]=l*o+f*i+qn(a);const p=o*n;i=i*n+p,o=p}}(l,c-i,a),l.reverse(),a.reverse(),function(t,n){const e=t.length-1;for(let r=0;r<=e;r++)for(let o=1;o<=e-r;o++){const e=t[o-1],r=n[o-1]+Xn(e);t[o]=t[o]+e,n[o]=n[o]+r+Xn(t[o])}}(l,a);let p=0,h=0,d=Kn(s);for(let t=1;t<l.length-1;t++){let n=Kn(l[t]);const e=l[t],r=a[t]*zn;Jn(e)<=r&&(h++,n=-d),n!==d&&(p++,d=n)}return Kn(u)!==d&&p++,1===h&&1===p?1:h>0?function(t,n,e,r,o,i,c,s){let[u,f]=Qn(t,e,n);(function(t,n,e){const r=t.length-1;if(r<0)return;let o=[0,n],i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Un(u[1]),l=e[s],a=Gn(o,u);t[s]=a,e[s]=l*o[1]+f*i+Un(a[1]);const p=Gn(o,[0,n]);i=i*n+p[1],o=p}})(u,r-e,f),u.reverse(),f.reverse(),[u,f]=Qn(u,1,f);let l=0,a=0,p=Kn(o);for(let t=0;t<u.length-1;t++){let n=Kn(u[t][1]);const e=f[t]*Fn,r=u[t];e>=Jn(r[1])&&(a++,n=-p),n!==p&&(l++,p=n)}return Kn(i)!==p&&l++,1===a&&1===l?1:0===a?l:c>1?function(t,n,e,r,o){let i=$n(t(),n);i=Zn(i,e-n),i.reverse(),i=$n(i,1);let c=0,s=Kn(r);for(let t=1;t<i.length-1;t++){const n=i[t];let e=Kn(n[n.length-1]);e!==s&&0!==e&&(c++,s=e)}return Kn(o)!==s&&c++,c}(s,e,r,o,i):-l}(e,r,i,c,s,u,f,o):p}}(t,c,n,e,i);let m,x;for(;d.length>0;){const r=d.pop(),[o,s,u,f,l]=r,a=g(o,s,u,f,l);if(0===a)continue;if(1===a){m=m||e.map(t=>t*Fn),x=x||xe(n);const[t,r,c]=ve(x,m,o,s,u,f,i,!1);v.push({t:c,tS:t,tE:r,multiplicity:1});continue}let p=a<0?l+1:0;if(s-o<=2*Ie(a)*kn*ye(1,2**Ce(Oe(ye(Ie(o),Ie(s)))))){if(0===p){v.push({t:(o+s)/2,tS:o,tE:s,multiplicity:Ie(a)});continue}p=1/0}const[h,b]=Ee(t,c,n,e,o,s,i);d.push([o,h,u,b,p]),d.push([h,s,b,f,p])}return v.reverse(),v.filter(t=>{const{tS:n,tE:e}=t;return!(e<s||n>u)})}(u,t,r,n,e,s)}}function Ye(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,v=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,v+(d+(s+(f-s)*n-d)*n-v)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}const{abs:De}=Math;function Le(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=De(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=De(n),a=De(r),p=De(o),h=De(i),d=De(c),v=De(s),g=l+(p+l)*e,m=p+(d+p)*e,x=g+(m+g)*e,b=a+(h+a)*e,w=h+(v+h)*e,_=b+(w+b)*e;return[x+(m+(d+(De(u)+d)*e+m)*e+x)*e,_+(w+(v+(De(f)+v)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=De(n),f=De(r),l=De(o),a=De(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(De(c)+l)*e+p)*e,h+(a+(De(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=De(n),s=De(r);return[c+(De(o)+c)*e,s+(De(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}const Xe=Number.EPSILON,qe=Number.EPSILON/2,We=qe*qe,je=Ve(1),He=function(){const t=3*We;return t/(1-t)}();function Ve(t){const n=t*qe;return n/(1-n)}const{abs:Qe}=Math,Re=[[0,0],[0,0]];const{min:Ge,max:Ue}=Math;function $e(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=fn(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*qe*r[0][0],f=9*qe*r[1][0],l=9*qe*r[2][0],a=9*qe*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],v=e[3][1],g=9*qe*r[0][1],m=9*qe*r[1][1],x=9*qe*r[2][1],b=9*qe*r[3][1],w=Ge(o-u,i-f,c-l,s-a),_=Ue(o+u,i+f,c+l,s+a);return[[w,Ge(p-g,h-m,d-x,v-b)],[_,Ue(p+g,h+m,d+x,v+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=Qt(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*qe*r[0][0],u=5*qe*r[1][0],f=5*qe*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*qe*r[0][1],d=5*qe*r[1][1],v=5*qe*r[2][1],g=Ge(o-s,i-u,c-f),m=Ue(o+s,i+u,c+f);return[[g,Ge(l-h,a-d,p-v)],[m,Ue(l+h,a+d,p+v)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:Re}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=Qe(n),l=Qe(o),a=Qe(c),p=Qe(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(Qe(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=Qe(n),l=Qe(o),a=Qe(c),p=Qe(i);return{ps:u,_ps:[[f*(a+l)+l,f*(Qe(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=Qe(n),a=Qe(e),p=Qe(i),h=Qe(s),d=Qe(c),v=Qe(u);return{ps:f,_ps:[[l*(h+p)+p,l*(v+d)+d],[a*(h+p)+p,a*(v+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*qe*r[0][0],s=3*qe*r[1][0],u=e[0][1],f=e[1][1],l=3*qe*r[0][1],a=3*qe*r[1][1],p=Ge(o-c,i-s),h=Ue(o+c,i+s);return[[p,Ge(u-l,f-a)],[h,Ue(u+l,f+a)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Ye(t,n);let i;if(4===t.length)i=Le(t,[0,n]).map(t=>8*je*t);else if(3===t.length)i=Le(t,[0,n]).map(t=>5*je*t);else if(2===t.length)i=Le(t,[0,n]).map(t=>2*je*t);else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}function Ze(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}const Je=Z,Ke=Number.EPSILON;function tr(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function nr(t){return[2*t[0],2*t[1]]}function er(t){return[4*t[0],4*t[1]]}const rr=tr,or=Ut,ir=Hn,cr=Gn,sr=nr,ur=er,fr=$t;function lr(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,v]=n,g=rr(c,d),m=rr(u,d),x=rr(l,d),b=rr(p,d),w=rr(s,v),_=rr(f,v),M=rr(a,v),I=rr(h,v),S=cr(g,g),y=ir(6,cr(g,m)),O=ir(6,cr(g,x)),C=sr(cr(g,b)),N=ir(9,cr(m,m)),E=ir(18,cr(m,x)),T=ir(6,cr(m,b)),P=ir(9,cr(x,x)),k=ir(6,cr(x,b)),A=cr(b,b),B=cr(w,w),z=ir(6,cr(w,_)),F=ir(6,cr(w,M)),Y=sr(cr(w,I)),D=ir(9,cr(_,_)),L=ir(18,cr(_,M)),X=ir(6,cr(_,I)),q=ir(9,cr(M,M)),W=ir(6,cr(M,I)),j=cr(I,I),H=or(T,P),V=or(C,E),Q=or(O,N),R=or(X,q),G=or(Y,L),U=or(F,D);return[ir(6,or(or(or(or(fr(A,k),fr(S,y)),H),fr(Q,V)),or(or(or(fr(j,W),fr(B,z)),R),fr(U,G)))),ir(5,or(fr(or(or(k,ir(5,y)),ir(3,V)),sr(or(or(H,sr(Q)),ir(3,S)))),fr(or(or(W,ir(5,z)),ir(3,G)),sr(or(or(R,sr(U)),ir(3,B)))))),ur(or(fr(fr(H,ir(3,fr(V,sr(Q)))),ir(5,fr(sr(y),ir(3,S)))),fr(fr(R,ir(3,fr(G,sr(U)))),ir(5,fr(sr(z),ir(3,B)))))),ir(3,or(fr(V,sr(fr(sr(Q),ir(5,fr(y,sr(S)))))),fr(G,sr(fr(sr(U),ir(5,fr(z,sr(B)))))))),sr(or(fr(Q,ir(5,fr(y,ir(3,S)))),fr(U,ir(5,fr(z,ir(3,B)))))),or(fr(y,ir(6,S)),fr(z,ir(6,B)))]}const ar=tr,pr=Ut,hr=Hn,dr=Gn,vr=nr,gr=$t,mr=er;function xr(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=ar(e,u),a=ar(o,u),p=ar(c,u),h=ar(r,f),d=ar(i,f),v=ar(s,f),g=dr(l,l),m=dr(l,a),x=dr(l,p),b=dr(a,a),w=dr(a,p),_=dr(p,p),M=dr(h,h),I=dr(h,d),S=dr(h,v),y=dr(d,d),O=dr(d,v),C=dr(v,v),N=pr(S,vr(y)),E=pr(x,vr(b));return[pr(gr(pr(pr(C,M),vr(N)),mr(pr(O,I))),gr(pr(pr(_,g),vr(E)),mr(pr(w,m)))),hr(3,pr(pr(gr(O,N),gr(hr(3,I),M)),pr(gr(w,E),gr(hr(3,m),g)))),pr(gr(N,hr(3,gr(vr(I),M))),gr(E,hr(3,gr(vr(m),g)))),pr(gr(I,M),gr(m,g))]}function br(t){return[-2*t[0],-2*t[1]]}const wr=Gt,_r=Ut,Mr=br;function Ir(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=wr(u,u),h=wr(u,f),d=wr(f,f),v=wr(l,l),g=wr(l,a),m=wr(a,a),x=_r(h,g),b=_r(v,p);return[_r(_r(d,m),_r(b,Mr(x))),$t(x,b)]}function Sr(t){const n=[];for(let e=0;e<t.length;e++)n.push(2*t[e]);return n}function yr(t){const n=[];for(let e=0;e<t.length;e++)n.push(-2*t[e]);return n}const Or=Z,Cr=nt,Nr=Sr,Er=yr,Tr=Z,Pr=nt,kr=Sr;function Ar(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const Br=Z,zr=yr,{abs:Fr}=Math;function Yr(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=Fr(e[0]),s=Fr(e[1]),u=Fr(r[0]),f=Fr(r[1]),l=Fr(o[0]),a=Fr(o[1]),p=Fr(i[0]),h=Fr(i[1]),d=Fr(n[0]),v=Fr(n[1]),g=c+d,m=u+d,x=l+d,b=p+d,w=s+v,_=f+v,M=a+v,I=h+v,S=g*g,y=6*g*m,O=6*x*b,C=w*w,N=6*w*_,E=6*M*I,T=6*m*b+9*x*x,P=2*g*b+18*m*x,k=6*g*x+9*m*m,A=6*_*I+9*M*M,B=2*w*I+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+O+(S+y)+T+(k+P)+(I*I+E+(C+N)+A+(z+B))),5*(O+5*y+3*P+2*(T+2*k+3*S)+(E+5*N+3*B+2*(A+2*z+3*C))),4*(T+3*(P+2*k)+5*(2*y+3*S)+(A+3*(B+2*z)+5*(2*N+3*C))),3*(P+2*(2*k+5*(y+2*S))+(B+2*(2*z+5*(N+2*C)))),2*(k+5*(y+3*S)+(z+5*(N+3*C))),y+6*S+(N+6*C)]}function Dr(t,n){const e=t[0],r=t[1],o=t[2],i=Fr(e[0]),c=Fr(e[1]),s=Fr(r[0]),u=Fr(r[1]),f=Fr(o[0]),l=Fr(o[1]),a=Fr(n[0]),p=Fr(n[1]),h=i+a,d=s+a,v=f+a,g=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*v,M=g*g,I=g*m,S=m*x,y=g*x+m*m*2,O=h*v+d*d*2;return[x*x+M+2*y+4*(S+I)+(v*v+b+2*O+4*(_+w)),3*(S+y+(3*I+M)+(_+O+(3*w+b))),y+3*(2*I+M)+(O+3*(2*w+b)),I+M+(w+b)]}function Lr(t,n){const e=t[0],r=t[1],o=Fr(e[0]),i=Fr(e[1]),c=Fr(r[0]),s=Fr(r[1]),u=Fr(n[0]),f=Fr(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,v=p*p+l*l;return[a*a+h*h+2*d+v,d+v]}function Xr(t,n){const e=t.length-1;if(3===e)return{polyDd:lr(t,n),polyE:Yr(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,v]=n,g=Or(c,d),m=Or(u,d),x=Or(l,d),b=Or(p,d),w=Or(s,v),_=Or(f,v),M=Or(a,v),I=Or(h,v),S=et(g,g),y=Cr(6,et(g,m)),O=Cr(6,et(g,x)),C=Nr(et(g,b)),N=Cr(9,et(m,m)),E=Cr(18,et(m,x)),T=Cr(6,et(m,b)),P=Cr(9,et(x,x)),k=Cr(6,et(x,b)),A=et(b,b),B=et(w,w),z=Cr(6,et(w,_)),F=Cr(6,et(w,M)),Y=Nr(et(w,I)),D=Cr(9,et(_,_)),L=Cr(18,et(_,M)),X=Cr(6,et(_,I)),q=Cr(9,et(M,M)),W=Cr(6,et(M,I)),j=et(I,I),H=J(T,P),V=J(C,E),Q=J(O,N),R=J(X,q),G=J(Y,L),U=J(F,D),$=it(J(J(A,S),J(H,Q)),J(J(V,k),y)),Z=it(J(J(j,B),J(R,U)),J(J(G,W),z)),K=Cr(6,J($,Z)),tt=J(Er(J(J(H,Nr(Q)),Cr(3,S))),J(J(k,Cr(3,V)),Cr(5,y))),nt=J(Er(J(J(R,Nr(U)),Cr(3,B))),J(J(W,Cr(3,G)),Cr(5,z))),rt=Cr(5,J(tt,nt)),ot=J(J(H,Cr(3,it(Nr(Q),V))),Cr(5,it(Cr(3,S),Nr(y)))),ct=J(J(R,Cr(3,it(Nr(U),G))),Cr(5,it(Cr(3,B),Nr(z)))),st=Cr(4,J(ot,ct)),ut=it(V,Nr(it(Nr(Q),Cr(5,it(y,Nr(S)))))),ft=it(G,Nr(it(Nr(U),Cr(5,it(z,Nr(B)))))),lt=Cr(3,J(ut,ft)),at=it(Q,Cr(5,it(y,Cr(3,S)))),pt=it(U,Cr(5,it(z,Cr(3,B))));return[K,rt,st,lt,Nr(J(at,pt)),J(it(y,Cr(6,S)),it(z,Cr(6,B)))].map(Ln)}(t,n)};if(2===e)return{polyDd:xr(t,n),polyE:Dr(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=Tr(e,u),a=Tr(o,u),p=Tr(c,u),h=Tr(r,f),d=Tr(i,f),v=Tr(s,f),g=et(l,l),m=et(l,a),x=et(l,p),b=et(a,a),w=et(a,p),_=et(p,p),M=et(h,h),I=et(h,d),S=et(h,v),y=et(d,d),O=et(d,v),C=et(v,v),N=J(S,kr(y)),E=J(x,kr(b)),T=J(it(J(_,kr(E)),Ar(J(w,m))),g),P=J(it(J(C,kr(N)),Ar(J(O,I))),M),k=J(T,P),A=J(it(w,E),it(Pr(3,m),g)),B=J(it(O,N),it(Pr(3,I),M));return[k,Pr(3,J(A,B)),J(it(N,Pr(3,it(kr(I),M))),it(E,Pr(3,it(kr(m),g)))),J(it(I,M),it(m,g))].map(Ln)}(t,n)};if(1===e)return{polyDd:Ir(t,n),polyE:Lr(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=Br(e,c),f=Br(o,c),l=Br(r,s),a=Br(i,s),p=et(u,u),h=et(u,f),d=et(f,f),v=et(l,l),g=et(l,a),m=et(a,a),x=J(h,g),b=J(v,p);return[J(J(d,m),J(zr(x),b)),it(x,b)].map(Ln)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}const{sqrt:qr}=Math;function Wr(t,n,e=0,r=1){const{polyDd:o,polyE:i,getPolyExact:c}=Xr(t,n),s=Fe(o,e,r,i,c)||[];s.push({t:e,tS:e,tE:e,multiplicity:1}),s.push({t:r,tS:r,tE:r,multiplicity:1});const u=s.map(e=>{const r=$e(t,[e.tS,e.tE]),o=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=Je(t,u),r=Je(n,f),o=rt(J(et(e,e),et(r,r))),i=o*(1-Ke),c=o*(1+Ke);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(r,n);return{p:Ze(r),t:e.t,d:(qr(o[0])+qr(o[1]))/2,dSquaredI:o,box:r,ri:e}});let f=Number.POSITIVE_INFINITY;for(let t=0;t<u.length;t++){const n=u[t].dSquaredI[1];n<f&&(f=n)}const l=[];for(let t=0;t<u.length;t++){const n=u[t];n.dSquaredI[0]<=f&&l.push(n)}return l}function jr(t){return(t.tS+t.tE)/2}function Hr(t){const n=t.xs;if(4===n.length){let t=0,e=0;for(let r=0;r<n.length;r++)0===n[r].x.kind&&t++,4===n[r].x.kind&&e++;if(2===t&&2===e)return!0}return n.length<=2&&7!==n[0].x.kind}function Vr(t){const n=(t=Ln(t)).length;return 2===n?t:n<=1?[0,t[0]]:[t[n-2],t[n-1]]}const{abs:Qr,min:Rr,max:Gr,log2:Ur,ceil:$r}=Math;function Zr(t,n){const{tS:e,tE:r}=t,o=r-e;if(0===o)return[{tS:[0,e],tE:[0,e],multiplicity:t.multiplicity}];const i=2**$r(Ur(o)),c=function(t,n,e){return Zn($n(t,e),n)}(n,i,e),s=c.map(Vr),u=s.map(t=>t[1]*kn**2),f=Fe(s,0,1,u,()=>c),l=[];for(const t of f)l.push({tS:lt(e,t.tS*i),tE:lt(e,t.tE*i),multiplicity:t.multiplicity});return l}function Jr(t,n){return ct(it(t,n))}const{abs:Kr}=Math;function to(t,n){const e=t.inOuts;e.sort(function(t){return(n,e)=>{let r=n.side-e.side;if(0!==r)return r;const o=n.sideX,i=e.sideX;r=o.ri.tS-i.ri.tS;const c=8*Number.EPSILON;return Kr(r)>=c?r:(o.compensated||(o.compensated=1,o.riExp=Zr(o.ri,o.getPExact())[0]),i.compensated||(i.compensated=1,i.riExp=Zr(i.ri,i.getPExact())[0]),r=Jr(o.riExp.tS,i.riExp.tS),0!==r?r:(r=n.dir-e.dir,0!==r?t*r:1===n.dir?n.idx-e.idx:e.idx-n.idx))}}(n));let r=e[e.length-1];for(let t=0;t<e.length;t++){const n=e[t];n.prevAround=r,r.nextAround=n,r=n}}function no(t,n,e,r){const o=function(t,n){return(e,r,o)=>{t.has(e)||(e.orientation=r,e.parent=o,e.windingNum=o.windingNum+e.orientation,n.push(e))}}(r,e);to(t.container,n.orientation);let i,c,s=1,u=t,f=n.orientation;for(;u=1===n.orientation?u.nextAround:u.prevAround,u!==t;){const t=s;s-=u.dir,1===s&&(f*=-1),-1!==u.dir&&(i?1===t&&0===s?o(u,n.orientation,n.parent):0===t&&-1===s&&o(u,-n.orientation,n.parent):0===s?i=u:1===s&&o(u,n.orientation,n))}return Hr(t.container)||(c=[t.p,i.p]),{inOutToUse:i,additionalBezier:c}}function eo(t,n){const e=t._x_,r=n._x_,o=e.curve,i=e.x.ri.tS,c=r.curve,s=r.x.ri.tS;let u=o,f=i;Hr(t.container)||(f=jr(Wr(o.ps,t.p)[0].ri));const l=[];for(;;){if(u===c&&(f<s||f===s&&0!==l.length)){const t=u.ps,n=[f,s];return l.push({ps:t,ts:n}),l}{const t=u.ps,n=[f,1];l.push({ps:t,ts:n})}f=0,u=u.next}}function ro(t,n){const e=n._x_,r=t._x_,o=r.curve,i=r.x.ri.tS,c=e.curve,s=e.x.ri.tS;let u=o,f=i;Hr(t.container)||(f=jr(Wr(u.ps,t.p)[0].ri));const l=[];for(;;){const t=u.ps;if(u===c&&(f>s||f===s&&0!==l.length)){const n=[f,s];return l.push({ps:t,ts:n}),l}{const n=[f,0];l.push({ps:t,ts:n})}f=1,u=u.prev}}function oo(t,n,e,r){const o=function(t,n,e){return(r,o,i,c)=>{n.has(r)||1!==r.dir||(r.loopsIdxs=new Set(c),r.orientation=o*t.orientation,r.parent=i.parent,r.windingNum=i.windingNum+r.orientation,e.unshift(r))}}(n,r,e);to(t.container,1);let i=t.nextAround,c=t;const s=[],u=new Set(n.loopsIdxs);for(;c=c.nextAround,c!==t;)o(c,n.dir,n,u),s.push(c.idx),-1===c.dir?u?.add(c._x_?.curve.loop.idx):u.delete(c._x_?.curve.loop.idx);let f;return Hr(t.container)||(f=[t.p,i.p]),{inOutToUse:i,additionalBezier:f}}function io(t){const{ps:n,ts:e}=t;return P(n,e[0],e[1])}function co(t,n,e){const r=[],o=[];let i,c=n;const s=e?oo:no,u=[];do{t.add(c),u.push(c);const e=c.nextOrPrev;t.add(e);const f=1===c.dir?eo(c,e):ro(c,e);o.push(...f);const l=s(e,n,r,t);if(({inOutToUse:c,additionalBezier:i}=l),void 0!==i){const t=io(o[o.length-1]),n={ps:t,ts:[0,jr(Wr(t,i[0])[0].ri)]};o.pop(),o.push(n),o.push({ps:i,ts:[0,1]})}}while(c!==n);return"undefined"!=typeof _debug_&&_debug_.verbose&&function(t){const n=[],e=[];for(let r of t)e.push(1===r.dir?"color: blue;":"color: red"),n.push(`%c${r.idx}`)}(u),{bezierPieces:o,additionalOutsToCheck:r}}function so(t,n,e,r){const o=[t];for(;o.length;){const t=o.pop();if(n.add(t._x_.curve.loop),e.has(t))continue;t.children=new Set;const{bezierPieces:i,additionalOutsToCheck:c}=co(e,t,r);t.bezierPieces=i,t.parent.children=t.parent.children||new Set,t.parent.children.add(t);for(let t=0;t<c.length;t++)o.push(c[t])}}function uo(t){if(4===t.length)return fo(t);if(3===t.length)return lo(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n,n],[o-e,e]]}(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[n],[e]]}(t);throw new Error("The given bezier curve must be of order <= 3.")}function fo(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[s-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-c),3*(c+e-2*o),3*(o-e),e]]}function lo(t){const[[n,e],[r,o],[i,c]]=t;return[[i+n-2*r,2*(r-n),n],[c+e-2*o,2*(o-e),e]]}function ao(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=U(t),c=Fe(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=$e(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}return{minY:r,maxY:o}}function po(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=U(t),c=Fe(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=$e(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}return{minX:r,maxX:o}}(t),e=ao(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const ho=D(po);function vo(t){const n=U(t),e=Fe(n[0],0,1)?.map(t=>t.t)||[],r=Fe(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=Ye(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Ye(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}const go=D(vo),{min:mo,max:xo}=Math;function bo(t){const n=t.map(go);return{minX:mo(...n.map(t=>t.box[0][0])),maxX:xo(...n.map(t=>t.box[1][0])),minY:mo(...n.map(t=>t.box[0][1])),maxY:xo(...n.map(t=>t.box[1][1]))}}const wo=new Function("try {return this===window;}catch(e){ return false;}")()?function(t){const n=window.atob(t),e=n.length,r=new Uint8Array(e);for(let t=0;t<e;t++)r[t]=n.charCodeAt(t);return r.buffer}:function(t){return function(t){const n=new ArrayBuffer(t.length),e=new Uint8Array(n);for(let n=0;n<t.length;++n)e[n]=t[n];return n}(Buffer.from(t,"base64"))},_o=wo("AGFzbQEAAAABBgFgAX8BfAMDAgAABQMBAAAHHwMGbWVtb3J5AgAHc3F1YXJlcwAACHNxdWFyZXM0AAEKjgECPwECfiAArULHuuXf9tjQm2p+IgEgASABfnxCIIoiAiACfiABQse65d/22NCbanx8QiCKIgIgAn4gAXxCIIi6C0wBAn4gAK1Cx7rl3/bY0JtqfiIBQse65d/22NCbanwiAiABIAIgASABIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiLoL"),Mo=new WebAssembly.Module(_o),Io=new WebAssembly.Instance(Mo),So=Io.exports.squares;Io.exports.squares4;const yo=1e-6;function Oo(t,n){let e;const r=[t];for(;r.length;)o(r.pop());return e;function o(o){if(o===t||function(t,n){let e=0;do{e++;const o=So(e)/4294967296,i=r(t,n,Ye(t[So(e+1e3)%t.length],o));if(void 0!==i)return i}while(e<100);return;function r(t,n,e){if(function(t,n){const e=bo(t),r=bo(n);return e.minX<r.minX||e.maxX>r.maxX||e.minY<r.minY||e.maxY>r.maxY}(t,n))return!1;const r=function(t,n){const[e,r]=n;let o=0;for(let i=0;i<t.length;i++){const c=t[i],[[s,u],[f,l]]=ho(c);let a=u>r||l<r||!1;if(a=a||s>e||!1,a)continue;const p=[];let h,d,v;const g=!0;h=t=>uo(t)[1],d=[0,-r],v=0;const m=c.map(V(d)),x=h(m),b=Fe(x,0-yo,1+yo)?.map(t=>t.t)||[];for(let t=0;t<b.length;t++){const e=b[t];if(Math.abs(e)<yo||Math.abs(e-1)<yo)return;const r=Ye(m,e);(g&&n[v]>=r[v]||!g&&n[v]<=r[v])&&p.push(e)}if(1===p.length||3===p.length)for(const t of p){const n=Q($(c,t));if(Math.abs(n[1])<yo)return}o+=p.length}return o}(n,e);return void 0!==r?r%2!=0:void 0}}(n.beziers,o.bezierPieces.map(io))){e=o;for(const t of o.children)r.push(t)}}}function Co(t,n){return No(t)-No(n)}function No(t){let n=Number.POSITIVE_INFINITY;for(const e of t){const t=go(e).box[0][1];t<n&&(n=t)}return n}const{abs:Eo,sign:To}=Math;function Po(t){let n=t.parent;for(;;){if(void 0===n)return!1;if(n.used)return!0;n=n.parent}}function ko(t,n,e){let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;o>c&&([o,c]=[c,o]),u>l&&([u,l]=[l,u]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]);const a=t||r===i&&s===f,p=t||o===c&&u===l;return(a?r<=f:r<f)&&(a?i>=s:i>s)&&(p?u<=c:u<c)&&(p?l>=o:l>o)}function Ao(t,n){return ko(!0,t.box,n.box)}function Bo(t,n){for(let e=0;e<n.length;e++){const r=n[e];zo(t,[r.a,r.b])}}function zo(t,n){const[e,r]=n;let o=t.get(e);o||(o=[],t.set(e,o));let i=t.get(r);i||(i=[],t.set(r,i)),o.push(r),i.push(e)}function Fo(t,n,e,r){e.add(n),r.push(n);const o=t.get(n);for(let n=0;n<o.length;n++){const i=o[n];e.has(i)||Fo(t,i,e,r)}}function Yo(t){const n=[],e=new Set;for(const r of t){const o=r[0];e.has(o)||(n.push([]),Fo(t,o,e,n[n.length-1]))}return n}function Do(t,n){const e=new Set;for(const t of n)for(const n of t)e.add(n);const r=[];for(let n=0;n<t.length;n++){const o=t[n];e.has(o)||r.push(o)}return r}function Lo(t){const n=[];for(const e of t){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const c=[];for(const n of e){const[[e,s],[u,f]]=n.box;e<t&&(t=e),s<r&&(r=s),u>o&&(o=u),f>i&&(i=f),c.push(...n.xs)}const s={box:[[t,r],[o,i]],xs:c,inOuts:void 0};n.push(s)}return n}function Xo(t){return{tS:[0,t.tS],tE:[0,t.tE],multiplicity:t.multiplicity}}function qo(t,n){const e=t[0],r=t[1],o=r+n,i=o-r,c=e+(r-(o-i)+(n-i)),s=o+c;return[c-(s-o),s]}const Wo=tr,jo=Hn,Ho=Ut,Vo=qo,{abs:Qo}=Math;function Ro(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Wo(s,n),l=Wo(r,i),a=3*(r-i),p=jo(3,l),h=Qo(a),d=Ho(f,p),v=h+Qo(s-n+a),g=Wo(i,2*r),m=Vo(g,n),x=Qo(i-2*r+n),b=jo(3,m),w=6*x,_=Wo(r,n),M=jo(3,_),I=Qo(3*(r-n)),S=Wo(u,e),y=Wo(o,c),O=3*(o-c),C=jo(3,y),N=Qo(O),E=Ho(S,C),T=N+Qo(u-e+O),P=Wo(c,2*o),k=Vo(P,e),A=Qo(c-2*o+e),B=jo(3,k),z=6*A,F=Wo(o,e);return{coeffs:[[d,b,M,[0,n]],[E,B,jo(3,F),[0,e]]],errorBound:[[v,w,I,0],[T,z,Qo(3*(o-e)),0]]}}function Go(t){const[[n,e],[r,o],[i,c]]=t,s=i-2*r,u=Wo(i,2*r),f=Vo(u,n),l=Qo(s+n),a=Wo(2*r,2*n),p=c-2*o,h=Wo(c,2*o),d=Vo(h,e),v=Qo(p+e);return{coeffs:[[f,a,[0,n]],[d,Wo(2*o,2*e),[0,e]]],errorBound:[[l,0,0],[v,0,0]]}}function Uo(t){const[[n,e],[r,o]]=t;return[[Wo(r,n),[0,n]],[Wo(o,e),[0,e]]]}const $o=$t,Zo=Hn,Jo=ot,{abs:Ko}=Math;function ti(t){const[[n,[,e]],[r,[,o]]]=Uo(t),i=Jo(r),c=n,s=Zo(o,n),u=Ko(s[1]),f=Zo(e,r),l=Ko(f[1]),a=$o(f,s);return{coeffs:{vₓ:i,vᵧ:c,v:a},errorBound:{v_:u+l+Ko(a[1])}}}const{abs:ni}=Math,ei=Ut,ri=Hn,oi=Gn;function ii(t){return[-t[0],-t[1]]}const ci=ii,si=nr,ui=Hn,fi=Gn,li=$t,{abs:ai}=Math;function pi(t){const{coeffs:[[n,e,[,r]],[o,i,[,c]]],errorBound:[[s],[u]]}=Go(t),f=n[1],l=e[1],a=o[1],p=i[1],h=ai(r),d=ai(l),v=ai(f),g=ai(c),m=ai(p),x=ai(a),b=fi(n,i),w=s*m+2*ai(f*p),_=fi(e,o),M=d*u+2*ai(l*a),I=ui(c,n),S=g*s+ai(c*f),y=ui(r,o),O=h*u+ai(r*a),C=ui(c,e),N=ai(c*l),E=ui(r,i),T=ai(r*p),P=fi(n,n),k=2*(s*v+ai(f*f)),A=fi(n,o),B=s*x+v*u+2*ai(f*a),z=fi(o,o),F=2*(u*x+ai(a*a)),Y=f*p-l*a,D=f*c-r*a,L=l*c-r*p,X=li(b,_),q=ai(Y),W=w+M+q,j=li(I,y),H=ai(D),V=S+O+H,Q=li(C,E),R=ai(L),G=N+T+R,U=ci(z),$=F,Z=si(A),J=2*B,K=ci(P),tt=k,nt=p*Y,et=fi(i,X),rt=m*W+2*ai(nt),ot=2*D*a,it=si(fi(o,j)),ct=2*(u*H+x*V+2*ai(ot)),st=nt-ot,ut=li(et,it),ft=rt+ct+ai(st),lt=2*f*D,at=si(fi(n,j)),pt=2*(s*H+v*V+2*ai(lt)),ht=l*Y,dt=fi(e,X),vt=d*W+2*ai(ht),gt=lt-ht,mt=li(at,dt),xt=pt+vt+ai(gt),bt=Y*L,wt=fi(X,Q),_t=W*R+q*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ci=Gt,Ni=nr,Ei=Hn,Ti=Gn,Pi=Ut,{abs:ki}=Math,Ai=Ut,Bi=Hn,zi=Gn,{abs:Fi}=Math,Yi=Gt,Di=nr,Li=Hn,Xi=Gn,qi=Ut,{abs:Wi}=Math,ji=Gt,Hi=nr,Vi=Hn,Qi=Gn,Ri=Ut,{abs:Gi}=Math,Ui=Ut,$i=Hn,Zi=Gn,{abs:Ji}=Math,Ki=Gt,tc=nr,nc=Hn,ec=Gn,rc=Ut,{abs:oc}=Math,ic=Gt,cc=nr,sc=Hn,uc=Gn,fc=Ut,{abs:lc}=Math,ac=Z,pc=lt,hc=nt,dc=at;function vc(t){if(4===t.length)return gc(t);if(3===t.length)return mc(t);if(2===t.length)return xc(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[[n]],[[e]]]}(t);throw new Error("The given bezier curve must be of order <= cubic.")}function gc(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[J(ac(s,n),hc(3,ac(r,i))),hc(3,dc(pc(i,n),-2*r)),hc(3,ac(r,n)),[n]].map(Ln),[J(ac(u,e),hc(3,ac(o,c))),hc(3,dc(pc(c,e),-2*o)),hc(3,ac(o,e)),[e]].map(Ln)]}function mc(t){const[[n,e],[r,o],[i,c]]=t;return[[dc(pc(i,n),-2*r),ac(2*r,2*n),[n]],[dc(pc(c,e),-2*o),ac(2*o,2*e),[e]]]}function xc(t){const[[n,e],[r,o]]=t;return[[ac(r,n),[n]],[ac(o,e),[e]]]}const bc=nt,wc=ot;function _c(t){const[[n,[e]],[r,[o]]]=t;if(0!==ct(n)||0!==ct(r))return{vₓ:wc(r),vᵧ:n,v:Ln(it(bc(e,r),bc(o,n)))}}const Mc=nt,Ic=et,Sc=J;function yc(t,n){const e=xc(t),[[r,[o]],[i,[c]]]=xc(n),{vₓ:s,vᵧ:u,v:f}=_c(e),l=Ic(r,s),a=Ic(i,u),p=Sc(l,a),h=Mc(o,s),d=Mc(c,u),v=Sc(h,d);return[p,Sc(v,f)].map(Ln)}const Oc=nt,Cc=Sr,Nc=it,Ec=et,Tc=ot;function Pc(t){const[[n,e,[r]],[o,i,[c]]]=t;if(0===ct(n)&&0===ct(o))return _c([[e,[r]],[i,[c]]]);const s=Ec(n,i),u=Ec(e,o),f=Oc(c,n),l=Oc(r,o),a=Oc(c,e),p=Oc(r,i),h=Ec(n,n),d=Ec(n,o),v=Ec(o,o),g=Nc(s,u),m=Nc(f,l),x=Nc(a,p),b=Ln(Tc(v)),w=Ln(Cc(d)),_=Ln(Tc(h)),M=Ec(i,g),I=Cc(Ec(o,m)),S=Ln(Nc(M,I)),y=Cc(Ec(n,m)),O=Ec(e,g),C=Ln(Nc(y,O)),N=Ec(g,x),E=Ec(m,m);return{vₓₓ:b,vₓᵧ:w,vᵧᵧ:_,vₓ:S,vᵧ:C,v:Ln(Nc(N,E))}}const kc=ne,Ac=nt,Bc=et,zc=J,Fc=Sr;function Yc(t,n){const e=mc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return yc([t[0],t[2]],n);const[[r,[o]],[i,[c]]]=xc(n),{vₓₓ:s,vₓᵧ:u,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=Pc(e),h=kc(o,o),d=Ac(o,r),v=kc(o,c),g=Ac(o,i),m=Bc(r,r),x=Ac(c,r),b=Bc(r,i),w=kc(c,c),_=Ac(c,i),M=Bc(i,i),I=Bc(m,s),S=Bc(M,f),y=Bc(b,u),O=zc(I,S),C=zc(O,y),N=Bc(d,s),E=Bc(_,f),T=zc(g,x),P=Bc(T,u),k=Fc(zc(N,E)),A=zc(k,P),B=Bc(r,l),z=Bc(i,a),F=zc(B,z),Y=zc(A,F),D=Bc(h,s),L=Bc(v,u),X=Bc(w,f),q=zc(D,L),W=zc(q,X),j=Ac(o,l),H=Ac(c,a),V=zc(j,H),Q=zc(W,V);return[C,Y,zc(Q,p)].map(Ln)}const Dc=et,Lc=Z,Xc=tt,qc=lt;function Wc(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[rt(it(Xc(qc(c/4,u/4),3),qc(t/4,l/4))),rt(it(Xc(qc(s/4,f/4),3),qc(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Lc(o,e),a=Lc(i,r),p=Lc(u,c),h=Lc(f,s),d=it(Dc(p,a),Dc(h,l));if(0===ct(d))return;const v=Lc(c,e),g=Lc(s,r),m=rt(it(Dc(g,l),Dc(v,a)))/rt(d);return[c+m*rt(p),s+m*rt(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}const jc=nt,Hc=et,Vc=J,Qc=it,Rc=ot,Gc=Sr;function Uc(t){const[[n,e,r,[o]],[i,c,s,[u]]]=t;if(0===ct(n)&&0===ct(i))return Pc([[e,r,[o]],[c,s,[u]]]);const f=Hc(n,s),l=Hc(r,i),a=Hc(n,c),p=Hc(e,c),h=Hc(e,i),d=Hc(n,n),v=Hc(c,c),g=Hc(i,i),m=Hc(r,n),x=Hc(e,e),b=Hc(s,i),w=Hc(c,i),_=Hc(e,n),M=Hc(n,i),I=jc(u,n),S=jc(o,i),y=jc(u,e),O=jc(o,c),C=Hc(e,s),N=Hc(r,c),E=jc(u,r),T=jc(o,s),P=Qc(I,S),k=Qc(f,l),A=Qc(a,h),B=Qc(y,O),z=Qc(C,N),F=Qc(E,T),Y=Qc(b,v),D=Qc(m,x),L=Vc(h,a),X=Vc(l,f),q=Gc(k),W=Hc(P,P),j=Hc(P,k),H=Hc(P,A),V=Hc(P,z),Q=Hc(k,k),R=Hc(q,B),G=Hc(A,B),U=Hc(A,z),$=Hc(A,F),Z=Ln(Hc(Rc(i),g)),J=Ln(Hc(jc(3,n),g)),K=Ln(Hc(jc(-3,i),d)),tt=Ln(Hc(n,d)),nt=Qc(jc(-3,P),z),et=Hc(nt,g),rt=Hc(A,Y),ot=Vc(et,rt),it=Hc(q,w),st=Ln(Vc(ot,it)),ut=Hc(nt,d),ft=Hc(A,D),l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f),Y=Jc(i,u),D=Jc(i,l),L=Kc(z,Y),X=Kc(F,D),q=Jc(_,L),W=Jc(O,X),j=Kc(q,W),H=Kc(N,T),V=ts(Kc(E,k)),Q=Kc(P,B),R=Kc(H,a),G=Kc(V,p),U=Kc(Q,h),$=Jc(_,R),Z=Jc(I,G),J=Jc(O,U),K=Kc($,Z),tt=Kc(K,J),nt=ts(Kc(T,a)),et=ts(Kc(P,h)),rt=Kc(N,nt),ot=Kc(B,et),it=Kc(E,p),st=Kc(k,p),ut=Jc(x,rt),ft=Jc(y,ot),lt=Jc(w,it),at=Jc(M,st),pt=Jc(r,d),ht=Jc(i,v),dt=Kc(ut,ft),vt=Kc(lt,at),gt=Kc(dt,vt),mt=Kc(pt,ht),xt=Kc(gt,mt),bt=Kc(C,T),wt=Kc(A,P),_t=Kc(bt,a),Mt=Kc(wt,h),It=Jc(m,_t),St=Jc(S,Mt),yt=Jc(b,p),Ot=Kc(It,St),Ct=Kc(Ot,yt),Nt=Zc(o,d),Et=Zc(c,v),Tt=Kc(Nt,Et),Pt=Kc(Ct,Tt);return[j,tt,xt,Kc(Pt,g)].map(Ln)}const es=nt,rs=et,os=J;function is(t,n){const e=xc(t),[[r,o,[i]],[c,s,[u]]]=mc(n);if(0===ct(r)&&0===ct(c))return yc(t,[n[0],n[2]]);const{vₓ:f,vᵧ:l,v:a}=_c(e),p=rs(r,f),h=rs(c,l),d=os(p,h),v=rs(o,f),g=rs(s,l),m=os(v,g),x=es(i,f),b=es(u,l),w=os(x,b);return[d,m,os(w,a)].map(Ln)}const cs=ne,ss=nt,us=et,fs=J,ls=Sr;function as(t,n){const e=mc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return is([t[0],t[2]],n);const[[r,o,[i]],[c,s,[u]]]=mc(n);if(0===ct(r)&&0===ct(c))return Yc(t,[n[0],n[2]]);const{vₓₓ:f,vₓᵧ:l,vᵧᵧ:a,vₓ:p,vᵧ:h,v:d}=Pc(e),v=cs(i,i),g=ss(i,o),m=ss(i,r),x=cs(i,u),b=ss(i,s),w=ss(i,c),_=us(o,o),M=us(o,r),I=ss(u,o),S=us(o,s),y=us(o,c),O=us(r,s),C=us(r,r),N=ss(u,r),E=us(r,c),T=cs(u,u),P=ss(u,s),k=ss(u,c),A=us(s,s),B=us(s,c),z=us(c,c),F=us(C,f),Y=us(E,l),D=us(z,a),L=fs(F,Y),X=fs(L,D),q=us(M,f),W=us(B,a),j=fs(y,O),H=us(j,l),V=ls(fs(q,W)),Q=fs(V,H),R=fs(ls(m),_),G=fs(ls(k),A),U=fs(w,S),$=fs(U,N),Z=us(R,f),J=us(G,a),K=us($,l),tt=us(r,p),nt=us(c,h),et=fs(Z,J),rt=fs(et,K),ot=fs(tt,nt),it=fs(rt,ot),st=us(g,f),ut=us(P,a),ft=fs(b,I),lt=us(ft,l),at=ls(fs(st,ut)),pt=us(o,p),ht=us(s,h),dt=fs(at,lt),vt=fs(pt,ht),gt=fs(dt,vt),mt=us(v,f),xt=us(x,l),bt=us(T,a),wt=ss(i,p),_t=ss(u,h),Mt=fs(mt,xt),It=fs(Mt,bt),St=fs(wt,_t),yt=fs(It,St);return[X,Q,it,gt,fs(yt,d)].map(Ln)}const ps=ne,hs=nt,ds=et,vs=J,gs=Sr;function ms(t,n){const e=gc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return as(Wc(t),n);const[[r,o,[i]],[c,s,[u]]]=mc(n);if(0===ct(r)&&0===ct(c))return ns(t,[n[0],n[2]]);const{vₓₓₓ:f,vₓₓᵧ:l,vₓᵧᵧ:a,vᵧᵧᵧ:p,vₓₓ:h,vₓᵧ:d,vᵧᵧ:v,vₓ:g,vᵧ:m,v:x}=Uc(e),b=ps(i,i),w=hs(i,o),_=hs(i,r),M=ps(i,u),I=hs(i,s),S=hs(i,c),y=ds(o,o),O=ds(o,r),C=hs(u,o),N=ds(o,s),E=ds(o,c),T=ds(r,s),P=ds(r,r),k=hs(u,r),A=ds(r,c),B=ps(u,u),z=hs(u,s),F=hs(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J),bn=hs(u,Z),wn=hs(u,K),_n=vs(mn,bn),Mn=vs(xn,wn),In=ds(vn,f),Sn=ds(gn,p),yn=ds(_n,l),On=ds(Mn,a),Cn=ds(Z,h),Nn=ds(J,v),En=ds(lt,d),Tn=ds(r,g),Pn=ds(c,m),kn=vs(In,Sn),An=vs(yn,On),Bn=vs(Cn,Nn),zn=vs(kn,An),Fn=vs(Bn,En),Yn=vs(Tn,Pn),Dn=vs(zn,Fn),Xn=vs(Dn,Yn),qn=ds(ps(3,i),w),Wn=ds(ps(3,u),z),jn=hs(i,st),Hn=hs(u,ut),Vn=ds(w,h),Qn=ds(z,v),Rn=ds(I,d),Gn=ds(C,d),Un=gs(vs(Vn,Qn)),$n=vs(Rn,Gn),Zn=ds(o,g),Jn=ds(s,m),Kn=ds(qn,f),te=ds(Wn,p),ne=ds(jn,l),ee=ds(Hn,a),re=vs(Kn,te),oe=vs(ne,ee),ie=vs(re,oe),ce=vs(Un,$n),se=vs(Zn,Jn),ue=vs(ie,ce),fe=vs(ue,se),le=hs(i,f),ae=hs(i,a),pe=hs(u,l),he=hs(u,p),de=vs(le,pe),ve=vs(ae,he),ge=vs(de,h),me=vs(ve,v),xe=ds(b,ge),be=ds(B,me),we=ds(M,d),_e=hs(i,g),Me=hs(u,m),Ie=vs(xe,be),Se=vs(Ie,we),ye=vs(_e,Me),Oe=vs(Se,ye);return[G,yt,Qt,dn,Xn,fe,vs(Oe,x)].map(Ln)}const xs=nt,bs=et,ws=J;function _s(t,n){const e=xc(t),[[r,o,i,[c]],[s,u,f,[l]]]=gc(n);if(0===ct(r)&&0===ct(s))return is(t,Wc(n));const{vₓ:a,vᵧ:p,v:h}=_c(e),d=bs(r,a),v=bs(s,p),g=ws(d,v),m=bs(o,a),x=bs(u,p),b=ws(m,x),w=bs(i,a),_=bs(f,p),M=ws(w,_),I=xs(c,a),S=xs(l,p),y=ws(I,S);return[g,b,M,ws(y,h)].map(Ln)}const Ms=ne,Is=nt,Ss=et,ys=J,Os=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ys(Dt,Lt),Wt=ys(qt,Xt),jt=Ss(o,d),Ht=Ss(u,v),Vt=ys(jt,Ht),Qt=ys(Wt,Vt),Rt=Ss(x,a),Gt=Ss(H,h),Ut=ys(M,N),$t=Ss(Ut,p),Zt=Os(ys(Rt,Gt)),Jt=ys(Zt,$t),Kt=Ss(i,d),tn=Ss(f,v),nn=ys(Kt,tn),en=ys(Jt,nn),rn=Ss(m,a),on=Ss(_,p),cn=Ss(j,h),sn=Is(c,d),un=Is(l,v),fn=ys(rn,on),ln=ys(fn,cn),an=ys(sn,un),pn=ys(ln,an);return[rt,lt,bt,At,Qt,en,ys(pn,g)].map(Ln)}const Ns=ne,Es=nt,Ts=et,Ps=J,ks=Sr,As=[[function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=ti(t),[[c,[,s]],[u,[,f]]]=Uo(n),l=c[1],a=u[1],p=e[1],h=r[1],d=o[1],v=l*p,g=2*ni(v),m=oi(c,e),x=a*h,b=2*ni(x),w=oi(u,r),_=v+x,M=ei(m,w),I=g+b+ni(_),S=s*p,y=ri(s,e),O=ni(S),C=f*h,N=ri(f,r),E=ni(C),T=S+C,P=ei(y,N),k=O+E+ni(T);return{coeffs:[M,ei(P,o)],errBound:[I,k+i+ni(T+d)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=ti(t),{coeffs:[[c,s,[,u]],[f,l,[,a]]],errorBound:[[p],[h]]}=Go(n),d=e[1],v=r[1],g=o[1],m=Fi(d),x=Fi(v),b=s[1],w=c[1],_=l[1],M=f[1],I=w*d,S=zi(c,e),y=p*m+2*Fi(I),O=M*v,C=zi(f,r),N=h*x+2*Fi(O),E=I+O,T=Ai(S,C),P=y+N+Fi(E),k=b*d,A=zi(s,e),B=2*Fi(k),z=_*v,F=zi(l,r),Y=2*Fi(z),D=k+z,L=Ai(A,F),X=B+Y+Fi(D),q=Bi(u,e),W=u*d,j=Fi(W),H=Bi(a,r),V=a*v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(b-c),b]}const Ds=Ys,Ls=Number.EPSILON/2,Xs=Ls*Ls,qs=$t,Ws=$t,js=Gn,Hs=Ut,Vs=$t,Qs=tr,Rs=qo;function Gs(t,n){if(0===n[0]&&0===n[1])return t[0].map(t=>[0,t]);if(0===n[0]&&1===n[1])return t[t.length-1].map(t=>[0,t]);if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=Rs(js(Qs(o,e),n),e),a=Rs(js(Qs(c,o),n),o),p=Rs(js(Qs(u,c),n),c),h=Hs(l,js(Vs(a,l),n)),d=Hs(a,js(Vs(p,a),n)),v=Hs(h,js(Vs(d,h),n)),g=Rs(js(Qs(i,r),n),r),m=Rs(js(Qs(s,i),n),i),x=Rs(js(Qs(f,s),n),s),b=Hs(g,js(Vs(m,g),n)),w=Hs(m,js(Vs(x,m),n));return[v,Hs(b,js(Vs(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=Hs([0,e],js(Qs(o,e),n)),f=Hs([0,o],js(Qs(c,o),n)),l=Hs(u,js(Vs(f,u),n)),a=Hs([0,r],js(Qs(i,r),n)),p=Hs([0,i],js(Qs(s,i),n));return[l,Hs(a,js(Vs(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Rs(js(Qs(o,e),n),e),Rs(js(Qs(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}const{abs:Us}=Math,$s=[0,1],Zs=$t,Js=qo,Ks=Ut,tu=Gn,nu=Hn,eu=nr,ru=function(t,n,e,r){const o=t[0],i=t[1],c=n[0],s=n[1],u=Ds(t,n),f=Math.abs(o+i),l=Math.abs(c+s),a=l-Ls*l-r;return a<=0?{est:u,err:Number.POSITIVE_INFINITY}:{est:u,err:(l*e+f*r)/a**2+9*Xs*Math.abs(f/l)}},ou=function(t,n){return qs(t,n)[1]>0?n:t},iu=function(t,n){return Ws(t,n)[1]>0?t:n};function cu(t,n){return n[0][0]!==n[1][0]||n[0][1]!==n[1][1]?4===t.length?function([[t,n],[e,r],[o,i],[c,s]],[u,f]){const l=Zs(f,u),a=3*We*Us(l[1]),p=Zs($s,u),h=3*We*Us(p[1]),d=ru(l,p,a,h);f=Js(d.est,d.err);const v=Zs($s,u),g=tu(u,u),m=tu(u,v),x=tu(v,v),b=tu(g,u),w=tu(g,v),_=tu(x,u),M=tu(x,v),I=Zs($s,f),S=tu(f,f),y=tu(f,I),O=tu(I,I),C=tu(S,f),N=tu(S,I),E=tu(O,f),T=tu(O,I),P=Us(u[1]),k=Us(v[1]),A=Us(g[1]),B=Us(m[1]),z=Us(x[1]),F=Us(b[1]),Y=Us(w[1]),D=Us(_[1]),L=Us(M[1]),X=Us(f[1]),q=Us(I[1]),W=Us(S[1]),j=Us(y[1]),H=Us(O[1]),V=Us(C[1]),Q=Us(N[1]),R=Us(E[1]),G=Us(T[1]);let U=Us(t),$=Us(n),Z=Us(e),J=Us(r),K=Us(o),tt=Us(i),nt=Us(c),et=Us(s);const rt=Ks(nu(c,u),nu(o,v)),ot=Ks(Ks(nu(c,g),nu(2*o,m)),nu(e,x)),it=Ks(Ks(nu(c,b),nu(t,M)),nu(3,Ks(nu(o,w),nu(e,_)))),ct=Ks(tu(ot,f),tu(it,I)),st=Ks(Ks(tu(rt,S),tu(it,O)),tu(eu(ot),y)),ut=Ks(Ks(nu(c,C),tu(it,T)),nu(3,Ks(tu(rt,N),tu(ot,E)))),ft=Us(it[1]),lt=nt*P+K*k,at=nt*A+2*K*B+Z*z;U=nt*F+U*L+3*(K*Y+Z*D),Z=at*X+ft*q,K=lt*W+ft*H+2*at*j,nt=nt*V+ft*G+3*(lt*Q+at*R),U*=11*We,Z*=15*We,K*=20*We,nt*=22*We;const pt=Ks(nu(s,u),nu(i,v)),ht=Ks(Ks(nu(s,g),nu(2*i,m)),nu(r,x)),dt=Ks(Ks(nu(s,b),nu(n,M)),nu(3,Ks(nu(i,w),nu(r,_)))),vt=Ks(tu(ht,f),tu(dt,I)),gt=Ks(Ks(tu(pt,S),tu(dt,O)),tu(eu(ht),y)),mt=Ks(Ks(nu(s,C),tu(dt,T)),nu(3,Ks(tu(pt,N),tu(ht,E)))),xt=Us(dt[1]),bt=et*P+tt*k,wt=et*A+2*tt*B+J*z;$=et*F+$*L+3*(tt*Y+J*D),J=wt*X+xt*q,tt=bt*W+xt*H+2*wt*j,et=et*V+xt*G+3*(bt*Q+wt*R),$*=11*We,J*=15*We,tt*=20*We,et*=22*We;const _t=ou(ou(Js(it,-U),Js(ct,-Z)),ou(Js(st,-K),Js(ut,-nt))),Mt=iu(iu(Js(it,+U),Js(ct,+Z)),iu(Js(st,+K),Js(ut,+nt)));return[[_t,ou(ou(Js(dt,-$),Js(vt,-J)),ou(Js(gt,-tt),Js(mt,-et)))],[Mt,iu(iu(Js(dt,+$),Js(vt,+J)),iu(Js(gt,+tt),Js(mt,+et)))]]}(t,n):3===t.length?function([[t,n],[e,r],[o,i]],[c,s]){const u=Zs(s,c),f=3*We*Us(u[1]),l=Zs($s,c),a=3*We*Us(l[1]),p=ru(u,l,f,a);s=Js(p.est,p.err);const h=Zs($s,c),d=tu(c,c),v=tu(c,h),g=tu(h,h),m=Zs($s,s),x=tu(s,s),b=tu(s,m),w=tu(m,m),_=Us(c[1]),M=Us(h[1]),I=Us(d[1]),S=Us(v[1]),y=Us(g[1]),O=Us(s[1]),C=Us(m[1]),N=Us(x[1]),E=Us(b[1]),T=Us(w[1]);let P=Us(t),k=Us(n),A=Us(e),B=Us(r),z=Us(o),F=Us(i);const Y=Ks(Ks(nu(o,d),nu(2*e,v)),nu(t,g)),D=Ks(nu(o,c),nu(e,h)),L=Y,X=Ks(tu(s,D),tu(m,Y)),q=Ks(Ks(nu(o,x),tu(eu(b),D)),tu(w,Y)),W=z*I+2*A*S+P*y,j=z*_+A*M;P=W,A=O*j+C*W,z=N*o+2*E*j+T*W,P*=7*We,A*=11*We,z*=14*We;const H=Ks(Ks(nu(i,d),nu(2*r,v)),nu(n,g)),V=Ks(nu(i,c),nu(r,h)),Q=H,R=Ks(tu(s,V),tu(m,H)),G=Ks(Ks(nu(i,x),tu(eu(b),V)),tu(w,H)),U=F*I+2*B*S+k*y,$=F*_+B*M;k=U,B=O*$+C*U,F=N*i+2*E*$+T*U,k*=7*We,B*=11*We,F*=14*We;const Z=ou(ou(Js(L,-P),Js(X,-A)),Js(q,-z)),J=iu(iu(Js(L,+P),Js(X,+A)),Js(q,+z));return[[Z,ou(ou(Js(Q,-k),Js(R,-B)),Js(G,-F))],[J,iu(iu(Js(Q,+k),Js(R,+B)),Js(G,+F))]]}(t,n):function([[t,n],[e,r]],[o,i]){const c=Zs(i,o),s=3*We*Us(c[1]),u=Zs($s,o),f=3*We*Us(u[1]),l=ru(c,u,s,f);i=Js(l.est,l.err);const a=Zs($s,o),p=Zs($s,i),h=Us(o[1]),d=Us(a[1]),v=Us(i[1]),g=Us(p[1]);let m=Us(t),x=Us(n),b=Us(e),w=Us(r);const _=Ks(nu(e,o),nu(t,a)),M=Ks(nu(e,i),tu(_,p));m=b*h+m*d,b=b*v+m*g,m*=3*qe,b*=7*qe;const I=Ks(nu(r,o),nu(n,a)),S=Ks(nu(r,i),tu(I,p));x=w*h+x*d,w=w*v+x*g,x*=3*qe,w*=7*qe;const y=ou(Js(_,-m),Js(M,-b)),O=iu(Js(_,+m),Js(M,+b));return[[y,ou(Js(I,-x),Js(S,-w))],[O,iu(Js(I,+x),Js(S,+w))]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n[0]&&0===n[1]){const t=[0,e[0]],n=[0,e[1]];return[[t,n],[t,n]]}if(0===n[0]&&1===n[1]){const t=[0,r[0]],n=[0,r[1]];return[[t,n],[t,n]]}const o=Gs(t,n);let i;if(4===t.length)i=Le(t,n).map(t=>16*He*t);else if(3===t.length)i=Le(t,n).map(t=>10*He*t);else if(2===t.length)i=Le(t,n).map(t=>4*He*t);else if(1===t.length)return[o,o];return[[Js(o[0],-i[0]),Js(o[1],-i[1])],[Js(o[0],+i[0]),Js(o[1],+i[1])]]}(t,n[0])}function su(t){return(n,e)=>{let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;return(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])&&([o,c]=[c,o]),(u[1]>l[1]||u[1]===l[1]&&u[0]>l[0])&&([u,l]=[l,u]),(r[1]>i[1]||r[1]===i[1]&&r[0]>i[0])&&([r,i]=[i,r]),(s[1]>f[1]||s[1]===f[1]&&s[0]>f[0])&&([s,f]=[f,s]),t?(r[1]<f[1]||r[1]===f[1]&&r[0]<=f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>=s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<=c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>=o[0]):(r[1]<f[1]||r[1]===f[1]&&r[0]<f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>o[0])}}function uu(t){return[((n=t.x.box)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];var n}function fu(t,n){const e=zs(t,n);if(void 0===e)return;const{coeffs:r,errBound:o,getPExact:i}=e,c=Fe(r,0,1,o,i)||[];return 0!==c.length?{ris:c.map(Xo),getPExact:i}:void 0}function lu(t){const n=rt(t.tS);return{t:n,tS:n,tE:rt(t.tE),multiplicity:t.multiplicity}}function au(t,n){const e=fu(t,n);if(void 0===e)return[];const{getPExact:r}=e;let o,{ris:i}=e;const c=()=>(o=o||r(),o),s=fu(n,t);if(void 0===s)return[];let{ris:u}=s;const{getPExact:f}=s;let l;const a=()=>(l=l||f(),l);let p;p=1;let h,d=0;t:for(;d<p;){h=u.map(n=>cu(t,[n.tS,n.tE]));for(let t=0;t<u.length;t++){const n=h[t];for(let e=t+1;e<u.length;e++){const t=h[e];if(su(!0)(n,t)){const t=[];for(const n of u)t.push(...Zr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},a()));u=t,d++;continue t}}}break t}p=1;let v,g=0;t:for(;g<p;){v=i.map(t=>cu(n,[t.tS,t.tE]));for(let t=0;t<i.length;t++){const n=v[t];for(let e=t+1;e<i.length;e++){const t=v[e];if(su(!0)(n,t)){const t=[];for(const n of i)t.push(...Zr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},c()));i=t,g++;continue t}}}break t}const m=[];for(let t=0;t<u.length;t++){const n=h[t];for(let e=0;e<i.length;e++){const o=v[e];if(su(!0)(n,o)){const c={compensated:d,ri:lu(u[t]),riExp:d?u[t]:void 0,getPExact:d?void 0:f,kind:1,box:pu(n)},s={compensated:g,ri:lu(i[e]),riExp:g?i[e]:void 0,getPExact:g?void 0:r,kind:1,box:pu(o)};m.push({psX:c,sideX:s})}}}return m}function pu(t){return t.map(t=>t.map(rt))}function hu(t,n){return function(t,n){const e=t.xs,r=[],o=new Map;for(const t of e){const n=t.curve,e=o.get(n);e?e.push(t):o.set(n,[t])}const i=function(t){const[[n,e],[r,o]]=t.box,i=[[[r,e],[n,e]],[[n,e],[n,o]],[[n,o],[r,o]],[[r,o],[r,e]]];return(n,e,r)=>{const o=n.ps,c=e.slice();for(let t=0;t<i.length;t++){const n=au(o,i[t]);for(const{psX:e,sideX:r}of n)c.push({x:e,side:t,sideX:r,curve:void 0})}c.sort((t,n)=>t.x.ri.tS-n.x.ri.tS);const s=[],u=[];let f,l;for(const n of c)void 0!==n.side?(!0===l&&(u.push({idx:++r,dir:1,p:uu(n),_x_:f,container:t,side:n.side,sideX:n.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),f.out=u[u.length-1]),l=!1):(!1===l&&(s.push({idx:++r,dir:-1,p:uu(f),_x_:n,container:t,side:f.side,sideX:f.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),n.in_=s[s.length-1]),l=!0),f=n;return{ins:s,outs:u,ioIdx:r}}}(t);for(const t of o){const[e,o]=t;let c,s;({ins:c,outs:s,ioIdx:n}=i(e,o,n)),r.push(...c),r.push(...s)}return{inOuts:r,ioIdx:n}}(t,n)}function du(t,n,e,r){const o=[];for(const r of t)o.push({type:-1,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(vu);const i=new Set,c=[];for(const t of o){const{item:n,type:e}=t;if(-1===e){for(const t of i){const e=r(n,t);e&&c.push({a:n,b:t,u:e})}i.add(n)}else 1===e&&i.delete(n)}return c}function vu(t,n){const e=t.x-n.x;return 0!==e?e:t.type}function gu(t,n,e){const r=(t[0]-e[0])*(n[1]-e[1]),o=(t[1]-e[1])*(n[0]-e[0]),i=r-o;let c;if(r>0){if(o<=0)return i;c=r+o}else{if(!(r<0))return i;if(o>=0)return i;c=-r-o}return Math.abs(i)>=3330669073875472e-31*c?i:function(t,n,e,r){const o=t[0]-e[0],i=n[0]-e[0],c=t[1]-e[1],s=n[1]-e[1],u=it(ne(o,s),ne(c,i));let f=rt(u);if(Math.abs(f)>=2220446049250315e-31*r)return f;const l=Z(t[0],e[0])[0],a=Z(n[0],e[0])[0],p=Z(t[1],e[1])[0],h=Z(n[1],e[1])[0];if(0===l&&0===p&&0===a&&0===h)return f;const d=1109335647967049e-46*r+3330669073875471e-31*Math.abs(f);if(f+=o*h+s*l-(c*a+i*p),Math.abs(f)>=d)return f;const v=J(u,it(ne(l,s),ne(p,i))),g=J(v,it(ne(o,h),ne(c,a)));let m=J(g,it(ne(l,h),ne(p,a)));return m=Ln(m),m[m.length-1]}(t,n,e,c)}function mu(t,n){const e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function xu(t,n,e){const r=n[0]-t[0],o=n[1]-t[1];return r*(e[0]-n[0])+o*(e[1]-n[1])}const bu=function(t,n){if(0===t.length)return;const e=t.slice(),r=function(t){let n,e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r=0;r<t.length;r++){const o=t[r][1];(o<e[1]||o===e[1]&&t[r][0]<e[0])&&(n=r,e=t[r])}return n}(e),[o]=e.splice(r,1);e.sort((t,n)=>{let e=-gu(o,t,n);return 0!==e?e:(e=t[1]-n[1],0!==e?e:t[0]-n[0])}),e.unshift(o);const i=function(t){const n=[t[0]],e=t.length;for(let r=1;r<t.length;r++){const o=t[(r+e-1)%e],i=t[r];o[0]===i[0]&&o[1]===i[1]||n.push(i)}return n}(e),c=[];for(const t of i){for(;c.length>=2&&gu(c[c.length-2],c[c.length-1],t)<0;)c.pop();c.push(t)}if(n||c.length<3)return c;const s=[];{const t=c.length;for(let n=0;n<t;n++){const e=(n+1)%t,r=c[(n+t-1)%t],o=c[n],i=c[e];(0!==gu(r,o,i)||xu(r,o,i)<0)&&s.push(o)}}return s},wu=Ut,_u=et,Mu=J,Iu=Gn,{abs:Su}=Math;const{abs:yu}=Math;const{abs:Ou}=Math,Cu=Gn,Nu=Ut,Eu=et,Tu=J,{abs:Pu}=Math;function ku(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓ:n,vₓᵧ:e,vᵧᵧ:r,vₓ:o,vᵧ:i,v:f}=function(t){const[[n,e,r],[o,i,c]]=lo(t),s=n*i-e*o,u=n*c-r*o;return{vₓₓ:-o*o,vₓᵧ:2*n*o,vᵧᵧ:-n*n,vₓ:i*s-2*o*u,vᵧ:2*n*u-e*s,v:s*(e*c-r*i)-u*u}}(t),{vₓₓ_:l,vₓᵧ_:a,vᵧᵧ_:p,vₓ_:h,vᵧ_:d,v_:v}=function(t){const[n,e]=t[0],[[r,o],[i,c]]=function(t){const[[n,e],[r,o],[i,c]]=t,s=yu(n),u=yu(r),f=yu(i),l=yu(e),a=yu(o);return[[f+s+2*u,2*(u+s),0],[yu(c)+l+2*a,2*(a+l),0]]}(t),s=Ou(n),u=Ou(e),f=r*c+o*i,l=r*u+s*i;return{vₓₓ_:i*i,vₓᵧ_:2*r*i,vᵧᵧ_:r*r,vₓ_:c*f+2*i*l,vᵧ_:2*r*l+o*f,v_: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=J,{abs:Du}=Math;function Lu(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓₓ:n,vₓₓᵧ:e,vₓᵧᵧ:r,vᵧᵧᵧ:o,vₓₓ:i,vₓᵧ:f,vᵧᵧ:l,vₓ:a,vᵧ:p,v:h}=function(t){const[[n,e,r,o],[i,c,s,u]]=fo(t),f=n*s,l=r*i,a=n*c,p=e*i,h=n*n,d=i*i,v=n*u-o*i,g=f-l,m=a-p,x=e*u-o*c,b=e*s-r*c,w=r*u-o*s,_=2*g,M=v*v,I=v*b,S=_*x,y=m*x,O=-3*v-b,C=-3*M-2*I+(S+m*w),N=2*(v*g-y),E=v*m-g*g+m*b;return{vₓₓₓ:-i*d,vₓₓᵧ:3*n*d,vₓᵧᵧ:-3*i*h,vᵧᵧᵧ:n*h,vₓₓ:O*d+m*(s*i-c*c)+_*c*i,vₓᵧ:2*(m*(e*c-(l+f)/2)-(O*n*i+g*(p+a))),vᵧᵧ:O*h+m*(r*n-e*e)+_*e*n,vₓ:i*C+(c*N+s*E),vᵧ:-n*C-(e*N+r*E),v:v*(S-M-I)+(E*w-y*x)}}(t),{vₓₓₓ_:d,vₓₓᵧ_:v,vₓᵧᵧ_:g,vᵧᵧᵧ_:m,vₓₓ_:x,vₓᵧ_:b,vᵧᵧ_:w,vₓ_:_,vᵧ_:M,v_:I}=function(t){const[n,e]=t[0],[[r,o,i],[c,s,u]]=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=yu(n),l=yu(r),a=yu(i),p=yu(s),h=yu(e),d=yu(o),v=yu(c);return[[p+f+3*(l+a),3*(a+f+2*l),3*(l+f),0],[yu(u)+h+3*(d+v),3*(v+h+2*d),3*(d+h),0]]}(t),f=Au(n),l=Au(e),a=r*u,p=i*c,h=r*s,d=o*c,v=r*r,g=c*c,m=r*l+f*c,x=a+p,b=h+d,w=o*l+f*s,_=o*u+i*s,M=i*l+f*u,I=2*x,S=m*m,y=m*_,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=P*B+A*k+2*tt,et=Bu(n,D),ot=y*X+v*L+2*Du(et[1]),it=Bu(o,R),ct=O*U+g*G+2*Du(it[1]),st=Bu(i,$),ut=C*J+m*Z+2*Du(st[1]),ft=Bu(u,H),lt=N*Q+x*V+2*Du(ft[1]),at=Bu(f,z),pt=Du(f[1])*Y+b*F+2*Du(at[1]),ht=Bu(l,K),dt=Du(l[1])*nt+w*tt+2*Du(ht[1]),vt=Bu(a,q),gt=Du(a[1])*j+_*W+2*Du(vt[1]),mt=Bu(E,p),xt=Du(p[1])*A+M*P+2*Du(mt[1]),bt=Bu(T,h),wt=Du(h[1])*B+I*k+2*Du(bt[1]),_t=zu(et,it),Mt=ot+ct+Du(_t[1]),It=zu(st,ft),St=ut+lt+Du(It[1]),yt=zu(_t,It),Ot=Mt+St+Du(yt[1]),Ct=zu(at,ht),Nt=pt+dt+Du(Ct[1]),Et=zu(Ct,vt),Tt=Nt+gt+Du(Et[1]),Pt=zu(yt,Et),kt=Ot+Tt+Du(Pt[1]),At=zu(mt,bt),Bt=xt+wt+Du(At[1]),zt=zu(At,d),Ft=Bt+S+Du(zt[1]),Yt=zu(Pt,zt),Dt=kt+Ft+Du(Yt[1]);if(He*Dt<Du(rt(Yt)))return!1}{const n=function(t){return Uc(gc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];n.hasOwnProperty("vₓₓₓ")||(n.vₓₓₓ=[0],n.vₓₓᵧ=[0],n.vₓᵧᵧ=[0],n.vᵧᵧᵧ=[0]),n.hasOwnProperty("vₓₓ")||(n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓₓ:o,vₓₓᵧ:i,vₓᵧᵧ:f,vᵧᵧᵧ:l,vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:v,v:g}=n,m=Fu(e,e),x=Fu(e,m),b=Fu(r,r),w=Fu(r,b),_=Fu(r,m),M=Fu(e,b),I=Fu(e,r),S=Fu(o,x),y=Fu(i,_),O=Fu(f,M),C=Fu(l,w),N=Fu(a,m),E=Fu(p,I),T=Fu(h,b),P=Fu(e,d),k=Fu(r,v),A=Yu(S,y),B=Yu(O,C),z=Yu(A,B),F=Yu(N,E),Y=Yu(F,T),D=Yu(z,Y),L=Yu(P,k),X=Yu(L,g);return 0===ct(Yu(D,X))}}function Xu(t,n){const{coeffs:e,errBound:r,getPExact:o}=zs(t,n);return Fe(e,0,1,r,o)}const{min:qu,max:Wu}=Math;function ju(t,n){let[[e,r],[o,i]]=t,[[c,s],[u,f]]=n;if(e>o&&([e,o]=[o,e]),c>u&&([c,u]=[u,c]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]),e<=u&&o>=c&&s<=i&&f>=r)return[[Wu(e,c),Wu(r,s)],[qu(o,u),qu(i,f)]]}function Hu(t,n,e){if(void 0===e)return;if(0===e.length)return[];const r=Xu(n,t);if(void 0===r)return;if(0===r.length)return[];const o=r.map(n=>$e(t,[n.tS,n.tE])),i=e.map(t=>$e(n,[t.tS,t.tE])),c=[];for(let t=0;t<r.length;t++){const n=o[t];for(let o=0;o<e.length;o++){const s=ju(n,i[o]);if(void 0!==s){const n={ri:r[t],box:s,kind:1},i={ri:e[o],box:s,kind:1};c.push([n,i])}}}return c}function Vu(t,n,e){for(const r of[t,n]){const o=r.length;for(let i=1;i<o+1;i++){const c=r[i-1],s=r[i%o],u=[s[1]-c[1],c[0]-s[0]];let f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let n=0;n<t.length;n++){const e=u[0]*t[n][0]+u[1]*t[n][1];e<f&&(f=e),e>l&&(l=e)}let a=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;for(let t=0;t<n.length;t++){const e=u[0]*n[t][0]+u[1]*n[t][1];e<a&&(a=e),e>p&&(p=e)}if(e&&(l<a||p<f))return!1;if(!e&&(l<=a||p<=f))return!1}}return!0}const Qu=ne,Ru=J,{abs:Gu}=Math;function Uu(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=Gu(3*r)+Gu(f)+(Gu(3*i)+Gu(l))+Gu(a);if(Gu(a)-qe*p>0)return!1;const h=u+3*o,d=e+3*c,v=h-d,g=Gu(3*o)+Gu(h)+(Gu(3*c)+Gu(d))+Gu(v);return!(Gu(v)-qe*g>0)&&0===ct(it(Ru([s],Qu(3,r)),Ru([n],Qu(3,i))))&&0===ct(it(Ru([u],Qu(3,o)),Ru([e],Qu(3,c))))}const $u=lt,{abs:Zu}=Math;function Ju(t){const[[n,e],[r,o],[i,c]]=t,s=n+i,u=s-2*r,f=Zu(s)+Zu(u);if(Zu(u)-f>0)return!1;const l=e+c,a=l-2*o,p=Zu(l)+Zu(a);return!(Zu(a)-p>0)&&0===ct(it($u(n,i),[2*r]))&&0===ct(it($u(e,c),[2*o]))}function Ku(t){const n=t[0][0],e=t[0][1];for(let r=1;r<t.length;r++)if(n!==t[r][0]||e!==t[r][1])return!1;return!0}function tf(t){return 4===t.length&&Uu(t)&&(t=Wc(t)),3===t.length&&Ju(t)&&(t=[t[0],t[2]]),2===t.length&&Ku(t)&&(t=[t[0]]),t}const nf=Number.EPSILON,ef=nf/2;function rf(t,n){return n<0?t<1?t:1-ef:0===n?1:t>1?t:1+nf}function of(t){const n=function(t){const n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!1),Array.from(new Uint8Array(n))}(t),e=n[0],r=n[1],o=e>>7,i=((127&e)<<4)+((240&r)>>4),c=0===i?0:16,s=0===i?i-1022:i-1023,u=n.slice(1);return u[0]=(15&r)+c,{sign:o,exponent:s,significand:u}}function cf(t){return of(t).significand}function sf(t){return Math.log2(t&-t)}function uf(t){if(0===t||!Number.isFinite(t))return NaN;const n=cf(t),e=n.length;for(let t=e-1;t>=0;t--){if(0===n[t])continue;const r=sf(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function ff(t){return t>=128?7:t>=64?6:t>=32?5:t>=16?4:t>=8?3:t>=4?2:t>=2?1:t>=1?0:NaN}function lf(t){if(0===t||!Number.isFinite(t))return NaN;const n=cf(t),e=n.length;for(let t=0;t<e;t++){const r=ff(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function af(t){return of(t).exponent}function pf(t){if(0===t||!Number.isFinite(t))return NaN;const n=af(t);return lf(t)-52+n}function hf(t,n){const e=(2**(53-n)+1)*t;return e-(e-t)}function df(t,n){if(0===ct(t=Ln(t)))return[0];const e=pf(t[t.length-1]);let r=e,o=t.length-1;for(;o>0;){const i=pf(t[o-1]);if(e-i>n)break;r=i,o--}const i=Math.min(n-(e-r),53);let c=t[o];c=hf(c,i);const s=t.slice(o);return s[0]=c,s}function vf(t){return 0===t?0:lf(t)-uf(t)+1}function gf(t){const n=Ln(t);if(0===ct(n))return 0;const e=n[n.length-1],r=n[0];return af(e)-af(r)+(53-uf(r))}function mf(t){return rt(function(t,n,e){let r=n,o=t,i=!1,c=0;e||(c=gf(o)-gf(r)+1,e=c/53+1,i=!0);let s=[1/rt(r)],u=1;for(;;){if(o=et(o,s),u>e)return i?(o=df(o,c),o):o.slice(o.length-e,o.length);r=et(r,s),s=it([2],r),u*=2}}(t[0],t[1],2))}function xf(t){return ct(t[0])*ct(t[1])}function bf(t){return(n,e)=>{const r=vc(n),o=vc(e),i=vc(n.slice().reverse()),c=vc(e.slice().reverse()),s=t(r,o),u=t(i,o),f=t(r,c),l=t(i,c),a=-xf(u),p=-xf(l),h=mf(s),d=mf(f);return[rf(h,a),rf(d,p)]}}const wf=bf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[,o]=n;return[it(o,r),e]}(t[e],n[e])});function _f(t,n){return Jr(et(t[0],n[1]),et(t[1],n[0]))*ct(t[1])*ct(n[1])}function Mf(t){let n=-1024;for(let e=0;e<t.length;e++){const r=t[e];for(let t=0;t<r.length;t++){const e=r[t];if(0===e)continue;const o=-af(e)+vf(e)-1;o>n&&(n=o)}}return 0===n?t.map(t=>t.map(t=>BigInt(t))):n>0?t.map(t=>t.map(t=>{if(0===t)return 0n;const e=-af(t)+vf(t)-1;return BigInt(t*2**e)*2n**BigInt(n-e)})):t.map(t=>t.map(t=>BigInt(t*2**n)))}function If(t,n){if(n=n<0n?-n:n,0n===(t=t<0n?-t:t))return n;if(0n===n)return t;for(;0n!==n;){const e=n;n=t%n,t=e}return t}const Sf=BigInt(2**53);function yf(t){if(0n===t)return[0];const n=[];let e=0,r=t;for(;0n!==r;){r=t/Sf;const o=t%Sf;n.push(Number(o)*2**(53*e)),t=r,e++}return Ln(n)}const{round:Of,sqrt:Cf}=Math;function Nf(t){if(t<=1n){if(t<0n)throw new Error("square root of negative numbers are not allowed");return t}let n=BigInt(Of(Cf(Number(t))));for(;;){const e=n+t/n>>1n;if(e===n)return n;n=e}}function Ef(t){return t<0n?-t:t}function Tf(t){let n=0n;for(let e=0;e<t.length;e++)n+=t[e];return n}function Pf(t,n){const[e,r]=kf(t[0],n[0]),[o,i]=kf(t[1],n[1]);if(0===_f(e,o)||0===_f(e,i))return e;if(0===_f(r,o)||0===_f(r,i))return r;throw new Error("An unexpected error occured.")}function kf(t,n){const[e,r]=t,[o,i]=n,[c,s]=function(t){const[n,e]=Mf(t).map(Tf),r=If(n,e);return[yf(Nf(Ef(n/r))),yf(Nf(Ef(e/r)))]}([o,e]);return[[it(et(i,s),et(r,c)),et(c,Sr(e))],[it(et(i,ot(s)),et(r,c)),et(c,Sr(e))]].sort(_f)}function Af(t,n){const e=vc(t),r=0===ct(e[0][0])?0:0===ct(e[1][0])?1:-1;if(-1!==r){const e=t[0][r],o=t[2][r],i=n[0][r],c=n[2][r];return wf([[e,e],[o,o]],[[i,i],[c,c]])}return bf(Pf)(t,n)}const{round:Bf,cbrt:zf}=Math;function Ff(t){const n=(e=t)>0n?1n:e<0n?-1n:0n;var e;if((t=Ef(t))<=1n)return n*t;let r=BigInt(Bf(zf(Number(t))));for(;;){const e=(2n*r+t/(r*r))/3n;if(e===r)return n*r;r=e}}function Yf(t){return et(t,t)}const Df=bf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[o,i]=n,c=function(t){const[n,e]=Mf(t).map(Tf),r=If(n,e);return[yf(Ff(n/r)),yf(Ff(e/r))]}([o,e]),s=Yf(c[0]);return[it(et(i,Yf(c[1])),et(r,s)),et(nt(3,e),s)]}(t[e],n[e])}),{EPSILON:Lf}=Number,Xf=Lf/2+Lf**2/2;function qf(t){return t>0?t-t*Xf:t+t*Xf}const{EPSILON:Wf}=Number,jf=Wf/2+Wf**2/2;function Hf(t){return t>0?t+t*jf:t-t*jf}function Vf(t){if(0===t||1===t)return[t,t];const n=qf(qf(t)),e=function(t){return Hf(Hf(t))}(t);return[n,e]}function Qf(t,n,e,r){const o=t.ps,i=n.ps,c=[];let s=Xu(o,i);if(void 0===s){const r=2**(e-47),s=function(t,n,e=!1){e||(t=tf(t),n=tf(n));const r=[,,wf,Af,Df],[o,i]=r[t.length](t,n),[c,s]=r[t.length](n,t),u=[{tA:o,tB:0,bez:"B",start:!0},{tA:i,tB:1,bez:"B",start:!1},{tA:0,tB:c,bez:"A",start:!0},{tA:1,tB:s,bez:"A",start:!1}].sort((t,n)=>t.tA-n.tA);if(u[1].tA===u[2].tA){const n=u[1],e=n.tA,r=n.tB,o=$e(t,[e,e]);return[{p:o[0],kind:4,box:o,t1:e,ri1:{t:e,tS:e,tE:e,multiplicity:1},t2:r,ri2:{t:r,tS:r,tE:r,multiplicity:1}}]}if(u[0].bez===u[1].bez)return[];const f=u[1],l=u[2],[a,p]=Vf(f.tA),[h,d]=Vf(f.tB),[v,g]=Vf(l.tA),[m,x]=Vf(l.tB),b=$e(t,[a,p]),w=$e(n,[h,d]),_=$e(t,[v,g]),M=$e(n,[m,x]),I=ju(b,w),S=ju(_,M),y={t:a,tS:a,tE:p,multiplicity:1},O={t:h,tS:h,tE:d,multiplicity:1},C={t:v,tS:v,tE:g,multiplicity:1},N={t:m,tS:m,tE:x,multiplicity:1};return[{p:Ze(I),kind:5,box:I,t1:y.t,ri1:y,t2:O.t,ri2:O},{p:Ze(S),kind:5,box:S,t1:C.t,ri1:C,t2:N.t,ri2:N}]}(o,i);for(const e of s){const i=Ye(o,e.ri1.tS),s=[[i[0]-r,i[1]-r],[i[0]+r,i[1]+r]],u={x:{ri:e.ri1,kind:5,box:s},curve:t},f={x:{ri:e.ri2,kind:5,box:s},curve:n};c.push([u,f])}return c}if(r&&(s=s.filter(t=>t.tS>0)),0===s.length)return[];const u=Hu(o,i,s);if(void 0===u||0===u.length)return[];for(const e of u){const r={x:e[0],curve:t},o={x:e[1],curve:n};c.push([r,o])}return c}const Rf=Ve(1);function Gf(t,n,e){const r=n.ps;if(0===t)return r[0],{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[r[0],r[0]],kind:e},curve:n};if(1===t){const o=r[r.length-1];return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[o,o],kind:e},curve:n}}const{p:o,pE:i}=function(t,n){const e=Ye(t,n),r=Le(t,[0,n]);if(4===t.length)return{p:e,pE:r.map(t=>9*Rf*t)};if(3===t.length)return{p:e,pE:r.map(t=>6*Rf*t)};if(2===t.length)return{p:e,pE:r.map(t=>3*Rf*t)};if(1===t.length)return{p:t[0],pE:[0,0]};throw new Error("The given bezier curve must be of order <= 3.")}(r,t);return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]],kind:e},curve:n}}function Uf(t,n){if(n.next===t){if(t.next===n)return;[t,n]=[n,t]}const e=t.ps,r=n.ps;if(function(t,n){if(4===t.length)return Lu(t,n);if(3===t.length)return ku(t,n);if(2===t.length)return function(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{coeffs:{vₓ:n,vᵧ:o,v:i},errorBound:{v_:u}}=ti(t),f=Vr(e),l=Vr(r),a=Su(c),p=Su(s),h=Su(n[1]),d=Su(o[1]),v=a/3,g=p/3,m=n[1]*c,x=Iu(f,n),b=h*v+2*Su(m),w=o[1]*s,_=Iu(l,o),M=d*g+2*Su(w),I=wu(x,_),S=b+M+Su(I[1]),y=wu(I,i),O=S+u+Su(y[1]);if(He*O<Su(rt(y)))return!1}{const n=function(t){return _c(xc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];const{vₓ:o,vᵧ:i,v:f}=n,l=_u(e,o),a=_u(r,i);return 0===ct(Mu(Mu(l,a),f))}}(t,n);if(1===t.length){const e=Ln(n[0]),r=Ln(n[1]);return 1===e.length&&1===r.length&&e[0]===t[0][0]&&r[0]===t[0][1]}throw new Error("The given bezier curve must be of order <= 3")}(e,r[r.length-1].map(t=>[t]))){const i=Hu(e,r,[(o=1,{t:o,tS:o,tE:o,multiplicity:1})]);if(void 0===i||0===i.length)return;return[[{x:i[0][0],curve:t},Gf(1,n,1)]]}var o}function $f(t){return t[t.length-1]<0?ot(t):t}function Zf(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}Number.EPSILON;const Jf=Number.EPSILON/2;function Kf(t,n,e,r){const o=t/n,i=Math.abs(t),c=Math.abs(n),s=c-r;return s<=0?{est:o,err:Number.POSITIVE_INFINITY}:{est:o,err:(c*e+i*r)/s**2+Jf*Math.abs(i/c)}}function tl(t){const n=t[0],e=t[1];if(0===e)return[0,0];const r=Math.sqrt(e),o=r*r,i=134217729*r,c=i-(i-r),s=r-c,u=.5*(e-o-(s*s-(o-c*c-c*s*2))+n)/r;return[u-(r+u-r),r+u]}const{abs:nl}=Math;const{abs:el}=Math;function rl(t){const{coeffs:[[n,e,r],[o,i,c]],errorBound:[[s,u],[f,l]]}=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s-n,l=r-i,a=f+3*l,p=i+n,h=p-2*r,d=r-n,v=u-e,g=o-c,m=v+3*g,x=c+e,b=x-2*o,w=o-e;return{coeffs:[[a,3*h,3*d,n],[m,3*b,3*w,e]],errorBound:[[nl(f)+6*nl(l)+nl(a),6*(nl(p)+nl(h)),6*nl(d),0],[nl(v)+6*nl(g)+nl(m),6*(nl(x)+nl(b)),6*nl(w),0]]}}(t),a=el(n),p=el(e),h=el(r),d=el(o),v=el(i),g=el(c),m=e*o,x=n*i,b=n*c,w=r*o,_=e*c,M=r*i,I=u*d+p*f+el(m),S=s*v+a*l+el(x),y=s*g+el(b),O=h*f+el(w),C=u*g+el(_),N=h*l+el(M),E=m-x,T=el(E),P=I+S+T,k=w-b,A=el(k),B=O+y+A,z=_-M,F=el(z),Y=C+N+F,D=E*E,L=E*k,X=z*E,q=k*k,W=X+q;return{coeffs:[D,L,W],errBound:[2*P*T+el(D),P*A+T*B+el(L),Y*T+F*P+el(X)+(2*A*B+el(q))+el(W)].map(t=>je*t)}}const ol=et,il=J;function cl(t){const[[n,e,r],[o,i,c]]=gc(t),s=ol(e,o),u=ol(n,i),f=ol(n,c),l=ol(r,o),a=ol(e,c),p=ol(r,i),h=it(s,u),d=it(l,f),v=it(a,p),g=ol(h,h),m=ol(h,d),x=ol(h,v),b=ol(d,d);return[g,m,il(x,b)]}const sl=it,ul=et,fl=nt,ll=tr,al=Zf,pl=ii,hl=Ut,dl=nr,vl=Ys,gl=J,ml=at,xl=2*Xe,{abs:bl}=Math;function wl(t,n=!0){if(t.length<4)return[];const{coeffs:[e,r,o],errBound:[i,c,s]}=rl(t);if(bl(e)<=i){const[[n,e],[r,o],[i,c],[s,u]]=t,f=gl(ll(s,n),fl(3,ll(r,i))),l=ml(al(i,n),-2*r),a=gl(ll(u,e),fl(3,ll(o,c))),p=ml(al(c,e),-2*o);if(0===Jr(ul(l,a),ul(f,p)))return[]}const u=r*r,f=4*e*o,l=u-f,a=2*c*bl(r)+je*u+(4*(i*bl(o)+bl(e)*s)+je*bl(f))+je*bl(l);if(l<-a)return[];if(l>a){const{est:t,err:u}=function(t,n){if(t-n<=0){const e=t>0?Math.sqrt(t):0;return{est:e,err:Math.max(Math.sqrt(t+n)-e,e)}}const e=Math.sqrt(t),r=Math.sqrt(t-n),o=Math.sqrt(t+n);return{est:e,err:Math.max(Math.abs(r-e),Math.abs(o-e))}}(l,a);let f;f=r>=0?-r-t:-r+t;const p=c+u+je*bl(f),{est:h,err:d}=Kf(f,2*e,p,2*i),{est:v,err:g}=Kf(2*o,f,2*s,p);if(n){if(h+d<0||h-d>1||v+g<0||v-g>1)return[]}else if((h+d<0||h-d>1)&&(v+g<0||v-g>1))return[]}let[p,h,d]=cl(t);const v=sl(ul(h,h),fl(4,ul(p,d))),g=ct(v);if(g<0)return[];if(g>0){const t=tl(Vr(v));let e;p=Vr(p),h=Vr(h),d=Vr(d),e=ct(h)>=0?pl(hl(h,t)):hl(pl(h),t);let r=rt(vl(e,dl(p))),o=rt(vl(dl(d),e));if(n){if(r<-xl||r>1+xl||o<-xl||o>1+xl)return[]}else if((r<-xl||r>1+xl)&&(o<-xl||o>1+xl))return[];return[r,o]=r<o?[r,o]:[o,r],r>=0-xl&&r<=1+xl?o>=0-xl&&o<=1+xl?[r,o]:[r]:o>=0-xl&&o<=1+xl?[o]:[]}const m=yr(p);if(ct(h)*ct(m)<0)return[];if(Jr($f(h),$f(m))>0)return[];const x=Vr(h),b=Vr(m),w=vl(x,b),_=w[1]+w[0];return[_,_]}const _l=Number.EPSILON;function Ml(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i)),6*(i+n-2*r)],[6*(u-e+3*(o-c)),6*(c+e-2*o)]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[2*(i-2*r+n)],[2*(c-2*o+e)]]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function Il(t){if(4===t.length)return 0===gu(t[0],t[1],t[2])&&0===gu(t[1],t[2],t[3])&&0===gu(t[0],t[2],t[3]);if(3===t.length)return 0===gu(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}function Sl(t){if(Il(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&Uu(t)&&(t=Wc(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=i-r,u=s-(r-n),f=c-o,l=f-(o-e);return[u*u+l*l,-(n*(u-r)-r*(s-r)+e*(l-o)-o*(f-o))]}(t);return{minima:[],maxima:Fe(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=U(t),[[s,u],[f,l]]=Ml(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i))],[6*(u-e+3*(o-c))]]}if(t.length<=3)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=a*i,d=p*e,v=u*c,g=u*i,m=f*f,x=s*c,b=l*r,w=l*e,_=f*r,M=r*e,I=r*n,S=r*o,y=e*e,O=e*n,C=e*i,N=n*c,E=n*o,T=n*n,P=c*i,k=c*o,A=i*i,B=i*o,z=o*o,F=a*c-p*r,Y=u*r+l*c,D=v-b,L=r*r+c*c,X=C+N,q=k+A,W=I+y,j=e*o+n*i,H=T-z,V=O-B,Q=M-P,R=r*i+e*c,G=k+q,$=I+W,Z=S+X,J=C+X,K=$-G,tt=X+N,nt=S+C+N,et=2*w+_;return{inflectionPoly:[s*o-f*n,u*o+s*i-l*n-f*e,g+x-w-_,v-b],otherExtremaPoly:[T*(h-3*d)+z*(3*h-d)+2*(E*(a*e-p*i+3*(l*f-u*s))+3*s*f*V)+3*(j*(m-s*s)+H*(u*f+l*s)),a*(o*($+3*q)+n*J)-p*(r*(3*T+z)+e*(3*O+2*B)+n*G)+3*(u*(l*H-u*E+2*(f*V-s*j))+s*(2*l*V+f*(2*(I-k)+(y-A))-s*nt)+l*(l*E+2*f*j)+m*Z),a*(2*r*j+e*tt+i*(4*k+G))-p*(2*r*(3*O+B)+e*(y+2*k)+i*tt)+3*(u*(2*(l*V-s*nt)+f*K-u*j)+s*(2*f*Q-s*R)+l*(l*j+2*f*Z+s*K)+m*R),a*(r*(S+2*X)+c*(y+3*q))-p*(r*(3*W+G)+c*J)+3*(u*(l*K-u*Z+2*(f*Q-s*R))+s*(r*(et-s*c)-c*(2*l*i+f*c))+l*(l*X+r*(2*f*i+l*o))+f*c*et),L*(h-d)+2*(M+P)*F-3*(Y*(g+x-w-_)+(u*e+s*r+l*i+f*c)*D),F*L-3*Y*D]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Fe(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=(n-r)*t[r];return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=G(i,n);G(e,n)*r>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Fe(e,0,1)?.map(t=>t.t)||[]}}const{sqrt:yl}=Math;function Ol(t,n){const[e,r]=function(t,n){const[e,r]=U(t),[o,i]=Ml(t),c=G(e,n),s=G(r,n),u=G(o,n);return[c*G(i,n)-s*u,yl((c*c+s*s)**3)]}(t,n);return e/r}const{abs:Cl}=Math,Nl=D(function(t){const{curves:n}=t;let e=ao(n[0].ps).minY,r=n[0];for(let t=1;t<n.length;t++){const o=ao(n[t].ps).minY,i=o.box[0][1],c=e.box[0][1];(i<c||i===c&&o.ts[0]>e.ts[0])&&(e=o,r=n[t])}return{curve:r,y:e}});function El(t){const{curve:n,y:e}=Nl(t),r=e.ts;return r[0]<=0?[Gf(0,n,0),Gf(1,n.prev,0)]:r[1]>=1?[Gf(1,n,0),Gf(0,n.next,0)]:[{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n},{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n}]}function Tl(t,n,e){const r=e-(n-Math.floor(Math.log2(Math.abs(t))))+1;return r<=0?0:e>=53?t:hf(t,r)}function Pl(t,n,e){const r=function(t,n){const e=[];for(const n of t)for(const t of n.curves)e.push(t);const r=du(e,t=>ho(t.ps)[0][0],t=>ho(t.ps)[1][0],function(t){return(n,e)=>{const r=n.ps,o=e.ps;if(2===r.length&&2===o.length)return function(t,n,e){let r=t.ps,o=n.ps;const i=ho(r),c=ho(o);if(t.next!==n&&n.next!==t){if(ko(!0,i,c)){const r=Qf(t,n,e,!1);return r.length?r:void 0}return}if(n.next===t&&([t,n]=[n,t],[r,o]=[o,r]),0!==gu(r[0],r[1],o[1]))return;if(!ko(!1,i,c))return;let s;return s=mu(r[0],r[1])>mu(o[0],o[1])?[jr(Wr(r,o[1])[0].ri),1]:[0,jr(Wr(o,r[0])[0].ri)],[[Gf(1,t,5),Gf(0,n,5)],[Gf(s[0],t,5),Gf(s[1],n,5)]]}(n,e,t);if(n.next===e||e.next===n)return ko(!1,ho(r),ho(o))&&Vu(bu(r,!1),bu(o,!1),!1)?e.next===n?Qf(e,n,t,!0):Qf(n,e,t,!0):Uf(n,e);let i=ko(!0,ho(r),ho(o));return i?(i=Vu(bu(r,!1),bu(o,!1),!0),i?Qf(n,e,t,!1):void 0):void 0}}(n)),o=[];for(const t of r)for(const n of t.u)o.push(n);return o}(t,e),o=function(t){const n=[];for(const e of t)for(const t of e.curves){const e=t.ps,r=wl(e);if(0===r.length)continue;const o=r[0]===r[1]?3:2,i=r[0]-_l,c=r[0]+_l,s=r[1]-_l,u=r[1]+_l,f=$e(e,[i,c]),l=$e(e,[s,u]);n.push([{x:{ri:{t:i,tS:i,tE:c,multiplicity:1},box:f,kind:o},curve:t},{x:{ri:{t:s,tS:s,tE:u,multiplicity:1},box:l,kind:o},curve:t}])}return n}(t),i=function(t){const n=[];for(const e of t)for(const t of e.curves)n.push([Gf(1,t,4),Gf(0,t.next,4)]);return n}(t),{extremes:c,xs:s}=function(t){const n=new Map,e=[];for(const r of t){const t=El(r);e.push(t),n.set(r,t)}return{extremes:n,xs:e}}(t),u=function(t,n){const e=[];for(const r of n)for(const n of r.curves){const r=n.ps,o=Sl(r),{minima:i,maxima:c}=o,s=[0,1,...i,...c];for(let o of s)Cl(Ol(r,o))>1e7*2**-t&&e.push([Gf(o,n,7),Gf(o,n,7)])}return e}(e,t);let f=[...r,...o,...i,...s,...u];if("undefined"!=typeof _debug_){const{intersection:t}=_debug_.elems;for(const n of[r,o,i,s,u])for(const e of n)t.push(...e)}let l=f.map(t=>({xs:t,box:[[t[0].x.box[0][0]-n,t[0].x.box[0][1]-n],[t[0].x.box[1][0]+n,t[0].x.box[1][1]+n]],inOuts:void 0}));for(;;){const t=du(l,kl,Al,Ao);if(!t.length)break;const n=new Map;Bo(n,t);const e=Yo(n),r=Do(l,e);l=[...Lo(e),...r]}l=function(t){return t.filter(t=>{const n=t.xs;if(2===t.xs.length){const t=n[0];if(1===t.x.kind&&t.x.ri.multiplicity%2==0)return!1}for(const n of t.xs)if(4!==n.x.kind)return!0;return!1})}(l),l=function(t,n,e){const r=Math.log2(e)-3;return t.map(t=>{const e=t.box.map(t=>t.map(t=>Tl(t,n,n-r)));return{...t,box:e}})}(l,e,n),"undefined"!=typeof _debug_&&_debug_.elems.container.push(...l);let a=0;for(const t of l){for(const n of t.xs)n.container=t;let n;({inOuts:n,ioIdx:a}=hu(t,a)),t.inOuts=n}f=f.filter(t=>void 0!==t[0].container),function(t){const n=new Map;for(const e of t)for(const t of e){const e=t.curve.loop,r=n.get(e)||[];r.length||n.set(e,r),r.push(t)}for(const t of n){const n=t[1];if(!n||!n.length)continue;n.sort((t,n)=>{let e=t.curve.idx-n.curve.idx;return 0!==e?e:(e=t.x.ri.tS-n.x.ri.tS,0!==e?e:void 0!==t.in_?-1:1)});const e=n.length;for(let t=0;t<e;t++)n[t].next=n[(t+1)%e],n[t].prev=n[(t-1+e)%e]}}(f);for(const t of l)for(const n of t.inOuts){if(-1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.next,void 0===e.in_;);t.nextOrPrev=e.in_,t.idx=t.nextOrPrev.idx}for(const t of l)for(const n of t.inOuts){if(1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.prev,void 0===e.out;);t.nextOrPrev=e.out,t.idx=t.nextOrPrev.idx}return{extremes:c,containers:l}}function kl(t){return t.box[0][0]}function Al(t){return t.box[1][0]}function Bl(t,n,e){to(t,1);const r=t.inOuts,o=r[0],i=r[r.length-1],c=1===o.dir?o:i,s=i.dir,u=0===n.idx?new Set:1===n.orientation?n.loopsIdxs:new Set;return o.orientation=s,o.parent=n,o.windingNum=n.windingNum+s,o.loopsIdxs=new Set(u),o.children=new Set,1===s&&o.loopsIdxs?.add(e.idx),i.orientation=s,i.parent=n,i.windingNum=n.windingNum+s,i.loopsIdxs=new Set(u),i.children=new Set,1===s&&i.loopsIdxs?.add(e.idx),c}function zl(t){if(!Il(t))return!1;const n=t.map(t=>t[0]),e=t.map(t=>t[1]);return!(Fl(n)&&Fl(e))}function Fl(t){return function(t){for(let n=1;n<t.length;n++)if(t[n-1]>t[n])return!1;return!0}(t)||function(t){for(let n=1;n<t.length;n++)if(t[n-1]<t[n])return!1;return!0}(t)}function Yl(t,n){const e=n/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[e*t[0],e*t[1]]}function Dl(t){for(let n=0;n<t.length-1;n++)for(let e=n+1;e<t.length;e++)if(t[n][0]===t[e][0]&&t[n][1]===t[e][1])return!1;return!0}const{abs:Ll}=Math;function Xl(t,n,e){if(void 0!==t&&!Ku(t)){if(2===t.length)return t;if(3===t.length){if(Dl(t))return Il(t)?[t[0],t[2]]:t;if(Wl(t[0],t[2]))return;return[t[0],t[2]]}if(Dl(t)){const r=ql(t);if(void 0===r)return;return function(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e][0]!==n[e][0]||t[e][1]!==n[e][1])return!1;return!0}(r,t)?t:Xl(r,n,e)}if(Wl(t[0],t[3])){if(Il(t))return;return t}if(Il(t))return[t[0],t[3]];if(Wl(t[0],t[1])&&Wl(t[1],t[2])||Wl(t[1],t[2])&&Wl(t[2],t[3])||Wl(t[0],t[1])&&Wl(t[2],t[3]))return Xl([t[0],t[t.length-1]],n,e);if(Wl(t[0],t[2])||Wl(t[1],t[3])||Wl(t[1],t[2]))return t;if(Wl(t[0],t[1])){if(mu(t[1],t[2])<4*n)return[t[0],t[2],t[2],t[3]];{const r=Yl(X(t[1],t[2]),2*n),o=V(t[1],r);return ql([t[0],e(o),t[2],t[3]])}}if(Wl(t[2],t[3])){if(mu(t[2],t[1])<4*n)return[t[0],t[1],t[1],t[3]];{const r=Yl(X(t[2],t[1]),2*n),o=V(t[2],r);return ql([t[0],t[1],e(o),t[3]])}}}}function ql(t){return Il(t)?[t[0],t[3]]:Uu(t)?Wc(t):t}function Wl(t,n){return t[0]===n[0]&&t[1]===n[1]}function jl(t){return t}function Hl(t,n,e,r=!1,o=!0){const i=function(t,n,e=!0){const r=2**t*2**-n,o=e?function(t,n){return e=>{const r=Tl(e[0],t,n),o=Tl(e[1],t,n);return r===e[0]&&o===e[1]?e:[r,o]}}(t,n):jl;return t=>{const n=[];for(let e=0;e<t.length;e++){let i=t[e].slice();const c=n[n.length-1],s=c?c[c.length-1]:o(t[0][0]);i[0]=s,i=i.map(t=>o(t)),zl(i)&&(i=[i[0],i[i.length-1]]),i=Xl(i,r,o),void 0!==i&&n.push(i)}const e=n.length;if(!e)return[];const i=n[e-1];return i[i.length-1]=n[0][0],n}}(e,n,o);let c=t.slice();return c=r?function(t,n,e,r=.02){const o=[];for(const i of t){const t=[];for(const o of i){const i=o.map(t=>t.map(t=>{let o,i=0,c=0,s=0;for(;!(++c>10);){i=(t+Math.random())*(1+(Math.random()-.7)*r),i=Tl(i,e,n);const c=vf(i);c>s&&(s=c,o=i)}return o}));t.push(i)}o.push(t)}return o}(c,n,e,1):c,c=c.map(i),c=c.filter(t=>t.length>0),"undefined"!=typeof _debug_&&(_debug_.timing.normalize=performance.now()-_debug_.timing.timingStart),c}const Vl=D(t=>{let n=0;for(const e of t)for(const t of e)for(const e of t)for(const t of e){const e=Math.abs(t);e>n&&(n=e)}return n});function Ql(t){let n=0;for(let e=0;e<=t.length-1&&0===t[e];e++)n++;return 0!==n&&(t=t.slice(n)),t}const{max:Rl}=Math;function Gl(t,n){const e=t.length-1,r=n.length-1;if(e<0||r<0)return[];const o=e+r,i=new Array(o+1).fill(0);for(let c=0;c<e+1;c++)for(let s=0;s<r+1;s++)i[o-(c+s)]+=t[e-c]*n[r-s];return Ql(i)}function Ul(t,n){const e=t.length-1,r=new Array(e+2);for(let n=0;n<e+1;n++)r[n]=t[n]/(e+1-n);return r[e+1]=n,r}const{min:$l,max:Zl}=Math;function Jl(t,n){const e=t.length-1,r=n.length-1,o=Zl(e,r),i=new Array(o+1),c=$l(e,r);for(let s=0;s<=c;s++)i[o-s]=t[e-s]+n[r-s];for(let n=c+1;n<=e;n++)i[o-n]=t[e-n];for(let t=c+1;t<=r;t++)i[o-t]=n[r-t];return Ql(i)}function Kl(t){let n=0;for(const e of t){const[t,r]=uo(e),[o,i]=U(e);n+=G(Ul(Jl(Gl(t,i),Mn(Gl(r,o))),0),1)}return n/2}function ta(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Dt(t[e],t[e+1]);return n}const{sqrt:na}=Math;function ea(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=ta(t);if(256*mu(t[0],t[t.length-1])<s*s){const[r,o]=Ye(t,.5),s=na((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=na((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=V(t[0].map(t=>-t));return po(t.map(t=>R(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=R(i,c);return h.map(n=>V(t[0],d(n)))}function ra(t){return{ps:t,ts:[0,1]}}const oa=tt,ia=it,ca=lt,sa=ct,ua=it,fa=et,la=nt,aa=tr,pa=Zf,ha=J,da=at,{abs:va}=Math,ga={order:0,realOrder:0,collinear:!0,nodeType:"n/a"},ma={order:1,realOrder:1,collinear:!0,nodeType:"n/a"},xa={order:1,realOrder:0,collinear:!0,nodeType:"n/a"},ba={order:2,realOrder:2,collinear:!1,nodeType:"n/a"},wa={order:2,realOrder:2,collinear:!0,nodeType:"n/a"},_a={order:2,realOrder:1,collinear:!0,nodeType:"n/a"},Ma={order:2,realOrder:0,collinear:!0,nodeType:"n/a"},Ia={order:3,realOrder:3,collinear:!1,nodeType:"crunode"},Sa={order:3,realOrder:3,collinear:!1,nodeType:"acnode"},ya={order:3,realOrder:3,collinear:!1,nodeType:"cusp"},Oa={order:3,realOrder:3,collinear:!1,nodeType:"explicit"},Ca={order:3,realOrder:3,collinear:!0,nodeType:"n/a"},Na={order:3,realOrder:2,collinear:!1,nodeType:"n/a"},Ea={order:3,realOrder:2,collinear:!0,nodeType:"n/a"},Ta={order:3,realOrder:1,collinear:!0,nodeType:"n/a"},Pa={order:3,realOrder:0,collinear:!0,nodeType:"n/a"};const{abs:ka,PI:Aa}=Math;function Ba(t,n=[0,1]){if(t.length<=2)return 0;const[e,r]=n;if(e===r)return 0;if(3===t.length){const n=Qt(t,e,r).ps,[[o,i],[c,s],[u,f]]=n;return Kt([c-o,s-i],[u-c,f-s])}if(4===t.length){const n=fn(t,e,r).ps,o=function(t){if(4===t.length)return Uu(t)?function(t){if(!Il(t))return!1;const[n,e,r,o]=t,[i,c]=n,[s,u]=e,[f,l]=r,[a,p]=o,h=ia(oa(ca(s/4,f/4),3),ca(i/4,a/4)),d=ia(oa(ca(u/4,l/4),3),ca(c/4,p/4));return 0===sa(ia(ca(i/2,a/2),h))&&0===sa(ia(ca(c/2,p/2),d))}(t)?Ku(t)?Pa:Ta:Il(t)?Ea:Na:Il(t)?Ca:function(t){const{coeffs:[n,e,r],errBound:[o,i,c]}=rl(t);if(va(n)<=o){const[[n,e],[r,o],[i,c],[s,u]]=t,f=ha(aa(s,n),la(3,aa(r,i))),l=da(pa(i,n),-2*r),a=ha(aa(u,e),la(3,aa(o,c))),p=da(pa(c,e),-2*o);if(0===Jr(fa(l,a),fa(f,p)))return Oa}const s=e*e,u=4*n*r,f=s-u,l=2*i*va(e)+je*s+(4*(o*va(r)+va(n)*c)+je*va(u))+je*va(f);if(f<-l)return Sa;if(f>l)return Ia;const[a,p,h]=cl(t),d=ct(ua(fa(p,p),la(4,fa(a,h))));return d<0?Sa:d>0?Ia:ya}(t);if(3===t.length)return Il(t)?Ju(t)?Ku(t)?Ma:_a:wa:ba;if(2===t.length)return Ku(t)?xa:ma;if(1===t.length)return ga;throw new Error("The given bezier curve must be of order <= 3")}(n),[[i,c],[s,u],[f,l],[a,p]]=n,h=[s-i,u-c],d=[f-s,l-u],v=[a-f,p-l];if(0===d[0]&&0===d[1]||o.realOrder<=2)return Kt(h,v);const g=Kt(h,d)+Kt(d,v);return"acnode"===o.nodeType||"cusp"===o.nodeType?g<=-Aa?g+2*Aa:g>=+Aa?g-2*Aa:g:g}throw new Error("The given bezier curve must be of order <= 3.")}const{round:za,PI:Fa}=Math;const{abs:Ya,max:Da,ceil:La,log2:Xa}=Math;function qa(n,e,r={}){"undefined"!=typeof _debug_&&(_debug_.timing.timingStart=performance.now()),e=e||Vl(n);const o=La(Xa(e)),{inclMicroCorners:i=!0,minLoopArea:c=(2**o*2**-12)**2,forceOrientationNegative:s=!1,booleanOp:u="OR",containerSizeMultiplier:f=16}=r,l=2**o*2**-46*f;(function(t){if("undefined"!=typeof _debug_)for(const n of t){_debug_.elems.loopPre.push(...t),_debug_.elems.loopsPre.push(t);for(const t of n){const n=ho(t),e=ea(t),r=bu(t,!1);_debug_.elems.bezier_.push(t),_debug_.elems.looseBoundingBox_.push(n),_debug_.elems.tightBoundingBox_.push(e),_debug_.elems.boundingHull_.push(r)}}})(n=Hl(n,46,o,!1,!0)),n.sort(Co);const a=n.map((n,e)=>t(n,e)),{extremes:p,containers:h}=Pl(a,l,o),d={dir:void 0,idx:0,parent:void 0,children:new Set,windingNum:0,p:void 0,_x_:void 0,container:void 0,loopsIdxs:new Set,orientation:-1},v=new Set,g=new Set;for(const t of a){if(v.has(t))continue;v.add(t);const n=Oo(d,t),e=p.get(t)[0].container;if(0===e.inOuts.length)continue;const r=Bl(e,n,t),o=2===e.inOuts.length&&2===e.xs.length;if(o&&e.inOuts[0].nextOrPrev===e.inOuts[1])r.bezierPieces=t.beziers.map(ra),r.parent.children=r.parent.children||new Set,r.parent.children.add(r);else if(so(r,v,g,!1),o&&void 0!==r.bezierPieces){const{bezierPieces:t}=r,n=t[t.length-1],e=t[0];if(n.ps===e.ps){const r={ps:n.ps,ts:[n.ts[0],e.ts[1]]};t.shift(),t.pop(),t.unshift(r)}}}const m=function(t){const n=[],e=[t];for(;e.length;){const t=e.pop();0===t.windingNum&&n.push(...t.children),e.push(...t.children),0===t.windingNum&&(t.children=new Set)}return n}(d),x=function(t){return n=>{const e="OR"===t||"XOR"===t?[n]:[];n.used="OR"===t||"XOR"===t;const r=Array.from(n.children);for(;r.length;){const n=r.pop();if("OR"===t&&0===n.windingNum&&e.push(n),"AND"===t){const t=Po(n);(0===n.windingNum&&t||Eo(n.windingNum)>=2&&!t)&&(e.push(n),n.used=!0)}if("XOR"===t){const t=Po(n);(0===n.windingNum&&t||Eo(n.windingNum)>=2&&t)&&(e.push(n),n.used=!0)}for(const t of n.children)r.push(t)}return e}}(u),b=m.map(x).filter(t=>0!==t.length).map(n=>{const e=n[0].orientation;return n.map((n,r)=>function(n,e,r,o){const i=n.bezierPieces?.map(io);if(void 0===i)return t([],r);const{orientation:c}=n,s=o?-1:e;return t((0===r?s:-s)*c>0?i:i.map(t=>t.toReversed()).toReversed(),r)}(n,e,r,s))}),w=[];for(let t=0;t<b.length;t++){const n=b[t].filter(t=>Ya(Kl(t.beziers))>c);n.length&&(n.sort((t,n)=>Co(t.beziers,n.beziers)),w.push(n))}"undefined"!=typeof _debug_&&(_debug_.timing.simplifyPaths=performance.now()-_debug_.timing.timingStart-_debug_.timing.normalize);const _=i?w:w.map(n=>n.map(n=>{const{beziers:e}=n,r=function(t,n){!function(t){za(function(t){const n=t.length;let e=0;for(let r=0;r<n;r++){const o=t[(r-1+n)%n],i=t[r];e+=Ba(i,[0,1])+Kt($(o,1),$(i,0))}return e}(t)/(2*Fa))}(t);const e=t.map(t=>t.map(t=>[t[0],t[1]])).filter(t=>ta(t)>n),r=e.length;for(let t=0;t<r;t++){const n=e[t],o=e[(t+1)%r],i=n[n.length-1],c=o[0];c[0]===i[0]&&c[1]===i[1]||(i[0]=c[0],i[1]=c[1])}return e}(e,Da(...h.map(t=>Ya(t.box[0][0]-t.box[1][0])),...h.map(t=>Ya(t.box[0][1]-t.box[1][1]))));return t(r,n.idx)}));return function(t){if("undefined"!=typeof _debug_)for(const n of t)_debug_.elems.loop.push(...n),_debug_.elems.loops.push(n)}(_),_}const{max:Wa,abs:ja}=Math;function Ha(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=n[0],v=n[1],g=c-d,m=u-d,x=l-d,b=p-d,w=s-v,_=f-v,M=a-v,I=h-v,S=g*g,y=6*g*m,O=6*x*b,C=w*w,N=6*w*_,E=6*M*I,T=6*m*b+9*x*x,P=2*g*b+18*m*x,k=6*g*x+9*m*m,A=6*_*I+9*M*M,B=2*w*I+18*_*M,z=6*w*M+9*_*_;return[6*(b*b-O+(S-y)+T+(k-P)+(I*I-E+(C-N)+A+(z-B))),5*(O+5*y+3*P-2*(T+2*k+3*S)+(E+5*N+3*B-2*(A+2*z+3*C))),4*(T-3*(P-2*k)-5*(2*y-3*S)+(A-3*(B-2*z)-5*(2*N-3*C))),3*(P-2*(2*k-5*(y-2*S))+(B-2*(2*z-5*(N-2*C)))),2*(k-5*(y-3*S)+(z-5*(N-3*C))),y-6*S+(N-6*C)]}function Va(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n[0],p=n[1],h=i-a,d=s-a,v=f-a,g=c-p,m=u-p,x=l-p,b=h*h,w=h*d,_=d*v,M=g*g,I=g*m,S=m*x,y=g*x+m*m*2,O=h*v+d*d*2;return[x*x+M+2*y-4*(S+I)+(v*v+b+2*O-4*(_+w)),3*(S-y+(3*I-M)+(_-O+(3*w-b))),y-3*(2*I-M)+(O-3*(2*w-b)),I-M+(w-b)]}function Qa(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=u*f+l*a,h=l*l+u*u;return[f*f+a*a+(h-2*p),p-h]}const{sqrt:Ra}=Math;function Ga(t,n,e=!0){let r;if(4===t.length)r=Ha(t,n);else if(3===t.length)r=Va(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Dt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}r=Qa(t,n)}const o=Fe(r,0,1)?.map(t=>t.t)||[];e&&(o.push(0),o.push(1));let i,c=Number.POSITIVE_INFINITY;for(const e of o){const r=Ye(t,e),o=mu(r,n);o<c&&(c=o,i={p:r,t:e,d:Ra(o)})}return i}const{sqrt:Ua}=Math,{abs:$a}=Math;function Za(t){let n=Number.NEGATIVE_INFINITY;for(let e=0;e<t.length;e++){const r=t[e],o=$a(r[0]),i=$a(r[1]);o>n&&(n=o),i>n&&(n=i)}return n}const{max:Ja}=Math;function Ka(t){return Ja(t.hL+t.hEL,t.hR+t.hER)}function tp(t,n){const e=Ka(t)-Ka(n);return 0!==e?e:t.tS-n.tS}class np{compare;heap=[];constructor(t){this.compare=t}insert(t){const n=this.heap;n.push(t);let e=n.length-1;for(;;){const r=(e-1-(e+1)%2)/2;if(-1===r)return;const o=n[r];if(this.compare(t,o)<0)break;n[r]=t,n[e]=o,e=r}}popMax(){const t=this.heap,n=t[0];return t[0]=t[t.length-1],t.length--,this.swimDown(),n}swimDown(){const t=this.heap,n=t.length;let e=0;for(;;){const r=2*e+1;if(r>=n)break;const o=2*e+2,i=o>=n||this.compare(t[r],t[o])>0?r:o,c=t[i],s=t[e];if(this.compare(s,c)>0)break;t[i]=s,t[e]=c,e=i}}swapMinOrMax(t){this.heap[0]=t,this.swimDown()}static getParentIdx(t){return(t-1-(t+1)%2)/2}static getLeftChild(t){return 2*t+1}static getRightChild(t){return 2*t+2}}const{max:ep}=Math;function rp(t,n,e,r=50){if(1===t.length)return Ga(n,t[0]).d;if(1===n.length)return function(t,n){let e;if(4===t.length)e=Ha(t,n);else if(3===t.length)e=Va(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Dt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=Qa(t,n)}const r=Fe(e,0,1)?.map(t=>t.t)||[];r.push(0),r.push(1);let o,i=Number.NEGATIVE_INFINITY;for(const e of r){const r=Ye(t,e),c=mu(r,n);c>i&&(i=c,o={p:r,t:e,d:Ua(c)})}return o}(t,n[0]).d;if(2===t.length&&2===n.length){const e=Ga(n,t[0]).d,r=Ga(n,t[t.length-1]).d;return e>r?e:r}const o=ep(Za(t),Za(n));e=e||o/1e6;const[i,c]=op(t,0,1),s={tS:0,tE:1,hL:Ga(n,t[0]).d,hR:Ga(n,t[t.length-1]).d,hEL:i,hER:c},u=new np(tp);u.insert(s);let f=0,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(;;){const o=u.heap[0],{tS:i,tE:c,hL:s,hR:p}=o,h=(i+c)/2,[d,v]=op(t,i,h),[g,m]=op(t,h,c),x=Ye(t,h),b=Dt(x,Ga(n,x).p),w=ep(s,b,p);if(w>a&&(a=w),l=Ka(o),l-a<e)return a;if(f++>r)return a;const _={tS:i,tE:h,hL:s,hR:b,hEL:d,hER:v},M={tS:h,tE:c,hL:b,hR:p,hEL:g,hER:m};u.swapMinOrMax(_),u.insert(M)}}function op(t,n,e){const r=(e+n)/2,o=P(t,n,r),i=P(t,r,e);return[ta(o),ta(i)]}function ip(t,n=!1){const e=t;let r=e;const o=[];do{n&&r===e||m(r)||o.push(r),r=r.nextOnCircle}while(r!==e);return o}function cp(t){const n=[],e=[t],r=new Set;for(;e.length>0;){const t=Ft(e.pop());if(0===t.length)continue;n.push(t);const o=t[0],i=t[t.length-1].next.prevOnCircle;r.add(o),r.add(i);const c=ip(o,!0),s=ip(i,!0),u=c.filter(t=>!r.has(t)),f=s.filter(t=>!r.has(t));for(const t of u)r.add(t);for(const t of f)r.add(t);e.push(...u,...f)}return n}class sp{datum;color=0;parent;left;right;constructor(t){this.datum=t}}class up{compare;root;constructor(t){this.compare=t,this.root=void 0}isEmpty(){return void 0===this.root}find(t){let n=this.root;for(;n;){const e=this.compare(t,n.datum);if(0===e)return n;n=e<0?n.left:n.right}}insert(t){if(void 0===this.root)return this.root=new sp(t),void(this.root.color=1);let n,e=this.root;for(;e;){n=e;const r=this.compare(t,e.datum);if(0===r)return void(e.datum=t);e=r<0?e.left:e.right}const r=new sp(t);r.parent=n,this.compare(t,n.datum)<0?n.left=r:n.right=r,this.fixInsert(r)}remove(t,n=!1,e){const r=this.find(t);if(void 0===r)return;const o=r.datum;return this.removeNode(r),o}findBounds(t){let n=this.root;const e=[void 0,void 0];for(;n;)this.compare(t,n.datum)>=0?(e[0]=n,n=n.right):(e[1]=n,n=n.left);return e}getMinNode(t){let n=void 0===t?this.root:t;for(;n&&n.left;)n=n.left;return n}getMaxNode(t){let n=void 0===t?this.root:t;for(;n&&n.right;)n=n.right;return n}removeNode(t){let n,e,r=t,o=r.color;void 0===t.left?(n=t.right,e=t.parent,this.transplant(t,t.right)):void 0===t.right?(n=t.left,e=t.parent,this.transplant(t,t.left)):(r=this.getMinNode(t.right),o=r.color,n=r.right,r.parent===t?(e=r,n&&(n.parent=r)):(e=r.parent,this.transplant(r,r.right),r.right=t.right,r.right.parent=r),this.transplant(t,r),r.left=t.left,r.left.parent=r,r.color=t.color),1===o&&this.fixDelete(n,e)}fixInsert(t){let n=t;for(;n.parent&&0===n.parent.color;){const t=n.parent,e=t.parent;if(t===e.left){const r=e.right;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.right&&(n=t,this.rotateLeft(n)),n.parent.color=1,e.color=0,this.rotateRight(e))}else{const r=e.left;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.left&&(n=t,this.rotateRight(n)),n.parent.color=1,e.color=0,this.rotateLeft(e))}}this.root.color=1}fixDelete(t,n){let e=t,r=n;for(;e!==this.root&&1===this.colorOf(e)&&void 0!==r;)if(e===r?.left){let t=r.right;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateLeft(r),t=r.right),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=e?.parent):(1===this.colorOf(t?.right)&&(t?.left&&(t.left.color=1),t&&(t.color=0,this.rotateRight(t)),t=r.right),t&&(t.color=r.color),r.color=1,t?.right&&(t.right.color=1),this.rotateLeft(r),e=this.root,r=void 0)}else{let t=r?.left;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateRight(r),t=r.left),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=r?.parent):(1===this.colorOf(t?.left)&&(t?.right&&(t.right.color=1),t&&(t.color=0,this.rotateLeft(t)),t=r?.left),t&&(t.color=r.color),r.color=1,t?.left&&(t.left.color=1),this.rotateRight(r),e=this.root,r=void 0)}e&&(e.color=1)}transplant(t,n){void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n&&(n.parent=t.parent)}rotateLeft(t){const n=t.right;t.right=n.left,n.left&&(n.left.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}rotateRight(t){const n=t.left;t.left=n.right,n.right&&(n.right.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}colorOf(t){return t?t.color:1}}function fp(t){const n=new Map;return p(t).forEach(function(t){const e=t.pointOnShape.curve.loop;let r=n.get(e);r||(r=new up(xn),n.set(e,r)),r.insert(t)}),n}const{max:lp}=Math;function ap(t,n=.125,e=50){let r=N(t.cpNode);for(;!m(r);)r=r.next;const o=cp(r),i=new Set;for(let t=0;t<o.length;t++){const r=o[t];let c=0;for(;c<r.length;){const t=c;for(;(c++,c!==r.length)&&!(pp(t,c,r,e)>n);)i.add(r[c])}}r=function(t,n){const e=n;do{if(t(n))return n;n=n.next}while(n!==e)}(m,r);for(const n of i)wn(t=>2!==v(t)&&!t.isHoleClosing)(n)||B(n,t.meta);return{cpNode:r,meta:{...t.meta,cpTrees:fp(r)}}}function pp(t,n,e,r){const o=[],i=Tt(e[t],e[n].next);for(;t<n+1;t++)o.push(rp(Pt(e[t]),i,r));return lp(...o)}function hp(t){const n=[],e=p(t);for(const t of e)w(t)&&!t.isHoleClosing&&n.push(t);return n}const dp=function(t,n,e){const r=t.get(n);return void 0!==r&&r.has(e)},vp=function(t,n,e){let r=t.get(n);void 0===r&&(r=new Set,t.set(n,r)),r.add(e)};function gp(t){let n=t,e=t.prevOnCircle;for(;m(e);)e=e.prevOnCircle;const r=[];do{m(n)||r.push(n),n=n.nextOnCircle}while(n!==e);return r}function mp(t,n){const e=new Map,r=new Map;return S(t,function(t){const o=r.get(t)||n*t.pointOnShape.circle.radius,i=t.next,c=function(t,n,e=.4,r=16){if(4===n.length)return ln(t,n,e,r);if(3===n.length)return cn(t,n,e,r);if(2===n.length)return Lt(t,n);if(1===n.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}([0,1],Pt(t)),s=i.pointOnShape.circle.radius;if(o-c>n*s)for(const t of g(i))if(r.set(t,o-c),!i.isHoleClosing){const{center:t}=i.pointOnShape.circle;vp(e,t[0],t[1])}}),e}function xp(t,n){let e=0;"undefined"!=typeof _debug_&&(e=performance.now());const r=function(t){const n=p(t);return n.reduce(function(t,n){return t.pointOnShape.circle.radius>=n.pointOnShape.circle.radius?t:n},n[0])}(N(t.cpNode));!function(t,n){const e=hp(n);for(;e.length;){const r=e.pop(),{center:o}=r.pointOnShape.circle;if(!dp(t,o[0],o[1])||r.isIntersection)continue;let i=r.prevOnCircle,c=!1;for(;!c;){i=i.next;const{center:e}=i.pointOnShape.circle;if(dp(t,e[0],e[1]))if(At(i,n))c=!0;else{if(1===gp(i).length)continue;c=!0}else{for(;m(i.prevOnCircle);)i=i.prevOnCircle;c=!0}}if(c){const t=i.prevOnCircle;t.next=i,i.prev=t,t.nextOnCircle=i,i.prevOnCircle=t}}}(mp(r,n),r);const o={cpNode:r,meta:{...t.meta,cpTrees:fp(r)}};return function(t){"undefined"!=typeof _debug_&&(_debug_.timing.sats=performance.now()-t)}(e),o}const bp={maxCurviness:.05,maxLength:40,applySat:!0,satScale:2,simplify:!0,simplifyTolerance:2**-4,minBezLength:2**-6,angleIncrement:15},wp={maxCurviness:{range:[.01,3],scaleByMaxCoordinate:!1},maxLength:{range:[1,1024],scaleByMaxCoordinate:!0},angleIncrement:{range:[.1,360],scaleByMaxCoordinate:!1},satScale:{range:[1,1/0],scaleByMaxCoordinate:!1},simplifyTolerance:{range:[2**-20,2**20],scaleByMaxCoordinate:!0},minBezLength:{range:[2**-20,2],scaleByMaxCoordinate:!0}};function _p(t){return[t[1],-t[0]]}function Mp(t,n){if(!yt(n))return 0;const e=St(n);return e.isDull?-q(_p(e.tangents[0]),Q(X(n.p,t))):0}function Ip(t){return t[0]*t[0]+t[1]*t[1]}function Sp(t,n,e){return t[0]*(n[1]*e[2]-n[2]*e[1])-t[1]*(n[0]*e[2]-n[2]*e[0])+t[2]*(n[0]*e[1]-n[1]*e[0])}function yp(t){const n=t[0],e=t[1],r=t[2],o=Ip,i=.5*Sp([o(n),n[1],1],[o(e),e[1],1],[o(r),r[1],1]),c=.5*Sp([n[0],o(n),1],[e[0],o(e),1],[r[0],o(r),1]),s=Sp([n[0],n[1],1],[e[0],e[1],1],[r[0],r[1],1]);return[i/s,c/s]}function Op(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}const Cp=tr,Np=Gn,Ep=Ut,Tp=Number.EPSILON;function Pp(t,n){const[e,r]=t,[o,i]=n,c=tr(e,o),s=tr(r,i);return Ut(Gn(c,c),Gn(s,s))[1]}const kp=Number.EPSILON;function Ap(t,n,e){const[r,o]=e,{ps:i}=t,c=[];if(r!==o){const{polyDd:e,polyE:s,getPolyExact:u}=Xr(i,n),f=Fe(e,r,o,s,u)||[];c.push(...f.map(e=>{const{tS:r,tE:o,t:c}=e,s=c<0?0:c>1?1:c,u=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=1/0,a=-1/0;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=Cp(t,u),r=Cp(n,f),o=Ep(Np(e,e),Np(r,r))[1],i=o*(1-Tp),c=o*(1+Tp);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}($e(i,[r,o]),n),f=0===s?1:s;return{curve:0===s?t.prev:t,t:f,dSquaredI:u}}))}const s=e.slice();return r===o&&s.push(r),c.push(...s.map(e=>{const r=Pp(Gs(i,[0,e]).map(t=>t[0]+t[1]),n),o=[r*(1-kp),r*(1+kp)],c=0===e?1:e;return{curve:0===e?t.prev:t,t:c,dSquaredI:o}})),c}const{min:Bp}=Math,zp=1+2**-20;function Fp(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];return u<o?f<i?mu(t[0],n):f>s?mu([o,s],n):(o-u)**2:u>c?f<i?mu([c,i],n):f>s?mu(t[1],n):(u-c)**2:f<i?(i-f)**2:f>s?(f-s)**2:0}const Yp=D(po);function Dp(t,n){const e=[0,1,2,3].map(e=>function(t,n){const e=mu,r=n[0],o=n[1],i=e(r,o);if(0==i)return e(t,r);let c=((t[0]-r[0])*(o[0]-r[0])+(t[1]-r[1])*(o[1]-r[1]))/i;return c=Math.max(0,Math.min(1,c)),e(t,[r[0]+c*(o[0]-r[0]),r[1]+c*(o[1]-r[1])])}(n,[t[e],t[(e+1)%4]])),r=mu(t[0],t[1]),o=mu(t[0],t[3]);return e[0]<=o&&e[2]<=o&&e[1]<=r&&e[3]<=r?0:Math.min(...e)}const Lp=D(ea);function Xp(t,n){return Gs(t,[0,n])}function qp(t,n){t=function(t,n){const e=function(t,n){let e=1/0;for(let r=0;r<t.length;r++){const o=t[r],{curve:{ps:i},ts:c}=o,s=Ye(i,c[0]),u=Ye(i,c[1]);e=Bp(e,mu(n,s),mu(n,u))}return zp*e}(t,n);return t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Fp(Yp(c),n)<=e&&r.push(i)}return r}(t,n,e),t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],c=i.curve.ps;Dp(Lp(c),n)<=e&&r.push(i)}return r}(t,n,e),t}(t,n);const e=[];for(let r=0;r<t.length;r++){const o=t[r],i=Ap(o.curve,n,o.ts);e.push(...i)}let r=1/0;for(let t=0;t<e.length;t++){const n=e[t].dSquaredI[1];n<r&&(r=n)}const o=[];for(let t=0;t<e.length;t++){const n=e[t];n.dSquaredI[0]<=r&&o.push(n)}return o.map(t=>{const{curve:n,t:e}=t,{ps:r}=n,o=Xp(r,e);return{curve:n,t:e,isSource:!1,p:o.map(t=>t[0]+t[1]),pDd:o}})}function Wp(t,n){return n.map(n=>qp(n,t)[0])}function jp(t,n){return[n*t[0],n*t[1]]}function Hp(t,n,e){const r=Op(e);let o,i,c,s,u=1,f=0;do{i=V(jp(e,u),n),c=t.map(t=>qp(t,n)[0]),s=Op(X(i,yp(c.map(t=>t.p)))),o=s<r,u/=2,f++}while(!o&&f<3);return{newX:i,newV:s,newPoss:c}}const{min:Vp,abs:Qp,asin:Rp}=Math;function Gp(t,n,e,r,o){const i=2**(o-32),c=[t[0],t[n],t[t.length-1]],s=[r[0],r[n],r[t.length-1]],u=[[c[0],c[1],c[2]],[c[1],c[2],c[0]],[c[2],c[0],c[1]]][e],f=[[s[0],s[1],s[2]],[s[1],s[2],s[0]],[s[2],s[0],s[1]]][e];if(_(u[0][0]))return;let l,a=0,p=function(t,n){const e=t[0][0].pointOnShape.circle.center,r=qp(n[1],e)[0];return yp([t[0][0].pointOnShape.p,r.p,t[2][1].pointOnShape.p])}(u,f),h=1/0;for(;h>i&&a<10;){if(a++,l=Wp(p,f),!Number.isFinite(p[0])||!Number.isFinite(p[1]))return;const t=yp(l.map(t=>t.p)),n=X(p,t);if(!Number.isFinite(n[0])||!Number.isFinite(n[1]))return;const e=Hp(f,p,n);p=e.newX,l=e.newPoss;const r=Op(n);h=Qp(r-e.newV)}const d=(Dt(p,l[0].p)+Dt(p,l[1].p)+Dt(p,l[2].p))/3,v={center:p,radius:d};let g=0;for(let t=0;t<3;t++){const n=l[t],e=Q(X(n.p,p)),r=W(e);if(yt(n)&&St(n).isDull){const t=It(n.curve.ps,n.curve.next.ps).tangents.map(W),r=Rp(j(t[0],e)),o=Rp(j(e,t[1]));let i=0;r>0&&(i+=r),o>0&&(i+=o),g+=i}else{const t=Q($(n.curve.ps,n.t));g+=Qp(Rp(j(r,t)))}}const m=[];for(let t=0;t<r.length;t++){const n=qp(r[t],p)[0];m.push(Dt(n.p,p))}const x=Vp(...m);return{threeProngInfo:{poss:l,circle:v,δ3s:u},error:1*Qp(d-x)+1*g}}function Up(t){let n=t[0];const e=t[1],r=[];let o=!0;do{const t=n.pointOnShape,e=n.next.pointOnShape,i=t.curve,c=e.curve;if(o)if(o=!1,c===i&&mn(e,t)>0)r.push({curve:i,ts:[t.t,e.t]}),n=n.next;else{if(i.loop===c.loop){const n={curve:i,ts:[t.t,1]};r.push(n),$p(r,i,c,e.t)}n=n.next}else o=!0,n=n.prevOnCircle}while(n!==e);return r}function $p(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({curve:o,ts:[0,n]})}while(o!==e)}function Zp(t,n,e,r){const o={...n,order:e,order2:r},i=t.findBounds({pointOnShape:o});if(void 0!==i[0]||void 0!==i[1])return void 0===i[0]||void 0===i[1]?t.getMaxNode()?.datum:i[0].datum}function Jp(t,n,e,r,o,i,c){if(void 0!==i&&!function(t,n,e){const r=mn(n,e.pointOnShape);if(r<0)return!0;if(0===r)return!1;const o=t.getMinNode();if(void 0===o)return!0;const i=o.datum;return mn(t.getMaxNode().datum.pointOnShape,n)<0&&i===e}(r,o,i.next)&&!t)return;const s={pointOnShape:o,isHoleClosing:n,isIntersection:e,id:c.id,next:void 0,prev:void 0,nextOnCircle:void 0,prevOnCircle:void 0};c.id++;const u=void 0===i?s:i,f=void 0===i?s:u.next;return f.prev=s,u.next=s,s.prev=u,s.next=f,r.insert(s),s}function Kp(t,n,e,r,o,i,c){const{cpTrees:s}=o;let u=!1;const f=i.map((i,f)=>{const l=r[f],a=s.get(i.curve.loop),p={...i,circle:e,order:l,order2:0},h=void 0===c?Zp(a,i,l,0):c[f],d=Jp(t,n,!1,a,p,h,o.lastInsertId);return void 0===d&&(u=!0),d});return u||function(t,n){n=n.slice().sort(function(t){const n=t.center;return function(t,e){let r=t.pointOnShape.p,o=e.pointOnShape.p;r=[r[0]-n[0],r[1]-n[1]],o=[o[0]-n[0],o[1]-n[1]];const i=Math.atan2(r[1],r[0]);return Math.atan2(o[1],o[0])-i}}(t));const e=n.length;for(let t=0;t<e;t++){const r=n[t];r.nextOnCircle=n[(t+1)%e],r.prevOnCircle=n[(t-1+e)%e]}}(e,f),{anyFailed:u,cpNodes:f}}const th=Math.cos(Math.PI/180*1);function nh(t,n,e,r,o,i){const{cpTrees:c,maxCoordPowerOf2:s}=t,u=2**(s-40),f=2**(s-46),l=Zp(c.get(n.curve.loop),n,r,o);if(!l)return;const a=[l,l.next],{p,t:h}=n;for(const t of a){const n=t.pointOnShape.p,r=Dt(p,n);if(!(r>u)&&(q(Q(X(n,t.pointOnShape.circle.center)),Q(X(p,e.center)))>th||r<f&&0!==h&&1!==h))return t}}function eh(t,n){const e=[];for(const t of n)e.push([t,t.next]);const r=function(t,n){const e=t.map(Up);let r,o=1/0;for(let i=1;i<t.length-1;i++)for(let c=0;c<3;c++){const s=Gp(t,i,c,e,n);if(void 0===s)continue;const{error:u,threeProngInfo:f}=s;u<o&&(o=u,r=f)}return r}(e,t.maxCoordPowerOf2),{circle:o,poss:i,δ3s:c}=r,s=[];for(let t=0;t<3;t++)s.push(Mp(o.center,i[t]));const u=[];for(let n=0;n<i.length;n++){const e=nh(t,i[n],o,s[n],0);void 0!==e&&v(e)<=2&&!e.isHoleClosing&&u.push(e)}return{closeBysFor3Prong:u,cpNodes:0===u.length?Kp(!0,!1,o,s,t,i,c.map(t=>t[0])).cpNodes:[]}}let rh,oh=0;function ih(t,n){if(Ot(n.pointOnShape))return{closeBysFor3Prong:void 0,addedCpNodes:[]};const e=[];for(;;){if(void 0===n)continue;const r=I(n);if(r.length<=2)break;const{closeBysFor3Prong:o,cpNodes:i}=eh(t,r);if(e.push(i),o.length>0)return{closeBysFor3Prong:o,addedCpNodes:e};if("undefined"!=typeof _debug_&&++oh===_debug_.directives.stopAfterThreeProngsNum)return}return{closeBysFor3Prong:void 0,addedCpNodes:e}}function ch(t){for(const n of t)return n}function sh(t,n,e,r){const o=n[0];g(o).forEach(t=>{e.delete(t),r.delete(t)}),B(o,t)}function uh(t,n,e){const r=new Map;for(let o=0;o<n.length;o++){const i=new up(xn);r.set(t[o],i);const c=n[o];let s,u;for(const t of c){const n={center:t.p,radius:0},{curve:r}=t,o={...t,curve:r,t:1,circle:n,order:-1,order2:0},c={...t,curve:r.next,t:0,circle:n,order:1,order2:0};s=Jp(!0,!1,!1,i,o,u,e),u=Jp(!0,!1,!1,i,c,s,e),s.prevOnCircle=u,u.prevOnCircle=s,s.nextOnCircle=u,u.nextOnCircle=s}}return r}function fh(t){const n=[],e=[],r=[],o=[],i=[];for(const c of t)for(const t of c.curves){const c=t.ps,s=bu(c,!0);r.push(s);const u=Yp(c);n.push(u);const f=ea(c);e.push(f);const l=It(t.ps,t.next.ps);l.isQuiteSharp?o.push(t):l.isQuiteDull&&i.push(t)}return{looseBoundingBoxes:n,tightBoundingBoxes:e,boundingHulls:r,sharpCorners:o,dullCorners:i}}function lh(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(!(ta(o.ps)<t)&&It(o.ps,o.next.ps).isQuiteSharp){const{ps:t}=o,n=t[t.length-1],r=[[0,n[0]],[0,n[1]]];e.push({curve:o,t:1,isSource:!0,p:n,pDd:r})}}return e}}function ah(t,n){let e=[0,0];for(let r=0;r<t.length;r++)e=Ut(t[r],Hn(n,e));return e}const ph=tr,hh=Hn,dh=Ut,vh=qo,gh=Zf;function mh(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[dh(ph(s,n),hh(3,ph(r,i))),hh(3,vh(gh(i,n),-2*r)),hh(3,ph(r,n)),[0,n]],[dh(ph(u,e),hh(3,ph(o,c))),hh(3,vh(gh(c,e),-2*o)),hh(3,ph(o,e)),[0,e]]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[vh(gh(i,n),-2*r),ph(2*r,2*n),[0,n]],[vh(gh(c,e),-2*o),ph(2*o,2*e),[0,e]]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[ph(r,n),[0,n]],[ph(o,e),[0,e]]]}(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[[0,n]],[[0,e]]]}(t);throw new Error("The given bezier curve must be of order <= cubic.")}function xh(t,n){const e=t[0],r=t[1],o=r-n,i=o-r,c=e-e,s=r-(o-i)+(-n-i)+e,u=o+s,f=e-(e-c)-c+(s-(u-o)),l=u+f;return[f-(l-u),l]}const bh=Hn,wh=Ut,_h=Gn,Mh=ii,Ih=br,Sh=nr,yh=xh,Oh=tr,Ch=Ut,Nh=Gn,Eh=ii,Th=br,Ph=nr,kh=xh,Ah=Hn,Bh=Ut,zh=Gn,Fh=ii,Yh=br,Dh=nr,Lh=xh,Xh=Ut,qh=Gn,Wh=nr,jh=xh;function Hh(t,n,e){const[r,o]=t,[i,c]=n,[s,u]=e,f=jh(r,s),l=jh(o,u);return{a0:Xh(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(L,ed(Zh(t,V))),R=Jh(X,Zh(t,Jh(ed(Q),td(Zh(t,V))))),G=Jh(q,Zh(t,Jh(ed(R),td(Zh(t,Q))))),U=Jh(W,Zh(t,Jh(ed(G),td(Zh(t,R))))),$=Zh(3,Kh(a,d)),Z=ed(ed(Jh(Kh(a,v),Kh(p,d)))),J=Jh(Jh(Kh(a,X),Zh(6,Kh(p,v))),Zh(5,Kh(h,d))),K=Jh(Jh(ed(Kh(p,X)),Zh(8,Kh(h,v))),td(Zh(6,Kh(w,d)))),tt=Jh(Jh(td(Kh(a,W)),Kh(p,q)),Jh(Zh(3,Kh(h,X)),td(Zh(10,Kh(w,v))))),nt=$,et=Jh(Z,ed(ed(Zh(t,nt)))),rt=Jh(J,Zh(t,Jh(ed(ed(et)),td(Zh(6,Zh(t,nt)))))),ot=Jh(K,Zh(t,Jh(ed(ed(rt)),Zh(t,Jh(Zh(-6,et),ed(ed(Zh(t,nt))))))));return{A:[j,H],B:[V,Q,R,G,U],C:[I,y],D:[P,k,A,B,z],H:[nt,et,rt,ot,Jh(tt,Zh(t,Jh(ed(ed(ot)),Zh(t,Jh(Zh(-6,rt),Zh(t,Jh(ed(ed(et)),td(Zh(t,nt)))))))))]}}(p,e,l):function(t,n,e){if(1===e.length){const{a0:r,b0:o}=Hh(t,n,e[0]);return{A:[r],B:[o],C:[],D:[],H:[]}}return Vh[e.length](t,n,e)}(d,e,l);x=Fe(o,u,f)||[];for(let o=0;o<x.length;o++){const i=x[o],{tS:c,tE:l,t:a}=i;if(i.multiplicity>1)continue;if(l<u||c>f)continue;if(c<0)continue;const p=l>1?1:a,d=ah(n,p),v=ah(r,p),g=d[0]+d[1],_=v[0]+v[1],M=od(g);if(id(M)<2**-40)continue;const I=-_/g;if(I<=0)continue;const S=[cd(I,e[0]),cd(I,e[1])],y=[S[0][1],S[1][1]],O=rd(Ip(y));if(O<=2**(t-40))continue;const C=[h[0]+y[0],h[1]+y[1]];i.tS<=u&&i.tE>=u&&(b=!0),i.tS<=f&&i.tE>=f&&(w=!0);const N=0===p?1:p,E={curve:0===p?s.prev:s,s:N,d:O,x:C};m.push(E)}}const _=l[l.length-1];let M=0===p&&s===a.prev||1===p&&s===a;const I=[];if(0===u);else if(1===u)M||b||I.push({P:_,t:1});else if(!b){const t=Ye(l,u);I.push({P:t,t:u})}if(u!==f)if(0===f);else if(1===f)M||w||(I.push({P:_,t:1}),M=!0);else if(!w){const t=Ye(l,f);I.push({P:t,t:f})}for(let t=0;t<I.length;t++){const{P:n,t:r}=I[t],{a0:o,b0:i}=Hh(d,e,n);if(od(o[1])<=2**-40||od(i[1])<=2**-40)continue;const c=-i[1]/o[1];if(c<2**-40)continue;const u=[cd(c,e[0]),cd(c,e[1])],f=[u[0][1],u[1][1]],l=rd(Ip(f)),a=[h[0]+f[0],h[1]+f[1]],p=0===r?1:r,v={curve:0===r?s.prev:s,s:p,d:l,x:a};m.push(v)}return m}function ud(t,n,e){const[r,o]=t,[i,c]=n,[s,u]=e,f=r-s,l=o-u;return{a0:2*(i*f+c*l),b0:f*f+l*l}}const{abs:fd}=Math,ld=1+2**-20,ad=1+2**-20,pd=D(ea),hd=Gt,dd=Ut,vd=$t,gd=jn,{acos:md}=Math,xd=Zf,bd=tr,wd=Hn,_d=Ut,Md=qo;function Id(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[wd(3,_d(bd(s,n),wd(3,bd(r,i)))),wd(6,Md(xd(i,n),-2*r)),wd(3,bd(r,n))],[wd(3,_d(bd(u,e),wd(3,bd(o,c)))),wd(6,Md(xd(c,e),-2*o)),wd(3,bd(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[Md(xd(2*i,2*n),-4*r),bd(2*r,2*n)],[Md(xd(2*c,2*e),-4*o),bd(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[bd(r,n)],[bd(o,e)]]}(t);if(1===t.length)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Sd=tr,yd=Ut,Od=Hn,Cd=qo;function Nd(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Od(6,yd(Sd(s,n),Od(3,Sd(r,i)))),Od(6,Cd(Sd(i,2*r),n))],[Od(6,yd(Sd(u,e),Od(3,Sd(o,c)))),Od(6,Cd(Sd(c,2*o),e))]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[Cd(Sd(2*i,4*r),2*n)],[Cd(Sd(2*c,4*o),2*e)]]}if(t.length<=2)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Ed=Gn,Td=Ut,Pd=$t;const{sqrt:kd}=Math;function Ad(t,n,e){const{curve:r,p:o,t:i}=n,{ps:c}=r,s=1/t,u=function(t,n){const[e,r]=function(t,n){const[e,r]=Id(t),[o,i]=Nd(t),c=ah(e,n),s=ah(r,n),u=ah(o,n),f=ah(i,n),l=Pd(Ed(c,f),Ed(s,u)),a=Td(Ed(c,c),Ed(s,s));return[l,tl(Ed(a,Ed(a,a)))]}(t,n);return Ys(e,r)}(c,i),f=-(u[0]+u[1]),l=f<s?s:f,[a,p]=e,h=kd(a*a+p*p)*l;return[[o[0]+a/h,o[1]+p/h],1/l]}const{sqrt:Bd}=Math,{abs:zd,sin:Fd,cos:Yd,max:Dd,sqrt:Ld}=Math;function Xd(t){const{loops:n,maxCoordPowerOf2:e,squaredDiagonalLength:r}=t,o=(2**(e-21))**2,i=2**(e-46),c=Ld(r),s=2**(e-32);return function(r,u,f,l){const{curve:{loop:a,ps:p},t:h,p:d}=l,v=function(t,n){const[e,r]=Id(t),o=ah(r,n);return[[-o[0],-o[1]],ah(e,n)]}(p,h),g=[-v[0][1],-v[1][1]],m=r?[0,-c]:0!==f?R(Fd(f),Yd(f))(g):g,x=r||0!==f?[[0,m[0]],[0,m[1]]]:[[-v[0][0],-v[0][1]],[-v[1][0],-v[1][1]]];let[b,w]=function(t,n,e,r,o){let i,c;const{p:s}=r;if(n)return[[s[0],s[1]-e],e];if(0===t)return Ad(e,r,o);const{p:u}=r,[f,l]=o,a=e/Bd(f*f+l*l),p=[f*a,l*a];return i=[u[0]+p[0],u[1]+p[1]],c=e,[i,c]}(f,r,c,l,m);const _=function(t,n,e,r,o,i,c){const{cpTrees:s}=o;if(n)return r.filter(t=>t!==e).flatMap(t=>t.curves.map(t=>({curve:t,ts:[0,1]})));const u=yt(i)&&St(i).isDull?1===i.t&&0===t?-1:0===i.t?1:Mp(c,i):0,f=Zp(s.get(e),i,u,0);return f&&f!==f.next.next?Up([f,f]):e.curves.map(t=>({curve:t,ts:[0,1]}))}(f,r,a,n,t,l,b),M=function(t,n,e,r,o){let i=n**2,c=[r[0]+o[0],r[1]+o[1]];for(let t=0;t<e.length;t++){const n=e[t],{ps:s}=n.curve,u=s[0],f=s[s.length-1];for(const t of[u,f]){if(mu(c,t)>i)continue;const{a0:n,b0:e}=ud(r,o,t);if(fd(n)<=2**-40||fd(e)<=2**-40)continue;const s=-e/n;if(s<2**-40)continue;const u=[s*o[0],s*o[1]],f=Ip(u);f<i&&(i=f,c=[r[0]+u[0],r[1]+u[1]])}}return ld*i}(0,w,_,d,m),I=Ld(M),S=Ld(m[0]**2+m[1]**2);b=[d[0]+m[0]/S*I,d[1]+m[1]/S*I],function(t,n,e){if(t.length<=2)return t;let r=0;for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Fp(Yp(c),n)<=ad*e&&Dp(pd(c),n)<=ad*e&&(t[r]=i,r++)}t.length=r}(_,b,M);const y=function(t,n,e,r,o,i,c){const s=[];for(let n=0;n<c.length;n++){const u=sd(t,0,e,r,o,i,c[n]);s.push(...u)}let u=1/0;for(let t=0;t<s.length;t++){const n=s[t].d*(1+2**-46);n<u&&(u=n)}const f=[];for(let t=0;t<s.length;t++){const n=s[t];n.d*(1-2**-46)<=u&&f.push(n)}return f}(e,0,x,l,u,f,_);if(1!==y.length){if(0===y.length)return void(r&&console.log(l));if(!r&&!function(t,n){const{curve:e,s:r,x:o}=t[0],i=2**(n-40);for(let n=1;n<t.length;n++){const{x:e}=t[n];if(zd(o[0]-e[0])>i||zd(o[0]-e[0])>i)return!1}return!0}(y,e))return}const{x:O,d:C,curve:N,s:E}=y[0];if(u&&w<(1-s)*C)return void function(t,n,e,r){if(yt(r)&&St(r).isDull)return;const o={radius:n,center:e};nh(t,r,o,Mp(o.center,r),0)||Kp(!1,!1,o,[-.5,.5],t,[r,r])}(t,w,b,l);const T=Xp(N.ps,E),P={curve:N,t:E,isSource:!1,p:T.map(t=>t[0]+t[1]),pDd:T},k={center:O,radius:C},A=Pp(l.p,P.p),B=Pp(O,P.p);if(!r){if(0===A)return;if(A<=Dd(function(t,n,e){if(n+e>=t)return 1/0;const r=tr(t,n),o=gd(n,r),i=t-n,c=n*i,s=(c-n*e-e*e/2)/(c+i*e),u=Ys(vd(vd(o,hd(n,e)),hd(e,e/2)),dd(o,gd(e,r)))[1];return md(s),n*md(u)}(w,Ld(B),4*i),o))return}return{circle:k,z:P}}}function qd(t,n,e,r,o){e=0===e.t?{...e,curve:e.curve.prev,t:1}:e;const i=Mp(n.center,e),c=Mp(n.center,r),s={...r,circle:n,order:c,order2:0},u={...e,circle:n,order:i,order2:0};if(nh(t,e,n,i,0))return;if(nh(t,r,n,c,0))return;const{anyFailed:f,cpNodes:l}=Kp(o,o,n,[i,c],t,[u,s]);if(!f)return o&&function(t,n){const{cpTrees:e}=t,[r,o]=n,i=o.pointOnShape,c=Jp(!0,!0,!1,e.get(i.curve.loop),{...i,order2:1},o,t.lastInsertId);c.holeCloserTwin=o,o.holeCloserTwin=c;const s=r.pointOnShape,u=Jp(!0,!0,!1,e.get(s.curve.loop),{...r.pointOnShape,order2:-1},r.prev,t.lastInsertId);u.holeCloserTwin=r,r.holeCloserTwin=u,u.prevOnCircle=c,u.nextOnCircle=c,c.prevOnCircle=u,c.nextOnCircle=u,o.next=r,r.prev=o,u.next=c,c.prev=u}(t,l),l[0];l.forEach(n=>{void 0!==n&&A(n,t)})}const{PI:Wd,atan2:jd}=Math;function Hd(t,n,e,r){let o;const i=Xd(t),c=n*Wd/180;for(let n=0;n<e.length;n++){const s=e[n],u=Vd(c,s);for(const e of u){const c=i(!1,r,e,s);if(c){const{circle:n,z:e}=c,r=qd(t,n,s,e,!1);o=o||r}if("undefined"!=typeof _debug_&&n+1===_debug_.directives.stopAfterTwoProngsNum)return}}return o}function Vd(t,n){const e=[0];if(1===n.t){const{curve:r}=n,o=It(r.ps,r.next.ps);if(o.isQuiteDull){const n=_p(o.tangents[0]),r=_p(o.tangents[1]),i=(jd(n[1],n[0])+2*Wd)%(2*Wd),c=((jd(r[1],r[0])+2*Wd)%(2*Wd)-i+2*Wd)%(2*Wd);let s=t;for(;s<=c-t/2;)e.push(s),s+=t}}return e}function Qd(t,n,e,r){let o;for(let i=0;i<e.length;i++){const c=Hd(t,n,e[i],r);o=void 0===o?c:o}return o}function Rd(t,n=.4,e=10,r=2**-16){const o=[0],i=[1];for(;;){const c=o[o.length-1],s=i[i.length-1],u=P(t,c,s),f=ta(u),l=nn(u);if(f<=e&&l<=n||s-c<=r){if(o.push(i.pop()),1===s)return o;continue}const a=(c+s)/2;i.push(a)}}function Gd(t){if(t.length<4)return[];const[[n,e],[r,o],[i,c],[s,u]]=t,f=r-n,l=o-e,a=i-r-f,p=c-o-l,h=s-i-f-2*a,d=u-c-l-2*p,v=a*d-p*h,g=f*d-l*h,m=f*p-l*a;return Fe([v,g,m],0,1)?.map(t=>t.t)||[]}function Ud(t,n,e){return function(r){const o=[],i=r.curves;for(let r=0;r<i.length;r++){const c=i[r],s=c.ps;if(ta(s)<t)continue;let u=Rd(s,n,e);u=2===u.length?[.5]:u,u.push(...Gd(s)),u=u.filter(t=>0!==t&&1!==t);const f=u.map(t=>{const n=Xp(c.ps,t),e=n.map(t=>t[0]+t[1]);return{curve:c,t,isSource:!0,p:e,pDd:n}});o.push(...f)}return o}}const $d=tr,Zd=Ut,Jd=Hn,Kd=nr,tv=er,nv=Hn,ev=Gn,rv=Ut,ov=$t;const iv=tr,cv=Hn,sv=Gn,uv=Ut,fv=$t;function lv(t){if(Il(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&Uu(t)&&(t=Wc(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=iv(r,n),u=iv(i,r),f=fv(u,s),l=iv(o,e),a=iv(c,o),p=fv(a,l),h=uv(fv(cv(n,fv(f,[0,r])),cv(r,fv(u,[0,r]))),fv(cv(e,fv(p,[0,o])),cv(o,fv(a,[0,o]))));return[uv(sv(f,f),sv(p,p)),ii(h)]}(t);return{minima:[],maxima:Fe(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=Id(t),[[s,u],[f,l]]=Nd(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Jd(6,Zd($d(s,n),Jd(3,$d(r,i))))],[Jd(6,Zd($d(u,e),Jd(3,$d(o,c))))]]}if(t.length<=3)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=ev(a,i),d=ev(p,e),v=ev(u,c),g=ev(u,i),m=ev(f,f),x=ev(s,c),b=ev(l,r),w=ev(l,e),_=ev(f,r),M=ev(r,e),I=ev(r,n),S=ev(r,o),y=ev(e,e),O=ev(e,n),C=ev(e,i),N=ev(n,c),E=ev(n,o),T=ev(n,n),P=ev(c,i),k=ev(c,o),A=ev(i,i),B=ev(i,o),z=ev(o,o),F=ov(ev(a,c),ev(p,r)),Y=ov(h,d),D=rv(ev(u,r),ev(l,c)),L=rv(rv(ev(u,e),ev(s,r)),rv(ev(l,i),ev(f,c))),X=ov(v,b),q=ov(rv(g,x),rv(w,_)),W=rv(ev(r,r),ev(c,c)),j=rv(M,P),H=rv(C,N),V=rv(k,A),Q=rv(I,y),R=rv(ev(e,o),ev(n,i)),G=ov(T,z),U=ov(O,B),$=rv(S,C),Z=ov(M,P),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ov(ct,ev(s,c))),ev(c,rv(Kd(ev(l,i)),ev(f,c)))))),rv(ev(l,rv(ev(l,H),ev(r,rv(Kd(ev(f,i)),ev(l,o))))),ev(f,ev(c,ct))))),It=rv(ov(wt,_t),Mt),St=ov(rv(ev(W,Y),Kd(ev(j,F))),nv(3,rv(ev(D,q),ev(L,X)))),yt=ov(ev(F,W),nv(3,ev(D,X)));return{inflectionPoly:[ov(ev(s,o),ev(f,n)),ov(rv(ev(u,o),ev(s,i)),rv(ev(l,n),ev(f,e))),ov(rv(g,x),rv(w,_)),ov(v,b)],otherExtremaPoly:[at,vt,bt,It,St,yt]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Fe(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=Hn(n-r,t[r]);return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=fe(i,n);ct(et(fe(e,n),r))>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Fe(e,0,1)?.map(t=>t.t)||[]}}function av(t){const{curve:n,t:e}=t,{ps:r}=n,o=Xp(r,e),i=o.map(t=>t[0]+t[1]);return{curve:n,t:t.t,isSource:!0,p:i,pDd:o}}function pv(t,n,e,r,o){(o&&(r>t.val||r===t.val&&e>t.t)||!o&&(r<t.val||r===t.val&&e>t.t))&&(t.curve=n,t.t=e,t.val=r)}const hv=D(function(t){const n=[{curve:void 0,t:void 0,val:1/0},{curve:void 0,t:void 0,val:1/0}],e=[{curve:void 0,t:void 0,val:-1/0},{curve:void 0,t:void 0,val:-1/0}];return t.curves.forEach(function(t){const r=vo(t.ps);for(let o=0;o<2;o++)pv(n[o],t,r.ts[0][o],r.box[0][o],!1),pv(e[o],t,r.ts[1][o],r.box[1][o],!0)}),{minX:av(n[0]),minY:av(n[1]),maxX:av(e[0]),maxY:av(e[1])}});function dv(t){return hv(t).minY}function vv(t){const{loops:n}=t,e=n.map(dv);let r;const o=Xd(t);for(let n=1;n<e.length;n++){const i=e[n],c=o(!0,!1,0,i);if(!c)throw new Error("Unable to find hole-closing 2-prong");const{circle:s,z:u}=c,f=qd(t,s,i,u,!0);r=void 0===r?f:r}return r}const gv=D(function(t){let n,e,r,o,i=1/0,c=-1/0,s=1/0,u=-1/0;for(const f of t){const t=hv(f);t.minX.p[0]<i&&(n=t.minX,i=t.minX.p[0]),t.maxX.p[0]>c&&(e=t.maxX,c=t.maxX.p[0]),t.minY.p[1]<s&&(r=t.minY,s=t.minY.p[1]),t.maxY.p[1]>u&&(o=t.maxY,u=t.maxY.p[1])}return{minX:n,minY:r,maxX:e,maxY:o}});function mv(t,n,e){"undefined"!=typeof _debug_&&(rh=performance.now());const{minBezLength:r,maxCurviness:o,maxLength:i,angleIncrement:c}=e,s=lh(r),u=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(ta(o.ps)<t)continue;const{next:i,ps:c}=o;if(It(c,i.ps).isQuiteDull){const t=c[c.length-1],n=[[0,t[0]],[0,t[1]]];e.push({curve:o,t:1,isSource:!0,p:t,pDd:n}),e.push({curve:i,t:0,isSource:!0,p:t,pDd:n})}}return e}}(r),f=Ud(r,o,i),l=function(t){return function(n){const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(ta(o.ps)<t)continue;const{ps:i}=o;e.push(...lv(i).maxima.map(t=>{const n=Xp(i,t),e=n.map(t=>t[0]+t[1]);return{curve:o,t,isSource:!0,p:e,pDd:n}}))}return e}}(r),a=gv(t),h=(a.maxX.p[0]-a.minX.p[0])**2+(a.maxY.p[1]-a.minY.p[1])**2,d=t.map(s),v={id:0},g={maxCoordPowerOf2:n,squaredDiagonalLength:h,loops:t,cpTrees:uh(t,d,v),lastInsertId:v,...fh(t)};let m;if(m=vv(g),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterHoleClosers)return{cpNode:m,meta:g};if(function(){if("undefined"==typeof _debug_)return;const t=performance.now();_debug_.timing.holeClosers+=t-rh,rh=t}(),m=Qd(g,c,t.map(u),!1)||m,m=Qd(g,c,t.map(l),!0)||m,m=Qd(g,c,t.map(f),!1)||m,function(){if("undefined"==typeof _debug_)return;const t=performance.now();_debug_.timing.oneAnd2Prongs+=t-rh,rh=t}(),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterTwoProngs)return{cpNode:m,meta:g};if(m=function(t,n){if(void 0===n)return;const e=new Set;let r=!0;for(;r;){r=!1;const o=new Set(p(n));for(const n of o){const{closeBysFor3Prong:i,addedCpNodes:c}=ih(t,n);c.length>0&&(r=!0),void 0===i?e.add(n):(r=!0,sh(t,i,o,e)),c.forEach(t=>t.forEach(t=>e.add(t)))}n=ch(e)}return n}(g,m),void 0===m)return;if("undefined"!=typeof _debug_&&_debug_.directives.stopAfterThreeProngs)return{cpNode:m,meta:g};const x={cpNode:m,meta:g};return"undefined"!=typeof _debug_&&(_debug_.timing.threeProngs+=performance.now()-rh),x}const{ceil:xv,log2:bv}=Math;function wv(t,n){const{maxCoordinate:e}=function(t){let n=0,e=1/0,r=-1/0,o=1/0,i=-1/0;for(const c of t)for(const t of c)for(const c of t){const t=c[0],s=c[1],u=Wa(ja(t),ja(s));u>n&&(n=u),t<e&&(e=t),t>r&&(r=t),s<o&&(o=s),s>i&&(i=s)}return{maxCoordinate:n,width:r-e,height:i-o}}(t),r=xv(bv(e)),o=function(t,n){const e={...n};for(const n in wp){const r=n;let o=e[r];const i=wp[r],{range:c,scaleByMaxCoordinate:s}=i;o<c[0]&&(o=c[0]),o>c[1]&&(o=c[1]),s&&(o*=2**(t-10)),e[r]=o}return e}(r,{...bp,...n||{}}),{applySat:i,simplify:c,satScale:s,simplifyTolerance:u}=o,f=qa(t,void 0,{forceOrientationNegative:!0}),l=[];for(const t of f){let n=mv(t,r,o);void 0!==n&&(i&&(n=xp(n,s)),c&&(n=ap(n,u,50)),l.push(n))}return l}function _v(t){const n=function(t){let n=t;const e=hp(t);for(;e.length;){const r=e.pop();if(r.isHoleClosing||r.isIntersection)continue;let o=r.next;for(;;){o=o.next;let e=!1;const r=o.prevOnCircle;if(v(o)>2){const n=o.nextOnCircle;At(o,t)?e=!0:o.next===n?o=n:n.next!==r&&(e=!0)}else if(m(o)&&!o.isIntersection)return void(n=o);if(e){r.next=o,o.prev=r,n=o;break}}}return n}(N(t.cpNode));if(n)return{cpNode:n,meta:{...t.meta,cpTrees:fp(n)}}}function Mv(t){if(!t)return void(window._debug_=void 0);let n=window._debug_;n={...n,elems:{...n?.elems},timing:{...n?.timing,holeClosers:0,oneAnd2Prongs:0,threeProngs:0,sats:0,simplifyMat:0},fs:{...n?.fs},directives:{...n?.directives,stopAfterHoleClosers:!1,stopAfterHoleClosersNum:void 0,stopAfterTwoProngs:!1,stopAfterTwoProngsNum:void 0,stopAfterThreeProngs:!1,stopAfterThreeProngsNum:void 0}},window._debug_=n}function Iv(t,n,e,r){const o=[];for(const r of t)o.push({type:0,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(Sv);const i=new Set,c=[];for(const t of o){const{item:n}=t;if(0===t.type){for(const t of i.values())r(n,t)&&c.push([n,t]);i.add(n)}else 1===t.type&&i.delete(t.item)}return c}function Sv(t,n){const e=t.x-n.x;return 0!==e?e:0===t.type?-1:1}const yv=1e-4;function Ov(t,n){const e=t.pointOnShape,r=n.pointOnShape;let{curve:o,p:i,t:c}=e,{curve:s,p:u,t:f}=r;if(i[0]===u[0]&&i[1]===u[1])return[i];1===c&&(c=0,o=o.next),0===f&&(f=1,s=s.prev);const{ps:l}=o,{ps:a}=s,p=[i,V(i)(Q($(l,c)))],h=[u,V(u)(Q($(a,f)))],d=L(p,h),v=X(i,u);let g;if(d){const t=X(i,d),n=X(u,d);g=q(t,v)<0||q(n,v)>0}else g=!0;if(!g)return[i,d,u];const m=X(p[0],p[1]),x=X(h[0],h[1]),b=Math.abs(j(v,m))/9,w=Math.abs(j(v,x))/9;return b>.01||w>.01||b>yv||w>yv?void 0:[i,u]}const Cv=D(function(t){return an(Pt(t))});function Nv(t,n){const e=function(t){const n=new Map;for(let e of t)for(let r of t){const t=e.pointOnShape.circle.center,o=r.pointOnShape.circle.center,i=e.pointOnShape.p,c=r.pointOnShape.p;r!==e&&t[0]===o[0]&&t[1]===o[1]&&i[0]===c[0]&&i[1]===c[1]&&n.set(e,r)}return n}(n),r=t.length,o=[];for(let n=0;n<r;n++){const i=t[n],c=[];for(let o=0;o<r;o++){const r=t[o];if(n===o){c.push(0);continue}let s=1/0;for(const t of g(i)){let n=Cv(t),o=t.next;for(;!At(o,r);)if(o.isHoleClosing)o=Ev(e,o);else{if(_n(o)){n=1/0;break}n+=Cv(o),o=o.next}n<s&&(s=n)}c.push(s)}o.push(c)}return o}function Ev(t,n){return t.get(n).next}function Tv(t){let{cpNode:n}=t,e=n;do{if(w(n)||n.next!==n.nextOnCircle){n=n.next;continue}const t=n.next,r=t.next,o=n.next.nextOnCircle;n.next=r,n.nextOnCircle=o,r.prev=n,o.prevOnCircle=n,e===t&&(e=n),n=n.next}while(n!==e);return t.cpNode=n,t}function Pv(t,n){return t.pointOnShape.curve.loop===n.pointOnShape.curve.loop}function kv(t){const n=[],e=[t],r=new Set(e);for(t.isHoleClosing&&r.add(t.prevOnCircle.holeCloserTwin),r.add(t);e.length>0;){const t=[],o=e.pop(),i=o.pointOnShape.curve.loop;let c=o;do{if(i===c.pointOnShape.curve.loop){t.push(c),c=c.next;continue}const n=c.holeCloserTwin;r.has(n)||(r.add(n),r.add(n.prevOnCircle.holeCloserTwin),e.push(n)),c=c.prev.holeCloserTwin}while(c!==o);n.push(t)}return n}function Av(t){let{cpNode:n}=t;for(;!w(n);)n=n.next;return Pv(n,n.next)||(n=n.holeCloserTwin),kv(n)}const{max:Bv,abs:zv,round:Fv,log2:Yv}=Math;function Dv(t,n=void 0){const e=function(t,n){return function(e){const r=e.next,o=e.pointOnShape,i=r.pointOnShape,{curve:c,circle:s,p:u}=o,{curve:f,p:l}=i;if(u[0]===l[0]&&u[1]===l[1])return;if(c.loop!==f.loop)return;const a=Dt(s.center,u);if(x(e),void 0!==n){const e=2**(t-n);if(zv(s.radius-a)>e)throw new Error(`Medial circle radius must be about the same (2**${Fv(Yv(e))}) as distance from medial circle center to point on shape, found: medial radius ${s.radius}, distance: ${a}`)}return function(t){const n=t.next,e=t.pointOnShape,r=n.pointOnShape,{p:o}=e,{p:i}=r,c=o,s=jv(t,Lv),u=i,f=jv(n,Xv),l=L(s,f),a=X(c,u);let p;if(l){const t=X(c,l),n=X(u,l);p=q(t,a)<0||q(n,a)>0}else p=!0;if(!p)return[c,l,u];const h=W(a),d=X(s[0],s[1]),v=X(f[0],f[1]),g=zv(j(a,d))/9,m=zv(j(a,v))/9;if(g>qv||m>qv)return[c,u];if(g>Wv||m>Wv){const t=H(c,u,1/3),n=H(c,u,2/3),e=V(h,t),r=[n,V(h,n)];return[c,L(s,[t,e]),L(f,r),u]}return[c,u]}(e)}}(Bv(...t.map(t=>t.meta.maxCoordPowerOf2)),n),r=function(t,n,e){if(!Number.isInteger(3))throw new Error("depth must be an integer >= 1");return function t(n,r){const o=r;if(1===n){const t=[];for(let n=0;n<o.length;n++){const r=e(o[n]);void 0===r||t.push(r)}return t}const i=[];for(let e=0;e<o.length;e++)i.push(t(n-1,o[e]));return i}(3,n)}(0,t.map(Tv).map(Av),e);return r}const Lv=0,Xv=1,qv=.01,Wv=1e-4;function jv(t,n){let{pointOnShape:e}=t,{curve:r,t:o,p:i}=e,{ps:c}=r;return n===Lv&&1===o&&(o=0,r=r.next,c=r.ps),n===Xv&&0===o&&(o=1,r=r.prev,c=r.ps),[i,V(i,$(c,o))]}function Hv(t,n){return{center:t.center,radius:n*t.radius}}export{bn as CpNodeFs,e as beziersToSvgPathStr,N as clone,xn as cpNodeComparator,uh as createInitialCpTree,Mv as enableDebugForMat,M as enhanceCpNode,Xd as find2Prong,vv as findAndAddHoleClosing2Prongs,wv as findMats,a as floydWarshall,g as getAllOnCircle,p as getAllOnLoop,kv as getAllOnLoop_ByLoop,gn as getAllVertices,T as getBoundaryBezierPartsToNext,pn as getBoundaryBeziersBetween,k as getBoundaryBeziersToNext,Up as getBoundaryPieceBeziers,Ft as getBranch,Yt as getBranchBeziers,cp as getBranches,z as getChildren,qp as getCloseBoundaryPointsCertified,Fp as getClosestSquareDistanceToRect,Ct as getEdgeDirection,kt as getFirstExit,Ud as getFor2ProngsOnLoop,Nv as getGraph,h as getHoleClosers,Ov as getImpliedBoundaryBezierBetween,vn as getInitialDegAngleBetweenMatCurves,Tt as getMatCurveBetween,Pt as getMatCurveToNext,dn as getMatCurvesBetween,Ad as getOsculatingCircle,fh as getPartialMeta,l as getPathsFromStr,Ap as getPotentialClosestPointsOnCurveCertified,v as getProngCount,x as getRealProngCount,hn as getSalience,mp as getSatCulls,gv as getShapeBounds,lh as getSharpCornersOnLoop,y as getVertexForwardChildren,w as isFullyTerminating,At as isOnSameCircle,Pv as isOnSameLoop,Bt as isOneProng,_ as isSharp,m as isTerminating,b as isTrivial,zt as isTwoProng,_n as isVertexSpecial,t as loopFromBeziers,Dv as reconstructFromMats,B as removeVertex,Hv as scaleCircle,ap as simplifyMat,Iv as sweepLine,xp as toScaleAxis,I as traverseCp,S as traverseEdges,O as traverseVertices,_v as trimMat};