@aussieljk/forkbook 0.0.0-stage → 0.0.1-2

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 (598) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +77 -2
  3. package/assets/addon-vitest/templates/vitest.config.4.template.ts +36 -0
  4. package/assets/browser/favicon-wrapper.svg +46 -0
  5. package/assets/browser/favicon.svg +1 -0
  6. package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
  7. package/assets/browser/nunito-sans-bold.woff2 +0 -0
  8. package/assets/browser/nunito-sans-italic.woff2 +0 -0
  9. package/assets/browser/nunito-sans-regular.woff2 +0 -0
  10. package/assets/builder-vite/iframe.html +99 -0
  11. package/assets/create/rendererAssets/.eslintrc.json +16 -0
  12. package/assets/create/rendererAssets/common/Configure.mdx +388 -0
  13. package/assets/create/rendererAssets/common/assets/accessibility.png +0 -0
  14. package/assets/create/rendererAssets/common/assets/accessibility.svg +1 -0
  15. package/assets/create/rendererAssets/common/assets/addon-library.png +0 -0
  16. package/assets/create/rendererAssets/common/assets/assets.png +0 -0
  17. package/assets/create/rendererAssets/common/assets/avif-test-image.avif +0 -0
  18. package/assets/create/rendererAssets/common/assets/context.png +0 -0
  19. package/assets/create/rendererAssets/common/assets/discord.svg +1 -0
  20. package/assets/create/rendererAssets/common/assets/docs.png +0 -0
  21. package/assets/create/rendererAssets/common/assets/figma-plugin.png +0 -0
  22. package/assets/create/rendererAssets/common/assets/github.svg +1 -0
  23. package/assets/create/rendererAssets/common/assets/share.png +0 -0
  24. package/assets/create/rendererAssets/common/assets/styling.png +0 -0
  25. package/assets/create/rendererAssets/common/assets/testing.png +0 -0
  26. package/assets/create/rendererAssets/common/assets/theming.png +0 -0
  27. package/assets/create/rendererAssets/common/assets/tutorials.svg +1 -0
  28. package/assets/create/rendererAssets/common/assets/youtube.svg +1 -0
  29. package/assets/create/rendererAssets/common/button.css +30 -0
  30. package/assets/create/rendererAssets/common/header.css +32 -0
  31. package/assets/create/rendererAssets/common/page.css +68 -0
  32. package/assets/create/templates/react-native/index.expo.js +20 -0
  33. package/assets/create/templates/react-native/index.js +25 -0
  34. package/assets/docs/addon-backgrounds.gif +0 -0
  35. package/assets/docs/addon-controls-args-annotated.png +0 -0
  36. package/assets/docs/addon-controls-args-background-color.png +0 -0
  37. package/assets/docs/addon-controls-args-background-string.png +0 -0
  38. package/assets/docs/addon-controls-args-docs.png +0 -0
  39. package/assets/docs/addon-controls-args-logging.png +0 -0
  40. package/assets/docs/addon-controls-args-no-annotation.png +0 -0
  41. package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
  42. package/assets/docs/addon-controls-args-reflow.png +0 -0
  43. package/assets/docs/addon-controls-args-template.png +0 -0
  44. package/assets/docs/addon-controls-expanded.png +0 -0
  45. package/assets/docs/addon-controls-hero.gif +0 -0
  46. package/assets/docs/addon-controls-install.png +0 -0
  47. package/assets/docs/hero.gif +0 -0
  48. package/assets/docs/highlight.png +0 -0
  49. package/assets/docs/message-reference.png +0 -0
  50. package/assets/docs/viewport.png +0 -0
  51. package/assets/react-native/metro-env.d.ts +69 -0
  52. package/assets/server/addon.tsconfig.json +6 -0
  53. package/assets/server/base-preview-body.html +116 -0
  54. package/assets/server/base-preview-head.html +494 -0
  55. package/assets/server/openBrowser.applescript +94 -0
  56. package/assets/server/template.ejs +87 -0
  57. package/dist/.build-stamp +0 -0
  58. package/dist/_browser-chunks/Color-PCLE2J36.js +1025 -0
  59. package/dist/_browser-chunks/DocsRenderer-JXND3PVQ.js +10 -0
  60. package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +1619 -0
  61. package/dist/_browser-chunks/chunk-2JDQ35OA.js +247 -0
  62. package/dist/_browser-chunks/chunk-2JT76G3E.js +104 -0
  63. package/dist/_browser-chunks/chunk-2MEPHP35.js +17 -0
  64. package/dist/_browser-chunks/chunk-2SCZVUKW.js +24 -0
  65. package/dist/_browser-chunks/chunk-46Z7NGAS.js +41 -0
  66. package/dist/_browser-chunks/chunk-4ATQOMJB.js +30 -0
  67. package/dist/_browser-chunks/chunk-52CW7FF7.js +49 -0
  68. package/dist/_browser-chunks/chunk-5I7E4GMO.js +62 -0
  69. package/dist/_browser-chunks/chunk-5P4QA6MY.js +20 -0
  70. package/dist/_browser-chunks/chunk-5WMXI5GW.js +816 -0
  71. package/dist/_browser-chunks/chunk-66OCZ54D.js +2604 -0
  72. package/dist/_browser-chunks/chunk-6SXYJQST.js +253 -0
  73. package/dist/_browser-chunks/chunk-AYRF6EJB.js +36 -0
  74. package/dist/_browser-chunks/chunk-B4AUNNU4.js +156 -0
  75. package/dist/_browser-chunks/chunk-BCP2FFXF.js +369 -0
  76. package/dist/_browser-chunks/chunk-C3D4HEFY.js +3396 -0
  77. package/dist/_browser-chunks/chunk-CFAOWGL7.js +43 -0
  78. package/dist/_browser-chunks/chunk-CFWWCCZV.js +223 -0
  79. package/dist/_browser-chunks/chunk-CNED6RYH.js +18 -0
  80. package/dist/_browser-chunks/chunk-DRQKCCAG.js +136 -0
  81. package/dist/_browser-chunks/chunk-ECQ75MKQ.js +0 -0
  82. package/dist/_browser-chunks/chunk-EIYAKDGP.js +302 -0
  83. package/dist/_browser-chunks/chunk-ENKK74N4.js +12 -0
  84. package/dist/_browser-chunks/chunk-FENFYI4X.js +698 -0
  85. package/dist/_browser-chunks/chunk-FJGWSWL5.js +155 -0
  86. package/dist/_browser-chunks/chunk-FVSEPWWX.js +2810 -0
  87. package/dist/_browser-chunks/chunk-GNZY6LOW.js +10116 -0
  88. package/dist/_browser-chunks/chunk-IE4ULIOQ.js +14 -0
  89. package/dist/_browser-chunks/chunk-IMSF75WX.js +42 -0
  90. package/dist/_browser-chunks/chunk-IWQGIXJS.js +14 -0
  91. package/dist/_browser-chunks/chunk-JMC7AIKT.js +108 -0
  92. package/dist/_browser-chunks/chunk-JPUOQJUI.js +8 -0
  93. package/dist/_browser-chunks/chunk-JSBKXXXF.js +218 -0
  94. package/dist/_browser-chunks/chunk-JWSKPMPC.js +73 -0
  95. package/dist/_browser-chunks/chunk-JYVGARBG.js +2943 -0
  96. package/dist/_browser-chunks/chunk-KBK7GKBN.js +35 -0
  97. package/dist/_browser-chunks/chunk-KQ7CRO2B.js +108 -0
  98. package/dist/_browser-chunks/chunk-LAWXTSXK.js +18 -0
  99. package/dist/_browser-chunks/chunk-LE2LTDW3.js +14 -0
  100. package/dist/_browser-chunks/chunk-LEVSOOLQ.js +48 -0
  101. package/dist/_browser-chunks/chunk-LV5PIKV4.js +93 -0
  102. package/dist/_browser-chunks/chunk-MDOL7KML.js +56 -0
  103. package/dist/_browser-chunks/chunk-MFMDGWP6.js +34 -0
  104. package/dist/_browser-chunks/chunk-MLBOOZL4.js +67 -0
  105. package/dist/_browser-chunks/chunk-NQUD4B7H.js +91 -0
  106. package/dist/_browser-chunks/chunk-NULBREPZ.js +43 -0
  107. package/dist/_browser-chunks/chunk-NZMVUW5T.js +7 -0
  108. package/dist/_browser-chunks/chunk-OD6IBQCC.js +117 -0
  109. package/dist/_browser-chunks/chunk-ODVJ3XZJ.js +157 -0
  110. package/dist/_browser-chunks/chunk-OQWFVDIN.js +386 -0
  111. package/dist/_browser-chunks/chunk-OVH3USFB.js +20 -0
  112. package/dist/_browser-chunks/chunk-OZZPSYQR.js +14 -0
  113. package/dist/_browser-chunks/chunk-P6PK47TQ.js +1970 -0
  114. package/dist/_browser-chunks/chunk-PFRNG3UC.js +22 -0
  115. package/dist/_browser-chunks/chunk-PJSMZ27A.js +13 -0
  116. package/dist/_browser-chunks/chunk-QC4HFS6K.js +41 -0
  117. package/dist/_browser-chunks/chunk-QDXFODK4.js +274 -0
  118. package/dist/_browser-chunks/chunk-RBCHTR7C.js +28 -0
  119. package/dist/_browser-chunks/chunk-RMYQ3QN3.js +294 -0
  120. package/dist/_browser-chunks/chunk-RNTIV5CE.js +411 -0
  121. package/dist/_browser-chunks/chunk-RSPAQWVJ.js +80 -0
  122. package/dist/_browser-chunks/chunk-S6TK43XQ.js +836 -0
  123. package/dist/_browser-chunks/chunk-SC67XZST.js +18 -0
  124. package/dist/_browser-chunks/chunk-SFVA4SBT.js +683 -0
  125. package/dist/_browser-chunks/chunk-SZYFOQMT.js +25 -0
  126. package/dist/_browser-chunks/chunk-TBJCJXK4.js +18 -0
  127. package/dist/_browser-chunks/chunk-UMDO3KB7.js +205 -0
  128. package/dist/_browser-chunks/chunk-V2G23FV7.js +11 -0
  129. package/dist/_browser-chunks/chunk-V5M7Q4HT.js +88 -0
  130. package/dist/_browser-chunks/chunk-W5M6NPS3.js +198 -0
  131. package/dist/_browser-chunks/chunk-W7NE2JXW.js +84 -0
  132. package/dist/_browser-chunks/chunk-WGVAAM43.js +1110 -0
  133. package/dist/_browser-chunks/chunk-WHQRNHXD.js +8 -0
  134. package/dist/_browser-chunks/chunk-WOSOWBCA.js +12 -0
  135. package/dist/_browser-chunks/chunk-WZ7KR7SH.js +85 -0
  136. package/dist/_browser-chunks/chunk-YEKO6BHJ.js +20 -0
  137. package/dist/_browser-chunks/chunk-YI2IBIQS.js +7 -0
  138. package/dist/_browser-chunks/chunk-YTIT5NA5.js +1966 -0
  139. package/dist/_browser-chunks/chunk-ZEHRUHTA.js +6 -0
  140. package/dist/_browser-chunks/chunk-ZTQ5MEJ5.js +203 -0
  141. package/dist/_browser-chunks/matchers-YLBYSYAF.js +1263 -0
  142. package/dist/_browser-chunks/react-dom-client-4OHE3QDV.js +9 -0
  143. package/dist/_node-chunks/attached-runtime-I2G4WLJI.js +282 -0
  144. package/dist/_node-chunks/builder-manager-VVHYQXCH.js +1661 -0
  145. package/dist/_node-chunks/chunk-2BUPBPFB.js +82 -0
  146. package/dist/_node-chunks/chunk-2DSIDINN.js +884 -0
  147. package/dist/_node-chunks/chunk-2RU7BKEW.js +23 -0
  148. package/dist/_node-chunks/chunk-34EO2PUT.js +26 -0
  149. package/dist/_node-chunks/chunk-3BKIBF5S.js +3008 -0
  150. package/dist/_node-chunks/chunk-3SDUYDXH.js +98 -0
  151. package/dist/_node-chunks/chunk-3T4ZSNPH.js +662 -0
  152. package/dist/_node-chunks/chunk-3W7F2B7P.js +79 -0
  153. package/dist/_node-chunks/chunk-3Y6AAY5H.js +80 -0
  154. package/dist/_node-chunks/chunk-42UWAGPW.js +1193 -0
  155. package/dist/_node-chunks/chunk-4FEANXWU.js +1986 -0
  156. package/dist/_node-chunks/chunk-5DQFEZEA.js +40 -0
  157. package/dist/_node-chunks/chunk-6KEHV53S.js +1218 -0
  158. package/dist/_node-chunks/chunk-6LMWA44H.js +3837 -0
  159. package/dist/_node-chunks/chunk-6YKBRP72.js +20 -0
  160. package/dist/_node-chunks/chunk-7GUDZVRQ.js +110 -0
  161. package/dist/_node-chunks/chunk-B5J7Q7J4.js +21 -0
  162. package/dist/_node-chunks/chunk-BS2WMZMR.js +90 -0
  163. package/dist/_node-chunks/chunk-BSKFCWQD.js +47 -0
  164. package/dist/_node-chunks/chunk-BXVYT7SB.js +36 -0
  165. package/dist/_node-chunks/chunk-CCOTJ4FC.js +688 -0
  166. package/dist/_node-chunks/chunk-CQKMLL5J.js +33 -0
  167. package/dist/_node-chunks/chunk-CXRU72ET.js +63 -0
  168. package/dist/_node-chunks/chunk-DC7DKR5K.js +20 -0
  169. package/dist/_node-chunks/chunk-DHJFTB4K.js +25 -0
  170. package/dist/_node-chunks/chunk-DUR55DJJ.js +1094 -0
  171. package/dist/_node-chunks/chunk-E6YESGLX.js +7032 -0
  172. package/dist/_node-chunks/chunk-EHUNOMDD.js +52345 -0
  173. package/dist/_node-chunks/chunk-ET7PWEO7.js +298 -0
  174. package/dist/_node-chunks/chunk-EWOX7HPJ.js +20 -0
  175. package/dist/_node-chunks/chunk-F3ZFKBHY.js +844 -0
  176. package/dist/_node-chunks/chunk-FK7KGTV7.js +26 -0
  177. package/dist/_node-chunks/chunk-FPZB5OI7.js +35 -0
  178. package/dist/_node-chunks/chunk-FW2HQUBQ.js +25 -0
  179. package/dist/_node-chunks/chunk-FY6UXW6G.js +11 -0
  180. package/dist/_node-chunks/chunk-GEFQN7K3.js +499 -0
  181. package/dist/_node-chunks/chunk-GRBLDJCR.js +989 -0
  182. package/dist/_node-chunks/chunk-H32DYT6P.js +87 -0
  183. package/dist/_node-chunks/chunk-H4PPVMP5.js +23 -0
  184. package/dist/_node-chunks/chunk-HMP2G23X.js +25 -0
  185. package/dist/_node-chunks/chunk-ICPBH3E7.js +59 -0
  186. package/dist/_node-chunks/chunk-IDEL2J23.js +23 -0
  187. package/dist/_node-chunks/chunk-IK4FGZLR.js +223 -0
  188. package/dist/_node-chunks/chunk-JDXXX6LB.js +68 -0
  189. package/dist/_node-chunks/chunk-JGGFYIG5.js +5468 -0
  190. package/dist/_node-chunks/chunk-JPAZLYJ3.js +29 -0
  191. package/dist/_node-chunks/chunk-JZOO7GGC.js +48 -0
  192. package/dist/_node-chunks/chunk-KISMCCP5.js +4744 -0
  193. package/dist/_node-chunks/chunk-LCK4ZQKG.js +115 -0
  194. package/dist/_node-chunks/chunk-LO56I6E2.js +132 -0
  195. package/dist/_node-chunks/chunk-LXBD4UL4.js +104 -0
  196. package/dist/_node-chunks/chunk-MA24JW6C.js +7162 -0
  197. package/dist/_node-chunks/chunk-MK2KYAI6.js +5414 -0
  198. package/dist/_node-chunks/chunk-NDWKJ4CL.js +2102 -0
  199. package/dist/_node-chunks/chunk-NIBT7XDZ.js +168 -0
  200. package/dist/_node-chunks/chunk-NPO45IMH.js +33 -0
  201. package/dist/_node-chunks/chunk-OISX4AGQ.js +414 -0
  202. package/dist/_node-chunks/chunk-OUW6R7C3.js +26 -0
  203. package/dist/_node-chunks/chunk-OWNFOGTA.js +194 -0
  204. package/dist/_node-chunks/chunk-Q7QNUM5H.js +49 -0
  205. package/dist/_node-chunks/chunk-QEQLR22M.js +1877 -0
  206. package/dist/_node-chunks/chunk-RRN2V55B.js +45 -0
  207. package/dist/_node-chunks/chunk-RWFIFGO5.js +144 -0
  208. package/dist/_node-chunks/chunk-RXNJDRGO.js +209 -0
  209. package/dist/_node-chunks/chunk-RZMQ7S3L.js +92 -0
  210. package/dist/_node-chunks/chunk-SIEXZVCR.js +51 -0
  211. package/dist/_node-chunks/chunk-SLWQNBGO.js +2034 -0
  212. package/dist/_node-chunks/chunk-SVTBJ7Q3.js +35 -0
  213. package/dist/_node-chunks/chunk-SWO5CDYU.js +32 -0
  214. package/dist/_node-chunks/chunk-TD5PLLQG.js +121 -0
  215. package/dist/_node-chunks/chunk-TEQGGSP7.js +33 -0
  216. package/dist/_node-chunks/chunk-TFCEV2XX.js +155 -0
  217. package/dist/_node-chunks/chunk-TFEWM4E3.js +1073 -0
  218. package/dist/_node-chunks/chunk-TINO74G5.js +21 -0
  219. package/dist/_node-chunks/chunk-TNJIXE37.js +40 -0
  220. package/dist/_node-chunks/chunk-TWI4GVH7.js +19 -0
  221. package/dist/_node-chunks/chunk-U5W53R2J.js +1011 -0
  222. package/dist/_node-chunks/chunk-UBOGWBEA.js +148 -0
  223. package/dist/_node-chunks/chunk-UMUBKI6E.js +3787 -0
  224. package/dist/_node-chunks/chunk-UVINFLGY.js +56 -0
  225. package/dist/_node-chunks/chunk-V2DY426G.js +1133 -0
  226. package/dist/_node-chunks/chunk-VLOXOXXE.js +45 -0
  227. package/dist/_node-chunks/chunk-W4OMYLSP.js +1297 -0
  228. package/dist/_node-chunks/chunk-WAXVSN3O.js +18 -0
  229. package/dist/_node-chunks/chunk-WCULS5TP.js +3767 -0
  230. package/dist/_node-chunks/chunk-WNZ2UMFM.js +153 -0
  231. package/dist/_node-chunks/chunk-WZJF2OUH.js +74 -0
  232. package/dist/_node-chunks/chunk-XGIUVY52.js +611 -0
  233. package/dist/_node-chunks/chunk-XHL2LVBM.js +415 -0
  234. package/dist/_node-chunks/chunk-XI6B6P47.js +59 -0
  235. package/dist/_node-chunks/chunk-XLP2ZKXV.js +60 -0
  236. package/dist/_node-chunks/chunk-YCMRA6RX.js +95 -0
  237. package/dist/_node-chunks/chunk-YZFWBA5L.js +2700 -0
  238. package/dist/_node-chunks/chunk-ZMAMXQKP.js +4731 -0
  239. package/dist/_node-chunks/chunk-ZWBCQ4MJ.js +110 -0
  240. package/dist/_node-chunks/dist-VTSTZKUB.js +16 -0
  241. package/dist/_node-chunks/globby-OEMHPBFY.js +2884 -0
  242. package/dist/_node-chunks/jiti-NFX6UU74.js +3848 -0
  243. package/dist/_node-chunks/lib-MDVARD7W.js +366 -0
  244. package/dist/_node-chunks/local-runtime-NTKIN2QT.js +78 -0
  245. package/dist/_node-chunks/mdx-plugin-MWISDWDQ.js +5680 -0
  246. package/dist/_node-chunks/monorepo-LIRFMQXE.js +121 -0
  247. package/dist/_node-chunks/monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js +121 -0
  248. package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +22 -0
  249. package/dist/_node-chunks/pattern-copy-play-EKHIUAU2.js +807 -0
  250. package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +20 -0
  251. package/dist/_node-chunks/rehype-external-links-BUN3HUCO.js +121 -0
  252. package/dist/_node-chunks/rehype-slug-PLADX223.js +52 -0
  253. package/dist/_node-chunks/relaxed-limits-GBHW6KIQ.js +117 -0
  254. package/dist/_node-chunks/run-KDTIZNSY.js +103 -0
  255. package/dist/_node-chunks/run-NL66VTNR.js +4532 -0
  256. package/dist/_node-chunks/session-id-KIIVOQLR.js +23 -0
  257. package/dist/_node-chunks/setup-MGC7BQO6.js +278 -0
  258. package/dist/_node-chunks/vitest.config.4.template-JH2THZFG.js +54 -0
  259. package/dist/actions/decorator.d.ts +7 -0
  260. package/dist/actions/decorator.js +43 -0
  261. package/dist/actions/index.d.ts +67 -0
  262. package/dist/actions/index.js +28 -0
  263. package/dist/addon-a11y/index.d.ts +52 -0
  264. package/dist/addon-a11y/index.js +16 -0
  265. package/dist/addon-a11y/manager.js +1429 -0
  266. package/dist/addon-a11y/preset.js +18 -0
  267. package/dist/addon-a11y/preview.d.ts +17 -0
  268. package/dist/addon-a11y/preview.js +15 -0
  269. package/dist/addon-docs/blocks.d.ts +1061 -0
  270. package/dist/addon-docs/blocks.js +2461 -0
  271. package/dist/addon-docs/index.d.ts +236 -0
  272. package/dist/addon-docs/index.js +16 -0
  273. package/dist/addon-docs/manager.js +90 -0
  274. package/dist/addon-docs/mdx-react-shim.d.ts +1 -0
  275. package/dist/addon-docs/mdx-react-shim.js +2 -0
  276. package/dist/addon-docs/preset.js +378 -0
  277. package/dist/addon-docs/preview.d.ts +4 -0
  278. package/dist/addon-docs/preview.js +7 -0
  279. package/dist/addon-links/index.d.ts +22 -0
  280. package/dist/addon-links/index.js +20 -0
  281. package/dist/addon-links/manager.js +14 -0
  282. package/dist/addon-links/preview.d.ts +6 -0
  283. package/dist/addon-links/preview.js +9 -0
  284. package/dist/addon-links/react/index.d.ts +25 -0
  285. package/dist/addon-links/react/index.js +52 -0
  286. package/dist/addon-mcp/preset.js +1345 -0
  287. package/dist/addon-mcp/preview.js +29 -0
  288. package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +1153 -0
  289. package/dist/addon-ondevice-actions/index.d.ts +4 -0
  290. package/dist/addon-ondevice-actions/index.js +7 -0
  291. package/dist/addon-ondevice-actions/register.js +7 -0
  292. package/dist/addon-ondevice-controls/index.d.ts +6 -0
  293. package/dist/addon-ondevice-controls/index.js +14 -0
  294. package/dist/addon-ondevice-controls/register.js +10 -0
  295. package/dist/addon-pseudo-states/index.d.ts +35 -0
  296. package/dist/addon-pseudo-states/index.js +15 -0
  297. package/dist/addon-pseudo-states/manager.js +53 -0
  298. package/dist/addon-pseudo-states/preview.d.ts +9 -0
  299. package/dist/addon-pseudo-states/preview.js +10 -0
  300. package/dist/addon-themes/index.d.ts +80 -0
  301. package/dist/addon-themes/index.js +104 -0
  302. package/dist/addon-themes/manager.js +97 -0
  303. package/dist/addon-themes/postinstall.js +33 -0
  304. package/dist/addon-themes/preview.d.ts +6 -0
  305. package/dist/addon-themes/preview.js +8 -0
  306. package/dist/addon-vitest/constants.d.ts +132 -0
  307. package/dist/addon-vitest/constants.js +66 -0
  308. package/dist/addon-vitest/index.d.ts +4 -0
  309. package/dist/addon-vitest/index.js +8 -0
  310. package/dist/addon-vitest/manager.js +665 -0
  311. package/dist/addon-vitest/node/coverage-reporter.js +1284 -0
  312. package/dist/addon-vitest/node/vitest.js +674 -0
  313. package/dist/addon-vitest/postinstall.js +24 -0
  314. package/dist/addon-vitest/preset.js +943 -0
  315. package/dist/addon-vitest/vitest-plugin/global-setup.js +162 -0
  316. package/dist/addon-vitest/vitest-plugin/index.d.ts +56 -0
  317. package/dist/addon-vitest/vitest-plugin/index.js +463 -0
  318. package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +9 -0
  319. package/dist/addon-vitest/vitest-plugin/setup-file.browser.4.js +20 -0
  320. package/dist/addon-vitest/vitest-plugin/setup-file.js +50 -0
  321. package/dist/addon-vitest/vitest-plugin/test-utils.js +128 -0
  322. package/dist/babel/index.d.ts +2301 -0
  323. package/dist/babel/index.js +61 -0
  324. package/dist/backgrounds/index.d.ts +6 -0
  325. package/dist/backgrounds/index.js +15 -0
  326. package/dist/bin/core.js +1705 -0
  327. package/dist/bin/dispatcher.js +43 -0
  328. package/dist/bin/loader.js +115 -0
  329. package/dist/builder-vite/index.d.ts +50 -0
  330. package/dist/builder-vite/index.js +245 -0
  331. package/dist/builder-vite/preset.js +27 -0
  332. package/dist/channels/index.d.ts +2 -0
  333. package/dist/channels/index.js +352 -0
  334. package/dist/chunk-B2t1tGRh.d.ts +284 -0
  335. package/dist/chunk-BCoJQE-f.d.ts +602 -0
  336. package/dist/chunk-BGkgZp-H.d.ts +214 -0
  337. package/dist/chunk-BTVrWliM.d.ts +115 -0
  338. package/dist/chunk-BXLImeLy.d.ts +197 -0
  339. package/dist/chunk-BfBzpgct.d.ts +916 -0
  340. package/dist/chunk-Bpi2tz-6.d.ts +511 -0
  341. package/dist/chunk-BxWufQms.d.ts +142 -0
  342. package/dist/chunk-C-bavsOH.d.ts +34 -0
  343. package/dist/chunk-C2p5r3Vt.d.ts +13001 -0
  344. package/dist/chunk-C6PAgHLT.d.ts +12 -0
  345. package/dist/chunk-CMeX4WRe.d.ts +179 -0
  346. package/dist/chunk-Ct9xd6IM.d.ts +65 -0
  347. package/dist/chunk-CwQKNaYL.d.ts +15 -0
  348. package/dist/chunk-D7DwV41f.d.ts +3622 -0
  349. package/dist/chunk-DEVFdzxR.d.ts +253 -0
  350. package/dist/chunk-DaVb55-_.d.ts +124 -0
  351. package/dist/chunk-DgRNfmj_.d.ts +40 -0
  352. package/dist/chunk-DoIGKY33.d.ts +666 -0
  353. package/dist/chunk-Dr3R0DXk.d.ts +40 -0
  354. package/dist/chunk-DtHByo32.d.ts +55 -0
  355. package/dist/chunk-Dw1z1Pki.d.ts +933 -0
  356. package/dist/chunk-DzuY9DXg.d.ts +79 -0
  357. package/dist/chunk-FjDVzZTj.d.ts +62 -0
  358. package/dist/chunk-Kt1tW-D1.d.ts +59 -0
  359. package/dist/chunk-XP8oHzpE.d.ts +6 -0
  360. package/dist/chunk-gCX81nOr.d.ts +61 -0
  361. package/dist/chunk-pcFXCimE.d.ts +741 -0
  362. package/dist/cli/index.d.ts +1174 -0
  363. package/dist/cli/index.js +5613 -0
  364. package/dist/cli/skills/content/index.d.ts +72 -0
  365. package/dist/cli/skills/content/index.js +335 -0
  366. package/dist/cli/tools/sdk/child-host.d.ts +61 -0
  367. package/dist/cli/tools/sdk/child-host.js +131 -0
  368. package/dist/cli/tools/sdk/index.d.ts +137 -0
  369. package/dist/cli/tools/sdk/index.js +44 -0
  370. package/dist/cli-commands/bin/index.js +25 -0
  371. package/dist/client-logger/index.d.ts +31 -0
  372. package/dist/client-logger/index.js +63 -0
  373. package/dist/common/index.d.ts +1103 -0
  374. package/dist/common/index.js +364 -0
  375. package/dist/components/index.d.ts +1924 -0
  376. package/dist/components/index.js +13759 -0
  377. package/dist/core-events/index.d.ts +155 -0
  378. package/dist/core-events/index.js +136 -0
  379. package/dist/core-server/index.d.ts +2200 -0
  380. package/dist/core-server/index.js +4165 -0
  381. package/dist/core-server/presets/common-manager.css +170 -0
  382. package/dist/core-server/presets/common-manager.js +4168 -0
  383. package/dist/core-server/presets/common-override-preset.js +81 -0
  384. package/dist/core-server/presets/common-preset.js +2187 -0
  385. package/dist/create/bin/index.js +23 -0
  386. package/dist/create/index.js +25 -0
  387. package/dist/csf/csf-utils.d.ts +2 -0
  388. package/dist/csf/csf-utils.js +19 -0
  389. package/dist/csf/index.d.ts +7 -0
  390. package/dist/csf/index.js +2142 -0
  391. package/dist/csf-tools/index.d.ts +1157 -0
  392. package/dist/csf-tools/index.js +736 -0
  393. package/dist/docs-tools/index.d.ts +197 -0
  394. package/dist/docs-tools/index.js +61 -0
  395. package/dist/highlight/index.d.ts +10 -0
  396. package/dist/highlight/index.js +15 -0
  397. package/dist/instrumenter/index.d.ts +113 -0
  398. package/dist/instrumenter/index.js +2595 -0
  399. package/dist/manager/_manager-chunks/globals-runtime-8HkdnU2F.js +6144 -0
  400. package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +3389 -0
  401. package/dist/manager/_manager-chunks/globals-runtime-BdGkqNEt.js +45 -0
  402. package/dist/manager/_manager-chunks/globals-runtime-BmphMP6z.js +1190 -0
  403. package/dist/manager/_manager-chunks/globals-runtime-BvM-NY2g.js +13307 -0
  404. package/dist/manager/_manager-chunks/globals-runtime-C02fvgcd.js +9243 -0
  405. package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +9766 -0
  406. package/dist/manager/_manager-chunks/globals-runtime-DpNYC-qi.js +5564 -0
  407. package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +5357 -0
  408. package/dist/manager/_manager-chunks/globals-runtime-DwFqpqya.js +722 -0
  409. package/dist/manager/_manager-chunks/globals-runtime-FC201B7s.js +6837 -0
  410. package/dist/manager/_manager-chunks/globals-runtime-Rp_zjGnh.js +121 -0
  411. package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +10463 -0
  412. package/dist/manager/_manager-chunks/globals-runtime-eLPTIfX-.js +7759 -0
  413. package/dist/manager/_manager-chunks/globals-runtime-qKvCZHFY.js +4468 -0
  414. package/dist/manager/_manager-chunks/globals-runtime-sGpNlIJ1.js +5102 -0
  415. package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +452 -0
  416. package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +22 -0
  417. package/dist/manager/_manager-chunks/runtime-BhkT2CXl.js +1408 -0
  418. package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +998 -0
  419. package/dist/manager/_manager-chunks/runtime-D0UOWx0U.js +979 -0
  420. package/dist/manager/_manager-chunks/runtime-D94Vq3oR.js +4014 -0
  421. package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +77 -0
  422. package/dist/manager/_manager-chunks/runtime-EITvVbkG.js +46 -0
  423. package/dist/manager/_manager-chunks/runtime-cp5pazY2.js +8936 -0
  424. package/dist/manager/_manager-chunks/runtime-eDVAYF7N.js +6860 -0
  425. package/dist/manager/_manager-chunks/runtime-i-PDAHLR.js +2493 -0
  426. package/dist/manager/globals-runtime.js +2 -0
  427. package/dist/manager/globals.d.ts +23 -0
  428. package/dist/manager/globals.js +26 -0
  429. package/dist/manager/manager-stores.d.ts +2 -0
  430. package/dist/manager/manager-stores.js +19 -0
  431. package/dist/manager/runtime.js +2 -0
  432. package/dist/manager-api/index.d.ts +2 -0
  433. package/dist/manager-api/index.js +3257 -0
  434. package/dist/manager-errors.d.ts +89 -0
  435. package/dist/manager-errors.js +20 -0
  436. package/dist/mcp/index.d.ts +270 -0
  437. package/dist/mcp/index.js +305 -0
  438. package/dist/mocking-utils/index.d.ts +689 -0
  439. package/dist/mocking-utils/index.js +521 -0
  440. package/dist/mocking-utils/mocker-runtime.js +1254 -0
  441. package/dist/nextjs-vite/config/preview.js +3 -0
  442. package/dist/nextjs-vite/export-mocks/cache/index.d.ts +25 -0
  443. package/dist/nextjs-vite/export-mocks/cache/index.js +29 -0
  444. package/dist/nextjs-vite/export-mocks/headers/index.d.ts +37 -0
  445. package/dist/nextjs-vite/export-mocks/headers/index.js +54 -0
  446. package/dist/nextjs-vite/export-mocks/link/index.d.ts +9 -0
  447. package/dist/nextjs-vite/export-mocks/link/index.js +59 -0
  448. package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +28 -0
  449. package/dist/nextjs-vite/export-mocks/navigation/index.js +58 -0
  450. package/dist/nextjs-vite/export-mocks/router/index.d.ts +34 -0
  451. package/dist/nextjs-vite/export-mocks/router/index.js +63 -0
  452. package/dist/nextjs-vite/index.d.ts +92 -0
  453. package/dist/nextjs-vite/index.js +58 -0
  454. package/dist/nextjs-vite/node/index.d.ts +6 -0
  455. package/dist/nextjs-vite/node/index.js +20 -0
  456. package/dist/nextjs-vite/preset.js +648 -0
  457. package/dist/nextjs-vite/preview.d.ts +20 -0
  458. package/dist/nextjs-vite/preview.js +11 -0
  459. package/dist/nextjs-vite/vite-plugin/index.d.ts +6 -0
  460. package/dist/nextjs-vite/vite-plugin/index.js +19 -0
  461. package/dist/nextjs-vite-plugin/index.d.ts +28 -0
  462. package/dist/nextjs-vite-plugin/index.js +923 -0
  463. package/dist/nextjs-vite-plugin/mocks/storybook.global.js +29 -0
  464. package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-context.js +8 -0
  465. package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-default-loader.js +23 -0
  466. package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +28 -0
  467. package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +17 -0
  468. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/cache/index.js +29 -0
  469. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/dynamic/index.js +40 -0
  470. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/headers/index.js +55 -0
  471. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/link/index.js +63 -0
  472. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/navigation/index.js +71 -0
  473. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +74 -0
  474. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/rsc/server-only.js +7 -0
  475. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/safe-stable-stringify/index.js +13 -0
  476. package/dist/nextjs-vite-plugin/plugins/next-mocks/compatibility/draft-mode.compat.js +7 -0
  477. package/dist/node-logger/index.d.ts +495 -0
  478. package/dist/node-logger/index.js +42 -0
  479. package/dist/oxc-parser/index.d.ts +99 -0
  480. package/dist/oxc-parser/index.js +275 -0
  481. package/dist/oxc-parser/worker.js +37 -0
  482. package/dist/preview/_chunks/runtime-BIzIdDbb.js +10263 -0
  483. package/dist/preview/_chunks/runtime-BTPtVY1p.js +1102 -0
  484. package/dist/preview/_chunks/runtime-BZSnICCg.js +8484 -0
  485. package/dist/preview/_chunks/runtime-BdGkqNEt.js +45 -0
  486. package/dist/preview/_chunks/runtime-BwSxqk3t.js +63 -0
  487. package/dist/preview/_chunks/runtime-CqHxptiK.js +6143 -0
  488. package/dist/preview/_chunks/runtime-CsV4HZPV.js +5064 -0
  489. package/dist/preview/_chunks/runtime-CxZK_Ln3.js +284 -0
  490. package/dist/preview/_chunks/runtime-DZToXfvO.js +9767 -0
  491. package/dist/preview/_chunks/runtime-DrTjJkPY.js +3872 -0
  492. package/dist/preview/_chunks/runtime-DuHdxMFA.js +387 -0
  493. package/dist/preview/_chunks/runtime-iXdo8CR8.js +3635 -0
  494. package/dist/preview/_chunks/runtime-q3wt0e_N.js +6838 -0
  495. package/dist/preview/globals.d.ts +16 -0
  496. package/dist/preview/globals.js +20 -0
  497. package/dist/preview/runtime.js +6 -0
  498. package/dist/preview-api/index.d.ts +4 -0
  499. package/dist/preview-api/index.js +147 -0
  500. package/dist/preview-errors.d.ts +186 -0
  501. package/dist/preview-errors.js +56 -0
  502. package/dist/react/docgen/docgen-worker.js +38 -0
  503. package/dist/react/entry-preview-argtypes.js +9 -0
  504. package/dist/react/entry-preview-docs.js +12 -0
  505. package/dist/react/entry-preview-rsc.js +11 -0
  506. package/dist/react/entry-preview.js +21 -0
  507. package/dist/react/index.d.ts +119 -0
  508. package/dist/react/index.js +26 -0
  509. package/dist/react/preset.js +301 -0
  510. package/dist/react/preview.d.ts +2 -0
  511. package/dist/react/preview.js +11 -0
  512. package/dist/react-native/bin/get-stories.js +34 -0
  513. package/dist/react-native/index.d.ts +160 -0
  514. package/dist/react-native/index.js +1547 -0
  515. package/dist/react-native/metro/node.d.ts +83 -0
  516. package/dist/react-native/metro/node.js +21 -0
  517. package/dist/react-native/metro/withStorybook.d.ts +2269 -0
  518. package/dist/react-native/metro/withStorybook.js +138 -0
  519. package/dist/react-native/preview.d.ts +6 -0
  520. package/dist/react-native/preview.js +20 -0
  521. package/dist/react-native/scripts/generate.d.ts +22 -0
  522. package/dist/react-native/scripts/generate.js +18 -0
  523. package/dist/react-native/stub.js +20 -0
  524. package/dist/react-native-theming/index.d.ts +175 -0
  525. package/dist/react-native-theming/index.js +2591 -0
  526. package/dist/react-native-ui/index.d.ts +130 -0
  527. package/dist/react-native-ui/index.js +1448 -0
  528. package/dist/react-native-ui-common/index.d.ts +230 -0
  529. package/dist/react-native-ui-common/index.js +514 -0
  530. package/dist/react-vite/index.d.ts +4 -0
  531. package/dist/react-vite/index.js +8 -0
  532. package/dist/react-vite/node/index.d.ts +6 -0
  533. package/dist/react-vite/node/index.js +20 -0
  534. package/dist/react-vite/preset.d.ts +6 -0
  535. package/dist/react-vite/preset.js +21 -0
  536. package/dist/router/index.d.ts +141 -0
  537. package/dist/router/index.js +1217 -0
  538. package/dist/server-errors.d.ts +2 -0
  539. package/dist/server-errors.js +149 -0
  540. package/dist/shared/open-service/index.d.ts +3 -0
  541. package/dist/shared/open-service/index.js +115 -0
  542. package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +75 -0
  543. package/dist/shared/open-service/toolsets/docs/public.d.ts +1296 -0
  544. package/dist/shared/open-service/toolsets/docs/public.js +991 -0
  545. package/dist/telemetry/index.d.ts +314 -0
  546. package/dist/telemetry/index.js +103 -0
  547. package/dist/test/index.d.ts +158 -0
  548. package/dist/test/index.js +19421 -0
  549. package/dist/theming/create.d.ts +15 -0
  550. package/dist/theming/create.js +11 -0
  551. package/dist/theming/index.d.ts +54 -0
  552. package/dist/theming/index.js +511 -0
  553. package/dist/types/index.d.ts +2 -0
  554. package/dist/types/index.js +48 -0
  555. package/dist/viewport/index.d.ts +275 -0
  556. package/dist/viewport/index.js +21 -0
  557. package/package.json +1054 -4
  558. package/template/nextjs-vite/cli/.eslintrc.json +6 -0
  559. package/template/nextjs-vite/cli/js/Button.jsx +42 -0
  560. package/template/nextjs-vite/cli/js/Button.stories.js +49 -0
  561. package/template/nextjs-vite/cli/js/Configure.mdx +470 -0
  562. package/template/nextjs-vite/cli/js/Header.jsx +58 -0
  563. package/template/nextjs-vite/cli/js/Header.stories.js +30 -0
  564. package/template/nextjs-vite/cli/js/Page.jsx +68 -0
  565. package/template/nextjs-vite/cli/js/Page.stories.js +28 -0
  566. package/template/nextjs-vite/cli/ts/Button.stories.ts +54 -0
  567. package/template/nextjs-vite/cli/ts/Button.tsx +39 -0
  568. package/template/nextjs-vite/cli/ts/Configure.mdx +446 -0
  569. package/template/nextjs-vite/cli/ts/Header.stories.ts +34 -0
  570. package/template/nextjs-vite/cli/ts/Header.tsx +54 -0
  571. package/template/nextjs-vite/cli/ts/Page.stories.ts +33 -0
  572. package/template/nextjs-vite/cli/ts/Page.tsx +73 -0
  573. package/template/react/cli/.eslintrc.json +5 -0
  574. package/template/react/cli/js/Button.jsx +39 -0
  575. package/template/react/cli/js/Button.stories.js +49 -0
  576. package/template/react/cli/js/Header.jsx +56 -0
  577. package/template/react/cli/js/Header.stories.js +29 -0
  578. package/template/react/cli/js/Page.jsx +69 -0
  579. package/template/react/cli/js/Page.stories.js +28 -0
  580. package/template/react/cli/ts/Button.stories.ts +54 -0
  581. package/template/react/cli/ts/Button.tsx +37 -0
  582. package/template/react/cli/ts/Header.stories.ts +34 -0
  583. package/template/react/cli/ts/Header.tsx +56 -0
  584. package/template/react/cli/ts/Page.stories.ts +33 -0
  585. package/template/react/cli/ts/Page.tsx +73 -0
  586. package/template/react-vite/cli/.eslintrc.json +5 -0
  587. package/template/react-vite/cli/js/Button.jsx +39 -0
  588. package/template/react-vite/cli/js/Button.stories.js +49 -0
  589. package/template/react-vite/cli/js/Header.jsx +56 -0
  590. package/template/react-vite/cli/js/Header.stories.js +29 -0
  591. package/template/react-vite/cli/js/Page.jsx +69 -0
  592. package/template/react-vite/cli/js/Page.stories.js +28 -0
  593. package/template/react-vite/cli/ts/Button.stories.ts +54 -0
  594. package/template/react-vite/cli/ts/Button.tsx +37 -0
  595. package/template/react-vite/cli/ts/Header.stories.ts +34 -0
  596. package/template/react-vite/cli/ts/Header.tsx +56 -0
  597. package/template/react-vite/cli/ts/Page.stories.ts +33 -0
  598. package/template/react-vite/cli/ts/Page.tsx +73 -0
@@ -0,0 +1,2595 @@
1
+ import {
2
+ CallStates,
3
+ EVENTS
4
+ } from "../_browser-chunks/chunk-TBJCJXK4.js";
5
+ import {
6
+ inspect
7
+ } from "../_browser-chunks/chunk-BCP2FFXF.js";
8
+ import "../_browser-chunks/chunk-IMSF75WX.js";
9
+
10
+ // src/instrumenter/instrumenter.ts
11
+ import { once } from "@aussieljk/forkbook/internal/client-logger";
12
+ import {
13
+ FORCE_REMOUNT,
14
+ SET_CURRENT_STORY,
15
+ STORY_RENDER_PHASE_CHANGED
16
+ } from "@aussieljk/forkbook/internal/core-events";
17
+ import { global } from "@storybook/global";
18
+
19
+ // ../../node_modules/@vitest/pretty-format/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js
20
+ var f = {
21
+ reset: [0, 0],
22
+ bold: [1, 22, "\x1B[22m\x1B[1m"],
23
+ dim: [2, 22, "\x1B[22m\x1B[2m"],
24
+ italic: [3, 23],
25
+ underline: [4, 24],
26
+ inverse: [7, 27],
27
+ hidden: [8, 28],
28
+ strikethrough: [9, 29],
29
+ black: [30, 39],
30
+ red: [31, 39],
31
+ green: [32, 39],
32
+ yellow: [33, 39],
33
+ blue: [34, 39],
34
+ magenta: [35, 39],
35
+ cyan: [36, 39],
36
+ white: [37, 39],
37
+ gray: [90, 39],
38
+ bgBlack: [40, 49],
39
+ bgRed: [41, 49],
40
+ bgGreen: [42, 49],
41
+ bgYellow: [43, 49],
42
+ bgBlue: [44, 49],
43
+ bgMagenta: [45, 49],
44
+ bgCyan: [46, 49],
45
+ bgWhite: [47, 49],
46
+ blackBright: [90, 39],
47
+ redBright: [91, 39],
48
+ greenBright: [92, 39],
49
+ yellowBright: [93, 39],
50
+ blueBright: [94, 39],
51
+ magentaBright: [95, 39],
52
+ cyanBright: [96, 39],
53
+ whiteBright: [97, 39],
54
+ bgBlackBright: [100, 49],
55
+ bgRedBright: [101, 49],
56
+ bgGreenBright: [102, 49],
57
+ bgYellowBright: [103, 49],
58
+ bgBlueBright: [104, 49],
59
+ bgMagentaBright: [105, 49],
60
+ bgCyanBright: [106, 49],
61
+ bgWhiteBright: [107, 49]
62
+ }, h = Object.entries(f);
63
+ function a(n) {
64
+ return String(n);
65
+ }
66
+ a.open = "";
67
+ a.close = "";
68
+ var B = h.reduce(
69
+ (n, [e]) => (n[e] = a, n),
70
+ { isColorSupported: !1 }
71
+ );
72
+ function C(n = !1) {
73
+ let e = typeof process < "u" ? process : void 0, i = e?.env || {}, g = e?.argv || [];
74
+ return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || e?.platform === "win32" || n && i.TERM !== "dumb" || "CI" in i) || typeof window < "u" && !!window.chrome;
75
+ }
76
+ function p(n = !1) {
77
+ let e = C(n), i = (r, t, c, o) => {
78
+ let l = "", s3 = 0;
79
+ do
80
+ l += r.substring(s3, o) + c, s3 = o + t.length, o = r.indexOf(t, s3);
81
+ while (~o);
82
+ return l + r.substring(s3);
83
+ }, g = (r, t, c = r) => {
84
+ let o = (l) => {
85
+ let s3 = String(l), b = s3.indexOf(t, r.length);
86
+ return ~b ? r + i(s3, t, c, b) + t : r + s3 + t;
87
+ };
88
+ return o.open = r, o.close = t, o;
89
+ }, u = {
90
+ isColorSupported: e
91
+ }, d = (r) => `\x1B[${r}m`;
92
+ for (let [r, t] of h)
93
+ u[r] = e ? g(
94
+ d(t[0]),
95
+ d(t[1]),
96
+ t[2]
97
+ ) : a;
98
+ return u;
99
+ }
100
+
101
+ // ../../node_modules/@vitest/pretty-format/node_modules/tinyrainbow/dist/browser.js
102
+ var s = p();
103
+
104
+ // ../../node_modules/@vitest/pretty-format/dist/index.js
105
+ function _mergeNamespaces(n, m3) {
106
+ return m3.forEach(function(e) {
107
+ e && typeof e != "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
108
+ if (k !== "default" && !(k in n)) {
109
+ var d = Object.getOwnPropertyDescriptor(e, k);
110
+ Object.defineProperty(n, k, d.get ? d : {
111
+ enumerable: !0,
112
+ get: function() {
113
+ return e[k];
114
+ }
115
+ });
116
+ }
117
+ });
118
+ }), Object.freeze(n);
119
+ }
120
+ function getKeysOfEnumerableProperties(object, compareKeys) {
121
+ let rawKeys = Object.keys(object), keys = compareKeys === null ? rawKeys : rawKeys.sort(compareKeys);
122
+ if (Object.getOwnPropertySymbols)
123
+ for (let symbol of Object.getOwnPropertySymbols(object))
124
+ Object.getOwnPropertyDescriptor(object, symbol).enumerable && keys.push(symbol);
125
+ return keys;
126
+ }
127
+ function printIteratorEntries(iterator, config, indentation, depth, refs, printer2, separator = ": ") {
128
+ let result = "", width = 0, current = iterator.next();
129
+ if (!current.done) {
130
+ result += config.spacingOuter;
131
+ let indentationNext = indentation + config.indent;
132
+ for (; !current.done; ) {
133
+ if (result += indentationNext, width++ === config.maxWidth) {
134
+ result += "\u2026";
135
+ break;
136
+ }
137
+ let name = printer2(current.value[0], config, indentationNext, depth, refs), value = printer2(current.value[1], config, indentationNext, depth, refs);
138
+ result += name + separator + value, current = iterator.next(), current.done ? config.min || (result += ",") : result += `,${config.spacingInner}`;
139
+ }
140
+ result += config.spacingOuter + indentation;
141
+ }
142
+ return result;
143
+ }
144
+ function printIteratorValues(iterator, config, indentation, depth, refs, printer2) {
145
+ let result = "", width = 0, current = iterator.next();
146
+ if (!current.done) {
147
+ result += config.spacingOuter;
148
+ let indentationNext = indentation + config.indent;
149
+ for (; !current.done; ) {
150
+ if (result += indentationNext, width++ === config.maxWidth) {
151
+ result += "\u2026";
152
+ break;
153
+ }
154
+ result += printer2(current.value, config, indentationNext, depth, refs), current = iterator.next(), current.done ? config.min || (result += ",") : result += `,${config.spacingInner}`;
155
+ }
156
+ result += config.spacingOuter + indentation;
157
+ }
158
+ return result;
159
+ }
160
+ function printListItems(list, config, indentation, depth, refs, printer2) {
161
+ let result = "";
162
+ list = list instanceof ArrayBuffer ? new DataView(list) : list;
163
+ let isDataView = (l) => l instanceof DataView, length = isDataView(list) ? list.byteLength : list.length;
164
+ if (length > 0) {
165
+ result += config.spacingOuter;
166
+ let indentationNext = indentation + config.indent;
167
+ for (let i = 0; i < length; i++) {
168
+ if (result += indentationNext, i === config.maxWidth) {
169
+ result += "\u2026";
170
+ break;
171
+ }
172
+ (isDataView(list) || i in list) && (result += printer2(isDataView(list) ? list.getInt8(i) : list[i], config, indentationNext, depth, refs)), i < length - 1 ? result += `,${config.spacingInner}` : config.min || (result += ",");
173
+ }
174
+ result += config.spacingOuter + indentation;
175
+ }
176
+ return result;
177
+ }
178
+ function printObjectProperties(val, config, indentation, depth, refs, printer2) {
179
+ let result = "", keys = getKeysOfEnumerableProperties(val, config.compareKeys);
180
+ if (keys.length > 0) {
181
+ result += config.spacingOuter;
182
+ let indentationNext = indentation + config.indent;
183
+ for (let i = 0; i < keys.length; i++) {
184
+ let key = keys[i], name = printer2(key, config, indentationNext, depth, refs), value = printer2(val[key], config, indentationNext, depth, refs);
185
+ result += `${indentationNext + name}: ${value}`, i < keys.length - 1 ? result += `,${config.spacingInner}` : config.min || (result += ",");
186
+ }
187
+ result += config.spacingOuter + indentation;
188
+ }
189
+ return result;
190
+ }
191
+ var asymmetricMatcher = typeof Symbol == "function" && Symbol.for ? /* @__PURE__ */ Symbol.for("jest.asymmetricMatcher") : 1267621, SPACE$2 = " ", serialize$5 = (val, config, indentation, depth, refs, printer2) => {
192
+ let stringedValue = val.toString();
193
+ if (stringedValue === "ArrayContaining" || stringedValue === "ArrayNotContaining")
194
+ return ++depth > config.maxDepth ? `[${stringedValue}]` : `${stringedValue + SPACE$2}[${printListItems(val.sample, config, indentation, depth, refs, printer2)}]`;
195
+ if (stringedValue === "ObjectContaining" || stringedValue === "ObjectNotContaining")
196
+ return ++depth > config.maxDepth ? `[${stringedValue}]` : `${stringedValue + SPACE$2}{${printObjectProperties(val.sample, config, indentation, depth, refs, printer2)}}`;
197
+ if (stringedValue === "StringMatching" || stringedValue === "StringNotMatching" || stringedValue === "StringContaining" || stringedValue === "StringNotContaining")
198
+ return stringedValue + SPACE$2 + printer2(val.sample, config, indentation, depth, refs);
199
+ if (typeof val.toAsymmetricMatcher != "function")
200
+ throw new TypeError(`Asymmetric matcher ${val.constructor.name} does not implement toAsymmetricMatcher()`);
201
+ return val.toAsymmetricMatcher();
202
+ }, test$5 = (val) => val && val.$$typeof === asymmetricMatcher, plugin$5 = {
203
+ serialize: serialize$5,
204
+ test: test$5
205
+ }, SPACE$1 = " ", OBJECT_NAMES = /* @__PURE__ */ new Set(["DOMStringMap", "NamedNodeMap"]), ARRAY_REGEXP = /^(?:HTML\w*Collection|NodeList)$/;
206
+ function testName(name) {
207
+ return OBJECT_NAMES.has(name) || ARRAY_REGEXP.test(name);
208
+ }
209
+ var test$4 = (val) => val && val.constructor && !!val.constructor.name && testName(val.constructor.name);
210
+ function isNamedNodeMap(collection) {
211
+ return collection.constructor.name === "NamedNodeMap";
212
+ }
213
+ var serialize$4 = (collection, config, indentation, depth, refs, printer2) => {
214
+ let name = collection.constructor.name;
215
+ return ++depth > config.maxDepth ? `[${name}]` : (config.min ? "" : name + SPACE$1) + (OBJECT_NAMES.has(name) ? `{${printObjectProperties(isNamedNodeMap(collection) ? [...collection].reduce((props, attribute) => (props[attribute.name] = attribute.value, props), {}) : { ...collection }, config, indentation, depth, refs, printer2)}}` : `[${printListItems([...collection], config, indentation, depth, refs, printer2)}]`);
216
+ }, plugin$4 = {
217
+ serialize: serialize$4,
218
+ test: test$4
219
+ };
220
+ function escapeHTML(str) {
221
+ return str.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
222
+ }
223
+ function printProps(keys, props, config, indentation, depth, refs, printer2) {
224
+ let indentationNext = indentation + config.indent, colors = config.colors;
225
+ return keys.map((key) => {
226
+ let value = props[key], printed = printer2(value, config, indentationNext, depth, refs);
227
+ return typeof value != "string" && (printed.includes(`
228
+ `) && (printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation), printed = `{${printed}}`), `${config.spacingInner + indentation + colors.prop.open + key + colors.prop.close}=${colors.value.open}${printed}${colors.value.close}`;
229
+ }).join("");
230
+ }
231
+ function printChildren(children, config, indentation, depth, refs, printer2) {
232
+ return children.map((child) => config.spacingOuter + indentation + (typeof child == "string" ? printText(child, config) : printer2(child, config, indentation, depth, refs))).join("");
233
+ }
234
+ function printText(text, config) {
235
+ let contentColor = config.colors.content;
236
+ return contentColor.open + escapeHTML(text) + contentColor.close;
237
+ }
238
+ function printComment(comment, config) {
239
+ let commentColor = config.colors.comment;
240
+ return `${commentColor.open}<!--${escapeHTML(comment)}-->${commentColor.close}`;
241
+ }
242
+ function printElement(type, printedProps, printedChildren, config, indentation) {
243
+ let tagColor = config.colors.tag;
244
+ return `${tagColor.open}<${type}${printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open}${printedChildren ? `>${tagColor.close}${printedChildren}${config.spacingOuter}${indentation}${tagColor.open}</${type}` : `${printedProps && !config.min ? "" : " "}/`}>${tagColor.close}`;
245
+ }
246
+ function printElementAsLeaf(type, config) {
247
+ let tagColor = config.colors.tag;
248
+ return `${tagColor.open}<${type}${tagColor.close} \u2026${tagColor.open} />${tagColor.close}`;
249
+ }
250
+ var ELEMENT_NODE = 1, TEXT_NODE = 3, COMMENT_NODE = 8, FRAGMENT_NODE = 11, ELEMENT_REGEXP = /^(?:(?:HTML|SVG)\w*)?Element$/;
251
+ function testHasAttribute(val) {
252
+ try {
253
+ return typeof val.hasAttribute == "function" && val.hasAttribute("is");
254
+ } catch {
255
+ return !1;
256
+ }
257
+ }
258
+ function testNode(val) {
259
+ let constructorName = val.constructor.name, { nodeType, tagName } = val, isCustomElement = typeof tagName == "string" && tagName.includes("-") || testHasAttribute(val);
260
+ return nodeType === ELEMENT_NODE && (ELEMENT_REGEXP.test(constructorName) || isCustomElement) || nodeType === TEXT_NODE && constructorName === "Text" || nodeType === COMMENT_NODE && constructorName === "Comment" || nodeType === FRAGMENT_NODE && constructorName === "DocumentFragment";
261
+ }
262
+ var test$3 = (val) => {
263
+ var _val$constructor;
264
+ return (val == null || (_val$constructor = val.constructor) === null || _val$constructor === void 0 ? void 0 : _val$constructor.name) && testNode(val);
265
+ };
266
+ function nodeIsText(node) {
267
+ return node.nodeType === TEXT_NODE;
268
+ }
269
+ function nodeIsComment(node) {
270
+ return node.nodeType === COMMENT_NODE;
271
+ }
272
+ function nodeIsFragment(node) {
273
+ return node.nodeType === FRAGMENT_NODE;
274
+ }
275
+ var serialize$3 = (node, config, indentation, depth, refs, printer2) => {
276
+ if (nodeIsText(node))
277
+ return printText(node.data, config);
278
+ if (nodeIsComment(node))
279
+ return printComment(node.data, config);
280
+ let type = nodeIsFragment(node) ? "DocumentFragment" : node.tagName.toLowerCase();
281
+ return ++depth > config.maxDepth ? printElementAsLeaf(type, config) : printElement(type, printProps(nodeIsFragment(node) ? [] : Array.from(node.attributes, (attr) => attr.name).sort(), nodeIsFragment(node) ? {} : [...node.attributes].reduce((props, attribute) => (props[attribute.name] = attribute.value, props), {}), config, indentation + config.indent, depth, refs, printer2), printChildren(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer2), config, indentation);
282
+ }, plugin$3 = {
283
+ serialize: serialize$3,
284
+ test: test$3
285
+ }, IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@", IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@", IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@", IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@", IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@", IS_RECORD_SENTINEL = "@@__IMMUTABLE_RECORD__@@", IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@", IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@", IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@", getImmutableName = (name) => `Immutable.${name}`, printAsLeaf = (name) => `[${name}]`, SPACE = " ", LAZY = "\u2026";
286
+ function printImmutableEntries(val, config, indentation, depth, refs, printer2, type) {
287
+ return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}{${printIteratorEntries(val.entries(), config, indentation, depth, refs, printer2)}}`;
288
+ }
289
+ function getRecordEntries(val) {
290
+ let i = 0;
291
+ return { next() {
292
+ if (i < val._keys.length) {
293
+ let key = val._keys[i++];
294
+ return {
295
+ done: !1,
296
+ value: [key, val.get(key)]
297
+ };
298
+ }
299
+ return {
300
+ done: !0,
301
+ value: void 0
302
+ };
303
+ } };
304
+ }
305
+ function printImmutableRecord(val, config, indentation, depth, refs, printer2) {
306
+ let name = getImmutableName(val._name || "Record");
307
+ return ++depth > config.maxDepth ? printAsLeaf(name) : `${name + SPACE}{${printIteratorEntries(getRecordEntries(val), config, indentation, depth, refs, printer2)}}`;
308
+ }
309
+ function printImmutableSeq(val, config, indentation, depth, refs, printer2) {
310
+ let name = getImmutableName("Seq");
311
+ return ++depth > config.maxDepth ? printAsLeaf(name) : val[IS_KEYED_SENTINEL] ? `${name + SPACE}{${val._iter || val._object ? printIteratorEntries(val.entries(), config, indentation, depth, refs, printer2) : LAZY}}` : `${name + SPACE}[${val._iter || val._array || val._collection || val._iterable ? printIteratorValues(val.values(), config, indentation, depth, refs, printer2) : LAZY}]`;
312
+ }
313
+ function printImmutableValues(val, config, indentation, depth, refs, printer2, type) {
314
+ return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}[${printIteratorValues(val.values(), config, indentation, depth, refs, printer2)}]`;
315
+ }
316
+ var serialize$2 = (val, config, indentation, depth, refs, printer2) => val[IS_MAP_SENTINEL] ? printImmutableEntries(val, config, indentation, depth, refs, printer2, val[IS_ORDERED_SENTINEL] ? "OrderedMap" : "Map") : val[IS_LIST_SENTINEL] ? printImmutableValues(val, config, indentation, depth, refs, printer2, "List") : val[IS_SET_SENTINEL] ? printImmutableValues(val, config, indentation, depth, refs, printer2, val[IS_ORDERED_SENTINEL] ? "OrderedSet" : "Set") : val[IS_STACK_SENTINEL] ? printImmutableValues(val, config, indentation, depth, refs, printer2, "Stack") : val[IS_SEQ_SENTINEL] ? printImmutableSeq(val, config, indentation, depth, refs, printer2) : printImmutableRecord(val, config, indentation, depth, refs, printer2), test$2 = (val) => val && (val[IS_ITERABLE_SENTINEL] === !0 || val[IS_RECORD_SENTINEL] === !0), plugin$2 = {
317
+ serialize: serialize$2,
318
+ test: test$2
319
+ };
320
+ function getDefaultExportFromCjs(x) {
321
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
322
+ }
323
+ var reactIs$1 = { exports: {} }, reactIs_production = {};
324
+ var hasRequiredReactIs_production;
325
+ function requireReactIs_production() {
326
+ if (hasRequiredReactIs_production) return reactIs_production;
327
+ hasRequiredReactIs_production = 1;
328
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference");
329
+ function typeOf(object) {
330
+ if (typeof object == "object" && object !== null) {
331
+ var $$typeof = object.$$typeof;
332
+ switch ($$typeof) {
333
+ case REACT_ELEMENT_TYPE:
334
+ switch (object = object.type, object) {
335
+ case REACT_FRAGMENT_TYPE:
336
+ case REACT_PROFILER_TYPE:
337
+ case REACT_STRICT_MODE_TYPE:
338
+ case REACT_SUSPENSE_TYPE:
339
+ case REACT_SUSPENSE_LIST_TYPE:
340
+ case REACT_VIEW_TRANSITION_TYPE:
341
+ return object;
342
+ default:
343
+ switch (object = object && object.$$typeof, object) {
344
+ case REACT_CONTEXT_TYPE:
345
+ case REACT_FORWARD_REF_TYPE:
346
+ case REACT_LAZY_TYPE:
347
+ case REACT_MEMO_TYPE:
348
+ return object;
349
+ case REACT_CONSUMER_TYPE:
350
+ return object;
351
+ default:
352
+ return $$typeof;
353
+ }
354
+ }
355
+ case REACT_PORTAL_TYPE:
356
+ return $$typeof;
357
+ }
358
+ }
359
+ }
360
+ return reactIs_production.ContextConsumer = REACT_CONSUMER_TYPE, reactIs_production.ContextProvider = REACT_CONTEXT_TYPE, reactIs_production.Element = REACT_ELEMENT_TYPE, reactIs_production.ForwardRef = REACT_FORWARD_REF_TYPE, reactIs_production.Fragment = REACT_FRAGMENT_TYPE, reactIs_production.Lazy = REACT_LAZY_TYPE, reactIs_production.Memo = REACT_MEMO_TYPE, reactIs_production.Portal = REACT_PORTAL_TYPE, reactIs_production.Profiler = REACT_PROFILER_TYPE, reactIs_production.StrictMode = REACT_STRICT_MODE_TYPE, reactIs_production.Suspense = REACT_SUSPENSE_TYPE, reactIs_production.SuspenseList = REACT_SUSPENSE_LIST_TYPE, reactIs_production.isContextConsumer = function(object) {
361
+ return typeOf(object) === REACT_CONSUMER_TYPE;
362
+ }, reactIs_production.isContextProvider = function(object) {
363
+ return typeOf(object) === REACT_CONTEXT_TYPE;
364
+ }, reactIs_production.isElement = function(object) {
365
+ return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
366
+ }, reactIs_production.isForwardRef = function(object) {
367
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
368
+ }, reactIs_production.isFragment = function(object) {
369
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
370
+ }, reactIs_production.isLazy = function(object) {
371
+ return typeOf(object) === REACT_LAZY_TYPE;
372
+ }, reactIs_production.isMemo = function(object) {
373
+ return typeOf(object) === REACT_MEMO_TYPE;
374
+ }, reactIs_production.isPortal = function(object) {
375
+ return typeOf(object) === REACT_PORTAL_TYPE;
376
+ }, reactIs_production.isProfiler = function(object) {
377
+ return typeOf(object) === REACT_PROFILER_TYPE;
378
+ }, reactIs_production.isStrictMode = function(object) {
379
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
380
+ }, reactIs_production.isSuspense = function(object) {
381
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
382
+ }, reactIs_production.isSuspenseList = function(object) {
383
+ return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
384
+ }, reactIs_production.isValidElementType = function(type) {
385
+ return typeof type == "string" || typeof type == "function" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0);
386
+ }, reactIs_production.typeOf = typeOf, reactIs_production;
387
+ }
388
+ var reactIs_development$1 = {};
389
+ var hasRequiredReactIs_development$1;
390
+ function requireReactIs_development$1() {
391
+ return hasRequiredReactIs_development$1 || (hasRequiredReactIs_development$1 = 1, process.env.NODE_ENV !== "production" && (function() {
392
+ function typeOf(object) {
393
+ if (typeof object == "object" && object !== null) {
394
+ var $$typeof = object.$$typeof;
395
+ switch ($$typeof) {
396
+ case REACT_ELEMENT_TYPE:
397
+ switch (object = object.type, object) {
398
+ case REACT_FRAGMENT_TYPE:
399
+ case REACT_PROFILER_TYPE:
400
+ case REACT_STRICT_MODE_TYPE:
401
+ case REACT_SUSPENSE_TYPE:
402
+ case REACT_SUSPENSE_LIST_TYPE:
403
+ case REACT_VIEW_TRANSITION_TYPE:
404
+ return object;
405
+ default:
406
+ switch (object = object && object.$$typeof, object) {
407
+ case REACT_CONTEXT_TYPE:
408
+ case REACT_FORWARD_REF_TYPE:
409
+ case REACT_LAZY_TYPE:
410
+ case REACT_MEMO_TYPE:
411
+ return object;
412
+ case REACT_CONSUMER_TYPE:
413
+ return object;
414
+ default:
415
+ return $$typeof;
416
+ }
417
+ }
418
+ case REACT_PORTAL_TYPE:
419
+ return $$typeof;
420
+ }
421
+ }
422
+ }
423
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference");
424
+ reactIs_development$1.ContextConsumer = REACT_CONSUMER_TYPE, reactIs_development$1.ContextProvider = REACT_CONTEXT_TYPE, reactIs_development$1.Element = REACT_ELEMENT_TYPE, reactIs_development$1.ForwardRef = REACT_FORWARD_REF_TYPE, reactIs_development$1.Fragment = REACT_FRAGMENT_TYPE, reactIs_development$1.Lazy = REACT_LAZY_TYPE, reactIs_development$1.Memo = REACT_MEMO_TYPE, reactIs_development$1.Portal = REACT_PORTAL_TYPE, reactIs_development$1.Profiler = REACT_PROFILER_TYPE, reactIs_development$1.StrictMode = REACT_STRICT_MODE_TYPE, reactIs_development$1.Suspense = REACT_SUSPENSE_TYPE, reactIs_development$1.SuspenseList = REACT_SUSPENSE_LIST_TYPE, reactIs_development$1.isContextConsumer = function(object) {
425
+ return typeOf(object) === REACT_CONSUMER_TYPE;
426
+ }, reactIs_development$1.isContextProvider = function(object) {
427
+ return typeOf(object) === REACT_CONTEXT_TYPE;
428
+ }, reactIs_development$1.isElement = function(object) {
429
+ return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
430
+ }, reactIs_development$1.isForwardRef = function(object) {
431
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
432
+ }, reactIs_development$1.isFragment = function(object) {
433
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
434
+ }, reactIs_development$1.isLazy = function(object) {
435
+ return typeOf(object) === REACT_LAZY_TYPE;
436
+ }, reactIs_development$1.isMemo = function(object) {
437
+ return typeOf(object) === REACT_MEMO_TYPE;
438
+ }, reactIs_development$1.isPortal = function(object) {
439
+ return typeOf(object) === REACT_PORTAL_TYPE;
440
+ }, reactIs_development$1.isProfiler = function(object) {
441
+ return typeOf(object) === REACT_PROFILER_TYPE;
442
+ }, reactIs_development$1.isStrictMode = function(object) {
443
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
444
+ }, reactIs_development$1.isSuspense = function(object) {
445
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
446
+ }, reactIs_development$1.isSuspenseList = function(object) {
447
+ return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
448
+ }, reactIs_development$1.isValidElementType = function(type) {
449
+ return typeof type == "string" || typeof type == "function" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0);
450
+ }, reactIs_development$1.typeOf = typeOf;
451
+ })()), reactIs_development$1;
452
+ }
453
+ var hasRequiredReactIs$1;
454
+ function requireReactIs$1() {
455
+ return hasRequiredReactIs$1 || (hasRequiredReactIs$1 = 1, process.env.NODE_ENV === "production" ? reactIs$1.exports = requireReactIs_production() : reactIs$1.exports = requireReactIs_development$1()), reactIs$1.exports;
456
+ }
457
+ var reactIsExports$1 = requireReactIs$1(), index$1 = getDefaultExportFromCjs(reactIsExports$1), ReactIs19 = _mergeNamespaces({
458
+ __proto__: null,
459
+ default: index$1
460
+ }, [reactIsExports$1]), reactIs = { exports: {} }, reactIs_production_min = {};
461
+ var hasRequiredReactIs_production_min;
462
+ function requireReactIs_production_min() {
463
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
464
+ hasRequiredReactIs_production_min = 1;
465
+ var b = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), e = /* @__PURE__ */ Symbol.for("react.strict_mode"), f3 = /* @__PURE__ */ Symbol.for("react.profiler"), g = /* @__PURE__ */ Symbol.for("react.provider"), h3 = /* @__PURE__ */ Symbol.for("react.context"), k = /* @__PURE__ */ Symbol.for("react.server_context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), m3 = /* @__PURE__ */ Symbol.for("react.suspense"), n = /* @__PURE__ */ Symbol.for("react.suspense_list"), p3 = /* @__PURE__ */ Symbol.for("react.memo"), q = /* @__PURE__ */ Symbol.for("react.lazy"), t = /* @__PURE__ */ Symbol.for("react.offscreen"), u;
466
+ u = /* @__PURE__ */ Symbol.for("react.module.reference");
467
+ function v(a3) {
468
+ if (typeof a3 == "object" && a3 !== null) {
469
+ var r = a3.$$typeof;
470
+ switch (r) {
471
+ case b:
472
+ switch (a3 = a3.type, a3) {
473
+ case d:
474
+ case f3:
475
+ case e:
476
+ case m3:
477
+ case n:
478
+ return a3;
479
+ default:
480
+ switch (a3 = a3 && a3.$$typeof, a3) {
481
+ case k:
482
+ case h3:
483
+ case l:
484
+ case q:
485
+ case p3:
486
+ case g:
487
+ return a3;
488
+ default:
489
+ return r;
490
+ }
491
+ }
492
+ case c:
493
+ return r;
494
+ }
495
+ }
496
+ }
497
+ return reactIs_production_min.ContextConsumer = h3, reactIs_production_min.ContextProvider = g, reactIs_production_min.Element = b, reactIs_production_min.ForwardRef = l, reactIs_production_min.Fragment = d, reactIs_production_min.Lazy = q, reactIs_production_min.Memo = p3, reactIs_production_min.Portal = c, reactIs_production_min.Profiler = f3, reactIs_production_min.StrictMode = e, reactIs_production_min.Suspense = m3, reactIs_production_min.SuspenseList = n, reactIs_production_min.isAsyncMode = function() {
498
+ return !1;
499
+ }, reactIs_production_min.isConcurrentMode = function() {
500
+ return !1;
501
+ }, reactIs_production_min.isContextConsumer = function(a3) {
502
+ return v(a3) === h3;
503
+ }, reactIs_production_min.isContextProvider = function(a3) {
504
+ return v(a3) === g;
505
+ }, reactIs_production_min.isElement = function(a3) {
506
+ return typeof a3 == "object" && a3 !== null && a3.$$typeof === b;
507
+ }, reactIs_production_min.isForwardRef = function(a3) {
508
+ return v(a3) === l;
509
+ }, reactIs_production_min.isFragment = function(a3) {
510
+ return v(a3) === d;
511
+ }, reactIs_production_min.isLazy = function(a3) {
512
+ return v(a3) === q;
513
+ }, reactIs_production_min.isMemo = function(a3) {
514
+ return v(a3) === p3;
515
+ }, reactIs_production_min.isPortal = function(a3) {
516
+ return v(a3) === c;
517
+ }, reactIs_production_min.isProfiler = function(a3) {
518
+ return v(a3) === f3;
519
+ }, reactIs_production_min.isStrictMode = function(a3) {
520
+ return v(a3) === e;
521
+ }, reactIs_production_min.isSuspense = function(a3) {
522
+ return v(a3) === m3;
523
+ }, reactIs_production_min.isSuspenseList = function(a3) {
524
+ return v(a3) === n;
525
+ }, reactIs_production_min.isValidElementType = function(a3) {
526
+ return typeof a3 == "string" || typeof a3 == "function" || a3 === d || a3 === f3 || a3 === e || a3 === m3 || a3 === n || a3 === t || typeof a3 == "object" && a3 !== null && (a3.$$typeof === q || a3.$$typeof === p3 || a3.$$typeof === g || a3.$$typeof === h3 || a3.$$typeof === l || a3.$$typeof === u || a3.getModuleId !== void 0);
527
+ }, reactIs_production_min.typeOf = v, reactIs_production_min;
528
+ }
529
+ var reactIs_development = {};
530
+ var hasRequiredReactIs_development;
531
+ function requireReactIs_development() {
532
+ return hasRequiredReactIs_development || (hasRequiredReactIs_development = 1, process.env.NODE_ENV !== "production" && (function() {
533
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_SERVER_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.server_context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen"), enableScopeAPI = !1, enableCacheElement = !1, enableTransitionTracing = !1, enableLegacyHidden = !1, enableDebugTracing = !1, REACT_MODULE_REFERENCE;
534
+ REACT_MODULE_REFERENCE = /* @__PURE__ */ Symbol.for("react.module.reference");
535
+ function isValidElementType(type) {
536
+ return !!(typeof type == "string" || typeof type == "function" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
537
+ // types supported by any Flight configuration anywhere since
538
+ // we don't know which Flight build this will end up being used
539
+ // with.
540
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0));
541
+ }
542
+ function typeOf(object) {
543
+ if (typeof object == "object" && object !== null) {
544
+ var $$typeof = object.$$typeof;
545
+ switch ($$typeof) {
546
+ case REACT_ELEMENT_TYPE:
547
+ var type = object.type;
548
+ switch (type) {
549
+ case REACT_FRAGMENT_TYPE:
550
+ case REACT_PROFILER_TYPE:
551
+ case REACT_STRICT_MODE_TYPE:
552
+ case REACT_SUSPENSE_TYPE:
553
+ case REACT_SUSPENSE_LIST_TYPE:
554
+ return type;
555
+ default:
556
+ var $$typeofType = type && type.$$typeof;
557
+ switch ($$typeofType) {
558
+ case REACT_SERVER_CONTEXT_TYPE:
559
+ case REACT_CONTEXT_TYPE:
560
+ case REACT_FORWARD_REF_TYPE:
561
+ case REACT_LAZY_TYPE:
562
+ case REACT_MEMO_TYPE:
563
+ case REACT_PROVIDER_TYPE:
564
+ return $$typeofType;
565
+ default:
566
+ return $$typeof;
567
+ }
568
+ }
569
+ case REACT_PORTAL_TYPE:
570
+ return $$typeof;
571
+ }
572
+ }
573
+ }
574
+ var ContextConsumer = REACT_CONTEXT_TYPE, ContextProvider = REACT_PROVIDER_TYPE, Element2 = REACT_ELEMENT_TYPE, ForwardRef = REACT_FORWARD_REF_TYPE, Fragment = REACT_FRAGMENT_TYPE, Lazy = REACT_LAZY_TYPE, Memo = REACT_MEMO_TYPE, Portal = REACT_PORTAL_TYPE, Profiler = REACT_PROFILER_TYPE, StrictMode = REACT_STRICT_MODE_TYPE, Suspense = REACT_SUSPENSE_TYPE, SuspenseList = REACT_SUSPENSE_LIST_TYPE, hasWarnedAboutDeprecatedIsAsyncMode = !1, hasWarnedAboutDeprecatedIsConcurrentMode = !1;
575
+ function isAsyncMode(object) {
576
+ return hasWarnedAboutDeprecatedIsAsyncMode || (hasWarnedAboutDeprecatedIsAsyncMode = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")), !1;
577
+ }
578
+ function isConcurrentMode(object) {
579
+ return hasWarnedAboutDeprecatedIsConcurrentMode || (hasWarnedAboutDeprecatedIsConcurrentMode = !0, console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")), !1;
580
+ }
581
+ function isContextConsumer(object) {
582
+ return typeOf(object) === REACT_CONTEXT_TYPE;
583
+ }
584
+ function isContextProvider(object) {
585
+ return typeOf(object) === REACT_PROVIDER_TYPE;
586
+ }
587
+ function isElement(object) {
588
+ return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
589
+ }
590
+ function isForwardRef(object) {
591
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
592
+ }
593
+ function isFragment(object) {
594
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
595
+ }
596
+ function isLazy(object) {
597
+ return typeOf(object) === REACT_LAZY_TYPE;
598
+ }
599
+ function isMemo(object) {
600
+ return typeOf(object) === REACT_MEMO_TYPE;
601
+ }
602
+ function isPortal(object) {
603
+ return typeOf(object) === REACT_PORTAL_TYPE;
604
+ }
605
+ function isProfiler(object) {
606
+ return typeOf(object) === REACT_PROFILER_TYPE;
607
+ }
608
+ function isStrictMode(object) {
609
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
610
+ }
611
+ function isSuspense(object) {
612
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
613
+ }
614
+ function isSuspenseList(object) {
615
+ return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
616
+ }
617
+ reactIs_development.ContextConsumer = ContextConsumer, reactIs_development.ContextProvider = ContextProvider, reactIs_development.Element = Element2, reactIs_development.ForwardRef = ForwardRef, reactIs_development.Fragment = Fragment, reactIs_development.Lazy = Lazy, reactIs_development.Memo = Memo, reactIs_development.Portal = Portal, reactIs_development.Profiler = Profiler, reactIs_development.StrictMode = StrictMode, reactIs_development.Suspense = Suspense, reactIs_development.SuspenseList = SuspenseList, reactIs_development.isAsyncMode = isAsyncMode, reactIs_development.isConcurrentMode = isConcurrentMode, reactIs_development.isContextConsumer = isContextConsumer, reactIs_development.isContextProvider = isContextProvider, reactIs_development.isElement = isElement, reactIs_development.isForwardRef = isForwardRef, reactIs_development.isFragment = isFragment, reactIs_development.isLazy = isLazy, reactIs_development.isMemo = isMemo, reactIs_development.isPortal = isPortal, reactIs_development.isProfiler = isProfiler, reactIs_development.isStrictMode = isStrictMode, reactIs_development.isSuspense = isSuspense, reactIs_development.isSuspenseList = isSuspenseList, reactIs_development.isValidElementType = isValidElementType, reactIs_development.typeOf = typeOf;
618
+ })()), reactIs_development;
619
+ }
620
+ var hasRequiredReactIs;
621
+ function requireReactIs() {
622
+ return hasRequiredReactIs || (hasRequiredReactIs = 1, process.env.NODE_ENV === "production" ? reactIs.exports = requireReactIs_production_min() : reactIs.exports = requireReactIs_development()), reactIs.exports;
623
+ }
624
+ var reactIsExports = requireReactIs(), index = getDefaultExportFromCjs(reactIsExports), ReactIs18 = _mergeNamespaces({
625
+ __proto__: null,
626
+ default: index
627
+ }, [reactIsExports]), reactIsMethods = [
628
+ "isAsyncMode",
629
+ "isConcurrentMode",
630
+ "isContextConsumer",
631
+ "isContextProvider",
632
+ "isElement",
633
+ "isForwardRef",
634
+ "isFragment",
635
+ "isLazy",
636
+ "isMemo",
637
+ "isPortal",
638
+ "isProfiler",
639
+ "isStrictMode",
640
+ "isSuspense",
641
+ "isSuspenseList",
642
+ "isValidElementType"
643
+ ], ReactIs = Object.fromEntries(reactIsMethods.map((m3) => [m3, (v) => ReactIs18[m3](v) || ReactIs19[m3](v)]));
644
+ function getChildren(arg, children = []) {
645
+ if (Array.isArray(arg))
646
+ for (let item of arg)
647
+ getChildren(item, children);
648
+ else arg != null && arg !== !1 && arg !== "" && children.push(arg);
649
+ return children;
650
+ }
651
+ function getType(element) {
652
+ let type = element.type;
653
+ if (typeof type == "string")
654
+ return type;
655
+ if (typeof type == "function")
656
+ return type.displayName || type.name || "Unknown";
657
+ if (ReactIs.isFragment(element))
658
+ return "React.Fragment";
659
+ if (ReactIs.isSuspense(element))
660
+ return "React.Suspense";
661
+ if (typeof type == "object" && type !== null) {
662
+ if (ReactIs.isContextProvider(element))
663
+ return "Context.Provider";
664
+ if (ReactIs.isContextConsumer(element))
665
+ return "Context.Consumer";
666
+ if (ReactIs.isForwardRef(element)) {
667
+ if (type.displayName)
668
+ return type.displayName;
669
+ let functionName = type.render.displayName || type.render.name || "";
670
+ return functionName === "" ? "ForwardRef" : `ForwardRef(${functionName})`;
671
+ }
672
+ if (ReactIs.isMemo(element)) {
673
+ let functionName = type.displayName || type.type.displayName || type.type.name || "";
674
+ return functionName === "" ? "Memo" : `Memo(${functionName})`;
675
+ }
676
+ }
677
+ return "UNDEFINED";
678
+ }
679
+ function getPropKeys$1(element) {
680
+ let { props } = element;
681
+ return Object.keys(props).filter((key) => key !== "children" && props[key] !== void 0).sort();
682
+ }
683
+ var serialize$1 = (element, config, indentation, depth, refs, printer2) => ++depth > config.maxDepth ? printElementAsLeaf(getType(element), config) : printElement(getType(element), printProps(getPropKeys$1(element), element.props, config, indentation + config.indent, depth, refs, printer2), printChildren(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer2), config, indentation), test$1 = (val) => val != null && ReactIs.isElement(val), plugin$1 = {
684
+ serialize: serialize$1,
685
+ test: test$1
686
+ }, testSymbol = typeof Symbol == "function" && Symbol.for ? /* @__PURE__ */ Symbol.for("react.test.json") : 245830487;
687
+ function getPropKeys(object) {
688
+ let { props } = object;
689
+ return props ? Object.keys(props).filter((key) => props[key] !== void 0).sort() : [];
690
+ }
691
+ var serialize = (object, config, indentation, depth, refs, printer2) => ++depth > config.maxDepth ? printElementAsLeaf(object.type, config) : printElement(object.type, object.props ? printProps(getPropKeys(object), object.props, config, indentation + config.indent, depth, refs, printer2) : "", object.children ? printChildren(object.children, config, indentation + config.indent, depth, refs, printer2) : "", config, indentation), test = (val) => val && val.$$typeof === testSymbol, plugin = {
692
+ serialize,
693
+ test
694
+ }, toString = Object.prototype.toString, toISOString = Date.prototype.toISOString, errorToString = Error.prototype.toString, regExpToString = RegExp.prototype.toString;
695
+ function getConstructorName(val) {
696
+ return typeof val.constructor == "function" && val.constructor.name || "Object";
697
+ }
698
+ function isWindow(val) {
699
+ return typeof window < "u" && val === window;
700
+ }
701
+ var SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/, NEWLINE_REGEXP = /\n/g, PrettyFormatPluginError = class extends Error {
702
+ constructor(message, stack) {
703
+ super(message), this.stack = stack, this.name = this.constructor.name;
704
+ }
705
+ };
706
+ function isToStringedArrayType(toStringed) {
707
+ return toStringed === "[object Array]" || toStringed === "[object ArrayBuffer]" || toStringed === "[object DataView]" || toStringed === "[object Float32Array]" || toStringed === "[object Float64Array]" || toStringed === "[object Int8Array]" || toStringed === "[object Int16Array]" || toStringed === "[object Int32Array]" || toStringed === "[object Uint8Array]" || toStringed === "[object Uint8ClampedArray]" || toStringed === "[object Uint16Array]" || toStringed === "[object Uint32Array]";
708
+ }
709
+ function printNumber(val) {
710
+ return Object.is(val, -0) ? "-0" : String(val);
711
+ }
712
+ function printBigInt(val) {
713
+ return `${val}n`;
714
+ }
715
+ function printFunction(val, printFunctionName) {
716
+ return printFunctionName ? `[Function ${val.name || "anonymous"}]` : "[Function]";
717
+ }
718
+ function printSymbol(val) {
719
+ return String(val).replace(SYMBOL_REGEXP, "Symbol($1)");
720
+ }
721
+ function printError(val) {
722
+ return `[${errorToString.call(val)}]`;
723
+ }
724
+ function printBasicValue(val, printFunctionName, escapeRegex, escapeString) {
725
+ if (val === !0 || val === !1)
726
+ return `${val}`;
727
+ if (val === void 0)
728
+ return "undefined";
729
+ if (val === null)
730
+ return "null";
731
+ let typeOf = typeof val;
732
+ if (typeOf === "number")
733
+ return printNumber(val);
734
+ if (typeOf === "bigint")
735
+ return printBigInt(val);
736
+ if (typeOf === "string")
737
+ return escapeString ? `"${val.replaceAll(/"|\\/g, "\\$&")}"` : `"${val}"`;
738
+ if (typeOf === "function")
739
+ return printFunction(val, printFunctionName);
740
+ if (typeOf === "symbol")
741
+ return printSymbol(val);
742
+ let toStringed = toString.call(val);
743
+ return toStringed === "[object WeakMap]" ? "WeakMap {}" : toStringed === "[object WeakSet]" ? "WeakSet {}" : toStringed === "[object Function]" || toStringed === "[object GeneratorFunction]" ? printFunction(val, printFunctionName) : toStringed === "[object Symbol]" ? printSymbol(val) : toStringed === "[object Date]" ? Number.isNaN(+val) ? "Date { NaN }" : toISOString.call(val) : toStringed === "[object Error]" ? printError(val) : toStringed === "[object RegExp]" ? escapeRegex ? regExpToString.call(val).replaceAll(/[$()*+.?[\\\]^{|}]/g, "\\$&") : regExpToString.call(val) : val instanceof Error ? printError(val) : null;
744
+ }
745
+ function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {
746
+ if (refs.includes(val))
747
+ return "[Circular]";
748
+ refs = [...refs], refs.push(val);
749
+ let hitMaxDepth = ++depth > config.maxDepth, min = config.min;
750
+ if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON == "function" && !hasCalledToJSON)
751
+ return printer(val.toJSON(), config, indentation, depth, refs, !0);
752
+ let toStringed = toString.call(val);
753
+ return toStringed === "[object Arguments]" ? hitMaxDepth ? "[Arguments]" : `${min ? "" : "Arguments "}[${printListItems(val, config, indentation, depth, refs, printer)}]` : isToStringedArrayType(toStringed) ? hitMaxDepth ? `[${val.constructor.name}]` : `${min || !config.printBasicPrototype && val.constructor.name === "Array" ? "" : `${val.constructor.name} `}[${printListItems(val, config, indentation, depth, refs, printer)}]` : toStringed === "[object Map]" ? hitMaxDepth ? "[Map]" : `Map {${printIteratorEntries(val.entries(), config, indentation, depth, refs, printer, " => ")}}` : toStringed === "[object Set]" ? hitMaxDepth ? "[Set]" : `Set {${printIteratorValues(val.values(), config, indentation, depth, refs, printer)}}` : hitMaxDepth || isWindow(val) ? `[${getConstructorName(val)}]` : `${min || !config.printBasicPrototype && getConstructorName(val) === "Object" ? "" : `${getConstructorName(val)} `}{${printObjectProperties(val, config, indentation, depth, refs, printer)}}`;
754
+ }
755
+ var ErrorPlugin = {
756
+ test: (val) => val && val instanceof Error,
757
+ serialize(val, config, indentation, depth, refs, printer2) {
758
+ if (refs.includes(val))
759
+ return "[Circular]";
760
+ refs = [...refs, val];
761
+ let hitMaxDepth = ++depth > config.maxDepth, { message, cause, ...rest } = val, entries = {
762
+ message,
763
+ ...typeof cause < "u" ? { cause } : {},
764
+ ...val instanceof AggregateError ? { errors: val.errors } : {},
765
+ ...rest
766
+ }, name = val.name !== "Error" ? val.name : getConstructorName(val);
767
+ return hitMaxDepth ? `[${name}]` : `${name} {${printIteratorEntries(Object.entries(entries).values(), config, indentation, depth, refs, printer2)}}`;
768
+ }
769
+ };
770
+ function isNewPlugin(plugin2) {
771
+ return plugin2.serialize != null;
772
+ }
773
+ function printPlugin(plugin2, val, config, indentation, depth, refs) {
774
+ let printed;
775
+ try {
776
+ printed = isNewPlugin(plugin2) ? plugin2.serialize(val, config, indentation, depth, refs, printer) : plugin2.print(val, (valChild) => printer(valChild, config, indentation, depth, refs), (str) => {
777
+ let indentationNext = indentation + config.indent;
778
+ return indentationNext + str.replaceAll(NEWLINE_REGEXP, `
779
+ ${indentationNext}`);
780
+ }, {
781
+ edgeSpacing: config.spacingOuter,
782
+ min: config.min,
783
+ spacing: config.spacingInner
784
+ }, config.colors);
785
+ } catch (error) {
786
+ throw new PrettyFormatPluginError(error.message, error.stack);
787
+ }
788
+ if (typeof printed != "string")
789
+ throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`);
790
+ return printed;
791
+ }
792
+ function findPlugin(plugins2, val) {
793
+ for (let plugin2 of plugins2)
794
+ try {
795
+ if (plugin2.test(val))
796
+ return plugin2;
797
+ } catch (error) {
798
+ throw new PrettyFormatPluginError(error.message, error.stack);
799
+ }
800
+ return null;
801
+ }
802
+ function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
803
+ let plugin2 = findPlugin(config.plugins, val);
804
+ if (plugin2 !== null)
805
+ return printPlugin(plugin2, val, config, indentation, depth, refs);
806
+ let basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString);
807
+ return basicResult !== null ? basicResult : printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
808
+ }
809
+ var DEFAULT_THEME = {
810
+ comment: "gray",
811
+ content: "reset",
812
+ prop: "yellow",
813
+ tag: "cyan",
814
+ value: "green"
815
+ }, DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME), DEFAULT_OPTIONS = {
816
+ callToJSON: !0,
817
+ compareKeys: void 0,
818
+ escapeRegex: !1,
819
+ escapeString: !0,
820
+ highlight: !1,
821
+ indent: 2,
822
+ maxDepth: Number.POSITIVE_INFINITY,
823
+ maxWidth: Number.POSITIVE_INFINITY,
824
+ min: !1,
825
+ plugins: [],
826
+ printBasicPrototype: !0,
827
+ printFunctionName: !0,
828
+ theme: DEFAULT_THEME
829
+ };
830
+ function validateOptions(options) {
831
+ for (let key of Object.keys(options))
832
+ if (!Object.prototype.hasOwnProperty.call(DEFAULT_OPTIONS, key))
833
+ throw new Error(`pretty-format: Unknown option "${key}".`);
834
+ if (options.min && options.indent !== void 0 && options.indent !== 0)
835
+ throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');
836
+ }
837
+ function getColorsHighlight() {
838
+ return DEFAULT_THEME_KEYS.reduce((colors, key) => {
839
+ let value = DEFAULT_THEME[key], color = value && s[value];
840
+ if (color && typeof color.close == "string" && typeof color.open == "string")
841
+ colors[key] = color;
842
+ else
843
+ throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);
844
+ return colors;
845
+ }, /* @__PURE__ */ Object.create(null));
846
+ }
847
+ function getColorsEmpty() {
848
+ return DEFAULT_THEME_KEYS.reduce((colors, key) => (colors[key] = {
849
+ close: "",
850
+ open: ""
851
+ }, colors), /* @__PURE__ */ Object.create(null));
852
+ }
853
+ function getPrintFunctionName(options) {
854
+ return options?.printFunctionName ?? DEFAULT_OPTIONS.printFunctionName;
855
+ }
856
+ function getEscapeRegex(options) {
857
+ return options?.escapeRegex ?? DEFAULT_OPTIONS.escapeRegex;
858
+ }
859
+ function getEscapeString(options) {
860
+ return options?.escapeString ?? DEFAULT_OPTIONS.escapeString;
861
+ }
862
+ function getConfig(options) {
863
+ return {
864
+ callToJSON: options?.callToJSON ?? DEFAULT_OPTIONS.callToJSON,
865
+ colors: options?.highlight ? getColorsHighlight() : getColorsEmpty(),
866
+ compareKeys: typeof options?.compareKeys == "function" || options?.compareKeys === null ? options.compareKeys : DEFAULT_OPTIONS.compareKeys,
867
+ escapeRegex: getEscapeRegex(options),
868
+ escapeString: getEscapeString(options),
869
+ indent: options?.min ? "" : createIndent(options?.indent ?? DEFAULT_OPTIONS.indent),
870
+ maxDepth: options?.maxDepth ?? DEFAULT_OPTIONS.maxDepth,
871
+ maxWidth: options?.maxWidth ?? DEFAULT_OPTIONS.maxWidth,
872
+ min: options?.min ?? DEFAULT_OPTIONS.min,
873
+ plugins: options?.plugins ?? DEFAULT_OPTIONS.plugins,
874
+ printBasicPrototype: options?.printBasicPrototype ?? !0,
875
+ printFunctionName: getPrintFunctionName(options),
876
+ spacingInner: options?.min ? " " : `
877
+ `,
878
+ spacingOuter: options?.min ? "" : `
879
+ `
880
+ };
881
+ }
882
+ function createIndent(indent) {
883
+ return Array.from({ length: indent + 1 }).join(" ");
884
+ }
885
+ function format(val, options) {
886
+ if (options && (validateOptions(options), options.plugins)) {
887
+ let plugin2 = findPlugin(options.plugins, val);
888
+ if (plugin2 !== null)
889
+ return printPlugin(plugin2, val, getConfig(options), "", 0, []);
890
+ }
891
+ let basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options));
892
+ return basicResult !== null ? basicResult : printComplexValue(val, getConfig(options), "", 0, []);
893
+ }
894
+ var plugins = {
895
+ AsymmetricMatcher: plugin$5,
896
+ DOMCollection: plugin$4,
897
+ DOMElement: plugin$3,
898
+ Immutable: plugin$2,
899
+ ReactElement: plugin$1,
900
+ ReactTestComponent: plugin,
901
+ Error: ErrorPlugin
902
+ };
903
+
904
+ // ../../node_modules/@vitest/utils/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js
905
+ var f2 = {
906
+ reset: [0, 0],
907
+ bold: [1, 22, "\x1B[22m\x1B[1m"],
908
+ dim: [2, 22, "\x1B[22m\x1B[2m"],
909
+ italic: [3, 23],
910
+ underline: [4, 24],
911
+ inverse: [7, 27],
912
+ hidden: [8, 28],
913
+ strikethrough: [9, 29],
914
+ black: [30, 39],
915
+ red: [31, 39],
916
+ green: [32, 39],
917
+ yellow: [33, 39],
918
+ blue: [34, 39],
919
+ magenta: [35, 39],
920
+ cyan: [36, 39],
921
+ white: [37, 39],
922
+ gray: [90, 39],
923
+ bgBlack: [40, 49],
924
+ bgRed: [41, 49],
925
+ bgGreen: [42, 49],
926
+ bgYellow: [43, 49],
927
+ bgBlue: [44, 49],
928
+ bgMagenta: [45, 49],
929
+ bgCyan: [46, 49],
930
+ bgWhite: [47, 49],
931
+ blackBright: [90, 39],
932
+ redBright: [91, 39],
933
+ greenBright: [92, 39],
934
+ yellowBright: [93, 39],
935
+ blueBright: [94, 39],
936
+ magentaBright: [95, 39],
937
+ cyanBright: [96, 39],
938
+ whiteBright: [97, 39],
939
+ bgBlackBright: [100, 49],
940
+ bgRedBright: [101, 49],
941
+ bgGreenBright: [102, 49],
942
+ bgYellowBright: [103, 49],
943
+ bgBlueBright: [104, 49],
944
+ bgMagentaBright: [105, 49],
945
+ bgCyanBright: [106, 49],
946
+ bgWhiteBright: [107, 49]
947
+ }, h2 = Object.entries(f2);
948
+ function a2(n) {
949
+ return String(n);
950
+ }
951
+ a2.open = "";
952
+ a2.close = "";
953
+ var B2 = h2.reduce(
954
+ (n, [e]) => (n[e] = a2, n),
955
+ { isColorSupported: !1 }
956
+ );
957
+ function C2(n = !1) {
958
+ let e = typeof process < "u" ? process : void 0, i = e?.env || {}, g = e?.argv || [];
959
+ return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || e?.platform === "win32" || n && i.TERM !== "dumb" || "CI" in i) || typeof window < "u" && !!window.chrome;
960
+ }
961
+ function p2(n = !1) {
962
+ let e = C2(n), i = (r, t, c, o) => {
963
+ let l = "", s3 = 0;
964
+ do
965
+ l += r.substring(s3, o) + c, s3 = o + t.length, o = r.indexOf(t, s3);
966
+ while (~o);
967
+ return l + r.substring(s3);
968
+ }, g = (r, t, c = r) => {
969
+ let o = (l) => {
970
+ let s3 = String(l), b = s3.indexOf(t, r.length);
971
+ return ~b ? r + i(s3, t, c, b) + t : r + s3 + t;
972
+ };
973
+ return o.open = r, o.close = t, o;
974
+ }, u = {
975
+ isColorSupported: e
976
+ }, d = (r) => `\x1B[${r}m`;
977
+ for (let [r, t] of h2)
978
+ u[r] = e ? g(
979
+ d(t[0]),
980
+ d(t[1]),
981
+ t[2]
982
+ ) : a2;
983
+ return u;
984
+ }
985
+
986
+ // ../../node_modules/@vitest/utils/node_modules/tinyrainbow/dist/browser.js
987
+ var s2 = p2();
988
+
989
+ // ../../node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js
990
+ var { AsymmetricMatcher, DOMCollection, DOMElement, Immutable, ReactElement, ReactTestComponent } = plugins, PLUGINS = [
991
+ ReactTestComponent,
992
+ ReactElement,
993
+ DOMElement,
994
+ DOMCollection,
995
+ Immutable,
996
+ AsymmetricMatcher
997
+ ];
998
+ function stringify(object, maxDepth = 10, { maxLength, ...options } = {}) {
999
+ let MAX_LENGTH = maxLength ?? 1e4, result;
1000
+ try {
1001
+ result = format(object, {
1002
+ maxDepth,
1003
+ escapeString: !1,
1004
+ plugins: PLUGINS,
1005
+ ...options
1006
+ });
1007
+ } catch {
1008
+ result = format(object, {
1009
+ callToJSON: !1,
1010
+ maxDepth,
1011
+ escapeString: !1,
1012
+ plugins: PLUGINS,
1013
+ ...options
1014
+ });
1015
+ }
1016
+ return result.length >= MAX_LENGTH && maxDepth > 1 ? stringify(object, Math.floor(Math.min(maxDepth, Number.MAX_SAFE_INTEGER) / 2), {
1017
+ maxLength,
1018
+ ...options
1019
+ }) : result;
1020
+ }
1021
+ var formatRegExp = /%[sdjifoOc%]/g;
1022
+ function format2(...args) {
1023
+ if (typeof args[0] != "string") {
1024
+ let objects = [];
1025
+ for (let i2 = 0; i2 < args.length; i2++)
1026
+ objects.push(inspect2(args[i2], {
1027
+ depth: 0,
1028
+ colors: !1
1029
+ }));
1030
+ return objects.join(" ");
1031
+ }
1032
+ let len = args.length, i = 1, template = args[0], str = String(template).replace(formatRegExp, (x) => {
1033
+ if (x === "%%")
1034
+ return "%";
1035
+ if (i >= len)
1036
+ return x;
1037
+ switch (x) {
1038
+ case "%s": {
1039
+ let value = args[i++];
1040
+ return typeof value == "bigint" ? `${value.toString()}n` : typeof value == "number" && value === 0 && 1 / value < 0 ? "-0" : typeof value == "object" && value !== null ? typeof value.toString == "function" && value.toString !== Object.prototype.toString ? value.toString() : inspect2(value, {
1041
+ depth: 0,
1042
+ colors: !1
1043
+ }) : String(value);
1044
+ }
1045
+ case "%d": {
1046
+ let value = args[i++];
1047
+ return typeof value == "bigint" ? `${value.toString()}n` : Number(value).toString();
1048
+ }
1049
+ case "%i": {
1050
+ let value = args[i++];
1051
+ return typeof value == "bigint" ? `${value.toString()}n` : Number.parseInt(String(value)).toString();
1052
+ }
1053
+ case "%f":
1054
+ return Number.parseFloat(String(args[i++])).toString();
1055
+ case "%o":
1056
+ return inspect2(args[i++], {
1057
+ showHidden: !0,
1058
+ showProxy: !0
1059
+ });
1060
+ case "%O":
1061
+ return inspect2(args[i++]);
1062
+ case "%c":
1063
+ return i++, "";
1064
+ case "%j":
1065
+ try {
1066
+ return JSON.stringify(args[i++]);
1067
+ } catch (err) {
1068
+ let m3 = err.message;
1069
+ if (m3.includes("circular structure") || m3.includes("cyclic structures") || m3.includes("cyclic object"))
1070
+ return "[Circular]";
1071
+ throw err;
1072
+ }
1073
+ default:
1074
+ return x;
1075
+ }
1076
+ });
1077
+ for (let x = args[i]; i < len; x = args[++i])
1078
+ x === null || typeof x != "object" ? str += ` ${x}` : str += ` ${inspect2(x)}`;
1079
+ return str;
1080
+ }
1081
+ function inspect2(obj, options = {}) {
1082
+ return options.truncate === 0 && (options.truncate = Number.POSITIVE_INFINITY), inspect(obj, options);
1083
+ }
1084
+ function getDefaultExportFromCjs2(x) {
1085
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
1086
+ }
1087
+
1088
+ // ../../node_modules/@vitest/utils/dist/helpers.js
1089
+ function isFinalObj(obj) {
1090
+ return obj === Object.prototype || obj === Function.prototype || obj === RegExp.prototype;
1091
+ }
1092
+ function getType2(value) {
1093
+ return Object.prototype.toString.apply(value).slice(8, -1);
1094
+ }
1095
+ function collectOwnProperties(obj, collector) {
1096
+ let collect = typeof collector == "function" ? collector : (key) => collector.add(key);
1097
+ Object.getOwnPropertyNames(obj).forEach(collect), Object.getOwnPropertySymbols(obj).forEach(collect);
1098
+ }
1099
+ function getOwnProperties(obj) {
1100
+ let ownProps = /* @__PURE__ */ new Set();
1101
+ return isFinalObj(obj) ? [] : (collectOwnProperties(obj, ownProps), Array.from(ownProps));
1102
+ }
1103
+ var defaultCloneOptions = { forceWritable: !1 };
1104
+ function deepClone(val, options = defaultCloneOptions) {
1105
+ return clone(val, /* @__PURE__ */ new WeakMap(), options);
1106
+ }
1107
+ function clone(val, seen, options = defaultCloneOptions) {
1108
+ let k, out;
1109
+ if (seen.has(val))
1110
+ return seen.get(val);
1111
+ if (Array.isArray(val)) {
1112
+ for (out = Array.from({ length: k = val.length }), seen.set(val, out); k--; )
1113
+ out[k] = clone(val[k], seen, options);
1114
+ return out;
1115
+ }
1116
+ if (Object.prototype.toString.call(val) === "[object Object]") {
1117
+ out = Object.create(Object.getPrototypeOf(val)), seen.set(val, out);
1118
+ let props = getOwnProperties(val);
1119
+ for (let k2 of props) {
1120
+ let descriptor = Object.getOwnPropertyDescriptor(val, k2);
1121
+ if (!descriptor)
1122
+ continue;
1123
+ let cloned = clone(val[k2], seen, options);
1124
+ options.forceWritable ? Object.defineProperty(out, k2, {
1125
+ enumerable: descriptor.enumerable,
1126
+ configurable: !0,
1127
+ writable: !0,
1128
+ value: cloned
1129
+ }) : "get" in descriptor ? Object.defineProperty(out, k2, {
1130
+ ...descriptor,
1131
+ get() {
1132
+ return cloned;
1133
+ }
1134
+ }) : Object.defineProperty(out, k2, {
1135
+ ...descriptor,
1136
+ value: cloned
1137
+ });
1138
+ }
1139
+ return out;
1140
+ }
1141
+ return val;
1142
+ }
1143
+
1144
+ // ../../node_modules/@vitest/utils/dist/diff.js
1145
+ var DIFF_DELETE = -1, DIFF_INSERT = 1, DIFF_EQUAL = 0, Diff = class {
1146
+ 0;
1147
+ 1;
1148
+ constructor(op, text) {
1149
+ this[0] = op, this[1] = text;
1150
+ }
1151
+ };
1152
+ function diff_commonPrefix(text1, text2) {
1153
+ if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0))
1154
+ return 0;
1155
+ let pointermin = 0, pointermax = Math.min(text1.length, text2.length), pointermid = pointermax, pointerstart = 0;
1156
+ for (; pointermin < pointermid; )
1157
+ text1.substring(pointerstart, pointermid) === text2.substring(pointerstart, pointermid) ? (pointermin = pointermid, pointerstart = pointermin) : pointermax = pointermid, pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
1158
+ return pointermid;
1159
+ }
1160
+ function diff_commonSuffix(text1, text2) {
1161
+ if (!text1 || !text2 || text1.charAt(text1.length - 1) !== text2.charAt(text2.length - 1))
1162
+ return 0;
1163
+ let pointermin = 0, pointermax = Math.min(text1.length, text2.length), pointermid = pointermax, pointerend = 0;
1164
+ for (; pointermin < pointermid; )
1165
+ text1.substring(text1.length - pointermid, text1.length - pointerend) === text2.substring(text2.length - pointermid, text2.length - pointerend) ? (pointermin = pointermid, pointerend = pointermin) : pointermax = pointermid, pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
1166
+ return pointermid;
1167
+ }
1168
+ function diff_commonOverlap_(text1, text2) {
1169
+ let text1_length = text1.length, text2_length = text2.length;
1170
+ if (text1_length === 0 || text2_length === 0)
1171
+ return 0;
1172
+ text1_length > text2_length ? text1 = text1.substring(text1_length - text2_length) : text1_length < text2_length && (text2 = text2.substring(0, text1_length));
1173
+ let text_length = Math.min(text1_length, text2_length);
1174
+ if (text1 === text2)
1175
+ return text_length;
1176
+ let best = 0, length = 1;
1177
+ for (; ; ) {
1178
+ let pattern = text1.substring(text_length - length), found = text2.indexOf(pattern);
1179
+ if (found === -1)
1180
+ return best;
1181
+ length += found, (found === 0 || text1.substring(text_length - length) === text2.substring(0, length)) && (best = length, length++);
1182
+ }
1183
+ }
1184
+ function diff_cleanupSemantic(diffs) {
1185
+ let changes = !1, equalities = [], equalitiesLength = 0, lastEquality = null, pointer = 0, length_insertions1 = 0, length_deletions1 = 0, length_insertions2 = 0, length_deletions2 = 0;
1186
+ for (; pointer < diffs.length; )
1187
+ diffs[pointer][0] === DIFF_EQUAL ? (equalities[equalitiesLength++] = pointer, length_insertions1 = length_insertions2, length_deletions1 = length_deletions2, length_insertions2 = 0, length_deletions2 = 0, lastEquality = diffs[pointer][1]) : (diffs[pointer][0] === DIFF_INSERT ? length_insertions2 += diffs[pointer][1].length : length_deletions2 += diffs[pointer][1].length, lastEquality && lastEquality.length <= Math.max(length_insertions1, length_deletions1) && lastEquality.length <= Math.max(length_insertions2, length_deletions2) && (diffs.splice(equalities[equalitiesLength - 1], 0, new Diff(DIFF_DELETE, lastEquality)), diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT, equalitiesLength--, equalitiesLength--, pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1, length_insertions1 = 0, length_deletions1 = 0, length_insertions2 = 0, length_deletions2 = 0, lastEquality = null, changes = !0)), pointer++;
1188
+ for (changes && diff_cleanupMerge(diffs), diff_cleanupSemanticLossless(diffs), pointer = 1; pointer < diffs.length; ) {
1189
+ if (diffs[pointer - 1][0] === DIFF_DELETE && diffs[pointer][0] === DIFF_INSERT) {
1190
+ let deletion = diffs[pointer - 1][1], insertion = diffs[pointer][1], overlap_length1 = diff_commonOverlap_(deletion, insertion), overlap_length2 = diff_commonOverlap_(insertion, deletion);
1191
+ overlap_length1 >= overlap_length2 ? (overlap_length1 >= deletion.length / 2 || overlap_length1 >= insertion.length / 2) && (diffs.splice(pointer, 0, new Diff(DIFF_EQUAL, insertion.substring(0, overlap_length1))), diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlap_length1), diffs[pointer + 1][1] = insertion.substring(overlap_length1), pointer++) : (overlap_length2 >= deletion.length / 2 || overlap_length2 >= insertion.length / 2) && (diffs.splice(pointer, 0, new Diff(DIFF_EQUAL, deletion.substring(0, overlap_length2))), diffs[pointer - 1][0] = DIFF_INSERT, diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlap_length2), diffs[pointer + 1][0] = DIFF_DELETE, diffs[pointer + 1][1] = deletion.substring(overlap_length2), pointer++), pointer++;
1192
+ }
1193
+ pointer++;
1194
+ }
1195
+ }
1196
+ var nonAlphaNumericRegex_ = /[^a-z0-9]/i, whitespaceRegex_ = /\s/, linebreakRegex_ = /[\r\n]/, blanklineEndRegex_ = /\n\r?\n$/, blanklineStartRegex_ = /^\r?\n\r?\n/;
1197
+ function diff_cleanupSemanticLossless(diffs) {
1198
+ let pointer = 1;
1199
+ for (; pointer < diffs.length - 1; ) {
1200
+ if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
1201
+ let equality1 = diffs[pointer - 1][1], edit = diffs[pointer][1], equality2 = diffs[pointer + 1][1], commonOffset = diff_commonSuffix(equality1, edit);
1202
+ if (commonOffset) {
1203
+ let commonString = edit.substring(edit.length - commonOffset);
1204
+ equality1 = equality1.substring(0, equality1.length - commonOffset), edit = commonString + edit.substring(0, edit.length - commonOffset), equality2 = commonString + equality2;
1205
+ }
1206
+ let bestEquality1 = equality1, bestEdit = edit, bestEquality2 = equality2, bestScore = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
1207
+ for (; edit.charAt(0) === equality2.charAt(0); ) {
1208
+ equality1 += edit.charAt(0), edit = edit.substring(1) + equality2.charAt(0), equality2 = equality2.substring(1);
1209
+ let score = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
1210
+ score >= bestScore && (bestScore = score, bestEquality1 = equality1, bestEdit = edit, bestEquality2 = equality2);
1211
+ }
1212
+ diffs[pointer - 1][1] !== bestEquality1 && (bestEquality1 ? diffs[pointer - 1][1] = bestEquality1 : (diffs.splice(pointer - 1, 1), pointer--), diffs[pointer][1] = bestEdit, bestEquality2 ? diffs[pointer + 1][1] = bestEquality2 : (diffs.splice(pointer + 1, 1), pointer--));
1213
+ }
1214
+ pointer++;
1215
+ }
1216
+ }
1217
+ function diff_cleanupMerge(diffs) {
1218
+ diffs.push(new Diff(DIFF_EQUAL, ""));
1219
+ let pointer = 0, count_delete = 0, count_insert = 0, text_delete = "", text_insert = "", commonlength;
1220
+ for (; pointer < diffs.length; )
1221
+ switch (diffs[pointer][0]) {
1222
+ case DIFF_INSERT:
1223
+ count_insert++, text_insert += diffs[pointer][1], pointer++;
1224
+ break;
1225
+ case DIFF_DELETE:
1226
+ count_delete++, text_delete += diffs[pointer][1], pointer++;
1227
+ break;
1228
+ case DIFF_EQUAL:
1229
+ count_delete + count_insert > 1 ? (count_delete !== 0 && count_insert !== 0 && (commonlength = diff_commonPrefix(text_insert, text_delete), commonlength !== 0 && (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] === DIFF_EQUAL ? diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength) : (diffs.splice(0, 0, new Diff(DIFF_EQUAL, text_insert.substring(0, commonlength))), pointer++), text_insert = text_insert.substring(commonlength), text_delete = text_delete.substring(commonlength)), commonlength = diff_commonSuffix(text_insert, text_delete), commonlength !== 0 && (diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1], text_insert = text_insert.substring(0, text_insert.length - commonlength), text_delete = text_delete.substring(0, text_delete.length - commonlength))), pointer -= count_delete + count_insert, diffs.splice(pointer, count_delete + count_insert), text_delete.length && (diffs.splice(pointer, 0, new Diff(DIFF_DELETE, text_delete)), pointer++), text_insert.length && (diffs.splice(pointer, 0, new Diff(DIFF_INSERT, text_insert)), pointer++), pointer++) : pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL ? (diffs[pointer - 1][1] += diffs[pointer][1], diffs.splice(pointer, 1)) : pointer++, count_insert = 0, count_delete = 0, text_delete = "", text_insert = "";
1230
+ break;
1231
+ }
1232
+ diffs[diffs.length - 1][1] === "" && diffs.pop();
1233
+ let changes = !1;
1234
+ for (pointer = 1; pointer < diffs.length - 1; )
1235
+ diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL && (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1] ? (diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length), diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1], diffs.splice(pointer - 1, 1), changes = !0) : diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) === diffs[pointer + 1][1] && (diffs[pointer - 1][1] += diffs[pointer + 1][1], diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1], diffs.splice(pointer + 1, 1), changes = !0)), pointer++;
1236
+ changes && diff_cleanupMerge(diffs);
1237
+ }
1238
+ function diff_cleanupSemanticScore_(one, two) {
1239
+ if (!one || !two)
1240
+ return 6;
1241
+ let char1 = one.charAt(one.length - 1), char2 = two.charAt(0), nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_), nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_), whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_), whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_), lineBreak1 = whitespace1 && char1.match(linebreakRegex_), lineBreak2 = whitespace2 && char2.match(linebreakRegex_), blankLine1 = lineBreak1 && one.match(blanklineEndRegex_), blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);
1242
+ return blankLine1 || blankLine2 ? 5 : lineBreak1 || lineBreak2 ? 4 : nonAlphaNumeric1 && !whitespace1 && whitespace2 ? 3 : whitespace1 || whitespace2 ? 2 : nonAlphaNumeric1 || nonAlphaNumeric2 ? 1 : 0;
1243
+ }
1244
+ var NO_DIFF_MESSAGE = "Compared values have no visual difference.", SIMILAR_MESSAGE = "Compared values serialize to the same structure.\nPrinting internal object structure without calling `toJSON` instead.", build = {}, hasRequiredBuild;
1245
+ function requireBuild() {
1246
+ if (hasRequiredBuild) return build;
1247
+ hasRequiredBuild = 1, Object.defineProperty(build, "__esModule", {
1248
+ value: !0
1249
+ }), build.default = diffSequence;
1250
+ let pkg = "diff-sequences", NOT_YET_SET = 0, countCommonItemsF = (aIndex, aEnd, bIndex, bEnd, isCommon) => {
1251
+ let nCommon = 0;
1252
+ for (; aIndex < aEnd && bIndex < bEnd && isCommon(aIndex, bIndex); )
1253
+ aIndex += 1, bIndex += 1, nCommon += 1;
1254
+ return nCommon;
1255
+ }, countCommonItemsR = (aStart, aIndex, bStart, bIndex, isCommon) => {
1256
+ let nCommon = 0;
1257
+ for (; aStart <= aIndex && bStart <= bIndex && isCommon(aIndex, bIndex); )
1258
+ aIndex -= 1, bIndex -= 1, nCommon += 1;
1259
+ return nCommon;
1260
+ }, extendPathsF = (d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF) => {
1261
+ let iF = 0, kF = -d, aFirst = aIndexesF[iF], aIndexPrev1 = aFirst;
1262
+ aIndexesF[iF] += countCommonItemsF(
1263
+ aFirst + 1,
1264
+ aEnd,
1265
+ bF + aFirst - kF + 1,
1266
+ bEnd,
1267
+ isCommon
1268
+ );
1269
+ let nF = d < iMaxF ? d : iMaxF;
1270
+ for (iF += 1, kF += 2; iF <= nF; iF += 1, kF += 2) {
1271
+ if (iF !== d && aIndexPrev1 < aIndexesF[iF])
1272
+ aFirst = aIndexesF[iF];
1273
+ else if (aFirst = aIndexPrev1 + 1, aEnd <= aFirst)
1274
+ return iF - 1;
1275
+ aIndexPrev1 = aIndexesF[iF], aIndexesF[iF] = aFirst + countCommonItemsF(aFirst + 1, aEnd, bF + aFirst - kF + 1, bEnd, isCommon);
1276
+ }
1277
+ return iMaxF;
1278
+ }, extendPathsR = (d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR) => {
1279
+ let iR = 0, kR = d, aFirst = aIndexesR[iR], aIndexPrev1 = aFirst;
1280
+ aIndexesR[iR] -= countCommonItemsR(
1281
+ aStart,
1282
+ aFirst - 1,
1283
+ bStart,
1284
+ bR + aFirst - kR - 1,
1285
+ isCommon
1286
+ );
1287
+ let nR = d < iMaxR ? d : iMaxR;
1288
+ for (iR += 1, kR -= 2; iR <= nR; iR += 1, kR -= 2) {
1289
+ if (iR !== d && aIndexesR[iR] < aIndexPrev1)
1290
+ aFirst = aIndexesR[iR];
1291
+ else if (aFirst = aIndexPrev1 - 1, aFirst < aStart)
1292
+ return iR - 1;
1293
+ aIndexPrev1 = aIndexesR[iR], aIndexesR[iR] = aFirst - countCommonItemsR(
1294
+ aStart,
1295
+ aFirst - 1,
1296
+ bStart,
1297
+ bR + aFirst - kR - 1,
1298
+ isCommon
1299
+ );
1300
+ }
1301
+ return iMaxR;
1302
+ }, extendOverlappablePathsF = (d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division) => {
1303
+ let bF = bStart - aStart, aLength = aEnd - aStart, baDeltaLength = bEnd - bStart - aLength, kMinOverlapF = -baDeltaLength - (d - 1), kMaxOverlapF = -baDeltaLength + (d - 1), aIndexPrev1 = NOT_YET_SET, nF = d < iMaxF ? d : iMaxF;
1304
+ for (let iF = 0, kF = -d; iF <= nF; iF += 1, kF += 2) {
1305
+ let insert = iF === 0 || iF !== d && aIndexPrev1 < aIndexesF[iF], aLastPrev = insert ? aIndexesF[iF] : aIndexPrev1, aFirst = insert ? aLastPrev : aLastPrev + 1, bFirst = bF + aFirst - kF, nCommonF = countCommonItemsF(
1306
+ aFirst + 1,
1307
+ aEnd,
1308
+ bFirst + 1,
1309
+ bEnd,
1310
+ isCommon
1311
+ ), aLast = aFirst + nCommonF;
1312
+ if (aIndexPrev1 = aIndexesF[iF], aIndexesF[iF] = aLast, kMinOverlapF <= kF && kF <= kMaxOverlapF) {
1313
+ let iR = (d - 1 - (kF + baDeltaLength)) / 2;
1314
+ if (iR <= iMaxR && aIndexesR[iR] - 1 <= aLast) {
1315
+ let bLastPrev = bF + aLastPrev - (insert ? kF + 1 : kF - 1), nCommonR = countCommonItemsR(
1316
+ aStart,
1317
+ aLastPrev,
1318
+ bStart,
1319
+ bLastPrev,
1320
+ isCommon
1321
+ ), aIndexPrevFirst = aLastPrev - nCommonR, bIndexPrevFirst = bLastPrev - nCommonR, aEndPreceding = aIndexPrevFirst + 1, bEndPreceding = bIndexPrevFirst + 1;
1322
+ division.nChangePreceding = d - 1, d - 1 === aEndPreceding + bEndPreceding - aStart - bStart ? (division.aEndPreceding = aStart, division.bEndPreceding = bStart) : (division.aEndPreceding = aEndPreceding, division.bEndPreceding = bEndPreceding), division.nCommonPreceding = nCommonR, nCommonR !== 0 && (division.aCommonPreceding = aEndPreceding, division.bCommonPreceding = bEndPreceding), division.nCommonFollowing = nCommonF, nCommonF !== 0 && (division.aCommonFollowing = aFirst + 1, division.bCommonFollowing = bFirst + 1);
1323
+ let aStartFollowing = aLast + 1, bStartFollowing = bFirst + nCommonF + 1;
1324
+ return division.nChangeFollowing = d - 1, d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing ? (division.aStartFollowing = aEnd, division.bStartFollowing = bEnd) : (division.aStartFollowing = aStartFollowing, division.bStartFollowing = bStartFollowing), !0;
1325
+ }
1326
+ }
1327
+ }
1328
+ return !1;
1329
+ }, extendOverlappablePathsR = (d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division) => {
1330
+ let bR = bEnd - aEnd, aLength = aEnd - aStart, baDeltaLength = bEnd - bStart - aLength, kMinOverlapR = baDeltaLength - d, kMaxOverlapR = baDeltaLength + d, aIndexPrev1 = NOT_YET_SET, nR = d < iMaxR ? d : iMaxR;
1331
+ for (let iR = 0, kR = d; iR <= nR; iR += 1, kR -= 2) {
1332
+ let insert = iR === 0 || iR !== d && aIndexesR[iR] < aIndexPrev1, aLastPrev = insert ? aIndexesR[iR] : aIndexPrev1, aFirst = insert ? aLastPrev : aLastPrev - 1, bFirst = bR + aFirst - kR, nCommonR = countCommonItemsR(
1333
+ aStart,
1334
+ aFirst - 1,
1335
+ bStart,
1336
+ bFirst - 1,
1337
+ isCommon
1338
+ ), aLast = aFirst - nCommonR;
1339
+ if (aIndexPrev1 = aIndexesR[iR], aIndexesR[iR] = aLast, kMinOverlapR <= kR && kR <= kMaxOverlapR) {
1340
+ let iF = (d + (kR - baDeltaLength)) / 2;
1341
+ if (iF <= iMaxF && aLast - 1 <= aIndexesF[iF]) {
1342
+ let bLast = bFirst - nCommonR;
1343
+ if (division.nChangePreceding = d, d === aLast + bLast - aStart - bStart ? (division.aEndPreceding = aStart, division.bEndPreceding = bStart) : (division.aEndPreceding = aLast, division.bEndPreceding = bLast), division.nCommonPreceding = nCommonR, nCommonR !== 0 && (division.aCommonPreceding = aLast, division.bCommonPreceding = bLast), division.nChangeFollowing = d - 1, d === 1)
1344
+ division.nCommonFollowing = 0, division.aStartFollowing = aEnd, division.bStartFollowing = bEnd;
1345
+ else {
1346
+ let bLastPrev = bR + aLastPrev - (insert ? kR - 1 : kR + 1), nCommonF = countCommonItemsF(
1347
+ aLastPrev,
1348
+ aEnd,
1349
+ bLastPrev,
1350
+ bEnd,
1351
+ isCommon
1352
+ );
1353
+ division.nCommonFollowing = nCommonF, nCommonF !== 0 && (division.aCommonFollowing = aLastPrev, division.bCommonFollowing = bLastPrev);
1354
+ let aStartFollowing = aLastPrev + nCommonF, bStartFollowing = bLastPrev + nCommonF;
1355
+ d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing ? (division.aStartFollowing = aEnd, division.bStartFollowing = bEnd) : (division.aStartFollowing = aStartFollowing, division.bStartFollowing = bStartFollowing);
1356
+ }
1357
+ return !0;
1358
+ }
1359
+ }
1360
+ }
1361
+ return !1;
1362
+ }, divide = (nChange, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, aIndexesR, division) => {
1363
+ let bF = bStart - aStart, bR = bEnd - aEnd, aLength = aEnd - aStart, bLength = bEnd - bStart, baDeltaLength = bLength - aLength, iMaxF = aLength, iMaxR = aLength;
1364
+ if (aIndexesF[0] = aStart - 1, aIndexesR[0] = aEnd, baDeltaLength % 2 === 0) {
1365
+ let dMin = (nChange || baDeltaLength) / 2, dMax = (aLength + bLength) / 2;
1366
+ for (let d = 1; d <= dMax; d += 1)
1367
+ if (iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF), d < dMin)
1368
+ iMaxR = extendPathsR(d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR);
1369
+ else if (
1370
+ // If a reverse path overlaps a forward path in the same diagonal,
1371
+ // return a division of the index intervals at the middle change.
1372
+ extendOverlappablePathsR(
1373
+ d,
1374
+ aStart,
1375
+ aEnd,
1376
+ bStart,
1377
+ bEnd,
1378
+ isCommon,
1379
+ aIndexesF,
1380
+ iMaxF,
1381
+ aIndexesR,
1382
+ iMaxR,
1383
+ division
1384
+ )
1385
+ )
1386
+ return;
1387
+ } else {
1388
+ let dMin = ((nChange || baDeltaLength) + 1) / 2, dMax = (aLength + bLength + 1) / 2, d = 1;
1389
+ for (iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF), d += 1; d <= dMax; d += 1)
1390
+ if (iMaxR = extendPathsR(
1391
+ d - 1,
1392
+ aStart,
1393
+ bStart,
1394
+ bR,
1395
+ isCommon,
1396
+ aIndexesR,
1397
+ iMaxR
1398
+ ), d < dMin)
1399
+ iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
1400
+ else if (
1401
+ // If a forward path overlaps a reverse path in the same diagonal,
1402
+ // return a division of the index intervals at the middle change.
1403
+ extendOverlappablePathsF(
1404
+ d,
1405
+ aStart,
1406
+ aEnd,
1407
+ bStart,
1408
+ bEnd,
1409
+ isCommon,
1410
+ aIndexesF,
1411
+ iMaxF,
1412
+ aIndexesR,
1413
+ iMaxR,
1414
+ division
1415
+ )
1416
+ )
1417
+ return;
1418
+ }
1419
+ throw new Error(
1420
+ `${pkg}: no overlap aStart=${aStart} aEnd=${aEnd} bStart=${bStart} bEnd=${bEnd}`
1421
+ );
1422
+ }, findSubsequences = (nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division) => {
1423
+ if (bEnd - bStart < aEnd - aStart) {
1424
+ if (transposed = !transposed, transposed && callbacks.length === 1) {
1425
+ let { foundSubsequence: foundSubsequence2, isCommon: isCommon2 } = callbacks[0];
1426
+ callbacks[1] = {
1427
+ foundSubsequence: (nCommon, bCommon, aCommon) => {
1428
+ foundSubsequence2(nCommon, aCommon, bCommon);
1429
+ },
1430
+ isCommon: (bIndex, aIndex) => isCommon2(aIndex, bIndex)
1431
+ };
1432
+ }
1433
+ let tStart = aStart, tEnd = aEnd;
1434
+ aStart = bStart, aEnd = bEnd, bStart = tStart, bEnd = tEnd;
1435
+ }
1436
+ let { foundSubsequence, isCommon } = callbacks[transposed ? 1 : 0];
1437
+ divide(
1438
+ nChange,
1439
+ aStart,
1440
+ aEnd,
1441
+ bStart,
1442
+ bEnd,
1443
+ isCommon,
1444
+ aIndexesF,
1445
+ aIndexesR,
1446
+ division
1447
+ );
1448
+ let {
1449
+ nChangePreceding,
1450
+ aEndPreceding,
1451
+ bEndPreceding,
1452
+ nCommonPreceding,
1453
+ aCommonPreceding,
1454
+ bCommonPreceding,
1455
+ nCommonFollowing,
1456
+ aCommonFollowing,
1457
+ bCommonFollowing,
1458
+ nChangeFollowing,
1459
+ aStartFollowing,
1460
+ bStartFollowing
1461
+ } = division;
1462
+ aStart < aEndPreceding && bStart < bEndPreceding && findSubsequences(
1463
+ nChangePreceding,
1464
+ aStart,
1465
+ aEndPreceding,
1466
+ bStart,
1467
+ bEndPreceding,
1468
+ transposed,
1469
+ callbacks,
1470
+ aIndexesF,
1471
+ aIndexesR,
1472
+ division
1473
+ ), nCommonPreceding !== 0 && foundSubsequence(nCommonPreceding, aCommonPreceding, bCommonPreceding), nCommonFollowing !== 0 && foundSubsequence(nCommonFollowing, aCommonFollowing, bCommonFollowing), aStartFollowing < aEnd && bStartFollowing < bEnd && findSubsequences(
1474
+ nChangeFollowing,
1475
+ aStartFollowing,
1476
+ aEnd,
1477
+ bStartFollowing,
1478
+ bEnd,
1479
+ transposed,
1480
+ callbacks,
1481
+ aIndexesF,
1482
+ aIndexesR,
1483
+ division
1484
+ );
1485
+ }, validateLength = (name, arg) => {
1486
+ if (typeof arg != "number")
1487
+ throw new TypeError(`${pkg}: ${name} typeof ${typeof arg} is not a number`);
1488
+ if (!Number.isSafeInteger(arg))
1489
+ throw new RangeError(`${pkg}: ${name} value ${arg} is not a safe integer`);
1490
+ if (arg < 0)
1491
+ throw new RangeError(`${pkg}: ${name} value ${arg} is a negative integer`);
1492
+ }, validateCallback = (name, arg) => {
1493
+ let type = typeof arg;
1494
+ if (type !== "function")
1495
+ throw new TypeError(`${pkg}: ${name} typeof ${type} is not a function`);
1496
+ };
1497
+ function diffSequence(aLength, bLength, isCommon, foundSubsequence) {
1498
+ validateLength("aLength", aLength), validateLength("bLength", bLength), validateCallback("isCommon", isCommon), validateCallback("foundSubsequence", foundSubsequence);
1499
+ let nCommonF = countCommonItemsF(0, aLength, 0, bLength, isCommon);
1500
+ if (nCommonF !== 0 && foundSubsequence(nCommonF, 0, 0), aLength !== nCommonF || bLength !== nCommonF) {
1501
+ let aStart = nCommonF, bStart = nCommonF, nCommonR = countCommonItemsR(
1502
+ aStart,
1503
+ aLength - 1,
1504
+ bStart,
1505
+ bLength - 1,
1506
+ isCommon
1507
+ ), aEnd = aLength - nCommonR, bEnd = bLength - nCommonR, nCommonFR = nCommonF + nCommonR;
1508
+ aLength !== nCommonFR && bLength !== nCommonFR && findSubsequences(
1509
+ 0,
1510
+ aStart,
1511
+ aEnd,
1512
+ bStart,
1513
+ bEnd,
1514
+ !1,
1515
+ [
1516
+ {
1517
+ foundSubsequence,
1518
+ isCommon
1519
+ }
1520
+ ],
1521
+ [NOT_YET_SET],
1522
+ [NOT_YET_SET],
1523
+ {
1524
+ aCommonFollowing: NOT_YET_SET,
1525
+ aCommonPreceding: NOT_YET_SET,
1526
+ aEndPreceding: NOT_YET_SET,
1527
+ aStartFollowing: NOT_YET_SET,
1528
+ bCommonFollowing: NOT_YET_SET,
1529
+ bCommonPreceding: NOT_YET_SET,
1530
+ bEndPreceding: NOT_YET_SET,
1531
+ bStartFollowing: NOT_YET_SET,
1532
+ nChangeFollowing: NOT_YET_SET,
1533
+ nChangePreceding: NOT_YET_SET,
1534
+ nCommonFollowing: NOT_YET_SET,
1535
+ nCommonPreceding: NOT_YET_SET
1536
+ }
1537
+ ), nCommonR !== 0 && foundSubsequence(nCommonR, aEnd, bEnd);
1538
+ }
1539
+ }
1540
+ return build;
1541
+ }
1542
+ var buildExports = requireBuild(), diffSequences = getDefaultExportFromCjs2(buildExports);
1543
+ function formatTrailingSpaces(line, trailingSpaceFormatter) {
1544
+ return line.replace(/\s+$/, (match) => trailingSpaceFormatter(match));
1545
+ }
1546
+ function printDiffLine(line, isFirstOrLast, color, indicator, trailingSpaceFormatter, emptyFirstOrLastLinePlaceholder) {
1547
+ return line.length !== 0 ? color(`${indicator} ${formatTrailingSpaces(line, trailingSpaceFormatter)}`) : indicator !== " " ? color(indicator) : isFirstOrLast && emptyFirstOrLastLinePlaceholder.length !== 0 ? color(`${indicator} ${emptyFirstOrLastLinePlaceholder}`) : "";
1548
+ }
1549
+ function printDeleteLine(line, isFirstOrLast, { aColor, aIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder }) {
1550
+ return printDiffLine(line, isFirstOrLast, aColor, aIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
1551
+ }
1552
+ function printInsertLine(line, isFirstOrLast, { bColor, bIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder }) {
1553
+ return printDiffLine(line, isFirstOrLast, bColor, bIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
1554
+ }
1555
+ function printCommonLine(line, isFirstOrLast, { commonColor, commonIndicator, commonLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder }) {
1556
+ return printDiffLine(line, isFirstOrLast, commonColor, commonIndicator, commonLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
1557
+ }
1558
+ function createPatchMark(aStart, aEnd, bStart, bEnd, { patchColor }) {
1559
+ return patchColor(`@@ -${aStart + 1},${aEnd - aStart} +${bStart + 1},${bEnd - bStart} @@`);
1560
+ }
1561
+ function joinAlignedDiffsNoExpand(diffs, options) {
1562
+ let iLength = diffs.length, nContextLines = options.contextLines, nContextLines2 = nContextLines + nContextLines, jLength = iLength, hasExcessAtStartOrEnd = !1, nExcessesBetweenChanges = 0, i = 0;
1563
+ for (; i !== iLength; ) {
1564
+ let iStart = i;
1565
+ for (; i !== iLength && diffs[i][0] === DIFF_EQUAL; )
1566
+ i += 1;
1567
+ if (iStart !== i)
1568
+ if (iStart === 0)
1569
+ i > nContextLines && (jLength -= i - nContextLines, hasExcessAtStartOrEnd = !0);
1570
+ else if (i === iLength) {
1571
+ let n = i - iStart;
1572
+ n > nContextLines && (jLength -= n - nContextLines, hasExcessAtStartOrEnd = !0);
1573
+ } else {
1574
+ let n = i - iStart;
1575
+ n > nContextLines2 && (jLength -= n - nContextLines2, nExcessesBetweenChanges += 1);
1576
+ }
1577
+ for (; i !== iLength && diffs[i][0] !== DIFF_EQUAL; )
1578
+ i += 1;
1579
+ }
1580
+ let hasPatch = nExcessesBetweenChanges !== 0 || hasExcessAtStartOrEnd;
1581
+ nExcessesBetweenChanges !== 0 ? jLength += nExcessesBetweenChanges + 1 : hasExcessAtStartOrEnd && (jLength += 1);
1582
+ let jLast = jLength - 1, lines = [], jPatchMark = 0;
1583
+ hasPatch && lines.push("");
1584
+ let aStart = 0, bStart = 0, aEnd = 0, bEnd = 0, pushCommonLine = (line) => {
1585
+ let j = lines.length;
1586
+ lines.push(printCommonLine(line, j === 0 || j === jLast, options)), aEnd += 1, bEnd += 1;
1587
+ }, pushDeleteLine = (line) => {
1588
+ let j = lines.length;
1589
+ lines.push(printDeleteLine(line, j === 0 || j === jLast, options)), aEnd += 1;
1590
+ }, pushInsertLine = (line) => {
1591
+ let j = lines.length;
1592
+ lines.push(printInsertLine(line, j === 0 || j === jLast, options)), bEnd += 1;
1593
+ };
1594
+ for (i = 0; i !== iLength; ) {
1595
+ let iStart = i;
1596
+ for (; i !== iLength && diffs[i][0] === DIFF_EQUAL; )
1597
+ i += 1;
1598
+ if (iStart !== i)
1599
+ if (iStart === 0) {
1600
+ i > nContextLines && (iStart = i - nContextLines, aStart = iStart, bStart = iStart, aEnd = aStart, bEnd = bStart);
1601
+ for (let iCommon = iStart; iCommon !== i; iCommon += 1)
1602
+ pushCommonLine(diffs[iCommon][1]);
1603
+ } else if (i === iLength) {
1604
+ let iEnd = i - iStart > nContextLines ? iStart + nContextLines : i;
1605
+ for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1)
1606
+ pushCommonLine(diffs[iCommon][1]);
1607
+ } else {
1608
+ let nCommon = i - iStart;
1609
+ if (nCommon > nContextLines2) {
1610
+ let iEnd = iStart + nContextLines;
1611
+ for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1)
1612
+ pushCommonLine(diffs[iCommon][1]);
1613
+ lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options), jPatchMark = lines.length, lines.push("");
1614
+ let nOmit = nCommon - nContextLines2;
1615
+ aStart = aEnd + nOmit, bStart = bEnd + nOmit, aEnd = aStart, bEnd = bStart;
1616
+ for (let iCommon = i - nContextLines; iCommon !== i; iCommon += 1)
1617
+ pushCommonLine(diffs[iCommon][1]);
1618
+ } else
1619
+ for (let iCommon = iStart; iCommon !== i; iCommon += 1)
1620
+ pushCommonLine(diffs[iCommon][1]);
1621
+ }
1622
+ for (; i !== iLength && diffs[i][0] === DIFF_DELETE; )
1623
+ pushDeleteLine(diffs[i][1]), i += 1;
1624
+ for (; i !== iLength && diffs[i][0] === DIFF_INSERT; )
1625
+ pushInsertLine(diffs[i][1]), i += 1;
1626
+ }
1627
+ return hasPatch && (lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options)), lines.join(`
1628
+ `);
1629
+ }
1630
+ function joinAlignedDiffsExpand(diffs, options) {
1631
+ return diffs.map((diff2, i, diffs2) => {
1632
+ let line = diff2[1], isFirstOrLast = i === 0 || i === diffs2.length - 1;
1633
+ switch (diff2[0]) {
1634
+ case DIFF_DELETE:
1635
+ return printDeleteLine(line, isFirstOrLast, options);
1636
+ case DIFF_INSERT:
1637
+ return printInsertLine(line, isFirstOrLast, options);
1638
+ default:
1639
+ return printCommonLine(line, isFirstOrLast, options);
1640
+ }
1641
+ }).join(`
1642
+ `);
1643
+ }
1644
+ var noColor = (string) => string, DIFF_CONTEXT_DEFAULT = 5, DIFF_TRUNCATE_THRESHOLD_DEFAULT = 0;
1645
+ function getDefaultOptions() {
1646
+ return {
1647
+ aAnnotation: "Expected",
1648
+ aColor: s2.green,
1649
+ aIndicator: "-",
1650
+ bAnnotation: "Received",
1651
+ bColor: s2.red,
1652
+ bIndicator: "+",
1653
+ changeColor: s2.inverse,
1654
+ changeLineTrailingSpaceColor: noColor,
1655
+ commonColor: s2.dim,
1656
+ commonIndicator: " ",
1657
+ commonLineTrailingSpaceColor: noColor,
1658
+ compareKeys: void 0,
1659
+ contextLines: DIFF_CONTEXT_DEFAULT,
1660
+ emptyFirstOrLastLinePlaceholder: "",
1661
+ expand: !1,
1662
+ includeChangeCounts: !1,
1663
+ omitAnnotationLines: !1,
1664
+ patchColor: s2.yellow,
1665
+ printBasicPrototype: !1,
1666
+ truncateThreshold: DIFF_TRUNCATE_THRESHOLD_DEFAULT,
1667
+ truncateAnnotation: "... Diff result is truncated",
1668
+ truncateAnnotationColor: noColor
1669
+ };
1670
+ }
1671
+ function getCompareKeys(compareKeys) {
1672
+ return compareKeys && typeof compareKeys == "function" ? compareKeys : void 0;
1673
+ }
1674
+ function getContextLines(contextLines) {
1675
+ return typeof contextLines == "number" && Number.isSafeInteger(contextLines) && contextLines >= 0 ? contextLines : DIFF_CONTEXT_DEFAULT;
1676
+ }
1677
+ function normalizeDiffOptions(options = {}) {
1678
+ return {
1679
+ ...getDefaultOptions(),
1680
+ ...options,
1681
+ compareKeys: getCompareKeys(options.compareKeys),
1682
+ contextLines: getContextLines(options.contextLines)
1683
+ };
1684
+ }
1685
+ function isEmptyString(lines) {
1686
+ return lines.length === 1 && lines[0].length === 0;
1687
+ }
1688
+ function countChanges(diffs) {
1689
+ let a3 = 0, b = 0;
1690
+ return diffs.forEach((diff2) => {
1691
+ switch (diff2[0]) {
1692
+ case DIFF_DELETE:
1693
+ a3 += 1;
1694
+ break;
1695
+ case DIFF_INSERT:
1696
+ b += 1;
1697
+ break;
1698
+ }
1699
+ }), {
1700
+ a: a3,
1701
+ b
1702
+ };
1703
+ }
1704
+ function printAnnotation({ aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator, includeChangeCounts, omitAnnotationLines }, changeCounts) {
1705
+ if (omitAnnotationLines)
1706
+ return "";
1707
+ let aRest = "", bRest = "";
1708
+ if (includeChangeCounts) {
1709
+ let aCount = String(changeCounts.a), bCount = String(changeCounts.b), baAnnotationLengthDiff = bAnnotation.length - aAnnotation.length, aAnnotationPadding = " ".repeat(Math.max(0, baAnnotationLengthDiff)), bAnnotationPadding = " ".repeat(Math.max(0, -baAnnotationLengthDiff)), baCountLengthDiff = bCount.length - aCount.length, aCountPadding = " ".repeat(Math.max(0, baCountLengthDiff)), bCountPadding = " ".repeat(Math.max(0, -baCountLengthDiff));
1710
+ aRest = `${aAnnotationPadding} ${aIndicator} ${aCountPadding}${aCount}`, bRest = `${bAnnotationPadding} ${bIndicator} ${bCountPadding}${bCount}`;
1711
+ }
1712
+ let a3 = `${aIndicator} ${aAnnotation}${aRest}`, b = `${bIndicator} ${bAnnotation}${bRest}`;
1713
+ return `${aColor(a3)}
1714
+ ${bColor(b)}
1715
+
1716
+ `;
1717
+ }
1718
+ function printDiffLines(diffs, truncated, options) {
1719
+ return printAnnotation(options, countChanges(diffs)) + (options.expand ? joinAlignedDiffsExpand(diffs, options) : joinAlignedDiffsNoExpand(diffs, options)) + (truncated ? options.truncateAnnotationColor(`
1720
+ ${options.truncateAnnotation}`) : "");
1721
+ }
1722
+ function diffLinesUnified(aLines, bLines, options) {
1723
+ let normalizedOptions = normalizeDiffOptions(options), [diffs, truncated] = diffLinesRaw(isEmptyString(aLines) ? [] : aLines, isEmptyString(bLines) ? [] : bLines, normalizedOptions);
1724
+ return printDiffLines(diffs, truncated, normalizedOptions);
1725
+ }
1726
+ function diffLinesUnified2(aLinesDisplay, bLinesDisplay, aLinesCompare, bLinesCompare, options) {
1727
+ if (isEmptyString(aLinesDisplay) && isEmptyString(aLinesCompare) && (aLinesDisplay = [], aLinesCompare = []), isEmptyString(bLinesDisplay) && isEmptyString(bLinesCompare) && (bLinesDisplay = [], bLinesCompare = []), aLinesDisplay.length !== aLinesCompare.length || bLinesDisplay.length !== bLinesCompare.length)
1728
+ return diffLinesUnified(aLinesDisplay, bLinesDisplay, options);
1729
+ let [diffs, truncated] = diffLinesRaw(aLinesCompare, bLinesCompare, options), aIndex = 0, bIndex = 0;
1730
+ return diffs.forEach((diff2) => {
1731
+ switch (diff2[0]) {
1732
+ case DIFF_DELETE:
1733
+ diff2[1] = aLinesDisplay[aIndex], aIndex += 1;
1734
+ break;
1735
+ case DIFF_INSERT:
1736
+ diff2[1] = bLinesDisplay[bIndex], bIndex += 1;
1737
+ break;
1738
+ default:
1739
+ diff2[1] = bLinesDisplay[bIndex], aIndex += 1, bIndex += 1;
1740
+ }
1741
+ }), printDiffLines(diffs, truncated, normalizeDiffOptions(options));
1742
+ }
1743
+ function diffLinesRaw(aLines, bLines, options) {
1744
+ let truncate = options?.truncateThreshold ?? !1, truncateThreshold = Math.max(Math.floor(options?.truncateThreshold ?? 0), 0), aLength = truncate ? Math.min(aLines.length, truncateThreshold) : aLines.length, bLength = truncate ? Math.min(bLines.length, truncateThreshold) : bLines.length, truncated = aLength !== aLines.length || bLength !== bLines.length, isCommon = (aIndex2, bIndex2) => aLines[aIndex2] === bLines[bIndex2], diffs = [], aIndex = 0, bIndex = 0;
1745
+ for (diffSequences(aLength, bLength, isCommon, (nCommon, aCommon, bCommon) => {
1746
+ for (; aIndex !== aCommon; aIndex += 1)
1747
+ diffs.push(new Diff(DIFF_DELETE, aLines[aIndex]));
1748
+ for (; bIndex !== bCommon; bIndex += 1)
1749
+ diffs.push(new Diff(DIFF_INSERT, bLines[bIndex]));
1750
+ for (; nCommon !== 0; nCommon -= 1, aIndex += 1, bIndex += 1)
1751
+ diffs.push(new Diff(DIFF_EQUAL, bLines[bIndex]));
1752
+ }); aIndex !== aLength; aIndex += 1)
1753
+ diffs.push(new Diff(DIFF_DELETE, aLines[aIndex]));
1754
+ for (; bIndex !== bLength; bIndex += 1)
1755
+ diffs.push(new Diff(DIFF_INSERT, bLines[bIndex]));
1756
+ return [diffs, truncated];
1757
+ }
1758
+ function getType3(value) {
1759
+ if (value === void 0)
1760
+ return "undefined";
1761
+ if (value === null)
1762
+ return "null";
1763
+ if (Array.isArray(value))
1764
+ return "array";
1765
+ if (typeof value == "boolean")
1766
+ return "boolean";
1767
+ if (typeof value == "function")
1768
+ return "function";
1769
+ if (typeof value == "number")
1770
+ return "number";
1771
+ if (typeof value == "string")
1772
+ return "string";
1773
+ if (typeof value == "bigint")
1774
+ return "bigint";
1775
+ if (typeof value == "object") {
1776
+ if (value != null) {
1777
+ if (value.constructor === RegExp)
1778
+ return "regexp";
1779
+ if (value.constructor === Map)
1780
+ return "map";
1781
+ if (value.constructor === Set)
1782
+ return "set";
1783
+ if (value.constructor === Date)
1784
+ return "date";
1785
+ }
1786
+ return "object";
1787
+ } else if (typeof value == "symbol")
1788
+ return "symbol";
1789
+ throw new Error(`value of unknown type: ${value}`);
1790
+ }
1791
+ function getNewLineSymbol(string) {
1792
+ return string.includes(`\r
1793
+ `) ? `\r
1794
+ ` : `
1795
+ `;
1796
+ }
1797
+ function diffStrings(a3, b, options) {
1798
+ let truncate = options?.truncateThreshold ?? !1, truncateThreshold = Math.max(Math.floor(options?.truncateThreshold ?? 0), 0), aLength = a3.length, bLength = b.length;
1799
+ if (truncate) {
1800
+ let aMultipleLines = a3.includes(`
1801
+ `), bMultipleLines = b.includes(`
1802
+ `), aNewLineSymbol = getNewLineSymbol(a3), bNewLineSymbol = getNewLineSymbol(b), _a = aMultipleLines ? `${a3.split(aNewLineSymbol, truncateThreshold).join(aNewLineSymbol)}
1803
+ ` : a3, _b = bMultipleLines ? `${b.split(bNewLineSymbol, truncateThreshold).join(bNewLineSymbol)}
1804
+ ` : b;
1805
+ aLength = _a.length, bLength = _b.length;
1806
+ }
1807
+ let truncated = aLength !== a3.length || bLength !== b.length, isCommon = (aIndex2, bIndex2) => a3[aIndex2] === b[bIndex2], aIndex = 0, bIndex = 0, diffs = [];
1808
+ return diffSequences(aLength, bLength, isCommon, (nCommon, aCommon, bCommon) => {
1809
+ aIndex !== aCommon && diffs.push(new Diff(DIFF_DELETE, a3.slice(aIndex, aCommon))), bIndex !== bCommon && diffs.push(new Diff(DIFF_INSERT, b.slice(bIndex, bCommon))), aIndex = aCommon + nCommon, bIndex = bCommon + nCommon, diffs.push(new Diff(DIFF_EQUAL, b.slice(bCommon, bIndex)));
1810
+ }), aIndex !== aLength && diffs.push(new Diff(DIFF_DELETE, a3.slice(aIndex))), bIndex !== bLength && diffs.push(new Diff(DIFF_INSERT, b.slice(bIndex))), [diffs, truncated];
1811
+ }
1812
+ function concatenateRelevantDiffs(op, diffs, changeColor) {
1813
+ return diffs.reduce((reduced, diff2) => reduced + (diff2[0] === DIFF_EQUAL ? diff2[1] : diff2[0] === op && diff2[1].length !== 0 ? changeColor(diff2[1]) : ""), "");
1814
+ }
1815
+ var ChangeBuffer = class {
1816
+ op;
1817
+ line;
1818
+ lines;
1819
+ changeColor;
1820
+ constructor(op, changeColor) {
1821
+ this.op = op, this.line = [], this.lines = [], this.changeColor = changeColor;
1822
+ }
1823
+ pushSubstring(substring) {
1824
+ this.pushDiff(new Diff(this.op, substring));
1825
+ }
1826
+ pushLine() {
1827
+ this.lines.push(this.line.length !== 1 ? new Diff(this.op, concatenateRelevantDiffs(this.op, this.line, this.changeColor)) : this.line[0][0] === this.op ? this.line[0] : new Diff(this.op, this.line[0][1])), this.line.length = 0;
1828
+ }
1829
+ isLineEmpty() {
1830
+ return this.line.length === 0;
1831
+ }
1832
+ // Minor input to buffer.
1833
+ pushDiff(diff2) {
1834
+ this.line.push(diff2);
1835
+ }
1836
+ // Main input to buffer.
1837
+ align(diff2) {
1838
+ let string = diff2[1];
1839
+ if (string.includes(`
1840
+ `)) {
1841
+ let substrings = string.split(`
1842
+ `), iLast = substrings.length - 1;
1843
+ substrings.forEach((substring, i) => {
1844
+ i < iLast ? (this.pushSubstring(substring), this.pushLine()) : substring.length !== 0 && this.pushSubstring(substring);
1845
+ });
1846
+ } else
1847
+ this.pushDiff(diff2);
1848
+ }
1849
+ // Output from buffer.
1850
+ moveLinesTo(lines) {
1851
+ this.isLineEmpty() || this.pushLine(), lines.push(...this.lines), this.lines.length = 0;
1852
+ }
1853
+ }, CommonBuffer = class {
1854
+ deleteBuffer;
1855
+ insertBuffer;
1856
+ lines;
1857
+ constructor(deleteBuffer, insertBuffer) {
1858
+ this.deleteBuffer = deleteBuffer, this.insertBuffer = insertBuffer, this.lines = [];
1859
+ }
1860
+ pushDiffCommonLine(diff2) {
1861
+ this.lines.push(diff2);
1862
+ }
1863
+ pushDiffChangeLines(diff2) {
1864
+ let isDiffEmpty = diff2[1].length === 0;
1865
+ (!isDiffEmpty || this.deleteBuffer.isLineEmpty()) && this.deleteBuffer.pushDiff(diff2), (!isDiffEmpty || this.insertBuffer.isLineEmpty()) && this.insertBuffer.pushDiff(diff2);
1866
+ }
1867
+ flushChangeLines() {
1868
+ this.deleteBuffer.moveLinesTo(this.lines), this.insertBuffer.moveLinesTo(this.lines);
1869
+ }
1870
+ // Input to buffer.
1871
+ align(diff2) {
1872
+ let op = diff2[0], string = diff2[1];
1873
+ if (string.includes(`
1874
+ `)) {
1875
+ let substrings = string.split(`
1876
+ `), iLast = substrings.length - 1;
1877
+ substrings.forEach((substring, i) => {
1878
+ if (i === 0) {
1879
+ let subdiff = new Diff(op, substring);
1880
+ this.deleteBuffer.isLineEmpty() && this.insertBuffer.isLineEmpty() ? (this.flushChangeLines(), this.pushDiffCommonLine(subdiff)) : (this.pushDiffChangeLines(subdiff), this.flushChangeLines());
1881
+ } else i < iLast ? this.pushDiffCommonLine(new Diff(op, substring)) : substring.length !== 0 && this.pushDiffChangeLines(new Diff(op, substring));
1882
+ });
1883
+ } else
1884
+ this.pushDiffChangeLines(diff2);
1885
+ }
1886
+ // Output from buffer.
1887
+ getLines() {
1888
+ return this.flushChangeLines(), this.lines;
1889
+ }
1890
+ };
1891
+ function getAlignedDiffs(diffs, changeColor) {
1892
+ let deleteBuffer = new ChangeBuffer(DIFF_DELETE, changeColor), insertBuffer = new ChangeBuffer(DIFF_INSERT, changeColor), commonBuffer = new CommonBuffer(deleteBuffer, insertBuffer);
1893
+ return diffs.forEach((diff2) => {
1894
+ switch (diff2[0]) {
1895
+ case DIFF_DELETE:
1896
+ deleteBuffer.align(diff2);
1897
+ break;
1898
+ case DIFF_INSERT:
1899
+ insertBuffer.align(diff2);
1900
+ break;
1901
+ default:
1902
+ commonBuffer.align(diff2);
1903
+ }
1904
+ }), commonBuffer.getLines();
1905
+ }
1906
+ function hasCommonDiff(diffs, isMultiline) {
1907
+ if (isMultiline) {
1908
+ let iLast = diffs.length - 1;
1909
+ return diffs.some((diff2, i) => diff2[0] === DIFF_EQUAL && (i !== iLast || diff2[1] !== `
1910
+ `));
1911
+ }
1912
+ return diffs.some((diff2) => diff2[0] === DIFF_EQUAL);
1913
+ }
1914
+ function diffStringsUnified(a3, b, options) {
1915
+ if (a3 !== b && a3.length !== 0 && b.length !== 0) {
1916
+ let isMultiline = a3.includes(`
1917
+ `) || b.includes(`
1918
+ `), [diffs, truncated] = diffStringsRaw(isMultiline ? `${a3}
1919
+ ` : a3, isMultiline ? `${b}
1920
+ ` : b, !0, options);
1921
+ if (hasCommonDiff(diffs, isMultiline)) {
1922
+ let optionsNormalized = normalizeDiffOptions(options), lines = getAlignedDiffs(diffs, optionsNormalized.changeColor);
1923
+ return printDiffLines(lines, truncated, optionsNormalized);
1924
+ }
1925
+ }
1926
+ return diffLinesUnified(a3.split(`
1927
+ `), b.split(`
1928
+ `), options);
1929
+ }
1930
+ function diffStringsRaw(a3, b, cleanup, options) {
1931
+ let [diffs, truncated] = diffStrings(a3, b, options);
1932
+ return cleanup && diff_cleanupSemantic(diffs), [diffs, truncated];
1933
+ }
1934
+ function getCommonMessage(message, options) {
1935
+ let { commonColor } = normalizeDiffOptions(options);
1936
+ return commonColor(message);
1937
+ }
1938
+ var { AsymmetricMatcher: AsymmetricMatcher2, DOMCollection: DOMCollection2, DOMElement: DOMElement2, Immutable: Immutable2, ReactElement: ReactElement2, ReactTestComponent: ReactTestComponent2 } = plugins, PLUGINS2 = [
1939
+ ReactTestComponent2,
1940
+ ReactElement2,
1941
+ DOMElement2,
1942
+ DOMCollection2,
1943
+ Immutable2,
1944
+ AsymmetricMatcher2,
1945
+ plugins.Error
1946
+ ], FORMAT_OPTIONS = {
1947
+ maxDepth: 20,
1948
+ plugins: PLUGINS2
1949
+ }, FALLBACK_FORMAT_OPTIONS = {
1950
+ callToJSON: !1,
1951
+ maxDepth: 8,
1952
+ plugins: PLUGINS2
1953
+ };
1954
+ function diff(a3, b, options) {
1955
+ if (Object.is(a3, b))
1956
+ return "";
1957
+ let aType = getType3(a3), expectedType = aType, omitDifference = !1;
1958
+ if (aType === "object" && typeof a3.asymmetricMatch == "function") {
1959
+ if (a3.$$typeof !== /* @__PURE__ */ Symbol.for("jest.asymmetricMatcher") || typeof a3.getExpectedType != "function")
1960
+ return;
1961
+ expectedType = a3.getExpectedType(), omitDifference = expectedType === "string";
1962
+ }
1963
+ if (expectedType !== getType3(b)) {
1964
+ let truncate = function(s3) {
1965
+ return s3.length <= MAX_LENGTH ? s3 : `${s3.slice(0, MAX_LENGTH)}...`;
1966
+ }, { aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator } = normalizeDiffOptions(options), formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options), aDisplay = format(a3, formatOptions), bDisplay = format(b, formatOptions), MAX_LENGTH = 1e5;
1967
+ aDisplay = truncate(aDisplay), bDisplay = truncate(bDisplay);
1968
+ let aDiff = `${aColor(`${aIndicator} ${aAnnotation}:`)}
1969
+ ${aDisplay}`, bDiff = `${bColor(`${bIndicator} ${bAnnotation}:`)}
1970
+ ${bDisplay}`;
1971
+ return `${aDiff}
1972
+
1973
+ ${bDiff}`;
1974
+ }
1975
+ if (!omitDifference)
1976
+ switch (aType) {
1977
+ case "string":
1978
+ return diffLinesUnified(a3.split(`
1979
+ `), b.split(`
1980
+ `), options);
1981
+ case "boolean":
1982
+ case "number":
1983
+ return comparePrimitive(a3, b, options);
1984
+ case "map":
1985
+ return compareObjects(sortMap(a3), sortMap(b), options);
1986
+ case "set":
1987
+ return compareObjects(sortSet(a3), sortSet(b), options);
1988
+ default:
1989
+ return compareObjects(a3, b, options);
1990
+ }
1991
+ }
1992
+ function comparePrimitive(a3, b, options) {
1993
+ let aFormat = format(a3, FORMAT_OPTIONS), bFormat = format(b, FORMAT_OPTIONS);
1994
+ return aFormat === bFormat ? "" : diffLinesUnified(aFormat.split(`
1995
+ `), bFormat.split(`
1996
+ `), options);
1997
+ }
1998
+ function sortMap(map) {
1999
+ return new Map(Array.from(map.entries()).sort());
2000
+ }
2001
+ function sortSet(set) {
2002
+ return new Set(Array.from(set.values()).sort());
2003
+ }
2004
+ function compareObjects(a3, b, options) {
2005
+ let difference, hasThrown = !1;
2006
+ try {
2007
+ let formatOptions = getFormatOptions(FORMAT_OPTIONS, options);
2008
+ difference = getObjectsDifference(a3, b, formatOptions, options);
2009
+ } catch {
2010
+ hasThrown = !0;
2011
+ }
2012
+ let noDiffMessage = getCommonMessage(NO_DIFF_MESSAGE, options);
2013
+ if (difference === void 0 || difference === noDiffMessage) {
2014
+ let formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
2015
+ difference = getObjectsDifference(a3, b, formatOptions, options), difference !== noDiffMessage && !hasThrown && (difference = `${getCommonMessage(SIMILAR_MESSAGE, options)}
2016
+
2017
+ ${difference}`);
2018
+ }
2019
+ return difference;
2020
+ }
2021
+ function getFormatOptions(formatOptions, options) {
2022
+ let { compareKeys, printBasicPrototype, maxDepth } = normalizeDiffOptions(options);
2023
+ return {
2024
+ ...formatOptions,
2025
+ compareKeys,
2026
+ printBasicPrototype,
2027
+ maxDepth: maxDepth ?? formatOptions.maxDepth
2028
+ };
2029
+ }
2030
+ function getObjectsDifference(a3, b, formatOptions, options) {
2031
+ let formatOptionsZeroIndent = {
2032
+ ...formatOptions,
2033
+ indent: 0
2034
+ }, aCompare = format(a3, formatOptionsZeroIndent), bCompare = format(b, formatOptionsZeroIndent);
2035
+ if (aCompare === bCompare)
2036
+ return getCommonMessage(NO_DIFF_MESSAGE, options);
2037
+ {
2038
+ let aDisplay = format(a3, formatOptions), bDisplay = format(b, formatOptions);
2039
+ return diffLinesUnified2(aDisplay.split(`
2040
+ `), bDisplay.split(`
2041
+ `), aCompare.split(`
2042
+ `), bCompare.split(`
2043
+ `), options);
2044
+ }
2045
+ }
2046
+ var MAX_DIFF_STRING_LENGTH = 2e4;
2047
+ function isAsymmetricMatcher(data) {
2048
+ return getType2(data) === "Object" && typeof data.asymmetricMatch == "function";
2049
+ }
2050
+ function isReplaceable(obj1, obj2) {
2051
+ let obj1Type = getType2(obj1), obj2Type = getType2(obj2);
2052
+ return obj1Type === obj2Type && (obj1Type === "Object" || obj1Type === "Array");
2053
+ }
2054
+ function printDiffOrStringify(received, expected, options) {
2055
+ let { aAnnotation, bAnnotation } = normalizeDiffOptions(options);
2056
+ if (typeof expected == "string" && typeof received == "string" && expected.length > 0 && received.length > 0 && expected.length <= MAX_DIFF_STRING_LENGTH && received.length <= MAX_DIFF_STRING_LENGTH && expected !== received) {
2057
+ if (expected.includes(`
2058
+ `) || received.includes(`
2059
+ `))
2060
+ return diffStringsUnified(expected, received, options);
2061
+ let [diffs] = diffStringsRaw(expected, received, !0), hasCommonDiff2 = diffs.some((diff2) => diff2[0] === DIFF_EQUAL), printLabel = getLabelPrinter(aAnnotation, bAnnotation), expectedLine = printLabel(aAnnotation) + printExpected(getCommonAndChangedSubstrings(diffs, DIFF_DELETE, hasCommonDiff2)), receivedLine = printLabel(bAnnotation) + printReceived(getCommonAndChangedSubstrings(diffs, DIFF_INSERT, hasCommonDiff2));
2062
+ return `${expectedLine}
2063
+ ${receivedLine}`;
2064
+ }
2065
+ let clonedExpected = deepClone(expected, { forceWritable: !0 }), clonedReceived = deepClone(received, { forceWritable: !0 }), { replacedExpected, replacedActual } = replaceAsymmetricMatcher(clonedReceived, clonedExpected);
2066
+ return diff(replacedExpected, replacedActual, options);
2067
+ }
2068
+ function replaceAsymmetricMatcher(actual, expected, actualReplaced = /* @__PURE__ */ new WeakSet(), expectedReplaced = /* @__PURE__ */ new WeakSet()) {
2069
+ return actual instanceof Error && expected instanceof Error && typeof actual.cause < "u" && typeof expected.cause > "u" ? (delete actual.cause, {
2070
+ replacedActual: actual,
2071
+ replacedExpected: expected
2072
+ }) : isReplaceable(actual, expected) ? actualReplaced.has(actual) || expectedReplaced.has(expected) ? {
2073
+ replacedActual: actual,
2074
+ replacedExpected: expected
2075
+ } : (actualReplaced.add(actual), expectedReplaced.add(expected), getOwnProperties(expected).forEach((key) => {
2076
+ let expectedValue = expected[key], actualValue = actual[key];
2077
+ if (isAsymmetricMatcher(expectedValue))
2078
+ expectedValue.asymmetricMatch(actualValue) && (actual[key] = expectedValue);
2079
+ else if (isAsymmetricMatcher(actualValue))
2080
+ actualValue.asymmetricMatch(expectedValue) && (expected[key] = actualValue);
2081
+ else if (isReplaceable(actualValue, expectedValue)) {
2082
+ let replaced = replaceAsymmetricMatcher(actualValue, expectedValue, actualReplaced, expectedReplaced);
2083
+ actual[key] = replaced.replacedActual, expected[key] = replaced.replacedExpected;
2084
+ }
2085
+ }), {
2086
+ replacedActual: actual,
2087
+ replacedExpected: expected
2088
+ }) : {
2089
+ replacedActual: actual,
2090
+ replacedExpected: expected
2091
+ };
2092
+ }
2093
+ function getLabelPrinter(...strings) {
2094
+ let maxLength = strings.reduce((max, string) => string.length > max ? string.length : max, 0);
2095
+ return (string) => `${string}: ${" ".repeat(maxLength - string.length)}`;
2096
+ }
2097
+ var SPACE_SYMBOL = "\xB7";
2098
+ function replaceTrailingSpaces(text) {
2099
+ return text.replace(/\s+$/gm, (spaces) => SPACE_SYMBOL.repeat(spaces.length));
2100
+ }
2101
+ function printReceived(object) {
2102
+ return s2.red(replaceTrailingSpaces(stringify(object)));
2103
+ }
2104
+ function printExpected(value) {
2105
+ return s2.green(replaceTrailingSpaces(stringify(value)));
2106
+ }
2107
+ function getCommonAndChangedSubstrings(diffs, op, hasCommonDiff2) {
2108
+ return diffs.reduce((reduced, diff2) => reduced + (diff2[0] === DIFF_EQUAL ? diff2[1] : diff2[0] === op ? hasCommonDiff2 ? s2.inverse(diff2[1]) : diff2[1] : ""), "");
2109
+ }
2110
+
2111
+ // ../../node_modules/@vitest/utils/dist/error.js
2112
+ var IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@", IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
2113
+ function isImmutable(v) {
2114
+ return v && (v[IS_COLLECTION_SYMBOL] || v[IS_RECORD_SYMBOL]);
2115
+ }
2116
+ var OBJECT_PROTO = Object.getPrototypeOf({});
2117
+ function getUnserializableMessage(err) {
2118
+ return err instanceof Error ? `<unserializable>: ${err.message}` : typeof err == "string" ? `<unserializable>: ${err}` : "<unserializable>";
2119
+ }
2120
+ function serializeValue(val, seen = /* @__PURE__ */ new WeakMap()) {
2121
+ if (!val || typeof val == "string")
2122
+ return val;
2123
+ if (val instanceof Error && "toJSON" in val && typeof val.toJSON == "function") {
2124
+ let jsonValue = val.toJSON();
2125
+ return jsonValue && jsonValue !== val && typeof jsonValue == "object" && (typeof val.message == "string" && safe(() => jsonValue.message ?? (jsonValue.message = val.message)), typeof val.stack == "string" && safe(() => jsonValue.stack ?? (jsonValue.stack = val.stack)), typeof val.name == "string" && safe(() => jsonValue.name ?? (jsonValue.name = val.name)), val.cause != null && safe(() => jsonValue.cause ?? (jsonValue.cause = serializeValue(val.cause, seen)))), serializeValue(jsonValue, seen);
2126
+ }
2127
+ if (typeof val == "function")
2128
+ return `Function<${val.name || "anonymous"}>`;
2129
+ if (typeof val == "symbol")
2130
+ return val.toString();
2131
+ if (typeof val != "object")
2132
+ return val;
2133
+ if (typeof Buffer < "u" && val instanceof Buffer)
2134
+ return `<Buffer(${val.length}) ...>`;
2135
+ if (typeof Uint8Array < "u" && val instanceof Uint8Array)
2136
+ return `<Uint8Array(${val.length}) ...>`;
2137
+ if (isImmutable(val))
2138
+ return serializeValue(val.toJSON(), seen);
2139
+ if (val instanceof Promise || val.constructor && val.constructor.prototype === "AsyncFunction")
2140
+ return "Promise";
2141
+ if (typeof Element < "u" && val instanceof Element)
2142
+ return val.tagName;
2143
+ if (typeof val.asymmetricMatch == "function")
2144
+ return `${val.toString()} ${format2(val.sample)}`;
2145
+ if (typeof val.toJSON == "function")
2146
+ return serializeValue(val.toJSON(), seen);
2147
+ if (seen.has(val))
2148
+ return seen.get(val);
2149
+ if (Array.isArray(val)) {
2150
+ let clone2 = new Array(val.length);
2151
+ return seen.set(val, clone2), val.forEach((e, i) => {
2152
+ try {
2153
+ clone2[i] = serializeValue(e, seen);
2154
+ } catch (err) {
2155
+ clone2[i] = getUnserializableMessage(err);
2156
+ }
2157
+ }), clone2;
2158
+ } else {
2159
+ let clone2 = /* @__PURE__ */ Object.create(null);
2160
+ seen.set(val, clone2);
2161
+ let obj = val;
2162
+ for (; obj && obj !== OBJECT_PROTO; )
2163
+ Object.getOwnPropertyNames(obj).forEach((key) => {
2164
+ if (!(key in clone2))
2165
+ try {
2166
+ clone2[key] = serializeValue(val[key], seen);
2167
+ } catch (err) {
2168
+ delete clone2[key], clone2[key] = getUnserializableMessage(err);
2169
+ }
2170
+ }), obj = Object.getPrototypeOf(obj);
2171
+ return clone2;
2172
+ }
2173
+ }
2174
+ function safe(fn) {
2175
+ try {
2176
+ return fn();
2177
+ } catch {
2178
+ }
2179
+ }
2180
+ function normalizeErrorMessage(message) {
2181
+ return message.replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "");
2182
+ }
2183
+ function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
2184
+ if (!_err || typeof _err != "object")
2185
+ return { message: String(_err) };
2186
+ let err = _err;
2187
+ (err.showDiff || err.showDiff === void 0 && err.expected !== void 0 && err.actual !== void 0) && (err.diff = printDiffOrStringify(err.actual, err.expected, {
2188
+ ...diffOptions,
2189
+ ...err.diffOptions
2190
+ })), "expected" in err && typeof err.expected != "string" && (err.expected = stringify(err.expected, 10)), "actual" in err && typeof err.actual != "string" && (err.actual = stringify(err.actual, 10));
2191
+ try {
2192
+ typeof err.message == "string" && (err.message = normalizeErrorMessage(err.message));
2193
+ } catch {
2194
+ }
2195
+ try {
2196
+ !seen.has(err) && typeof err.cause == "object" && (seen.add(err), err.cause = processError(err.cause, diffOptions, seen));
2197
+ } catch {
2198
+ }
2199
+ try {
2200
+ return serializeValue(err);
2201
+ } catch (e) {
2202
+ return serializeValue(new Error(`Failed to fully serialize error: ${e?.message}
2203
+ Inner error message: ${err?.message}`));
2204
+ }
2205
+ }
2206
+
2207
+ // src/instrumenter/preview-api.ts
2208
+ var addons = globalThis.__STORYBOOK_ADDONS_PREVIEW;
2209
+
2210
+ // src/instrumenter/instrumenter.ts
2211
+ var alreadyCompletedException = new Error(
2212
+ "This function ran after the play function completed. Did you forget to `await` it?"
2213
+ ), isObject = (o) => Object.prototype.toString.call(o) === "[object Object]", isModule = (o) => Object.prototype.toString.call(o) === "[object Module]", isInstrumentable = (o) => {
2214
+ if (!isObject(o) && !isModule(o))
2215
+ return !1;
2216
+ if (o.constructor === void 0)
2217
+ return !0;
2218
+ let proto = o.constructor.prototype;
2219
+ return !!isObject(proto);
2220
+ }, construct = (obj) => {
2221
+ try {
2222
+ return new obj.constructor();
2223
+ } catch {
2224
+ return {};
2225
+ }
2226
+ }, getInitialState = () => ({
2227
+ renderPhase: "preparing",
2228
+ isDebugging: !1,
2229
+ isPlaying: !1,
2230
+ isLocked: !1,
2231
+ cursor: 0,
2232
+ calls: [],
2233
+ shadowCalls: [],
2234
+ callRefsByResult: /* @__PURE__ */ new Map(),
2235
+ chainedCallIds: /* @__PURE__ */ new Set(),
2236
+ ancestors: [],
2237
+ playUntil: void 0,
2238
+ resolvers: {},
2239
+ syncTimeout: void 0
2240
+ }), getRetainedState = (state, isDebugging = !1) => {
2241
+ let calls = (isDebugging ? state.shadowCalls : state.calls).filter((call) => call.retain);
2242
+ if (!calls.length)
2243
+ return;
2244
+ let callRefsByResult = new Map(
2245
+ Array.from(state.callRefsByResult.entries()).filter(([, ref]) => ref.retain)
2246
+ );
2247
+ return { cursor: calls.length, calls, callRefsByResult };
2248
+ }, Instrumenter = class {
2249
+ constructor() {
2250
+ this.detached = !1;
2251
+ this.initialized = !1;
2252
+ // State is tracked per story to deal with multiple stories on the same canvas (i.e. docs mode)
2253
+ this.state = {};
2254
+ this.loadParentWindowState = () => {
2255
+ try {
2256
+ this.state = global.window?.parent?.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__ || {};
2257
+ } catch {
2258
+ this.detached = !0;
2259
+ }
2260
+ };
2261
+ this.updateParentWindowState = () => {
2262
+ try {
2263
+ global.window.parent.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__ = this.state;
2264
+ } catch {
2265
+ this.detached = !0;
2266
+ }
2267
+ };
2268
+ this.loadParentWindowState();
2269
+ let resetState = ({
2270
+ storyId,
2271
+ renderPhase,
2272
+ isPlaying = !0,
2273
+ isDebugging = !1
2274
+ }) => {
2275
+ let state = this.getState(storyId);
2276
+ this.setState(storyId, {
2277
+ ...getInitialState(),
2278
+ ...getRetainedState(state, isDebugging),
2279
+ renderPhase: renderPhase || state.renderPhase,
2280
+ shadowCalls: isDebugging ? state.shadowCalls : [],
2281
+ chainedCallIds: isDebugging ? state.chainedCallIds : /* @__PURE__ */ new Set(),
2282
+ playUntil: isDebugging ? state.playUntil : void 0,
2283
+ isPlaying,
2284
+ isDebugging
2285
+ }), this.sync(storyId);
2286
+ }, start = (channel) => ({ storyId, playUntil }) => {
2287
+ this.getState(storyId).isDebugging || this.setState(storyId, ({ calls }) => ({
2288
+ calls: [],
2289
+ shadowCalls: calls.map((call) => ({ ...call, status: "waiting" /* WAITING */ })),
2290
+ isDebugging: !0
2291
+ }));
2292
+ let log = this.getLog(storyId);
2293
+ this.setState(storyId, ({ shadowCalls }) => {
2294
+ if (playUntil || !log.length)
2295
+ return { playUntil };
2296
+ let firstRowIndex = shadowCalls.findIndex((call) => call.id === log[0].callId);
2297
+ return {
2298
+ playUntil: shadowCalls.slice(0, firstRowIndex).filter((call) => call.interceptable && !call.ancestors?.length).slice(-1)[0]?.id
2299
+ };
2300
+ }), channel.emit(FORCE_REMOUNT, { storyId, isDebugging: !0 });
2301
+ }, back = (channel) => ({ storyId }) => {
2302
+ let log = this.getLog(storyId).filter((call) => !call.ancestors?.length), last = log.reduceRight((res, item, index2) => res >= 0 || item.status === "waiting" /* WAITING */ ? res : index2, -1);
2303
+ start(channel)({ storyId, playUntil: log[last - 1]?.callId });
2304
+ }, goto = (channel) => ({ storyId, callId }) => {
2305
+ let { calls, shadowCalls, resolvers } = this.getState(storyId), call = calls.find(({ id }) => id === callId), shadowCall = shadowCalls.find(({ id }) => id === callId);
2306
+ if (!call && shadowCall && Object.values(resolvers).length > 0) {
2307
+ let nextId = this.getLog(storyId).find((c) => c.status === "waiting" /* WAITING */)?.callId;
2308
+ shadowCall.id !== nextId && this.setState(storyId, { playUntil: shadowCall.id }), Object.values(resolvers).forEach((resolve) => resolve());
2309
+ } else
2310
+ start(channel)({ storyId, playUntil: callId });
2311
+ }, next = (channel) => ({ storyId }) => {
2312
+ let { resolvers } = this.getState(storyId);
2313
+ if (Object.values(resolvers).length > 0)
2314
+ Object.values(resolvers).forEach((resolve) => resolve());
2315
+ else {
2316
+ let nextId = this.getLog(storyId).find((c) => c.status === "waiting" /* WAITING */)?.callId;
2317
+ nextId ? start(channel)({ storyId, playUntil: nextId }) : end({ storyId });
2318
+ }
2319
+ }, end = ({ storyId }) => {
2320
+ this.setState(storyId, { playUntil: void 0, isDebugging: !1 }), Object.values(this.getState(storyId).resolvers).forEach((resolve) => resolve());
2321
+ }, renderPhaseChanged = ({
2322
+ storyId,
2323
+ newPhase
2324
+ }) => {
2325
+ let { isDebugging } = this.getState(storyId);
2326
+ if (newPhase === "preparing" && isDebugging)
2327
+ return resetState({ storyId, renderPhase: newPhase, isDebugging });
2328
+ if (newPhase === "playing")
2329
+ return resetState({ storyId, renderPhase: newPhase, isDebugging });
2330
+ newPhase === "played" ? this.setState(storyId, {
2331
+ renderPhase: newPhase,
2332
+ isLocked: !1,
2333
+ isPlaying: !1,
2334
+ isDebugging: !1
2335
+ }) : newPhase === "errored" ? this.setState(storyId, {
2336
+ renderPhase: newPhase,
2337
+ isLocked: !1,
2338
+ isPlaying: !1
2339
+ }) : newPhase === "aborted" ? this.setState(storyId, {
2340
+ renderPhase: newPhase,
2341
+ isLocked: !0,
2342
+ isPlaying: !1
2343
+ }) : this.setState(storyId, {
2344
+ renderPhase: newPhase
2345
+ }), this.sync(storyId);
2346
+ };
2347
+ addons && addons.ready().then(() => {
2348
+ this.channel = addons.getChannel(), this.channel.on(FORCE_REMOUNT, resetState), this.channel.on(STORY_RENDER_PHASE_CHANGED, renderPhaseChanged), this.channel.on(SET_CURRENT_STORY, () => {
2349
+ this.initialized ? this.cleanup() : this.initialized = !0;
2350
+ }), this.channel.on(EVENTS.START, start(this.channel)), this.channel.on(EVENTS.BACK, back(this.channel)), this.channel.on(EVENTS.GOTO, goto(this.channel)), this.channel.on(EVENTS.NEXT, next(this.channel)), this.channel.on(EVENTS.END, end);
2351
+ });
2352
+ }
2353
+ getState(storyId) {
2354
+ return this.state[storyId] || getInitialState();
2355
+ }
2356
+ setState(storyId, update) {
2357
+ if (storyId) {
2358
+ let state = this.getState(storyId), patch = typeof update == "function" ? update(state) : update;
2359
+ this.state = { ...this.state, [storyId]: { ...state, ...patch } }, this.updateParentWindowState();
2360
+ }
2361
+ }
2362
+ cleanup() {
2363
+ this.state = Object.entries(this.state).reduce(
2364
+ (acc, [storyId, state]) => {
2365
+ let retainedState = getRetainedState(state);
2366
+ return retainedState && (acc[storyId] = Object.assign(getInitialState(), retainedState)), acc;
2367
+ },
2368
+ {}
2369
+ );
2370
+ let payload = { controlStates: {
2371
+ detached: this.detached,
2372
+ start: !1,
2373
+ back: !1,
2374
+ goto: !1,
2375
+ next: !1,
2376
+ end: !1
2377
+ }, logItems: [] };
2378
+ this.channel?.emit(EVENTS.SYNC, payload), this.updateParentWindowState();
2379
+ }
2380
+ getLog(storyId) {
2381
+ let { calls, shadowCalls } = this.getState(storyId), merged = [...shadowCalls];
2382
+ calls.forEach((call, index2) => {
2383
+ merged[index2] = call;
2384
+ });
2385
+ let seen = /* @__PURE__ */ new Set();
2386
+ return merged.reduceRight((acc, call) => (call.args.forEach((arg) => {
2387
+ arg?.__callId__ && seen.add(arg.__callId__);
2388
+ }), call.path.forEach((node) => {
2389
+ node.__callId__ && seen.add(node.__callId__);
2390
+ }), (call.interceptable || call.exception) && !seen.has(call.id) && (acc.unshift({ callId: call.id, status: call.status, ancestors: call.ancestors }), seen.add(call.id)), acc), []);
2391
+ }
2392
+ // Traverses the object structure to recursively patch all function properties.
2393
+ // Returns the original object, or a new object with the same constructor,
2394
+ // depending on whether it should mutate.
2395
+ instrument(obj, options, depth = 0) {
2396
+ if (!isInstrumentable(obj))
2397
+ return obj;
2398
+ let { mutate = !1, path = [] } = options, keys = options.getKeys ? options.getKeys(obj, depth) : Object.keys(obj);
2399
+ return depth += 1, keys.reduce(
2400
+ (acc, key) => {
2401
+ let descriptor = getPropertyDescriptor(obj, key);
2402
+ if (typeof descriptor?.get == "function") {
2403
+ if (descriptor.configurable) {
2404
+ let getter = () => descriptor?.get?.bind(obj)?.();
2405
+ Object.defineProperty(acc, key, {
2406
+ get: () => this.instrument(getter(), { ...options, path: path.concat(key) }, depth)
2407
+ });
2408
+ }
2409
+ return acc;
2410
+ }
2411
+ let value = obj[key];
2412
+ return typeof value != "function" ? (acc[key] = this.instrument(value, { ...options, path: path.concat(key) }, depth), acc) : "__originalFn__" in value && typeof value.__originalFn__ == "function" ? (acc[key] = value, acc) : (acc[key] = (...args) => this.track(key, value, obj, args, options), acc[key].__originalFn__ = value, Object.defineProperty(acc[key], "name", { value: key, writable: !1 }), Object.keys(value).length > 0 && Object.assign(
2413
+ acc[key],
2414
+ this.instrument({ ...value }, { ...options, path: path.concat(key) }, depth)
2415
+ ), acc);
2416
+ },
2417
+ mutate ? obj : construct(obj)
2418
+ );
2419
+ }
2420
+ // Monkey patch an object method to record calls.
2421
+ // Returns a function that invokes the original function, records the invocation ("call") and
2422
+ // returns the original result.
2423
+ track(method, fn, object, args, options) {
2424
+ let storyId = args?.[0]?.__storyId__ || global.__STORYBOOK_PREVIEW__?.selectionStore?.selection?.storyId, { cursor, ancestors } = this.getState(storyId);
2425
+ this.setState(storyId, { cursor: cursor + 1 });
2426
+ let id = `${ancestors.slice(-1)[0] || storyId} [${cursor}] ${method}`, { path = [], intercept = !1, retain = !1 } = options, interceptable = typeof intercept == "function" ? intercept(method, path) : intercept, call = { id, cursor, storyId, ancestors, path, method, args, interceptable, retain }, result = (interceptable && !ancestors.length ? this.intercept : this.invoke).call(this, fn, object, call, options);
2427
+ return this.instrument(result, { ...options, mutate: !0, path: [{ __callId__: call.id }] });
2428
+ }
2429
+ intercept(fn, object, call, options) {
2430
+ let { chainedCallIds, isDebugging, playUntil } = this.getState(call.storyId), isChainedUpon = chainedCallIds.has(call.id);
2431
+ return !isDebugging || isChainedUpon || playUntil ? (playUntil === call.id && this.setState(call.storyId, { playUntil: void 0 }), this.invoke(fn, object, call, options)) : new Promise((resolve) => {
2432
+ this.setState(call.storyId, ({ resolvers }) => ({
2433
+ isLocked: !1,
2434
+ resolvers: { ...resolvers, [call.id]: resolve }
2435
+ }));
2436
+ }).then(() => (this.setState(call.storyId, (state) => {
2437
+ let { [call.id]: _, ...resolvers } = state.resolvers;
2438
+ return { isLocked: !0, resolvers };
2439
+ }), this.invoke(fn, object, call, options)));
2440
+ }
2441
+ invoke(fn, object, call, options) {
2442
+ let { callRefsByResult, renderPhase } = this.getState(call.storyId), maximumDepth = 25, serializeValues = (value, depth, seen) => {
2443
+ if (seen.includes(value))
2444
+ return "[Circular]";
2445
+ if (seen = [...seen, value], depth > maximumDepth)
2446
+ return "...";
2447
+ if (callRefsByResult.has(value))
2448
+ return callRefsByResult.get(value);
2449
+ if (value instanceof Array)
2450
+ return value.map((it) => serializeValues(it, ++depth, seen));
2451
+ if (value instanceof Date)
2452
+ return { __date__: { value: value.toISOString() } };
2453
+ if (value instanceof Error) {
2454
+ let { name, message, stack } = value;
2455
+ return { __error__: { name, message, stack } };
2456
+ }
2457
+ if (value instanceof RegExp) {
2458
+ let { flags, source } = value;
2459
+ return { __regexp__: { flags, source } };
2460
+ }
2461
+ if (value instanceof global.window?.HTMLElement) {
2462
+ let { prefix, localName, id, classList, innerText } = value, classNames = Array.from(classList);
2463
+ return { __element__: { prefix, localName, id, classNames, innerText } };
2464
+ }
2465
+ return typeof value == "function" ? {
2466
+ __function__: { name: "getMockName" in value ? value.getMockName() : value.name }
2467
+ } : typeof value == "symbol" ? { __symbol__: { description: value.description } } : typeof value == "object" && value?.constructor?.name && value?.constructor?.name !== "Object" ? { __class__: { name: value.constructor.name } } : Object.prototype.toString.call(value) === "[object Object]" ? Object.fromEntries(
2468
+ Object.entries(value).map(([key, val]) => [key, serializeValues(val, ++depth, seen)])
2469
+ ) : value;
2470
+ }, info = {
2471
+ ...call,
2472
+ args: call.args.map((arg) => serializeValues(arg, 0, []))
2473
+ };
2474
+ call.path.forEach((ref) => {
2475
+ ref?.__callId__ && this.setState(call.storyId, ({ chainedCallIds }) => ({
2476
+ chainedCallIds: new Set(Array.from(chainedCallIds).concat(ref.__callId__))
2477
+ }));
2478
+ });
2479
+ let handleException = (e) => {
2480
+ if (e instanceof Error) {
2481
+ let { name, message, stack, callId = call.id } = e, {
2482
+ showDiff = void 0,
2483
+ diff: diff2 = void 0,
2484
+ actual = void 0,
2485
+ expected = void 0
2486
+ } = e.name === "AssertionError" ? processError(e) : e, exception = { name, message, stack, callId, showDiff, diff: diff2, actual, expected };
2487
+ if (this.update({ ...info, status: "error" /* ERROR */, exception }), this.setState(call.storyId, (state) => ({
2488
+ callRefsByResult: new Map([
2489
+ ...Array.from(state.callRefsByResult.entries()),
2490
+ [e, { __callId__: call.id, retain: call.retain }]
2491
+ ])
2492
+ })), call.ancestors?.length)
2493
+ throw Object.prototype.hasOwnProperty.call(e, "callId") || Object.defineProperty(e, "callId", { value: call.id }), e;
2494
+ }
2495
+ throw e;
2496
+ };
2497
+ try {
2498
+ if (renderPhase === "played" && !call.retain)
2499
+ throw alreadyCompletedException;
2500
+ let finalArgs = (options.getArgs ? options.getArgs(call, this.getState(call.storyId)) : call.args).map((arg) => typeof arg != "function" || isClass(arg) || Object.keys(arg).length ? arg : (...args) => {
2501
+ let { cursor, ancestors } = this.getState(call.storyId);
2502
+ this.setState(call.storyId, { cursor: 0, ancestors: [...ancestors, call.id] });
2503
+ let restore = () => this.setState(call.storyId, { cursor, ancestors }), willRestore = !1;
2504
+ try {
2505
+ let res = arg(...args);
2506
+ return res instanceof Promise ? (willRestore = !0, res.finally(restore)) : res;
2507
+ } finally {
2508
+ willRestore || restore();
2509
+ }
2510
+ }), result = fn.apply(object, finalArgs);
2511
+ return result && ["object", "function", "symbol"].includes(typeof result) && this.setState(call.storyId, (state) => ({
2512
+ callRefsByResult: new Map([
2513
+ ...Array.from(state.callRefsByResult.entries()),
2514
+ [result, { __callId__: call.id, retain: call.retain }]
2515
+ ])
2516
+ })), this.update({
2517
+ ...info,
2518
+ status: result instanceof Promise ? "active" /* ACTIVE */ : "done" /* DONE */
2519
+ }), result instanceof Promise ? result.then((value) => (this.update({ ...info, status: "done" /* DONE */ }), value), handleException) : result;
2520
+ } catch (e) {
2521
+ return handleException(e);
2522
+ }
2523
+ }
2524
+ // Sends the call info to the manager and synchronizes the log.
2525
+ update(call) {
2526
+ this.channel?.emit(EVENTS.CALL, call), this.setState(call.storyId, ({ calls }) => {
2527
+ let callsById = calls.concat(call).reduce((a3, c) => Object.assign(a3, { [c.id]: c }), {});
2528
+ return {
2529
+ // Calls are sorted to ensure parent calls always come before calls in their callback.
2530
+ calls: Object.values(callsById).sort(
2531
+ (a3, b) => a3.id.localeCompare(b.id, void 0, { numeric: !0 })
2532
+ )
2533
+ };
2534
+ }), this.sync(call.storyId);
2535
+ }
2536
+ // Builds a log of interceptable calls and control states and sends it to the manager.
2537
+ // Uses a 0ms debounce because this might get called many times in one tick.
2538
+ sync(storyId) {
2539
+ let synchronize = () => {
2540
+ let { isLocked, isPlaying } = this.getState(storyId), logItems = this.getLog(storyId), pausedAt = logItems.filter(({ ancestors }) => !ancestors.length).find((item) => item.status === "waiting" /* WAITING */)?.callId, hasActive = logItems.some((item) => item.status === "active" /* ACTIVE */);
2541
+ if (this.detached || isLocked || hasActive || logItems.length === 0) {
2542
+ let controlStates2 = {
2543
+ detached: this.detached,
2544
+ start: !1,
2545
+ back: !1,
2546
+ goto: !1,
2547
+ next: !1,
2548
+ end: !1
2549
+ }, payload2 = { storyId, controlStates: controlStates2, logItems };
2550
+ this.channel?.emit(EVENTS.SYNC, payload2);
2551
+ return;
2552
+ }
2553
+ let hasPrevious = logItems.some(
2554
+ (item) => item.status === "done" /* DONE */ || item.status === "error" /* ERROR */
2555
+ ), controlStates = {
2556
+ detached: this.detached,
2557
+ start: hasPrevious,
2558
+ back: hasPrevious,
2559
+ goto: !0,
2560
+ next: isPlaying,
2561
+ end: isPlaying
2562
+ }, payload = { storyId, controlStates, logItems, pausedAt };
2563
+ this.channel?.emit(EVENTS.SYNC, payload);
2564
+ };
2565
+ this.setState(storyId, ({ syncTimeout }) => (clearTimeout(syncTimeout), { syncTimeout: setTimeout(synchronize, 0) }));
2566
+ }
2567
+ };
2568
+ function instrument(obj, options = {}) {
2569
+ try {
2570
+ let forceInstrument = !1, skipInstrument = !1;
2571
+ return global.window?.location?.search?.includes("instrument=true") ? forceInstrument = !0 : global.window?.location?.search?.includes("instrument=false") && (skipInstrument = !0), global.window?.parent === global.window && !forceInstrument || skipInstrument ? obj : (global.window && !global.window.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__ && (global.window.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__ = new Instrumenter()), (global.window?.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__).instrument(obj, options));
2572
+ } catch (e) {
2573
+ return once.warn(e), obj;
2574
+ }
2575
+ }
2576
+ function getPropertyDescriptor(obj, propName) {
2577
+ let target = obj;
2578
+ for (; target != null; ) {
2579
+ let descriptor = Object.getOwnPropertyDescriptor(target, propName);
2580
+ if (descriptor)
2581
+ return descriptor;
2582
+ target = Object.getPrototypeOf(target);
2583
+ }
2584
+ }
2585
+ function isClass(obj) {
2586
+ if (typeof obj != "function")
2587
+ return !1;
2588
+ let descriptor = Object.getOwnPropertyDescriptor(obj, "prototype");
2589
+ return descriptor ? !descriptor.writable : !1;
2590
+ }
2591
+ export {
2592
+ CallStates,
2593
+ EVENTS,
2594
+ instrument
2595
+ };