@aussieljk/forkbook 0.0.1-11 → 0.0.1-13

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 (381) hide show
  1. package/README.md +1 -1
  2. package/assets/create/rendererAssets/common/button.css +6 -6
  3. package/assets/create/rendererAssets/common/header.css +5 -5
  4. package/assets/create/rendererAssets/common/page.css +10 -10
  5. package/dist/_browser-chunks/{Color-QLZNXLSV.js → Color-2EUQ6NXV.js} +2 -2
  6. package/dist/_browser-chunks/{DocsRenderer-JXND3PVQ.js → DocsRenderer-DKXSW2OY.js} +2 -2
  7. package/dist/_browser-chunks/{WithTooltip-GNLRTZDF.js → WithTooltip-QCFTNB6P.js} +5 -4
  8. package/dist/_browser-chunks/{chunk-RBCHTR7C.js → chunk-2ELGJRFZ.js} +1 -1
  9. package/dist/_browser-chunks/{chunk-6ELMKWKX.js → chunk-2WZWS7GJ.js} +1 -1
  10. package/dist/_browser-chunks/{chunk-FRAOQJDI.js → chunk-3QPZOXB7.js} +1 -5
  11. package/dist/_browser-chunks/{chunk-GRO2ZYEJ.js → chunk-4BOJAE7P.js} +12 -8
  12. package/dist/_browser-chunks/{chunk-ZHKZKFY4.js → chunk-6SL45YM3.js} +9 -13
  13. package/dist/_browser-chunks/{chunk-DS2WQZGO.js → chunk-BLCZ3C5M.js} +41 -62
  14. package/dist/_browser-chunks/{chunk-7DQREF4S.js → chunk-DHTLVXAL.js} +37 -44
  15. package/dist/_browser-chunks/{chunk-GNZY6LOW.js → chunk-DISGPOF4.js} +54 -51
  16. package/dist/_browser-chunks/{chunk-76222HQR.js → chunk-E6QKKKLO.js} +20 -5
  17. package/dist/_browser-chunks/{chunk-DYNTDJ3O.js → chunk-EBSOKHFG.js} +8 -2
  18. package/dist/_browser-chunks/{chunk-3M5T7BW4.js → chunk-ECMVTOVD.js} +1 -1
  19. package/dist/_browser-chunks/{chunk-EQKMUQF3.js → chunk-ENHFQXYS.js} +5 -4
  20. package/dist/_browser-chunks/{chunk-KYSD26D6.js → chunk-EW2M3URL.js} +90 -83
  21. package/dist/_browser-chunks/{chunk-I4ATZPNZ.js → chunk-FCULT3AE.js} +3 -3
  22. package/dist/_browser-chunks/{chunk-46Z7NGAS.js → chunk-HX443LKV.js} +1 -1
  23. package/dist/_browser-chunks/{chunk-NGMQJMCY.js → chunk-HZFHNYRC.js} +1 -1
  24. package/dist/_browser-chunks/{chunk-5H4KFI44.js → chunk-KQJ4T6JL.js} +30 -24
  25. package/dist/_browser-chunks/{chunk-RMYQ3QN3.js → chunk-NK5SGJNG.js} +22 -17
  26. package/dist/_browser-chunks/{chunk-N3NRW5XX.js → chunk-PQRPDA4U.js} +3 -3
  27. package/dist/_browser-chunks/{chunk-2JDQ35OA.js → chunk-PU7D2WDP.js} +0 -11
  28. package/dist/_browser-chunks/{chunk-5WMXI5GW.js → chunk-QFO2B4X2.js} +31 -28
  29. package/dist/_browser-chunks/{chunk-TTBPZQ24.js → chunk-S7N7Z5TY.js} +47 -43
  30. package/dist/_browser-chunks/{chunk-2JT76G3E.js → chunk-SBOQ4QPY.js} +15 -15
  31. package/dist/_browser-chunks/{chunk-WBLVFDJT.js → chunk-UH3XTEOQ.js} +716 -658
  32. package/dist/_browser-chunks/{chunk-5I7E4GMO.js → chunk-WY2LUGOH.js} +1 -1
  33. package/dist/_browser-chunks/{chunk-O24AZJZ7.js → chunk-YJO5BK52.js} +7 -3
  34. package/dist/_browser-chunks/{chunk-3HM3VWJS.js → chunk-ZF37BMDS.js} +6 -2
  35. package/dist/_browser-chunks/{chunk-QU4RB2WU.js → chunk-ZF5SPY56.js} +4 -4
  36. package/dist/_browser-chunks/{matchers-YLBYSYAF.js → matchers-2HVLNCVO.js} +4 -4
  37. package/dist/_browser-chunks/{react-dom-client-4OHE3QDV.js → react-dom-client-SLBUX3U3.js} +1 -1
  38. package/dist/_node-chunks/{attached-runtime-J2AKT5WI.js → attached-runtime-7IRDQUTZ.js} +28 -29
  39. package/dist/_node-chunks/{builder-manager-Z4RWF4ZH.js → builder-manager-YTALSWKQ.js} +39 -28
  40. package/dist/_node-chunks/{chunk-2WVLC5M2.js → chunk-26ERGIQH.js} +6 -6
  41. package/dist/_node-chunks/{chunk-VZG3OKFO.js → chunk-33T4HNF2.js} +6 -6
  42. package/dist/_node-chunks/{chunk-ZEYODVQT.js → chunk-3F3673RQ.js} +7 -7
  43. package/dist/_node-chunks/{chunk-Y4W4B3E7.js → chunk-3FLRYZLJ.js} +6 -6
  44. package/dist/_node-chunks/{chunk-AVL7GUOZ.js → chunk-3L2QRDKH.js} +522 -1045
  45. package/dist/_node-chunks/{chunk-XO54HM4P.js → chunk-3NH7IHUS.js} +6 -6
  46. package/dist/_node-chunks/{chunk-GMKLTDKN.js → chunk-3ZAENV5A.js} +6 -6
  47. package/dist/_node-chunks/{chunk-3IIQSDCO.js → chunk-4B52HLKK.js} +53 -55
  48. package/dist/_node-chunks/chunk-4CZJ4SFH.js +281 -0
  49. package/dist/_node-chunks/{chunk-BBU2FUPC.js → chunk-4IIWFG7O.js} +13 -11
  50. package/dist/_node-chunks/{chunk-2U5J7YTA.js → chunk-4YWZLOAF.js} +6 -6
  51. package/dist/_node-chunks/{chunk-XVOIYGTJ.js → chunk-5A5XOSRM.js} +6 -6
  52. package/dist/_node-chunks/chunk-5T6Q7HT3.js +11 -0
  53. package/dist/_node-chunks/{chunk-MI7WBXWX.js → chunk-6DRDJF2Q.js} +6 -6
  54. package/dist/_node-chunks/{chunk-WBCKO5LP.js → chunk-6JSZY5TJ.js} +6 -6
  55. package/dist/_node-chunks/{chunk-3EBGFRAH.js → chunk-7SPDKMDQ.js} +32 -40
  56. package/dist/_node-chunks/{chunk-IRPQQARO.js → chunk-7YLKDHLZ.js} +7 -7
  57. package/dist/_node-chunks/{chunk-BSQB5B57.js → chunk-7YQIVUEK.js} +6 -6
  58. package/dist/_node-chunks/{chunk-PYVGF5F2.js → chunk-ADCQYK3Z.js} +6 -6
  59. package/dist/_node-chunks/{chunk-7YQTID2W.js → chunk-ALHQVE5R.js} +6 -6
  60. package/dist/_node-chunks/{chunk-MW4OAPPD.js → chunk-B4XAZ2OC.js} +8 -8
  61. package/dist/_node-chunks/{chunk-GGCOG7OV.js → chunk-BFQJF3ID.js} +283 -306
  62. package/dist/_node-chunks/{chunk-5GOXN5M4.js → chunk-BSXI35KM.js} +7 -7
  63. package/dist/_node-chunks/{chunk-TAMTPVYZ.js → chunk-BZQF5KUE.js} +7 -7
  64. package/dist/_node-chunks/{chunk-5JLVSH44.js → chunk-CEIESR4U.js} +8 -8
  65. package/dist/_node-chunks/{chunk-OJWUUSA4.js → chunk-CESXIP3N.js} +6 -6
  66. package/dist/_node-chunks/{chunk-CEYSYQLV.js → chunk-DAEUTT3I.js} +6 -6
  67. package/dist/_node-chunks/{chunk-FB2BOL6I.js → chunk-DIC4T2UO.js} +6 -6
  68. package/dist/_node-chunks/{chunk-LKITAODU.js → chunk-DPOWAA4P.js} +37 -31
  69. package/dist/_node-chunks/{chunk-W3KFVTWV.js → chunk-DTNEHO4J.js} +10 -10
  70. package/dist/_node-chunks/{chunk-C5OFHB3N.js → chunk-DY7F7B6V.js} +7 -7
  71. package/dist/_node-chunks/{chunk-FUG5LYKS.js → chunk-E56UKDJR.js} +8 -8
  72. package/dist/_node-chunks/{chunk-A7GEBS3Q.js → chunk-EFX2VA4Q.js} +6 -6
  73. package/dist/_node-chunks/{chunk-PQTEFQIJ.js → chunk-EM6AYELK.js} +10 -12
  74. package/dist/_node-chunks/{chunk-32FLWHUC.js → chunk-F2AFT3P7.js} +497 -475
  75. package/dist/_node-chunks/{chunk-OXT6T4AS.js → chunk-GC7NA2Y7.js} +7 -7
  76. package/dist/_node-chunks/{chunk-55S3GGGC.js → chunk-GIKCT5KG.js} +7 -7
  77. package/dist/_node-chunks/{chunk-PXOD36TR.js → chunk-GLNHSUKT.js} +20 -20
  78. package/dist/_node-chunks/{chunk-BKND5XP2.js → chunk-GQZZQB4K.js} +7 -7
  79. package/dist/_node-chunks/{chunk-GTXZNA2L.js → chunk-GRN6WQC3.js} +10 -10
  80. package/dist/_node-chunks/{chunk-6UASHVMR.js → chunk-HCMHVV7N.js} +8 -8
  81. package/dist/_node-chunks/{chunk-IVAOJWPF.js → chunk-HJVZQS65.js} +7 -7
  82. package/dist/_node-chunks/{chunk-ER3X3AQ7.js → chunk-I26RGEVQ.js} +7 -7
  83. package/dist/_node-chunks/{chunk-LAIED5XU.js → chunk-I36FPWMO.js} +6 -6
  84. package/dist/_node-chunks/{chunk-W7HY3ELZ.js → chunk-IDPQ3CVN.js} +474 -479
  85. package/dist/_node-chunks/{chunk-36LPBTLF.js → chunk-JUVUVVHI.js} +6 -6
  86. package/dist/_node-chunks/{chunk-DGWKJQ6G.js → chunk-K6TEIAKH.js} +62 -7
  87. package/dist/_node-chunks/{chunk-7IOSIYW2.js → chunk-KEXQ3BON.js} +7 -7
  88. package/dist/_node-chunks/{chunk-NLNAIU4I.js → chunk-KUZSE7ZD.js} +9 -9
  89. package/dist/_node-chunks/chunk-LJ5JRR5Q.js +18 -0
  90. package/dist/_node-chunks/{chunk-YBG7HVP7.js → chunk-LMGI47HP.js} +8 -8
  91. package/dist/_node-chunks/{chunk-6E34W4UX.js → chunk-LPIPPSMS.js} +6 -6
  92. package/dist/_node-chunks/{chunk-XICRXTTE.js → chunk-LR4W5G37.js} +6 -6
  93. package/dist/_node-chunks/{chunk-VKRGTLQJ.js → chunk-M4MRBEJI.js} +27 -23
  94. package/dist/_node-chunks/{chunk-REIDJUVJ.js → chunk-M7BVABR2.js} +20 -16
  95. package/dist/_node-chunks/{chunk-XCJ2ZIQ4.js → chunk-MK2RPLWT.js} +7 -7
  96. package/dist/_node-chunks/{chunk-LHNHFYK3.js → chunk-MKSEM5C2.js} +6 -6
  97. package/dist/_node-chunks/{chunk-RNRGXAFV.js → chunk-MWQIBOUB.js} +6 -6
  98. package/dist/_node-chunks/{chunk-NFDQT7UW.js → chunk-NAXIA2JI.js} +320 -316
  99. package/dist/_node-chunks/{chunk-GYFR2JLS.js → chunk-NDVIMCIX.js} +7 -7
  100. package/dist/_node-chunks/{chunk-D5ADPGA4.js → chunk-NIOVXWQZ.js} +6 -6
  101. package/dist/_node-chunks/{chunk-54EHKXV7.js → chunk-NRP4FGRT.js} +15 -9
  102. package/dist/_node-chunks/{chunk-NIQSBBT2.js → chunk-NSNBFXVB.js} +7 -7
  103. package/dist/_node-chunks/{chunk-Z2ZTDQDY.js → chunk-NTUTJAD4.js} +8 -8
  104. package/dist/_node-chunks/{chunk-XH5CXH53.js → chunk-O46DZ2KC.js} +8 -8
  105. package/dist/_node-chunks/{chunk-S3NDLFYL.js → chunk-OH5M2YER.js} +7 -7
  106. package/dist/_node-chunks/{chunk-FTYDKQCO.js → chunk-OSIENBU6.js} +6 -6
  107. package/dist/_node-chunks/{chunk-76KKKLEE.js → chunk-OVJZBW54.js} +7 -7
  108. package/dist/_node-chunks/{chunk-WO4UEQI6.js → chunk-PGIDRLZ5.js} +22 -22
  109. package/dist/_node-chunks/{chunk-J3SM62J3.js → chunk-PJCSZR4T.js} +8 -8
  110. package/dist/_node-chunks/{chunk-OPT5A55S.js → chunk-PQXP5FZ2.js} +8 -8
  111. package/dist/_node-chunks/{chunk-5P4N734V.js → chunk-PU33WSBW.js} +34 -52
  112. package/dist/_node-chunks/{chunk-APPFF22V.js → chunk-PUBZLLNL.js} +7 -7
  113. package/dist/_node-chunks/{chunk-ALGQMFMN.js → chunk-QWZZX2HN.js} +6 -6
  114. package/dist/_node-chunks/{chunk-NLLM4MDK.js → chunk-RMUBUNBY.js} +6 -6
  115. package/dist/_node-chunks/{chunk-SJXLINHV.js → chunk-S33FEPQ3.js} +6 -6
  116. package/dist/_node-chunks/{chunk-FEC5PGJO.js → chunk-SHP6447T.js} +7 -7
  117. package/dist/_node-chunks/{chunk-MBIVTOJK.js → chunk-ST3KB36E.js} +6 -6
  118. package/dist/_node-chunks/{chunk-AKMPPLT5.js → chunk-SXX75O2D.js} +7 -7
  119. package/dist/_node-chunks/{chunk-6UAJLEIO.js → chunk-TQ5YAQ4Y.js} +6 -6
  120. package/dist/_node-chunks/{chunk-R7VDUSKY.js → chunk-TSJ3JCNN.js} +16 -10
  121. package/dist/_node-chunks/{chunk-TKMXEHM4.js → chunk-UYEX6LW6.js} +7 -7
  122. package/dist/_node-chunks/{chunk-46Y5H6X5.js → chunk-VJLLEKWR.js} +138 -116
  123. package/dist/_node-chunks/{chunk-IFAV3CER.js → chunk-WWJKLYU5.js} +10 -10
  124. package/dist/_node-chunks/{chunk-MXLHIEXC.js → chunk-XC7K4QEX.js} +6 -6
  125. package/dist/_node-chunks/{chunk-GO3YSBPE.js → chunk-Y64FM6U7.js} +8 -8
  126. package/dist/_node-chunks/{chunk-T6P2EJD2.js → chunk-YDM7NH4T.js} +6 -6
  127. package/dist/_node-chunks/{chunk-XSVOMORJ.js → chunk-ZHVOUP6D.js} +6 -6
  128. package/dist/_node-chunks/dist-CFCU4PZG.js +27 -0
  129. package/dist/_node-chunks/dist-PFMT5YJK.js +16 -0
  130. package/dist/_node-chunks/{local-runtime-YDAW5RJV.js → local-runtime-BKID5MBG.js} +19 -20
  131. package/dist/_node-chunks/{mdx-plugin-XLDET5LV.js → mdx-plugin-7BOUDCZB.js} +13 -13
  132. package/dist/_node-chunks/{monorepo-NWMAHGOM.js → monorepo-FRHSAJB7.js} +11 -11
  133. package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-4B6IZ7JD.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-7BHSAJP4.js} +11 -11
  134. package/dist/_node-chunks/optimized-tests-F5LCOTXH.js +22 -0
  135. package/dist/_node-chunks/{pattern-copy-play-PJC4PO6A.js → pattern-copy-play-6TGV6WS4.js} +9 -9
  136. package/dist/_node-chunks/postinstallAddon-4RININ5C.js +20 -0
  137. package/dist/_node-chunks/{rehype-external-links-4CWXZ35U.js → rehype-external-links-EE2HT4QP.js} +9 -9
  138. package/dist/_node-chunks/{rehype-slug-QZ2PWSJH.js → rehype-slug-ZKRW2V6Z.js} +9 -9
  139. package/dist/_node-chunks/{relaxed-limits-ZQR4ER7L.js → relaxed-limits-6Q7VRQC5.js} +11 -11
  140. package/dist/_node-chunks/{run-U63AXEKZ.js → run-6Y3ZTASZ.js} +23 -21
  141. package/dist/_node-chunks/{run-BMXB2BW2.js → run-EBHIAT35.js} +18 -18
  142. package/dist/_node-chunks/{setup-NCUTUBNN.js → setup-6XIF77JT.js} +8 -8
  143. package/dist/_node-chunks/{vitest.config.4.template-4XHF7XPS.js → vitest.config.4.template-GMQNQ4UW.js} +7 -7
  144. package/dist/actions/decorator.js +16 -21
  145. package/dist/actions/index.d.ts +3 -3
  146. package/dist/actions/index.js +1 -1
  147. package/dist/addon-a11y/index.js +2 -2
  148. package/dist/addon-a11y/manager.js +11 -11
  149. package/dist/addon-a11y/preset.js +7 -7
  150. package/dist/addon-a11y/preview.d.ts +8 -2
  151. package/dist/addon-a11y/preview.js +2 -2
  152. package/dist/addon-docs/blocks.d.ts +104 -85
  153. package/dist/addon-docs/blocks.js +30 -32
  154. package/dist/addon-docs/index.d.ts +2 -2
  155. package/dist/addon-docs/index.js +3 -3
  156. package/dist/addon-docs/manager.js +4 -4
  157. package/dist/addon-docs/preset.js +12 -12
  158. package/dist/addon-docs/preview.d.ts +3 -1
  159. package/dist/addon-docs/preview.js +1 -1
  160. package/dist/addon-links/index.d.ts +2 -1
  161. package/dist/addon-links/preview.d.ts +1 -1
  162. package/dist/addon-mcp/preset.js +11 -11
  163. package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +16 -16
  164. package/dist/addon-ondevice-controls/index.js +1 -1
  165. package/dist/addon-ondevice-controls/register.js +1 -1
  166. package/dist/addon-pseudo-states/index.js +1 -1
  167. package/dist/addon-pseudo-states/preview.d.ts +1 -1
  168. package/dist/addon-pseudo-states/preview.js +1 -1
  169. package/dist/addon-themes/index.d.ts +6 -5
  170. package/dist/addon-themes/postinstall.js +7 -7
  171. package/dist/addon-vitest/constants.js +8 -8
  172. package/dist/addon-vitest/manager.js +18 -9
  173. package/dist/addon-vitest/node/coverage-reporter.js +11 -11
  174. package/dist/addon-vitest/node/vitest.js +34 -34
  175. package/dist/addon-vitest/postinstall.js +10 -10
  176. package/dist/addon-vitest/preset.js +21 -20
  177. package/dist/addon-vitest/vitest-plugin/global-setup.js +22 -22
  178. package/dist/addon-vitest/vitest-plugin/index.js +69 -59
  179. package/dist/babel/index.d.ts +209 -212
  180. package/dist/babel/index.js +11 -11
  181. package/dist/bin/core.js +110 -89
  182. package/dist/bin/dispatcher.js +10 -10
  183. package/dist/bin/loader.js +8 -8
  184. package/dist/builder-vite/index.d.ts +1 -1
  185. package/dist/builder-vite/index.js +18 -18
  186. package/dist/builder-vite/preset.js +13 -13
  187. package/dist/channels/index.d.ts +1 -1
  188. package/dist/channels/index.js +2 -2
  189. package/dist/{chunk-Dr3R0DXk.d.ts → chunk-B-NVyPqN.d.ts} +2 -2
  190. package/dist/{chunk-Fg1Fm__9.d.ts → chunk-BCG2ui5q.d.ts} +671 -674
  191. package/dist/{chunk-DoIGKY33.d.ts → chunk-BLZXEm1K.d.ts} +6 -8
  192. package/dist/{chunk-CYuvV2sR.d.ts → chunk-BNRZY6Jq.d.ts} +3 -3
  193. package/dist/{chunk-CNqjcOmK.d.ts → chunk-BV_hETtB.d.ts} +2 -2
  194. package/dist/chunk-BcYKnZln.d.ts +10 -0
  195. package/dist/{chunk-BCoJQE-f.d.ts → chunk-BtKww7r1.d.ts} +6 -4
  196. package/dist/{chunk-Bpi2tz-6.d.ts → chunk-Bubi-WAs.d.ts} +20 -17
  197. package/dist/{chunk-pcFXCimE.d.ts → chunk-CmV7WZzR.d.ts} +124 -2
  198. package/dist/{chunk-BGkgZp-H.d.ts → chunk-D3uSIa6H.d.ts} +9 -1
  199. package/dist/{chunk-DROZ9oel.d.ts → chunk-DNCU78oW.d.ts} +110 -9
  200. package/dist/{chunk-D0NUmzXp.d.ts → chunk-LWwxlbee.d.ts} +4 -4
  201. package/dist/{chunk-BXLImeLy.d.ts → chunk-u_gGuTrz.d.ts} +23 -8
  202. package/dist/cli/index.d.ts +3 -3
  203. package/dist/cli/index.js +25 -30
  204. package/dist/cli/skills/content/index.d.ts +1 -1
  205. package/dist/cli/tools/sdk/child-host.d.ts +1 -1
  206. package/dist/cli/tools/sdk/child-host.js +17 -17
  207. package/dist/cli/tools/sdk/index.d.ts +3 -3
  208. package/dist/cli/tools/sdk/index.js +18 -18
  209. package/dist/cli-commands/bin/index.js +7 -7
  210. package/dist/client-logger/index.d.ts +20 -21
  211. package/dist/client-logger/index.js +2 -1
  212. package/dist/common/index.d.ts +13 -13
  213. package/dist/common/index.js +34 -35
  214. package/dist/components/index.d.ts +46 -35
  215. package/dist/components/index.js +194 -205
  216. package/dist/core-events/index.d.ts +2 -2
  217. package/dist/core-server/index.d.ts +15 -10
  218. package/dist/core-server/index.js +706 -165
  219. package/dist/core-server/presets/common-manager.js +254 -336
  220. package/dist/core-server/presets/common-override-preset.js +10 -10
  221. package/dist/core-server/presets/common-preset.js +83 -275
  222. package/dist/create/bin/index.js +7 -7
  223. package/dist/create/index.js +15 -15
  224. package/dist/csf/csf-utils.d.ts +1 -1
  225. package/dist/csf/index.d.ts +3 -3
  226. package/dist/csf/index.js +40 -43
  227. package/dist/csf-tools/index.d.ts +52 -44
  228. package/dist/csf-tools/index.js +13 -13
  229. package/dist/docs-tools/index.d.ts +332 -16
  230. package/dist/docs-tools/index.js +3 -3
  231. package/dist/instrumenter/index.d.ts +5 -5
  232. package/dist/instrumenter/index.js +25 -15
  233. package/dist/manager/_manager-chunks/{globals-runtime-DvV_TF3-.js → globals-runtime-B4NRbNSS.js} +2 -2
  234. package/dist/manager/_manager-chunks/{globals-runtime-wjkxyMn0.js → globals-runtime-BC43T1rL.js} +4150 -50
  235. package/dist/manager/_manager-chunks/{globals-runtime-BSj0mCjE.js → globals-runtime-BgWmCsA7.js} +114 -110
  236. package/dist/manager/_manager-chunks/{globals-runtime-CA8AuIRT.js → globals-runtime-BnQ7i5wq.js} +232 -228
  237. package/dist/manager/_manager-chunks/globals-runtime-BtduS2C2.js +10601 -0
  238. package/dist/manager/_manager-chunks/globals-runtime-BzuYs3dZ.js +1971 -0
  239. package/dist/manager/_manager-chunks/{globals-runtime-C5gK7HhH.js → globals-runtime-C59T0h-j.js} +2 -2
  240. package/dist/manager/_manager-chunks/{globals-runtime-CCTA-XPa.js → globals-runtime-CCZrdft6.js} +5 -4
  241. package/dist/manager/_manager-chunks/{globals-runtime-BY3epqww.js → globals-runtime-CS41oTca.js} +2 -1
  242. package/dist/manager/_manager-chunks/{globals-runtime-Bu9eGDTe.js → globals-runtime-Cccwtspx.js} +288 -420
  243. package/dist/manager/_manager-chunks/globals-runtime-CoTrrHG3.js +1163 -0
  244. package/dist/manager/_manager-chunks/{globals-runtime-BweHuXkK.js → globals-runtime-DCmvKMN5.js} +2 -2
  245. package/dist/manager/_manager-chunks/{globals-runtime-C92M_Vnq.js → globals-runtime-Ddp2jFET.js} +5 -5
  246. package/dist/manager/_manager-chunks/globals-runtime-DgO0hT2p.js +32 -0
  247. package/dist/manager/_manager-chunks/globals-runtime-Me9Bl-sx.js +156 -0
  248. package/dist/manager/_manager-chunks/{globals-runtime-CHjExYMv.js → globals-runtime-UFDJQlo-.js} +741 -540
  249. package/dist/manager/_manager-chunks/globals-runtime-nQMRiA0J.js +19 -0
  250. package/dist/manager/_manager-chunks/{globals-runtime-Bj5KDUJi.js → globals-runtime-oRjPg2jY.js} +1 -1
  251. package/dist/manager/_manager-chunks/runtime-4wMiTjjZ.js +552 -0
  252. package/dist/manager/_manager-chunks/{runtime--hR2NZFd.js → runtime-AvqHE9rM.js} +112 -109
  253. package/dist/manager/_manager-chunks/{runtime-EPerAEAs.js → runtime-CZtDJIYj.js} +3 -3
  254. package/dist/manager/_manager-chunks/{runtime-B6NL14pz.js → runtime-D8QxTQiI.js} +6 -6
  255. package/dist/manager/_manager-chunks/{runtime-BAsOe1C_.js → runtime-DC3oEVlM.js} +49 -49
  256. package/dist/manager/_manager-chunks/{runtime-CJQZFUUj.js → runtime-DCOIOn4T.js} +46 -56
  257. package/dist/manager/_manager-chunks/{runtime-DvB1axgp.js → runtime-D_FDSHFG.js} +13 -13
  258. package/dist/manager/_manager-chunks/{runtime-Dtbhxq5m.js → runtime-Db8fJ2MP.js} +67 -500
  259. package/dist/manager/_manager-chunks/{runtime-CgRqs_SK.js → runtime-lPbyY_f5.js} +882 -869
  260. package/dist/manager/_manager-chunks/{runtime-Dem2xJbS.js → runtime-td6oYfU6.js} +739 -554
  261. package/dist/manager/globals-runtime.js +1 -1
  262. package/dist/manager/runtime.js +1 -1
  263. package/dist/manager-api/index.d.ts +1 -1
  264. package/dist/manager-api/index.js +479 -464
  265. package/dist/manager-errors.d.ts +1 -1
  266. package/dist/mcp/index.d.ts +1 -1
  267. package/dist/mcp/index.js +9 -9
  268. package/dist/mocking-utils/index.d.ts +5 -3
  269. package/dist/mocking-utils/index.js +21 -26
  270. package/dist/nextjs-vite/export-mocks/headers/index.js +3 -1
  271. package/dist/nextjs-vite/export-mocks/link/index.d.ts +4 -1
  272. package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +9 -1
  273. package/dist/nextjs-vite/export-mocks/router/index.js +13 -7
  274. package/dist/nextjs-vite/index.d.ts +2 -2
  275. package/dist/nextjs-vite/index.js +9 -5
  276. package/dist/nextjs-vite/node/index.js +7 -7
  277. package/dist/nextjs-vite/preset.js +12 -12
  278. package/dist/nextjs-vite/preview.d.ts +2 -1
  279. package/dist/nextjs-vite/preview.js +1 -1
  280. package/dist/nextjs-vite/vite-plugin/index.d.ts +2 -2
  281. package/dist/nextjs-vite/vite-plugin/index.js +9 -9
  282. package/dist/nextjs-vite-plugin/index.js +17 -27
  283. package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
  284. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +10 -6
  285. package/dist/node-logger/index.d.ts +18 -18
  286. package/dist/node-logger/index.js +9 -9
  287. package/dist/oxc-parser/index.js +14 -11
  288. package/dist/oxc-parser/worker.js +10 -10
  289. package/dist/preview/_chunks/{runtime-Bcv1hJky.js → runtime-BYRCSYBN.js} +4148 -48
  290. package/dist/preview/_chunks/{runtime-WapFVPAh.js → runtime-Bvh_rfnQ.js} +2 -37
  291. package/dist/preview/_chunks/{runtime-BZ4pNS3g.js → runtime-CdZ1yk7m.js} +3 -3
  292. package/dist/preview/_chunks/{runtime-BhSZ1Mwt.js → runtime-CsO4apr9.js} +38 -42
  293. package/dist/preview/_chunks/{runtime-BUnOhg9h.js → runtime-D2MPrqbU.js} +2 -2
  294. package/dist/preview/_chunks/{runtime-BPwAnlRx.js → runtime-DS0s7U3c.js} +1 -1
  295. package/dist/preview/_chunks/{runtime-BgPhfM5P.js → runtime-U1Ycy25F.js} +736 -428
  296. package/dist/preview/_chunks/{runtime-BJwGQok8.js → runtime-tyJLgv6h.js} +221 -60
  297. package/dist/preview/runtime.js +1 -1
  298. package/dist/preview-api/index.d.ts +3 -3
  299. package/dist/preview-api/index.js +8 -8
  300. package/dist/preview-errors.d.ts +1 -1
  301. package/dist/react/docgen/docgen-worker.js +11 -11
  302. package/dist/react/entry-preview-argtypes.js +1 -1
  303. package/dist/react/entry-preview-docs.js +1 -1
  304. package/dist/react/entry-preview.js +1 -1
  305. package/dist/react/index.d.ts +5 -7
  306. package/dist/react/index.js +5 -5
  307. package/dist/react/preset.js +13 -13
  308. package/dist/react/preview.js +4 -4
  309. package/dist/react-native/bin/get-stories.js +8 -8
  310. package/dist/react-native/index.d.ts +37 -36
  311. package/dist/react-native/index.js +38 -38
  312. package/dist/react-native/metro/node.d.ts +1 -1
  313. package/dist/react-native/metro/node.js +10 -10
  314. package/dist/react-native/metro/withForkbook.d.ts +7 -7
  315. package/dist/react-native/metro/withForkbook.js +16 -16
  316. package/dist/react-native/preview.js +4 -1
  317. package/dist/react-native/scripts/generate.js +8 -8
  318. package/dist/react-native/stub.js +1 -1
  319. package/dist/react-native-ui/index.d.ts +8 -7
  320. package/dist/react-native-ui/index.js +1 -8
  321. package/dist/react-native-ui-common/index.d.ts +30 -9
  322. package/dist/react-native-ui-common/index.js +26 -31
  323. package/dist/react-vite/node/index.js +7 -7
  324. package/dist/react-vite/preset.js +7 -7
  325. package/dist/router/index.d.ts +2 -2
  326. package/dist/router/index.js +4 -2
  327. package/dist/server-errors.d.ts +1 -1
  328. package/dist/server-errors.js +9 -9
  329. package/dist/shared/open-service/index.d.ts +3 -3
  330. package/dist/shared/open-service/index.js +1 -1
  331. package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
  332. package/dist/shared/open-service/toolsets/docs/public.d.ts +7 -7
  333. package/dist/telemetry/index.d.ts +38 -274
  334. package/dist/telemetry/index.js +11 -66
  335. package/dist/test/index.d.ts +2 -2
  336. package/dist/test/index.js +139 -120
  337. package/dist/theming/create.d.ts +1 -1
  338. package/dist/theming/index.d.ts +1 -1
  339. package/dist/types/index.d.ts +2 -2
  340. package/dist/types/index.js +2 -2
  341. package/package.json +16 -16
  342. package/template/nextjs-vite/cli/js/Button.jsx +2 -2
  343. package/template/nextjs-vite/cli/js/Header.jsx +1 -1
  344. package/template/nextjs-vite/cli/js/Page.jsx +1 -1
  345. package/template/nextjs-vite/cli/ts/Button.tsx +2 -2
  346. package/template/nextjs-vite/cli/ts/Header.tsx +1 -1
  347. package/template/nextjs-vite/cli/ts/Page.tsx +1 -1
  348. package/template/react/cli/js/Button.jsx +2 -2
  349. package/template/react/cli/js/Header.jsx +1 -1
  350. package/template/react/cli/js/Page.jsx +1 -1
  351. package/template/react/cli/ts/Button.tsx +2 -2
  352. package/template/react/cli/ts/Header.tsx +1 -1
  353. package/template/react/cli/ts/Page.tsx +1 -1
  354. package/template/react-vite/cli/js/Button.jsx +2 -2
  355. package/template/react-vite/cli/js/Header.jsx +1 -1
  356. package/template/react-vite/cli/js/Page.jsx +1 -1
  357. package/template/react-vite/cli/ts/Button.tsx +2 -2
  358. package/template/react-vite/cli/ts/Header.tsx +1 -1
  359. package/template/react-vite/cli/ts/Page.tsx +1 -1
  360. package/dist/_node-chunks/chunk-2YNXKY72.js +0 -40
  361. package/dist/_node-chunks/chunk-3NST2GUZ.js +0 -33
  362. package/dist/_node-chunks/chunk-4D325SMT.js +0 -1359
  363. package/dist/_node-chunks/chunk-APXRPW7A.js +0 -11
  364. package/dist/_node-chunks/chunk-QHBQRPDP.js +0 -155
  365. package/dist/_node-chunks/chunk-SMBAR4G6.js +0 -18
  366. package/dist/_node-chunks/chunk-SRDKK3SG.js +0 -33
  367. package/dist/_node-chunks/chunk-V5IMPC3J.js +0 -33
  368. package/dist/_node-chunks/chunk-YIAUHGY2.js +0 -69
  369. package/dist/_node-chunks/dist-C5QIQD3G.js +0 -27
  370. package/dist/_node-chunks/dist-NBRPZCHX.js +0 -16
  371. package/dist/_node-chunks/optimized-tests-EIPJR7HA.js +0 -22
  372. package/dist/_node-chunks/postinstallAddon-EOAAURMG.js +0 -20
  373. package/dist/_node-chunks/session-id-HEW5JUNB.js +0 -23
  374. package/dist/chunk-BGhyFTJO.d.ts +0 -115
  375. package/dist/chunk-DaVb55-_.d.ts +0 -124
  376. package/dist/manager/_manager-chunks/globals-runtime-Bs75QQ_I.js +0 -9987
  377. package/dist/manager/_manager-chunks/globals-runtime-WZKaeKm9.js +0 -4091
  378. package/dist/manager/_manager-chunks/runtime-5o_11Jae.js +0 -78
  379. package/dist/preview/_chunks/runtime-BsMjBzuq.js +0 -53
  380. package/dist/preview/_chunks/runtime-C1jgT6tJ.js +0 -4091
  381. package/dist/preview/_chunks/runtime-CkOhMcXf.js +0 -387
@@ -1,23 +1,25 @@
1
1
  import { a as __toESM, n as __esmMin, r as __exportAll } from "./globals-runtime-BdGkqNEt.js";
2
- import { B as stringify, H as init_esm, L as init_dist, V as dedent, c as require_semver, s as require_store2, z as parse } from "./globals-runtime-CA8AuIRT.js";
3
- import { $ as countStatusesByValue, A as setStoryPathEntries, B as init_test, C as init_use_universal_store_manager, D as buildManagerHref, E as router_exports, F as init_routes, G as init_tags$1, H as BUILT_IN_FILTERS, I as isReviewManagerRoute, L as create, M as buildArgsParam, O as fromUrlPath, P as queryFromLocation, Q as UNIVERSAL_STATUS_STORE_OPTIONS, R as create_exports, S as init_mock, T as init_router, U as Tag, V as test_exports, W as USER_TAG_FILTER, _ as useServiceCommand, _t as StorybookError, b as init_test_provider_store, d as getService, et as createStatusStore, f as init_manager, gt as init_universal_store, h as useServiceQuery, ht as UniversalStore, j as toUrlPath, mt as init_global, n as theming_exports, nt as statusValueShortName, p as registerService, pt as global, rt as toStatusValue, t as init_theming, tt as init_status_store, v as UNIVERSAL_TEST_PROVIDER_STORE_OPTIONS, vt as init_storybook_error, w as useUniversalStore, x as MockUniversalStore, y as createTestProviderStore, z as init_create } from "./globals-runtime-Bu9eGDTe.js";
4
- import { $ as once, A as SET_WHATS_NEW_CACHE, B as STORY_PREPARED, C as SELECT_STORY, D as SET_GLOBALS, E as SET_FILTER, F as STORIES_EXPAND_ALL, G as UPDATE_GLOBALS, H as STORY_SPECIFIED, I as STORY_ARGS_UPDATED, J as core_events_exports, K as UPDATE_QUERY_PARAMS, L as STORY_CHANGED, M as SHARED_STATE_SET, N as SIDEBAR_FILTER_CHANGED, O as SET_INDEX, P as STORIES_COLLAPSE_ALL, Q as logger, R as STORY_INDEX_INVALIDATED, S as RESULT_WHATS_NEW_DATA, T as SET_CURRENT_STORY, U as TELEMETRY_ERROR, V as STORY_RENDER_PHASE_CHANGED, W as TOGGLE_WHATS_NEW_NOTIFICATIONS, X as client_logger_exports, Y as init_core_events, Z as init_client_logger, _ as OPEN_IN_EDITOR_RESPONSE, a as channels_exports, b as REQUEST_WHATS_NEW_DATA, c as init_channel_slot, d as CURRENT_STORY_WAS_SET, f as DOCS_PREPARED, g as OPEN_IN_EDITOR_REQUEST, h as NAVIGATE_URL, i as mockChannel, j as SHARED_STATE_CHANGED, k as SET_STORIES, l as setChannel, m as GLOBALS_UPDATED, n as init_components, o as init_channels, p as FORCE_REMOUNT, q as UPDATE_STORY_ARGS, r as init_mock_channel, s as getChannel, t as components_exports, u as CONFIG_ERROR, v as PRELOAD_ENTRIES, w as SET_CONFIG, x as RESET_STORY_ARGS, y as PREVIEW_KEYDOWN, z as STORY_MISSING } from "./globals-runtime-BSj0mCjE.js";
5
- import { D as require_client, E as require_jsx_runtime, O as require_react_dom, S as stringify$1, b as init_main, k as require_react } from "./globals-runtime-Bs75QQ_I.js";
6
- import { F as mergeWith, L as mapValues, N as omit, O as init_toMerged, P as init_mergeWith, R as init_isEqual, a as throttle, c as partition, i as init_throttle, j as pick, k as toMerged, l as countBy, o as require_copy_to_clipboard, t as require_browser_dtector_umd_min, z as isEqual } from "./globals-runtime-DvV_TF3-.js";
7
- import { $ as init_timer, $a as init_circle, $i as init_file_code, $n as init_network, $o as init_bold, $r as init_layers, $t as init_save, A as Users, Aa as CornerUpRight, Ai as GitFork, An as Pilcrow, Ao as Check, Ar as Mail, As as ArrowDownRight, At as Smartphone, B as Unlink, Ba as Command, Bi as Folder, Bn as PanelLeft, Bo as Calendar, Br as ListFilter, Bs as Accessibility, Bt as ShoppingBasket, C as init_watch, Ca as init_database, Ci as init_grid_2x2, Cn as init_plus, Co as init_chevron_up, Cr as init_menu, Cs as init_arrow_left, Ct as init_square_x, D as init_volume_2, Da as init_credit_card, Di as init_git_pull_request, Dn as init_pin, Do as init_chevron_left, Dr as init_maximize_2, Ds as init_arrow_down, Dt as init_square_arrow_out_up_right, E as Volume2, Ea as CreditCard, Ei as GitPullRequest, En as Pin, Eo as ChevronLeft, Er as Maximize2, Es as ArrowDown, Et as SquareArrowOutUpRight, F as init_user_plus, Fa as init_copy, Fi as init_git_branch, Fn as init_pencil, Fo as init_chart_line, Fr as init_lock_open, Fs as init_archive_restore, Ft as init_skip_forward, G as init_type, Ga as init_code, Gi as init_flask_conical, Gn as init_paintbrush_vertical, Go as init_brush_cleaning, Gr as init_link, Gt as init_share, H as UnfoldVertical, Ha as Columns2, Hi as FoldVertical, Hn as Paintbrush, Ho as Bug, Hr as ListChecks, Hs as LucideProvider, Ht as Shield, I as UserCog, Ia as Contrast, Ii as Gift, In as PenTool, Io as ChartColumn, Ir as List, Is as Apple, It as SkipBack, J as TriangleAlert, Ja as Cloud, Ji as Files, Jn as Nut, Jo as Bookmark, Jr as LifeBuoy, Jt as Settings, K as TrianglesCenterlineDashedHorizontal, Ka as CodeXml, Ki as Flag, Kn as Package, Ko as Briefcase, Kr as Library, Kt as Share2, L as init_user_cog, La as init_contrast, Li as init_gift, Ln as init_pen_tool, Lo as init_chart_column, Lr as init_list, Ls as init_apple, Lt as init_skip_back, M as User, Ma as CornerUpLeft, Mi as GitCommitHorizontal, Mn as Phone, Mo as CheckCheck, Mr as Lock, Ms as ArrowDownLeft, Mt as SlidersHorizontal, N as init_user, Na as init_corner_up_left, Ni as init_git_commit_horizontal, Nn as init_phone, No as init_check_check, Nr as init_lock, Ns as init_arrow_down_left, Nt as init_sliders_horizontal, O as Video, Oa as Cpu, Oi as GitMerge, On as PinOff, Oo as ChevronDown, Or as MapPin, Os as ArrowDownWideNarrow, Ot as SquareArrowDownLeft, P as UserPlus, Pa as Copy, Pi as GitBranch, Pn as Pencil, Po as ChartLine, Pr as LockOpen, Ps as ArchiveRestore, Pt as SkipForward, Q as Timer, Qa as Circle, Qi as FileCode, Qn as Network, Qo as Bold, Qr as Layers, Qt as Save, R as Upload, Ra as Compass, Ri as Gauge, Rn as Paperclip, Ro as Camera, Rr as ListOrdered, Rs as AppWindow, Rt as Signpost, S as Watch, Sa as Database, Si as Grid2x2, Sn as Plus, So as ChevronUp, Sr as Menu, Ss as ArrowLeft, St as SquareX, T as init_wand_sparkles, Ta as init_crosshair, Ti as init_globe, Tn as init_play, To as init_chevron_right, Tr as init_memory_stick, Ts as init_arrow_left_right, Tt as init_square_dashed, U as init_unfold_vertical, Ua as init_columns_2, Ui as init_fold_vertical, Un as init_paintbrush, Uo as init_bug, Ur as init_list_checks, Us as init_context$1, Ut as init_shield, V as init_unlink, Va as init_command, Vi as init_folder, Vn as init_panel_left, Vo as init_calendar, Vr as init_list_filter, Vs as init_accessibility, Vt as init_shopping_basket, W as Type, Wa as Code, Wi as FlaskConical, Wn as PaintbrushVertical, Wo as BrushCleaning, Wr as Link, Ws as require_memoizerific, Wt as Share, X as Trash, Xa as Clock, Xi as FileText, Xn as Newspaper, Xo as BookOpen, Xr as LayoutGrid, Xt as Search, Y as init_triangle_alert, Ya as init_cloud, Yi as init_files, Yn as init_nut, Yo as init_bookmark, Yr as init_life_buoy, Yt as init_settings$1, Z as init_trash, Za as init_clock, Zi as init_file_text, Zn as init_newspaper, Zo as init_book_open, Zr as init_layout_grid, Zt as init_search, _ as init_x, _a as init_download, _i as init_hard_drive, _n as init_printer, _o as init_circle_arrow_right, _r as init_message_square_text, _s as init_arrow_up_narrow_wide, _t as init_sticker, aa as init_face_slightly_frowning, ai as init_info, an as init_rows_2, ao as init_circle_stop, ar as init_moon, as as init_badge_check, at as init_text_align_start, b as Waypoints, ba as Delete, bi as GripVertical, bn as Pointer, bo as CircleAlert, br as MessageCircleMore, bs as ArrowRight, bt as Square, c as ZoomOut, ca as Eye, ci as IdCard, cn as RotateCcw, co as CircleQuestionMark, cr as MonitorPlay, cs as AtSign, ct as Terminal, d as init_zoom_in, da as init_eye_off, di as init_house, dn as init_rewind, do as init_circle_play, dr as init_minus, ds as init_atom, dt as init_tag, ea as FastForward, ei as Key, en as Ruler, eo as CircleX, er as MousePointerClick, es as Bell, et as ThumbsUp, f as Zap, fa as Expand, fi as Hourglass, fn as RefreshCw, fo as CirclePlus, fr as MessagesSquare, fs as ArrowUp, ft as Tablet, g as X, ga as Download, gi as HardDrive, gn as Printer, go as CircleArrowRight, gr as MessageSquareText, gs as ArrowUpNarrowWide, gt as Sticker, h as init_zap_off, ha as init_ellipsis, hi as init_heart, hn as init_puzzle, ho as init_circle_check, hr as init_message_square, hs as init_arrow_up_right, ht as init_sun, ia as FaceSlightlyFrowning, ii as Info, in as Rows2, io as CircleStop, ir as Moon, is as BadgeCheck, it as TextAlignStart, j as init_users, ja as init_corner_up_right, ji as init_git_fork, jn as init_pilcrow, jo as init_check, jr as init_mail, js as init_arrow_down_right, jt as init_smartphone, k as init_video, ka as init_cpu, ki as init_git_merge, kn as init_pin_off, ko as init_chevron_down, kr as init_map_pin, ks as init_arrow_down_wide_narrow, kt as init_square_arrow_down_left, l as init_zoom_out, la as init_eye, li as init_id_card, ln as init_rotate_ccw, lo as init_circle_question_mark, lr as init_monitor_play, ls as init_at_sign, lt as init_terminal, m as ZapOff, ma as Ellipsis, mi as Heart, mn as Puzzle, mo as CircleCheck, mr as MessageSquare, ms as ArrowUpRight, mt as Sun, na as FaceSlightlySmiling, ni as Italic, nn as Rss, no as CircleUser, nr as MousePointer2, ns as Ban, nt as TextCursorInput, oa as FaceNeutral, oi as Image, on as RotateCw, oo as CircleSlash2, or as Monitor, os as Award, ot as TextAlignEnd, p as init_zap, pa as init_expand, pi as init_hourglass, pn as init_refresh_cw, po as init_circle_plus, pr as init_messages_square, ps as init_arrow_up, pt as init_tablet, q as init_triangles_centerline_dashed_horizontal, qa as init_code_xml, qi as init_flag, qn as init_package, qo as init_briefcase, qr as init_library, qt as init_share_2, ra as init_face_slightly_smiling, ri as init_italic, rn as init_rss, ro as init_circle_user, rr as init_mouse_pointer_2, rs as init_ban, rt as init_text_cursor_input, sa as init_face_neutral, si as init_image, sn as init_rotate_cw, so as init_circle_slash_2, sr as init_monitor, ss as init_award, st as init_text_align_end, ta as init_fast_forward, ti as init_key, tn as init_ruler, to as init_circle_x, tr as init_mouse_pointer_click, ts as init_bell, tt as init_thumbs_up, u as ZoomIn, ua as EyeOff, ui as House, un as Rewind, uo as CirclePlay, ur as Minus, us as Atom, ut as Tag$1, v as Wrench, va as Diamond, vi as Grid3x3, vn as Power, vo as CircleArrowLeft, vr as MessageCircle, vs as ArrowUpLeft, vt as Star, w as WandSparkles, wa as Crosshair, wi as Globe, wn as Play, wo as ChevronRight, wr as MemoryStick, ws as ArrowLeftRight, wt as SquareDashed, x as init_waypoints, xa as init_delete, xi as init_grip_vertical, xn as init_pointer, xo as init_circle_alert, xr as init_message_circle_more, xs as init_arrow_right, xt as init_square, y as init_wrench, ya as init_diamond, yi as init_grid_3x3, yn as init_power, yo as init_circle_arrow_left, yr as init_message_circle, ys as init_arrow_up_left, yt as init_star, z as init_upload, za as init_compass, zi as init_gauge, zn as init_paperclip, zo as init_camera, zr as init_list_ordered, zs as init_app_window, zt as init_signpost } from "./globals-runtime-Bj5KDUJi.js";
8
- import { n as types_exports, r as Addon_TypesEnum, t as init_types } from "./globals-runtime-C5gK7HhH.js";
9
- import { h as processError, m as init_error } from "./globals-runtime-BweHuXkK.js";
2
+ import { B as stringify, H as init_esm, L as init_dist, V as dedent, c as require_semver, s as require_store2, z as parse } from "./globals-runtime-BnQ7i5wq.js";
3
+ import { $ as countStatusesByValue, A as setStoryPathEntries, B as init_test, C as init_use_universal_store_manager, D as buildManagerHref, E as router_exports, F as init_routes, G as init_tags$1, H as BUILT_IN_FILTERS, I as isReviewManagerRoute, L as create, M as buildArgsParam, O as fromUrlPath, P as queryFromLocation, Q as UNIVERSAL_STATUS_STORE_OPTIONS, R as create_exports, S as init_mock, T as init_router, U as Tag, V as test_exports, W as USER_TAG_FILTER, _ as useServiceCommand, _t as UniversalStore, b as init_test_provider_store, bt as init_storybook_error, d as getService, et as createStatusStore, f as init_manager, gt as init_global, h as useServiceQuery, ht as global, it as formatIssues, j as toUrlPath, n as theming_exports, nt as statusValueShortName, p as registerService, rt as toStatusValue, t as init_theming, tt as init_status_store, v as UNIVERSAL_TEST_PROVIDER_STORE_OPTIONS, vt as init_universal_store, w as useUniversalStore, x as MockUniversalStore, y as createTestProviderStore, yt as StorybookError, z as init_create } from "./globals-runtime-Cccwtspx.js";
4
+ import { $ as once, A as SET_WHATS_NEW_CACHE, B as STORY_PREPARED, C as SELECT_STORY, D as SET_GLOBALS, E as SET_FILTER, F as STORIES_EXPAND_ALL, G as UPDATE_GLOBALS, H as STORY_SPECIFIED, I as STORY_ARGS_UPDATED, J as core_events_exports, K as UPDATE_QUERY_PARAMS, L as STORY_CHANGED, M as SHARED_STATE_SET, N as SIDEBAR_FILTER_CHANGED, O as SET_INDEX, P as STORIES_COLLAPSE_ALL, Q as logger, R as STORY_INDEX_INVALIDATED, S as RESULT_WHATS_NEW_DATA, T as SET_CURRENT_STORY, U as TELEMETRY_ERROR, V as STORY_RENDER_PHASE_CHANGED, W as TOGGLE_WHATS_NEW_NOTIFICATIONS, X as client_logger_exports, Y as init_core_events, Z as init_client_logger, _ as OPEN_IN_EDITOR_RESPONSE, a as channels_exports, b as REQUEST_WHATS_NEW_DATA, c as init_channel_slot, d as CURRENT_STORY_WAS_SET, f as DOCS_PREPARED, g as OPEN_IN_EDITOR_REQUEST, h as NAVIGATE_URL, i as mockChannel, j as SHARED_STATE_CHANGED, k as SET_STORIES, l as setChannel, m as GLOBALS_UPDATED, n as init_components, o as init_channels, p as FORCE_REMOUNT, q as UPDATE_STORY_ARGS, r as init_mock_channel, s as getChannel, t as components_exports, u as CONFIG_ERROR, v as PRELOAD_ENTRIES, w as SET_CONFIG, x as RESET_STORY_ARGS, y as PREVIEW_KEYDOWN, z as STORY_MISSING } from "./globals-runtime-BgWmCsA7.js";
5
+ import { i as require_react, r as require_jsx_runtime } from "./globals-runtime-nQMRiA0J.js";
6
+ import { n as require_react_dom, t as require_client } from "./globals-runtime-DgO0hT2p.js";
7
+ import { F as mergeWith, L as mapValues, N as omit, O as init_toMerged, P as init_mergeWith, R as init_isEqual, a as throttle, c as partition, i as init_throttle, j as pick, k as toMerged, l as countBy, o as require_copy_to_clipboard, t as require_browser_dtector_umd_min, z as isEqual } from "./globals-runtime-B4NRbNSS.js";
8
+ import { $ as init_timer, $a as init_circle, $i as init_file_code, $n as init_network, $o as init_bold, $r as init_layers, $t as init_save, A as Users, Aa as CornerUpRight, Ai as GitFork, An as Pilcrow, Ao as Check, Ar as Mail, As as ArrowDownRight, At as Smartphone, B as Unlink, Ba as Command, Bi as Folder, Bn as PanelLeft, Bo as Calendar, Br as ListFilter, Bs as Accessibility, Bt as ShoppingBasket, C as init_watch, Ca as init_database, Ci as init_grid_2x2, Cn as init_plus, Co as init_chevron_up, Cr as init_menu, Cs as init_arrow_left, Ct as init_square_x, D as init_volume_2, Da as init_credit_card, Di as init_git_pull_request, Dn as init_pin, Do as init_chevron_left, Dr as init_maximize_2, Ds as init_arrow_down, Dt as init_square_arrow_out_up_right, E as Volume2, Ea as CreditCard, Ei as GitPullRequest, En as Pin, Eo as ChevronLeft, Er as Maximize2, Es as ArrowDown, Et as SquareArrowOutUpRight, F as init_user_plus, Fa as init_copy, Fi as init_git_branch, Fn as init_pencil, Fo as init_chart_line, Fr as init_lock_open, Fs as init_archive_restore, Ft as init_skip_forward, G as init_type, Ga as init_code, Gi as init_flask_conical, Gn as init_paintbrush_vertical, Go as init_brush_cleaning, Gr as init_link, Gt as init_share, H as UnfoldVertical, Ha as Columns2, Hi as FoldVertical, Hn as Paintbrush, Ho as Bug, Hr as ListChecks, Hs as LucideProvider, Ht as Shield, I as UserCog, Ia as Contrast, Ii as Gift, In as PenTool, Io as ChartColumn, Ir as List, Is as Apple, It as SkipBack, J as TriangleAlert, Ja as Cloud, Ji as Files, Jn as Nut, Jo as Bookmark, Jr as LifeBuoy, Jt as Settings, K as TrianglesCenterlineDashedHorizontal, Ka as CodeXml, Ki as Flag, Kn as Package, Ko as Briefcase, Kr as Library, Kt as Share2, L as init_user_cog, La as init_contrast, Li as init_gift, Ln as init_pen_tool, Lo as init_chart_column, Lr as init_list, Ls as init_apple, Lt as init_skip_back, M as User, Ma as CornerUpLeft, Mi as GitCommitHorizontal, Mn as Phone, Mo as CheckCheck, Mr as Lock, Ms as ArrowDownLeft, Mt as SlidersHorizontal, N as init_user, Na as init_corner_up_left, Ni as init_git_commit_horizontal, Nn as init_phone, No as init_check_check, Nr as init_lock, Ns as init_arrow_down_left, Nt as init_sliders_horizontal, O as Video, Oa as Cpu, Oi as GitMerge, On as PinOff, Oo as ChevronDown, Or as MapPin, Os as ArrowDownWideNarrow, Ot as SquareArrowDownLeft, P as UserPlus, Pa as Copy, Pi as GitBranch, Pn as Pencil, Po as ChartLine, Pr as LockOpen, Ps as ArchiveRestore, Pt as SkipForward, Q as Timer, Qa as Circle, Qi as FileCode, Qn as Network, Qo as Bold, Qr as Layers, Qt as Save, R as Upload, Ra as Compass, Ri as Gauge, Rn as Paperclip, Ro as Camera, Rr as ListOrdered, Rs as AppWindow, Rt as Signpost, S as Watch, Sa as Database, Si as Grid2x2, Sn as Plus, So as ChevronUp, Sr as Menu, Ss as ArrowLeft, St as SquareX, T as init_wand_sparkles, Ta as init_crosshair, Ti as init_globe, Tn as init_play, To as init_chevron_right, Tr as init_memory_stick, Ts as init_arrow_left_right, Tt as init_square_dashed, U as init_unfold_vertical, Ua as init_columns_2, Ui as init_fold_vertical, Un as init_paintbrush, Uo as init_bug, Ur as init_list_checks, Us as init_context$1, Ut as init_shield, V as init_unlink, Va as init_command, Vi as init_folder, Vn as init_panel_left, Vo as init_calendar, Vr as init_list_filter, Vs as init_accessibility, Vt as init_shopping_basket, W as Type, Wa as Code, Wi as FlaskConical, Wn as PaintbrushVertical, Wo as BrushCleaning, Wr as Link, Ws as require_memoizerific, Wt as Share, X as Trash, Xa as Clock, Xi as FileText, Xn as Newspaper, Xo as BookOpen, Xr as LayoutGrid, Xt as Search, Y as init_triangle_alert, Ya as init_cloud, Yi as init_files, Yn as init_nut, Yo as init_bookmark, Yr as init_life_buoy, Yt as init_settings$1, Z as init_trash, Za as init_clock, Zi as init_file_text, Zn as init_newspaper, Zo as init_book_open, Zr as init_layout_grid, Zt as init_search, _ as init_x, _a as init_download, _i as init_hard_drive, _n as init_printer, _o as init_circle_arrow_right, _r as init_message_square_text, _s as init_arrow_up_narrow_wide, _t as init_sticker, aa as init_face_slightly_frowning, ai as init_info, an as init_rows_2, ao as init_circle_stop, ar as init_moon, as as init_badge_check, at as init_text_align_start, b as Waypoints, ba as Delete, bi as GripVertical, bn as Pointer, bo as CircleAlert, br as MessageCircleMore, bs as ArrowRight, bt as Square, c as ZoomOut, ca as Eye, ci as IdCard, cn as RotateCcw, co as CircleQuestionMark, cr as MonitorPlay, cs as AtSign, ct as Terminal, d as init_zoom_in, da as init_eye_off, di as init_house, dn as init_rewind, do as init_circle_play, dr as init_minus, ds as init_atom, dt as init_tag, ea as FastForward, ei as Key, en as Ruler, eo as CircleX, er as MousePointerClick, es as Bell, et as ThumbsUp, f as Zap, fa as Expand, fi as Hourglass, fn as RefreshCw, fo as CirclePlus, fr as MessagesSquare, fs as ArrowUp, ft as Tablet, g as X, ga as Download, gi as HardDrive, gn as Printer, go as CircleArrowRight, gr as MessageSquareText, gs as ArrowUpNarrowWide, gt as Sticker, h as init_zap_off, ha as init_ellipsis, hi as init_heart, hn as init_puzzle, ho as init_circle_check, hr as init_message_square, hs as init_arrow_up_right, ht as init_sun, ia as FaceSlightlyFrowning, ii as Info, in as Rows2, io as CircleStop, ir as Moon, is as BadgeCheck, it as TextAlignStart, j as init_users, ja as init_corner_up_right, ji as init_git_fork, jn as init_pilcrow, jo as init_check, jr as init_mail, js as init_arrow_down_right, jt as init_smartphone, k as init_video, ka as init_cpu, ki as init_git_merge, kn as init_pin_off, ko as init_chevron_down, kr as init_map_pin, ks as init_arrow_down_wide_narrow, kt as init_square_arrow_down_left, l as init_zoom_out, la as init_eye, li as init_id_card, ln as init_rotate_ccw, lo as init_circle_question_mark, lr as init_monitor_play, ls as init_at_sign, lt as init_terminal, m as ZapOff, ma as Ellipsis, mi as Heart, mn as Puzzle, mo as CircleCheck, mr as MessageSquare, ms as ArrowUpRight, mt as Sun, na as FaceSlightlySmiling, ni as Italic, nn as Rss, no as CircleUser, nr as MousePointer2, ns as Ban, nt as TextCursorInput, oa as FaceNeutral, oi as Image, on as RotateCw, oo as CircleSlash2, or as Monitor, os as Award, ot as TextAlignEnd, p as init_zap, pa as init_expand, pi as init_hourglass, pn as init_refresh_cw, po as init_circle_plus, pr as init_messages_square, ps as init_arrow_up, pt as init_tablet, q as init_triangles_centerline_dashed_horizontal, qa as init_code_xml, qi as init_flag, qn as init_package, qo as init_briefcase, qr as init_library, qt as init_share_2, ra as init_face_slightly_smiling, ri as init_italic, rn as init_rss, ro as init_circle_user, rr as init_mouse_pointer_2, rs as init_ban, rt as init_text_cursor_input, sa as init_face_neutral, si as init_image, sn as init_rotate_cw, so as init_circle_slash_2, sr as init_monitor, ss as init_award, st as init_text_align_end, ta as init_fast_forward, ti as init_key, tn as init_ruler, to as init_circle_x, tr as init_mouse_pointer_click, ts as init_bell, tt as init_thumbs_up, u as ZoomIn, ua as EyeOff, ui as House, un as Rewind, uo as CirclePlay, ur as Minus, us as Atom, ut as Tag$1, v as Wrench, va as Diamond, vi as Grid3x3, vn as Power, vo as CircleArrowLeft, vr as MessageCircle, vs as ArrowUpLeft, vt as Star, w as WandSparkles, wa as Crosshair, wi as Globe, wn as Play, wo as ChevronRight, wr as MemoryStick, ws as ArrowLeftRight, wt as SquareDashed, x as init_waypoints, xa as init_delete, xi as init_grip_vertical, xn as init_pointer, xo as init_circle_alert, xr as init_message_circle_more, xs as init_arrow_right, xt as init_square, y as init_wrench, ya as init_diamond, yi as init_grid_3x3, yn as init_power, yo as init_circle_arrow_left, yr as init_message_circle, ys as init_arrow_up_left, yt as init_star, z as init_upload, za as init_compass, zi as init_gauge, zn as init_paperclip, zo as init_camera, zr as init_list_ordered, zs as init_app_window, zt as init_signpost } from "./globals-runtime-oRjPg2jY.js";
9
+ import { n as types_exports, r as Addon_TypesEnum, t as init_types } from "./globals-runtime-C59T0h-j.js";
10
+ import { c as stringify$1, o as init_main } from "./globals-runtime-BzuYs3dZ.js";
11
+ import { h as processError, m as init_error } from "./globals-runtime-DCmvKMN5.js";
10
12
  //#region src/manager-errors.ts
11
13
  var manager_errors_exports = /* @__PURE__ */ __exportAll({
12
14
  Category: () => Category,
13
15
  OpenServiceStaticSnapshotInvalidError: () => OpenServiceStaticSnapshotInvalidError,
14
16
  OpenServiceStaticSnapshotLoadError: () => OpenServiceStaticSnapshotLoadError,
15
17
  ProviderDoesNotExtendBaseProviderError: () => ProviderDoesNotExtendBaseProviderError,
16
- StatusTypeIdMismatchError: () => StatusTypeIdMismatchError$1,
18
+ StatusTypeIdMismatchError: () => StatusTypeIdMismatchError$2,
17
19
  UncaughtManagerError: () => UncaughtManagerError,
18
20
  UniversalStoreFollowerTimeoutError: () => UniversalStoreFollowerTimeoutError
19
21
  });
20
- var Category, ProviderDoesNotExtendBaseProviderError, UncaughtManagerError, StatusTypeIdMismatchError$1, UniversalStoreFollowerTimeoutError, OpenServiceStaticSnapshotLoadError, OpenServiceStaticSnapshotInvalidError;
22
+ var Category, ProviderDoesNotExtendBaseProviderError, UncaughtManagerError, StatusTypeIdMismatchError$2, UniversalStoreFollowerTimeoutError, OpenServiceStaticSnapshotLoadError, OpenServiceStaticSnapshotInvalidError;
21
23
  function init_manager_errors() {
22
24
  return (init_manager_errors = __esmMin((() => {
23
25
  init_storybook_error();
@@ -56,7 +58,7 @@ function init_manager_errors() {
56
58
  this.stack = data.error.stack;
57
59
  }
58
60
  };
59
- StatusTypeIdMismatchError$1 = class extends StorybookError {
61
+ StatusTypeIdMismatchError$2 = class extends StorybookError {
60
62
  constructor(data) {
61
63
  super({
62
64
  name: "StatusTypeIdMismatchError",
@@ -104,7 +106,7 @@ function init_manager_errors() {
104
106
  }
105
107
  //#endregion
106
108
  //#region src/preview-errors.ts
107
- var InvalidChannelPageError, StatusTypeIdMismatchError;
109
+ var InvalidChannelPageError, StatusTypeIdMismatchError$1;
108
110
  function init_preview_errors() {
109
111
  return (init_preview_errors = __esmMin((() => {
110
112
  init_storybook_error();
@@ -119,7 +121,7 @@ function init_preview_errors() {
119
121
  this.data = data;
120
122
  }
121
123
  };
122
- StatusTypeIdMismatchError = class extends StorybookError {
124
+ StatusTypeIdMismatchError$1 = class extends StorybookError {
123
125
  constructor(data) {
124
126
  super({
125
127
  name: "StatusTypeIdMismatchError",
@@ -229,6 +231,185 @@ function init_initial_state() {
229
231
  })))();
230
232
  }
231
233
  //#endregion
234
+ //#region src/errors/server/dev-server.ts
235
+ var StatusTypeIdMismatchError;
236
+ function init_dev_server() {
237
+ return (init_dev_server = __esmMin((() => {
238
+ init_storybook_error();
239
+ StatusTypeIdMismatchError = class extends StorybookError {
240
+ constructor(data) {
241
+ super({
242
+ name: "StatusTypeIdMismatchError",
243
+ category: "CORE-SERVER",
244
+ code: 16,
245
+ message: `Status has typeId "${data.status.typeId}" but was added to store with typeId "${data.typeId}". Full status: ${JSON.stringify(data.status, null, 2)}`
246
+ });
247
+ this.data = data;
248
+ }
249
+ };
250
+ })))();
251
+ }
252
+ //#endregion
253
+ //#region src/errors/server/open-service.ts
254
+ var OpenServiceValidationError, OpenServiceMissingServiceError, OpenServiceInternalServiceError, OpenServiceUnimplementedOperationError, OpenServiceInvalidStaticPathError, OpenServiceAsyncSchemaError, OpenServiceLoadedDrainExceededError, OpenServiceMissingChannelError, OpenServiceRemoteCommandDisconnectedError, OpenServiceRemoteCommandUnhandledError, OpenServiceRemoteCommandConfigDriftError, OpenServiceAsyncRecipeError, OpenServiceCyclicStateError, OpenServiceOperationNameCollisionError;
255
+ function init_open_service() {
256
+ return (init_open_service = __esmMin((() => {
257
+ init_storybook_error();
258
+ OpenServiceValidationError = class extends StorybookError {
259
+ constructor(data) {
260
+ super({
261
+ name: "OpenServiceValidationError",
262
+ category: "CORE-COMMON",
263
+ code: 5,
264
+ message: `Invalid ${data.phase} for ${data.kind} "${data.serviceId}.${data.name}":\n${formatIssues(data.issues)}`
265
+ });
266
+ this.data = data;
267
+ }
268
+ };
269
+ OpenServiceMissingServiceError = class extends StorybookError {
270
+ constructor(data) {
271
+ super({
272
+ name: "OpenServiceMissingServiceError",
273
+ category: "CORE-COMMON",
274
+ code: 7,
275
+ message: `No registered service with id "${data.serviceId}" exists in this environment.`
276
+ });
277
+ this.data = data;
278
+ }
279
+ };
280
+ OpenServiceInternalServiceError = class extends StorybookError {
281
+ constructor(data) {
282
+ super({
283
+ name: "OpenServiceInternalServiceError",
284
+ category: "CORE-COMMON",
285
+ code: 19,
286
+ message: `Service "${data.serviceId}" is internal. Pass { internal: true } to getService() only if you intentionally depend on an unstable OSA surface. Internal services may change without notice.`
287
+ });
288
+ this.data = data;
289
+ }
290
+ };
291
+ OpenServiceUnimplementedOperationError = class extends StorybookError {
292
+ constructor(data) {
293
+ super({
294
+ name: "OpenServiceUnimplementedOperationError",
295
+ category: "CORE-COMMON",
296
+ code: 8,
297
+ message: `${data.kind[0].toUpperCase()}${data.kind.slice(1)} "${data.serviceId}.${data.name}" is not implemented for this environment.`
298
+ });
299
+ this.data = data;
300
+ }
301
+ };
302
+ OpenServiceInvalidStaticPathError = class extends StorybookError {
303
+ constructor(data) {
304
+ super({
305
+ name: "OpenServiceInvalidStaticPathError",
306
+ category: "CORE-COMMON",
307
+ code: 10,
308
+ message: `Invalid static path "${data.path}" for query "${data.serviceId}.${data.name}": use a relative path with forward slashes and no ".." segments.`
309
+ });
310
+ this.data = data;
311
+ }
312
+ };
313
+ OpenServiceAsyncSchemaError = class extends StorybookError {
314
+ constructor(data) {
315
+ super({
316
+ name: "OpenServiceAsyncSchemaError",
317
+ category: "CORE-COMMON",
318
+ code: 9,
319
+ message: `Async schema for ${data.kind} "${data.serviceId}.${data.name}" (${data.phase}): query input and output schemas must validate synchronously.`
320
+ });
321
+ this.data = data;
322
+ }
323
+ };
324
+ OpenServiceLoadedDrainExceededError = class extends StorybookError {
325
+ constructor(data) {
326
+ super({
327
+ name: "OpenServiceLoadedDrainExceededError",
328
+ category: "CORE-COMMON",
329
+ code: 11,
330
+ message: `Query "${data.serviceId}.${data.name}".loaded(...) did not settle after ${data.iterations} drain iterations. Check for handlers that keep discovering new dependencies after every state change.`
331
+ });
332
+ this.data = data;
333
+ }
334
+ };
335
+ OpenServiceMissingChannelError = class extends StorybookError {
336
+ constructor(data = {}) {
337
+ super({
338
+ name: "OpenServiceMissingChannelError",
339
+ category: "CORE-COMMON",
340
+ code: 13,
341
+ message: data.serviceId ? `Cannot register service "${data.serviceId}": the Forkbook addons channel is not installed in this runtime.` : "The Forkbook addons channel is not installed in this runtime."
342
+ });
343
+ this.data = data;
344
+ }
345
+ };
346
+ OpenServiceRemoteCommandDisconnectedError = class extends StorybookError {
347
+ constructor(data) {
348
+ super({
349
+ name: "OpenServiceRemoteCommandDisconnectedError",
350
+ category: "CORE-COMMON",
351
+ code: 14,
352
+ message: `Service "${data.serviceId}" was unregistered before a remote command resolved.`
353
+ });
354
+ this.data = data;
355
+ }
356
+ };
357
+ OpenServiceRemoteCommandUnhandledError = class extends StorybookError {
358
+ constructor(data) {
359
+ super({
360
+ name: "OpenServiceRemoteCommandUnhandledError",
361
+ category: "CORE-COMMON",
362
+ code: 15,
363
+ message: data.delegated ? `The Forkbook this runtime is attached to did not acknowledge remote command "${data.serviceId}.${data.commandName}" in time — it may be busy or unreachable. Retry; note the command may still have executed on that instance.` : `No runtime acknowledged remote command "${data.serviceId}.${data.commandName}"; its handler is not implemented in any connected runtime.`
364
+ });
365
+ this.data = data;
366
+ }
367
+ };
368
+ OpenServiceRemoteCommandConfigDriftError = class extends StorybookError {
369
+ constructor(data) {
370
+ super({
371
+ name: "OpenServiceRemoteCommandConfigDriftError",
372
+ category: "CORE-COMMON",
373
+ code: 30,
374
+ message: `The Forkbook this runtime is attached to reported it has no handler for remote command "${data.serviceId}.${data.commandName}". The two processes are running different configurations (for example a feature flag enabled in one but not the other). Restart the attached Forkbook with a configuration matching this process.`
375
+ });
376
+ this.data = data;
377
+ }
378
+ };
379
+ OpenServiceAsyncRecipeError = class extends StorybookError {
380
+ constructor() {
381
+ super({
382
+ name: "OpenServiceAsyncRecipeError",
383
+ category: "CORE-COMMON",
384
+ code: 31,
385
+ message: "setState recipes must be synchronous. A write after an await would change state without authoring a sync entry. Split the command into one setState per synchronous step."
386
+ });
387
+ }
388
+ };
389
+ OpenServiceCyclicStateError = class extends StorybookError {
390
+ constructor() {
391
+ super({
392
+ name: "OpenServiceCyclicStateError",
393
+ category: "CORE-COMMON",
394
+ code: 32,
395
+ message: "Service state must be JSON-serializable, but the value is cyclic or nested more than 256 levels deep. Store an id and look the value up in a query instead of a reference."
396
+ });
397
+ }
398
+ };
399
+ OpenServiceOperationNameCollisionError = class extends StorybookError {
400
+ constructor(data) {
401
+ super({
402
+ name: "OpenServiceOperationNameCollisionError",
403
+ category: "CORE-COMMON",
404
+ code: 16,
405
+ message: `Service "${data.serviceId}" cannot register "${data.operationName}" as both a query and a command.`
406
+ });
407
+ this.data = data;
408
+ }
409
+ };
410
+ })))();
411
+ }
412
+ //#endregion
232
413
  //#region src/manager-api/lib/addons.ts
233
414
  function getAddonsStore() {
234
415
  if (!globalThis[KEY]) globalThis[KEY] = new AddonStore();
@@ -359,7 +540,7 @@ function init_addons$1() {
359
540
  }
360
541
  }), options).then(() => api.getAddonState(addonId));
361
542
  },
362
- getAddonState: (addonId) => {
543
+ getAddonState(addonId) {
363
544
  return store.getState().addons[addonId] || globalThis?.FORKBOOK_ADDON_STATE[addonId];
364
545
  }
365
546
  };
@@ -376,9 +557,10 @@ function init_addons$1() {
376
557
  //#endregion
377
558
  //#region src/manager-api/modules/channel.ts
378
559
  var channel_exports = /* @__PURE__ */ __exportAll({ init: () => init$12 });
379
- var init$12;
560
+ var hasTarget, init$12;
380
561
  function init_channel() {
381
562
  return (init_channel = __esmMin((() => {
563
+ hasTarget = (data) => typeof data === "object" && data !== null && "options" in data && typeof data.options === "object" && data.options !== null && "target" in data.options && typeof data.options.target === "string";
382
564
  init$12 = ({ provider }) => {
383
565
  return {
384
566
  api: {
@@ -390,7 +572,7 @@ function init_channel() {
390
572
  off: (type, handler) => provider.channel?.off(type, handler),
391
573
  once: (type, handler) => provider.channel?.once(type, handler),
392
574
  emit: (type, data, ...args) => {
393
- if (data?.options?.target && data.options.target !== "storybook-preview-iframe" && !data.options.target.startsWith("storybook-ref-")) data.options.target = data.options.target !== "storybook_internal" ? `storybook-ref-${data.options.target}` : "storybook-preview-iframe";
575
+ if (hasTarget(data) && data.options.target && data.options.target !== "storybook-preview-iframe" && !data.options.target.startsWith("storybook-ref-")) data.options.target = data.options.target !== "storybook_internal" ? `storybook-ref-${data.options.target}` : "storybook-preview-iframe";
394
576
  provider.channel?.emit(type, data, ...args);
395
577
  }
396
578
  },
@@ -466,8 +648,8 @@ function instrument(obj, options = {}) {
466
648
  if (global.window?.location?.search?.includes("instrument=true")) forceInstrument = true;
467
649
  else if (global.window?.location?.search?.includes("instrument=false")) skipInstrument = true;
468
650
  if (global.window?.parent === global.window && !forceInstrument || skipInstrument) return obj;
469
- if (global.window && !global.window.__FORKBOOK_ADDON_INTERACTIONS_INSTRUMENTER__) global.window.__FORKBOOK_ADDON_INTERACTIONS_INSTRUMENTER__ = new Instrumenter();
470
- return (global.window?.__FORKBOOK_ADDON_INTERACTIONS_INSTRUMENTER__).instrument(obj, options);
651
+ global.window.__FORKBOOK_ADDON_INTERACTIONS_INSTRUMENTER__ ??= new Instrumenter();
652
+ return global.window.__FORKBOOK_ADDON_INTERACTIONS_INSTRUMENTER__.instrument(obj, options);
471
653
  } catch (e) {
472
654
  once.warn(e);
473
655
  return obj;
@@ -487,7 +669,7 @@ function isClass(obj) {
487
669
  if (!descriptor) return false;
488
670
  return !descriptor.writable;
489
671
  }
490
- var alreadyCompletedException, isObject, isModule, isInstrumentable, construct, getInitialState, getRetainedState, Instrumenter;
672
+ var alreadyCompletedException, isObject, isModule, isCallRef, isInstrumentable, construct, getInitialState, getRetainedState, Instrumenter;
491
673
  function init_instrumenter() {
492
674
  return (init_instrumenter = __esmMin((() => {
493
675
  init_client_logger();
@@ -499,6 +681,7 @@ function init_instrumenter() {
499
681
  alreadyCompletedException = /* @__PURE__ */ new Error(`This function ran after the play function completed. Did you forget to \`await\` it?`);
500
682
  isObject = (o) => Object.prototype.toString.call(o) === "[object Object]";
501
683
  isModule = (o) => Object.prototype.toString.call(o) === "[object Module]";
684
+ isCallRef = (value) => typeof value === "object" && value !== null && "__callId__" in value;
502
685
  isInstrumentable = (o) => {
503
686
  if (!isObject(o) && !isModule(o)) return false;
504
687
  if (o.constructor === void 0) return true;
@@ -728,7 +911,7 @@ function init_instrumenter() {
728
911
  const seen = /* @__PURE__ */ new Set();
729
912
  return merged.reduceRight((acc, call) => {
730
913
  call.args.forEach((arg) => {
731
- if (arg?.__callId__) seen.add(arg.__callId__);
914
+ if (isCallRef(arg)) seen.add(arg.__callId__);
732
915
  });
733
916
  call.path.forEach((node) => {
734
917
  if (node.__callId__) seen.add(node.__callId__);
@@ -746,14 +929,15 @@ function init_instrumenter() {
746
929
  }
747
930
  instrument(obj, options, depth = 0) {
748
931
  if (!isInstrumentable(obj)) return obj;
932
+ const source = obj;
749
933
  const { mutate = false, path = [] } = options;
750
- const keys = options.getKeys ? options.getKeys(obj, depth) : Object.keys(obj);
934
+ const keys = options.getKeys ? options.getKeys(source, depth) : Object.keys(source);
751
935
  depth += 1;
752
936
  return keys.reduce((acc, key) => {
753
- const descriptor = getPropertyDescriptor(obj, key);
937
+ const descriptor = getPropertyDescriptor(source, key);
754
938
  if (typeof descriptor?.get === "function") {
755
939
  if (descriptor.configurable) {
756
- const getter = () => descriptor?.get?.bind(obj)?.();
940
+ const getter = () => descriptor?.get?.bind(source)?.();
757
941
  Object.defineProperty(acc, key, { get: () => {
758
942
  return this.instrument(getter(), {
759
943
  ...options,
@@ -763,7 +947,7 @@ function init_instrumenter() {
763
947
  }
764
948
  return acc;
765
949
  }
766
- const value = obj[key];
950
+ const value = source[key];
767
951
  if (typeof value !== "function") {
768
952
  acc[key] = this.instrument(value, {
769
953
  ...options,
@@ -775,21 +959,22 @@ function init_instrumenter() {
775
959
  acc[key] = value;
776
960
  return acc;
777
961
  }
778
- acc[key] = (...args) => this.track(key, value, obj, args, options);
779
- acc[key].__originalFn__ = value;
780
- Object.defineProperty(acc[key], "name", {
962
+ const patched = Object.assign((...args) => this.track(key, value, source, args, options), { __originalFn__: value });
963
+ acc[key] = patched;
964
+ Object.defineProperty(patched, "name", {
781
965
  value: key,
782
966
  writable: false
783
967
  });
784
- if (Object.keys(value).length > 0) Object.assign(acc[key], this.instrument({ ...value }, {
968
+ if (Object.keys(value).length > 0) Object.assign(patched, this.instrument({ ...value }, {
785
969
  ...options,
786
970
  path: path.concat(key)
787
971
  }, depth));
788
972
  return acc;
789
- }, mutate ? obj : construct(obj));
973
+ }, mutate ? source : construct(source));
790
974
  }
791
975
  track(method, fn, object, args, options) {
792
- const storyId = args?.[0]?.__storyId__ || global.__FORKBOOK_PREVIEW__?.selectionStore?.selection?.storyId;
976
+ const firstArg = args[0];
977
+ const storyId = (typeof firstArg === "object" && firstArg !== null && "__storyId__" in firstArg ? firstArg.__storyId__ : void 0) || global.__FORKBOOK_PREVIEW__?.selectionStore?.selection?.storyId;
793
978
  const { cursor, ancestors } = this.getState(storyId);
794
979
  this.setState(storyId, { cursor: cursor + 1 });
795
980
  const id = `${ancestors.slice(-1)[0] || storyId} [${cursor}] ${method}`;
@@ -874,10 +1059,10 @@ function init_instrumenter() {
874
1059
  innerText
875
1060
  } };
876
1061
  }
877
- if (typeof value === "function") return { __function__: { name: "getMockName" in value ? value.getMockName() : value.name } };
1062
+ if (typeof value === "function") return { __function__: { name: "getMockName" in value && typeof value.getMockName === "function" ? value.getMockName() : value.name } };
878
1063
  if (typeof value === "symbol") return { __symbol__: { description: value.description } };
879
1064
  if (typeof value === "object" && value?.constructor?.name && value?.constructor?.name !== "Object") return { __class__: { name: value.constructor.name } };
880
- if (Object.prototype.toString.call(value) === "[object Object]") return Object.fromEntries(Object.entries(value).map(([key, val]) => [key, serializeValues(val, ++depth, seen)]));
1065
+ if (isObject(value)) return Object.fromEntries(Object.entries(value).map(([key, val]) => [key, serializeValues(val, ++depth, seen)]));
881
1066
  return value;
882
1067
  };
883
1068
  const info = {
@@ -885,7 +1070,7 @@ function init_instrumenter() {
885
1070
  args: call.args.map((arg) => serializeValues(arg, 0, []))
886
1071
  };
887
1072
  call.path.forEach((ref) => {
888
- if (ref?.__callId__) this.setState(call.storyId, ({ chainedCallIds }) => ({ chainedCallIds: new Set(Array.from(chainedCallIds).concat(ref.__callId__)) }));
1073
+ if (typeof ref === "object" && ref?.__callId__) this.setState(call.storyId, ({ chainedCallIds }) => ({ chainedCallIds: new Set(Array.from(chainedCallIds).concat(ref.__callId__)) }));
889
1074
  });
890
1075
  const handleException = (e) => {
891
1076
  if (e instanceof Error) {
@@ -1111,16 +1296,15 @@ function init_stories() {
1111
1296
  entries: Object.values(index.stories).reduce((acc, entry) => {
1112
1297
  let type = "story";
1113
1298
  if (entry.parameters?.docsOnly || entry.name === "Page" && countByTitle[entry.title] === 1) type = "docs";
1299
+ const { story: _story, kind: _kind, ...entryWithoutV3Fields } = entry;
1114
1300
  acc[entry.id] = {
1115
1301
  type,
1116
1302
  ...type === "docs" && {
1117
1303
  tags: ["stories-mdx"],
1118
1304
  storiesImports: []
1119
1305
  },
1120
- ...entry
1306
+ ...entryWithoutV3Fields
1121
1307
  };
1122
- delete acc[entry.id].story;
1123
- delete acc[entry.id].kind;
1124
1308
  return acc;
1125
1309
  }, {})
1126
1310
  };
@@ -1348,7 +1532,7 @@ function init_refs() {
1348
1532
  if (refId || source) return ["external", sourceFull];
1349
1533
  return [null, null];
1350
1534
  };
1351
- defaultStoryMapper = (b, a) => {
1535
+ defaultStoryMapper = (_ref, a) => {
1352
1536
  return {
1353
1537
  ...a,
1354
1538
  kind: a.kind.replace("|", "/")
@@ -1488,21 +1672,20 @@ function init_refs() {
1488
1672
  },
1489
1673
  setRef: async (id, { storyIndex, setStoriesData, ...rest }, ready = false) => {
1490
1674
  if (singleStory) return;
1491
- let internal_index;
1492
1675
  let index;
1493
1676
  let filteredIndex;
1494
1677
  const { filters } = store.getState();
1495
1678
  const { storyMapper = defaultStoryMapper } = provider.getConfig();
1496
1679
  const ref = api.getRefs()[id];
1497
- if (storyIndex || setStoriesData) {
1498
- internal_index = setStoriesData ? transformSetStoriesStoryDataToPreparedStoryIndex(map(setStoriesData, ref, { storyMapper })) : storyIndex;
1499
- filteredIndex = transformStoryIndexToStoriesHash(storyIndex, {
1680
+ const internal_index = setStoriesData ? transformSetStoriesStoryDataToPreparedStoryIndex(map(setStoriesData, ref, { storyMapper })) : storyIndex;
1681
+ if (internal_index) {
1682
+ filteredIndex = transformStoryIndexToStoriesHash(internal_index, {
1500
1683
  provider,
1501
1684
  docsOptions,
1502
1685
  filters,
1503
1686
  allStatuses: {}
1504
1687
  });
1505
- index = transformStoryIndexToStoriesHash(storyIndex, {
1688
+ index = transformStoryIndexToStoriesHash(internal_index, {
1506
1689
  provider,
1507
1690
  docsOptions,
1508
1691
  filters: {},
@@ -1531,10 +1714,7 @@ function init_refs() {
1531
1714
  ...ref,
1532
1715
  ...data
1533
1716
  };
1534
- const ordered = Object.keys(initialState).reduce((obj, key) => {
1535
- obj[key] = updated[key];
1536
- return obj;
1537
- }, {});
1717
+ const ordered = Object.fromEntries(Object.keys(initialState).map((key) => [key, updated[key]]));
1538
1718
  await store.setState({ refs: ordered });
1539
1719
  }
1540
1720
  };
@@ -1884,7 +2064,9 @@ function init_layout() {
1884
2064
  element.focus();
1885
2065
  }
1886
2066
  if (element !== document$2.activeElement && element.id !== document$2.activeElement?.id) return false;
1887
- if (select) element.select?.();
2067
+ if (select) {
2068
+ if ("select" in element && typeof element.select === "function") element.select();
2069
+ }
1888
2070
  return true;
1889
2071
  };
1890
2072
  if (attemptFocus()) return true;
@@ -2052,7 +2234,7 @@ function init_open_in_editor() {
2052
2234
  } },
2053
2235
  state: { notifications: [] },
2054
2236
  init: async () => {
2055
- const { color } = await import("./globals-runtime-Bu9eGDTe.js").then((n) => (n.t(), n.n));
2237
+ const { color } = await import("./globals-runtime-Cccwtspx.js").then((n) => (n.t(), n.n));
2056
2238
  provider.channel?.on(OPEN_IN_EDITOR_RESPONSE, (payload) => {
2057
2239
  if (payload.error !== null) fullAPI.addNotification({
2058
2240
  id: "open-in-editor-error",
@@ -2557,6 +2739,151 @@ function init_status() {
2557
2739
  })))();
2558
2740
  }
2559
2741
  //#endregion
2742
+ //#region src/manager-api/modules/stories-events.ts
2743
+ function removeRemovedOptions(options) {
2744
+ if (!options || typeof options === "string") return options;
2745
+ const result = { ...options };
2746
+ removedOptions.forEach((option) => {
2747
+ if (option in result) delete result[option];
2748
+ });
2749
+ return result;
2750
+ }
2751
+ var removedOptions, listenToStoryEvents;
2752
+ function init_stories_events() {
2753
+ return (init_stories_events = __esmMin((() => {
2754
+ init_core_events();
2755
+ init_routes();
2756
+ init_events();
2757
+ init_stories();
2758
+ removedOptions = [
2759
+ "enableShortcuts",
2760
+ "theme",
2761
+ "showRoots"
2762
+ ];
2763
+ listenToStoryEvents = ({ store, provider, fullAPI, api, navigateWithQueryParams }) => {
2764
+ provider.channel?.on(STORY_SPECIFIED, function handler({ storyId, viewMode }) {
2765
+ const { sourceType } = getEventMetadata(this, fullAPI);
2766
+ if (sourceType === "local") {
2767
+ const state = store.getState();
2768
+ const isCanvasRoute = !isReviewManagerRoute(state.path, state.customQueryParams) && (state.path === "/" || state.viewMode === "story" || state.viewMode === "docs");
2769
+ const stateHasSelection = state.viewMode && state.storyId;
2770
+ const stateSelectionDifferent = state.viewMode !== viewMode || state.storyId !== storyId;
2771
+ const { type } = state.index?.[state.storyId] || {};
2772
+ const isStory = !(type === "root" || type === "component" || type === "group");
2773
+ /**
2774
+ * When Forkbook starts, we want to navigate to the first story. But there are a few
2775
+ * exceptions:
2776
+ *
2777
+ * - If the current storyId and viewMode are already set/correct AND the url section is a
2778
+ * leaf-type.
2779
+ * - If the user has navigated away already.
2780
+ * - If the user started Forkbook with a specific page-URL like "/settings/about"
2781
+ */
2782
+ if (isCanvasRoute) {
2783
+ const { filteredIndex } = state;
2784
+ if (filteredIndex && !stateHasSelection) {
2785
+ if (!(filteredIndex[storyId]?.type === "story")) {
2786
+ const firstFiltered = Object.keys(filteredIndex).find((id) => {
2787
+ const entry = filteredIndex[id];
2788
+ return entry.type === "story" || entry.type === "docs";
2789
+ });
2790
+ if (firstFiltered) navigateWithQueryParams(`/${viewMode}/${firstFiltered}`);
2791
+ return;
2792
+ }
2793
+ }
2794
+ if (stateHasSelection && stateSelectionDifferent && isStory) provider.channel?.emit(SET_CURRENT_STORY, {
2795
+ storyId: state.storyId,
2796
+ viewMode: state.viewMode
2797
+ });
2798
+ else if (stateSelectionDifferent) navigateWithQueryParams(`/${viewMode}/${storyId}`);
2799
+ }
2800
+ }
2801
+ });
2802
+ provider.channel?.on(CURRENT_STORY_WAS_SET, function handler() {
2803
+ const { ref } = getEventMetadata(this, fullAPI);
2804
+ api.setPreviewInitialized(ref);
2805
+ });
2806
+ provider.channel?.on(STORY_CHANGED, function handler() {
2807
+ const { sourceType } = getEventMetadata(this, fullAPI);
2808
+ if (sourceType === "local") {
2809
+ const options = api.getCurrentParameter("options");
2810
+ if (options) fullAPI.setOptions(removeRemovedOptions(options));
2811
+ }
2812
+ });
2813
+ provider.channel?.on(STORY_PREPARED, function handler({ id, ...update }) {
2814
+ const { ref, sourceType } = getEventMetadata(this, fullAPI);
2815
+ api.updateStory(id, {
2816
+ ...update,
2817
+ prepared: true
2818
+ }, ref);
2819
+ if (!ref) {
2820
+ if (!store.getState().hasCalledSetOptions) {
2821
+ const { options } = update.parameters;
2822
+ fullAPI.setOptions(removeRemovedOptions(options));
2823
+ store.setState({ hasCalledSetOptions: true });
2824
+ }
2825
+ }
2826
+ if (sourceType === "local") {
2827
+ const { storyId, index, refId } = store.getState();
2828
+ if (!index) return;
2829
+ const toBePreloaded = Array.from(/* @__PURE__ */ new Set([api.findSiblingStoryId(storyId, index, 1, true), api.findSiblingStoryId(storyId, index, -1, true)])).filter(Boolean);
2830
+ provider.channel?.emit(PRELOAD_ENTRIES, {
2831
+ ids: toBePreloaded,
2832
+ options: { target: refId }
2833
+ });
2834
+ }
2835
+ });
2836
+ provider.channel?.on(DOCS_PREPARED, function handler({ id, ...update }) {
2837
+ const { ref } = getEventMetadata(this, fullAPI);
2838
+ api.updateStory(id, {
2839
+ ...update,
2840
+ prepared: true
2841
+ }, ref);
2842
+ });
2843
+ provider.channel?.on(SET_INDEX, function handler(index) {
2844
+ const { ref } = getEventMetadata(this, fullAPI);
2845
+ if (!ref) {
2846
+ api.setIndex(index);
2847
+ const options = api.getCurrentParameter("options");
2848
+ fullAPI.setOptions(removeRemovedOptions(options));
2849
+ } else fullAPI.setRef(ref.id, {
2850
+ ...ref,
2851
+ storyIndex: index
2852
+ }, true);
2853
+ });
2854
+ provider.channel?.on(SET_STORIES, function handler(data) {
2855
+ const { ref } = getEventMetadata(this, fullAPI);
2856
+ const setStoriesData = data.v ? denormalizeStoryParameters(data) : data.stories;
2857
+ if (!ref) throw new Error("Cannot call SET_STORIES for local frame");
2858
+ else fullAPI.setRef(ref.id, {
2859
+ ...ref,
2860
+ setStoriesData
2861
+ }, true);
2862
+ });
2863
+ provider.channel?.on(SELECT_STORY, function handler({ kind, title = kind, story, name = story, storyId, ...rest }) {
2864
+ const { ref } = getEventMetadata(this, fullAPI);
2865
+ if (!ref) fullAPI.selectStory(storyId || title, name, rest);
2866
+ else fullAPI.selectStory(storyId || title, name, {
2867
+ ...rest,
2868
+ ref: ref.id
2869
+ });
2870
+ });
2871
+ provider.channel?.on(STORY_ARGS_UPDATED, function handleStoryArgsUpdated({ storyId, args }) {
2872
+ const { ref } = getEventMetadata(this, fullAPI);
2873
+ api.updateStory(storyId, { args }, ref);
2874
+ });
2875
+ provider.channel?.on(CONFIG_ERROR, function handleConfigError() {
2876
+ const { ref } = getEventMetadata(this, fullAPI);
2877
+ api.setPreviewInitialized(ref);
2878
+ });
2879
+ provider.channel?.on(STORY_MISSING, function handleStoryMissing() {
2880
+ const { ref } = getEventMetadata(this, fullAPI);
2881
+ api.setPreviewInitialized(ref);
2882
+ });
2883
+ };
2884
+ })))();
2885
+ }
2886
+ //#endregion
2560
2887
  //#region src/manager-api/lib/filter-param.ts
2561
2888
  var parseFilterParam;
2562
2889
  function init_filter_param() {
@@ -2669,46 +2996,25 @@ function init_tags() {
2669
2996
  })))();
2670
2997
  }
2671
2998
  //#endregion
2672
- //#region src/manager-api/modules/stories.ts
2673
- var stories_exports = /* @__PURE__ */ __exportAll({ init: () => init$3 });
2674
- function removeRemovedOptions(options) {
2675
- if (!options || typeof options === "string") return options;
2676
- const result = { ...options };
2677
- removedOptions.forEach((option) => {
2678
- if (option in result) delete result[option];
2679
- });
2680
- return result;
2681
- }
2682
- var fetch, STORY_INDEX_PATH, TAGS_FILTER, STATIC_FILTER, STATUS_FILTER, STATUS_CHANGE_REBUILD_THROTTLE, BUILT_IN_TAG_IDS, removedOptions, FILTER_KEYS, init$3;
2683
- function init_stories$1() {
2684
- return (init_stories$1 = __esmMin((() => {
2999
+ //#region src/manager-api/modules/stories-filters.ts
3000
+ var TAGS_FILTER, STATIC_FILTER, STATUS_FILTER, STATUS_CHANGE_REBUILD_THROTTLE, BUILT_IN_TAG_IDS, FILTER_KEYS, initFilters;
3001
+ function init_stories_filters() {
3002
+ return (init_stories_filters = __esmMin((() => {
2685
3003
  init_client_logger();
2686
3004
  init_core_events();
2687
- init_csf_utils();
2688
3005
  init_router();
2689
- init_routes();
2690
- init_global();
2691
3006
  init_throttle();
2692
3007
  init_tags$1();
3008
+ init_global();
2693
3009
  init_status_store();
2694
- init_events();
2695
- init_stories();
2696
- init_url();
2697
3010
  init_status();
2698
3011
  init_statuses();
2699
3012
  init_tags();
2700
- ({fetch} = global);
2701
- STORY_INDEX_PATH = "./index.json";
2702
3013
  TAGS_FILTER = "tags-filter";
2703
3014
  STATIC_FILTER = "static-filter";
2704
3015
  STATUS_FILTER = "status-filter";
2705
3016
  STATUS_CHANGE_REBUILD_THROTTLE = 500;
2706
3017
  BUILT_IN_TAG_IDS = new Set(Object.keys(BUILT_IN_FILTERS));
2707
- removedOptions = [
2708
- "enableShortcuts",
2709
- "theme",
2710
- "showRoots"
2711
- ];
2712
3018
  FILTER_KEYS = {
2713
3019
  tag: {
2714
3020
  included: "includedTagFilters",
@@ -2719,23 +3025,7 @@ function init_stories$1() {
2719
3025
  excluded: "excludedStatusFilters"
2720
3026
  }
2721
3027
  };
2722
- init$3 = ({ fullAPI, store, navigate, provider, state: { location } = {}, storyId: initialStoryId, viewMode: initialViewMode, docsOptions = {} }) => {
2723
- const navigateWithQueryParams = (path, options) => {
2724
- const { customQueryParams } = store.getState();
2725
- navigate(buildNavigationUrl(path, customQueryParams ?? {}), options);
2726
- };
2727
- /**
2728
- * Before the index loads, the manager guesses the story from the URL path. When the index loads,
2729
- * read the URL again, and show the tree URL path for the story.
2730
- */
2731
- const canonicaliseUrl = () => {
2732
- const { location: currentLocation, path, customQueryParams } = store.getState();
2733
- const pathname = currentLocation?.pathname;
2734
- if (!pathname || queryFromLocation(currentLocation).path) return;
2735
- const resolved = fromUrlPath(pathname);
2736
- if (resolved === "/" || resolved === path && toUrlPath(resolved) === pathname) return;
2737
- navigate(buildNavigationUrl(`${resolved}${currentLocation.hash ?? ""}`, customQueryParams ?? {}), { replace: true });
2738
- };
3028
+ initFilters = ({ store, provider, fullAPI, location, setIndex }) => {
2739
3029
  const persistFilters = (inputPatch) => {
2740
3030
  return store.setState(inputPatch, {
2741
3031
  persistence: "url",
@@ -2749,7 +3039,6 @@ function init_stories$1() {
2749
3039
  }
2750
3040
  });
2751
3041
  };
2752
- let urlFilterTelemetryEmitted = false;
2753
3042
  const addFilters = async (type, items, excluded) => {
2754
3043
  const { included, excluded: excludedKey } = FILTER_KEYS[type];
2755
3044
  const state = store.getState();
@@ -2805,6 +3094,251 @@ function init_stories$1() {
2805
3094
  });
2806
3095
  };
2807
3096
  const api = {
3097
+ setFilter: async (id, filterFunction) => {
3098
+ await api.setFilters({ [id]: filterFunction });
3099
+ },
3100
+ setFilters: async (filters) => {
3101
+ await store.setState((state) => ({ filters: {
3102
+ ...state.filters,
3103
+ ...filters
3104
+ } }));
3105
+ if (!await applyCurrentFilters()) return;
3106
+ for (const id of Object.keys(filters)) provider.channel?.emit(SET_FILTER, { id });
3107
+ },
3108
+ resetTagFilters: async () => {
3109
+ await persistFilters((s) => ({
3110
+ includedTagFilters: s.defaultIncludedTagFilters,
3111
+ excludedTagFilters: s.defaultExcludedTagFilters
3112
+ }));
3113
+ await recomputeTagsFilter();
3114
+ },
3115
+ setAllTagFilters: async (included, excluded) => {
3116
+ await persistFilters({
3117
+ includedTagFilters: included,
3118
+ excludedTagFilters: excluded
3119
+ });
3120
+ await recomputeTagsFilter();
3121
+ },
3122
+ addTagFilters: async (tags, excluded) => {
3123
+ await addFilters("tag", tags, excluded);
3124
+ await recomputeTagsFilter();
3125
+ if (tags.length === 1 && BUILT_IN_TAG_IDS.has(tags[0])) emitFilterTelemetry("interaction", {
3126
+ filterType: "tag",
3127
+ filterId: tags[0],
3128
+ action: excluded ? "exclude" : "include"
3129
+ });
3130
+ },
3131
+ removeTagFilters: async (tags) => {
3132
+ await removeFilters("tag", tags);
3133
+ await recomputeTagsFilter();
3134
+ if (tags.length === 1 && BUILT_IN_TAG_IDS.has(tags[0])) emitFilterTelemetry("interaction", {
3135
+ filterType: "tag",
3136
+ filterId: tags[0],
3137
+ action: "remove"
3138
+ });
3139
+ },
3140
+ resetStatusFilters: async () => {
3141
+ await persistFilters({
3142
+ includedStatusFilters: [],
3143
+ excludedStatusFilters: []
3144
+ });
3145
+ await recomputeStatusFilter();
3146
+ },
3147
+ setAllStatusFilters: async (included, excluded) => {
3148
+ const prevState = store.getState();
3149
+ const prevIncluded = new Set(prevState.includedStatusFilters ?? []);
3150
+ const prevExcluded = new Set(prevState.excludedStatusFilters ?? []);
3151
+ const nextIncluded = new Set(included);
3152
+ const nextExcluded = new Set(excluded);
3153
+ await persistFilters({
3154
+ includedStatusFilters: included,
3155
+ excludedStatusFilters: excluded
3156
+ });
3157
+ await recomputeStatusFilter();
3158
+ const changedIds = /* @__PURE__ */ new Set([
3159
+ ...prevIncluded,
3160
+ ...prevExcluded,
3161
+ ...nextIncluded,
3162
+ ...nextExcluded
3163
+ ]);
3164
+ for (const id of changedIds) {
3165
+ const wasIncluded = prevIncluded.has(id);
3166
+ const wasExcluded = prevExcluded.has(id);
3167
+ const isIncluded = nextIncluded.has(id);
3168
+ const isExcluded = nextExcluded.has(id);
3169
+ if (wasIncluded === isIncluded && wasExcluded === isExcluded) continue;
3170
+ let action;
3171
+ if (isIncluded) action = "include";
3172
+ else if (isExcluded) action = "exclude";
3173
+ else action = "remove";
3174
+ emitFilterTelemetry("interaction", {
3175
+ filterType: "status",
3176
+ filterId: id,
3177
+ action
3178
+ });
3179
+ }
3180
+ },
3181
+ addStatusFilters: async (statuses, excluded) => {
3182
+ await addFilters("status", statuses, excluded);
3183
+ await recomputeStatusFilter();
3184
+ if (statuses.length === 1) emitFilterTelemetry("interaction", {
3185
+ filterType: "status",
3186
+ filterId: statuses[0],
3187
+ action: excluded ? "exclude" : "include"
3188
+ });
3189
+ },
3190
+ removeStatusFilters: async (statuses) => {
3191
+ await removeFilters("status", statuses);
3192
+ await recomputeStatusFilter();
3193
+ if (statuses.length === 1) emitFilterTelemetry("interaction", {
3194
+ filterType: "status",
3195
+ filterId: statuses[0],
3196
+ action: "remove"
3197
+ });
3198
+ }
3199
+ };
3200
+ const applyCurrentFilters = async () => {
3201
+ const { internal_index: index } = store.getState();
3202
+ if (!index) return false;
3203
+ await setIndex(index);
3204
+ const refs = await fullAPI.getRefs();
3205
+ for (const [refId, { internal_index, ...ref }] of Object.entries(refs)) await fullAPI.setRef(refId, {
3206
+ ...ref,
3207
+ storyIndex: internal_index
3208
+ }, true);
3209
+ return true;
3210
+ };
3211
+ let statusFilterRebuildQueued = false;
3212
+ let statusFilterRebuildInFlight = false;
3213
+ const flushStatusFilterRebuild = async () => {
3214
+ if (statusFilterRebuildInFlight) return;
3215
+ statusFilterRebuildInFlight = true;
3216
+ try {
3217
+ while (statusFilterRebuildQueued) {
3218
+ statusFilterRebuildQueued = false;
3219
+ try {
3220
+ await applyCurrentFilters();
3221
+ } catch (error) {
3222
+ logger.warn("Failed to rebuild story index after status change:", error);
3223
+ }
3224
+ }
3225
+ } finally {
3226
+ statusFilterRebuildInFlight = false;
3227
+ if (statusFilterRebuildQueued) flushStatusFilterRebuild();
3228
+ }
3229
+ };
3230
+ const requestStatusFilterRebuild = () => {
3231
+ statusFilterRebuildQueued = true;
3232
+ flushStatusFilterRebuild();
3233
+ };
3234
+ const recomputeTagsFilter = () => {
3235
+ const { includedTagFilters, excludedTagFilters } = store.getState();
3236
+ return api.setFilters({ [TAGS_FILTER]: computeTagsFilterFn(includedTagFilters, excludedTagFilters) });
3237
+ };
3238
+ const recomputeStatusFilter = () => {
3239
+ const { includedStatusFilters, excludedStatusFilters } = store.getState();
3240
+ return api.setFilters({ [STATUS_FILTER]: computeStatusFilterFn(includedStatusFilters ?? [], excludedStatusFilters ?? []) });
3241
+ };
3242
+ provider.channel?.on(SET_CONFIG, async () => {
3243
+ const { includedTagFilters, excludedTagFilters, includedStatusFilters, excludedStatusFilters, tagPresets } = store.getState();
3244
+ await api.setFilters({
3245
+ [STATIC_FILTER]: computeStaticFilterFn(tagPresets),
3246
+ [TAGS_FILTER]: computeTagsFilterFn(includedTagFilters, excludedTagFilters),
3247
+ [STATUS_FILTER]: computeStatusFilterFn(includedStatusFilters, excludedStatusFilters)
3248
+ });
3249
+ });
3250
+ fullStatusStore.onAllStatusChange(throttle(requestStatusFilterRebuild, STATUS_CHANGE_REBUILD_THROTTLE, { edges: ["leading", "trailing"] }));
3251
+ const tagPresets = global.TAGS_OPTIONS || {};
3252
+ const defaultTags = getDefaultTagsFromPreset(tagPresets);
3253
+ const { tags, statuses } = queryFromLocation(location ?? { search: "" });
3254
+ const parsedTags = parseTagsParam(tags);
3255
+ const hasTagsParam = tags !== void 0;
3256
+ const initialIncluded = hasTagsParam ? parsedTags.included : defaultTags.included;
3257
+ const initialExcluded = hasTagsParam ? parsedTags.excluded : defaultTags.excluded;
3258
+ const parsedStatuses = parseStatusesParam(statuses);
3259
+ const initialIncludedStatuses = parsedStatuses.included;
3260
+ const initialExcludedStatuses = parsedStatuses.excluded;
3261
+ const state = {
3262
+ filters: {
3263
+ [STATIC_FILTER]: computeStaticFilterFn(tagPresets),
3264
+ [TAGS_FILTER]: computeTagsFilterFn(initialIncluded, initialExcluded),
3265
+ [STATUS_FILTER]: computeStatusFilterFn(initialIncludedStatuses, initialExcludedStatuses)
3266
+ },
3267
+ tagPresets,
3268
+ defaultIncludedTagFilters: defaultTags.included,
3269
+ defaultExcludedTagFilters: defaultTags.excluded,
3270
+ includedTagFilters: initialIncluded,
3271
+ excludedTagFilters: initialExcluded,
3272
+ includedStatusFilters: initialIncludedStatuses,
3273
+ excludedStatusFilters: initialExcludedStatuses
3274
+ };
3275
+ let urlFilterTelemetryEmitted = false;
3276
+ /** Sends one telemetry event when the first URL already has built-in tag or status filters. */
3277
+ const emitUrlFilterTelemetry = () => {
3278
+ if (urlFilterTelemetryEmitted) return;
3279
+ urlFilterTelemetryEmitted = true;
3280
+ const hasBuiltInTagFilters = initialIncluded.some((id) => BUILT_IN_TAG_IDS.has(id)) || initialExcluded.some((id) => BUILT_IN_TAG_IDS.has(id));
3281
+ const hasStatusFilters = initialIncludedStatuses.length > 0 || initialExcludedStatuses.length > 0;
3282
+ if (hasBuiltInTagFilters || hasStatusFilters) emitFilterTelemetry("url");
3283
+ };
3284
+ return {
3285
+ api,
3286
+ state,
3287
+ emitUrlFilterTelemetry
3288
+ };
3289
+ };
3290
+ })))();
3291
+ }
3292
+ //#endregion
3293
+ //#region src/manager-api/modules/stories.ts
3294
+ var stories_exports = /* @__PURE__ */ __exportAll({ init: () => init$3 });
3295
+ var fetch, STORY_INDEX_PATH, applyUpdate, init$3;
3296
+ function init_stories$1() {
3297
+ return (init_stories$1 = __esmMin((() => {
3298
+ init_client_logger();
3299
+ init_core_events();
3300
+ init_csf_utils();
3301
+ init_router();
3302
+ init_global();
3303
+ init_stories();
3304
+ init_url();
3305
+ init_status();
3306
+ init_stories_events();
3307
+ init_stories_filters();
3308
+ ({fetch} = global);
3309
+ STORY_INDEX_PATH = "./index.json";
3310
+ applyUpdate = (indexes, id, update) => {
3311
+ for (const index of indexes) if (index?.[id]) index[id] = {
3312
+ ...index[id],
3313
+ ...update
3314
+ };
3315
+ };
3316
+ init$3 = ({ fullAPI, store, navigate, provider, state: { location } = {}, storyId: initialStoryId, viewMode: initialViewMode, docsOptions = {} }) => {
3317
+ const navigateWithQueryParams = (path, options) => {
3318
+ const { customQueryParams } = store.getState();
3319
+ navigate(buildNavigationUrl(path, customQueryParams ?? {}), options);
3320
+ };
3321
+ /**
3322
+ * Before the index loads, the manager guesses the story from the URL path. When the index loads,
3323
+ * read the URL again, and show the tree URL path for the story.
3324
+ */
3325
+ const canonicaliseUrl = () => {
3326
+ const { location: currentLocation, path, customQueryParams } = store.getState();
3327
+ const pathname = currentLocation?.pathname;
3328
+ if (!pathname || queryFromLocation(currentLocation).path) return;
3329
+ const resolved = fromUrlPath(pathname);
3330
+ if (resolved === "/" || resolved === path && toUrlPath(resolved) === pathname) return;
3331
+ navigate(buildNavigationUrl(`${resolved}${currentLocation.hash ?? ""}`, customQueryParams ?? {}), { replace: true });
3332
+ };
3333
+ const filters = initFilters({
3334
+ store,
3335
+ provider,
3336
+ fullAPI,
3337
+ location,
3338
+ setIndex: (index) => api.setIndex(index)
3339
+ });
3340
+ const api = {
3341
+ ...filters.api,
2808
3342
  storyId: toId,
2809
3343
  getData: (storyId, refId) => {
2810
3344
  const result = api.resolveStory(storyId, refId);
@@ -2942,438 +3476,116 @@ function init_stories$1() {
2942
3476
  findSiblingStoryId(storyId, index, direction, toSiblingGroup) {
2943
3477
  if (toSiblingGroup) {
2944
3478
  const lookupList = getComponentLookupList(index);
2945
- const position = lookupList.findIndex((i) => i.includes(storyId));
2946
- if (position === lookupList.length - 1 && direction > 0) return;
2947
- if (position === 0 && direction < 0) return;
2948
- if (lookupList[position + direction]) return lookupList[position + direction][0];
2949
- return;
2950
- }
2951
- const lookupList = getStoriesLookupList(index);
2952
- const position = lookupList.indexOf(storyId);
2953
- if (position === lookupList.length - 1 && direction > 0) return;
2954
- if (position === 0 && direction < 0) return;
2955
- return lookupList[position + direction];
2956
- },
2957
- updateStoryArgs: (story, updatedArgs) => {
2958
- const { id: storyId, refId } = story;
2959
- provider.channel?.emit(UPDATE_STORY_ARGS, {
2960
- storyId,
2961
- updatedArgs,
2962
- options: { target: refId }
2963
- });
2964
- },
2965
- resetStoryArgs: (story, argNames) => {
2966
- const { id: storyId, refId } = story;
2967
- provider.channel?.emit(RESET_STORY_ARGS, {
2968
- storyId,
2969
- argNames,
2970
- options: { target: refId }
2971
- });
2972
- },
2973
- fetchIndex: async () => {
2974
- try {
2975
- const result = await fetch(STORY_INDEX_PATH);
2976
- if (result.status !== 200) throw new Error(await result.text());
2977
- const storyIndex = await result.json();
2978
- if (storyIndex.v < 3) {
2979
- logger.warn(`Skipping story index with version v${storyIndex.v}, awaiting SET_STORIES.`);
2980
- return;
2981
- }
2982
- await api.setIndex(storyIndex);
2983
- } catch (err) {
2984
- await store.setState({ indexError: err });
2985
- }
2986
- },
2987
- setIndex: async (input) => {
2988
- const { filteredIndex: oldFilteredHash, index: oldHash, filters } = store.getState();
2989
- const allStatuses = fullStatusStore.getAll();
2990
- const newFilteredHash = transformStoryIndexToStoriesHash(input, {
2991
- provider,
2992
- docsOptions,
2993
- filters,
2994
- allStatuses,
2995
- statusFilterKey: STATUS_FILTER
2996
- });
2997
- const newHash = transformStoryIndexToStoriesHash(input, {
2998
- provider,
2999
- docsOptions,
3000
- filters: {},
3001
- allStatuses
3002
- });
3003
- setStoryPathEntries(Object.values(input.entries));
3004
- await store.setState({
3005
- internal_index: input,
3006
- filteredIndex: addPreparedStories(newFilteredHash, oldFilteredHash),
3007
- index: addPreparedStories(newHash, oldHash),
3008
- indexError: void 0
3009
- });
3010
- canonicaliseUrl();
3011
- },
3012
- updateStory: async (storyId, update, ref) => {
3013
- if (!ref) {
3014
- const { index, filteredIndex } = store.getState();
3015
- if (index && index[storyId]) index[storyId] = {
3016
- ...index[storyId],
3017
- ...update
3018
- };
3019
- if (filteredIndex && filteredIndex[storyId]) filteredIndex[storyId] = {
3020
- ...filteredIndex[storyId],
3021
- ...update
3022
- };
3023
- if (index || filteredIndex) await store.setState({
3024
- index,
3025
- filteredIndex
3026
- });
3027
- } else {
3028
- const { id: refId, index, filteredIndex } = ref;
3029
- const storyUpdates = {
3030
- ...ref.storyUpdates,
3031
- [storyId]: {
3032
- ...ref.storyUpdates?.[storyId],
3033
- ...update
3034
- }
3035
- };
3036
- if (index && index[storyId]) index[storyId] = {
3037
- ...index[storyId],
3038
- ...update
3039
- };
3040
- if (filteredIndex && filteredIndex[storyId]) filteredIndex[storyId] = {
3041
- ...filteredIndex[storyId],
3042
- ...update
3043
- };
3044
- await fullAPI.updateRef(refId, {
3045
- index,
3046
- filteredIndex,
3047
- storyUpdates
3048
- });
3049
- }
3050
- },
3051
- updateDocs: async (docsId, update, ref) => {
3052
- if (!ref) {
3053
- const { index, filteredIndex } = store.getState();
3054
- if (index) index[docsId] = {
3055
- ...index[docsId],
3056
- ...update
3057
- };
3058
- if (filteredIndex) filteredIndex[docsId] = {
3059
- ...filteredIndex[docsId],
3060
- ...update
3061
- };
3062
- if (index || filteredIndex) await store.setState({
3063
- index,
3064
- filteredIndex
3065
- });
3066
- } else {
3067
- const { id: refId, index, filteredIndex } = ref;
3068
- const storyUpdates = {
3069
- ...ref.storyUpdates,
3070
- [docsId]: {
3071
- ...ref.storyUpdates?.[docsId],
3072
- ...update
3073
- }
3074
- };
3075
- if (index && index[docsId]) index[docsId] = {
3076
- ...index[docsId],
3077
- ...update
3078
- };
3079
- if (filteredIndex && filteredIndex[docsId]) filteredIndex[docsId] = {
3080
- ...filteredIndex[docsId],
3081
- ...update
3082
- };
3083
- await fullAPI.updateRef(refId, {
3084
- index,
3085
- filteredIndex,
3086
- storyUpdates
3087
- });
3088
- }
3089
- },
3090
- setPreviewInitialized: async (ref) => {
3091
- if (!ref) store.setState({ previewInitialized: true });
3092
- else fullAPI.updateRef(ref.id, { previewInitialized: true });
3093
- },
3094
- setFilter: async (id, filterFunction) => {
3095
- await api.setFilters({ [id]: filterFunction });
3096
- },
3097
- setFilters: async (filters) => {
3098
- await store.setState((state) => ({ filters: {
3099
- ...state.filters,
3100
- ...filters
3101
- } }));
3102
- if (!await applyCurrentFilters()) return;
3103
- for (const id of Object.keys(filters)) provider.channel?.emit(SET_FILTER, { id });
3104
- },
3105
- resetTagFilters: async () => {
3106
- await persistFilters((s) => ({
3107
- includedTagFilters: s.defaultIncludedTagFilters,
3108
- excludedTagFilters: s.defaultExcludedTagFilters
3109
- }));
3110
- await recomputeTagsFilter();
3111
- },
3112
- setAllTagFilters: async (included, excluded) => {
3113
- await persistFilters({
3114
- includedTagFilters: included,
3115
- excludedTagFilters: excluded
3116
- });
3117
- await recomputeTagsFilter();
3118
- },
3119
- addTagFilters: async (tags, excluded) => {
3120
- await addFilters("tag", tags, excluded);
3121
- await recomputeTagsFilter();
3122
- if (tags.length === 1 && BUILT_IN_TAG_IDS.has(tags[0])) emitFilterTelemetry("interaction", {
3123
- filterType: "tag",
3124
- filterId: tags[0],
3125
- action: excluded ? "exclude" : "include"
3126
- });
3127
- },
3128
- removeTagFilters: async (tags) => {
3129
- await removeFilters("tag", tags);
3130
- await recomputeTagsFilter();
3131
- if (tags.length === 1 && BUILT_IN_TAG_IDS.has(tags[0])) emitFilterTelemetry("interaction", {
3132
- filterType: "tag",
3133
- filterId: tags[0],
3134
- action: "remove"
3135
- });
3136
- },
3137
- resetStatusFilters: async () => {
3138
- await persistFilters({
3139
- includedStatusFilters: [],
3140
- excludedStatusFilters: []
3141
- });
3142
- await recomputeStatusFilter();
3143
- },
3144
- setAllStatusFilters: async (included, excluded) => {
3145
- const prevState = store.getState();
3146
- const prevIncluded = new Set(prevState.includedStatusFilters ?? []);
3147
- const prevExcluded = new Set(prevState.excludedStatusFilters ?? []);
3148
- const nextIncluded = new Set(included);
3149
- const nextExcluded = new Set(excluded);
3150
- await persistFilters({
3151
- includedStatusFilters: included,
3152
- excludedStatusFilters: excluded
3153
- });
3154
- await recomputeStatusFilter();
3155
- const changedIds = /* @__PURE__ */ new Set([
3156
- ...prevIncluded,
3157
- ...prevExcluded,
3158
- ...nextIncluded,
3159
- ...nextExcluded
3160
- ]);
3161
- for (const id of changedIds) {
3162
- const wasIncluded = prevIncluded.has(id);
3163
- const wasExcluded = prevExcluded.has(id);
3164
- const isIncluded = nextIncluded.has(id);
3165
- const isExcluded = nextExcluded.has(id);
3166
- if (wasIncluded === isIncluded && wasExcluded === isExcluded) continue;
3167
- let action;
3168
- if (isIncluded) action = "include";
3169
- else if (isExcluded) action = "exclude";
3170
- else action = "remove";
3171
- emitFilterTelemetry("interaction", {
3172
- filterType: "status",
3173
- filterId: id,
3174
- action
3175
- });
3479
+ const position = lookupList.findIndex((i) => i.includes(storyId));
3480
+ if (position === lookupList.length - 1 && direction > 0) return;
3481
+ if (position === 0 && direction < 0) return;
3482
+ if (lookupList[position + direction]) return lookupList[position + direction][0];
3483
+ return;
3176
3484
  }
3485
+ const lookupList = getStoriesLookupList(index);
3486
+ const position = lookupList.indexOf(storyId);
3487
+ if (position === lookupList.length - 1 && direction > 0) return;
3488
+ if (position === 0 && direction < 0) return;
3489
+ return lookupList[position + direction];
3177
3490
  },
3178
- addStatusFilters: async (statuses, excluded) => {
3179
- await addFilters("status", statuses, excluded);
3180
- await recomputeStatusFilter();
3181
- if (statuses.length === 1) emitFilterTelemetry("interaction", {
3182
- filterType: "status",
3183
- filterId: statuses[0],
3184
- action: excluded ? "exclude" : "include"
3491
+ updateStoryArgs: (story, updatedArgs) => {
3492
+ const { id: storyId, refId } = story;
3493
+ provider.channel?.emit(UPDATE_STORY_ARGS, {
3494
+ storyId,
3495
+ updatedArgs,
3496
+ options: { target: refId }
3185
3497
  });
3186
3498
  },
3187
- removeStatusFilters: async (statuses) => {
3188
- await removeFilters("status", statuses);
3189
- await recomputeStatusFilter();
3190
- if (statuses.length === 1) emitFilterTelemetry("interaction", {
3191
- filterType: "status",
3192
- filterId: statuses[0],
3193
- action: "remove"
3499
+ resetStoryArgs: (story, argNames) => {
3500
+ const { id: storyId, refId } = story;
3501
+ provider.channel?.emit(RESET_STORY_ARGS, {
3502
+ storyId,
3503
+ argNames,
3504
+ options: { target: refId }
3194
3505
  });
3195
- }
3196
- };
3197
- const applyCurrentFilters = async () => {
3198
- const { internal_index: index } = store.getState();
3199
- if (!index) return false;
3200
- await api.setIndex(index);
3201
- const refs = await fullAPI.getRefs();
3202
- for (const [refId, { internal_index, ...ref }] of Object.entries(refs)) await fullAPI.setRef(refId, {
3203
- ...ref,
3204
- storyIndex: internal_index
3205
- }, true);
3206
- return true;
3207
- };
3208
- let statusFilterRebuildQueued = false;
3209
- let statusFilterRebuildInFlight = false;
3210
- const flushStatusFilterRebuild = async () => {
3211
- if (statusFilterRebuildInFlight) return;
3212
- statusFilterRebuildInFlight = true;
3213
- try {
3214
- while (statusFilterRebuildQueued) {
3215
- statusFilterRebuildQueued = false;
3216
- try {
3217
- await applyCurrentFilters();
3218
- } catch (error) {
3219
- logger.warn("Failed to rebuild story index after status change:", error);
3506
+ },
3507
+ fetchIndex: async () => {
3508
+ try {
3509
+ const result = await fetch(STORY_INDEX_PATH);
3510
+ if (result.status !== 200) throw new Error(await result.text());
3511
+ const storyIndex = await result.json();
3512
+ if (storyIndex.v < 3) {
3513
+ logger.warn(`Skipping story index with version v${storyIndex.v}, awaiting SET_STORIES.`);
3514
+ return;
3220
3515
  }
3516
+ await api.setIndex(storyIndex);
3517
+ } catch (err) {
3518
+ await store.setState({ indexError: err });
3221
3519
  }
3222
- } finally {
3223
- statusFilterRebuildInFlight = false;
3224
- if (statusFilterRebuildQueued) flushStatusFilterRebuild();
3520
+ },
3521
+ setIndex: async (input) => {
3522
+ const { filteredIndex: oldFilteredHash, index: oldHash, filters } = store.getState();
3523
+ const allStatuses = fullStatusStore.getAll();
3524
+ const newFilteredHash = transformStoryIndexToStoriesHash(input, {
3525
+ provider,
3526
+ docsOptions,
3527
+ filters,
3528
+ allStatuses,
3529
+ statusFilterKey: STATUS_FILTER
3530
+ });
3531
+ const newHash = transformStoryIndexToStoriesHash(input, {
3532
+ provider,
3533
+ docsOptions,
3534
+ filters: {},
3535
+ allStatuses
3536
+ });
3537
+ setStoryPathEntries(Object.values(input.entries));
3538
+ await store.setState({
3539
+ internal_index: input,
3540
+ filteredIndex: addPreparedStories(newFilteredHash, oldFilteredHash),
3541
+ index: addPreparedStories(newHash, oldHash),
3542
+ indexError: void 0
3543
+ });
3544
+ canonicaliseUrl();
3545
+ },
3546
+ updateStory: async (storyId, update, ref) => {
3547
+ await applyEntryUpdate(storyId, update, ref);
3548
+ },
3549
+ updateDocs: async (docsId, update, ref) => {
3550
+ await applyEntryUpdate(docsId, update, ref);
3551
+ },
3552
+ setPreviewInitialized: async (ref) => {
3553
+ if (!ref) store.setState({ previewInitialized: true });
3554
+ else fullAPI.updateRef(ref.id, { previewInitialized: true });
3225
3555
  }
3226
3556
  };
3227
- const requestStatusFilterRebuild = () => {
3228
- statusFilterRebuildQueued = true;
3229
- flushStatusFilterRebuild();
3230
- };
3231
- const recomputeTagsFilter = () => {
3232
- const { includedTagFilters, excludedTagFilters } = store.getState();
3233
- return api.setFilters({ [TAGS_FILTER]: computeTagsFilterFn(includedTagFilters, excludedTagFilters) });
3234
- };
3235
- const recomputeStatusFilter = () => {
3236
- const { includedStatusFilters, excludedStatusFilters } = store.getState();
3237
- return api.setFilters({ [STATUS_FILTER]: computeStatusFilterFn(includedStatusFilters ?? [], excludedStatusFilters ?? []) });
3238
- };
3239
- provider.channel?.on(STORY_SPECIFIED, function handler({ storyId, viewMode }) {
3240
- const { sourceType } = getEventMetadata(this, fullAPI);
3241
- if (sourceType === "local") {
3242
- const state = store.getState();
3243
- const isCanvasRoute = !isReviewManagerRoute(state.path, state.customQueryParams) && (state.path === "/" || state.viewMode === "story" || state.viewMode === "docs");
3244
- const stateHasSelection = state.viewMode && state.storyId;
3245
- const stateSelectionDifferent = state.viewMode !== viewMode || state.storyId !== storyId;
3246
- const { type } = state.index?.[state.storyId] || {};
3247
- const isStory = !(type === "root" || type === "component" || type === "group");
3248
- /**
3249
- * When storybook starts, we want to navigate to the first story. But there are a few
3250
- * exceptions:
3251
- *
3252
- * - If the current storyId and viewMode are already set/correct AND the url section is a
3253
- * leaf-type.
3254
- * - If the user has navigated away already.
3255
- * - If the user started storybook with a specific page-URL like "/settings/about"
3256
- */
3257
- if (isCanvasRoute) {
3258
- const { filteredIndex } = state;
3259
- if (filteredIndex && !stateHasSelection) {
3260
- if (!(filteredIndex[storyId]?.type === "story")) {
3261
- const firstFiltered = filteredIndex ? Object.keys(filteredIndex).find((id) => {
3262
- const entry = filteredIndex[id];
3263
- return entry.type === "story" || entry.type === "docs";
3264
- }) : void 0;
3265
- if (firstFiltered) navigateWithQueryParams(`/${viewMode}/${firstFiltered}`);
3266
- return;
3267
- }
3268
- }
3269
- if (stateHasSelection && stateSelectionDifferent && isStory) provider.channel?.emit(SET_CURRENT_STORY, {
3270
- storyId: state.storyId,
3271
- viewMode: state.viewMode
3272
- });
3273
- else if (stateSelectionDifferent) navigateWithQueryParams(`/${viewMode}/${storyId}`);
3274
- }
3275
- }
3276
- });
3277
- provider.channel?.on(CURRENT_STORY_WAS_SET, function handler() {
3278
- const { ref } = getEventMetadata(this, fullAPI);
3279
- api.setPreviewInitialized(ref);
3280
- });
3281
- provider.channel?.on(STORY_CHANGED, function handler() {
3282
- const { sourceType } = getEventMetadata(this, fullAPI);
3283
- if (sourceType === "local") {
3284
- const options = api.getCurrentParameter("options");
3285
- if (options) fullAPI.setOptions(removeRemovedOptions(options));
3286
- }
3287
- });
3288
- provider.channel?.on(STORY_PREPARED, function handler({ id, ...update }) {
3289
- const { ref, sourceType } = getEventMetadata(this, fullAPI);
3290
- api.updateStory(id, {
3291
- ...update,
3292
- prepared: true
3293
- }, ref);
3557
+ const applyEntryUpdate = async (id, update, ref) => {
3294
3558
  if (!ref) {
3295
- if (!store.getState().hasCalledSetOptions) {
3296
- const { options } = update.parameters;
3297
- fullAPI.setOptions(removeRemovedOptions(options));
3298
- store.setState({ hasCalledSetOptions: true });
3299
- }
3300
- }
3301
- if (sourceType === "local") {
3302
- const { storyId, index, refId } = store.getState();
3303
- if (!index) return;
3304
- const toBePreloaded = Array.from(/* @__PURE__ */ new Set([api.findSiblingStoryId(storyId, index, 1, true), api.findSiblingStoryId(storyId, index, -1, true)])).filter(Boolean);
3305
- provider.channel?.emit(PRELOAD_ENTRIES, {
3306
- ids: toBePreloaded,
3307
- options: { target: refId }
3559
+ const { index, filteredIndex } = store.getState();
3560
+ applyUpdate([index, filteredIndex], id, update);
3561
+ if (index || filteredIndex) await store.setState({
3562
+ index,
3563
+ filteredIndex
3308
3564
  });
3565
+ return;
3309
3566
  }
3310
- });
3311
- provider.channel?.on(DOCS_PREPARED, function handler({ id, ...update }) {
3312
- const { ref } = getEventMetadata(this, fullAPI);
3313
- api.updateStory(id, {
3314
- ...update,
3315
- prepared: true
3316
- }, ref);
3317
- });
3318
- provider.channel?.on(SET_INDEX, function handler(index) {
3319
- const { ref } = getEventMetadata(this, fullAPI);
3320
- if (!ref) {
3321
- api.setIndex(index);
3322
- const options = api.getCurrentParameter("options");
3323
- fullAPI.setOptions(removeRemovedOptions(options));
3324
- } else fullAPI.setRef(ref.id, {
3325
- ...ref,
3326
- storyIndex: index
3327
- }, true);
3328
- });
3329
- provider.channel?.on(SET_STORIES, function handler(data) {
3330
- const { ref } = getEventMetadata(this, fullAPI);
3331
- const setStoriesData = data.v ? denormalizeStoryParameters(data) : data.stories;
3332
- if (!ref) throw new Error("Cannot call SET_STORIES for local frame");
3333
- else fullAPI.setRef(ref.id, {
3334
- ...ref,
3335
- setStoriesData
3336
- }, true);
3337
- });
3338
- provider.channel?.on(SELECT_STORY, function handler({ kind, title = kind, story, name = story, storyId, ...rest }) {
3339
- const { ref } = getEventMetadata(this, fullAPI);
3340
- if (!ref) fullAPI.selectStory(storyId || title, name, rest);
3341
- else fullAPI.selectStory(storyId || title, name, {
3342
- ...rest,
3343
- ref: ref.id
3344
- });
3345
- });
3346
- provider.channel?.on(STORY_ARGS_UPDATED, function handleStoryArgsUpdated({ storyId, args }) {
3347
- const { ref } = getEventMetadata(this, fullAPI);
3348
- api.updateStory(storyId, { args }, ref);
3349
- });
3350
- provider.channel?.on(CONFIG_ERROR, function handleConfigError(err) {
3351
- const { ref } = getEventMetadata(this, fullAPI);
3352
- api.setPreviewInitialized(ref);
3353
- });
3354
- provider.channel?.on(STORY_MISSING, function handleConfigError(err) {
3355
- const { ref } = getEventMetadata(this, fullAPI);
3356
- api.setPreviewInitialized(ref);
3357
- });
3358
- provider.channel?.on(SET_CONFIG, async () => {
3359
- const { includedTagFilters, excludedTagFilters, includedStatusFilters, excludedStatusFilters, tagPresets } = store.getState();
3360
- await api.setFilters({
3361
- [STATIC_FILTER]: computeStaticFilterFn(tagPresets),
3362
- [TAGS_FILTER]: computeTagsFilterFn(includedTagFilters, excludedTagFilters),
3363
- [STATUS_FILTER]: computeStatusFilterFn(includedStatusFilters, excludedStatusFilters)
3567
+ const { id: refId, index, filteredIndex } = ref;
3568
+ const storyUpdates = {
3569
+ ...ref.storyUpdates,
3570
+ [id]: {
3571
+ ...ref.storyUpdates?.[id],
3572
+ ...update
3573
+ }
3574
+ };
3575
+ applyUpdate([index, filteredIndex], id, update);
3576
+ await fullAPI.updateRef(refId, {
3577
+ index,
3578
+ filteredIndex,
3579
+ storyUpdates
3364
3580
  });
3581
+ };
3582
+ listenToStoryEvents({
3583
+ store,
3584
+ provider,
3585
+ fullAPI,
3586
+ api,
3587
+ navigateWithQueryParams
3365
3588
  });
3366
- fullStatusStore.onAllStatusChange(throttle(requestStatusFilterRebuild, STATUS_CHANGE_REBUILD_THROTTLE, { edges: ["leading", "trailing"] }));
3367
- const tagPresets = global.TAGS_OPTIONS || {};
3368
- const defaultTags = getDefaultTagsFromPreset(tagPresets);
3369
- const { tags, statuses } = queryFromLocation(location ?? { search: "" });
3370
- const parsedTags = parseTagsParam(tags);
3371
- const hasTagsParam = tags !== void 0;
3372
- const initialIncluded = hasTagsParam ? parsedTags.included : defaultTags.included;
3373
- const initialExcluded = hasTagsParam ? parsedTags.excluded : defaultTags.excluded;
3374
- const parsedStatuses = parseStatusesParam(statuses);
3375
- const initialIncludedStatuses = parsedStatuses.included;
3376
- const initialExcludedStatuses = parsedStatuses.excluded;
3377
3589
  return {
3378
3590
  api,
3379
3591
  state: {
@@ -3381,27 +3593,12 @@ function init_stories$1() {
3381
3593
  viewMode: initialViewMode,
3382
3594
  hasCalledSetOptions: false,
3383
3595
  previewInitialized: false,
3384
- filters: {
3385
- [STATIC_FILTER]: computeStaticFilterFn(tagPresets),
3386
- [TAGS_FILTER]: computeTagsFilterFn(initialIncluded, initialExcluded),
3387
- [STATUS_FILTER]: computeStatusFilterFn(initialIncludedStatuses, initialExcludedStatuses)
3388
- },
3389
- tagPresets,
3390
- defaultIncludedTagFilters: defaultTags.included,
3391
- defaultExcludedTagFilters: defaultTags.excluded,
3392
- includedTagFilters: initialIncluded,
3393
- excludedTagFilters: initialExcluded,
3394
- includedStatusFilters: initialIncludedStatuses,
3395
- excludedStatusFilters: initialExcludedStatuses
3596
+ ...filters.state
3396
3597
  },
3397
3598
  init: async () => {
3398
3599
  provider.channel?.on(STORY_INDEX_INVALIDATED, () => api.fetchIndex());
3399
3600
  await api.fetchIndex();
3400
- if (urlFilterTelemetryEmitted) return;
3401
- urlFilterTelemetryEmitted = true;
3402
- const hasBuiltInTagFilters = initialIncluded.some((id) => BUILT_IN_TAG_IDS.has(id)) || initialExcluded.some((id) => BUILT_IN_TAG_IDS.has(id));
3403
- const hasStatusFilters = initialIncludedStatuses.length > 0 || initialExcludedStatuses.length > 0;
3404
- if (hasBuiltInTagFilters || hasStatusFilters) emitFilterTelemetry("url");
3601
+ filters.emitUrlFilterTelemetry();
3405
3602
  }
3406
3603
  };
3407
3604
  };
@@ -3477,7 +3674,7 @@ function init_url$1() {
3477
3674
  navSize,
3478
3675
  bottomPanelHeight,
3479
3676
  rightPanelWidth,
3480
- panelPosition: ["right", "bottom"].includes(panel) ? panel : void 0
3677
+ panelPosition: panel === "right" || panel === "bottom" ? panel : void 0
3481
3678
  };
3482
3679
  const ui = { enableShortcuts: parseBoolean(shortcuts) };
3483
3680
  const selectedPanel = addonPanel || void 0;
@@ -3549,13 +3746,12 @@ function init_url$1() {
3549
3746
  return customQueryParams ? customQueryParams[key] : void 0;
3550
3747
  },
3551
3748
  getUrlState() {
3552
- const { location, path, customQueryParams, storyId, url, viewMode } = store.getState();
3749
+ const { location, path, customQueryParams, storyId, viewMode } = store.getState();
3553
3750
  return {
3554
3751
  path,
3555
3752
  hash: location?.hash ?? "",
3556
3753
  queryParams: customQueryParams,
3557
3754
  storyId,
3558
- url,
3559
3755
  viewMode
3560
3756
  };
3561
3757
  },
@@ -3942,7 +4138,7 @@ function ManagerConsumer({ filter = defaultFilter, children }) {
3942
4138
  if (typeof renderer.current !== "function") return /* @__PURE__ */ import_react$2.default.createElement(import_react$2.Fragment, null, renderer.current);
3943
4139
  const comboData = filterer.current(managerContext);
3944
4140
  const comboDataArray = (0, import_react$2.useMemo)(() => {
3945
- return [...Object.entries(comboData).reduce((acc, keyval) => acc.concat(keyval), [])];
4141
+ return Object.entries(comboData).flat();
3946
4142
  }, [managerContext.state]);
3947
4143
  return (0, import_react$2.useMemo)(() => {
3948
4144
  const Child = renderer.current;
@@ -3979,14 +4175,15 @@ function useParameter(parameterKey, defaultValue) {
3979
4175
  }
3980
4176
  function useSharedState(stateId, defaultState) {
3981
4177
  const api = useStorybookApi();
3982
- const state = orDefault(api.getAddonState(stateId) || FORKBOOK_ADDON_STATE[stateId], FORKBOOK_ADDON_STATE[stateId] ? FORKBOOK_ADDON_STATE[stateId] : defaultState);
4178
+ const getCachedState = () => FORKBOOK_ADDON_STATE[stateId];
4179
+ const state = orDefault(api.getAddonState(stateId) || getCachedState(), getCachedState() || defaultState);
3983
4180
  let quicksync = false;
3984
4181
  if (state === defaultState && defaultState !== void 0) {
3985
4182
  FORKBOOK_ADDON_STATE[stateId] = defaultState;
3986
4183
  quicksync = true;
3987
4184
  }
3988
4185
  (0, import_react$2.useEffect)(() => {
3989
- if (quicksync) api.setAddonState(stateId, defaultState);
4186
+ if (quicksync && defaultState !== void 0) api.setAddonState(stateId, defaultState);
3990
4187
  }, [quicksync]);
3991
4188
  const setState = (0, import_react$2.useCallback)(async (s, options) => {
3992
4189
  await api.setAddonState(stateId, s, options);
@@ -4002,12 +4199,13 @@ function useSharedState(stateId, defaultState) {
4002
4199
  const stateInitializationHandlers = {
4003
4200
  [SET_STORIES]: async () => {
4004
4201
  const currentState = api.getAddonState(stateId);
4202
+ const cachedState = getCachedState();
4005
4203
  if (currentState) {
4006
4204
  FORKBOOK_ADDON_STATE[stateId] = currentState;
4007
4205
  api.emit(`${SHARED_STATE_SET}-manager-${stateId}`, currentState);
4008
- } else if (FORKBOOK_ADDON_STATE[stateId]) {
4009
- await setState(FORKBOOK_ADDON_STATE[stateId]);
4010
- api.emit(`${SHARED_STATE_SET}-manager-${stateId}`, FORKBOOK_ADDON_STATE[stateId]);
4206
+ } else if (cachedState) {
4207
+ await setState(cachedState);
4208
+ api.emit(`${SHARED_STATE_SET}-manager-${stateId}`, getCachedState());
4011
4209
  } else if (defaultState !== void 0) {
4012
4210
  await setState(defaultState);
4013
4211
  FORKBOOK_ADDON_STATE[stateId] = defaultState;
@@ -4115,7 +4313,7 @@ function init_root() {
4115
4313
  this.mounted = false;
4116
4314
  this.initModules = () => {
4117
4315
  this.modules.forEach((module) => {
4118
- if ("init" in module) module.init();
4316
+ module.init?.();
4119
4317
  });
4120
4318
  };
4121
4319
  const { location, path, refId, viewMode = props.docsOptions.docsMode ? "docs" : props.viewMode, singleStory, storyId, docsOptions, navigate } = props;
@@ -4131,7 +4329,10 @@ function init_root() {
4131
4329
  callback?.(this.state);
4132
4330
  return this.state;
4133
4331
  }
4134
- this.setState(stateChange, () => callback(this.state));
4332
+ this.setState((state) => ({
4333
+ ...state,
4334
+ ...typeof stateChange === "function" ? stateChange(state) : stateChange
4335
+ }), () => callback(this.state));
4135
4336
  return this.state;
4136
4337
  }
4137
4338
  });
@@ -4644,7 +4845,7 @@ function init_globals_runtime() {
4644
4845
  init_runtime();
4645
4846
  init_prepareForTelemetry();
4646
4847
  globalPackages.forEach((key) => {
4647
- globalThis[globalsNameReferenceMap[key]] = globalsNameValueMap[key];
4848
+ Object.assign(globalThis, { [globalsNameReferenceMap[key]]: globalsNameValueMap[key] });
4648
4849
  });
4649
4850
  queuedErrors = [];
4650
4851
  globalThis.sendTelemetryError = (error) => {
@@ -4671,4 +4872,4 @@ function init_globals_runtime() {
4671
4872
  })))();
4672
4873
  }
4673
4874
  //#endregion
4674
- export { init_manager_errors as C, UniversalStoreFollowerTimeoutError as S, StatusTypeIdMismatchError as _, init_shortcut as a, OpenServiceStaticSnapshotLoadError as b, init_instrumenter as c, isTestEnvironment as d, init_csf_utils as f, InvalidChannelPageError as g, init_addons as h, init_manager_api as i, instrument as l, addons$1 as m, init_useMedia as n, shortcutToAriaKeyshortcuts as o, sanitize as p, useMediaQuery as r, shortcutToHumanString as s, init_globals_runtime as t, init_animation_utils as u, init_preview_errors as v, StatusTypeIdMismatchError$1 as x, OpenServiceStaticSnapshotInvalidError as y };
4875
+ export { init_open_service as A, init_manager_errors as B, OpenServiceMissingServiceError as C, OpenServiceRemoteCommandUnhandledError as D, OpenServiceRemoteCommandDisconnectedError as E, init_preview_errors as F, OpenServiceStaticSnapshotInvalidError as I, OpenServiceStaticSnapshotLoadError as L, init_dev_server as M, InvalidChannelPageError as N, OpenServiceUnimplementedOperationError as O, StatusTypeIdMismatchError$1 as P, StatusTypeIdMismatchError$2 as R, OpenServiceMissingChannelError as S, OpenServiceRemoteCommandConfigDriftError as T, OpenServiceAsyncSchemaError as _, init_shortcut as a, OpenServiceInvalidStaticPathError as b, init_instrumenter as c, isTestEnvironment as d, init_csf_utils as f, OpenServiceAsyncRecipeError as g, init_addons as h, init_manager_api as i, StatusTypeIdMismatchError as j, OpenServiceValidationError as k, instrument as l, addons$1 as m, init_useMedia as n, shortcutToAriaKeyshortcuts as o, sanitize as p, useMediaQuery as r, shortcutToHumanString as s, init_globals_runtime as t, init_animation_utils as u, OpenServiceCyclicStateError as v, OpenServiceOperationNameCollisionError as w, OpenServiceLoadedDrainExceededError as x, OpenServiceInternalServiceError as y, UniversalStoreFollowerTimeoutError as z };