@uniqbit/mate-core 1.0.0-canary.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
  2. package/package.json +5 -4
  3. package/src/cli/commands/artifact/delivery/link.ts +1 -1
  4. package/src/cli/commands/artifact/delivery/output.ts +10 -1
  5. package/src/cli/commands/artifact/delivery/resolve.ts +3 -2
  6. package/src/cli/commands/artifact/delivery/submit.ts +9 -4
  7. package/src/cli/commands/artifact/delivery/take.ts +12 -9
  8. package/src/cli/commands/artifact/finish/command.ts +16 -14
  9. package/src/cli/commands/artifact/finish/engine.ts +8 -8
  10. package/src/cli/commands/artifact/project/command.ts +2 -3
  11. package/src/cli/commands/companion/hub.ts +11 -6
  12. package/src/cli/commands/companion/link.ts +173 -46
  13. package/src/cli/commands/report/contract.ts +0 -17
  14. package/src/cli/commands/studio/access.ts +4 -0
  15. package/src/cli/commands/studio/actions.ts +35 -2
  16. package/src/cli/commands/studio/mcp-manager.ts +162 -0
  17. package/src/cli/commands/studio/routes.ts +12 -0
  18. package/src/cli/commands/studio/selection.ts +44 -11
  19. package/src/cli/commands/studio/server.ts +246 -2
  20. package/src/cli/commands/studio/services.ts +26 -0
  21. package/src/cli/commands/studio/terminal-launch.ts +21 -4
  22. package/src/cli/commands/studio/terminal.ts +3 -14
  23. package/src/cli/commands/studio/work-requests.ts +9 -0
  24. package/src/cli/commands/studio/work.ts +473 -0
  25. package/src/cli/commands/vscode/release-vsix.json +2 -2
  26. package/src/cli/commands/working/cleanup.ts +1 -18
  27. package/src/cli/companion-link-wizard.tsx +158 -91
  28. package/src/cli/usage.ts +1 -1
  29. package/src/lib/agent-credential.ts +131 -0
  30. package/src/lib/credential-kinds.ts +7 -0
  31. package/src/lib/delivery/merge-git.ts +16 -0
  32. package/src/lib/delivery/record-delivery.ts +12 -6
  33. package/src/lib/delivery/record.ts +5 -0
  34. package/src/lib/delivery/refresh.ts +34 -6
  35. package/src/lib/delivery/staging/refs.ts +9 -4
  36. package/src/lib/delivery/staging/submit.ts +81 -22
  37. package/src/lib/mcp-manager/resolve.ts +27 -9
  38. package/src/lib/mcp-manager/store.ts +35 -11
  39. package/src/lib/mcp-manager/types.ts +14 -0
  40. package/src/lib/mcp-manager/validate.ts +6 -10
  41. package/src/lib/opencode-server.ts +2 -17
  42. package/src/lib/orchestrator/repo-local-store.ts +14 -0
  43. package/src/lib/orchestrator/repository-link.ts +80 -52
  44. package/src/lib/orchestrator/root-context.ts +17 -1
  45. package/src/lib/studio-chat/agent.ts +139 -0
  46. package/src/lib/studio-chat/companion-context.ts +136 -0
  47. package/src/lib/studio-chat/credential.ts +79 -0
  48. package/src/lib/studio-chat/harness-chat-agent.ts +334 -0
  49. package/src/lib/studio-chat/host-sandbox.ts +578 -0
  50. package/src/lib/studio-chat/prepare-bridges.ts +95 -0
  51. package/src/lib/studio-chat/session.ts +15 -0
  52. package/src/lib/studio-chat/turns.ts +112 -0
  53. package/src/lib/workset/claims.ts +85 -0
  54. package/src/lib/workset/execution.ts +71 -0
  55. package/src/lib/workset/git-transaction.ts +74 -0
  56. package/src/lib/workset/groups.ts +176 -0
  57. package/src/lib/workset/inventory.ts +196 -0
  58. package/src/lib/workset/projection.ts +237 -0
  59. package/src/lib/workset/record.ts +101 -36
  60. package/src/lib/workset/repositories.ts +24 -0
  61. package/src/lib/workset/sharing.ts +951 -0
  62. package/src/lib/workset/stages.ts +50 -14
  63. package/src/lib/workset/transactions.ts +158 -0
  64. package/src/runtime/companion-git-state.ts +1 -0
  65. package/src/runtime/companion-guidance.ts +2 -2
  66. package/src/runtime/forge-remote.ts +6 -0
  67. package/src/runtime/host-process.ts +28 -0
  68. package/src/runtime/secret-guard.ts +18 -1
  69. package/src/runtime/secret-patterns.ts +4 -3
  70. package/src/runtime/submitted-arrivals.ts +28 -2
  71. package/src/runtime/write-atomic.ts +2 -2
  72. package/src/studio.ts +52 -8
  73. package/src/templates/capabilities/openspec-cap/mate-full/schema.yaml +1 -1
  74. package/src/templates/capabilities/openspec-cap/mate-full/templates/proposal.md +1 -1
  75. package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +3 -2
  76. package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +5 -3
  77. package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +3 -2
  78. package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +5 -3
  79. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +12 -12
  80. package/src/tools/setup/capabilities/mcp-manager.ts +1 -2
  81. package/src/tools/setup/dynamic-plugins/declarations.ts +0 -26
  82. package/src/tools/setup/plugins/gitignore.ts +1 -0
  83. package/src/tools/setup/providers/claude-format.ts +1 -5
  84. package/src/tools/setup/providers/claude.ts +28 -3
  85. package/src/tools/setup/providers/opencode.ts +7 -18
  86. package/src/tools/setup/providers/relative-path-warnings.ts +26 -0
  87. package/studio-dist/THIRD-PARTY-NOTICES.md +297 -0
  88. package/studio-dist/client/THIRD-PARTY-LICENSES.md +4294 -0
  89. package/studio-dist/client/assets/DialogTitle-DOhjDa7H.js +1 -0
  90. package/studio-dist/client/assets/app-CG3vCgyA.css +2 -0
  91. package/studio-dist/client/assets/bundle-mjs-CdK3cBzO.js +1 -0
  92. package/studio-dist/client/assets/button-upSzkd-q.js +1 -0
  93. package/studio-dist/client/assets/chat-DbaMXb8H.js +157 -0
  94. package/studio-dist/client/assets/cn-BCnYnarL.js +1 -0
  95. package/studio-dist/client/assets/combobox-cP9OsRf2.js +1 -0
  96. package/studio-dist/client/assets/{companion-view-C1F0_jbt.js → companion-view-B54_Lj0S.js} +1 -1
  97. package/studio-dist/client/assets/fields-DNZ4a89M.js +1 -0
  98. package/studio-dist/client/assets/friction-DgEimeDB.js +1 -0
  99. package/studio-dist/client/assets/getting-started-BTfYCt5s.js +1 -0
  100. package/studio-dist/client/assets/{getting-started-BN4aTpsz.js → getting-started-CAszmdDJ.js} +1 -1
  101. package/studio-dist/client/assets/getting-started._topic-CHJMf0pa.js +1 -0
  102. package/studio-dist/client/assets/getting-started.index-MR6HftWs.js +1 -0
  103. package/studio-dist/client/assets/{graph-canvas-Be5qgdDt.js → graph-canvas-BdNk2F9O.js} +1 -1
  104. package/studio-dist/client/assets/graph-hRijsC89.js +2 -0
  105. package/studio-dist/client/assets/guides-CwFnh08E.js +1 -0
  106. package/studio-dist/client/assets/highlighted-body-JLMTFACH-BcroQey-.js +1 -0
  107. package/studio-dist/client/assets/index-D5oGyvG8.js +41 -0
  108. package/studio-dist/client/assets/{markdown-view-dku7MGPn.js → markdown-view-CJ8JsLb7.js} +1 -1
  109. package/studio-dist/client/assets/marked.esm-vFuq1cCd.js +65 -0
  110. package/studio-dist/client/assets/mcp-BE9M-bkO.js +4 -0
  111. package/studio-dist/client/assets/mermaid-WFAXDIZX-BjSsakrn.js +1 -0
  112. package/studio-dist/client/assets/panel-CDQ6Lryw.js +1 -0
  113. package/studio-dist/client/assets/plugins._service._view-DRVPUAWN.js +1 -0
  114. package/studio-dist/client/assets/{prepaint-BkoDSw5X.js → prepaint-sD_LlrDN.js} +1 -1
  115. package/studio-dist/client/assets/{queries-CMvC2OkU.js → queries-COL925ML.js} +1 -1
  116. package/studio-dist/client/assets/react-dom-K3Hp2Cdj.js +1 -0
  117. package/studio-dist/client/assets/{react-BYUSgtBs.js → react-h2xQ_NSp.js} +1 -1
  118. package/studio-dist/client/assets/reports-BClsojkb.js +1 -0
  119. package/studio-dist/client/assets/routes-CJQ2MAej.js +1 -0
  120. package/studio-dist/client/assets/search-DhWdEiKT.js +1 -0
  121. package/studio-dist/client/assets/select-B2FsN9FY.js +1 -0
  122. package/studio-dist/client/assets/skills-SoUHk77W.js +1 -0
  123. package/studio-dist/client/assets/{specs-Bqd1ajyD.js → specs-C_tZnAvF.js} +1 -1
  124. package/studio-dist/client/assets/specs-view-C6t3Y5IT.js +1 -0
  125. package/studio-dist/client/assets/steps-CF3-Zpmh.js +1 -0
  126. package/studio-dist/client/assets/{store-BYnEU33C.js → store-pY9gU4uS.js} +1 -1
  127. package/studio-dist/client/assets/studio-X7bnFrRe.js +36 -0
  128. package/studio-dist/client/assets/studio-queries-CKtAnIKP.js +2 -0
  129. package/studio-dist/client/assets/usage-BaaqUpTG.js +55 -0
  130. package/studio-dist/client/assets/useAnchoredPopupScrollLock-BspHR7Wt.js +1 -0
  131. package/studio-dist/client/assets/useBlocker-BQOfcu_f.js +1 -0
  132. package/studio-dist/client/assets/useMutation-DKeEoP5S.js +1 -0
  133. package/studio-dist/client/assets/useOpenInteractionType-CtaZCaFT.js +1 -0
  134. package/studio-dist/client/assets/usePopupHandleStore-Bc7Q4bnF.js +1 -0
  135. package/studio-dist/client/assets/vault-sAPFUnPN.js +1 -0
  136. package/studio-dist/client/assets/{warnings-Cnw99ugO.js → warnings-D7YY1HSG.js} +1 -1
  137. package/studio-dist/client/assets/work-BZek_LGB.js +5 -0
  138. package/studio-dist/client/assets/workflow-N5boHXFz.js +1 -0
  139. package/studio-dist/server/THIRD-PARTY-LICENSES.md +4371 -0
  140. package/studio-dist/server/assets/DialogTitle-DnKSl2V0.js +421 -0
  141. package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-CS3QRY4Q.js → __23tanstack-start-server-fn-resolver-Bli9bpSB.js} +38 -18
  142. package/studio-dist/server/assets/_tanstack-start-manifest_v.js +91 -59
  143. package/studio-dist/server/assets/{actions-D8erOphH.js → actions-CHEFA1i9.js} +33 -1
  144. package/studio-dist/server/assets/{cn-DWFJaP_9.js → bundle-mjs-Ot6dQ8Pq.js} +1 -2056
  145. package/studio-dist/server/assets/{button-Ct_WeYLc.js → button-BqA1urbl.js} +14 -7
  146. package/studio-dist/server/assets/chat-zl332Tvu.js +49486 -0
  147. package/studio-dist/server/assets/cn-B0fl6NWK.js +2057 -0
  148. package/studio-dist/server/assets/{combobox-17vO5Uz8.js → combobox-iTjvPCtS.js} +7 -6
  149. package/studio-dist/server/assets/{companion-view-JkxnGLlp.js → companion-view-DIQ6AFIY.js} +2 -2
  150. package/studio-dist/server/assets/{companions-YNLsbnch.js → companions-aVwjRL8j.js} +1 -1
  151. package/studio-dist/server/assets/{fields-VytPpqBq.js → fields-BMap2_Ju.js} +10 -3
  152. package/studio-dist/server/assets/{friction-BW86PCPM.js → friction-BER50hoD.js} +2 -2
  153. package/studio-dist/server/assets/{friction-B6osqFSm.js → friction-BPs9KWdq.js} +8 -8
  154. package/studio-dist/server/assets/{getting-started-CFHSeX5h.js → getting-started-DGfRVmZ_.js} +2 -2
  155. package/studio-dist/server/assets/{getting-started._topic-BK2eU6AS.js → getting-started._topic-BgrBA4Vj.js} +2 -2
  156. package/studio-dist/server/assets/{getting-started.index-DZLuXnNO.js → getting-started.index-BaFfQ9Mn.js} +2 -2
  157. package/studio-dist/server/assets/{graph-BJVZBevL.js → graph-Cgzlrv3P.js} +8 -8
  158. package/studio-dist/server/assets/{graph-DGZHV-Ek.js → graph-DODpuOy_.js} +1 -1
  159. package/studio-dist/server/assets/{graph-canvas-lrNT6jbl.js → graph-canvas-DW_zU1nA.js} +2 -2
  160. package/studio-dist/server/assets/{guides-_G8Vucsk.js → guides-CA_EMG7E.js} +1 -1
  161. package/studio-dist/server/assets/{guides-CEwLOZb9.js → guides-D0SpoD32.js} +1 -1
  162. package/studio-dist/server/assets/{guides.server-ZWFKX2XJ.js → guides.server-DJjQuy03.js} +1 -1
  163. package/studio-dist/server/assets/highlighted-body-JLMTFACH-BeHllu-r.js +41 -0
  164. package/studio-dist/server/assets/{markdown-view-Bmjghg_Z.js → markdown-view-CvVBGMZV.js} +1 -1
  165. package/studio-dist/server/assets/mcp-BU0fLYyJ.js +1103 -0
  166. package/studio-dist/server/assets/mcp-manager-D9YctTQe.js +50 -0
  167. package/studio-dist/server/assets/mermaid-WFAXDIZX-B1yDN6vG.js +1 -0
  168. package/studio-dist/server/assets/{panel-DvRjyil3.js → panel-D1K6Bsux.js} +4 -32
  169. package/studio-dist/server/assets/{plugins._service._view-B32LzraG.js → plugins._service._view-DdO1nELF.js} +4 -4
  170. package/studio-dist/server/assets/{prepaint-BEHwKl51.js → prepaint-BB3dwSmz.js} +1 -1
  171. package/studio-dist/server/assets/{queries-D6Vq0AuZ.js → queries-BwiDxQy5.js} +1 -1
  172. package/studio-dist/server/assets/{react-CiBZPDs8.js → react-B2cLiz-i.js} +1 -1
  173. package/studio-dist/server/assets/{reports-Dn92pLap.js → reports-9Pr7Bz6o.js} +7 -7
  174. package/studio-dist/server/assets/{reports-DDaH5k0H.js → reports-Cc9M3phM.js} +1 -1
  175. package/studio-dist/server/assets/{router-Bjf4S9tO.js → router-DcWe0J7Y.js} +827 -548
  176. package/studio-dist/server/assets/{routes-B4sNiE0X.js → routes-BEXxl0py.js} +8 -8
  177. package/studio-dist/server/assets/{search-DKeJRvg8.js → search-bltT7gwy.js} +39 -7
  178. package/studio-dist/server/assets/{select-CVHYL7oR.js → select-CZvHgGCi.js} +7 -6
  179. package/studio-dist/server/assets/{shell-BxbYYaAk.js → shell-BQ0vMKXN.js} +13 -4
  180. package/studio-dist/server/assets/{skills-Bj8eOgzR.js → skills-Be_52h0i.js} +1 -1
  181. package/studio-dist/server/assets/{skills-B4-0qpqN.js → skills-BpGGUl6L.js} +8 -8
  182. package/studio-dist/server/assets/{specs-rfMug6qW.js → specs-CCGgXE-V.js} +5 -5
  183. package/studio-dist/server/assets/{specs-view-qi1SE1Sl.js → specs-view-DtL5JxYM.js} +12 -11
  184. package/studio-dist/server/assets/{steps-rger6HJc.js → steps-BWFSO6dM.js} +1 -1
  185. package/studio-dist/server/assets/{store-Dg9T7oWs.js → store-X7yLPp7v.js} +1 -1
  186. package/studio-dist/server/assets/{studio-queries-CeFfmIuM.js → studio-queries-ur1ygXi3.js} +117 -13
  187. package/studio-dist/server/assets/{studio-D79JzDLc.js → studio-qzH-UETC.js} +209 -180
  188. package/studio-dist/server/assets/{usage-Dw_UQFX-.js → usage-C1o0DLzS.js} +1 -1
  189. package/studio-dist/server/assets/{usage-BJgYWRCX.js → usage-DWbSPrPD.js} +10 -9
  190. package/studio-dist/server/assets/{useAnchoredPopupScrollLock-ciS_sEq3.js → useAnchoredPopupScrollLock-DLDmv6kM.js} +4 -135
  191. package/studio-dist/server/assets/useBlocker-CQtANHK8.js +111 -0
  192. package/studio-dist/server/assets/{useMutation-DnWK0PhO.js → useMutation-NjlA8oFY.js} +2 -2
  193. package/studio-dist/server/assets/useOpenInteractionType-CZYscfOb.js +136 -0
  194. package/studio-dist/server/assets/usePopupHandleStore-DEEXJYv0.js +26 -0
  195. package/studio-dist/server/assets/{vault-BzarssiL.js → vault-B_kfi1h-.js} +1 -1
  196. package/studio-dist/server/assets/{vault-CvlrLd2H.js → vault-dL79JlKH.js} +8 -115
  197. package/studio-dist/server/assets/{views-CAxwKHMK.js → views-BSGH56lb.js} +3 -3
  198. package/studio-dist/server/assets/{warnings-BpVCugHm.js → warnings-DtUVPV-k.js} +2 -2
  199. package/studio-dist/server/assets/work-D789VXGH.js +110 -0
  200. package/studio-dist/server/assets/work-DsCEfhmK.js +3817 -0
  201. package/studio-dist/server/assets/work-requests-BLhOmQFO.js +11 -0
  202. package/studio-dist/server/assets/{workflow-BdrzcCt8.js → workflow-BOZ2sRYg.js} +9 -9
  203. package/studio-dist/server/server.js +3 -3
  204. package/wrappers/bin/openspec +87 -2
  205. package/studio-dist/client/assets/app-ggXJ_QVh.css +0 -2
  206. package/studio-dist/client/assets/button-C9SQW3kI.js +0 -1
  207. package/studio-dist/client/assets/cn-DC80MJV0.js +0 -1
  208. package/studio-dist/client/assets/combobox-D7mKYCBb.js +0 -1
  209. package/studio-dist/client/assets/fields-CEep8IFT.js +0 -1
  210. package/studio-dist/client/assets/friction-D9dBU7WN.js +0 -1
  211. package/studio-dist/client/assets/getting-started-BDyGvHhc.js +0 -1
  212. package/studio-dist/client/assets/getting-started._topic-B9ajbF4o.js +0 -1
  213. package/studio-dist/client/assets/getting-started.index-CYiBPtb7.js +0 -1
  214. package/studio-dist/client/assets/graph-ah7ZXfTa.js +0 -2
  215. package/studio-dist/client/assets/guides-CsL0660B.js +0 -1
  216. package/studio-dist/client/assets/index-zmRH87D4.js +0 -40
  217. package/studio-dist/client/assets/panel-COgk0vP5.js +0 -1
  218. package/studio-dist/client/assets/plugins._service._view-Cn3WBHab.js +0 -1
  219. package/studio-dist/client/assets/reports-C_AqLBYH.js +0 -1
  220. package/studio-dist/client/assets/routes-BokQmHtC.js +0 -1
  221. package/studio-dist/client/assets/search-DxidNK2M.js +0 -1
  222. package/studio-dist/client/assets/select-CYFCbHUd.js +0 -1
  223. package/studio-dist/client/assets/skills-R3vttWHM.js +0 -1
  224. package/studio-dist/client/assets/specs-view-znqFPx9p.js +0 -1
  225. package/studio-dist/client/assets/steps-tVDWn7j6.js +0 -1
  226. package/studio-dist/client/assets/studio-ndtFcS2Y.js +0 -100
  227. package/studio-dist/client/assets/studio-queries-CkUSByy7.js +0 -2
  228. package/studio-dist/client/assets/usage-Kuhr8dSl.js +0 -55
  229. package/studio-dist/client/assets/useAnchoredPopupScrollLock-dc_kP4Go.js +0 -1
  230. package/studio-dist/client/assets/useMutation-CqtM9COw.js +0 -1
  231. package/studio-dist/client/assets/vault-CSP8kwRg.js +0 -1
  232. package/studio-dist/client/assets/workflow-BPJAmmZi.js +0 -1
@@ -1 +1 @@
1
- import{it as e}from"./studio-queries-CkUSByy7.js";import{a as t,n,t as r}from"./jsx-runtime-MZURdZre.js";var i=t(n(),1),a=r(),o=new Set(`h1.h2.h3.h4.h5.h6.p.pre.code.span.blockquote.hr.ol.ul.li.div.dl.dt.dd.table.thead.tbody.tr.th.td.strong.em.del.br`.split(`.`));function s(t,n,r){let s=t.c?.map((e,t)=>c(e,t,r)),{a:l}=t;if(t.t===`a`){if(r&&l?.guide){let[t,i]=l.guide.split(`#`);return t&&!/^\/getting-started(?:\/(?:worktrees|vscode))?$/.test(t)?(0,a.jsx)(`span`,{children:s},n):(0,a.jsx)(e,{to:t||`.`,hash:i,search:r,children:s},n)}return l?.note?(0,a.jsx)(e,{to:`/vault`,search:e=>({...e,path:l.note,dir:void 0,mode:void 0}),"data-vault-entry":l.note,children:s},n):l?.href&&/^https?:\/\//i.test(l.href)?(0,a.jsx)(`a`,{href:l.href,target:`_blank`,rel:`noopener noreferrer`,children:s},n):(0,a.jsx)(`span`,{children:s},n)}return t.t===`input`?(0,a.jsx)(`input`,{type:`checkbox`,checked:!!l?.checked,disabled:!0,readOnly:!0,"aria-label":`Task`},n):o.has(t.t)?(r&&l?.id&&s&&s.push((0,a.jsx)(e,{to:`.`,hash:l.id,search:r,className:`guide-anchor`,"aria-label":`Link to ${l.id}`,children:`#`},`anchor`)),(0,i.createElement)(t.t,{key:n,className:l?.className,id:r?l?.id:void 0,tabIndex:r&&l?.id?-1:void 0,start:l?.start,style:l?.align?{textAlign:l.align}:void 0},s&&s.length>0?s:void 0)):(0,a.jsx)(`span`,{children:s},n)}function c(e,t,n){return typeof e==`string`?e:s(e,t,n)}function l({nodes:e,guideSearch:t}){return(0,a.jsx)(`div`,{className:`markdown-body`,children:e.map((e,n)=>c(e,n,t))})}export{l as t};
1
+ import{ut as e}from"./studio-queries-CKtAnIKP.js";import{a as t,n,t as r}from"./jsx-runtime-MZURdZre.js";var i=t(n(),1),a=r(),o=new Set(`h1.h2.h3.h4.h5.h6.p.pre.code.span.blockquote.hr.ol.ul.li.div.dl.dt.dd.table.thead.tbody.tr.th.td.strong.em.del.br`.split(`.`));function s(t,n,r){let s=t.c?.map((e,t)=>c(e,t,r)),{a:l}=t;if(t.t===`a`){if(r&&l?.guide){let[t,i]=l.guide.split(`#`);return t&&!/^\/getting-started(?:\/(?:worktrees|vscode))?$/.test(t)?(0,a.jsx)(`span`,{children:s},n):(0,a.jsx)(e,{to:t||`.`,hash:i,search:r,children:s},n)}return l?.note?(0,a.jsx)(e,{to:`/vault`,search:e=>({...e,path:l.note,dir:void 0,mode:void 0}),"data-vault-entry":l.note,children:s},n):l?.href&&/^https?:\/\//i.test(l.href)?(0,a.jsx)(`a`,{href:l.href,target:`_blank`,rel:`noopener noreferrer`,children:s},n):(0,a.jsx)(`span`,{children:s},n)}return t.t===`input`?(0,a.jsx)(`input`,{type:`checkbox`,checked:!!l?.checked,disabled:!0,readOnly:!0,"aria-label":`Task`},n):o.has(t.t)?(r&&l?.id&&s&&s.push((0,a.jsx)(e,{to:`.`,hash:l.id,search:r,className:`guide-anchor`,"aria-label":`Link to ${l.id}`,children:`#`},`anchor`)),(0,i.createElement)(t.t,{key:n,className:l?.className,id:r?l?.id:void 0,tabIndex:r&&l?.id?-1:void 0,start:l?.start,style:l?.align?{textAlign:l.align}:void 0},s&&s.length>0?s:void 0)):(0,a.jsx)(`span`,{children:s},n)}function c(e,t,n){return typeof e==`string`?e:s(e,t,n)}function l({nodes:e,guideSearch:t}){return(0,a.jsx)(`div`,{className:`markdown-body`,children:e.map((e,n)=>c(e,n,t))})}export{l as t};
@@ -0,0 +1,65 @@
1
+ function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var t=e();function n(e){t=e}var r={exec:()=>null};function i(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function a(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(s.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var o=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),s={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:i(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:i(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:i(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:i(e=>RegExp(`^ {0,${e}}(?:</?(?:${y})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:i(e=>RegExp(`^ {0,${e}}>`))},c=/^(?:[ \t]*(?:\n|$))+/,l=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,u=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,d=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,f=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,p=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,m=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,h=a(m).replace(/bull/g,p).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),g=a(m).replace(/bull/g,p).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ee=/^[^\n]+/,v=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,te=a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,v).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ne=a(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,p).getRegex(),y=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,b=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,re=a(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,b).replace(`tag`,y).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),x=e=>a(_).replace(`hr`,d).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,y).getRegex(),ie=x(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ae=x(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),S={blockquote:a(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ae).getRegex(),code:l,def:te,fences:u,heading:f,hr:d,html:re,lheading:h,list:ne,newline:c,paragraph:ie,table:r,text:ee},oe=a(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,d).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,y).getRegex(),se={...S,lheading:g,table:oe,paragraph:a(_).replace(`hr`,d).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,oe).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,y).getRegex()},ce={...S,html:a(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,b).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:a(_).replace(`hr`,d).replace(`heading`,` *#{1,6} *[^
2
+ ]`).replace(`lheading`,h).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},le=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ue=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,de=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,fe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,C=/[\p{P}\p{S}]/u,w=/[\s\p{P}\p{S}]/u,T=/[^\s\p{P}\p{S}]/u,pe=a(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,w).getRegex(),me=/[\p{Pi}\p{Ps}"']/u,E=/(?!~)[\p{P}\p{S}]/u,he=/(?!~)[\s\p{P}\p{S}]/u,ge=/(?:[^\s\p{P}\p{S}]|~)/u,_e=a(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,o?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),D=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ve=a(D,`u`).replace(/punct/g,C).getRegex(),ye=a(D,`u`).replace(/punct/g,E).getRegex(),be=a(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,me).replace(/punct/g,C).getRegex(),O=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,xe=a(O,`gu`).replace(/notPunctSpace/g,T).replace(/punctSpace/g,w).replace(/punct/g,C).getRegex(),Se=a(O,`gu`).replace(/notPunctSpace/g,ge).replace(/punctSpace/g,he).replace(/punct/g,E).getRegex(),Ce=a(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,T).replace(/punctSpace/g,w).replace(/punct/g,C).getRegex(),we=a(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,T).replace(/punctSpace/g,w).replace(/punct/g,C).getRegex(),Te=a(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,T).replace(/punctSpace/g,w).replace(/punct/g,C).getRegex(),Ee=a(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,C).getRegex(),De=a(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,T).replace(/punctSpace/g,w).replace(/punct/g,C).getRegex(),Oe=a(/\\(punct)/,`gu`).replace(/punct/g,C).getRegex(),ke=a(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,C).getRegex(),Ae=a(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),je=a(b).replace(`(?:-->|$)`,`-->`).getRegex(),Me=a(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,je).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),k=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,A=a(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,k).getRegex(),Ne=a(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,A).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Pe=a(/^!?\[(label)\]\[(ref)\]/).replace(`label`,A).replace(`ref`,v).getRegex(),Fe=a(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,v).getRegex(),j=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Ie=a(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,k).getRegex(),Le=a(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,a(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ie).replace(`ref`,j).getRegex()).replace(`nolink`,a(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,j).getRegex()).getRegex(),M=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Re=a(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),N={_backpedal:r,anyPunctuation:Oe,anyPunctuationOutsideCode:ke,autolink:Ae,blockSkip:_e,br:de,code:ue,del:r,delLDelim:r,delRDelim:r,emStrongLDelim:ve,emStrongRDelimAst:xe,emStrongRDelimUnd:we,escape:le,link:Ne,nolink:Fe,punctuation:pe,reflink:Pe,reflinkSearch:Le,tag:Me,text:fe,url:r},ze={...N,emStrongLDelim:be,emStrongRDelimAst:Ce,emStrongRDelimUnd:Te,link:a(/^!?\[(label)\]\((.*?)\)/).replace(`label`,A).getRegex(),reflink:a(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,A).getRegex()},P={...N,emStrongRDelimAst:Se,emStrongLDelim:ye,delLDelim:Ee,delRDelim:De,url:a(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Re).replace(`protocol`,M).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:a(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,M).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Be={...P,br:a(de).replace(`{2,}`,`*`).getRegex(),text:a(P.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},F={normal:S,gfm:se,pedantic:ce},I={normal:N,gfm:P,breaks:Be,pedantic:ze},Ve={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},L=e=>Ve[e];function R(e,t){if(t){if(s.escapeTest.test(e))return e.replace(s.escapeReplace,L)}else if(s.escapeTestNoEncode.test(e))return e.replace(s.escapeReplaceNoEncode,L);return e}function He(e){return s.numericCharacterReference.test(e)?e.replace(s.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&amp;`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&amp;`:String.fromCodePoint(r)}):e}function z(e){try{e=encodeURI(e).replace(s.percentDecode,`%`)}catch{return null}return e}function B(e,t){let n=e.replace(s.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(s.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(s.slashPipe,`|`);return n}function V(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function H(e){let t=e.split(`
3
+ `),n=t.length-1;for(;n>=0&&s.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
4
+ `)}function U(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function Ue(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function W(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function We(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function Ge(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
5
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
6
+ `)}function Ke(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var G=class{options;rules;lexer;constructor(e){this.options=e||t}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:H(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Ge(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=V(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:V(t[0],`
7
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:V(t[0],`
8
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=V(t[0],`
9
+ `).split(`
10
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
11
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
12
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
13
+ ${s}`:s,r=r?`${r}
14
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
15
+ `),o=t.raw+`
16
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
17
+ `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
18
+ ${d.join(`
19
+ `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
20
+ `+e.join(`
21
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
22
+ `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
23
+ `,1)[0],d=t[1].length,f=this.options.pedantic?W(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>W(e,d)),p=e.split(`
24
+ `,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(`
25
+ `,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>W(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
26
+ `+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||n.test(f))break;a+=`
27
+ `+p}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=H(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Ue(t[2],`()`)!==-1)return;let e=U(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:V(t[0],`
28
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=B(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
29
+ `):[],a={type:`table`,raw:V(t[0],`
30
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(B(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:V(t[0],`
31
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
32
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Ke(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=V(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Ue(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),We(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Ke(e,n[1],r,this.rules))return;let i=t[U((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return We(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:He(t[0]),escaped:e}}}},K=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t,this.options.tokenizer=this.options.tokenizer||new G,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:s,block:F.normal,inline:I.normal};this.options.pedantic?(n.block=F.pedantic,n.inline=I.pedantic):this.options.gfm&&(n.block=F.gfm,n.inline=this.options.breaks?I.breaks:I.gfm),this.tokenizer.rules=n}static get rules(){return{block:F,inline:I}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(s.carriageReturn,`
33
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(s.tabCharGlobal,` `).replace(s.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
34
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
35
+ `)?``:`
36
+ `)+i.raw,n.text+=`
37
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
38
+ `)?``:`
39
+ `)+i.raw,n.text+=`
40
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
41
+ `)?``:`
42
+ `)+i.raw,r.text+=`
43
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
44
+ `)?``:`
45
+ `)+i.raw,n.text+=`
46
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,U(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,U(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},q=class{options;parser;constructor(e){this.options=e||t}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(s.notSpaceStart)?.[0],i=e?e.replace(s.endingNewline,``)+`
47
+ `:``;return r?`<pre><code class="language-`+R(r)+`">`+(n?i:R(i,!0))+`</code></pre>
48
+ `:`<pre><code>`+(n?i:R(i,!0))+`</code></pre>
49
+ `}blockquote({tokens:e}){return`<blockquote>
50
+ ${this.parser.parse(e)}</blockquote>
51
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
52
+ `}hr(e){return`<hr>
53
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
54
+ `+r+`</`+i+`>
55
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
56
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
57
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
58
+ <thead>
59
+ `+t+`</thead>
60
+ `+r+`</table>
61
+ `}tablerow({text:e}){return`<tr>
62
+ ${e}</tr>
63
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
64
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${R(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?R(n,!0):this.parser.parseInline(r),o=z(e);if(o===null)return a;e=R(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+R(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=z(e);if(i===null)return R(n);e=i;let a=`<img src="${R(e)}" alt="${R(n)}"`;return t&&(a+=` title="${R(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:R(e.text)}},J=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Y=class e{options;renderer;textRenderer;constructor(e){this.options=e||t,this.options.renderer=this.options.renderer||new q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new J}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},X=class{options;block;constructor(e){this.options=e||t}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?K.lex:K.lexInline}provideParser(e=this.block){return e?Y.parse:Y.parseInline}};function Z(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var Q=new class{defaults=e();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Y;Renderer=q;TextRenderer=J;Lexer=K;Tokenizer=G;Hooks=X;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(Z(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)Z(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)Z(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;Z(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);Z(n,this.walkTokens(i,t))}):e.tokens&&Z(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new q(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new G(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new X;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=X.passThroughHooks.has(n)?e=>{if(this.defaults.async&&X.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&Z(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return K.lex(e,t??this.defaults)}parser(e,t){return Y.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?K.lex:K.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Y.parse:Y.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?K.lex:K.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Y.parse:Y.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
65
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+R(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Q.parse(e,t)}$.options=$.setOptions=function(e){return Q.setOptions(e),$.defaults=Q.defaults,n($.defaults),$},$.getDefaults=e,$.defaults=t;function qe(...e){return Q.use(...e),$.defaults=Q.defaults,n($.defaults),$}$.use=qe,$.walkTokens=function(e,t){return Q.walkTokens(e,t)},$.parseInline=Q.parseInline,$.Parser=Y,$.parser=Y.parse,$.Renderer=q,$.TextRenderer=J,$.Lexer=K,$.lexer=K.lex,$.Tokenizer=G,$.Hooks=X,$.parse=$,$.options,$.setOptions,$.walkTokens,$.parseInline,Y.parse,K.lex;export{K as t};
@@ -0,0 +1,4 @@
1
+ import{$ as e,It as t,Lt as n,N as r,Q as i,X as a,Z as o,d as s,et as c,f as l,m as u,p as d}from"./index-D5oGyvG8.js";import{G as ee,d as f}from"./studio-queries-CKtAnIKP.js";import{t as te}from"./useMutation-DKeEoP5S.js";import{p as ne,t as p}from"./cn-BCnYnarL.js";import{t as re}from"./useBlocker-BQOfcu_f.js";import{a as m,n as ie,t as h}from"./jsx-runtime-MZURdZre.js";import{ct as g,it as _,lt as v,nt as ae,ot as y,r as b,rt as x,t as S,ut as C}from"./button-upSzkd-q.js";import{i as w,t as T}from"./fields-DNZ4a89M.js";import{n as E,r as D,t as O}from"./studio-X7bnFrRe.js";import{a as k,c as A,l as j,o as M,s as N}from"./select-B2FsN9FY.js";var P=m(ie(),1),F={servers:`server`,groups:`group`},I={enabled:`off`,off:`enabled`,inherit:`enable`,enable:`disable`,disable:`inherit`},L=(e,t)=>e?.[t]??[];function R(e,t,n,r){if(t===null)return L(e.catalog?.enabled,n).includes(r)?`enabled`:`off`;let i=e.audiences[t];return L(i?.enable,n).includes(r)?`enable`:L(i?.disable,n).includes(r)?`disable`:`inherit`}function z(e,t,n,r){let i=L(e,t).filter(e=>e!==n);return{...e,[t]:r?[...i,n]:i}}function B(e,t,n,r){let i=I[R(e,t,n,r)];if(t===null){let t=z(e.catalog?.enabled,n,r,i===`enabled`);return{...e,catalog:{...e.catalog,enabled:t}}}let a=e.audiences[t];return{...e,audiences:{...e.audiences,[t]:{enable:z(a?.enable,n,r,i===`enable`),disable:z(a?.disable,n,r,i===`disable`)}}}}function oe(e,t,n){return{groups:(t===`servers`?Object.entries(e.catalog?.groups??{}):[]).filter(([,e])=>e.includes(n)).map(([e])=>e),base:R(e,null,t,n)===`enabled`,audiences:Object.keys(e.audiences).filter(r=>R(e,r,t,n)!==`inherit`)}}function V(e){return e.length<2?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`}function se(e,t,n){let{groups:r,base:i,audiences:a}=oe(e,t,n),o=[...r.length>0?[`${r.length===1?`group`:`groups`} ${V(r)}`]:[],...i?[`the base selection`]:[],...a.length>0?[`${a.length===1?`audience`:`audiences`} ${V(a)}`]:[]];return o.length>0?V(o):null}function H(e,t,n,r){let i=e=>e.flatMap(e=>e===n?r??[]:e),a=e=>e?.[t]?{...e,[t]:i(e[t])}:e,o=e.catalog?.groups;return{catalog:{...e.catalog,groups:t===`servers`&&o?Object.fromEntries(Object.entries(o).map(([e,t])=>[e,i(t)])):o,enabled:a(e.catalog?.enabled)},audiences:Object.fromEntries(Object.entries(e.audiences).map(([e,t])=>[e,{enable:a(t.enable),disable:a(t.disable)}]))}}function ce(e,t,n){let r=H(e,t,n,null),{[n]:i,...a}=r.catalog?.[t]??{};return{...r,catalog:{...r.catalog,[t]:a}}}function le(e,t,n,r,i){let a=n!==null&&n!==r?H(e,t,n,r):e,o=Object.entries(a.catalog?.[t]??{}),s=o.findIndex(([e])=>e===n);return s===-1?o.push([r,i]):o[s]=[r,i],{...a,catalog:{...a.catalog,[t]:Object.fromEntries(o)}}}function ue(e,t,n,r){return r!==n&&Object.hasOwn(e.catalog?.[t]??{},r)}var de=[`stdio`,...E];function U(e){return`command`in e?`stdio`:e.transport??`http`}function fe(e){return Object.entries(e??{}).map(([e,t])=>({header:e,...D(t)??{prefix:``,variable:``}}))}function pe(e=``,t){let n=t&&`command`in t?t:void 0,r=t&&`url`in t?t:void 0;return{name:e,transport:t?U(t):`stdio`,command:n?.command??``,args:(n?.args??[]).join(`
2
+ `),url:r?.url??``,env:(t?.env??[]).join(`
3
+ `),headers:fe(r?.headers)}}var W=e=>e.split(`
4
+ `).map(e=>e.trim()).filter(Boolean);function me(e){let t=W(e.env),n=t.length>0?{env:t}:{};if(e.transport===`stdio`){let t=W(e.args);return{command:e.command.trim(),...t.length>0?{args:t}:{},...n}}let r=e.headers.filter(e=>e.header.trim()||e.variable.trim());return{url:e.url.trim(),...e.transport===`sse`?{transport:`sse`}:{},...r.length>0?{headers:Object.fromEntries(r.map(e=>[e.header.trim(),`${e.prefix}\${${e.variable.trim()}}`]))}:{},...n}}var G=h(),K=`none`,q=[{value:K,label:`No prefix`},...O.map(e=>({value:e,label:e.trim()}))];function he({dialog:e,open:t,finalFocus:n,...r}){return(0,G.jsx)(a,{open:t,onOpenChange:e=>{e||r.onClose()},children:(0,G.jsxs)(i,{className:`grid max-h-[80vh] w-[min(520px,calc(100vw-32px))] gap-4 overflow-y-auto p-5`,finalFocus:n,children:[e?.kind===`form`&&e.entry===`servers`?(0,G.jsx)(ye,{previous:e.previous,...r}):null,e?.kind===`form`&&e.entry===`groups`?(0,G.jsx)(xe,{previous:e.previous,...r}):null,e?.kind===`delete`?(0,G.jsx)(Se,{entry:e.entry,name:e.name,...r},`${e.entry}/${e.name}`):null]})})}function ge({companion:e,state:t,onApply:n,onClose:r},i,a){let o=ne(),[s,c]=(0,P.useState)(null),l=te({mutationFn:t=>o.fetchQuery(d(e,t)),onSuccess:(e,t)=>{e.ok&&(n(t),r())}}),u=(e,n)=>{if(ue(t,i,a,e))return l.reset(),c(e);c(null),l.mutate(le(t,i,a,e,n))},ee=s?`A ${F[i]} named ${s} already exists.`:l.isError?l.error.message||`The entry could not be checked.`:l.data?.ok===!1?l.data.reason:null;return{submit:u,pending:l.isPending,refusal:ee}}function J({title:t,children:n}){return(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsx)(c,{className:`text-md`,children:t}),(0,G.jsx)(e,{children:n})]})}function Y({className:e,...t}){return(0,G.jsx)(T,{className:p(`font-mono`,e),autoComplete:`off`,spellCheck:!1,...t})}function X(e){return(0,G.jsx)(Z,{label:`Name`,hint:`Lowercase letters, digits and hyphens.`,children:(0,G.jsx)(Y,{...e})})}function Z({label:e,hint:t,children:n}){return(0,G.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,G.jsx)(`span`,{children:e}),n,t?(0,G.jsx)(`span`,{className:`text-xs text-muted`,children:t}):null]})}function _e({pending:e,action:t}){return(0,G.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,G.jsx)(o,{render:(0,G.jsx)(S,{variant:`ghost`}),children:`Cancel`}),(0,G.jsx)(S,{type:`submit`,variant:`primary`,disabled:e,children:e?`Checking…`:t})]})}function ve({children:e}){return e?(0,G.jsx)(`p`,{className:`m-0 text-sm text-bad`,role:`alert`,children:e}):null}function ye({previous:e,...t}){let{state:n}=t,[r,i]=(0,P.useState)(()=>pe(e??``,e?n.catalog?.servers?.[e]:void 0)),a=ge(t,`servers`,e),o=(e,t)=>i(n=>({...n,[e]:t}));return(0,G.jsxs)(`form`,{className:`grid gap-3.5`,onSubmit:e=>{e.preventDefault(),a.submit(r.name.trim(),me(r))},children:[(0,G.jsx)(J,{title:e?`Edit ${e}`:`Add a server`,children:`Variables are given by name only. Mate never stores or shows a value.`}),(0,G.jsx)(X,{value:r.name,placeholder:`acme-docs`,onChange:e=>o(`name`,e.currentTarget.value)}),(0,G.jsxs)(`div`,{className:`grid gap-1.5 text-sm`,children:[(0,G.jsx)(`span`,{children:`Transport`}),(0,G.jsx)(y,{label:`Transport`,options:de.map(e=>({value:e,label:e})),value:r.transport,onChange:e=>o(`transport`,e)})]}),r.transport===`stdio`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:`Command`,children:(0,G.jsx)(Y,{value:r.command,placeholder:`acme-docs-mcp`,onChange:e=>o(`command`,e.currentTarget.value)})}),(0,G.jsx)(Z,{label:`Arguments`,hint:`One per line.`,children:(0,G.jsx)(w,{className:`min-h-16 font-mono`,value:r.args,spellCheck:!1,onChange:e=>o(`args`,e.currentTarget.value)})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{label:`URL`,children:(0,G.jsx)(Y,{value:r.url,placeholder:`https://acme.test/mcp`,onChange:e=>o(`url`,e.currentTarget.value)})}),(0,G.jsx)(be,{rows:r.headers,onChange:e=>o(`headers`,e)})]}),(0,G.jsx)(Z,{label:`Environment variable names`,hint:`One name per line, such as ACME_TOKEN. Set the values where Studio and your agents run.`,children:(0,G.jsx)(w,{className:`min-h-16 font-mono`,value:r.env,spellCheck:!1,onChange:e=>o(`env`,e.currentTarget.value)})}),(0,G.jsx)(ve,{children:a.refusal}),(0,G.jsx)(_e,{pending:a.pending,action:e?`Apply`:`Add server`})]})}function be({rows:e,onChange:t}){let n=(0,P.useRef)(null),r=(0,P.useId)(),i=(n,r)=>t(e.map((e,t)=>t===n?{...e,...r}:e));return(0,G.jsxs)(`fieldset`,{className:`m-0 grid gap-1.5 border-0 p-0 text-sm`,children:[(0,G.jsx)(`legend`,{className:`mb-1.5 p-0`,children:`Headers`}),e.map((a,o)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Y,{className:`min-w-0 flex-1`,value:a.header,placeholder:`Authorization`,"aria-label":`Header ${o+1} name`,onChange:e=>i(o,{header:e.currentTarget.value})}),(0,G.jsxs)(k,{items:q,value:a.prefix||K,onValueChange:e=>{e!==null&&i(o,{prefix:e===K?``:e})},children:[(0,G.jsx)(A,{className:`w-32 flex-none`,"aria-label":`Header ${o+1} prefix`,children:(0,G.jsx)(j,{})}),(0,G.jsx)(M,{children:q.map(e=>(0,G.jsx)(N,{value:e.value,children:e.label},e.value))})]}),(0,G.jsx)(Y,{className:`min-w-0 flex-1`,value:a.variable,placeholder:`ACME_KEY`,"aria-label":`Header ${o+1} variable name`,onChange:e=>i(o,{variable:e.currentTarget.value})}),(0,G.jsx)(S,{variant:`ghost`,size:`icon`,"aria-label":`Remove header ${o+1}`,onClick:()=>{t(e.filter((e,t)=>t!==o)),n.current?.focus()},children:(0,G.jsx)(b,{name:`close`})})]},`${r}-${o}`)),(0,G.jsx)(`div`,{children:(0,G.jsxs)(S,{ref:n,size:`sm`,onClick:()=>t([...e,{header:``,prefix:``,variable:``}]),children:[(0,G.jsx)(b,{name:`plus`,className:`size-3.5`}),`Add header`]})}),(0,G.jsx)(`span`,{className:`text-xs text-muted`,children:`A header's value is the prefix followed by the named variable.`})]})}function xe({previous:e,...t}){let{state:n}=t,r=Object.keys(n.catalog?.servers??{}),[i,a]=(0,P.useState)(e??``),[o,s]=(0,P.useState)(()=>(e?n.catalog?.groups?.[e]:void 0)??[]),c=ge(t,`groups`,e);return(0,G.jsxs)(`form`,{className:`grid gap-3.5`,onSubmit:e=>{e.preventDefault(),c.submit(i.trim(),r.filter(e=>o.includes(e)))},children:[(0,G.jsx)(J,{title:e?`Edit ${e}`:`Add a group`,children:`A group lets a selection turn several servers on or off at once.`}),(0,G.jsx)(X,{value:i,placeholder:`acme-data`,onChange:e=>a(e.currentTarget.value)}),(0,G.jsxs)(`fieldset`,{className:`m-0 grid gap-1 border-0 p-0 text-sm`,children:[(0,G.jsx)(`legend`,{className:`mb-1.5 p-0`,children:`Servers`}),r.map(e=>(0,G.jsxs)(`label`,{className:`inline-flex items-center gap-2 font-mono text-xs`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:o.includes(e),onChange:t=>s(t.currentTarget.checked?[...o,e]:o.filter(t=>t!==e))}),e]},e))]}),(0,G.jsx)(ve,{children:c.refusal}),(0,G.jsx)(_e,{pending:c.pending,action:e?`Apply`:`Add group`})]})}function Se({entry:e,name:t,state:n,onApply:r,onClose:i}){let[a]=(0,P.useState)(()=>se(n,e,t));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(J,{title:(0,G.jsxs)(G.Fragment,{children:[`Delete `,F[e],` `,(0,G.jsx)(`span`,{className:`font-mono`,children:t}),`?`]}),children:[a?`It is used by ${a}. Deleting it removes it there too.`:`No group or selection uses it.`,` `,`Nothing is written until you save.`]}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,G.jsx)(o,{render:(0,G.jsx)(S,{variant:`ghost`}),children:`Cancel`}),(0,G.jsxs)(S,{variant:`danger`,onClick:()=>{r(ce(n,e,t)),i()},children:[(0,G.jsx)(b,{name:`trash`}),`Delete `,F[e]]})]})]})}function Ce({companion:e,writable:t}){let i=n(l(e)),a=(0,P.useRef)(null),{button:o,retried:s}=r(i.isSuccess,t?void 0:a);return i.data?(0,G.jsx)(Te,{companion:e,writable:t,loaded:i.data,addServer:o,filter:a}):i.isError?(0,G.jsxs)(`div`,{className:p(_,`text-sm`),role:`alert`,children:[(0,G.jsx)(`p`,{className:`m-0 text-bad`,children:`The MCP servers could not be read.`}),(0,G.jsx)(`p`,{className:`m-0 mt-1 text-muted`,children:i.error.message}),(0,G.jsx)(S,{className:`mt-3`,onClick:()=>{s(),i.refetch()},disabled:i.isFetching,children:`Retry`})]}):(0,G.jsx)(C,{title:`Reading MCP servers…`})}var we=({catalog:e,audiences:t})=>({catalog:e,audiences:t});function Te({companion:e,writable:t,loaded:r,addServer:i,filter:a}){let o=ne(),[s,c]=(0,P.useState)(null),[f,m]=(0,P.useState)(null),[ie,h]=(0,P.useState)(!1),[g,v]=(0,P.useState)({shown:null,open:!1}),y=(0,P.useRef)(null);re({shouldBlockFn:()=>!window.confirm(`Discard unsaved changes?`),disabled:s===null});let C=s?.base??r,w=s?.draft??we(r),T=n({...d(e,w),enabled:s!==null,placeholderData:ee}),E=s?T.data:void 0,D=E?.ok?E:C,O=E?.ok===!1?E.reason:null,k=t=>{o.setQueryData(l(e).queryKey,t),c(null),m(null),requestAnimationFrame(()=>i.current?.focus())},A=te({mutationFn:t=>u({data:{companion:e,next:w,token:t}}),onSuccess:e=>{if(e.kind===`conflict`)return m(e.current);k(e.view),h(!0)}}),j=e=>{A.isError&&A.reset(),c({base:C,draft:e}),h(!1)},M=e=>{A.reset(),k(e)},N=t&&!A.isPending,I=e=>t=>{y.current=t.currentTarget,v({shown:e,open:!0})},L=Object.entries(w.catalog?.servers??{}),R=Object.entries(w.catalog?.groups??{}),z=(e,t)=>(0,G.jsxs)(`span`,{className:`ml-auto flex flex-none items-center gap-1`,children:[(0,G.jsx)(S,{variant:`ghost`,size:`sm`,disabled:!N,"aria-label":`Edit ${t}`,onClick:I({kind:`form`,entry:e,previous:t}),children:`Edit`}),(0,G.jsx)(S,{variant:`ghost`,size:`sm`,disabled:!N,"aria-label":`Delete ${t}`,onClick:I({kind:`delete`,entry:e,name:t}),children:`Delete`})]}),B=(e,n)=>(0,G.jsxs)(S,{ref:n,size:`sm`,disabled:!t,onClick:I({kind:`form`,entry:e,previous:null}),children:[(0,G.jsx)(b,{name:`plus`,className:`size-3.5`}),`Add `,F[e]]});return(0,G.jsxs)(`div`,{className:p(_,`grid gap-3 pb-8`),children:[(0,G.jsx)(Oe,{writable:t,dirty:s!==null,saved:ie,pending:A.isPending,blocked:O!==null||f!==null,error:O??(A.isError?A.error.message||`The save failed.`:null),onSave:()=>A.mutate(C.token),onDiscard:()=>M(f??r)}),f?(0,G.jsx)(ke,{current:f,pending:A.isPending,onLoad:()=>M(f),onOverwrite:()=>A.mutate(f.token)}):null,L.length===0&&R.length===0?(0,G.jsxs)(ae,{className:`grid justify-items-start gap-3`,children:[(0,G.jsx)(`span`,{children:`This companion declares no MCP servers. Add the first one to give its agents a tool.`}),B(`servers`,i)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(x,{title:`Servers`,count:L.length,hint:B(`servers`,i),children:[L.length===0?(0,G.jsx)(`p`,{className:`m-0 px-4 py-3 text-sm text-muted`,children:`No servers. The groups below have no server to turn on.`}):null,(0,G.jsx)(`ul`,{className:`m-0 list-none p-0`,children:L.map(([e,t])=>(0,G.jsxs)(`li`,{className:Ee,"data-mcp-server":e,children:[(0,G.jsx)(`span`,{className:`w-40 flex-none truncate font-mono text-sm`,children:e}),(0,G.jsx)(`span`,{className:`w-12 flex-none text-xs text-muted`,children:U(t)}),(0,G.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:`command`in t?[t.command,...t.args??[]].join(` `):t.url}),(0,G.jsx)(De,{statuses:D.variables[e]??[]}),z(`servers`,e)]},e))}),(0,G.jsx)(`p`,{className:`m-0 border-t border-rule-soft px-4 py-2 text-xs text-muted`,children:`Set and missing describe the environment Studio runs in, which the sessions it starts inherit. A variable set only for a session elsewhere shows as missing. Values never reach this page.`})]}),(0,G.jsx)(x,{title:`Groups`,count:R.length,hint:B(`groups`),children:R.length===0?(0,G.jsx)(`p`,{className:`m-0 px-4 py-3 text-sm text-muted`,children:`No groups. A group lets a selection turn several servers on or off at once.`}):(0,G.jsx)(`ul`,{className:`m-0 list-none p-0`,children:R.map(([e,t])=>(0,G.jsxs)(`li`,{className:Ee,children:[(0,G.jsx)(`span`,{className:`w-40 flex-none truncate font-mono text-sm`,children:e}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:t.length>0?t.join(`, `):`no servers`}),z(`groups`,e)]},e))})}),(0,G.jsx)(Pe,{state:w,effective:D.effective,stale:s!==null&&(T.isPlaceholderData||!E?.ok),writable:N,filterRef:a,onChange:j})]}),(0,G.jsx)(he,{dialog:g.shown,open:g.open,companion:e,state:w,onApply:j,onClose:()=>v(e=>({...e,open:!1})),finalFocus:()=>y.current?.isConnected?y.current:i.current})]})}var Ee=p(g,`py-1.5 hover:bg-transparent`);function De({statuses:e}){return e.length===0?null:(0,G.jsx)(`span`,{className:`flex flex-none flex-wrap items-center gap-x-3 gap-y-1`,children:e.map(({name:e,set:t})=>(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-2 font-mono text-xs`,children:[e,(0,G.jsx)(v,{marker:t?`done`:`warn`,children:t?`set`:`missing`})]},e))})}function Oe({writable:e,dirty:t,saved:n,pending:r,blocked:i,error:a,onSave:o,onDiscard:s}){return e?(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,G.jsx)(`p`,{className:`m-0 mr-auto text-sm text-muted`,role:`status`,children:t?(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-warn`,children:[(0,G.jsx)(`span`,{className:`size-[7px] rounded-full bg-current`,"aria-hidden":`true`}),`Unsaved changes`]}):n?`Saved. The changes apply at the next sync or launch.`:`Changes are written to framework.yaml when you save.`}),(0,G.jsx)(S,{variant:`ghost`,size:`sm`,disabled:!t||r,onClick:s,children:`Discard`}),(0,G.jsx)(S,{variant:`primary`,size:`sm`,disabled:!t||r||i,onClick:o,children:r?`Saving…`:`Save`}),a?(0,G.jsx)(`p`,{className:`m-0 basis-full text-sm text-bad`,role:`alert`,children:a}):null]}):(0,G.jsxs)(`p`,{className:`m-0 text-sm text-muted`,"data-mcp-read-only":``,children:[`Studio is read-only. Start it with `,(0,G.jsx)(`code`,{className:`font-mono`,children:`--writable`}),` to change MCP servers.`]})}function ke({current:e,pending:t,onLoad:n,onOverwrite:r}){let i=Object.keys(e.catalog?.servers??{}),a=Object.keys(e.catalog?.groups??{}),o=(0,P.useRef)(null);return(0,P.useEffect)(()=>{t||o.current?.focus()},[t]),(0,G.jsxs)(`section`,{className:`grid gap-2 rounded-card border border-[color-mix(in_srgb,var(--warn)_40%,var(--border))] bg-warn-soft px-4 py-3 text-sm`,role:`alert`,"aria-label":`Save conflict`,"data-mcp-conflict":``,children:[(0,G.jsx)(`h2`,{className:`m-0 text-base font-semibold text-warn`,children:`framework.yaml changed after this view loaded`}),(0,G.jsx)(`p`,{className:`m-0`,children:`Nothing was saved. Your edits are still in the view below.`}),(0,G.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-3 gap-y-1`,children:[(0,G.jsx)(Q,{label:`Servers in the file`,names:i}),(0,G.jsx)(Q,{label:`Groups in the file`,names:a}),(0,G.jsx)(Q,{label:`Base servers in the file`,names:e.effective.base})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,G.jsx)(S,{ref:o,size:`sm`,disabled:t,onClick:n,children:`Discard my edits and load the file`}),(0,G.jsx)(S,{size:`sm`,variant:`danger`,disabled:t,onClick:r,children:`Overwrite the file with my edits`})]})]})}function Q({label:e,names:t}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{className:`text-muted`,children:e}),(0,G.jsx)(`dd`,{className:`m-0 min-w-0 font-mono text-xs break-words`,children:t.length>0?t.join(`, `):`none`})]})}var Ae=`border-accent bg-accent-soft font-semibold text-text`,je=`border-transparent text-muted`,Me={enabled:{word:`Enabled`,look:Ae,icon:`check`},enable:{word:`Enable`,look:Ae,icon:`check`},disable:{word:`Disable`,look:`border-rule bg-surface font-semibold text-text`,icon:`close`},off:{word:`Off`,look:je},inherit:{word:`Inherit`,look:je}},Ne=`sticky top-0 z-10 border-b border-rule bg-surface px-3 py-2 text-left text-xs font-semibold whitespace-nowrap`,$=`sticky left-0 border-t border-rule-soft bg-page px-4 py-1.5 text-left font-normal`;function Pe({state:e,effective:t,stale:n,writable:r,filterRef:i,onChange:a}){let[o,s]=(0,P.useState)(``),c=o.trim().toLowerCase(),l=[`servers`,`groups`].flatMap(t=>Object.keys(e.catalog?.[t]??{}).filter(e=>e.toLowerCase().includes(c)).map(e=>({kind:t,name:e}))),u=[null,...Object.keys(e.audiences)],d=(t,n,i)=>{let o=R(e,i,t,n),{word:s,look:c,icon:l}=Me[o];return(0,G.jsx)(`td`,{className:`border-t border-rule-soft px-3 py-1`,children:(0,G.jsxs)(`button`,{type:`button`,className:p(`inline-flex h-7 min-w-24 items-center gap-1.5 rounded-control border px-2 text-xs transition-colors enabled:hover:border-accent disabled:cursor-not-allowed`,c),disabled:!r,"aria-label":`${n} for ${i??`base`}: ${s}`,"data-mcp-cell":`${i??`base`}/${n}`,"data-state":o,onClick:()=>a(B(e,i,t,n)),children:[l?(0,G.jsx)(b,{name:l,className:`size-3.5`}):null,s]})},i??``)};return(0,G.jsxs)(x,{title:`Selection`,hint:(0,G.jsx)(T,{ref:i,className:`h-7 w-48`,value:o,placeholder:`Filter by name`,"aria-label":`Filter servers and groups by name`,onChange:e=>s(e.currentTarget.value)}),children:[(0,G.jsx)(`div`,{className:`max-h-[60vh] overflow-auto`,children:(0,G.jsxs)(`table`,{className:`w-full border-separate border-spacing-0 text-sm`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{scope:`col`,className:p(Ne,`left-0 z-20 px-4`),children:`Server or group`}),u.map(e=>(0,G.jsx)(`th`,{scope:`col`,className:Ne,children:e===null?`Base`:(0,G.jsx)(`span`,{className:`font-mono`,children:e})},e??``))]})}),(0,G.jsxs)(`tbody`,{children:[l.map(({kind:e,name:t})=>(0,G.jsxs)(`tr`,{children:[(0,G.jsxs)(`th`,{scope:`row`,className:$,children:[(0,G.jsx)(`span`,{className:`font-mono text-sm`,children:t}),e===`groups`?(0,G.jsx)(`span`,{className:`ml-2 text-xs text-muted`,children:`group`}):null]}),u.map(n=>d(e,t,n))]},`${e}/${t}`)),l.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:u.length+1,className:`px-4 py-3 text-sm text-muted`,children:`No server or group matches the filter.`})}):null]}),(0,G.jsx)(`tfoot`,{children:(0,G.jsxs)(`tr`,{"aria-busy":n,children:[(0,G.jsx)(`th`,{scope:`row`,className:p($,`border-rule align-top font-semibold`),children:`Effective servers`}),u.map(e=>{let r=e===null?t.base:t.audiences[e];return(0,G.jsx)(`td`,{className:p(`border-t border-rule px-3 py-2 align-top font-mono text-xs`,n&&`opacity-60`),children:r&&r.length>0?(0,G.jsx)(`ul`,{className:`m-0 grid list-none gap-0.5 p-0`,children:r.map(e=>(0,G.jsx)(`li`,{children:e},e))}):(0,G.jsx)(`span`,{className:`font-sans text-muted`,children:`none`})},e??``)})]})})]})}),(0,G.jsxs)(`p`,{className:`m-0 border-t border-rule-soft px-4 py-2 text-xs text-muted`,children:[`Base applies to every session. An audience column applies on top of it to sessions started with `,(0,G.jsx)(`code`,{className:`font-mono`,children:`MATE_AUDIENCE`}),` set to that audience. A sync writes the base servers plus the active audience's changes.`]})]})}var Fe=function(){let e=s.useSearch(),{data:n}=t(f({companion:e.companion,studioMode:e.studioMode}));return!e.companion||!n.selected?null:(0,G.jsx)(Ce,{companion:e.companion,writable:n.writable},e.companion)};export{Fe as component};
@@ -0,0 +1 @@
1
+ export{a as Mermaid}from"./chat-DbaMXb8H.js";
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{r,t as i}from"./button-upSzkd-q.js";import{A as a,D as o,O as s,Y as c,k as l}from"./index-D5oGyvG8.js";import{n as u}from"./fields-DNZ4a89M.js";var d=e(t(),1),f=n();function p({items:e,current:t,onSelect:n,pass:p,wide:m,title:h,children:g}){let _=(0,d.useRef)(null),v=t!==null,y=t===null?-1:e.indexOf(t),b=y>0?e[y-1]:void 0,x=y>=0&&y<e.length-1?e[y+1]:void 0;(0,d.useEffect)(()=>{let e=e=>{let t=e.target;t?.closest&&!t.closest(`[data-slot=sheet-content]`)&&(_.current=t)};return document.addEventListener(`focusin`,e),()=>document.removeEventListener(`focusin`,e)},[]);let S=(0,d.useEffectEvent)(e=>{if(e.metaKey||e.ctrlKey||e.altKey||c(e.target))return;let t=e.key===`ArrowRight`?x:e.key===`ArrowLeft`?b:void 0;t!==void 0&&(e.preventDefault(),n(t))});return(0,d.useEffect)(()=>{if(!v)return;let e=e=>S(e);return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[v]),(0,f.jsx)(o,{open:v,onOpenChange:e=>{e||n(null)},children:(0,f.jsxs)(l,{wide:m,"aria-label":h,finalFocus:()=>!_.current?.isConnected||_.current,initialFocus:()=>document.getElementById(`side-panel-close`),children:[(0,f.jsx)(a,{className:`sr-only`,children:h}),(0,f.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-rule py-2.5 pr-3 pl-5`,children:[(0,f.jsxs)(`span`,{className:`mr-auto font-mono text-xs text-muted`,"aria-live":`polite`,children:[y>=0?`${y+1} of ${e.length}`:null,p?` · ${p}`:null]}),(0,f.jsx)(i,{size:`icon-sm`,variant:`ghost`,"aria-label":`Previous`,disabled:b===void 0,onClick:()=>b!==void 0&&n(b),children:(0,f.jsx)(r,{name:`left`})}),(0,f.jsx)(i,{size:`icon-sm`,variant:`ghost`,"aria-label":`Next`,disabled:x===void 0,onClick:()=>x!==void 0&&n(x),children:(0,f.jsx)(r,{name:`right`})}),(0,f.jsx)(s,{id:`side-panel-close`,render:(0,f.jsx)(i,{size:`icon-sm`,variant:`ghost`,"aria-label":`Close`}),children:(0,f.jsx)(r,{name:`close`})})]}),(0,f.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-auto`,children:g}),(0,f.jsxs)(`div`,{className:`flex gap-3.5 border-t border-rule px-5 py-2.5 text-2xs text-muted max-sm:hidden`,children:[(0,f.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,f.jsx)(u,{children:`←`}),(0,f.jsx)(u,{children:`→`}),` previous, next`]}),(0,f.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,f.jsx)(u,{children:`esc`}),` close`]})]})]})})}function m({kicker:e,title:t,mono:n=!1,children:r}){return(0,f.jsxs)(`div`,{className:`grid gap-1.5 border-b border-rule px-5 pt-4 pb-3.5`,children:[e?(0,f.jsx)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:e}):null,(0,f.jsx)(`h2`,{className:n?`m-0 font-mono text-md font-semibold break-words`:`m-0 text-lg font-semibold`,children:t}),r]})}function h({title:e,aside:t,children:n}){return(0,f.jsxs)(`section`,{className:`grid gap-2.5 border-b border-rule-soft px-5 py-4`,"aria-label":e,children:[(0,f.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 text-sm font-semibold`,children:[e,t?(0,f.jsx)(`span`,{className:`ml-auto font-mono text-2xs font-normal text-muted`,children:t}):null]}),n]})}export{h as n,p as r,m as t};
@@ -0,0 +1 @@
1
+ import{It as e,t,xt as n}from"./index-D5oGyvG8.js";import"./studio-X7bnFrRe.js";import{O as r,d as i}from"./studio-queries-CKtAnIKP.js";import{a,n as o,t as s}from"./jsx-runtime-MZURdZre.js";import{t as c}from"./cn-BCnYnarL.js";var l=a(o(),1),u=s(),d=e=>import(e);async function f(e,t,n,r=d){let i=(await r(t)).mount;if(typeof i!=`function`)throw Error(`the view module has no mount export`);let a=i(e,n);return typeof a==`function`?a:()=>{}}function p({moduleUrl:e,context:t,layout:r=`page`,load:i}){let a=(0,l.useRef)(null),[o,s]=(0,l.useState)(null),{companion:d,apiBase:p,writable:m}=t;return(0,l.useEffect)(()=>{let t=a.current;if(!t)return;let r=null,o=!1;s(null);let c=n()??void 0;return f(t,e,{companion:d,apiBase:p,writable:m,connection:c},i).then(e=>{o?e():r=e},e=>{o||s(e instanceof Error?e.message:String(e))}),()=>{o=!0,r?.(),t.replaceChildren()}},[e,d,p,m,i]),(0,u.jsxs)(`section`,{className:c(`plugin-view min-h-0 flex-1`,r===`workspace`?void 0:`mx-8 max-sm:mx-4`),"data-layout":r,children:[o?(0,u.jsxs)(`p`,{className:`m-0 rounded-card border border-dashed border-rule px-6 py-7 text-muted`,children:[`The view could not load: `,o]}):null,(0,u.jsx)(`div`,{ref:a,"data-plugin-view":e})]})}var m=function(){let{service:n,view:a}=t.useParams(),o=t.useSearch(),{data:s}=e(i(o)),c=s.pluginViews.find(e=>e.service===n&&e.view===a);return c?(0,u.jsx)(p,{moduleUrl:c.moduleUrl,layout:c.layout,context:{companion:s.selected?.digest??null,apiBase:`${r}${n}`,writable:s.writable}}):(0,u.jsx)(`section`,{className:`mx-8 max-sm:mx-4`,children:(0,u.jsx)(`p`,{className:`empty m-0 rounded-card border border-dashed border-rule px-6 py-7 text-muted`,children:`No running service offers this view.`})})};export{m as component};
@@ -1,4 +1,4 @@
1
- import{b as e,x as t}from"./studio-ndtFcS2Y.js";var n=`mate-studio-theme`,r=`mate-studio-companion`,i=`mate-studio-vault-tree`,a=`mate-studio-rail`,o=`(function () {
1
+ import{C as e,w as t}from"./studio-X7bnFrRe.js";var n=`mate-studio-theme`,r=`mate-studio-companion`,i=`mate-studio-vault-tree`,a=`mate-studio-rail`,o=`(function () {
2
2
  try {
3
3
  var chosen = localStorage.getItem(${JSON.stringify(n)});
4
4
  if (chosen === "dark" || chosen === "light") {
@@ -1 +1 @@
1
- import{u as e}from"./studio-queries-CkUSByy7.js";function t(e,t){return e.query({...t,staleTime:`static`})}async function n(n,r){return r.companion?(await t(n,e({companion:r.companion,studioMode:r.studioMode}))).selected?.digest??null:null}async function r(e,n,r=!1){return r?t(e,n):(t(e,n).catch(()=>{}),null)}export{r as n,n as r,t};
1
+ import{d as e}from"./studio-queries-CKtAnIKP.js";function t(e,t){return e.query({...t,staleTime:`static`})}async function n(n,r){return r.companion?(await t(n,e({companion:r.companion,studioMode:r.studioMode}))).selected?.digest??null:null}async function r(e,n,r=!1){return r?t(e,n):(t(e,n).catch(()=>{}),null)}export{r as n,n as r,t};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./jsx-runtime-MZURdZre.js";var n=t((t=>{var n=e();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},t.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},t.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},t.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},t.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)}},t.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},t.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)}},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},t.useFormStatus=function(){return c.H.useHostTransitionStatus()},t.version=`19.2.7`})),r=t(((e,t)=>{function r(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),t.exports=n()}));export{r as t};
@@ -1 +1 @@
1
- import{a as e,n as t}from"./jsx-runtime-MZURdZre.js";var n=e(t(),1),r=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},i=(e=>e?r(e):r),a=e=>e;function o(e,t=a){let r=n.useSyncExternalStore(e.subscribe,n.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return n.useDebugValue(r),r}var s=e=>{let t=i(e),n=e=>o(t,e);return Object.assign(n,t),n},c=(e=>e?s(e):s);export{c as t};
1
+ import{a as e,n as t}from"./jsx-runtime-MZURdZre.js";var n=e(t(),1),r=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},i=(e=>e?r(e):r),a=e=>e;function o(e,t=a){let r=n.useSyncExternalStore(e.subscribe,n.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return n.useDebugValue(r),r}var s=e=>{let t=i(e),n=e=>o(t,e);return Object.assign(n,t),n},c=(e=>e?s(e):s);export{o as n,i as r,c as t};
@@ -0,0 +1 @@
1
+ import{Lt as e,_t as t,bt as n,u as r}from"./index-D5oGyvG8.js";import{a as i,t as a}from"./useSelector-AYcH7lB0.js";import{D as o,pt as s,u as c}from"./studio-queries-CKtAnIKP.js";import{a as l,n as u,t as d}from"./jsx-runtime-MZURdZre.js";import{ct as f,it as p,nt as m,r as h,rt as g}from"./button-upSzkd-q.js";import{t as _}from"./cn-BCnYnarL.js";import{r as v,t as y}from"./panel-CDQ6Lryw.js";import"./studio-X7bnFrRe.js";function b(e){let t=i();return a(t.stores.location,s(e,t))}var x=l(u(),1),S=e=>String(e).padStart(2,`0`);function C(e){let t=new Date(e);return`${t.getFullYear()}-${S(t.getMonth()+1)}-${S(t.getDate())} ${S(t.getHours())}:${S(t.getMinutes())}`}function w(e,t){let n=t===`system`?``:`?scheme=${t}`;return`${o}${e}${n}`}var T=d(),E=/(?:^|[#&])report=([0-9a-f]{32})/;function D(e){try{let t=`${location.pathname}${location.search}${e?`#report=${e}`:``}`;history.replaceState(history.state,``,t)}catch{}}function O({report:e,src:t}){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(y,{title:e.title,kicker:(0,T.jsx)(`span`,{children:C(e.createdAt)}),children:(0,T.jsxs)(`a`,{id:`reports-open`,className:`inline-flex items-center gap-1.5 text-sm`,href:t,target:`_blank`,rel:`noopener noreferrer`,children:[(0,T.jsx)(h,{name:`external`,className:`size-3.5`}),` Open in new tab`]})}),(0,T.jsx)(`iframe`,{id:`reports-frame`,className:`min-h-0 w-full flex-1 border-0 bg-page`,title:`Hosted report`,sandbox:`allow-scripts allow-modals`,referrerPolicy:`no-referrer`,src:t},t)]})}function k({companion:r}){let i=e(c(r)),a=t(e=>e.theme),o=n(e=>e.clearReports),s=E.exec(b({select:e=>`#${e.hash}`}))?.[1],[l,u]=(0,x.useState)(void 0);(0,x.useEffect)(o,[o]);let d=i.data??[],h=l===void 0?s??null:l,y=d.find(e=>e.id===h)??null,S=e=>{u(e),D(e)},k=y?w(y.id,a):null;return(0,T.jsxs)(`section`,{className:_(p,`grid content-start gap-3 pb-10`),"data-reports-view":!0,"aria-label":`Hosted reports`,children:[d.length===0?(0,T.jsx)(m,{children:(0,T.jsx)(`span`,{id:`reports-empty`,children:`No hosted reports yet.`})}):(0,T.jsx)(g,{title:`Reports`,count:d.length,hint:`Newest first`,children:(0,T.jsx)(`ul`,{id:`reports-list`,className:`m-0 list-none p-0`,"aria-label":`Reports`,children:d.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,className:_(f,`grid grid-cols-[minmax(0,1fr)_auto]`),"data-report-id":e.id,"aria-current":e.id===y?.id?`true`:void 0,onClick:()=>S(e.id),children:[(0,T.jsx)(`span`,{className:`truncate text-sm`,"data-report-title":!0,children:e.title}),(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted`,"data-report-time":!0,children:C(e.createdAt)})]})},e.id))})}),(0,T.jsx)(v,{items:d.map(e=>e.id),current:y?.id??null,onSelect:S,wide:!0,title:y?`Report ${y.title}`:`Report`,children:y&&k?(0,T.jsx)(O,{report:y,src:k}):null})]})}var A=function(){let{companion:e}=r.useSearch();return e?(0,T.jsx)(k,{companion:e}):null};export{A as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./companion-view-B54_Lj0S.js";import{dt as t,h as n,p as r,ut as i}from"./studio-queries-CKtAnIKP.js";import{a,n as o,t as s}from"./jsx-runtime-MZURdZre.js";import{$ as c,ct as l,et as u,it as d,lt as f,nt as p,ot as m,r as h,rt as g,st as _,t as v,tt as y}from"./button-upSzkd-q.js";import{t as b}from"./cn-BCnYnarL.js";import{n as x,r as S,t as C}from"./panel-CDQ6Lryw.js";import{t as w}from"./warnings-D7YY1HSG.js";import{G as T,H as E,J as ee,K as D,Lt as O,U as te,V as k,W as A,q as j,v as M}from"./index-D5oGyvG8.js";import{t as ne}from"./markdown-view-CJ8JsLb7.js";var N=a(o(),1);function re(e){let t=new Set,n=[];for(let r of e)for(let e of r.specs)t.has(e)||(t.add(e),n.push({capability:e,change:r.name,archivedOn:r.archivedOn}));return n}var P=s(),ie=20,ae=12,F=`openspec/changes/archive`,I=e=>`openspec/specs/${e}/spec.md`,L=b(l,`grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 py-2`);function R({payload:e}){let[t,n]=(0,N.useState)(null),r=e.shipped.slice(0,ie),i=r.find(e=>e.anchor===t)??null;return(0,P.jsxs)(`div`,{className:`analyst-overview`,children:[(0,P.jsx)(w,{warnings:e.warnings}),(0,P.jsx)(`div`,{className:b(d,`@container pb-10`),children:(0,P.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)] items-start gap-3 @max-[760px]:grid-cols-1`,children:[(0,P.jsx)(V,{all:e.shipped.length,shown:r,current:t,onOpen:n}),(0,P.jsx)(U,{shipped:e.shipped})]})}),(0,P.jsx)(S,{items:r.map(e=>e.anchor),current:i?.anchor??null,onSelect:n,title:i?`Shipped change ${i.name}`:`Shipped change`,children:i?(0,P.jsx)(H,{change:i}):null})]})}function z(e){let t=[];for(let n of e){let e=t.at(-1);e?.[0]===n.archivedOn?e[1].push(n):t.push([n.archivedOn,[n]])}return t}function B(e){let t=new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(`en`,{weekday:`long`,timeZone:`UTC`})}function V({all:e,shown:t,current:n,onOpen:r}){return(0,P.jsx)(g,{title:`Recently shipped`,count:e,hint:e>t.length?`newest ${t.length}`:void 0,children:t.length===0?(0,P.jsx)(`p`,{className:`empty m-0 px-4 py-3 text-sm text-muted`,children:`No shipped changes yet.`}):(0,P.jsx)(`ol`,{className:`analyst-days m-0 list-none p-0`,children:z(t).map(([e,t])=>(0,P.jsxs)(`li`,{className:`border-t border-rule first:border-t-0`,children:[(0,P.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 bg-[color-mix(in_srgb,var(--surface)_45%,transparent)] px-4 pt-2.5 pb-1.5 text-xs font-semibold text-muted`,children:[(0,P.jsx)(`time`,{dateTime:e,className:`font-mono text-text`,children:e}),B(e),(0,P.jsx)(y,{value:t.length})]}),(0,P.jsx)(`ol`,{className:`analyst-list m-0 list-none p-0`,children:t.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,className:b(l,`grid gap-0.5 py-2`),"aria-current":n===e.anchor?`true`:void 0,onClick:()=>r(e.anchor),children:[(0,P.jsx)(`span`,{className:`analyst-row-title truncate font-mono text-sm`,children:e.name}),(0,P.jsx)(`span`,{className:`truncate text-xs text-muted`,children:e.specs.length===0?`no spec changes`:e.specs.join(`, `)})]})},e.anchor))})]},e))})})}function H({change:e}){let t=`${F}/${e.anchor}`;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(C,{mono:!0,title:e.name,kicker:(0,P.jsxs)(`span`,{children:[`Shipped `,e.archivedOn]})}),(0,P.jsx)(x,{title:`Proposal`,children:e.hasProposal?(0,P.jsxs)(i,{className:`inline-flex items-center gap-2 text-sm`,to:`/vault`,search:e=>({...e,path:`${t}/proposal.md`}),children:[(0,P.jsx)(h,{name:`doc`}),` Read the proposal`]}):(0,P.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`This change has no proposal.`,` `,(0,P.jsx)(i,{to:`/vault`,search:e=>({...e,dir:t}),children:`Open its folder`})]})}),(0,P.jsx)(x,{title:`Specs it changed`,aside:String(e.specs.length),children:e.specs.length===0?(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No spec changed.`}):(0,P.jsx)(`ul`,{className:`m-0 grid list-none gap-1 p-0`,children:e.specs.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(i,{className:`font-mono text-sm`,to:`/vault`,search:t=>({...t,path:I(e)}),children:e})},e))})})]})}function U({shipped:e}){let t=re(e).slice(0,ae);return(0,P.jsx)(g,{title:`Recently changed specs`,hint:(0,P.jsx)(i,{to:`/specs`,search:e=>e,children:`All specs`}),children:t.length===0?(0,P.jsx)(`p`,{className:`empty m-0 px-4 py-3 text-sm text-muted`,children:`No specs changed by shipped changes yet.`}):(0,P.jsx)(`ol`,{className:`analyst-list m-0 list-none p-0`,children:t.map((e,n)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(i,{className:L,to:`/vault`,search:t=>({...t,path:I(e.capability)}),children:[(0,P.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,P.jsx)(`span`,{className:`analyst-row-title truncate font-mono text-sm`,children:e.capability}),(0,P.jsxs)(`span`,{className:`truncate text-xs text-muted`,children:[`by `,e.change]})]}),(0,P.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e.archivedOn===t[n-1]?.archivedOn?null:e.archivedOn})]})},e.capability))})})}var W={accent:`before:bg-accent`,warn:`before:bg-warn`,why:`before:bg-why`,bad:`before:bg-bad`},G={accent:`bg-accent`,warn:`bg-warn`,why:`bg-why`,bad:`bg-bad`},K={accent:`text-text`,warn:`text-warn`,why:`text-why`,bad:`text-bad`};function q({steps:e,current:t,tone:n}){let r=`Step ${t+1} of ${e.length} · ${e[t]}`;return t<0?r=`Saved for later`:t>=e.length&&(r=`Delivered`),(0,P.jsxs)(`div`,{className:`grid gap-2`,role:`group`,"aria-label":`Delivery Path`,children:[(0,P.jsx)(`p`,{className:b(`m-0 text-xs font-semibold`,t>=0?K[n]:`text-muted`),children:r}),(0,P.jsx)(`ol`,{className:`m-0 grid list-none gap-1 p-0`,style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},children:e.map((e,r)=>(0,P.jsx)(`li`,{"aria-current":r===t?`step`:void 0,className:b(`h-1 rounded-full bg-rule`,r<t&&`bg-[color-mix(in_srgb,var(--accent)_55%,var(--border))]`,r===t&&G[n]),children:(0,P.jsx)(`span`,{className:`sr-only`,children:e})},e))})]})}function J({steps:e,current:t,tone:n=`accent`,compact:r=!1}){return r?(0,P.jsx)(q,{steps:e,current:t,tone:n}):(0,P.jsx)(`ol`,{className:`m-0 grid list-none gap-1 p-0`,style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},"aria-label":`Delivery Path`,children:e.map((e,r)=>(0,P.jsx)(`li`,{"aria-current":r===t?`step`:void 0,className:b(`grid gap-1.5 text-2xs text-muted before:h-1 before:rounded-full before:bg-rule before:content-['']`,r<t&&`before:bg-[color-mix(in_srgb,var(--accent)_55%,var(--border))]`,r===t&&`font-semibold text-text`,r===t&&W[n]),children:e},e))})}var oe=`openspec/changes`,Y=e=>`${oe}/${e.name}`,X=`flex w-full min-w-0 items-center gap-2.5 rounded-control border-0 bg-transparent px-2 py-1 text-left text-sm text-text hover:bg-surface-soft disabled:cursor-default disabled:hover:bg-transparent`;function se({done:e}){return(0,P.jsx)(`span`,{className:b(`grid size-3.5 flex-none place-items-center rounded-[4px] border`,e?`border-accent bg-accent text-on-accent`:`border-rule bg-page`),"aria-hidden":`true`,children:e?(0,P.jsx)(h,{name:`check`,className:`size-2.5 [stroke-width:2.4]`}):null})}function ce({companion:e,dir:t,onRead:n}){let a=O(r(e,`${t}/specs`));if(a.isPending)return(0,P.jsx)(`p`,{className:`m-0 pl-8 text-xs text-muted`,children:`Listing specs…`});let o=(a.data?.entries??[]).filter(e=>e.kind===`directory`);return a.isError||o.length===0?(0,P.jsx)(`p`,{className:`m-0 pl-8 text-xs text-muted`,children:(0,P.jsx)(i,{to:`/vault`,search:e=>({...e,dir:`${t}/specs`}),children:`Open the specs folder`})}):(0,P.jsx)(`ul`,{className:`m-0 grid list-none gap-0.5 p-0 pl-6`,children:o.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,className:X,"data-artifact-file":`${e.path}/spec.md`,onClick:()=>n(`${e.path}/spec.md`),children:[(0,P.jsx)(h,{name:`doc`,className:`flex-none text-muted`}),(0,P.jsx)(`span`,{className:`truncate font-mono text-xs`,children:e.name})]})},e.path))})}function le(e){return e.declared?e.folder?`folder`:`read`:e.done?e.folder?`per capability`:`read`:`not yet`}function ue({change:e,companion:t,onRead:n}){if(e.artifacts.length===0)return(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No artifacts yet.`});let r=Y(e);return(0,P.jsx)(`ul`,{className:`m-0 -mx-2 grid list-none gap-0.5 p-0`,children:e.artifacts.map(e=>{let i=e.path!==void 0,a=e.status===`done`,o=(a||i)&&t!==void 0,s=e.path===void 0?e.id===`specs`:e.path.endsWith(`/`);return(0,P.jsxs)(`li`,{children:[(0,P.jsxs)(`button`,{type:`button`,className:X,disabled:!o||s,"data-artifact":e.id,onClick:()=>n(e.path??`${r}/${e.id}.md`),children:[i?null:(0,P.jsx)(se,{done:a}),(0,P.jsx)(`span`,{className:a||i?`text-text`:`text-muted`,children:e.id}),(0,P.jsx)(`span`,{className:`ml-auto text-xs text-muted`,children:le({declared:i,done:a,folder:s})}),o&&!s?(0,P.jsx)(h,{name:`right`,className:`text-muted`}):null]}),o&&s&&!i?(0,P.jsx)(ce,{companion:t,dir:r,onRead:n}):null]},e.id)})})}function de({companion:e,path:t}){let r=O(n(e,{path:t})),i=r.data?.open?.markdown;return i?(0,P.jsx)(`div`,{className:`prose-panel`,children:(0,P.jsx)(ne,{nodes:i})}):(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:r.isPending?`Loading…`:`The file could not be read.`})}function fe({companion:e,path:t,change:n,onBack:r}){let a=t.slice(Y(n).length+1);return(0,P.jsxs)(`section`,{className:`grid content-start gap-3 px-5 py-4`,"aria-label":`Artifact ${a}`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(v,{size:`sm`,variant:`ghost`,className:`-ml-2`,onClick:r,children:[(0,P.jsx)(h,{name:`left`}),` Artifacts`]}),(0,P.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs text-muted`,children:a}),(0,P.jsxs)(i,{className:`ml-auto inline-flex flex-none items-center gap-1.5 text-xs`,to:`/vault`,search:e=>({...e,path:t}),children:[(0,P.jsx)(h,{name:`external`,className:`size-3.5`}),` Open in Vault`]})]}),(0,P.jsx)(de,{companion:e,path:t})]})}var Z=`Awaiting publication`,pe=[],me={"needs-you":`Review or fix before the build goes on`,building:`Some tasks are done; others remain`,ready:`Every task is done`};function Q(e){if(e.valid===!1)return{marker:`issue`,word:`Invalid`};let t=A(e);if(e.planned===!1){let n=e.position?.stage;return n?t===`ready`?{marker:`done`,word:n.label}:{marker:n.kind===`review`?`review`:`build`,word:n.label}:{marker:`idle`,word:e.dropped?`Dropped`:`Not placed`}}return t===`needs-you`?(e.totalTasks??0)===0?{marker:`warn`,word:`No tasks`}:{marker:`review`,word:`Review`}:t===`building`?{marker:`build`,word:E.building}:{marker:`done`,word:`Ready`}}function he({change:e,workflow:t,companion:n,reading:r,onRead:i}){let a=j(e,t),o=T(t),s=D(e),{marker:l,word:d}=Q(e),p=(0,P.jsx)(x,{title:`Artifacts`,aside:e.schemaName,children:(0,P.jsx)(ue,{change:e,companion:n,onRead:i})}),m=A(e)===`needs-you`;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(C,{mono:!0,title:e.name,kicker:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(f,{marker:l,children:d}),(0,P.jsx)(c,{at:e.lastModified,className:`ml-auto`})]}),children:(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:a.situation})}),r&&n?(0,P.jsx)(fe,{companion:n,path:r,change:e,onBack:()=>i(null)}):(0,P.jsxs)(P.Fragment,{children:[m?p:null,(0,P.jsx)(x,{title:`Delivery Path`,aside:a.stage,children:(0,P.jsx)(J,{steps:o.map(e=>e.label),current:o.findIndex(e=>e.id===a.stageId),tone:a.review?`why`:`accent`})}),(0,P.jsxs)(x,{title:`Next step`,children:[(0,P.jsxs)(`p`,{className:`m-0 text-sm`,children:[a.next,`.`]}),(0,P.jsx)(u,{text:a.prompt})]}),e.planned===!1?null:(0,P.jsx)(x,{title:s.unit===`tasks`?`Tasks`:`Plan`,aside:`${s.done}/${s.total}`,children:(0,P.jsx)(_,{...s})}),m?null:p]})]})}function ge({change:e,workflow:t,current:n,onOpen:r}){let{marker:i,word:a}=Q(e),o=j(e,t);return(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,className:b(l,`grid grid-cols-[minmax(0,1fr)_max-content_150px_72px] @max-[640px]:grid-cols-[minmax(0,1fr)_auto]`),"aria-current":n?`true`:void 0,"data-change":e.name,onClick:r,children:[(0,P.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.name}),(0,P.jsx)(`span`,{className:b(`truncate text-xs`,e.valid===!1?`text-bad`:`text-muted`),children:o.situation})]}),(0,P.jsx)(f,{marker:i,children:a}),(0,P.jsx)(`span`,{className:`@max-[640px]:hidden`,children:e.planned===!1?null:(0,P.jsx)(_,{...D(e)})}),(0,P.jsx)(c,{at:e.lastModified,className:`text-right @max-[640px]:hidden`})]})})}function $({change:e}){return(0,P.jsxs)(`li`,{className:b(l,`grid grid-cols-[minmax(0,1fr)_max-content] hover:bg-transparent`),"data-submitted":e.name,children:[(0,P.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.name}),(0,P.jsxs)(`span`,{className:`truncate text-xs text-muted`,children:[(0,P.jsx)(`span`,{className:e.mine?`font-semibold text-accent`:void 0,children:e.mine?`Yours`:e.author??`Someone else`}),` · ${e.group||`no delivery branch`}`]})]}),e.blocked?(0,P.jsx)(f,{marker:`issue`,children:`Blocked`}):(0,P.jsx)(f,{marker:`idle`,children:`Submitted`})]})}function _e({submitted:e}){return e.length===0?null:(0,P.jsx)(g,{title:Z,count:e.length,hint:`Publish with /mate-publish-artifact once merged`,children:(0,P.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.map(e=>(0,P.jsx)($,{change:e},e.name))})})}function ve(e,t){return[{value:`all`,label:`All`,count:k.reduce((t,n)=>t+e[n].length,0)+t},...k.map(t=>({value:t,label:E[t],count:e[t].length,tone:t===`needs-you`?`warn`:void 0})),...t>0?[{value:`submitted`,label:Z,count:t}]:[]]}function ye({changes:e,submitted:n=pe,selected:r,companion:i,workflow:a}){let o=t(),[s,c]=(0,N.useState)(`all`),[l,u]=(0,N.useState)(!1),[f,h]=(0,N.useState)(null),_=te(e,n),x=ee(_),C=k.filter(e=>s===`all`||s===e),w=C.flatMap(e=>x[e]),T=l?x[`needs-you`]:w,D=_.find(e=>e.name===r)??null,O=f&&f.change===D?.name?f.path:null,A=e=>{e===null&&u(!1),o({to:`.`,search:t=>({...t,change:e??void 0}),replace:!0})};return _.length===0&&n.length===0?(0,P.jsx)(`section`,{className:b(d,`pb-10`),"aria-label":`Changes`,children:(0,P.jsx)(p,{children:`No change is in flight in this companion.`})}):(0,P.jsxs)(`section`,{className:b(d,`@container grid content-start gap-3 pb-10`),"aria-label":`Changes`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(m,{label:`Show changes`,value:s,onChange:c,options:ve(x,n.length)}),x[`needs-you`].length>0?(0,P.jsxs)(v,{variant:`primary`,size:`sm`,className:`ml-auto`,onClick:()=>{u(!0),A(x[`needs-you`][0].name)},children:[`Start review pass`,(0,P.jsx)(y,{value:x[`needs-you`].length})]}):null]}),C.map(e=>x[e].length===0?null:(0,P.jsx)(g,{title:E[e],count:x[e].length,hint:me[e],tone:e===`needs-you`?`warn`:void 0,children:(0,P.jsx)(`ul`,{className:`m-0 list-none p-0`,children:x[e].map(e=>(0,P.jsx)(ge,{change:e,workflow:a,current:e.name===r,onOpen:()=>{u(!1),A(e.name)}},e.name))})},e)),s===`all`||s===`submitted`?(0,P.jsx)(_e,{submitted:n}):null,(0,P.jsx)(S,{items:T.map(e=>e.name),current:D?.name??null,onSelect:A,pass:l?`Needs you`:void 0,wide:O!==null,title:D?`Change ${D.name}`:`Change`,children:D?(0,P.jsx)(he,{change:D,workflow:a,companion:i,reading:O,onRead:e=>h(e?{change:D.name,path:e}:null)}):null})]})}function be({payload:e,selected:t,companion:n}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w,{warnings:e.warnings}),(0,P.jsx)(ye,{changes:e.changes,submitted:e.submitted,selected:t,companion:n,workflow:e.workflow??void 0})]})}function xe(){let t=M.useSearch();return(0,P.jsx)(e,{view:`dashboard`,search:t,children:e=>e.studioMode===`analysis`?(0,P.jsx)(R,{payload:{shipped:e.shipped??[],warnings:e.warnings}}):(0,P.jsx)(be,{payload:{changes:e.changes??[],submitted:e.submitted,warnings:e.warnings,workflow:e.workflow},selected:t.change,companion:t.companion})})}export{xe as component};
@@ -0,0 +1 @@
1
+ import{A as e,C as t,E as n,b as r,j as i,k as a,w as o,x as s,y as c}from"./studio-X7bnFrRe.js";var l=[7,30,90];function u(e){return l.find(t=>String(t)===String(e))}var d=[`repeats`,`recent`],f=(e,t)=>e.find(e=>e===t);function p(i){let o={};typeof i.companion==`string`&&t.test(i.companion)&&(o.companion=i.companion);let l=new URLSearchParams;i.studioMode!==void 0&&l.set(a,String(i.studioMode)),typeof i.role==`string`&&l.set(n,i.role);let p=e(l);p&&(o.studioMode=p);let m=Number(i.usageDays);/^\d+$/.test(String(i.usageDays))&&Number.isInteger(m)&&m>=1&&m<=365&&(o.usageDays=m),typeof i.usageRepository==`string`&&/^[a-zA-Z0-9_-]{1,64}$/.test(i.usageRepository)&&(o.usageRepository=i.usageRepository);let h=u(i.frictionDays);h&&(o.frictionDays=h);let g=f(r,i.frictionState);g&&(o.frictionState=g);let _=f(s,i.frictionType);_&&(o.frictionType=_);let v=f(c,i.frictionKind);v&&(o.frictionKind=v);let y=f(d,i.frictionSort);return y&&(o.frictionSort=y),o}function m(e){let t=new Map;for(let[n,r]of new URLSearchParams(e))t.has(n)||t.set(n,h(r));return Object.fromEntries(t)}function h(e){if(!e.startsWith(`"`))return e;try{let t=JSON.parse(e);return typeof t==`string`?t:e}catch{return e}}function g(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e)){if(r==null)continue;let e=typeof r==`object`||typeof r==`string`&&r.startsWith(`"`);t.set(n,e?JSON.stringify(r):String(r))}let n=t.toString();return n?`?${n}`:``}function _(e){return typeof e==`string`&&e.trim()||void 0}function v(e){let t=_(e.q),n=_(e.repo),r=_(e.area);return{...t?{q:t}:{},...n?{repo:n}:{},...r?{area:r}:{}}}function y(e,t,r,s,c={}){let l=new URLSearchParams(t),u=r===void 0||i(s,c).includes(r);if(l.get(`studioMode`)===s&&!l.has(`role`)&&u)return null;if(!u){let e=new URLSearchParams,t=l.get(o);return t!==null&&e.set(o,t),e.set(a,s),`/?${e}`}return l.delete(n),l.set(a,s),`${e}?${l}`}export{v as a,g as i,f as n,p as o,m as r,l as s,y as t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{t as r}from"./cn-BCnYnarL.js";import{Dn as i,Dt as a,Fn as o,Fr as s,G as c,H as l,Hn as u,In as d,Ir as f,Kn as p,L as m,Ln as h,M as g,Mr as _,Nr as v,Or as y,Qt as b,S as x,T as S,V as C,W as w,Xt as T,Y as E,Yn as D,a as O,ar as k,cn as A,cr as j,dn as M,f as N,ht as P,ir as F,jn as I,jr as L,kn as R,kr as z,kt as B,l as ee,lr as V,mt as te,nr as H,or as ne,pt as re,q as ie,qt as ae,r as oe,sr as U,tn as se,tr as W,un as ce,vn as G,vr as K,w as le,x as ue,zr as de}from"./button-upSzkd-q.js";import{_ as q,c as fe,d as pe,f as me,h as he,l as ge,o as _e,s as J,u as ve,v as ye,y as be}from"./fields-DNZ4a89M.js";import{r as xe,t as Se}from"./useOpenInteractionType-CtaZCaFT.js";import{_ as Ce,a as we,c as Te,d as Ee,f as De,h as Oe,l as ke,m as Ae,o as je,p as Me,r as Ne,s as Pe,t as Fe,u as Ie,v as Le,y as Re}from"./useAnchoredPopupScrollLock-BspHR7Wt.js";import{Ct as ze,Et as Be,Tt as Ve,wt as He}from"./index-D5oGyvG8.js";var Y=e(t(),1);function Ue(e,t){let{listRef:n,elementsRef:r,activeIndex:o,onMatch:s,disabledIndices:c,onTyping:l,enabled:u=!0,resetMs:d=750,selectedIndex:f=null}=t,p=V(l),m=e.useState(`open`),h=E(),g=Y.useRef(``),_=Y.useRef(f??o??-1),v=Y.useRef(null),y=V(e=>{function t(e){return r?.current[e]}function i(e){let n=t(e);return n&&!a(n)||n?.matches(`:disabled`)?!1:c==null||!B(L,e,c)}function l(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,a=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(a)&&i(n))return n}return-1}let u=n.current;if(g.current.length>0&&e.key===` `&&(b(e),p?.(!0)),g.current.length>0&&g.current[0]!==` `&&l(u,g.current)===-1&&e.key!==` `&&p?.(!1),u==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;m&&e.key!==` `&&(b(e),p?.(!0));let y=g.current===``;y&&(_.current=f??o??-1),u.every((e,t)=>e&&i(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&g.current===e.key&&(g.current=``,_.current=v.current),g.current+=e.key,h.start(d,()=>{g.current=``,_.current=v.current,p?.(!1)});let x=((y?f??o??-1:_.current)??0)+1,S=l(u,g.current,x);S===-1?e.key!==` `&&(g.current=``,p?.(!1)):(s?.(S,e),v.current=S)}),x=V(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),a=e.select(`floatingElement`);i(r,n)||i(a,n)||(h.clear(),g.current=``,_.current=v.current,p?.(!1))});j(()=>{(m||f===null)&&(h.clear(),v.current=null,g.current!==``&&(g.current=``,p?.(!1)))},[m,f,h,p]);let S=Y.useMemo(()=>({onKeyDown:y,onBlur:x}),[y,x]);return Y.useMemo(()=>u?{reference:S,floating:S}:{},[u,S])}function We(e){let[t,n]=Y.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var X=n(),Ge=5;function Z(e,t){let n=Ke(t);return e.clientX>=n.left-Ge&&e.clientX<=n.right+Ge&&e.clientY>=n.top-Ge&&e.clientY<=n.bottom+Ge}function Ke(e){let t=e.getBoundingClientRect(),n=K(e);if(R)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function qe(e,t){return e??t}var Je=Y.createContext(void 0),Ye=Y.createContext(void 0);function Q(){let e=Y.useContext(Je);if(e===void 0)throw Error(U(60));return e}function Xe(){let e=Y.useContext(Ye);if(e===void 0)throw Error(U(61));return e}var Ze={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Te(t,r)!==``},hasNullItemLabel:(e,t)=>t?Ne(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>ke(t,e,n)):ke(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function Qe(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function $e(e,t){return Math.max(0,e-t)}function et(e,t){if(t<=0)return 0;let n=Qe(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function tt(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:d=!1,onOpenChange:p,name:m,form:h,autoComplete:g,disabled:y=!1,readOnly:b=!1,required:x=!1,modal:w=!0,actionsRef:T,inputRef:E,onOpenChangeComplete:k,items:A,multiple:M=!1,itemToStringLabel:P,itemToStringValue:F,isItemEqualToValue:I=Ie,highlightItemOnHover:R=!0,children:B}=e,{clearErrors:te}=pe(),{setDirty:ne,setTouched:re,setFocused:ie,validityData:ae,setFilled:oe,name:U,disabled:se,validation:W,validationMode:ce}=he(),G=ge({id:t}),K=se||y,le=U??m,[q,_e]=de({controlled:n,default:M?r??L:r,name:`Select`,state:`value`}),[J,ve]=de({controlled:a,default:d,name:`Select`,state:`open`}),ye=Y.useRef([]),be=Y.useRef([]),we=Y.useRef(null),Ee=Y.useRef(null),Oe=Y.useRef(0),ke=Y.useRef(null),Ae=Y.useRef([]),je=Y.useRef(!1),Ne=Y.useRef(null),Fe=Y.useRef(null),ze=Y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Be=Y.useRef(!1),Ve=Y.useRef(q),{openMethod:He,triggerProps:Ge}=Se(J),Z=f(()=>new O({id:G,labelId:void 0,modal:w,multiple:M,disabled:K,readOnly:b,required:x,highlightItemOnHover:R,itemToStringLabel:P,itemToStringValue:F,isItemEqualToValue:I,value:q,open:J,mounted:J,transitionStatus:void 0,items:A,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:_,triggerProps:_,itemRoot:{props:_,multiple:M,disabled:K,readOnly:b,isItemEqualToValue:I},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:v,setOpen:v,handleScrollArrowVisibility:v,onOpenChangeComplete:v,listRef:ye,popupRef:we,scrollHandlerRef:Ee,scrollArrowsMountedCountRef:Oe,valueRef:ke,valuesRef:Ae,labelsRef:be,typingRef:je,selectionRef:ze,firstItemTextRef:Ne,selectedItemTextRef:Fe,alignItemWithTriggerActiveRef:Be,initialValueRef:Ve},Ze)).current,[Ke,qe]=Y.useState(!1),{mounted:Q,transitionStatus:Xe,forceUnmount:Qe}=ue({open:J,ref:we,preventUnmountOnClose:Ke,setPreventUnmountOnClose:qe,onUnmount(){Z.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),k?.(!1)}}),tt=Z.useState(`activeIndex`),nt=Z.useState(`selectedIndex`),rt=Z.useState(`triggerElement`),it=Z.useState(`positionerElement`),at=We(He),ot=He??at,st=Y.useMemo(()=>M?``:Te(q,F),[M,q,F]),ct=Y.useMemo(()=>M&&Array.isArray(q)?q.map(e=>Te(e,F)):Te(q,F),[M,q,F]),lt=c(rt),ut=V(()=>ct);me(lt,G,q,ut,!K,m);let dt=M?Array.isArray(q)&&q.length>0:q!=null&&st!==``;j(()=>{oe(dt)},[dt,oe]),j(function(){let e=De(Ae.current,q,I,M);e===null&&(Fe.current=null),J||Z.set(`selectedIndex`,e)},[M,J,q,I,Z]),fe(q,()=>{te(le),ne(Me(q,ae.initialValue,I)),W.change(q)});let $=V((e,t)=>{let n=t,r=N(n);p?.(e,n),t.isCanceled||(e||qe(r()),ve(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(re(!0),ie(!1),ce===`onBlur`&&W.commit(q)))});Y.useImperativeHandle(T,()=>({unmount:Qe,close:()=>{Z.state.open&&$(!1,H(u))}}),[Qe,$,Z]);let ft=V((e,t)=>{i?.(e,t),t.isCanceled||_e(e)}),pt=V(e=>{let t=$e(e.scrollHeight,e.clientHeight),n=et(e.scrollTop,t),r=n>0,i=n<t;Z.set(`scrollUpArrowVisible`,r),Z.set(`scrollDownArrowVisible`,i)}),mt=Re({open:J,onOpenChange:$,elements:{reference:rt,floating:it}}),ht=xe(mt,{enabled:!K,event:`mousedown`}),gt=S(mt),_t=Le(mt,{enabled:!K,listRef:ye,activeIndex:tt,selectedIndex:nt,disabledIndices:L,onNavigate(e){(e!==null||J)&&Z.set(`activeIndex`,e)},focusItemOnHover:R}),vt=Ue(mt,{enabled:!K&&(J||!b&&!M),listRef:be,activeIndex:tt,selectedIndex:nt,disabledIndices:e=>o(ye.current[e]),onMatch(e){J?Z.set(`activeIndex`,e):ft(Ae.current[e],H(D))},onTyping(e){je.current=e}}),yt=Y.useMemo(()=>z(vt.reference,_t.reference,gt.reference,ht.reference,Ge),[ht.reference,vt.reference,_t.reference,gt.reference,Ge]),bt=Y.useMemo(()=>z(ee,vt.floating,_t.floating,gt.floating),[vt.floating,_t.floating,gt.floating]),xt=_t.item??_,St=Y.useMemo(()=>({props:xt,multiple:M,disabled:K,readOnly:b,isItemEqualToValue:I}),[xt,M,K,b,I]);Z.useContextCallback(`setValue`,ft),Z.useContextCallback(`setOpen`,$),Z.useContextCallback(`handleScrollArrowVisibility`,pt),Z.useContextCallback(`onOpenChangeComplete`,k),Ce(()=>{Z.update({popupProps:bt,triggerProps:yt,itemRoot:St})}),Z.useSyncedValues({id:G,modal:w,multiple:M,disabled:K,readOnly:b,required:x,highlightItemOnHover:R,value:q,open:J,mounted:Q,transitionStatus:Xe,popupProps:bt,triggerProps:yt,itemRoot:St,items:A,itemToStringLabel:P,itemToStringValue:F,isItemEqualToValue:I,openMethod:ot});let Ct=s(E,W.inputRef),wt=M?void 0:le,Tt=Y.useMemo(()=>!M||!Array.isArray(q)||!le?null:q.map(e=>{let t=Te(e,F);return(0,X.jsx)(`input`,{type:`hidden`,form:h,name:le,value:t,disabled:K},t)}),[M,q,h,le,F,K]);return(0,X.jsxs)(Je.Provider,{value:Z,children:[(0,X.jsx)(Ye.Provider,{value:mt,children:B}),(0,X.jsx)(`input`,{...W.getValidationProps(K,{onFocus(){Z.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||K||b)return;let t=e.currentTarget.value,n=H(D,e.nativeEvent);function r(){if(M)return;let e=t.toLowerCase(),r=Ae.current.findIndex(t=>Te(t,F).toLowerCase()===e||Pe(t,P).toLowerCase()===e);r===-1&&(r=Ae.current.findIndex((t,n)=>{let r=be.current[n];return r!=null&&r.toLowerCase()===e}));let i=Ae.current[r];i!=null&&ft(i,n)}Z.set(`forceMount`,!0),queueMicrotask(r)}}),id:G&&wt==null?`${G}-hidden-input`:void 0,form:h,name:wt,autoComplete:g,value:st,disabled:K,required:x&&!(M&&dt),readOnly:b,ref:Ct,style:le?l:C,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tt]})}var nt=`data-popup-side`,rt=400,it={...ce,...q,popupSide:e=>e?{[nt]:e}:null,value:()=>null},at=Y.forwardRef(function(e,t){let{render:n,className:r,id:a,disabled:o=!1,nativeButton:s=!0,style:l,...u}=e,{setTouched:d,validationMode:f,validation:p,state:m,disabled:g}=he(),{labelId:_}=ve(),v=Q(),b=v.useState(`readOnly`),x=v.useState(`required`),S=v.useState(`disabled`),C=g||S||o,w=v.useState(`open`),T=v.useState(`mounted`),O=v.useState(`value`),A=v.useState(`triggerProps`),j=v.useState(`positionerElement`),M=v.useState(`listElement`),N=v.useState(`popupSide`),P=v.useState(`id`),F=v.useState(`labelId`),I=v.useState(`hasSelectedValue`),L=T&&j?N:null,R=a??P,B=qe(_,F);ge({id:a});let ee=c(j),V=Y.useRef(null),te=J(C,V),{getButtonProps:re,buttonRef:ie}=k({disabled:C,native:s}),ae=v.useStateSetter(`triggerElement`),oe=E(),U=E(),W=E();Y.useEffect(()=>{if(w)return W.start(rt,()=>{v.context.selectionRef.current.allowUnselectedMouseUp=!0,v.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{W.clear()};v.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},U.clear()},[w,v,U,W]);let ce=z(A,{id:R,role:`combobox`,"aria-expanded":w,"aria-haspopup":`listbox`,"aria-controls":w?M?.id??se(j)?.id:void 0,"aria-labelledby":B,"aria-readonly":b||void 0,"aria-required":x||void 0,tabIndex:C?-1:0,onFocus(e){te(!0),w&&v.context.alignItemWithTriggerActiveRef.current&&v.context.setOpen(!1,H(D,e.nativeEvent)),oe.start(0,()=>{v.set(`forceMount`,!0)})},onBlur(e){i(j,e.relatedTarget)||(d(!0),te(!1),f===`onBlur`&&p.commit(O))},onMouseDown(e){if(w)return;let t=ne(e.currentTarget);function n(e){if(!V.current)return;let t=e.target;i(V.current,t)||i(ee.current,t)||Z(e,V.current)||v.context.setOpen(!1,H(h,e))}U.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},u,re),G=p.getValidationProps(C,ce);G.role=`combobox`;let K={...m,open:w,disabled:C,value:O,readOnly:b,popupSide:L,placeholder:!I};return y(`button`,e,{ref:[t,V,ie,ae],state:K,stateAttributesMapping:it,props:G})}),ot={value:()=>null},st=Y.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Q(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?we(l,u,d):je(l,u,d)),y(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:ot})}),ct=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o={open:Q().useState(`open`)};return y(`span`,e,{state:o,ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:M})}),lt=Y.forwardRef(function(e,t){let n=Q(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,X.jsx)(g,{ref:t,...e}):null}),ut=Y.createContext(void 0);function dt(){let e=Y.useContext(ut);if(!e)throw Error(U(59));return e}function $(e,t){e&&Object.assign(e.style,t)}var ft={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},pt={position:`fixed`},mt=Y.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:h,disableAnchorTracking:g,alignItemWithTrigger:_=!0,collisionAvoidance:v=m,style:y,...b}=e,x=Q(),S=Xe(),C=x.useState(`open`),w=x.useState(`mounted`),T=x.useState(`modal`),E=x.useState(`value`),O=x.useState(`openMethod`),k=x.useState(`positionerElement`),A=x.useState(`triggerElement`),M=x.useState(`isItemEqualToValue`),N=x.useState(`transitionStatus`),P=Y.useRef(null),F=Y.useRef(null),[I,L]=Y.useState(_),R=w&&I&&O!==`touch`;!w&&I!==_&&L(_),Y.useImperativeHandle(x.context.alignItemWithTriggerActiveRef,()=>R),Fe((R||T)&&C,O===`touch`,k,A);let z=Ve({anchor:n,floatingRootContext:S,positionMethod:a,mounted:w,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:p,collisionBoundary:u,collisionPadding:f,sticky:h,disableAnchorTracking:g??R,collisionAvoidance:v,keepMounted:!0}),B=R?`none`:z.side,ee=R?pt:z.positionerStyles,te={open:C,side:B,align:z.align,anchorHidden:z.anchorHidden};j(()=>{x.set(`popupSide`,z.side)},[x,z.side]);let ne=x.useStateSetter(`positionerElement`),re=ze(e,te,{styles:ee,transitionStatus:N,props:b,refs:[t,ne],hidden:!w,inert:!C}),ie=Y.useRef(0),ae=V(e=>{if(x.context.valuesRef.current.length===0)return;let t=ie.current;ie.current=e.size;let n=H(D);if(t!==0&&!x.state.multiple&&E!==null&&Ee(x.context.valuesRef.current,E,M)===-1){let e=x.context.initialValueRef.current,t=e!=null&&Ee(x.context.valuesRef.current,e,M)!==-1?e:null;x.context.setValue(t,n),t===null&&(x.set(`selectedIndex`,null),x.context.selectedItemTextRef.current=null)}if(t!==0&&x.state.multiple&&Array.isArray(E)){let e=E.filter(e=>Ee(x.context.valuesRef.current,e,M)!==-1);e.length!==E.length&&(x.context.setValue(e,n),e.length===0&&(x.set(`selectedIndex`,null),x.context.selectedItemTextRef.current=null))}if(C&&R){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};$(k,e),$(x.context.popupRef.current,e)}}),oe=Y.useMemo(()=>({...z,side:B,alignItemWithTriggerActive:R,setControlledAlignItemWithTrigger:L,scrollUpArrowRef:P,scrollDownArrowRef:F}),[z,B,R,L]);return(0,X.jsx)(d,{elementsRef:x.context.listRef,labelsRef:x.context.labelsRef,onMapChange:ae,children:(0,X.jsxs)(ut.Provider,{value:oe,children:[w&&T&&(0,X.jsx)(_e,{inert:ye(!C),cutout:A}),re]})})}),ht=`base-ui-disable-scrollbar`,gt={className:ht,getElement(e){return(0,X.jsx)(`style`,{nonce:e,href:ht,precedence:`base-ui:low`,children:`.${ht}{scrollbar-width:none}.${ht}::-webkit-scrollbar{display:none}`})}},_t=Y.createContext(void 0),vt={disableStyleElements:!1};function yt(){return Y.useContext(_t)??vt}var bt=`--transform-origin`,xt={...A,...G},St=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=Q(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=Xe(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=dt(),_=re(!0)!=null,v=te(),{nonce:b,disableStyleElements:S}=yt(),C=s.useState(`id`),T=s.useState(`open`),E=s.useState(`openMethod`),D=s.useState(`mounted`),O=s.useState(`popupProps`),k=s.useState(`transitionStatus`),A=s.useState(`triggerElement`),M=s.useState(`positionerElement`),N=s.useState(`listElement`),F=Y.useRef(!1),L=Y.useRef(!1),R=Y.useRef({}),z=w(),B=V(e=>{if(!M||!s.context.popupRef.current||!L.current)return;let t=M.style.top===`0px`,n=M.style.bottom===`0px`;if(F.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=Tt(M),i=Et(M.getBoundingClientRect().height,`y`,r),a=ne(M),o=K(M),c=o.getComputedStyle(M),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=Ct(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=wt(e),g=null,_=e=>{M.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=Qe(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(F.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=Qe(g,0,wt(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(F.current=!0),s.context.handleScrollArrowVisibility(e)});Y.useImperativeHandle(s.context.scrollHandlerRef,()=>B,[B]),x({open:T,ref:s.context.popupRef,onComplete(){T&&s.context.onOpenChangeComplete(!0)}});let ee={open:T,transitionStatus:k,side:f,align:p};j(()=>{M&&s.context.popupRef.current&&!Object.keys(R.current).length&&(R.current={top:M.style.top||`0`,left:M.style.left||`0`,right:M.style.right,height:M.style.height,bottom:M.style.bottom,minHeight:M.style.minHeight,maxHeight:M.style.maxHeight,marginTop:M.style.marginTop,marginBottom:M.style.marginBottom})},[s,M]),j(()=>{T||m||(L.current=!1,F.current=!1,$(M,R.current))},[T,m,M]),j(()=>{let e=s.context.popupRef.current;if(!T||!A||!M||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(L.current=!0,e.style.removeProperty(bt),!m){z.request(()=>s.context.handleScrollArrowVisibility(N||e));return}let t=kt(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=K(M),i=r.getComputedStyle(M),a=r.getComputedStyle(e),o=ne(A),c=Tt(A),l=Dt(A.getBoundingClientRect(),c),d=Dt(M.getBoundingClientRect(),c),f=l.height,p=N||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=Ct(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,D=0;if(t&&n){let e=Dt(n.getBoundingClientRect(),c);T=Dt(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-d.top+T.height/2-r}let O=w+D+y+h,k=Math.min(S,O),j=S-_-y,P=O-k,L=C-5;M.style.left=`${Qe(E,5,L-d.width)}px`,M.style.height=`${k}px`,M.style.maxHeight=`none`,M.style.marginTop=`${_}px`,M.style.marginBottom=`${y}px`,e.style.height=`100%`;let z=wt(p),B=P>=z-1;B&&(k=Math.min(S,d.height)-(P-z));let ee=l.top<20||l.bottom>S-20||Math.ceil(k)+1<Math.min(m,b),V=(r.visualViewport?.scale??1)!==1&&I;if(ee||V){$(M,R.current),g(!1);return}let te=Math.max(b,k);if(B){let e=Math.max(0,S-O);M.style.top=d.height>=j?`0`:`${e}px`,M.style.height=`${k}px`,p.scrollTop=wt(p)}else M.style.bottom=`0`,p.scrollTop=P;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=Qe(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(bt,`50% ${i}%`)}(te===S||k>=x)&&(F.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,T,M,A,m,g,z,N,u,v,h]),Y.useEffect(()=>{if(!m||!M||!T)return;let e=K(M);function t(e){s.context.setOpen(!1,H(W,e))}return ie(e,`resize`,t)},[s,m,M,T]);let ae={...N?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${C}-list`},onKeyDown(e){_&&P.has(e.key)&&e.stopPropagation()},onScroll(e){N||B(e.currentTarget)},...m&&{style:N?{height:`100%`}:ft},className:!N&&m?gt.className:void 0},oe=y(`div`,e,{ref:[t,s.context.popupRef],state:ee,stateAttributesMapping:xt,props:[O,ae,He(k),o]});return(0,X.jsxs)(Y.Fragment,{children:[!S&&gt.getElement(b),(0,X.jsx)(be,{context:d,modal:!1,disabled:!D,openInteractionType:E,returnFocus:a,restoreFocus:!0,children:oe})]})});function Ct(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function wt(e){return $e(e.scrollHeight,e.clientHeight)}function Tt(e){return Be.getScale(e)}function Et(e,t,n){return e/n[t]}function Dt(e,t){return ae({x:Et(e.x,`x`,t),y:Et(e.y,`y`,t),width:Et(e.width,`x`,t),height:Et(e.height,`y`,t)})}var Ot=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function kt(e){let{style:t}=e,n={};for(let[e,r]of Ot)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Ot){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var At=Y.createContext(void 0);function jt(){let e=Y.useContext(At);if(!e)throw Error(U(57));return e}var Mt=Y.memo(Y.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=Y.useRef(null),d=F({guess:!0,label:o,textRef:u}),f=Q(),{props:m,multiple:h,disabled:g,readOnly:_,isItemEqualToValue:v}=f.useState(`itemRoot`),b=g||s,x=f.useState(`isActive`,d.index),S=f.useState(`open`),C=f.useState(`isSelected`,a),w=f.useState(`isSelectedByFocus`,d.index),E=d.index,D=Y.useRef(null);j(()=>{let e=f.context.valuesRef.current;return e[E]=a,()=>{delete e[E]}},[E,a,f]),j(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;h&&Array.isArray(e)?(n=Oe(E,a,f.context.valuesRef.current,e,v,t),r=n===E,E===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&ke(a,e,v),r&&(n=E)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[E,h,v,f,a]);let O=Y.useRef(`mouse`),A=Y.useRef(!1),{getButtonProps:M,buttonRef:N}=k({disabled:b,focusableWhenDisabled:!0,native:c,composite:!0}),P={disabled:b,selected:C,highlighted:x};function I(e){if(g||_)return;let t=f.state.value;if(h){let n=Array.isArray(t)?t:[],r=C?Ae(n,a,v):[...n,a];f.context.setValue(r,H(p,e))}else f.context.setValue(a,H(p,e)),f.context.setOpen(!1,H(p,e))}function L(){f.context.selectionRef.current.dragY=0}let R={role:`option`,"aria-selected":C,tabIndex:S&&x?0:-1,onKeyDown(e){f.set(`activeIndex`,E),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=O.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&T(e.nativeEvent)&&(n!==void 0||x),i=t&&!r&&!A.current;A.current=!1,b||i||I(e.nativeEvent)},onPointerEnter(e){O.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){O.current=e.pointerType,A.current=!0,L()},onMouseUp(){if(L(),b||O.current===`touch`||A.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&C,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!C;e||t||(A.current=!0,D.current?.click(),A.current=!1)}},z=y(`div`,e,{ref:[N,t,d.ref,D],state:P,props:[m,R,l,M]}),B=Y.useMemo(()=>({selected:C,index:E,textRef:u,selectedByFocus:w}),[C,E,u,w]);return(0,X.jsx)(At.Provider,{value:B,children:z})})),Nt=Y.memo(Y.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=Y.useRef(null),{transitionStatus:l,setMounted:u}=le(o),d=y(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:G});return x({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),Pt=Y.forwardRef(function(e,t){let{selected:n}=jt();return e.keepMounted||n?(0,X.jsx)(Nt,{...e,selected:n,ref:t}):null}),Ft=Y.memo(Y.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=jt(),a=Q(),{render:o,className:s,style:c,...l}=e,u=Y.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]);return y(`div`,e,{ref:[u,t,r],props:l})})),It=`relative flex h-9 w-full min-w-0 items-center gap-2 rounded-control border border-rule bg-page pr-9 pl-3 text-left text-sm text-text outline-none transition-colors focus-visible:border-accent data-popup-open:border-accent disabled:cursor-not-allowed disabled:opacity-60`,Lt=`pointer-events-none size-4 text-muted`,Rt=`max-h-[min(var(--available-height),20rem)] min-w-(--anchor-width) overflow-y-auto rounded-card border border-rule bg-surface p-1 text-text shadow-float outline-none transition-[opacity,transform] duration-150 data-ending-style:-translate-y-1 data-ending-style:opacity-0 data-starting-style:-translate-y-1 data-starting-style:opacity-0`,zt=`relative flex cursor-default items-center rounded-[6px] py-1.5 pr-8 pl-2.5 text-sm outline-none select-none data-disabled:opacity-50 data-highlighted:bg-accent-soft`,Bt=`pointer-events-none absolute right-2.5 size-4 text-accent`;function Vt(e){return(0,X.jsx)(tt,{"data-slot":`select`,...e})}function Ht({className:e,children:t,...n}){return(0,X.jsxs)(at,{"data-slot":`select-trigger`,className:r(It,e),...n,children:[t,(0,X.jsx)(ct,{className:`absolute right-3 flex`,children:(0,X.jsx)(oe,{name:`chevron`,className:Lt})})]})}function Ut({className:e,...t}){return(0,X.jsx)(st,{"data-slot":`select-value`,className:r(`truncate`,e),...t})}function Wt({className:e,...t}){return(0,X.jsx)(lt,{children:(0,X.jsx)(mt,{alignItemWithTrigger:!1,sideOffset:6,className:`z-40`,children:(0,X.jsx)(St,{"data-slot":`select-content`,className:r(Rt,e),...t})})})}function Gt({className:e,children:t,...n}){return(0,X.jsxs)(Mt,{"data-slot":`select-item`,className:r(zt,e),...n,children:[(0,X.jsx)(Ft,{className:`truncate`,children:t}),(0,X.jsx)(Pt,{className:Bt,children:(0,X.jsx)(oe,{name:`check`,className:`size-4`})})]})}export{Ue as C,Z as S,lt as _,Vt as a,tt as b,Ht as c,Ft as d,Pt as f,mt as g,St as h,Rt as i,Ut as l,Mt as m,zt as n,Wt as o,Nt as p,Bt as r,Gt as s,Lt as t,It as u,ct as v,qe as x,at as y};
@@ -0,0 +1 @@
1
+ import{t as e}from"./companion-view-B54_Lj0S.js";import{a as t,n,t as r}from"./jsx-runtime-MZURdZre.js";import{ct as i,et as a,it as o,nt as s,ot as c,r as l,rt as u}from"./button-upSzkd-q.js";import{t as d}from"./cn-BCnYnarL.js";import{n as f,r as p,t as m}from"./panel-CDQ6Lryw.js";import{i as h}from"./steps-CF3-Zpmh.js";import{G as g,f as _}from"./studio-queries-CKtAnIKP.js";import{Lt as v,l as y}from"./index-D5oGyvG8.js";import{t as b}from"./markdown-view-CJ8JsLb7.js";var x=t(n(),1),S=r(),C=`flex w-full min-w-0 items-center gap-2.5 rounded-control border-0 bg-transparent px-2 py-1 text-left text-sm text-text hover:bg-surface-soft aria-[current=true]:bg-accent-soft`;function w(e){return e<1024?`${e} B`:`${(e/1024).toFixed(+(e<10240))} KB`}function T({companion:e,agent:t,name:n}){let[r,i]=(0,x.useState)(void 0),a=v({..._(e,t,n,r),placeholderData:g});if(!a.data)return(0,S.jsx)(f,{title:`Files`,children:a.isError?(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,role:`alert`,children:a.error instanceof Error?a.error.message:`The skill could not be read.`}):(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Listing files…`})});let{files:o,truncated:s,open:c}=a.data;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(f,{title:`Files`,aside:s?`first ${o.length}`:o.length,children:(0,S.jsx)(`ul`,{className:`m-0 -mx-2 grid list-none gap-0.5 p-0`,children:o.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:C,"aria-current":c?.path===e.path?`true`:void 0,"data-skill-file":e.path,onClick:()=>i(e.path),children:[(0,S.jsx)(l,{name:`doc`,className:`flex-none text-muted`}),(0,S.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.path}),(0,S.jsx)(`span`,{className:`ml-auto flex-none font-mono text-2xs text-muted`,children:w(e.size)})]})},e.path))})}),c?(0,S.jsxs)(`section`,{className:d(`grid gap-2.5 px-5 py-4`,a.isPlaceholderData&&`opacity-60`),"aria-label":`File ${c.path}`,children:[(0,S.jsx)(`code`,{className:`truncate font-mono text-xs text-muted`,children:c.path}),c.nodes?(0,S.jsx)(`div`,{className:`prose-panel`,children:(0,S.jsx)(b,{nodes:c.nodes})}):(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:c.note})]}):null]})}var E=[{id:`claude`,label:`Claude`,dir:`.claude/skills`,invoke:e=>`/${e}`},{id:`opencode`,label:`OpenCode`,dir:`.opencode/skills`,invoke:e=>`@${e}`},{id:`agents`,label:`Agents`,dir:`.agents/skills`,invoke:e=>`$${e}`}],D=new Set([`mate-grilling`,`mate-domain-modeling`]);function O(){let e=new Map;for(let t of h({}).paths[0]?.steps??[]){t.skill&&!e.has(t.skill)&&e.set(t.skill,t.label);for(let n of t.alternatives??[])e.has(n.name)||e.set(n.name,t.label)}return e}function k(e,t){let n=[...t.keys()],r=e.filter(e=>t.has(e)).toSorted((e,t)=>n.indexOf(e)-n.indexOf(t)),i=e.filter(e=>D.has(e)),a=e.filter(e=>e.startsWith(`mate-`)&&!t.has(e)&&!D.has(e)),o=e.filter(e=>!e.startsWith(`mate-`)&&!t.has(e));return[{title:`Delivery Path`,hint:`In the order a change meets them`,names:r},{title:`Other Mate skills`,hint:`Run when you need them`,names:a},{title:`Used by other skills`,hint:`Loaded for you, not started on their own`,names:i},{title:`Other skills`,hint:`Installed besides Mate`,names:o}].filter(e=>e.names.length>0)}function A({skills:e,companion:t}){let n=e??{claude:[],opencode:[],agents:[]},[r,l]=(0,x.useState)(`claude`),[h,g]=(0,x.useState)(null),_=O(),v=E.find(e=>e.id===r);return(0,S.jsxs)(`section`,{className:d(o,`grid content-start gap-3 pb-10`),"aria-label":`Agent skills`,"data-skills-root":!0,children:[(0,S.jsx)(c,{label:`Agent`,value:r,onChange:e=>{l(e),g(null)},options:E.map(e=>({value:e.id,label:e.label,count:n[e.id].length}))}),E.map(e=>{let t=e.id===r,a=n[e.id];return(0,S.jsx)(`div`,{id:`skills-panel-${e.id}`,className:t?`grid gap-3`:`hidden`,"aria-hidden":!t,"data-skill-panel":e.id,"data-active":t,children:a.length===0?(0,S.jsxs)(s,{children:[e.label,` has no skills in this companion.`]}):k(a,_).map(e=>(0,S.jsx)(u,{title:e.title,count:e.names.length,hint:e.hint,children:(0,S.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.names.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:d(i,`grid grid-cols-[minmax(0,1fr)_auto] py-1.5`),"aria-current":t&&h===e?`true`:void 0,"data-skill":e,onClick:()=>g(e),children:[(0,S.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e}),_.has(e)?(0,S.jsx)(`span`,{className:`text-xs text-muted`,children:_.get(e)}):null]})},e))})},e.title))},e.id)}),(0,S.jsx)(p,{items:k(n[r],_).flatMap(e=>e.names),current:h,onSelect:g,wide:t!==void 0,title:h?`Skill ${h}`:`Skill`,children:h?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(m,{mono:!0,title:h,kicker:_.has(h)?(0,S.jsxs)(`span`,{children:[`Delivery Path · `,_.get(h)]}):(0,S.jsx)(`span`,{children:v.label})}),(0,S.jsx)(f,{title:`Start`,children:D.has(h)?(0,S.jsx)(`p`,{className:`m-0 text-sm`,children:`Used by other skills: they load it when they need it, so it has no start command.`}):(0,S.jsx)(a,{text:v.invoke(h),label:`start command`})}),(0,S.jsx)(f,{title:`Installed for`,children:(0,S.jsx)(`ul`,{className:`m-0 grid list-none gap-1.5 p-0`,children:E.filter(e=>n[e.id].includes(h)).map(e=>(0,S.jsxs)(`li`,{className:`flex items-center gap-3 text-sm`,children:[(0,S.jsx)(`span`,{className:`w-20 text-muted`,children:e.label}),(0,S.jsxs)(`code`,{className:`truncate font-mono text-xs`,children:[e.dir,`/`,h,`/`]})]},e.id))})}),t?(0,S.jsx)(T,{companion:t,agent:r,name:h},`${r}/${h}`):null]}):null})]})}var j=function(){let t=y.useSearch();return(0,S.jsx)(e,{view:`skills`,search:t,children:e=>(0,S.jsx)(A,{skills:e.skillInventory,companion:t.companion})})};export{j as component};
@@ -1 +1 @@
1
- import"./studio-ndtFcS2Y.js";import{t as e}from"./companion-view-C1F0_jbt.js";import{n as t,r as n}from"./specs-view-znqFPx9p.js";import{s as r}from"./index-zmRH87D4.js";import{t as i}from"./jsx-runtime-MZURdZre.js";function a(e){return(e.actions??[]).flatMap(({id:e,runAgents:t,copyAgents:r})=>{let i=n(e);return i?[{action:i,runAgents:t,copyAgents:r}]:[]})}var o=i(),s=function(){let n=r.useSearch(),i=r.useNavigate();return(0,o.jsx)(e,{view:`specs`,search:n,children:e=>(0,o.jsx)(t,{payload:{specs:e.specs??[],warnings:e.warnings},actions:a(e),companion:n.companion,filter:{q:n.q,repo:n.repo,area:n.area},onFilterChange:e=>void i({search:t=>({...t,q:e.q||void 0,repo:e.repo,area:e.area}),replace:!0})})})};export{s as component};
1
+ import"./studio-X7bnFrRe.js";import{t as e}from"./companion-view-B54_Lj0S.js";import{n as t,r as n}from"./specs-view-C6t3Y5IT.js";import{c as r}from"./index-D5oGyvG8.js";import{t as i}from"./jsx-runtime-MZURdZre.js";function a(e){return(e.actions??[]).flatMap(({id:e,runAgents:t,copyAgents:r})=>{let i=n(e);return i?[{action:i,runAgents:t,copyAgents:r}]:[]})}var o=i(),s=function(){let n=r.useSearch(),i=r.useNavigate();return(0,o.jsx)(e,{view:`specs`,search:n,children:e=>(0,o.jsx)(t,{payload:{specs:e.specs??[],warnings:e.warnings},actions:a(e),companion:n.companion,filter:{q:n.q,repo:n.repo,area:n.area},onFilterChange:e=>void i({search:t=>({...t,q:e.q||void 0,repo:e.repo,area:e.area}),replace:!0})})})};export{s as component};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{h as r,ut as i}from"./studio-queries-CKtAnIKP.js";import{t as a}from"./cn-BCnYnarL.js";import"./studio-X7bnFrRe.js";import{ct as o,it as s,lt as c,nt as l,r as u,rt as d}from"./button-upSzkd-q.js";import{t as f}from"./fields-DNZ4a89M.js";import{a as p,c as m,l as h,o as g,s as _}from"./select-B2FsN9FY.js";import{a as v,i as y,n as b,o as x,r as S,t as C}from"./combobox-cP9OsRf2.js";import{Lt as ee}from"./index-D5oGyvG8.js";import{t as te}from"./markdown-view-CJ8JsLb7.js";import{n as ne,r as w,t as T}from"./panel-CDQ6Lryw.js";import{t as E}from"./warnings-D7YY1HSG.js";var D=[`binds`,`in`,`mentions`,`co-change`],O=`Repository root`,k=e=>`spec:${e}`,A=(e,t)=>`openspec/changes/archive/${e}/${t}`,j=e=>`openspec/specs/${e}/spec.md`,M=/^[a-z0-9][a-z0-9-]{0,63}$/,re=[{id:`explore-workset`,skill:`mate-explore-change`,label:`Explore`,subject:`workset`,prompts:{claude:e=>`/mate-explore-change ${e}`,opencode:e=>`Use the mate-explore-change skill on Workset ${e}.`}},{id:`propose-workset`,skill:`mate-propose-change`,label:`Propose`,subject:`workset`,prompts:{claude:e=>`/mate-propose-change ${e}`,opencode:e=>`Use the mate-propose-change skill for ${e}.`}},{id:`apply-change`,skill:`mate-apply-change`,label:`Apply`,subject:`change`,prompts:{claude:e=>`/mate-apply-change ${e}`,opencode:e=>`Use the mate-apply-change skill on change ${e}.`}}],ie=[{id:`show-me`,skill:`mate-show-me`,label:`Show me`,subject:`spec`,prompts:{claude:e=>`/mate-show-me ${e}`,opencode:e=>`Use the mate-show-me skill on spec ${e}.`}}];function ae(e){return[...ie,...re].find(t=>t.id===e)??null}var N=e(t(),1),P=`unassigned`,F=e=>e??`(none)`;function I(e){return e.flatMap(e=>e.scopes.length===0?[{repository:null,area:P,spec:e}]:e.scopes.map(t=>({repository:t.repository??null,area:t.area??P,spec:e})))}function L(e,t){return e===t?0:e===null?1:t===null?-1:e.localeCompare(t)}var R=e=>new Set(e.map(e=>e.spec.capability)).size;function z(e,t){let n=I(e),r=Map.groupBy(n,e=>F(e.repository)),i=[...r.entries()].map(([e,t])=>({value:e,repository:t[0].repository,count:R(t)})).toSorted((e,t)=>L(e.repository,t.repository)),a=t!==void 0&&r.get(t)||n;return{repositories:i,areas:[...Map.groupBy(a,e=>`${F(e.repository)}\n${e.area}`).values()].map(e=>{let{repository:t,area:n}=e[0];return{repo:F(t),repository:t,area:n,count:R(e)}}).toSorted((e,t)=>L(e.repository,t.repository)||e.area.localeCompare(t.area))}}function B({repositories:e,areas:t},n){let r=n.q?.trim(),i=e.some(e=>e.value===n.repo)?n.repo:void 0,a=i!==void 0&&t.some(e=>e.area===n.area)?n.area:void 0;return{...r?{q:r}:{},...i===void 0?{}:{repo:i},...a===void 0?{}:{area:a}}}function V(e,t){if(t.repo!==void 0&&F(e.repository)!==t.repo||t.area!==void 0&&e.area!==t.area)return!1;if(!t.q)return!0;let n=t.q.toLowerCase();return e.spec.capability.toLowerCase().includes(n)||e.area.toLowerCase().includes(n)}function H(e,t={}){let n=I(e).filter(e=>V(e,t));return[...Map.groupBy(n,e=>F(e.repository)).values()].map(e=>({repository:e[0].repository,areas:[...Map.groupBy(e,e=>e.area)].map(([e,t])=>({area:e,specs:[...new Set(t.map(e=>e.spec))]})).toSorted((e,t)=>e.area.localeCompare(t.area))})).toSorted((e,t)=>L(e.repository,t.repository))}var U=n(),W=[];function G(e){return e.valid===!1?(0,U.jsx)(c,{marker:`issue`,children:`${e.issueCount??0} issues`}):e.valid===!0?(0,U.jsx)(c,{marker:`done`,children:`valid`}):(0,U.jsx)(c,{marker:`idle`,children:`unvalidated`})}var K=`.`,q=e=>e===K?O:e,J=e=>e??`No repository`,oe=({repository:e,area:t})=>[e,t===void 0?void 0:q(t)].filter(Boolean).join(` · `),se=200;function Y(e){return e===void 0?`requirements unknown`:`${e} ${e===1?`requirement`:`requirements`}`}var ce={};function le({payload:e,actions:t=W,companion:n,filter:r=ce,onFilterChange:i}){let[a,o]=(0,N.useState)(r);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(E,{warnings:e.warnings}),(0,U.jsx)(me,{specs:e.specs,actions:t,companion:n,filter:i?r:a,onFilterChange:i??o})]})}var X={key:``,label:`All Areas`},ue=(e,t)=>e.key===t.key,de=e=>e.label;function Z({specs:e,options:{repositories:t,areas:n},filter:r,search:i,onSearch:a,onChange:o}){let s=r.repo!==void 0,c=[{value:``,label:`All repositories`},...t.map(e=>({value:e.value,label:`${J(e.repository)} (${e.count})`}))],l=[X,...n.map(e=>{let t=s?q(e.area):`${J(e.repository)} · ${q(e.area)}`;return{key:`${e.repo}\n${e.area}`,label:`${t} (${e.count})`,option:e}})],u=l.find(e=>e.option?.repo===r.repo&&e.option?.area===r.area)??X;return(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`search`,"aria-label":`Filter specs`,children:[(0,U.jsx)(f,{type:`search`,className:`w-64 max-sm:w-full`,placeholder:`Search capability or Area`,"aria-label":`Search specs`,value:i,onChange:e=>a(e.currentTarget.value)}),(0,U.jsxs)(p,{items:c,value:r.repo??``,onValueChange:t=>{let n=t||void 0,i=z(e,n).areas.some(e=>e.repo===n&&e.area===r.area);o({...r,repo:n,area:i?r.area:void 0})},children:[(0,U.jsx)(m,{className:`w-auto max-w-72`,"aria-label":`Repository`,children:(0,U.jsx)(h,{})}),(0,U.jsx)(g,{children:c.map(e=>(0,U.jsx)(_,{value:e.value,children:e.label},e.value))})]}),(0,U.jsxs)(C,{items:l,value:u,onValueChange:e=>o(e?.option?{...r,repo:e.option.repo,area:e.option.area}:{...r,area:void 0}),isItemEqualToValue:ue,itemToStringLabel:de,children:[(0,U.jsx)(y,{className:`w-80 max-sm:w-full`,"aria-label":`Area`,placeholder:`All Areas`}),(0,U.jsxs)(b,{children:[(0,U.jsx)(S,{children:`No Areas match`}),(0,U.jsx)(x,{children:e=>(0,U.jsx)(v,{value:e,children:e.label},e.key)})]})]})]})}var Q=`inline-flex h-7 items-center gap-1.5 rounded-[6px] border border-rule bg-surface px-2.5 text-xs text-text hover:border-accent hover:bg-accent-soft`;function fe({capability:e,actions:t}){return!M.test(e)||t.length===0?null:(0,U.jsx)(`span`,{className:`spec-actions flex flex-wrap items-center gap-1.5`,children:t.map(({action:t,runAgents:n,copyAgents:r})=>(0,U.jsxs)(N.Fragment,{children:[n.length>0?(0,U.jsxs)(`button`,{type:`button`,className:a(Q,`spec-action`),"data-studio-action":t.id,"data-studio-subject":e,"data-studio-agents":n.join(` `),children:[(0,U.jsx)(u,{name:`play`,className:`size-3.5`}),t.label]}):null,(0,U.jsxs)(`button`,{type:`button`,className:a(Q,`spec-copy`),"aria-label":`Copy prompt`,"data-studio-copy-prompt":t.id,"data-prompt-claude":r.includes(`claude`)?t.prompts.claude(e):void 0,"data-prompt-opencode":r.includes(`opencode`)?t.prompts.opencode(e):void 0,children:[(0,U.jsx)(u,{name:`copy`,className:`size-3.5`}),`Copy prompt`]})]},t.id))})}function pe({specs:e,open:t,onOpen:n}){return(0,U.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,className:a(o,`grid grid-cols-[minmax(0,1fr)_auto_120px] py-1.5 max-sm:grid-cols-[minmax(0,1fr)_auto]`),"aria-current":t===e.capability?`true`:void 0,"data-spec":e.capability,onClick:()=>n(e.capability),children:[(0,U.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.capability}),e.valid===!0?(0,U.jsx)(`span`,{}):G(e),(0,U.jsx)(`span`,{className:`text-right text-xs text-muted tabular-nums max-sm:hidden`,children:Y(e.requirementCount)})]})},e.capability))})}function me({specs:e,actions:t,companion:n,filter:r,onFilterChange:i}){let[o,c]=(0,N.useState)(r.q??``),[u,f]=(0,N.useState)(r.q);r.q!==u&&(f(r.q),(r.q??``)!==o.trim()&&c(r.q??``));let p=(0,N.useRef)(void 0);(0,N.useEffect)(()=>()=>clearTimeout(p.current),[]);let m=z(e,r.repo),h=B(m,{...r,q:o}),g=e=>{clearTimeout(p.current),i(e)},_=e=>{c(e),clearTimeout(p.current),p.current=setTimeout(()=>i({...h,q:e.trim()}),se)},v=()=>{c(``),g({})},y=H(e,h),[b,x]=(0,N.useState)(null),S=[...new Set(y.flatMap(e=>e.areas.flatMap(e=>e.specs.map(e=>e.capability))))],C=e.find(e=>e.capability===b)??null;return(0,U.jsxs)(`section`,{className:a(s,`grid content-start gap-3 pb-10`),"aria-label":`Specs by repository and Area`,children:[e.length===0?(0,U.jsx)(l,{children:`No specs in this companion.`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Z,{specs:e,options:m,filter:h,search:o,onSearch:_,onChange:e=>g({...e,q:o.trim()})}),y.length===0?(0,U.jsxs)(l,{className:`flex flex-wrap items-center gap-3`,children:[`No spec matches the search and filters.`,(0,U.jsx)(`button`,{type:`button`,className:Q,onClick:v,children:`Clear filters`})]}):y.map(e=>(0,U.jsxs)(`section`,{className:`grid content-start gap-3`,"aria-label":`Repository ${J(e.repository)}`,children:[(0,U.jsx)(`h2`,{className:`m-0 mt-2 font-mono text-sm font-semibold text-muted`,children:J(e.repository)}),e.areas.map(({area:e,specs:t})=>(0,U.jsx)(d,{level:3,title:e===K?q(e):(0,U.jsx)(`span`,{className:`font-mono`,children:e}),label:`Area ${e}`,count:t.length,children:(0,U.jsx)(pe,{specs:t,open:b,onOpen:x})},e))]},e.repository??``))]}),(0,U.jsx)(w,{items:S,current:C?.capability??null,onSelect:x,wide:!0,title:C?`Spec ${C.capability}`:`Spec`,children:C?(0,U.jsx)($,{spec:C,actions:t,companion:n}):null})]})}function $({spec:e,actions:t=W,companion:n,withStatus:a=!0,children:o}){let s=j(e.capability),c=ee({...r(n??``,{path:s}),enabled:!!n}),l=c.data?.open?.markdown;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(T,{mono:!0,title:e.capability,kicker:(0,U.jsxs)(U.Fragment,{children:[a?G(e):null,(0,U.jsx)(`span`,{className:`ml-auto`,children:e.scopes.map(oe).join(`, `)})]}),children:(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(fe,{capability:e.capability,actions:t}),(0,U.jsxs)(i,{className:`inline-flex items-center gap-1.5 text-sm`,to:`/vault`,search:e=>({companion:e.companion,studioMode:e.studioMode,path:s}),children:[(0,U.jsx)(u,{name:`external`,className:`size-3.5`}),` Open in Vault`]})]})}),o,(0,U.jsx)(ne,{title:`Spec`,aside:e.requirementCount===void 0?void 0:Y(e.requirementCount),children:l?(0,U.jsx)(`div`,{className:`prose-panel`,children:(0,U.jsx)(te,{nodes:l})}):(0,U.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:c.isError?`The spec file could not be read.`:c.isPending&&n?`Loading…`:`The spec file could not be read.`})})]})}export{O as a,D as i,le as n,A as o,ae as r,k as s,$ as t};
@@ -0,0 +1 @@
1
+ import{S as e,T as t,d as n,f as r,g as i,h as a,l as o,m as s,p as c,u as l}from"./studio-X7bnFrRe.js";var u=i();function d(e){return e===`review`?`reviews`:`reviews-${e}`}function f(e){return e.kind===`human`?d(e.group):e.id}var p=[`mate-clarify-intent`,`mate-interview-me`,`mate-grill-me`],m={"mate-clarify-intent":`Default. Reads what the request already states and routes to an interview, grilling, or skip, then runs that one mode.`,"mate-interview-me":`Explicit mode: guided, one-question-at-a-time clarification when intent, constraints, or scope still need confirmation.`,"mate-grill-me":`Explicit mode: round-based stress test of a mostly known direction to surface hidden assumptions and risks.`},h={"clarify-intent":{what:`Settles who the change is for, why it is needed, how success is measured, and what binds it, before any artifact exists.`,why:`Intent gaps are cheapest to close before exploration turns them into documents.`},explore:{what:`Resolves repository evidence, unknowns, and options, with scope taken from the companion context map, and suggests slicing a large feature.`,why:`It separates uncertainty from the proposal's committed scope.`},propose:{what:`Chooses the schema from the minimal eligibility test, checks slicing when explore agreed none, and writes the change's planning artifacts in one prompt.`,why:`One prompt writes every artifact; each one is then reviewed on its own.`},apply:{what:`Records the delivery branch, avoiding protected branches, then implements the reviewed tasks.`,why:`The recorded branch is what submit and publication later wait on.`},"inspect-outcome":{what:`Shows what the applied change did as a rendered diagram and diff in a Mate report.`,why:`Seeing the result tells the reviewer whether cleanup is warranted.`},"refine-code":{what:`Looks for smaller, clearer code once tests pass, preserving behavior.`,why:`Cleanup lands before submit, so shipped code and recorded specs agree.`},submit:{what:`Records the delivery, validates the change, and pushes its Delivery Group's change folders for publication; allowed before the branch merges.`,why:`The finished change is safe on the remote and publishable from any machine once merged.`},publish:{what:`Archives submitted Delivery Groups whose delivery branches are merged, from any machine, and commits and pushes them, chosen by the developer.`,why:`Published canonical specs then describe the default branch; unmerged changes wait.`}};function g(e,t,n){return{what:(t?.schemaName===n?t.artifacts.find(t=>t.id===e)?.description:void 0)??`A person reviews the ${e} artifact.`,why:`Reviews stay with people: Mate never marks them approved.`}}function _(e){return{what:`Runs ${e.steps.map(e=>e.skill).join(`, then `)}.`,why:`The companion declares this stage in ${a}.`}}function v(n,r){if(n.kind===`human`)return null;if(n.id===`clarify-intent`)return`/${n.skill} about ${t}`;let i=n.id===`propose`&&r!==`mate-full`?` (use schema: ${r})`:``;return`/${n.skill}${i} for ${e}`}function y(n){return n&&n.replace(` ${e}`,``).replace(` ${t}`,``)}function b(e){return p.filter(e).map(e=>({name:e,description:m[e],prompt:`/${e} about ${t}`,copyPrompt:`/${e} about`}))}var x=new Set([`mate-explore-change`,`mate-propose-change`,`mate-apply-change`]);function S(e,t){return e.id===`submit`?t.submitArtifact===s:e.steps.some(e=>x.has(e.skill))}function C(e,t){if(e.kind===`human`)return[`human-review`];let n=e.optional?[`optional`,`skill`]:[`skill`];return S(e,t)&&n.push(`openspec`),n}var w={"mate-full":{tagline:`full planning`,description:`Full planning path: proposal, specs, design, and tasks.`},"mate-minimal":{tagline:`minimal planning`,description:`Short path: specs and tasks only, for one-Area, low-risk changes with clear intent.`}};function T(e){let t=n(e);return Object.hasOwn(w,t)?w[t]:{tagline:`custom schema`,description:`Planning path of the ${e} schema.`}}var E={plan:`Plan`,review:`Review`,build:`Build`,ship:`Ship`},D=new Set([`submit`,`publish`]);function O(e){let t=e.findLastIndex(e=>e.kind===`human`),n=t===-1?e.findIndex(e=>e.id===`apply`):t+1;return e.map((e,t)=>e.kind===`human`?`review`:D.has(e.id)?`ship`:n!==-1&&t>=n?`build`:`plan`)}function k(e){return e.kind===`human`?`human:${e.group}`:e.optional?`optional`:null}function A(e){let t=[];for(let n of e){let e=k(n),r=t.at(-1);e&&r?.key===e?r.steps.push(n):t.push({group:n.kind===`human`?`human`:e?`optional`:null,key:e,steps:[n]})}return t.map(e=>e.group===`human`||e.group===`optional`&&e.steps.length>1?{kind:`group`,group:e.group,steps:e.steps}:{kind:`stage`,step:e.steps[0]})}function j(e,t,n){let i=n.skills?new Set(n.skills):null,a=e=>!i||i.has(e),o=n.workflow??u,s=r(t,o),c=O(s.stages),l=s.stages.map((t,r)=>{let i=t.kind===`human`?g(t.artifact,n.topology,e):t.steps.some(e=>e.own)&&t.id in h?h[t.id]:_(t),s=v(t,e),l={...t,what:i.what,why:i.why,badges:C(t,o),prompt:s,copyPrompt:y(s),phase:c[r]};if(t.id===`clarify-intent`&&t.skill===p[0]&&(l.alternatives=b(a)),t.kind===`skill`){let e=[t.skill,...t.steps.map(e=>e.skill)].find(e=>!a(e));e&&(l.missingSkill=e)}return t.id===`apply`&&(l.sessionBreakBefore=!0),l});return{schema:e,label:e,...T(e),steps:l,map:A(l),reviewsKnown:s.reviewsKnown,stepsKnown:n.workflow!==null}}function M(e,t){return t?.schemaName===e?t.artifacts.map(e=>e.id):c(e)?o[e]:void 0}function N(e={}){let t=e.topology&&{...e.topology,schemaName:n(e.topology.schemaName)},r={...e,topology:t},i=t?.schemaName;return{paths:(i&&!c(i)?[i]:l).map(e=>j(e,M(e,t),r))}}export{N as i,f as n,d as r,E as t};
@@ -1 +1 @@
1
- import{i as e,kr as t}from"./button-C9SQW3kI.js";function n(n,r,i=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new e({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:n,floatingId:r,syncOnly:!0,nested:i,onOpenChange:void 0}),floatingId:r,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:t,inactiveTriggerProps:t,popupProps:t}}var r=e=>e.triggerIdProp??e.activeTriggerId,i=e=>e.openProp??e.open,a=e=>(e.popupElement?.id??e.floatingId)||void 0;function o(e,t){return t!==void 0&&i(e)&&r(e)===t}function s(e,t){return o(e,t)?!0:t!==void 0&&i(e)&&r(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var c={open:i,mounted:e=>e.mounted,transitionStatus:e=>i(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:r,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:a,isTriggerActive:(e,t)=>t!==void 0&&r(e)===t,isOpenedByTrigger:(e,t)=>o(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&r(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>s(e,t)?a(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};export{c as n,n as t};
1
+ import{Mr as e,i as t}from"./button-upSzkd-q.js";function n(n,r,i=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new t({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:n,floatingId:r,syncOnly:!0,nested:i,onOpenChange:void 0}),floatingId:r,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:e,inactiveTriggerProps:e,popupProps:e}}var r=e=>e.triggerIdProp??e.activeTriggerId,i=e=>e.openProp??e.open,a=e=>(e.popupElement?.id??e.floatingId)||void 0;function o(e,t){return t!==void 0&&i(e)&&r(e)===t}function s(e,t){return o(e,t)?!0:t!==void 0&&i(e)&&r(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var c={open:i,mounted:e=>e.mounted,transitionStatus:e=>i(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:r,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:a,isTriggerActive:(e,t)=>t!==void 0&&r(e)===t,isOpenedByTrigger:(e,t)=>o(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&r(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>s(e,t)?a(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};export{c as n,n as t};