@uniqbit/mate-core 1.0.0-canary.8 → 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 (244) 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/doctor.ts +17 -0
  14. package/src/cli/commands/report/contract.ts +0 -17
  15. package/src/cli/commands/studio/access.ts +4 -0
  16. package/src/cli/commands/studio/actions.ts +35 -2
  17. package/src/cli/commands/studio/mcp-manager.ts +162 -0
  18. package/src/cli/commands/studio/routes.ts +12 -0
  19. package/src/cli/commands/studio/selection.ts +44 -11
  20. package/src/cli/commands/studio/server.ts +246 -2
  21. package/src/cli/commands/studio/services.ts +26 -0
  22. package/src/cli/commands/studio/terminal-launch.ts +21 -4
  23. package/src/cli/commands/studio/terminal.ts +3 -14
  24. package/src/cli/commands/studio/work-requests.ts +9 -0
  25. package/src/cli/commands/studio/work.ts +473 -0
  26. package/src/cli/commands/vscode/release-vsix.json +2 -2
  27. package/src/cli/commands/working/cleanup.ts +1 -18
  28. package/src/cli/companion-link-wizard.tsx +158 -91
  29. package/src/cli/usage.ts +1 -1
  30. package/src/create-mate.ts +4 -1
  31. package/src/lib/agent-credential.ts +131 -0
  32. package/src/lib/credential-kinds.ts +7 -0
  33. package/src/lib/delivery/merge-git.ts +16 -0
  34. package/src/lib/delivery/record-delivery.ts +12 -6
  35. package/src/lib/delivery/record.ts +5 -0
  36. package/src/lib/delivery/refresh.ts +34 -6
  37. package/src/lib/delivery/staging/refs.ts +9 -4
  38. package/src/lib/delivery/staging/submit.ts +81 -22
  39. package/src/lib/mcp-manager/resolve.ts +88 -0
  40. package/src/lib/mcp-manager/store.ts +133 -0
  41. package/src/lib/mcp-manager/types.ts +72 -0
  42. package/src/lib/mcp-manager/validate.ts +242 -0
  43. package/src/lib/opencode-server.ts +2 -17
  44. package/src/lib/orchestrator/config-store.ts +30 -7
  45. package/src/lib/orchestrator/engine-floor.ts +16 -4
  46. package/src/lib/orchestrator/engine-guard.ts +7 -1
  47. package/src/lib/orchestrator/repo-local-store.ts +14 -0
  48. package/src/lib/orchestrator/repository-link.ts +80 -52
  49. package/src/lib/orchestrator/root-context.ts +17 -1
  50. package/src/lib/orchestrator/types.ts +4 -0
  51. package/src/lib/studio-chat/agent.ts +139 -0
  52. package/src/lib/studio-chat/companion-context.ts +136 -0
  53. package/src/lib/studio-chat/credential.ts +79 -0
  54. package/src/lib/studio-chat/harness-chat-agent.ts +334 -0
  55. package/src/lib/studio-chat/host-sandbox.ts +578 -0
  56. package/src/lib/studio-chat/prepare-bridges.ts +95 -0
  57. package/src/lib/studio-chat/session.ts +15 -0
  58. package/src/lib/studio-chat/turns.ts +112 -0
  59. package/src/lib/workset/claims.ts +85 -0
  60. package/src/lib/workset/execution.ts +71 -0
  61. package/src/lib/workset/git-transaction.ts +74 -0
  62. package/src/lib/workset/groups.ts +176 -0
  63. package/src/lib/workset/inventory.ts +196 -0
  64. package/src/lib/workset/projection.ts +237 -0
  65. package/src/lib/workset/record.ts +101 -36
  66. package/src/lib/workset/repositories.ts +24 -0
  67. package/src/lib/workset/sharing.ts +951 -0
  68. package/src/lib/workset/stages.ts +50 -14
  69. package/src/lib/workset/transactions.ts +158 -0
  70. package/src/runtime/companion-git-state.ts +1 -0
  71. package/src/runtime/companion-guidance.ts +2 -2
  72. package/src/runtime/forge-remote.ts +6 -0
  73. package/src/runtime/host-process.ts +28 -0
  74. package/src/runtime/secret-guard.ts +18 -1
  75. package/src/runtime/secret-patterns.ts +4 -3
  76. package/src/runtime/submitted-arrivals.ts +28 -2
  77. package/src/runtime/workflow/turn.ts +14 -12
  78. package/src/runtime/write-atomic.ts +2 -2
  79. package/src/studio.ts +61 -0
  80. package/src/templates/capabilities/openspec-cap/mate-full/schema.yaml +1 -1
  81. package/src/templates/capabilities/openspec-cap/mate-full/templates/proposal.md +1 -1
  82. package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +3 -2
  83. package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +5 -3
  84. package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +3 -2
  85. package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +5 -3
  86. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +12 -12
  87. package/src/tools/setup/capabilities/mcp-manager.ts +73 -0
  88. package/src/tools/setup/context-services.ts +35 -6
  89. package/src/tools/setup/dynamic-plugins/audiences.ts +3 -2
  90. package/src/tools/setup/dynamic-plugins/declarations.ts +0 -26
  91. package/src/tools/setup/engine.ts +55 -3
  92. package/src/tools/setup/plugin.ts +14 -0
  93. package/src/tools/setup/plugins/gitignore.ts +1 -0
  94. package/src/tools/setup/providers/claude-format.ts +40 -7
  95. package/src/tools/setup/providers/claude.ts +38 -3
  96. package/src/tools/setup/providers/opencode-format.ts +13 -3
  97. package/src/tools/setup/providers/opencode.ts +7 -18
  98. package/src/tools/setup/providers/relative-path-warnings.ts +26 -0
  99. package/studio-dist/THIRD-PARTY-NOTICES.md +297 -0
  100. package/studio-dist/client/THIRD-PARTY-LICENSES.md +4294 -0
  101. package/studio-dist/client/assets/DialogTitle-DOhjDa7H.js +1 -0
  102. package/studio-dist/client/assets/app-CG3vCgyA.css +2 -0
  103. package/studio-dist/client/assets/bundle-mjs-CdK3cBzO.js +1 -0
  104. package/studio-dist/client/assets/button-upSzkd-q.js +1 -0
  105. package/studio-dist/client/assets/chat-DbaMXb8H.js +157 -0
  106. package/studio-dist/client/assets/cn-BCnYnarL.js +1 -0
  107. package/studio-dist/client/assets/combobox-cP9OsRf2.js +1 -0
  108. package/studio-dist/client/assets/{companion-view-C_N237bf.js → companion-view-B54_Lj0S.js} +1 -1
  109. package/studio-dist/client/assets/fields-DNZ4a89M.js +1 -0
  110. package/studio-dist/client/assets/friction-DgEimeDB.js +1 -0
  111. package/studio-dist/client/assets/getting-started-BTfYCt5s.js +1 -0
  112. package/studio-dist/client/assets/{getting-started-djaQeWlu.js → getting-started-CAszmdDJ.js} +1 -1
  113. package/studio-dist/client/assets/getting-started._topic-CHJMf0pa.js +1 -0
  114. package/studio-dist/client/assets/getting-started.index-MR6HftWs.js +1 -0
  115. package/studio-dist/client/assets/{graph-canvas-ySGKMhmk.js → graph-canvas-BdNk2F9O.js} +1 -1
  116. package/studio-dist/client/assets/graph-hRijsC89.js +2 -0
  117. package/studio-dist/client/assets/guides-CwFnh08E.js +1 -0
  118. package/studio-dist/client/assets/highlighted-body-JLMTFACH-BcroQey-.js +1 -0
  119. package/studio-dist/client/assets/index-D5oGyvG8.js +41 -0
  120. package/studio-dist/client/assets/{markdown-view-jMiaBTSO.js → markdown-view-CJ8JsLb7.js} +1 -1
  121. package/studio-dist/client/assets/marked.esm-vFuq1cCd.js +65 -0
  122. package/studio-dist/client/assets/mcp-BE9M-bkO.js +4 -0
  123. package/studio-dist/client/assets/mermaid-WFAXDIZX-BjSsakrn.js +1 -0
  124. package/studio-dist/client/assets/panel-CDQ6Lryw.js +1 -0
  125. package/studio-dist/client/assets/plugins._service._view-DRVPUAWN.js +1 -0
  126. package/studio-dist/client/assets/{prepaint-CKsXyJOR.js → prepaint-sD_LlrDN.js} +1 -1
  127. package/studio-dist/client/assets/{queries-Dfp5deWj.js → queries-COL925ML.js} +1 -1
  128. package/studio-dist/client/assets/react-dom-K3Hp2Cdj.js +1 -0
  129. package/studio-dist/client/assets/{react-BYUSgtBs.js → react-h2xQ_NSp.js} +1 -1
  130. package/studio-dist/client/assets/reports-BClsojkb.js +1 -0
  131. package/studio-dist/client/assets/routes-CJQ2MAej.js +1 -0
  132. package/studio-dist/client/assets/search-DhWdEiKT.js +1 -0
  133. package/studio-dist/client/assets/select-B2FsN9FY.js +1 -0
  134. package/studio-dist/client/assets/skills-SoUHk77W.js +1 -0
  135. package/studio-dist/client/assets/{specs-BrCOjOch.js → specs-C_tZnAvF.js} +1 -1
  136. package/studio-dist/client/assets/specs-view-C6t3Y5IT.js +1 -0
  137. package/studio-dist/client/assets/steps-CF3-Zpmh.js +1 -0
  138. package/studio-dist/client/assets/{store-C3vJq8Wj.js → store-pY9gU4uS.js} +1 -1
  139. package/studio-dist/client/assets/studio-X7bnFrRe.js +36 -0
  140. package/studio-dist/client/assets/studio-queries-CKtAnIKP.js +2 -0
  141. package/studio-dist/client/assets/usage-BaaqUpTG.js +55 -0
  142. package/studio-dist/client/assets/useAnchoredPopupScrollLock-BspHR7Wt.js +1 -0
  143. package/studio-dist/client/assets/useBlocker-BQOfcu_f.js +1 -0
  144. package/studio-dist/client/assets/useMutation-DKeEoP5S.js +1 -0
  145. package/studio-dist/client/assets/useOpenInteractionType-CtaZCaFT.js +1 -0
  146. package/studio-dist/client/assets/usePopupHandleStore-Bc7Q4bnF.js +1 -0
  147. package/studio-dist/client/assets/vault-sAPFUnPN.js +1 -0
  148. package/studio-dist/client/assets/{warnings-CqOOGlPD.js → warnings-D7YY1HSG.js} +1 -1
  149. package/studio-dist/client/assets/work-BZek_LGB.js +5 -0
  150. package/studio-dist/client/assets/workflow-N5boHXFz.js +1 -0
  151. package/studio-dist/server/THIRD-PARTY-LICENSES.md +4371 -0
  152. package/studio-dist/server/assets/DialogTitle-DnKSl2V0.js +421 -0
  153. package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-gVfW5vIV.js → __23tanstack-start-server-fn-resolver-Bli9bpSB.js} +38 -18
  154. package/studio-dist/server/assets/_tanstack-start-manifest_v.js +91 -59
  155. package/studio-dist/server/assets/{actions-D8erOphH.js → actions-CHEFA1i9.js} +33 -1
  156. package/studio-dist/server/assets/{cn-FXJAM0KO.js → bundle-mjs-Ot6dQ8Pq.js} +1 -2056
  157. package/studio-dist/server/assets/{button-D6bvrFmm.js → button-BqA1urbl.js} +14 -7
  158. package/studio-dist/server/assets/chat-zl332Tvu.js +49486 -0
  159. package/studio-dist/server/assets/cn-B0fl6NWK.js +2057 -0
  160. package/studio-dist/server/assets/{combobox-D2MbYV1O.js → combobox-iTjvPCtS.js} +7 -6
  161. package/studio-dist/server/assets/{companion-view-Mf1ANbMb.js → companion-view-DIQ6AFIY.js} +2 -2
  162. package/studio-dist/server/assets/{companions-Dr6IpNAb.js → companions-aVwjRL8j.js} +1 -1
  163. package/studio-dist/server/assets/{fields-B4mAPETz.js → fields-BMap2_Ju.js} +10 -3
  164. package/studio-dist/server/assets/{friction-CWOTjpCV.js → friction-BER50hoD.js} +2 -2
  165. package/studio-dist/server/assets/{friction-9a5S1m7U.js → friction-BPs9KWdq.js} +8 -8
  166. package/studio-dist/server/assets/{getting-started-RU6tYU2Q.js → getting-started-DGfRVmZ_.js} +2 -2
  167. package/studio-dist/server/assets/{getting-started._topic-C02HGrC6.js → getting-started._topic-BgrBA4Vj.js} +2 -2
  168. package/studio-dist/server/assets/{getting-started.index-EzLRosbb.js → getting-started.index-BaFfQ9Mn.js} +2 -2
  169. package/studio-dist/server/assets/{graph-CZ2H9Fzr.js → graph-Cgzlrv3P.js} +8 -8
  170. package/studio-dist/server/assets/{graph-B11ITte0.js → graph-DODpuOy_.js} +1 -1
  171. package/studio-dist/server/assets/{graph-canvas-rP5TT14Z.js → graph-canvas-DW_zU1nA.js} +2 -2
  172. package/studio-dist/server/assets/{guides-BGftp4wf.js → guides-CA_EMG7E.js} +1 -1
  173. package/studio-dist/server/assets/{guides-B8HdeK_C.js → guides-D0SpoD32.js} +1 -1
  174. package/studio-dist/server/assets/{guides.server-DqFQAStf.js → guides.server-DJjQuy03.js} +1 -1
  175. package/studio-dist/server/assets/highlighted-body-JLMTFACH-BeHllu-r.js +41 -0
  176. package/studio-dist/server/assets/{markdown-view-CArpV-CS.js → markdown-view-CvVBGMZV.js} +1 -1
  177. package/studio-dist/server/assets/mcp-BU0fLYyJ.js +1103 -0
  178. package/studio-dist/server/assets/mcp-manager-D9YctTQe.js +50 -0
  179. package/studio-dist/server/assets/mermaid-WFAXDIZX-B1yDN6vG.js +1 -0
  180. package/studio-dist/server/assets/{panel-DR0iq46J.js → panel-D1K6Bsux.js} +4 -32
  181. package/studio-dist/server/assets/{plugins._service._view-n7u2k5dF.js → plugins._service._view-DdO1nELF.js} +4 -4
  182. package/studio-dist/server/assets/{prepaint-B28ClcPN.js → prepaint-BB3dwSmz.js} +1 -1
  183. package/studio-dist/server/assets/{queries-D-yVP9i0.js → queries-BwiDxQy5.js} +1 -1
  184. package/studio-dist/server/assets/{react-CiBZPDs8.js → react-B2cLiz-i.js} +1 -1
  185. package/studio-dist/server/assets/{reports-C2SmTgqh.js → reports-9Pr7Bz6o.js} +7 -7
  186. package/studio-dist/server/assets/{reports-B9k98oE6.js → reports-Cc9M3phM.js} +1 -1
  187. package/studio-dist/server/assets/{router-CPt0TAk_.js → router-DcWe0J7Y.js} +827 -548
  188. package/studio-dist/server/assets/{routes-CwH8LEy2.js → routes-BEXxl0py.js} +8 -8
  189. package/studio-dist/server/assets/{search-b-yQesv3.js → search-bltT7gwy.js} +39 -7
  190. package/studio-dist/server/assets/{select-C3i6TTX-.js → select-CZvHgGCi.js} +7 -6
  191. package/studio-dist/server/assets/{shell-CagqZZMZ.js → shell-BQ0vMKXN.js} +13 -4
  192. package/studio-dist/server/assets/{skills-DGg0mWDM.js → skills-Be_52h0i.js} +1 -1
  193. package/studio-dist/server/assets/{skills-C21Mg_8-.js → skills-BpGGUl6L.js} +8 -8
  194. package/studio-dist/server/assets/{specs-DetoMiaB.js → specs-CCGgXE-V.js} +5 -5
  195. package/studio-dist/server/assets/{specs-view-CmbfLDwN.js → specs-view-DtL5JxYM.js} +12 -11
  196. package/studio-dist/server/assets/{steps-D1tYAyWZ.js → steps-BWFSO6dM.js} +1 -1
  197. package/studio-dist/server/assets/{store-aC-I6f6o.js → store-X7yLPp7v.js} +1 -1
  198. package/studio-dist/server/assets/{studio-queries-Dqf-3nzj.js → studio-queries-ur1ygXi3.js} +117 -13
  199. package/studio-dist/server/assets/{studio-qRvQjRpz.js → studio-qzH-UETC.js} +1555 -179
  200. package/studio-dist/server/assets/{usage-Cwle9-xY.js → usage-C1o0DLzS.js} +1 -1
  201. package/studio-dist/server/assets/{usage-CS4CBK9D.js → usage-DWbSPrPD.js} +10 -9
  202. package/studio-dist/server/assets/{useAnchoredPopupScrollLock-BjMNgXv9.js → useAnchoredPopupScrollLock-DLDmv6kM.js} +4 -135
  203. package/studio-dist/server/assets/useBlocker-CQtANHK8.js +111 -0
  204. package/studio-dist/server/assets/{useMutation-DpBIuWXt.js → useMutation-NjlA8oFY.js} +2 -2
  205. package/studio-dist/server/assets/useOpenInteractionType-CZYscfOb.js +136 -0
  206. package/studio-dist/server/assets/usePopupHandleStore-DEEXJYv0.js +26 -0
  207. package/studio-dist/server/assets/{vault-CEBBRLMb.js → vault-B_kfi1h-.js} +1 -1
  208. package/studio-dist/server/assets/{vault-DVQidlId.js → vault-dL79JlKH.js} +8 -115
  209. package/studio-dist/server/assets/{views-UgO0Qz_g.js → views-BSGH56lb.js} +3 -3
  210. package/studio-dist/server/assets/{warnings-C7hgXpdk.js → warnings-DtUVPV-k.js} +2 -2
  211. package/studio-dist/server/assets/work-D789VXGH.js +110 -0
  212. package/studio-dist/server/assets/work-DsCEfhmK.js +3817 -0
  213. package/studio-dist/server/assets/work-requests-BLhOmQFO.js +11 -0
  214. package/studio-dist/server/assets/{workflow-6dZZ1ofw.js → workflow-BOZ2sRYg.js} +9 -9
  215. package/studio-dist/server/server.js +3 -3
  216. package/wrappers/bin/openspec +87 -2
  217. package/studio-dist/client/assets/app-ggXJ_QVh.css +0 -2
  218. package/studio-dist/client/assets/button-amJ3g5oD.js +0 -1
  219. package/studio-dist/client/assets/cn-BQPKiwI4.js +0 -1
  220. package/studio-dist/client/assets/combobox-CJ7aGFid.js +0 -1
  221. package/studio-dist/client/assets/fields-BAiGkJ5N.js +0 -1
  222. package/studio-dist/client/assets/friction-DqOU59v7.js +0 -1
  223. package/studio-dist/client/assets/getting-started-yp42dj5S.js +0 -1
  224. package/studio-dist/client/assets/getting-started._topic-C9zVXz_m.js +0 -1
  225. package/studio-dist/client/assets/getting-started.index-DWbDKICP.js +0 -1
  226. package/studio-dist/client/assets/graph-BYaD_5Bq.js +0 -2
  227. package/studio-dist/client/assets/guides-D6T6W_jV.js +0 -1
  228. package/studio-dist/client/assets/index-Qx7reRPD.js +0 -40
  229. package/studio-dist/client/assets/panel-C4bf_h2W.js +0 -1
  230. package/studio-dist/client/assets/plugins._service._view-y6f2FDAB.js +0 -1
  231. package/studio-dist/client/assets/reports-JFSwSueq.js +0 -1
  232. package/studio-dist/client/assets/routes-BdOWSgzK.js +0 -1
  233. package/studio-dist/client/assets/search-CXosfvYh.js +0 -1
  234. package/studio-dist/client/assets/select-BHYYWPhK.js +0 -1
  235. package/studio-dist/client/assets/skills-Bo9FLsBd.js +0 -1
  236. package/studio-dist/client/assets/specs-view-CdE2rlli.js +0 -1
  237. package/studio-dist/client/assets/steps-CKUno4lh.js +0 -1
  238. package/studio-dist/client/assets/studio-0ueISxwP.js +0 -100
  239. package/studio-dist/client/assets/studio-queries-BflKt9va.js +0 -2
  240. package/studio-dist/client/assets/usage-BLsLy0nN.js +0 -55
  241. package/studio-dist/client/assets/useAnchoredPopupScrollLock-DC7f8GOp.js +0 -1
  242. package/studio-dist/client/assets/useMutation-uJUrejsi.js +0 -1
  243. package/studio-dist/client/assets/vault-BB1B_OhR.js +0 -1
  244. package/studio-dist/client/assets/workflow-BFzmI-06.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{$ as r,F as i,I as a,J as o,L as s,Q as c,R as l,U as u,W as d,X as f,at as p,et as m,it as h,nt as g,rt as _,tt as v,z as y}from"./studio-queries-CKtAnIKP.js";import{n as b,t as x}from"./bundle-mjs-CdK3cBzO.js";var S=e(t(),1),C=n(),w=S.createContext(void 0),T=e=>{let t=S.useContext(w);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},E=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,C.jsx)(w.Provider,{value:e,children:t})),D=()=>u,O=()=>D(),k=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},A=new class extends k{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},j=h;function M(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=j,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var N=M(),P=new class extends k{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function F(e){return Math.min(1e3*2**e,3e4)}function I(e){return(e??`online`)!==`online`||P.isOnline()}var L=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function R(e){let t=!1,n=0,r,i=`pending`,a,s,c=new Promise((e,t)=>{a=e,s=t});c.catch(o);let l=()=>i!==`pending`,u=t=>{if(!l()){let n=new L(t);_(n),e.onCancel?.(n)}},d=()=>{t=!0},f=()=>{t=!1},p=()=>A.isFocused()&&(e.networkMode===`always`||P.isOnline())&&e.canRun(),m=()=>I(e.networkMode)&&e.canRun(),h=e=>{l()||(r?.(),i=`resolved`,a(e))},_=e=>{l()||(r?.(),i=`rejected`,s(e))},v=t=>new Promise(n=>{r=e=>{(l()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,l()||e.onContinue?.()}),y=()=>{if(l())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(h).catch(r=>{if(l())return;let i=e.retry??(O()?0:3),a=e.retryDelay??F,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?_(r):(n++,e.onFail?.(n,r),g(o).then(()=>l()||p()?void 0:v(p)).then(()=>{t?_(r):y()}))})};return{promise:c,status:()=>i,cancel:u,continue:()=>(r?.(),c),cancelRetry:d,continueRetry:f,canStart:m,start:()=>(m()?y():v(m).then(y),c)}}var z=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),d(this.gcTime)&&(this.#e=p.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(O()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(p.clearTimeout(this.#e),this.#e=void 0)}};function B(e){return{onFetch:(t,n)=>{let r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],u=t.state.data?.pageParams||[],d={pages:[],pageParams:[]},f=0,p=async()=>{let n=!1,p=t,m=e=>{i(e,()=>t.signal,()=>n=!0,p[y])},h=l(t.options,t.fetchOptions),g=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let o=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return m(e),e})(),c=await h(o),{maxPages:l}=t.options,u=i?s:a;return{pages:u(e.pages,c,l),pageParams:u(e.pageParams,r,l)}};if(o&&c.length){let e=o===`backward`,t=e?H:V,n={pages:c,pageParams:u};d=await g(n,t(r,n),e)}else{let t=e??c.length;do{let e=f===0?u[0]===void 0?r.initialPageParam:u[0]:V(r,d);if(f>0&&e==null)break;d=await g(d,e),f++}while(f<t)}return d};t.fetchFn=t.options.persister?()=>t.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):p}}}function V(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function H(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var U=class extends z{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=K(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=K(this.options);e.data!==void 0&&(this.setState(G(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=f(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(o).catch(o):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>c(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===v||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>c(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!_(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[y]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=l(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?B(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=R({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof L&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof L){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.scheduleGc()}})();return this.#o=s,o.start(),s}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...W(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...G(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),N.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function W(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function G(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function K(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var q=class extends k{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Y(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return X(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return X(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof c(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!r(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let i=this.hasListeners();i&&Z(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),i&&(this.#t!==n||c(this.options.enabled,this.#t)!==c(t.enabled,this.#t)||c(this.options.staleTime,this.#t)!==c(t.staleTime,this.#t))&&this.#g();let a=this.#_();i&&(this.#t!==n||c(this.options.enabled,this.#t)!==c(t.enabled,this.#t)||a!==this.#f)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return r(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(o)),t}#h(e){return!O()&&c(this.options.enabled,this.#t)!==!1&&d(e)}#g(){this.#b();let e=c(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=_(this.#r.dataUpdatedAt,e)+1;this.#u=p.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return c(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=p.setInterval(()=>{(this.options.refetchIntervalInBackground||A.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(p.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(p.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:l}=e,u={...l},d=!1,p;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Y(e,t),o=i&&Z(e,n,t,r);(a||o)&&(u={...u,...W(l.data,e.options)}),t._optimisticResults===`isRestoring`&&(u.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:h,status:g}=u;p=u.data;let _=!1;if(t.placeholderData!==void 0&&p===void 0&&g===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,_=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(g=`success`,p=f(i?.data,e,t),d=!0)}if(t.select&&p!==void 0&&!_){if(i&&p===a?.data&&t.select===this.#s)p=this.#c;else try{this.#s=t.select,p=t.select(p),p=f(i?.data,p,t),this.#c=p,this.#o=null}catch(e){this.#o=e}}else p===void 0&&(this.#o=null);this.#o&&(m=this.#o,p=this.#c,h=Date.now(),g=`error`,d=!1);let v=u.fetchStatus===`fetching`,y=g===`pending`,b=g===`error`,x=y&&v,S=p!==void 0;return{status:g,fetchStatus:u.fetchStatus,isPending:y,isSuccess:g===`success`,isError:b,isInitialLoading:x,isLoading:x,data:p,dataUpdatedAt:u.dataUpdatedAt,error:m,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>s.dataUpdateCount||u.errorUpdateCount>s.errorUpdateCount,isFetching:v,isRefetching:v&&!y,isLoadingError:b&&!S,isPaused:u.fetchStatus===`paused`,isPlaceholderData:d,isRefetchError:b&&S,isStale:Q(e,t),refetch:this.refetch,isEnabled:c(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),r(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();N.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function J(e,t){return c(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||c(t.retryOnMount,e)!==!1)}function Y(e,t){return J(e,t)||e.state.data!==void 0&&X(e,t,t.refetchOnMount)}function X(e,t,n){if(c(t.enabled,e)!==!1&&c(t.staleTime,e)!==`static`){let r=c(n,e);return r===`always`||r!==!1&&Q(e,t)}return!1}function Z(e,t,n,r){return(e!==t||c(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Q(e,n)}function Q(e,t){return c(t.enabled,e)!==!1&&e.isStaleByTime(c(t.staleTime,e))}var $=S.createContext(!1),ee=()=>S.useContext($);$.Provider;function te(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ne=S.createContext(te()),re=()=>S.useContext(ne),ie=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?m(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},ae=e=>{S.useEffect(()=>{e.clearReset()},[e])},oe=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||m(n,[e.error,r])),se=(e,t)=>t.state.data===void 0,ce=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},le=(e,t)=>e?.suspense&&t.isPending,ue=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function de(e,t,n){let r=ee(),i=re(),a=T(n),s=a.defaultQueryOptions(e),c=a.getQueryCache().get(s.queryHash),l=e.subscribed!==!1;s._optimisticResults=r?`isRestoring`:l?`optimistic`:void 0,ce(s),ie(s,i,c),ae(i);let[u]=S.useState(()=>new t(a,s)),d=u.getOptimisticResult(s);S.useEffect(()=>{u.setOptions(s)},[s,u]);let f=!r&&l;if(S.useSyncExternalStore(S.useCallback(e=>{let t=f?u.subscribe(N.batchCalls(e)):o;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),le(s,d))throw ue(s,u,i);if(oe({result:d,errorResetBoundary:i,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw d.error;return s.notifyOnChangeProps?d:u.trackResult(d)}function fe(...e){return x(b(e))}export{U as a,P as c,k as d,E as f,q as i,N as l,de as n,z as o,T as p,se as r,R as s,fe as t,A as u};
@@ -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,Gn as a,Jn as o,L as s,Ln as c,M as l,On as u,Or as d,Qt as f,S as p,Y as m,Yn as h,ar as g,br as _,cn as v,cr as y,lr as b,nn as x,nr as S,or as C,r as w,sr as T,vn as E}from"./button-upSzkd-q.js";import{h as D,l as O,o as k,s as A,u as j,v as M,y as N}from"./fields-DNZ4a89M.js";import{r as ee}from"./useOpenInteractionType-CtaZCaFT.js";import{t as P}from"./useAnchoredPopupScrollLock-BspHR7Wt.js";import{C as te,S as ne,i as F,n as I,p as L,r as R,t as re,u as z,x as ie}from"./select-B2FsN9FY.js";import{Ct as B,Tt as ae,at as V,ct as oe,dt as se,ft as ce,gt as H,ht as le,it as ue,lt as U,mt as W,nt as de,ot as G,pt as fe,rt as pe,st as me,tt as K,ut as he,wt as ge}from"./index-D5oGyvG8.js";var q=e(t(),1),_e=q.forwardRef(function(e,t){let{render:n,className:r,nativeButton:a=!0,disabled:s=!1,id:l,style:p,..._}=e,{state:v,disabled:y,setTouched:x,validationMode:w,validation:T}=D(),{labelId:E}=j(),k=H(),M=k.useState(`selectionMode`),N=k.useState(`disabled`),P=k.useState(`readOnly`),F=k.useState(`required`),I=k.useState(`positionerElement`),L=k.useState(`listElement`),R=k.useState(`popupId`),re=k.useState(`triggerProps`),z=k.useState(`inputInsidePopup`),B=k.useState(`id`),ae=k.useState(`labelId`),V=k.useState(`open`),oe=k.useState(`selectedValue`),ce=k.useState(`activeIndex`),ue=k.useState(`selectedIndex`),de=k.useState(`hasSelectedValue`),G=W(),pe=le(),me=m(),K=y||N||s,ge=U(),_e=he(k),J=q.useRef(null),Y=A(K,J);O({id:z?l:void 0});let X=z?l??B:l,ve=ie(E,ae),Z;V&&z?Z=R??fe(B):V&&(Z=L?.id);let Q=q.useRef(``);function $(e){Q.current=e.pointerType}let{reference:ye}=te(G,{enabled:!V&&!P&&!N&&M===`single`,listRef:k.context.labelsRef,activeIndex:ce,selectedIndex:ue,onMatch(e){let t=k.context.valuesRef.current[e];t!==void 0&&k.context.setSelectedValue(t,S(h))}}),{reference:be}=ee(G,{enabled:!N,event:`mousedown`}),{buttonRef:xe,getButtonProps:Se}=g({native:a,disabled:K}),Ce={...v,readOnly:P,open:V,disabled:K,popupSide:_e,listEmpty:ge,placeholder:M!==`none`&&!de},we=b(e=>{k.set(`triggerElement`,e)});return d(`button`,e,{ref:[t,xe,J,we],state:Ce,props:[re,be,ye,{id:X,tabIndex:z?0:-1,role:z?`combobox`:void 0,"aria-expanded":V,"aria-haspopup":z?`dialog`:`listbox`,"aria-controls":Z,"aria-required":z&&F||void 0,"aria-readonly":z&&P||void 0,"aria-labelledby":ve,onPointerDown:$,onPointerEnter:$,onFocus(){Y(!0),K||me.start(0,k.context.forceMount)},onBlur(e){if(!i(I,e.relatedTarget)&&(x(!0),Y(!1),w===`onBlur`)){let e=M===`none`?pe:oe;T.commit(e)}},onMouseDown(e){if(K||(z||G.set(`domReferenceElement`,e.currentTarget),k.context.forceMount(),Q.current!==`touch`&&(k.context.inputRef.current?.focus(),z||e.preventDefault()),V))return;let t=C(e.currentTarget);function n(e){let t=k.state.triggerElement;if(!t)return;let n=u(e),r=k.state.positionerElement,a=k.state.listElement;i(t,n)||i(r,n)||i(a,n)||ne(e,t)||k.context.setOpen(!1,S(c,e))}z&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(f(e),k.context.setOpen(!0,S(o,e.nativeEvent)),k.context.inputRef.current?.focus())}},T.getValidationProps(K,_),Se],stateAttributesMapping:se})});function J(e,t,n,r){if(e.baseUIHandlerPrevented)return;let i=u(e.nativeEvent),o=_(i)?i:null;(o===e.currentTarget||!r?.(o)&&!x(o))&&(e.preventDefault(),n||(t.context.inputRef.current?.focus(),t.state.openOnInputClick&&t.context.setOpen(!0,S(a,e.nativeEvent))))}var Y=q.forwardRef(function(e,t){let{render:n,className:r,style:a,...o}=e,{state:s}=D(),c=H(),l=c.useState(`open`),u=c.useState(`disabled`),f=c.useState(`readOnly`),p=c.useState(`hasSelectedValue`),m=c.useState(`selectionMode`),h=he(c),g=u,_=U(),v=m!==`none`&&!p,y={...s,open:l,disabled:g,readOnly:f,popupSide:h,listEmpty:_,placeholder:v},x=b(e=>{c.set(`inputGroupElement`,e)});return d(`div`,e,{ref:[t,x],props:[{role:`group`,onMouseDown(e){J(e,c,g,e=>i(c.context.chipsContainerRef.current,e))}},o],state:y,stateAttributesMapping:se})}),X=q.createContext(void 0);function ve(){let e=q.useContext(X);if(e===void 0)throw Error(T(20));return e}var Z=n(),Q=q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=H(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,Z.jsx)(X.Provider,{value:n,children:(0,Z.jsx)(l,{ref:t,...r})}):null}),$=q.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=s,style:_,...v}=e,x=H(),S=W(),C=ve(),w=x.useState(`modal`),T=x.useState(`open`),E=x.useState(`mounted`),D=x.useState(`openMethod`),O=x.useState(`positionerElement`),A=x.useState(`triggerElement`),j=x.useState(`inputElement`),N=x.useState(`inputGroupElement`),ee=x.useState(`inputInsidePopup`),te=x.useState(`transitionStatus`),ne=U(),F=ae({anchor:i??(ee?A:N??j),floatingRootContext:S,positionMethod:a,mounted:E,side:o,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:C,collisionAvoidance:g,lazyFlip:!0});P(T&&w,D===`touch`,O,A);let I={open:T,side:F.side,align:F.align,anchorHidden:F.anchorHidden,empty:ne};y(()=>{x.set(`popupSide`,F.side)},[x,F.side]);let L=b(e=>{x.set(`positionerElement`,e)}),R=B(e,I,{styles:F.positionerStyles,transitionStatus:te,props:v,refs:[t,L],hidden:!E,inert:!T});return(0,Z.jsxs)(me.Provider,{value:F,children:[E&&w&&(0,Z.jsx)(k,{inert:M(!T),cutout:N??j??A}),R]})}),ye={...v,...E},be=q.forwardRef(function(e,t){let{render:n,className:r,style:a,initialFocus:o,finalFocus:s,...c}=e,l=H(),f=oe(),m=W(),h=l.useState(`mounted`),g=l.useState(`open`),_=l.useState(`openMethod`),v=l.useState(`popupProps`),b=l.useState(`transitionStatus`),x=l.useState(`inputInsidePopup`),S=l.useState(`inputElement`),C=l.useState(`modal`),w=l.useState(`id`),T=U(),E=c.id??(x?fe(w):void 0);y(()=>(l.set(`popupId`,l.context.popupRef.current?.id||E),()=>{l.set(`popupId`,void 0)}),[l,E]),p({open:g,ref:l.context.popupRef,onComplete(){g&&l.context.onOpenChangeComplete(!0)}});let D={open:g,side:f.side,align:f.align,anchorHidden:f.anchorHidden,transitionStatus:b,empty:T},O=d(`div`,e,{state:D,ref:[t,l.context.popupRef],props:[v,{id:E,role:x?`dialog`:`presentation`,onFocus(e){let t=u(e.nativeEvent);_!==`touch`&&(i(l.state.listElement,t)||t===e.currentTarget)&&l.context.inputRef.current?.focus()}},ge(b),c],stateAttributesMapping:ye}),k=o===void 0?x?e=>e===`touch`?l.context.popupRef.current:S:!1:o,A;A=s??(x?void 0:!1);let j=!x||C;return(0,Z.jsx)(N,{context:m,disabled:!h,modal:j,openInteractionType:_,initialFocus:k,returnFocus:A,getInsideElements:()=>[l.context.startDismissRef.current,l.context.endDismissRef.current],children:(0,Z.jsxs)(q.Fragment,{children:[O,j&&(0,Z.jsx)(G,{ref:l.context.endDismissRef})]})})});function xe(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,Z.jsx)(ce,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}var Se=q.forwardRef(function(e,t){let{selected:n}=pe();return e.keepMounted||n?(0,Z.jsx)(L,{...e,selected:n,ref:t}):null}),Ce=xe;function we({className:e,...t}){return(0,Z.jsxs)(Y,{"data-slot":`combobox-input-group`,className:r(`relative flex items-center`,e),children:[(0,Z.jsx)(V,{"data-slot":`combobox-input`,className:r(z,`placeholder:text-muted focus:border-accent`),...t}),(0,Z.jsx)(_e,{"data-slot":`combobox-trigger`,"aria-label":`Show options`,className:`absolute inset-y-0 right-0 flex w-9 items-center justify-center outline-none`,children:(0,Z.jsx)(w,{name:`chevron`,className:re})})]})}function Te({className:e,...t}){return(0,Z.jsx)(Q,{children:(0,Z.jsx)($,{sideOffset:6,className:`z-40`,children:(0,Z.jsx)(be,{"data-slot":`combobox-content`,className:r(F,e),...t})})})}var Ee=ue;function De({className:e,...t}){return(0,Z.jsx)(K,{"data-slot":`combobox-empty`,className:r(`px-2.5 py-1.5 text-sm text-muted empty:hidden`,e),...t})}function Oe({className:e,children:t,...n}){return(0,Z.jsxs)(de,{"data-slot":`combobox-item`,className:r(I,e),...n,children:[(0,Z.jsx)(`span`,{className:`truncate`,children:t}),(0,Z.jsx)(Se,{className:R,children:(0,Z.jsx)(w,{name:`check`,className:`size-4`})})]})}export{Oe as a,we as i,Te as n,Ee as o,De as r,Ce as t};
@@ -1 +1 @@
1
- import{lt as e}from"./index-Qx7reRPD.js";import{a as t}from"./studio-queries-BflKt9va.js";import{t as n}from"./jsx-runtime-MZURdZre.js";var r=n();function i({companionPath:e,reason:t}){return(0,r.jsxs)(`section`,{className:`error mx-8 grid gap-1.5 rounded-card border border-[color-mix(in_srgb,var(--bad)_40%,var(--border))] bg-bad-soft px-5 py-4 max-sm:mx-4`,children:[(0,r.jsx)(`h2`,{className:`m-0 text-md font-semibold text-bad`,children:`Could not read this companion`}),(0,r.jsx)(`p`,{className:`m-0 font-mono text-xs break-all`,children:e}),(0,r.jsx)(`p`,{className:`m-0 text-sm`,children:t})]})}function a({view:n,search:a,children:o}){let{data:s}=e(t(n,a));return s.error?(0,r.jsx)(i,{companionPath:s.error.companionPath,reason:s.error.reason}):(0,r.jsx)(r.Fragment,{children:o(s)})}export{a as t};
1
+ import{It as e}from"./index-D5oGyvG8.js";import{o as t}from"./studio-queries-CKtAnIKP.js";import{t as n}from"./jsx-runtime-MZURdZre.js";var r=n();function i({companionPath:e,reason:t}){return(0,r.jsxs)(`section`,{className:`error mx-8 grid gap-1.5 rounded-card border border-[color-mix(in_srgb,var(--bad)_40%,var(--border))] bg-bad-soft px-5 py-4 max-sm:mx-4`,children:[(0,r.jsx)(`h2`,{className:`m-0 text-md font-semibold text-bad`,children:`Could not read this companion`}),(0,r.jsx)(`p`,{className:`m-0 font-mono text-xs break-all`,children:e}),(0,r.jsx)(`p`,{className:`m-0 text-sm`,children:t})]})}function a({view:n,search:a,children:o}){let{data:s}=e(t(n,a));return s.error?(0,r.jsx)(i,{companionPath:s.error.companionPath,reason:s.error.reason}):(0,r.jsx)(r.Fragment,{children:o(s)})}export{a 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{$t as i,B as a,Cr as o,Dn as s,Dt as c,E as l,En as u,Fr as d,G as f,Ir as p,J as m,K as ee,Lr as h,Mr as g,Nn as _,Nr as v,On as y,Or as b,P as x,Pr as S,Qt as te,St as ne,Tn as C,U as w,Vn as re,W as ie,Xt as T,Y as ae,Yn as oe,Zt as se,_t as E,an as ce,bt as le,cr as D,en as ue,gt as de,in as fe,j as pe,jn as me,lr as O,mr as he,nr as ge,or as k,q as A,sr as j,tn as _e,vr as M,vt as ve,wr as N,xr as P,xt as ye,z as be}from"./button-upSzkd-q.js";var F=e(t(),1),I=0;function xe(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(I);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),v;let o=requestAnimationFrame(a);return I=o,()=>{I===o&&(cancelAnimationFrame(o),I=0)}}var L=`data-base-ui-inert`,R=new WeakMap,z=new WeakSet,B=new WeakMap,Se=0;function Ce(e){return e?N(e)?e.host:Ce(e.parentNode):null}var we=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ce(t);return e.contains(n)?n:null}).filter(e=>e!=null),V=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Te=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{he(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function H(e,t,n,{mark:r=!0}){let i=we(t,e),a=r?Te(t,V(i),new Set(i)):[],o=[],s=[];if(n){let e=we(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Te(t,V(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(R.get(e)||0)+1;R.set(e,r),o.push(e),r===1&&n&&z.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(B.get(e)||0)+1;B.set(e,t),s.push(e),t===1&&e.setAttribute(L,``)}),Se+=1,()=>{o.forEach(e=>{let t=(R.get(e)||0)-1;R.set(e,t),t||(z.has(e)||e.removeAttribute(`aria-hidden`),z.delete(e))}),r&&s.forEach(e=>{let t=(B.get(e)||0)-1;B.set(e,t),t||e.removeAttribute(L)}),--Se,Se||(R=new WeakMap,z=new WeakSet,B=new WeakMap)}}function Ee(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=k(e[0]).body;return H(e,i,n,{mark:r})}var U=n();function De(e,t){let n=M(y(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(T(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var W=20,G=[];function Oe(){G=G.filter(e=>e.deref()?.isConnected)}function ke(e){Oe(),e&&he(e)!==`body`&&(G.push(new WeakRef(e)),G.length>W&&(G=G.slice(-20)))}function Ae(){return Oe(),G[G.length-1]?.deref()}function je(e){return e?ye(e)?e:ne(e)[0]||e:null}function Me(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=de(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return ye(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function K(e){let{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:p=!0,explicitReturnFocus:m,restoreFocus:h=!1,modal:g=!0,closeOnFocusOut:_=!0,openInteractionType:v=``,nextFocusableElement:b,previousFocusableElement:S,beforeContentFocusGuardRef:w,externalTree:oe,getInsideElements:de}=e,j=t.useState(`open`),M=t.useState(`domReferenceElement`),N=t.useState(`floatingElement`),{events:I,dataRef:L}=t.context,R=O(()=>L.current.floatingContext?.nodeId),z=o===!1,B=fe(M)&&z,Se=f(o),Ce=f(p),we=f(m),V=f(v),Te=f(j),H=pe(oe),W=x(),G=F.useRef(!1),K=F.useRef(!1),Ne=F.useRef(!1),Pe=F.useRef(null),Fe=F.useRef(``),q=F.useRef(``),J=F.useRef(null),Ie=F.useRef(null),Le=d(J,w,W?.beforeInsideRef),Re=d(Ie,W?.afterInsideRef),ze=ae(),Y=ae(),Be=ie(),Ve=W!=null,X=_e(N),Z=O((e=X)=>e?ne(e):[]),Q=O(()=>de?.().filter(e=>e!=null)??[]);F.useEffect(()=>{if(r||!g)return;function e(e){e.key===`Tab`&&s(X,C(k(X)))&&Z().length===0&&!B&&te(e)}let t=k(X);return A(t,`keydown`,e)},[r,X,g,B,Z]),F.useEffect(()=>{if(r||!j)return;let e=k(X);function t(){Ne.current=!1}function n(e){let t=y(e),n=Q(),r=s(N,t)||s(M,t)||s(W?.portalNode,t)||n.some(e=>e===t||s(e,t));Ne.current=!r,q.current=e.pointerType||`keyboard`,u(t,`[data-base-ui-click-trigger]`)&&(K.current=!0,Y.start(0,()=>{K.current=!1}))}function i(){q.current=`keyboard`}return ee(A(e,`pointerdown`,n,!0),A(e,`pointerup`,t,!0),A(e,`pointercancel`,t,!0),A(e,`keydown`,i,!0),t)},[r,N,M,X,j,W,Y,Q]),F.useEffect(()=>{if(r||!_)return;let e=k(X);function n(){K.current=!0,Y.start(0,()=>{K.current=!1})}function a(e){let t=y(e);ye(t)&&(Pe.current=t)}function o(n){let r=n.relatedTarget,a=n.currentTarget,o=y(n);g&&r==null&&o!=null&&s(N,o)&&ke(o),queueMicrotask(()=>{let u=R(),d=t.context.triggerElements,f=Q(),p=r?.hasAttribute(be(`focus-guard`))&&[J.current,Ie.current,W?.beforeInsideRef.current,W?.afterInsideRef.current,W?.beforeOutsideRef.current,W?.afterOutsideRef.current,l(S),l(b)].includes(r),m=!(s(M,r)||s(N,r)||s(r,N)||s(W?.portalNode,r)||f.some(e=>e===r||s(e,r))||d.hasMatchingElement(e=>s(e,r))||p||H&&(ue(H.nodesRef.current,u).find(e=>s(e.context?.elements.floating,r)||s(e.context?.elements.domReference,r))||i(H.nodesRef.current,u).find(e=>[e.context?.elements.floating,_e(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(a===M&&X&&Me(X),h&&a!==M&&!c(o)&&C(e)===e.body){if(P(X)&&(X.focus(),h===`popup`)){Be.request(()=>{X.focus()});return}let e=Z(),t=Pe.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||X;P(n)&&n.focus()}L.current.insideReactTree?L.current.insideReactTree=!1:(B||!g)&&r&&m&&!K.current&&(B||r!==Ae())&&(G.current=!0,t.setOpen(!1,ge(re,n)))})}function u(){Ne.current||(L.current.insideReactTree=!0,ze.start(0,()=>{L.current.insideReactTree=!1}))}let d=P(M)?M:null;if(N||d)return ee(d&&A(d,`focusout`,o),d&&A(d,`pointerdown`,n),N&&A(N,`focusin`,a),N&&A(N,`focusout`,o),N&&W&&A(N,`focusout`,u,!0))},[r,M,N,X,g,H,W,t,_,h,Z,B,R,L,ze,Y,Be,b,S,Q]),F.useEffect(()=>{if(r||!N||!j)return;let e=Array.from(W?.portalNode?.querySelectorAll(`[${be(`portal`)}]`)||[]),t=(H?i(H.nodesRef.current,R()):[]).find(e=>fe(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Ee([N,...e,J.current,Ie.current,W?.beforeOutsideRef.current,W?.afterOutsideRef.current,...Q(),t,l(S),l(b),B?M:null].filter(e=>e!=null),{ariaHidden:g||B,mark:!1}),a=Ee([N,...e].filter(e=>e!=null));return()=>{a(),n()}},[j,r,M,N,g,W,B,H,R,b,S,Q]),D(()=>{if(!j||r||!P(X))return;Fe.current=``,q.current=``;let e=k(X),t=C(e);queueMicrotask(()=>{let n=Se.current,r=typeof n==`function`?n(V.current||``):n;if(r===void 0||r===!1||s(X,t))return;let i=null,a=()=>(i??=Z(X),i[0]||X),o;o=r===!0||r===null?a():l(r),o||=a();let c=s(X,C(e)),u=L.current.openEvent,d=u?.type===`mousedown`&&T(u);xe(o,{sync:d,preventScroll:o===X,shouldFocus(){if(!Te.current)return!1;if(c)return!0;let t=C(e);return!(t!==o&&s(X,t))}})})},[r,j,X,Z,Se,V,Te,L]);let $=F.useRef(null);D(()=>{if(r||!X){$.current=null;return}$.current&&=($.current.cancelled=!0,null);let e=k(X),t=C(e),n=V.current==null;ke(t);function i(e){if(e.open||(Fe.current=De(e.nativeEvent,q.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(be(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(G.current=!0),e.reason===`outside-press`){if(e.nested)G.current=!1;else if(T(e.nativeEvent)||se(e.nativeEvent))G.current=!1;else{let e=!1;k(X).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?G.current=!1:G.current=!0}}}I.on(`openchange`,i);function a(e){let r=Ce.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=M?.isConnected?M:null,o=t?.isConnected&&he(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Ae()||null,typeof i==`boolean`?s:l(i)||s||null}return()=>{I.off(`openchange`,i);let t=C(e),n=Q(),r=s(N,t)||n.some(e=>e===t||s(e,t))||H&&ue(H.nodesRef.current,R(),!1).some(e=>s(e.context?.elements.floating,t)),o=Ce.current,c=Fe.current,l=a(c),u={cancelled:!1};$.current=u,queueMicrotask(()=>{$.current===u&&($.current=null);let n=je(l),i=we.current??typeof o!=`boolean`;if(!u.cancelled&&o&&!G.current&&P(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};c===`keyboard`&&(e.focusVisible=!0),n.focus(e)}G.current=!1})}},[r,N,X,Ce,we,V,I,H,M,R,Q]),D(()=>{if(!me||j||!N)return;let e=C(k(N));P(e)&&ce(e)&&s(N,e)&&e.blur()},[j,N]),D(()=>{if(!r&&W)return W.setFocusManagerState({modal:g,closeOnFocusOut:_,open:j,onOpenChange:t.setOpen,domReference:M}),()=>{W.setFocusManagerState(null)}},[r,W,g,j,t,_,M]),D(()=>{if(!r&&X)return Me(X),()=>{queueMicrotask(Oe)}},[r,X]);let He=!r&&(!g||!B)&&(Ve||g);return(0,U.jsxs)(F.Fragment,{children:[He&&(0,U.jsx)(a,{"data-type":`inside`,ref:Le,onFocus:e=>{if(g){let e=Z();xe(e[e.length-1])}else W?.portalNode&&(G.current=!1,le(e,W.portalNode)?E(M)?.focus():l(S??W.beforeOutsideRef)?.focus())}}),n,He&&(0,U.jsx)(a,{"data-type":`inside`,ref:Re,onFocus:e=>{g?xe(Z()[0]):W?.portalNode&&(_&&(G.current=!0),le(e,W.portalNode)?ve(M)?.focus():l(b??W.afterOutsideRef)?.focus())}})]})}function Ne(e){return S(19)?e:e?`true`:void 0}var Pe=`data-valid`,Fe=`data-invalid`,q={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},J={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ie={disabled:!1,...J},Le={valid(e){return e===null?null:e?{[Pe]:``}:{[Fe]:``}}},Re={invalid:void 0,name:void 0,validityData:{state:q,errors:[],error:``,value:``,initialValue:null},setValidityData:v,disabled:void 0,setTouched:v,setDirty:v,setFilled:v,setFocused:v,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Ie,registerFieldControl:v,validation:{getValidationProps:(e,t=g)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:v,getInputControl:()=>null,commit:async()=>{},change:v}},ze=F.createContext(Re);function Y(e=!0){let t=F.useContext(ze);if(t.setValidityData===v&&!e)throw Error(j(28));return t}function Be(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Y(),s=p(()=>Symbol());D(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),D(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var Ve=F.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:v,validationMode:`onSubmit`,submitCountRef:{current:0}});function X(){return F.useContext(Ve)}var Z=F.createContext({controlId:void 0,registerControlId:v,resetControlId:v,labelId:void 0,setLabelId:v,messageIds:[],setMessageIds:v,getDescriptionProps:e=>e});function Q(){return F.useContext(Z)}function $(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=Q(),o=h(),s=p(()=>Symbol()),c=F.useRef(!1),l=F.useRef(!1),u=O(()=>{c.current&&i!==v&&(c.current=!1,i(s.current,void 0))});return D(()=>{if(!n||i===v){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),D(()=>u,[u]),(n?r:void 0)??t??o}function He(e,t){let n=F.useRef(e),r=O(t);D(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Ue(e,t,n){let{setFocused:r,focusOwnerRef:i}=Y(),a=O(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return D(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}var We=F.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,U.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Ge={},Ke={},qe=``;function Je(e,t){return o(e)?e:t}function Ye(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Je(t,n)).overflowY)}function Xe(e){if(typeof document>`u`)return!1;let t=k(e);return M(t).innerWidth-t.documentElement.clientWidth>0}function Ze(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=k(e),n=t.documentElement,r=t.body,i=Je(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Qe(e){let t=k(e),n=t.documentElement,r=t.body,i=Je(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function $e(e){let t=k(e),n=t.documentElement,r=t.body,i=M(n),a=0,o=0,s=!1,c=w.create();if(me&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Ge={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},qe=n.style.scrollBehavior,Ke={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),ee=Math.max(0,i.innerHeight-r.clientHeight),h=parseFloat(c.marginTop)+parseFloat(c.marginBottom),g=parseFloat(c.marginLeft)+parseFloat(c.marginRight),_=Je(n,r);s=Ze(e),s?(n.style.scrollbarGutter=l,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||ee?`calc(100dvh - ${h+ee}px)`:`100dvh`,width:g||m?`calc(100vw - ${g+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Ge),Object.assign(r.style,Ke),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=qe)}function d(){u(),c.request(l)}l();let f=A(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var et=new class{lockCount=0;restore=null;timeoutLock=m.create();timeoutUnlock=m.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=k(e),n=t.documentElement,r=t.body,i=M(n);if(Ye(i,n,r)){let t=new i.MutationObserver(()=>{Ye(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=_||!Xe(e);this.restore=a?Qe(e):$e(e)}};function tt(e=!0,t=null){D(()=>{if(e)return et.acquire(t)},[e,t])}var nt=F.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:ee,setTouched:h,setDirty:g,validityData:_,setFilled:v,validationMode:y,validation:x}=Y(),{clearErrors:S,elementRef:te,submitCountRef:ne}=X(),C=ee||s,w=m??a,re={...p,disabled:C},{labelId:ie}=Q(),T=$({id:i}),se=o!==void 0,E=o==null?void 0:String(o),ce=O(()=>x.inputRef.current?.value);Be(x.inputRef,T,E,ce,!C,a),D(()=>{let e=E??x.inputRef.current?.value;e!==void 0&&v(e!==``)},[E,l,x.inputRef,v]),He(E,()=>{E!==void 0&&(S(w),g(E!==(_.initialValue??``)),x.change(E))});let le=F.useRef(null),ue=Ue(C,le),de=ae();return b(`input`,e,{ref:[t,le],state:re,props:[{id:T,disabled:C,name:w,ref:x.inputRef,"aria-labelledby":ie,autoFocus:u,...se?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=ge(oe,e.nativeEvent);c?.(t,n),se||(g(t!==(_.initialValue??``)),v(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(w),x.change(t)))},onFocus(){ue(!0)},onBlur(e){if(h(!0),ue(!1),y===`onBlur`){let t=e.currentTarget.value;x.commit(t),se&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(_.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){h(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===te.current&&!e.defaultPrevented){let t=e.currentTarget,n=ne.current;de.start(0,()=>{ne.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(C,e)],stateAttributesMapping:Le})}),rt=F.forwardRef(function(e,t){return(0,U.jsx)(nt,{ref:t,...e})}),it=F.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return b(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function at({className:e,...t}){return(0,U.jsx)(`kbd`,{"data-slot":`kbd`,className:r(`inline-grid h-[18px] min-w-[18px] place-items-center rounded-[4px] border border-b-2 border-rule bg-page px-1 font-mono text-[0.66rem] leading-none font-semibold text-muted select-none`,e),...t})}var ot=`w-full min-w-0 rounded-control border border-rule bg-page px-3 text-sm text-text outline-none transition-colors placeholder:text-muted focus:border-accent disabled:cursor-not-allowed disabled:opacity-60`;function st({className:e,...t}){return(0,U.jsx)(rt,{"data-slot":`input`,className:r(ot,`h-9`,e),...t})}function ct({className:e,...t}){return(0,U.jsx)(`textarea`,{"data-slot":`textarea`,className:r(ot,`min-h-20 py-2 leading-relaxed`,e),...t})}function lt({className:e,orientation:t=`horizontal`,...n}){return(0,U.jsx)(it,{"data-slot":`separator`,orientation:t,className:r(`shrink-0 bg-rule-soft data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch`,e),...n})}export{Le as _,tt as a,xe as b,He as c,X as d,Be as f,J as g,Y as h,ct as i,$ as l,ze as m,at as n,We as o,Re as p,lt as r,Ue as s,st as t,Q as u,Ne as v,K as y};
@@ -0,0 +1 @@
1
+ import{F as e,I as t,L as n,Lt as r,M as i,N as a,P as o,R as s,g as c,z as l}from"./index-D5oGyvG8.js";import{G as u}from"./studio-queries-CKtAnIKP.js";import{_ as d,v as f,x as p,y as m}from"./studio-X7bnFrRe.js";import{a as h,n as g,t as _}from"./jsx-runtime-MZURdZre.js";import{et as v,it as y,lt as b,nt as x,ot as S,r as ee,rt as te,t as C,tt as ne,ut as re}from"./button-upSzkd-q.js";import{a as ie,c as ae,l as oe,o as se,s as ce}from"./select-B2FsN9FY.js";import{t as w}from"./cn-BCnYnarL.js";import{n as T,s as le}from"./search-DhWdEiKT.js";import{t as ue}from"./fields-DNZ4a89M.js";var E=`mate`;function de(e){return/^[\w:./+=-]+$/.test(e)?e:/["$`\\!%]/.test(e)?`'${e.replaceAll(`'`,`'\\''`)}'`:`"${e}"`}function fe(e){return e.map(de).join(` `)}var D=h(g(),1),O=_(),k={fixed:{label:`Fixed`,marker:`done`},reported:{label:`Reported`,marker:`review`},dismissed:{label:`Dismissed`,marker:`idle`}},pe={person:`by a person`,triage:`by triage`,studio:`in Studio`},A=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function j({state:e}){if(!e)return null;let t=k[e.state];return e.reopened?(0,O.jsx)(b,{marker:`warn`,children:`Reopened`}):(0,O.jsx)(b,{marker:t.marker,children:t.label})}function me({state:e,time:t}){let n=k[e.state];return(0,O.jsxs)(`p`,{className:`m-0 flex flex-wrap items-baseline gap-x-3 gap-y-1 text-xs text-muted`,children:[(0,O.jsx)(j,{state:e}),(0,O.jsxs)(`span`,{children:[e.reopened?`Fixed, then recorded again; marked `:`${n.label} `,pe[e.by],` `,t]}),e.state===`reported`&&e.eventsSince!==void 0?(0,O.jsxs)(`span`,{className:`tabular-nums`,children:[A(e.eventsSince,`event`),` since reported`]}):null,e.link?(0,O.jsx)(`a`,{href:e.link,target:`_blank`,rel:`noreferrer`,className:`text-text underline`,children:e.link}):null,e.note?(0,O.jsx)(`span`,{className:`text-text`,children:e.note}):null]})}var M={label:`Note (optional)`,key:`note`,type:`text`},N={fixed:{action:`Mark fixed`,field:M},reported:{action:`Mark reported`,field:{label:`Issue link (optional)`,key:`link`,type:`url`}},dismissed:{action:`Dismiss`,field:M}};function he({name:e,handled:t,onMark:n}){let[r,i]=(0,D.useState)(null),[a,o]=(0,D.useState)(``),[s,c]=(0,D.useState)(!1),[l,u]=(0,D.useState)(null),d=(0,D.useId)(),p=(0,D.useRef)(null),m=(0,D.useRef)({}),h=(0,D.useRef)(null);(0,D.useEffect)(()=>{r?p.current?.focus():h.current&&m.current[h.current]?.focus(),h.current=null},[r]);let g=()=>{i(null),o(``),u(null)},_=()=>{s||(h.current=r,g())};async function v(e,t={}){c(!0),u(null);let r=await n(e,t);c(!1),r?u(r):g()}return(0,O.jsxs)(`div`,{className:`grid gap-1.5`,children:[r?(0,O.jsxs)(`form`,{"aria-label":`${N[r].action}: ${e}`,className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),v(r,{[N[r].field.key]:a})},onKeyDown:e=>{e.key===`Escape`&&_()},children:[(0,O.jsxs)(`label`,{htmlFor:d,className:`grid gap-1 text-xs text-muted`,children:[N[r].field.label,(0,O.jsx)(ue,{id:d,ref:p,type:N[r].field.type,value:a,onChange:e=>o(e.target.value),className:`h-8 w-72 max-w-full`})]}),(0,O.jsx)(C,{size:`sm`,variant:`primary`,type:`submit`,disabled:s,children:N[r].action}),(0,O.jsx)(C,{size:`sm`,onClick:_,disabled:s,children:`Cancel`})]}):(0,O.jsxs)(`div`,{role:`group`,"aria-label":`Mark ${e}`,className:`flex flex-wrap gap-2`,children:[f.map(e=>(0,O.jsx)(C,{ref:t=>{m.current[e]=t},size:`sm`,disabled:s,onClick:()=>i(e),children:N[e].action},e)),t?(0,O.jsx)(C,{size:`sm`,disabled:s,onClick:()=>void v(`open`),children:`Reopen`}):null]}),l?(0,O.jsx)(`p`,{className:`m-0 max-w-[70ch] text-xs text-bad`,role:`alert`,children:l}):null]})}var P={state:`open`,sort:`repeats`};function ge(e){return{state:e.frictionState??P.state,type:e.frictionType,kind:e.frictionKind,sort:e.frictionSort??P.sort}}function _e(e){return{frictionState:e.state===P.state?void 0:e.state,frictionType:e.type,frictionKind:e.kind,frictionSort:e.sort===P.sort?void 0:e.sort}}function F(e,t){let n=d(e,t);return t.sort===`recent`?{...n,groups:n.groups.toSorted((e,t)=>e.lastSeen<t.lastSeen?1:e.lastSeen>t.lastSeen?-1:0)}:n}var ve=le.map(e=>({value:String(e),label:`${e} days`})),ye=[{value:`open`,label:`Open`},{value:`handled`,label:`Handled`},{value:`all`,label:`All`}],I=`any`,be=[{value:I,label:`All kinds`},...m.map(e=>({value:e,label:e}))],xe=[{value:`repeats`,label:`Most repeated in one session`},{value:`recent`,label:`Most recent`}],L={id:`friction-recorded`,title:`Recorded friction`},R={id:`friction-agent-reports`,title:`Agent reports`},Se=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function z({at:e}){let t=i();return(0,O.jsx)(`time`,{dateTime:e,children:t?Se.format(Date.parse(e)):``})}var B=`m-0 grid grid-cols-[max-content_minmax(0,1fr)] items-baseline gap-x-3 gap-y-1 @md:grid-cols-[6rem_minmax(0,1fr)]`;function V({label:e,children:t}){return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`dt`,{className:`text-muted`,children:e}),(0,O.jsx)(`dd`,{className:`m-0 min-w-0`,children:t})]})}function H({label:e,counts:t}){let n=Object.entries(t);return n.length===0?null:(0,O.jsx)(V,{label:e,children:(0,O.jsx)(`span`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:n.map(([e,t])=>(0,O.jsxs)(`span`,{className:`font-mono tabular-nums`,children:[e,` `,(0,O.jsxs)(`span`,{className:`text-muted`,children:[`×`,t]})]},e))})})}function U({name:e,target:t,item:n,onMark:r}){return(0,O.jsxs)(`div`,{className:`mt-1 grid gap-1.5`,children:[n.state?(0,O.jsx)(me,{state:n.state,time:(0,O.jsx)(z,{at:n.state.at})}):null,(0,O.jsx)(he,{name:e,handled:!n.open,onMark:r}),(0,O.jsxs)(`div`,{role:`group`,"aria-label":`Triage ${e}`,className:`flex flex-wrap items-center gap-x-3 gap-y-2 text-xs`,children:[(0,O.jsx)(`p`,{className:`m-0 text-muted`,children:`To investigate this item, run in your own terminal, in a repository of its companion:`}),(0,O.jsx)(`div`,{className:`w-full max-w-xl min-w-0`,children:(0,O.jsx)(v,{text:fe([E,`triage`,t]),label:`command`})})]})]})}function W({fields:e}){let t=e.filter(([,e])=>e);return t.length===0?null:(0,O.jsx)(`dl`,{className:w(B,`max-w-[70ch] text-sm`),children:t.map(([e,t])=>(0,O.jsx)(V,{label:e,children:t},e))})}function G({focusKey:e,line:t,summary:n,children:r}){return(0,O.jsx)(`li`,{className:`border-t border-rule-soft first:border-t-0`,"data-friction-item":e,children:(0,O.jsxs)(`details`,{className:`group/friction`,children:[(0,O.jsxs)(`summary`,{className:`grid cursor-pointer list-none grid-cols-[auto_minmax(0,1fr)] gap-x-2 px-4 py-2.5 hover:bg-surface focus-visible:-outline-offset-2 [&::-webkit-details-marker]:hidden`,children:[(0,O.jsx)(ee,{name:`right`,className:`mt-1 size-3.5 text-muted transition-transform group-open/friction:rotate-90 motion-reduce:transition-none`}),(0,O.jsx)(`div`,{className:w(`flex min-w-0 flex-wrap items-baseline gap-x-4 gap-y-1`,t),children:n})]}),(0,O.jsx)(`div`,{className:`mr-4 mb-3 ml-9.5 grid gap-1.5 border-l border-rule-soft pl-3`,children:r})]})})}var K=`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 font-mono text-xs whitespace-nowrap text-muted tabular-nums`,Ce=`minmax(32ch,max-content)`,q=`minmax(22ch,max-content)`,J=`11ch`;function Y({wide:e}){return(0,O.jsx)(`span`,{"aria-hidden":`true`,className:w(`hidden`,e)})}function X(e){return[`at most ${e.maxPerSession} in one session`,A(e.events,`event`),A(e.sessions,`session`),e.reports.length>0?A(e.reports.length,`report`):null]}function we(e,t){let n=e.map(X),r=e=>Math.max(...n.map(t=>t[e]?.length??0),0),i=[0,1,2].map(e=>`${r(e)}ch`);return t.reports&&i.push(`${r(3)}ch`),i.push(Ce),t.state&&i.push(J),i.join(` `)}function Te(e){return e?`${q} ${J}`:q}var Z=e=>({"--friction-facts":e});function Q({state:e,column:t,wide:n}){return e?(0,O.jsx)(`span`,{className:`font-sans`,children:(0,O.jsx)(j,{state:e})}):t?(0,O.jsx)(Y,{wide:n}):null}function Ee({group:e,columns:t,onMark:n}){let[r,i,a,o]=X(e);return(0,O.jsxs)(G,{focusKey:e.fingerprint,line:`@5xl:grid @5xl:grid-cols-[minmax(0,1fr)_auto]`,summary:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`h3`,{className:`m-0 min-w-0 flex-[1_1_16rem] text-base font-semibold`,children:e.title}),(0,O.jsxs)(`span`,{className:w(K,`@3xl:grid @3xl:grid-cols-(--friction-facts)`),children:[(0,O.jsx)(`span`,{children:r}),(0,O.jsx)(`span`,{children:i}),(0,O.jsx)(`span`,{children:a}),o?(0,O.jsx)(`span`,{children:o}):t.reports?(0,O.jsx)(Y,{wide:`@3xl:block`}):null,(0,O.jsxs)(`span`,{children:[`last seen `,(0,O.jsx)(z,{at:e.lastSeen})]}),(0,O.jsx)(Q,{state:e.state,column:t.state,wide:`@3xl:block`})]})]}),children:[(0,O.jsxs)(`dl`,{className:w(B,`text-xs`),children:[(0,O.jsx)(V,{label:`Fingerprint`,children:(0,O.jsx)(`code`,{className:`font-mono`,children:e.fingerprint})}),(0,O.jsx)(V,{label:`First seen`,children:(0,O.jsx)(z,{at:e.firstSeen})}),(0,O.jsx)(V,{label:`Last seen`,children:(0,O.jsx)(z,{at:e.lastSeen})}),(0,O.jsx)(H,{label:`Mate`,counts:e.versions}),(0,O.jsx)(H,{label:`Paths`,counts:e.paths}),(0,O.jsx)(H,{label:`Flags`,counts:e.flags})]}),e.reports.length>0?(0,O.jsxs)(`section`,{"aria-label":`Reports on ${e.title}`,className:`mt-1`,children:[(0,O.jsx)(`h4`,{className:`m-0 text-xs font-semibold text-muted`,children:A(e.reports.length,`report`)}),(0,O.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.reports.map(e=>(0,O.jsxs)(`li`,{className:`grid gap-1 border-t border-rule-soft py-2 first:border-t-0`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 text-xs text-muted`,children:[(0,O.jsx)(`span`,{className:`font-semibold text-text`,children:e.kind}),e.cost?(0,O.jsx)(`span`,{children:e.cost}):null,(0,O.jsx)(z,{at:e.at})]}),(0,O.jsx)(W,{fields:[[`Expected`,e.expected],[`Evidence`,e.evidence],[`Workaround`,e.workaround]]})]},e.id))})]}):null,(0,O.jsx)(U,{name:e.title,target:e.fingerprint,item:e,onMark:n})]})}function De({report:e,stateColumn:t,onMark:n}){return(0,O.jsxs)(G,{focusKey:e.id,line:`@3xl:grid @3xl:grid-cols-[minmax(0,1fr)_auto]`,summary:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1`,children:[(0,O.jsx)(`h3`,{className:`m-0 min-w-0 font-mono text-sm leading-[1.375rem] font-semibold`,children:e.subject}),(0,O.jsx)(`span`,{className:`rounded-full border border-rule bg-page px-2 font-mono text-[0.7rem] text-text`,children:e.kind})]}),(0,O.jsxs)(`span`,{className:w(K,`@3xl:grid @3xl:grid-cols-(--friction-facts)`),children:[(0,O.jsx)(z,{at:e.at}),(0,O.jsx)(Q,{state:e.state,column:t,wide:`@3xl:block`})]})]}),children:[(0,O.jsx)(W,{fields:[[`Expected`,e.expected],[`Cost`,e.cost],[`Evidence`,e.evidence],[`Workaround`,e.workaround]]}),(0,O.jsx)(U,{name:e.subject,target:e.id,item:e,onMark:n})]})}function Oe({hidden:e,onShowAll:t}){return(0,O.jsxs)(O.Fragment,{children:[e===1?`1 item is`:`${e} items are`,` hidden by the filters.`,(0,O.jsx)(C,{size:`sm`,onClick:t,"data-show-all":!0,"aria-label":`Show all, including ${A(e,`hidden item`)}`,children:`Show all`})]})}function ke({view:e,shown:t,empty:n,onShowAll:r}){let i=[[L,t.groups.length],[R,t.freeReports.length]];return(0,O.jsxs)(`section`,{"aria-label":`Overview`,className:`grid gap-2 text-sm`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-5 gap-y-1`,children:[(0,O.jsxs)(`p`,{className:`m-0`,children:[A(e.events,`event`),` in `,A(e.sessions,`session`),` in the last`,` `,e.days,` days for the selected companion.`]}),(0,O.jsx)(`nav`,{"aria-label":`Friction sections`,className:`flex flex-wrap gap-x-4 gap-y-1`,children:i.map(([{id:e,title:t},n])=>n>0?(0,O.jsxs)(`a`,{href:`#${e}`,className:`inline-flex items-center gap-1.5 rounded-control underline`,children:[t,(0,O.jsx)(ne,{value:n})]},e):null)})]}),!n&&t.hidden>0?(0,O.jsx)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-muted`,children:(0,O.jsx)(Oe,{hidden:t.hidden,onShowAll:r})}):null,(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,O.jsx)(`p`,{className:`m-0 text-muted`,children:`To investigate, run this in your own terminal, inside the affected repository:`}),(0,O.jsx)(`div`,{className:`w-48 max-w-full`,children:(0,O.jsx)(v,{text:`${E} triage`,label:`command`})})]})]})}function Ae({recording:e,toggle:t,button:r}){return(0,O.jsxs)(`div`,{className:`grid gap-1`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,O.jsx)(l,{recording:e}),(0,O.jsx)(n,{ref:r,recording:e,toggle:t})]}),(0,O.jsx)(s,{}),t.error?(0,O.jsx)(`p`,{className:`m-0 text-sm text-bad`,role:`alert`,children:t.error}):null]})}function $({label:e,options:t,value:n,onChange:r,note:i,disabled:a}){let o=(0,D.useId)();return(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`label`,{htmlFor:o,className:`text-xs text-muted`,children:e}),(0,O.jsxs)(ie,{items:t,value:n,disabled:a,onValueChange:e=>{e!==null&&r(e)},children:[(0,O.jsx)(ae,{id:o,"aria-describedby":i?`${o}-note`:void 0,className:`h-7 w-auto`,children:(0,O.jsx)(oe,{})}),(0,O.jsx)(se,{children:t.map(e=>(0,O.jsx)(ce,{value:e.value,children:e.label},e.value))})]}),i?(0,O.jsx)(`span`,{id:`${o}-note`,className:`text-xs text-muted`,children:i}):null]})}function je({view:e,shown:t,filters:n,onFilters:r}){let i=[{value:I,label:`All types`},...t.types.map(e=>({value:e,label:e}))],a=F(e,{...n,kind:void 0}).freeReports.length===0;return(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2`,children:[(0,O.jsx)($,{label:`Type`,options:i,value:t.type??I,onChange:e=>r({...n,type:T(p,e)})}),(0,O.jsx)($,{label:`Kind`,options:be,value:n.kind??I,onChange:e=>r({...n,kind:T(m,e)}),note:`Agent reports only`,disabled:a&&n.kind===void 0}),(0,O.jsx)($,{label:`Sort`,options:xe,value:n.sort,onChange:e=>r({...n,sort:e})})]})}function Me({shown:e,empty:t,markItem:n,onShowAll:r}){if(t)return(0,O.jsxs)(x,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[`No item matches the filters. `,(0,O.jsx)(Oe,{hidden:e.hidden,onShowAll:r})]});let i={reports:e.groups.some(e=>e.reports.length>0),state:e.groups.some(e=>e.state!==null)},a=e.freeReports.some(e=>e.state!==null);return(0,O.jsxs)(`div`,{className:`grid gap-4`,children:[e.groups.length>0?(0,O.jsx)(te,{...L,count:e.groups.length,className:`wrap-anywhere`,children:(0,O.jsx)(`ul`,{className:`@container m-0 list-none p-0`,style:Z(we(e.groups,i)),children:e.groups.map(e=>(0,O.jsx)(Ee,{group:e,columns:i,onMark:n(e.fingerprint,e.title)},e.fingerprint))})}):null,e.freeReports.length>0?(0,O.jsx)(te,{...R,count:e.freeReports.length,hint:`These reports are not attached to a recorded event.`,className:`wrap-anywhere`,children:(0,O.jsx)(`ul`,{className:`@container m-0 list-none p-0`,style:Z(Te(a)),children:e.freeReports.map(e=>(0,O.jsx)(De,{report:e,stateColumn:a,onMark:n(e.id,e.subject)},e.id))})}):null]})}function Ne({view:e,days:t,onDays:n,toggle:r,filters:i,onFilters:a,mark:o,recordingButton:s}){let c=e.events>0||e.freeReports.length>0,l=F(e,i),[u,d]=(0,D.useState)(null),f=(0,D.useRef)(null);(0,D.useEffect)(()=>{if(!u)return;let e=e=>e===null?null:f.current?.querySelector(`[data-friction-item="${CSS.escape(e)}"] summary`);(e(u.key)??e(u.next)??f.current?.querySelector(`[data-show-all]`))?.focus()},[u]);let p=(e,t)=>async(n,r)=>{let i=[...l.groups.map(e=>e.fingerprint),...l.freeReports.map(e=>e.id)],a=i.indexOf(e),s=i[a+1]??i[a-1]??null,c;try{c=await o({target:e,state:n,...r})}catch(e){return`The mark could not be saved: ${e instanceof Error?e.message:String(e)}`}return c.ok?(d(r=>({announcementKey:(r?.announcementKey??0)+1,key:e,next:s,message:`${t}: ${n===`open`?`reopened`:`marked ${n}`}.`})),null):c.reason},m=()=>{[...f.current?.querySelectorAll(`[aria-label="State"] button`)??[]].find(e=>e.textContent===`All`)?.focus(),a({state:`all`,sort:i.sort})},h=l.groups.length===0&&l.freeReports.length===0;return(0,O.jsxs)(`div`,{ref:f,className:w(y,`grid min-w-0 gap-4 pt-3 pb-6`),children:[(0,O.jsx)(Ae,{recording:e.recording,toggle:r,button:s}),(0,O.jsxs)(`div`,{className:`grid gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2`,children:[(0,O.jsx)(S,{label:`Period`,options:ve,value:String(t),onChange:e=>n(Number(e))}),c?(0,O.jsx)(S,{label:`State`,options:ye,value:i.state,onChange:e=>a({...i,state:e})}):null]}),c?(0,O.jsx)(je,{view:e,shown:l,filters:i,onFilters:a}):null]}),(0,O.jsx)(`div`,{"aria-live":`polite`,className:`sr-only`,children:u?(0,O.jsx)(`p`,{children:u.message},u.announcementKey):null}),c?(0,O.jsxs)(O.Fragment,{children:[e.recording?null:(0,O.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Recording is off: nothing new is recorded. The records below were made while it was on.`}),(0,O.jsx)(ke,{view:e,shown:l,empty:h,onShowAll:m}),(0,O.jsx)(Me,{shown:l,empty:h,markItem:p,onShowAll:m})]}):(0,O.jsx)(x,{children:e.recording?`No friction was recorded in the last ${e.days} days.`:`Friction recording shows where Mate gets in an agent's way: its refusals and the ${E} commands that fail in agent sessions on this machine. Recording is off; turn it on to start.`})]})}function Pe({companion:n,days:s,onDays:c,filters:l,onFilters:d}){let f=r({...o(n,s),enabled:i(),placeholderData:u}),p=t(),m=e(),{button:h,retried:g}=a(f.isSuccess);if(!f.data&&!f.isError)return(0,O.jsx)(re,{title:`Reading the Friction Log…`});let _=f.isError?(0,O.jsxs)(`div`,{className:w(y,`pt-3 text-sm`),role:`alert`,children:[(0,O.jsx)(`p`,{className:`m-0 text-bad`,children:`The Friction Log could not be read.`}),(0,O.jsx)(C,{className:`mt-3`,onClick:()=>{g(),f.refetch()},disabled:f.isFetching,children:`Retry`})]}):null;return f.data?(0,O.jsxs)(O.Fragment,{children:[_,(0,O.jsx)(Ne,{view:f.data,days:s,onDays:c,toggle:p,filters:l,onFilters:d,mark:m,recordingButton:h})]}):_}var Fe=function(){let e=c.useSearch(),t=c.useNavigate();return e.companion?(0,O.jsx)(Pe,{companion:e.companion,days:e.frictionDays??30,onDays:e=>void t({search:t=>({...t,frictionDays:e})}),filters:ge(e),onFilters:e=>void t({search:t=>({...t,..._e(e)})})},e.companion):null};export{Fe as component};
@@ -0,0 +1 @@
1
+ import{Rt as e}from"./index-D5oGyvG8.js";var t=e;export{t as component};
@@ -1 +1 @@
1
- import{it as e}from"./studio-queries-BflKt9va.js";import{t}from"./markdown-view-jMiaBTSO.js";import{t as n}from"./jsx-runtime-MZURdZre.js";var r=n(),i=[{id:`start`,label:`Start here`,path:`/getting-started`},{id:`worktrees`,label:`Worktrees`,path:`/getting-started/worktrees`},{id:`vscode`,label:`VS Code & Cursor`,path:`/getting-started/vscode`}];function a({topic:n,guide:a,search:o}){let s={companion:o.companion,studioMode:o.studioMode};return(0,r.jsxs)(`div`,{className:`guide-reader min-w-0 px-6 max-sm:px-4`,children:[(0,r.jsx)(`nav`,{"aria-label":`Getting Started topics`,className:`mb-6 flex flex-wrap gap-2 border-b border-rule pb-3`,children:i.map(({id:t,label:i,path:a})=>(0,r.jsx)(e,{to:a,search:s,activeOptions:{exact:!0},"aria-current":n===t?`page`:void 0,className:`rounded-control px-3 py-2 text-sm text-muted hover:bg-surface hover:text-text aria-[current=page]:bg-accent-soft aria-[current=page]:font-semibold aria-[current=page]:text-accent`,children:i},t))}),(0,r.jsxs)(`article`,{className:`min-w-0 max-w-[70ch] pb-8`,"aria-label":a?.title??`Guide not found`,children:[a&&n!==`start`?(0,r.jsx)(`h2`,{className:`mb-4 text-lg font-semibold`,children:a.title}):null,a?(0,r.jsx)(t,{nodes:a.nodes,guideSearch:s}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`h2`,{className:`mb-2 text-lg font-semibold`,children:`Guide not found`}),(0,r.jsxs)(`p`,{children:[`This topic is not bundled with Studio.`,` `,(0,r.jsx)(e,{to:`/getting-started`,search:s,className:`text-accent underline`,children:`Return to Start here`}),`.`]})]})]})]})}export{a as t};
1
+ import{ut as e}from"./studio-queries-CKtAnIKP.js";import{t}from"./markdown-view-CJ8JsLb7.js";import{t as n}from"./jsx-runtime-MZURdZre.js";var r=n(),i=[{id:`start`,label:`Start here`,path:`/getting-started`},{id:`worktrees`,label:`Worktrees`,path:`/getting-started/worktrees`},{id:`vscode`,label:`VS Code & Cursor`,path:`/getting-started/vscode`}];function a({topic:n,guide:a,search:o}){let s={companion:o.companion,studioMode:o.studioMode};return(0,r.jsxs)(`div`,{className:`guide-reader min-w-0 px-6 max-sm:px-4`,children:[(0,r.jsx)(`nav`,{"aria-label":`Getting Started topics`,className:`mb-6 flex flex-wrap gap-2 border-b border-rule pb-3`,children:i.map(({id:t,label:i,path:a})=>(0,r.jsx)(e,{to:a,search:s,activeOptions:{exact:!0},"aria-current":n===t?`page`:void 0,className:`rounded-control px-3 py-2 text-sm text-muted hover:bg-surface hover:text-text aria-[current=page]:bg-accent-soft aria-[current=page]:font-semibold aria-[current=page]:text-accent`,children:i},t))}),(0,r.jsxs)(`article`,{className:`min-w-0 max-w-[70ch] pb-8`,"aria-label":a?.title??`Guide not found`,children:[a&&n!==`start`?(0,r.jsx)(`h2`,{className:`mb-4 text-lg font-semibold`,children:a.title}):null,a?(0,r.jsx)(t,{nodes:a.nodes,guideSearch:s}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`h2`,{className:`mb-2 text-lg font-semibold`,children:`Guide not found`}),(0,r.jsxs)(`p`,{children:[`This topic is not bundled with Studio.`,` `,(0,r.jsx)(e,{to:`/getting-started`,search:s,className:`text-accent underline`,children:`Return to Start here`}),`.`]})]})]})]})}export{a as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./getting-started-CAszmdDJ.js";import{n as t}from"./index-D5oGyvG8.js";import{t as n}from"./jsx-runtime-MZURdZre.js";var r=n(),i=function(){return(0,r.jsx)(e,{topic:t.useParams().topic,guide:t.useLoaderData(),search:t.useSearch()})};export{i as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./getting-started-CAszmdDJ.js";import{r as t}from"./index-D5oGyvG8.js";import{t as n}from"./jsx-runtime-MZURdZre.js";var r=n(),i=function(){return(0,r.jsx)(e,{topic:`start`,guide:t.useLoaderData(),search:t.useSearch()})};export{i as component};
@@ -1,4 +1,4 @@
1
- import"./studio-0ueISxwP.js";import{a as e,n as t,r as n,t as r}from"./jsx-runtime-MZURdZre.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u}from"./graph-BYaD_5Bq.js";var d=n(((e,t)=>{t.exports=function(){var e,t,n={};(function(){n.exports=function(e,t,n){var r,i,a,o,s,c,l,u,d,f,p=t.length,m=n.length,h=e.adjustSizes,g=e.barnesHutTheta*e.barnesHutTheta,_,v,y,b,x,S,C,w=[];for(a=0;a<p;a+=10)t[a+4]=t[a+2],t[a+5]=t[a+3],t[a+2]=0,t[a+3]=0;if(e.outboundAttractionDistribution){for(_=0,a=0;a<p;a+=10)_+=t[a+6];_/=p/10}if(e.barnesHutOptimize){var T=1/0,E=-1/0,D=1/0,O=-1/0,k,A,j;for(a=0;a<p;a+=10)T=Math.min(T,t[a+0]),E=Math.max(E,t[a+0]),D=Math.min(D,t[a+1]),O=Math.max(O,t[a+1]);var M=E-T,N=O-D;for(M>N?(D-=(M-N)/2,O=D+M):(T-=(N-M)/2,E=T+N),w[0]=-1,w[1]=(T+E)/2,w[2]=(D+O)/2,w[3]=Math.max(E-T,O-D),w[4]=-1,w[5]=-1,w[6]=0,w[7]=0,w[8]=0,r=1,a=0;a<p;a+=10)for(i=0,j=3;;)if(w[i+5]>=0){k=t[a+0]<w[i+1]?t[a+1]<w[i+2]?w[i+5]:w[i+5]+9:t[a+1]<w[i+2]?w[i+5]+18:w[i+5]+27,w[i+7]=(w[i+7]*w[i+6]+t[a+0]*t[a+6])/(w[i+6]+t[a+6]),w[i+8]=(w[i+8]*w[i+6]+t[a+1]*t[a+6])/(w[i+6]+t[a+6]),w[i+6]+=t[a+6],i=k;continue}else if(w[i+0]<0){w[i+0]=a;break}else{if(w[i+5]=r*9,u=w[i+3]/2,d=w[i+5],w[d+0]=-1,w[d+1]=w[i+1]-u,w[d+2]=w[i+2]-u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]-u,w[d+2]=w[i+2]+u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]+u,w[d+2]=w[i+2]-u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]+u,w[d+2]=w[i+2]+u,w[d+3]=u,w[d+4]=w[i+4],w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,r+=4,k=t[w[i+0]+0]<w[i+1]?t[w[i+0]+1]<w[i+2]?w[i+5]:w[i+5]+9:t[w[i+0]+1]<w[i+2]?w[i+5]+18:w[i+5]+27,w[i+6]=t[w[i+0]+6],w[i+7]=t[w[i+0]+0],w[i+8]=t[w[i+0]+1],w[k+0]=w[i+0],w[i+0]=-1,A=t[a+0]<w[i+1]?t[a+1]<w[i+2]?w[i+5]:w[i+5]+9:t[a+1]<w[i+2]?w[i+5]+18:w[i+5]+27,k===A){if(j--){i=k;continue}j=3;break}w[A+0]=a;break}}if(e.barnesHutOptimize)for(v=e.scalingRatio,a=0;a<p;a+=10)for(i=0;;)if(w[i+5]>=0){if(S=(t[a+0]-w[i+7])**2+(t[a+1]-w[i+8])**2,f=w[i+3],4*f*f/S<g){if(y=t[a+0]-w[i+7],b=t[a+1]-w[i+8],h===!0?S>0?(C=v*t[a+6]*w[i+6]/S,t[a+2]+=y*C,t[a+3]+=b*C):S<0&&(C=-v*t[a+6]*w[i+6]/Math.sqrt(S),t[a+2]+=y*C,t[a+3]+=b*C):S>0&&(C=v*t[a+6]*w[i+6]/S,t[a+2]+=y*C,t[a+3]+=b*C),i=w[i+4],i<0)break;continue}i=w[i+5];continue}else{if(c=w[i+0],c>=0&&c!==a&&(y=t[a+0]-t[c+0],b=t[a+1]-t[c+1],S=y*y+b*b,h===!0?S>0?(C=v*t[a+6]*t[c+6]/S,t[a+2]+=y*C,t[a+3]+=b*C):S<0&&(C=-v*t[a+6]*t[c+6]/Math.sqrt(S),t[a+2]+=y*C,t[a+3]+=b*C):S>0&&(C=v*t[a+6]*t[c+6]/S,t[a+2]+=y*C,t[a+3]+=b*C)),i=w[i+4],i<0)break;continue}else for(v=e.scalingRatio,o=0;o<p;o+=10)for(s=0;s<o;s+=10)y=t[o+0]-t[s+0],b=t[o+1]-t[s+1],h===!0?(S=Math.sqrt(y*y+b*b)-t[o+8]-t[s+8],S>0?(C=v*t[o+6]*t[s+6]/S/S,t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C):S<0&&(C=100*v*t[o+6]*t[s+6],t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C)):(S=Math.sqrt(y*y+b*b),S>0&&(C=v*t[o+6]*t[s+6]/S/S,t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C));for(d=e.gravity/e.scalingRatio,v=e.scalingRatio,a=0;a<p;a+=10)C=0,y=t[a+0],b=t[a+1],S=Math.sqrt(y**2+b**2),e.strongGravityMode?S>0&&(C=v*t[a+6]*d):S>0&&(C=v*t[a+6]*d/S),t[a+2]-=y*C,t[a+3]-=b*C;for(v=1*(e.outboundAttractionDistribution?_:1),l=0;l<m;l+=3)o=n[l+0],s=n[l+1],u=n[l+2],x=u**+e.edgeWeightInfluence,y=t[o+0]-t[s+0],b=t[o+1]-t[s+1],h===!0?(S=Math.sqrt(y*y+b*b)-t[o+8]-t[s+8],e.linLogMode?e.outboundAttractionDistribution?S>0&&(C=-v*x*Math.log(1+S)/S/t[o+6]):S>0&&(C=-v*x*Math.log(1+S)/S):e.outboundAttractionDistribution?S>0&&(C=-v*x/t[o+6]):S>0&&(C=-v*x)):(S=Math.sqrt(y**2+b**2),e.linLogMode?e.outboundAttractionDistribution?S>0&&(C=-v*x*Math.log(1+S)/S/t[o+6]):S>0&&(C=-v*x*Math.log(1+S)/S):e.outboundAttractionDistribution?(S=1,C=-v*x/t[o+6]):(S=1,C=-v*x)),S>0&&(t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C);var P,F,I,L,R,z;if(h===!0)for(a=0;a<p;a+=10)t[a+9]!==1&&(P=Math.sqrt(t[a+2]**2+t[a+3]**2),P>10&&(t[a+2]=t[a+2]*10/P,t[a+3]=t[a+3]*10/P),F=t[a+6]*Math.sqrt((t[a+4]-t[a+2])*(t[a+4]-t[a+2])+(t[a+5]-t[a+3])*(t[a+5]-t[a+3])),I=Math.sqrt((t[a+4]+t[a+2])*(t[a+4]+t[a+2])+(t[a+5]+t[a+3])*(t[a+5]+t[a+3]))/2,L=.1*Math.log(1+I)/(1+Math.sqrt(F)),R=t[a+0]+t[a+2]*(L/e.slowDown),t[a+0]=R,z=t[a+1]+t[a+3]*(L/e.slowDown),t[a+1]=z);else for(a=0;a<p;a+=10)t[a+9]!==1&&(F=t[a+6]*Math.sqrt((t[a+4]-t[a+2])*(t[a+4]-t[a+2])+(t[a+5]-t[a+3])*(t[a+5]-t[a+3])),I=Math.sqrt((t[a+4]+t[a+2])*(t[a+4]+t[a+2])+(t[a+5]+t[a+3])*(t[a+5]+t[a+3]))/2,L=t[a+7]*Math.log(1+I)/(1+Math.sqrt(F)),t[a+7]=Math.min(1,Math.sqrt(L*(t[a+2]**2+t[a+3]**2)/(1+Math.sqrt(F)))),R=t[a+0]+t[a+2]*(L/e.slowDown),t[a+0]=R,z=t[a+1]+t[a+3]*(L/e.slowDown),t[a+1]=z);return{}}})();var r=n.exports;self.addEventListener(`message`,function(n){var i=n.data;e=new Float32Array(i.nodes),i.edges&&(t=new Float32Array(i.edges)),r(i.settings,e,t),self.postMessage({nodes:e.buffer},[e.buffer])})}})),f=n(((e,t)=>{t.exports=function(e){return typeof e==`object`&&!!e&&typeof e.addUndirectedEdgeWithKey==`function`&&typeof e.dropNode==`function`&&typeof e.multi==`boolean`}})),p=n((e=>{function t(e){return typeof e!=`number`||isNaN(e)?1:e}function n(e,t){var n={},r=function(e){return e===void 0?t:e};typeof t==`function`&&(r=t);var i=function(t){return r(t[e])},a=function(){return r(void 0)};return typeof e==`string`?(n.fromAttributes=i,n.fromGraph=function(e,t){return i(e.getNodeAttributes(t))},n.fromEntry=function(e,t){return i(t)}):typeof e==`function`?(n.fromAttributes=function(){throw Error(`graphology-utils/getters/createNodeValueGetter: irrelevant usage.`)},n.fromGraph=function(t,n){return r(e(n,t.getNodeAttributes(n)))},n.fromEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=a,n.fromGraph=a,n.fromEntry=a),n}function r(e,t){var n={},r=function(e){return e===void 0?t:e};typeof t==`function`&&(r=t);var i=function(t){return r(t[e])},a=function(){return r(void 0)};return typeof e==`string`?(n.fromAttributes=i,n.fromGraph=function(e,t){return i(e.getEdgeAttributes(t))},n.fromEntry=function(e,t){return i(t)},n.fromPartialEntry=n.fromEntry,n.fromMinimalEntry=n.fromEntry):typeof e==`function`?(n.fromAttributes=function(){throw Error(`graphology-utils/getters/createEdgeValueGetter: irrelevant usage.`)},n.fromGraph=function(t,n){var i=t.extremities(n);return r(e(n,t.getEdgeAttributes(n),i[0],i[1],t.getNodeAttributes(i[0]),t.getNodeAttributes(i[1]),t.isUndirected(n)))},n.fromEntry=function(t,n,i,a,o,s,c){return r(e(t,n,i,a,o,s,c))},n.fromPartialEntry=function(t,n,i,a){return r(e(t,n,i,a))},n.fromMinimalEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=a,n.fromGraph=a,n.fromEntry=a,n.fromMinimalEntry=a),n}e.createNodeValueGetter=n,e.createEdgeValueGetter=r,e.createEdgeWeightGetter=function(e){return r(e,t)}})),m=n((e=>{e.assign=function(e){e||={};for(var t=Array.prototype.slice.call(arguments).slice(1),n=0,r,i=t.length;n<i;n++)if(t[n])for(r in t[n])e[r]=t[n][r];return e},e.validateSettings=function(e){return`linLogMode`in e&&typeof e.linLogMode!=`boolean`?{message:"the `linLogMode` setting should be a boolean."}:`outboundAttractionDistribution`in e&&typeof e.outboundAttractionDistribution!=`boolean`?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:`adjustSizes`in e&&typeof e.adjustSizes!=`boolean`?{message:"the `adjustSizes` setting should be a boolean."}:`edgeWeightInfluence`in e&&typeof e.edgeWeightInfluence!=`number`?{message:"the `edgeWeightInfluence` setting should be a number."}:`scalingRatio`in e&&!(typeof e.scalingRatio==`number`&&e.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:`strongGravityMode`in e&&typeof e.strongGravityMode!=`boolean`?{message:"the `strongGravityMode` setting should be a boolean."}:`gravity`in e&&!(typeof e.gravity==`number`&&e.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:`slowDown`in e&&!(typeof e.slowDown==`number`||e.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:`barnesHutOptimize`in e&&typeof e.barnesHutOptimize!=`boolean`?{message:"the `barnesHutOptimize` setting should be a boolean."}:`barnesHutTheta`in e&&!(typeof e.barnesHutTheta==`number`&&e.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},e.graphToByteArrays=function(e,t){var n=e.order,r=e.size,i={},a,o=new Float32Array(n*10),s=new Float32Array(r*3);return a=0,e.forEachNode(function(e,t){i[e]=a,o[a]=t.x,o[a+1]=t.y,o[a+2]=0,o[a+3]=0,o[a+4]=0,o[a+5]=0,o[a+6]=1,o[a+7]=1,o[a+8]=t.size||1,o[a+9]=+!!t.fixed,a+=10}),a=0,e.forEachEdge(function(e,n,r,c,l,u,d){var f=i[r],p=i[c],m=t(e,n,r,c,l,u,d);o[f+6]+=m,o[p+6]+=m,s[a]=f,s[a+1]=p,s[a+2]=m,a+=3}),{nodes:o,edges:s}},e.assignLayoutChanges=function(e,t,n){var r=0;e.updateEachNodeAttributes(function(e,i){return i.x=t[r],i.y=t[r+1],r+=10,n?n(e,i):i})},e.readGraphPositions=function(e,t){var n=0;e.forEachNode(function(e,r){t[n]=r.x,t[n+1]=r.y,n+=10})},e.collectLayoutChanges=function(e,t,n){for(var r=e.nodes(),i={},a=0,o=0,s=t.length;a<s;a+=10){if(n){var c=Object.assign({},e.getNodeAttributes(r[o]));c.x=t[a],c.y=t[a+1],c=n(r[o],c),i[r[o]]={x:c.x,y:c.y}}else i[r[o]]={x:t[a],y:t[a+1]};o++}return i},e.createWorker=function(e){var t=window.URL||window.webkitURL,n=e.toString(),r=t.createObjectURL(new Blob([`(`+n+`).call(this);`],{type:`text/javascript`})),i=new Worker(r);return t.revokeObjectURL(r),i}})),h=n(((e,t)=>{t.exports={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}})),g=n(((e,t)=>{var n=d(),r=f(),i=p().createEdgeWeightGetter,a=m(),o=h();function s(e,t){if(t||={},!r(e))throw Error(`graphology-layout-forceatlas2/worker: the given graph is not a valid graphology instance.`);var n=i(`getEdgeWeight`in t?t.getEdgeWeight:`weight`).fromEntry,s=a.assign({},o,t.settings),c=a.validateSettings(s);if(c)throw Error(`graphology-layout-forceatlas2/worker: `+c.message);this.worker=null,this.graph=e,this.settings=s,this.getEdgeWeight=n,this.matrices=null,this.running=!1,this.killed=!1,this.outputReducer=typeof t.outputReducer==`function`?t.outputReducer:null,this.handleMessage=this.handleMessage.bind(this);var l=void 0,u=this;this.handleGraphUpdate=function(){u.worker&&u.worker.terminate(),l&&clearTimeout(l),l=setTimeout(function(){l=void 0,u.spawnWorker()},0)},e.on(`nodeAdded`,this.handleGraphUpdate),e.on(`edgeAdded`,this.handleGraphUpdate),e.on(`nodeDropped`,this.handleGraphUpdate),e.on(`edgeDropped`,this.handleGraphUpdate),this.spawnWorker()}s.prototype.isRunning=function(){return this.running},s.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=a.createWorker(n),this.worker.addEventListener(`message`,this.handleMessage),this.running&&(this.running=!1,this.start())},s.prototype.handleMessage=function(e){if(this.running){var t=new Float32Array(e.data.nodes);a.assignLayoutChanges(this.graph,t,this.outputReducer),this.outputReducer&&a.readGraphPositions(this.graph,t),this.matrices.nodes=t,this.askForIterations()}},s.prototype.askForIterations=function(e){var t=this.matrices,n={settings:this.settings,nodes:t.nodes.buffer},r=[t.nodes.buffer];return e&&(n.edges=t.edges.buffer,r.push(t.edges.buffer)),this.worker.postMessage(n,r),this},s.prototype.start=function(){if(this.killed)throw Error(`graphology-layout-forceatlas2/worker.start: layout was killed.`);return this.running||(this.matrices=a.graphToByteArrays(this.graph,this.getEdgeWeight),this.running=!0,this.askForIterations(!0)),this},s.prototype.stop=function(){return this.running=!1,this},s.prototype.kill=function(){if(this.killed)return this;this.running=!1,this.killed=!0,this.matrices=null,this.worker.terminate(),this.graph.removeListener(`nodeAdded`,this.handleGraphUpdate),this.graph.removeListener(`edgeAdded`,this.handleGraphUpdate),this.graph.removeListener(`nodeDropped`,this.handleGraphUpdate),this.graph.removeListener(`edgeDropped`,this.handleGraphUpdate)},t.exports=s})),_=n(((e,t)=>{t.exports=function(e,t,n){var r,i,a,o,s,c,l,u,d,f,p=t.length,m=n.length,h=e.adjustSizes,g=e.barnesHutTheta*e.barnesHutTheta,_,v,y,b,x,S,C,w=[];for(a=0;a<p;a+=10)t[a+4]=t[a+2],t[a+5]=t[a+3],t[a+2]=0,t[a+3]=0;if(e.outboundAttractionDistribution){for(_=0,a=0;a<p;a+=10)_+=t[a+6];_/=p/10}if(e.barnesHutOptimize){var T=1/0,E=-1/0,D=1/0,O=-1/0,k,A,j;for(a=0;a<p;a+=10)T=Math.min(T,t[a+0]),E=Math.max(E,t[a+0]),D=Math.min(D,t[a+1]),O=Math.max(O,t[a+1]);var M=E-T,N=O-D;for(M>N?(D-=(M-N)/2,O=D+M):(T-=(N-M)/2,E=T+N),w[0]=-1,w[1]=(T+E)/2,w[2]=(D+O)/2,w[3]=Math.max(E-T,O-D),w[4]=-1,w[5]=-1,w[6]=0,w[7]=0,w[8]=0,r=1,a=0;a<p;a+=10)for(i=0,j=3;;)if(w[i+5]>=0){k=t[a+0]<w[i+1]?t[a+1]<w[i+2]?w[i+5]:w[i+5]+9:t[a+1]<w[i+2]?w[i+5]+18:w[i+5]+27,w[i+7]=(w[i+7]*w[i+6]+t[a+0]*t[a+6])/(w[i+6]+t[a+6]),w[i+8]=(w[i+8]*w[i+6]+t[a+1]*t[a+6])/(w[i+6]+t[a+6]),w[i+6]+=t[a+6],i=k;continue}else if(w[i+0]<0){w[i+0]=a;break}else{if(w[i+5]=r*9,u=w[i+3]/2,d=w[i+5],w[d+0]=-1,w[d+1]=w[i+1]-u,w[d+2]=w[i+2]-u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]-u,w[d+2]=w[i+2]+u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]+u,w[d+2]=w[i+2]-u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]+u,w[d+2]=w[i+2]+u,w[d+3]=u,w[d+4]=w[i+4],w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,r+=4,k=t[w[i+0]+0]<w[i+1]?t[w[i+0]+1]<w[i+2]?w[i+5]:w[i+5]+9:t[w[i+0]+1]<w[i+2]?w[i+5]+18:w[i+5]+27,w[i+6]=t[w[i+0]+6],w[i+7]=t[w[i+0]+0],w[i+8]=t[w[i+0]+1],w[k+0]=w[i+0],w[i+0]=-1,A=t[a+0]<w[i+1]?t[a+1]<w[i+2]?w[i+5]:w[i+5]+9:t[a+1]<w[i+2]?w[i+5]+18:w[i+5]+27,k===A){if(j--){i=k;continue}j=3;break}w[A+0]=a;break}}if(e.barnesHutOptimize)for(v=e.scalingRatio,a=0;a<p;a+=10)for(i=0;;)if(w[i+5]>=0){if(S=(t[a+0]-w[i+7])**2+(t[a+1]-w[i+8])**2,f=w[i+3],4*f*f/S<g){if(y=t[a+0]-w[i+7],b=t[a+1]-w[i+8],h===!0?S>0?(C=v*t[a+6]*w[i+6]/S,t[a+2]+=y*C,t[a+3]+=b*C):S<0&&(C=-v*t[a+6]*w[i+6]/Math.sqrt(S),t[a+2]+=y*C,t[a+3]+=b*C):S>0&&(C=v*t[a+6]*w[i+6]/S,t[a+2]+=y*C,t[a+3]+=b*C),i=w[i+4],i<0)break;continue}i=w[i+5];continue}else{if(c=w[i+0],c>=0&&c!==a&&(y=t[a+0]-t[c+0],b=t[a+1]-t[c+1],S=y*y+b*b,h===!0?S>0?(C=v*t[a+6]*t[c+6]/S,t[a+2]+=y*C,t[a+3]+=b*C):S<0&&(C=-v*t[a+6]*t[c+6]/Math.sqrt(S),t[a+2]+=y*C,t[a+3]+=b*C):S>0&&(C=v*t[a+6]*t[c+6]/S,t[a+2]+=y*C,t[a+3]+=b*C)),i=w[i+4],i<0)break;continue}else for(v=e.scalingRatio,o=0;o<p;o+=10)for(s=0;s<o;s+=10)y=t[o+0]-t[s+0],b=t[o+1]-t[s+1],h===!0?(S=Math.sqrt(y*y+b*b)-t[o+8]-t[s+8],S>0?(C=v*t[o+6]*t[s+6]/S/S,t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C):S<0&&(C=100*v*t[o+6]*t[s+6],t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C)):(S=Math.sqrt(y*y+b*b),S>0&&(C=v*t[o+6]*t[s+6]/S/S,t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C));for(d=e.gravity/e.scalingRatio,v=e.scalingRatio,a=0;a<p;a+=10)C=0,y=t[a+0],b=t[a+1],S=Math.sqrt(y**2+b**2),e.strongGravityMode?S>0&&(C=v*t[a+6]*d):S>0&&(C=v*t[a+6]*d/S),t[a+2]-=y*C,t[a+3]-=b*C;for(v=1*(e.outboundAttractionDistribution?_:1),l=0;l<m;l+=3)o=n[l+0],s=n[l+1],u=n[l+2],x=u**+e.edgeWeightInfluence,y=t[o+0]-t[s+0],b=t[o+1]-t[s+1],h===!0?(S=Math.sqrt(y*y+b*b)-t[o+8]-t[s+8],e.linLogMode?e.outboundAttractionDistribution?S>0&&(C=-v*x*Math.log(1+S)/S/t[o+6]):S>0&&(C=-v*x*Math.log(1+S)/S):e.outboundAttractionDistribution?S>0&&(C=-v*x/t[o+6]):S>0&&(C=-v*x)):(S=Math.sqrt(y**2+b**2),e.linLogMode?e.outboundAttractionDistribution?S>0&&(C=-v*x*Math.log(1+S)/S/t[o+6]):S>0&&(C=-v*x*Math.log(1+S)/S):e.outboundAttractionDistribution?(S=1,C=-v*x/t[o+6]):(S=1,C=-v*x)),S>0&&(t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C);var P,F,I,L,R,z;if(h===!0)for(a=0;a<p;a+=10)t[a+9]!==1&&(P=Math.sqrt(t[a+2]**2+t[a+3]**2),P>10&&(t[a+2]=t[a+2]*10/P,t[a+3]=t[a+3]*10/P),F=t[a+6]*Math.sqrt((t[a+4]-t[a+2])*(t[a+4]-t[a+2])+(t[a+5]-t[a+3])*(t[a+5]-t[a+3])),I=Math.sqrt((t[a+4]+t[a+2])*(t[a+4]+t[a+2])+(t[a+5]+t[a+3])*(t[a+5]+t[a+3]))/2,L=.1*Math.log(1+I)/(1+Math.sqrt(F)),R=t[a+0]+t[a+2]*(L/e.slowDown),t[a+0]=R,z=t[a+1]+t[a+3]*(L/e.slowDown),t[a+1]=z);else for(a=0;a<p;a+=10)t[a+9]!==1&&(F=t[a+6]*Math.sqrt((t[a+4]-t[a+2])*(t[a+4]-t[a+2])+(t[a+5]-t[a+3])*(t[a+5]-t[a+3])),I=Math.sqrt((t[a+4]+t[a+2])*(t[a+4]+t[a+2])+(t[a+5]+t[a+3])*(t[a+5]+t[a+3]))/2,L=t[a+7]*Math.log(1+I)/(1+Math.sqrt(F)),t[a+7]=Math.min(1,Math.sqrt(L*(t[a+2]**2+t[a+3]**2)/(1+Math.sqrt(F)))),R=t[a+0]+t[a+2]*(L/e.slowDown),t[a+0]=R,z=t[a+1]+t[a+3]*(L/e.slowDown),t[a+1]=z);return{}}})),v=n(((e,t)=>{var n=f(),r=p().createEdgeWeightGetter,i=_(),a=m(),o=h();function s(e,t,s){if(!n(t))throw Error(`graphology-layout-forceatlas2: the given graph is not a valid graphology instance.`);typeof s==`number`&&(s={iterations:s});var c=s.iterations;if(typeof c!=`number`)throw Error(`graphology-layout-forceatlas2: invalid number of iterations.`);if(c<=0)throw Error(`graphology-layout-forceatlas2: you should provide a positive number of iterations.`);var l=r(`getEdgeWeight`in s?s.getEdgeWeight:`weight`).fromEntry,u=typeof s.outputReducer==`function`?s.outputReducer:null,d=a.assign({},o,s.settings),f=a.validateSettings(d);if(f)throw Error(`graphology-layout-forceatlas2: `+f.message);for(var p=a.graphToByteArrays(t,l),m=0;m<c;m++)i(d,p.nodes,p.edges);if(e)a.assignLayoutChanges(t,p.nodes,u);else return a.collectLayoutChanges(t,p.nodes)}function c(e){var t=typeof e==`number`?e:e.order;return{barnesHutOptimize:t>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(t)}}var l=s.bind(null,!1);l.assign=s.bind(null,!0),l.inferSettings=c,t.exports=l})),y=e(t(),1),b=e(g(),1),x=v();function S(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t){if(e){if(typeof e==`string`)return S(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}function w(e){if(Array.isArray(e))return e}function T(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function E(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import"./studio-X7bnFrRe.js";import{a as e,n as t,r as n,t as r}from"./jsx-runtime-MZURdZre.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u}from"./graph-hRijsC89.js";var d=n(((e,t)=>{t.exports=function(){var e,t,n={};(function(){n.exports=function(e,t,n){var r,i,a,o,s,c,l,u,d,f,p=t.length,m=n.length,h=e.adjustSizes,g=e.barnesHutTheta*e.barnesHutTheta,_,v,y,b,x,S,C,w=[];for(a=0;a<p;a+=10)t[a+4]=t[a+2],t[a+5]=t[a+3],t[a+2]=0,t[a+3]=0;if(e.outboundAttractionDistribution){for(_=0,a=0;a<p;a+=10)_+=t[a+6];_/=p/10}if(e.barnesHutOptimize){var T=1/0,E=-1/0,D=1/0,O=-1/0,k,A,j;for(a=0;a<p;a+=10)T=Math.min(T,t[a+0]),E=Math.max(E,t[a+0]),D=Math.min(D,t[a+1]),O=Math.max(O,t[a+1]);var M=E-T,N=O-D;for(M>N?(D-=(M-N)/2,O=D+M):(T-=(N-M)/2,E=T+N),w[0]=-1,w[1]=(T+E)/2,w[2]=(D+O)/2,w[3]=Math.max(E-T,O-D),w[4]=-1,w[5]=-1,w[6]=0,w[7]=0,w[8]=0,r=1,a=0;a<p;a+=10)for(i=0,j=3;;)if(w[i+5]>=0){k=t[a+0]<w[i+1]?t[a+1]<w[i+2]?w[i+5]:w[i+5]+9:t[a+1]<w[i+2]?w[i+5]+18:w[i+5]+27,w[i+7]=(w[i+7]*w[i+6]+t[a+0]*t[a+6])/(w[i+6]+t[a+6]),w[i+8]=(w[i+8]*w[i+6]+t[a+1]*t[a+6])/(w[i+6]+t[a+6]),w[i+6]+=t[a+6],i=k;continue}else if(w[i+0]<0){w[i+0]=a;break}else{if(w[i+5]=r*9,u=w[i+3]/2,d=w[i+5],w[d+0]=-1,w[d+1]=w[i+1]-u,w[d+2]=w[i+2]-u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]-u,w[d+2]=w[i+2]+u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]+u,w[d+2]=w[i+2]-u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]+u,w[d+2]=w[i+2]+u,w[d+3]=u,w[d+4]=w[i+4],w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,r+=4,k=t[w[i+0]+0]<w[i+1]?t[w[i+0]+1]<w[i+2]?w[i+5]:w[i+5]+9:t[w[i+0]+1]<w[i+2]?w[i+5]+18:w[i+5]+27,w[i+6]=t[w[i+0]+6],w[i+7]=t[w[i+0]+0],w[i+8]=t[w[i+0]+1],w[k+0]=w[i+0],w[i+0]=-1,A=t[a+0]<w[i+1]?t[a+1]<w[i+2]?w[i+5]:w[i+5]+9:t[a+1]<w[i+2]?w[i+5]+18:w[i+5]+27,k===A){if(j--){i=k;continue}j=3;break}w[A+0]=a;break}}if(e.barnesHutOptimize)for(v=e.scalingRatio,a=0;a<p;a+=10)for(i=0;;)if(w[i+5]>=0){if(S=(t[a+0]-w[i+7])**2+(t[a+1]-w[i+8])**2,f=w[i+3],4*f*f/S<g){if(y=t[a+0]-w[i+7],b=t[a+1]-w[i+8],h===!0?S>0?(C=v*t[a+6]*w[i+6]/S,t[a+2]+=y*C,t[a+3]+=b*C):S<0&&(C=-v*t[a+6]*w[i+6]/Math.sqrt(S),t[a+2]+=y*C,t[a+3]+=b*C):S>0&&(C=v*t[a+6]*w[i+6]/S,t[a+2]+=y*C,t[a+3]+=b*C),i=w[i+4],i<0)break;continue}i=w[i+5];continue}else{if(c=w[i+0],c>=0&&c!==a&&(y=t[a+0]-t[c+0],b=t[a+1]-t[c+1],S=y*y+b*b,h===!0?S>0?(C=v*t[a+6]*t[c+6]/S,t[a+2]+=y*C,t[a+3]+=b*C):S<0&&(C=-v*t[a+6]*t[c+6]/Math.sqrt(S),t[a+2]+=y*C,t[a+3]+=b*C):S>0&&(C=v*t[a+6]*t[c+6]/S,t[a+2]+=y*C,t[a+3]+=b*C)),i=w[i+4],i<0)break;continue}else for(v=e.scalingRatio,o=0;o<p;o+=10)for(s=0;s<o;s+=10)y=t[o+0]-t[s+0],b=t[o+1]-t[s+1],h===!0?(S=Math.sqrt(y*y+b*b)-t[o+8]-t[s+8],S>0?(C=v*t[o+6]*t[s+6]/S/S,t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C):S<0&&(C=100*v*t[o+6]*t[s+6],t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C)):(S=Math.sqrt(y*y+b*b),S>0&&(C=v*t[o+6]*t[s+6]/S/S,t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C));for(d=e.gravity/e.scalingRatio,v=e.scalingRatio,a=0;a<p;a+=10)C=0,y=t[a+0],b=t[a+1],S=Math.sqrt(y**2+b**2),e.strongGravityMode?S>0&&(C=v*t[a+6]*d):S>0&&(C=v*t[a+6]*d/S),t[a+2]-=y*C,t[a+3]-=b*C;for(v=1*(e.outboundAttractionDistribution?_:1),l=0;l<m;l+=3)o=n[l+0],s=n[l+1],u=n[l+2],x=u**+e.edgeWeightInfluence,y=t[o+0]-t[s+0],b=t[o+1]-t[s+1],h===!0?(S=Math.sqrt(y*y+b*b)-t[o+8]-t[s+8],e.linLogMode?e.outboundAttractionDistribution?S>0&&(C=-v*x*Math.log(1+S)/S/t[o+6]):S>0&&(C=-v*x*Math.log(1+S)/S):e.outboundAttractionDistribution?S>0&&(C=-v*x/t[o+6]):S>0&&(C=-v*x)):(S=Math.sqrt(y**2+b**2),e.linLogMode?e.outboundAttractionDistribution?S>0&&(C=-v*x*Math.log(1+S)/S/t[o+6]):S>0&&(C=-v*x*Math.log(1+S)/S):e.outboundAttractionDistribution?(S=1,C=-v*x/t[o+6]):(S=1,C=-v*x)),S>0&&(t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C);var P,F,I,L,R,z;if(h===!0)for(a=0;a<p;a+=10)t[a+9]!==1&&(P=Math.sqrt(t[a+2]**2+t[a+3]**2),P>10&&(t[a+2]=t[a+2]*10/P,t[a+3]=t[a+3]*10/P),F=t[a+6]*Math.sqrt((t[a+4]-t[a+2])*(t[a+4]-t[a+2])+(t[a+5]-t[a+3])*(t[a+5]-t[a+3])),I=Math.sqrt((t[a+4]+t[a+2])*(t[a+4]+t[a+2])+(t[a+5]+t[a+3])*(t[a+5]+t[a+3]))/2,L=.1*Math.log(1+I)/(1+Math.sqrt(F)),R=t[a+0]+t[a+2]*(L/e.slowDown),t[a+0]=R,z=t[a+1]+t[a+3]*(L/e.slowDown),t[a+1]=z);else for(a=0;a<p;a+=10)t[a+9]!==1&&(F=t[a+6]*Math.sqrt((t[a+4]-t[a+2])*(t[a+4]-t[a+2])+(t[a+5]-t[a+3])*(t[a+5]-t[a+3])),I=Math.sqrt((t[a+4]+t[a+2])*(t[a+4]+t[a+2])+(t[a+5]+t[a+3])*(t[a+5]+t[a+3]))/2,L=t[a+7]*Math.log(1+I)/(1+Math.sqrt(F)),t[a+7]=Math.min(1,Math.sqrt(L*(t[a+2]**2+t[a+3]**2)/(1+Math.sqrt(F)))),R=t[a+0]+t[a+2]*(L/e.slowDown),t[a+0]=R,z=t[a+1]+t[a+3]*(L/e.slowDown),t[a+1]=z);return{}}})();var r=n.exports;self.addEventListener(`message`,function(n){var i=n.data;e=new Float32Array(i.nodes),i.edges&&(t=new Float32Array(i.edges)),r(i.settings,e,t),self.postMessage({nodes:e.buffer},[e.buffer])})}})),f=n(((e,t)=>{t.exports=function(e){return typeof e==`object`&&!!e&&typeof e.addUndirectedEdgeWithKey==`function`&&typeof e.dropNode==`function`&&typeof e.multi==`boolean`}})),p=n((e=>{function t(e){return typeof e!=`number`||isNaN(e)?1:e}function n(e,t){var n={},r=function(e){return e===void 0?t:e};typeof t==`function`&&(r=t);var i=function(t){return r(t[e])},a=function(){return r(void 0)};return typeof e==`string`?(n.fromAttributes=i,n.fromGraph=function(e,t){return i(e.getNodeAttributes(t))},n.fromEntry=function(e,t){return i(t)}):typeof e==`function`?(n.fromAttributes=function(){throw Error(`graphology-utils/getters/createNodeValueGetter: irrelevant usage.`)},n.fromGraph=function(t,n){return r(e(n,t.getNodeAttributes(n)))},n.fromEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=a,n.fromGraph=a,n.fromEntry=a),n}function r(e,t){var n={},r=function(e){return e===void 0?t:e};typeof t==`function`&&(r=t);var i=function(t){return r(t[e])},a=function(){return r(void 0)};return typeof e==`string`?(n.fromAttributes=i,n.fromGraph=function(e,t){return i(e.getEdgeAttributes(t))},n.fromEntry=function(e,t){return i(t)},n.fromPartialEntry=n.fromEntry,n.fromMinimalEntry=n.fromEntry):typeof e==`function`?(n.fromAttributes=function(){throw Error(`graphology-utils/getters/createEdgeValueGetter: irrelevant usage.`)},n.fromGraph=function(t,n){var i=t.extremities(n);return r(e(n,t.getEdgeAttributes(n),i[0],i[1],t.getNodeAttributes(i[0]),t.getNodeAttributes(i[1]),t.isUndirected(n)))},n.fromEntry=function(t,n,i,a,o,s,c){return r(e(t,n,i,a,o,s,c))},n.fromPartialEntry=function(t,n,i,a){return r(e(t,n,i,a))},n.fromMinimalEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=a,n.fromGraph=a,n.fromEntry=a,n.fromMinimalEntry=a),n}e.createNodeValueGetter=n,e.createEdgeValueGetter=r,e.createEdgeWeightGetter=function(e){return r(e,t)}})),m=n((e=>{e.assign=function(e){e||={};for(var t=Array.prototype.slice.call(arguments).slice(1),n=0,r,i=t.length;n<i;n++)if(t[n])for(r in t[n])e[r]=t[n][r];return e},e.validateSettings=function(e){return`linLogMode`in e&&typeof e.linLogMode!=`boolean`?{message:"the `linLogMode` setting should be a boolean."}:`outboundAttractionDistribution`in e&&typeof e.outboundAttractionDistribution!=`boolean`?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:`adjustSizes`in e&&typeof e.adjustSizes!=`boolean`?{message:"the `adjustSizes` setting should be a boolean."}:`edgeWeightInfluence`in e&&typeof e.edgeWeightInfluence!=`number`?{message:"the `edgeWeightInfluence` setting should be a number."}:`scalingRatio`in e&&!(typeof e.scalingRatio==`number`&&e.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:`strongGravityMode`in e&&typeof e.strongGravityMode!=`boolean`?{message:"the `strongGravityMode` setting should be a boolean."}:`gravity`in e&&!(typeof e.gravity==`number`&&e.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:`slowDown`in e&&!(typeof e.slowDown==`number`||e.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:`barnesHutOptimize`in e&&typeof e.barnesHutOptimize!=`boolean`?{message:"the `barnesHutOptimize` setting should be a boolean."}:`barnesHutTheta`in e&&!(typeof e.barnesHutTheta==`number`&&e.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},e.graphToByteArrays=function(e,t){var n=e.order,r=e.size,i={},a,o=new Float32Array(n*10),s=new Float32Array(r*3);return a=0,e.forEachNode(function(e,t){i[e]=a,o[a]=t.x,o[a+1]=t.y,o[a+2]=0,o[a+3]=0,o[a+4]=0,o[a+5]=0,o[a+6]=1,o[a+7]=1,o[a+8]=t.size||1,o[a+9]=+!!t.fixed,a+=10}),a=0,e.forEachEdge(function(e,n,r,c,l,u,d){var f=i[r],p=i[c],m=t(e,n,r,c,l,u,d);o[f+6]+=m,o[p+6]+=m,s[a]=f,s[a+1]=p,s[a+2]=m,a+=3}),{nodes:o,edges:s}},e.assignLayoutChanges=function(e,t,n){var r=0;e.updateEachNodeAttributes(function(e,i){return i.x=t[r],i.y=t[r+1],r+=10,n?n(e,i):i})},e.readGraphPositions=function(e,t){var n=0;e.forEachNode(function(e,r){t[n]=r.x,t[n+1]=r.y,n+=10})},e.collectLayoutChanges=function(e,t,n){for(var r=e.nodes(),i={},a=0,o=0,s=t.length;a<s;a+=10){if(n){var c=Object.assign({},e.getNodeAttributes(r[o]));c.x=t[a],c.y=t[a+1],c=n(r[o],c),i[r[o]]={x:c.x,y:c.y}}else i[r[o]]={x:t[a],y:t[a+1]};o++}return i},e.createWorker=function(e){var t=window.URL||window.webkitURL,n=e.toString(),r=t.createObjectURL(new Blob([`(`+n+`).call(this);`],{type:`text/javascript`})),i=new Worker(r);return t.revokeObjectURL(r),i}})),h=n(((e,t)=>{t.exports={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}})),g=n(((e,t)=>{var n=d(),r=f(),i=p().createEdgeWeightGetter,a=m(),o=h();function s(e,t){if(t||={},!r(e))throw Error(`graphology-layout-forceatlas2/worker: the given graph is not a valid graphology instance.`);var n=i(`getEdgeWeight`in t?t.getEdgeWeight:`weight`).fromEntry,s=a.assign({},o,t.settings),c=a.validateSettings(s);if(c)throw Error(`graphology-layout-forceatlas2/worker: `+c.message);this.worker=null,this.graph=e,this.settings=s,this.getEdgeWeight=n,this.matrices=null,this.running=!1,this.killed=!1,this.outputReducer=typeof t.outputReducer==`function`?t.outputReducer:null,this.handleMessage=this.handleMessage.bind(this);var l=void 0,u=this;this.handleGraphUpdate=function(){u.worker&&u.worker.terminate(),l&&clearTimeout(l),l=setTimeout(function(){l=void 0,u.spawnWorker()},0)},e.on(`nodeAdded`,this.handleGraphUpdate),e.on(`edgeAdded`,this.handleGraphUpdate),e.on(`nodeDropped`,this.handleGraphUpdate),e.on(`edgeDropped`,this.handleGraphUpdate),this.spawnWorker()}s.prototype.isRunning=function(){return this.running},s.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=a.createWorker(n),this.worker.addEventListener(`message`,this.handleMessage),this.running&&(this.running=!1,this.start())},s.prototype.handleMessage=function(e){if(this.running){var t=new Float32Array(e.data.nodes);a.assignLayoutChanges(this.graph,t,this.outputReducer),this.outputReducer&&a.readGraphPositions(this.graph,t),this.matrices.nodes=t,this.askForIterations()}},s.prototype.askForIterations=function(e){var t=this.matrices,n={settings:this.settings,nodes:t.nodes.buffer},r=[t.nodes.buffer];return e&&(n.edges=t.edges.buffer,r.push(t.edges.buffer)),this.worker.postMessage(n,r),this},s.prototype.start=function(){if(this.killed)throw Error(`graphology-layout-forceatlas2/worker.start: layout was killed.`);return this.running||(this.matrices=a.graphToByteArrays(this.graph,this.getEdgeWeight),this.running=!0,this.askForIterations(!0)),this},s.prototype.stop=function(){return this.running=!1,this},s.prototype.kill=function(){if(this.killed)return this;this.running=!1,this.killed=!0,this.matrices=null,this.worker.terminate(),this.graph.removeListener(`nodeAdded`,this.handleGraphUpdate),this.graph.removeListener(`edgeAdded`,this.handleGraphUpdate),this.graph.removeListener(`nodeDropped`,this.handleGraphUpdate),this.graph.removeListener(`edgeDropped`,this.handleGraphUpdate)},t.exports=s})),_=n(((e,t)=>{t.exports=function(e,t,n){var r,i,a,o,s,c,l,u,d,f,p=t.length,m=n.length,h=e.adjustSizes,g=e.barnesHutTheta*e.barnesHutTheta,_,v,y,b,x,S,C,w=[];for(a=0;a<p;a+=10)t[a+4]=t[a+2],t[a+5]=t[a+3],t[a+2]=0,t[a+3]=0;if(e.outboundAttractionDistribution){for(_=0,a=0;a<p;a+=10)_+=t[a+6];_/=p/10}if(e.barnesHutOptimize){var T=1/0,E=-1/0,D=1/0,O=-1/0,k,A,j;for(a=0;a<p;a+=10)T=Math.min(T,t[a+0]),E=Math.max(E,t[a+0]),D=Math.min(D,t[a+1]),O=Math.max(O,t[a+1]);var M=E-T,N=O-D;for(M>N?(D-=(M-N)/2,O=D+M):(T-=(N-M)/2,E=T+N),w[0]=-1,w[1]=(T+E)/2,w[2]=(D+O)/2,w[3]=Math.max(E-T,O-D),w[4]=-1,w[5]=-1,w[6]=0,w[7]=0,w[8]=0,r=1,a=0;a<p;a+=10)for(i=0,j=3;;)if(w[i+5]>=0){k=t[a+0]<w[i+1]?t[a+1]<w[i+2]?w[i+5]:w[i+5]+9:t[a+1]<w[i+2]?w[i+5]+18:w[i+5]+27,w[i+7]=(w[i+7]*w[i+6]+t[a+0]*t[a+6])/(w[i+6]+t[a+6]),w[i+8]=(w[i+8]*w[i+6]+t[a+1]*t[a+6])/(w[i+6]+t[a+6]),w[i+6]+=t[a+6],i=k;continue}else if(w[i+0]<0){w[i+0]=a;break}else{if(w[i+5]=r*9,u=w[i+3]/2,d=w[i+5],w[d+0]=-1,w[d+1]=w[i+1]-u,w[d+2]=w[i+2]-u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]-u,w[d+2]=w[i+2]+u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]+u,w[d+2]=w[i+2]-u,w[d+3]=u,w[d+4]=d+9,w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,d+=9,w[d+0]=-1,w[d+1]=w[i+1]+u,w[d+2]=w[i+2]+u,w[d+3]=u,w[d+4]=w[i+4],w[d+5]=-1,w[d+6]=0,w[d+7]=0,w[d+8]=0,r+=4,k=t[w[i+0]+0]<w[i+1]?t[w[i+0]+1]<w[i+2]?w[i+5]:w[i+5]+9:t[w[i+0]+1]<w[i+2]?w[i+5]+18:w[i+5]+27,w[i+6]=t[w[i+0]+6],w[i+7]=t[w[i+0]+0],w[i+8]=t[w[i+0]+1],w[k+0]=w[i+0],w[i+0]=-1,A=t[a+0]<w[i+1]?t[a+1]<w[i+2]?w[i+5]:w[i+5]+9:t[a+1]<w[i+2]?w[i+5]+18:w[i+5]+27,k===A){if(j--){i=k;continue}j=3;break}w[A+0]=a;break}}if(e.barnesHutOptimize)for(v=e.scalingRatio,a=0;a<p;a+=10)for(i=0;;)if(w[i+5]>=0){if(S=(t[a+0]-w[i+7])**2+(t[a+1]-w[i+8])**2,f=w[i+3],4*f*f/S<g){if(y=t[a+0]-w[i+7],b=t[a+1]-w[i+8],h===!0?S>0?(C=v*t[a+6]*w[i+6]/S,t[a+2]+=y*C,t[a+3]+=b*C):S<0&&(C=-v*t[a+6]*w[i+6]/Math.sqrt(S),t[a+2]+=y*C,t[a+3]+=b*C):S>0&&(C=v*t[a+6]*w[i+6]/S,t[a+2]+=y*C,t[a+3]+=b*C),i=w[i+4],i<0)break;continue}i=w[i+5];continue}else{if(c=w[i+0],c>=0&&c!==a&&(y=t[a+0]-t[c+0],b=t[a+1]-t[c+1],S=y*y+b*b,h===!0?S>0?(C=v*t[a+6]*t[c+6]/S,t[a+2]+=y*C,t[a+3]+=b*C):S<0&&(C=-v*t[a+6]*t[c+6]/Math.sqrt(S),t[a+2]+=y*C,t[a+3]+=b*C):S>0&&(C=v*t[a+6]*t[c+6]/S,t[a+2]+=y*C,t[a+3]+=b*C)),i=w[i+4],i<0)break;continue}else for(v=e.scalingRatio,o=0;o<p;o+=10)for(s=0;s<o;s+=10)y=t[o+0]-t[s+0],b=t[o+1]-t[s+1],h===!0?(S=Math.sqrt(y*y+b*b)-t[o+8]-t[s+8],S>0?(C=v*t[o+6]*t[s+6]/S/S,t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C):S<0&&(C=100*v*t[o+6]*t[s+6],t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C)):(S=Math.sqrt(y*y+b*b),S>0&&(C=v*t[o+6]*t[s+6]/S/S,t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C));for(d=e.gravity/e.scalingRatio,v=e.scalingRatio,a=0;a<p;a+=10)C=0,y=t[a+0],b=t[a+1],S=Math.sqrt(y**2+b**2),e.strongGravityMode?S>0&&(C=v*t[a+6]*d):S>0&&(C=v*t[a+6]*d/S),t[a+2]-=y*C,t[a+3]-=b*C;for(v=1*(e.outboundAttractionDistribution?_:1),l=0;l<m;l+=3)o=n[l+0],s=n[l+1],u=n[l+2],x=u**+e.edgeWeightInfluence,y=t[o+0]-t[s+0],b=t[o+1]-t[s+1],h===!0?(S=Math.sqrt(y*y+b*b)-t[o+8]-t[s+8],e.linLogMode?e.outboundAttractionDistribution?S>0&&(C=-v*x*Math.log(1+S)/S/t[o+6]):S>0&&(C=-v*x*Math.log(1+S)/S):e.outboundAttractionDistribution?S>0&&(C=-v*x/t[o+6]):S>0&&(C=-v*x)):(S=Math.sqrt(y**2+b**2),e.linLogMode?e.outboundAttractionDistribution?S>0&&(C=-v*x*Math.log(1+S)/S/t[o+6]):S>0&&(C=-v*x*Math.log(1+S)/S):e.outboundAttractionDistribution?(S=1,C=-v*x/t[o+6]):(S=1,C=-v*x)),S>0&&(t[o+2]+=y*C,t[o+3]+=b*C,t[s+2]-=y*C,t[s+3]-=b*C);var P,F,I,L,R,z;if(h===!0)for(a=0;a<p;a+=10)t[a+9]!==1&&(P=Math.sqrt(t[a+2]**2+t[a+3]**2),P>10&&(t[a+2]=t[a+2]*10/P,t[a+3]=t[a+3]*10/P),F=t[a+6]*Math.sqrt((t[a+4]-t[a+2])*(t[a+4]-t[a+2])+(t[a+5]-t[a+3])*(t[a+5]-t[a+3])),I=Math.sqrt((t[a+4]+t[a+2])*(t[a+4]+t[a+2])+(t[a+5]+t[a+3])*(t[a+5]+t[a+3]))/2,L=.1*Math.log(1+I)/(1+Math.sqrt(F)),R=t[a+0]+t[a+2]*(L/e.slowDown),t[a+0]=R,z=t[a+1]+t[a+3]*(L/e.slowDown),t[a+1]=z);else for(a=0;a<p;a+=10)t[a+9]!==1&&(F=t[a+6]*Math.sqrt((t[a+4]-t[a+2])*(t[a+4]-t[a+2])+(t[a+5]-t[a+3])*(t[a+5]-t[a+3])),I=Math.sqrt((t[a+4]+t[a+2])*(t[a+4]+t[a+2])+(t[a+5]+t[a+3])*(t[a+5]+t[a+3]))/2,L=t[a+7]*Math.log(1+I)/(1+Math.sqrt(F)),t[a+7]=Math.min(1,Math.sqrt(L*(t[a+2]**2+t[a+3]**2)/(1+Math.sqrt(F)))),R=t[a+0]+t[a+2]*(L/e.slowDown),t[a+0]=R,z=t[a+1]+t[a+3]*(L/e.slowDown),t[a+1]=z);return{}}})),v=n(((e,t)=>{var n=f(),r=p().createEdgeWeightGetter,i=_(),a=m(),o=h();function s(e,t,s){if(!n(t))throw Error(`graphology-layout-forceatlas2: the given graph is not a valid graphology instance.`);typeof s==`number`&&(s={iterations:s});var c=s.iterations;if(typeof c!=`number`)throw Error(`graphology-layout-forceatlas2: invalid number of iterations.`);if(c<=0)throw Error(`graphology-layout-forceatlas2: you should provide a positive number of iterations.`);var l=r(`getEdgeWeight`in s?s.getEdgeWeight:`weight`).fromEntry,u=typeof s.outputReducer==`function`?s.outputReducer:null,d=a.assign({},o,s.settings),f=a.validateSettings(d);if(f)throw Error(`graphology-layout-forceatlas2: `+f.message);for(var p=a.graphToByteArrays(t,l),m=0;m<c;m++)i(d,p.nodes,p.edges);if(e)a.assignLayoutChanges(t,p.nodes,u);else return a.collectLayoutChanges(t,p.nodes)}function c(e){var t=typeof e==`number`?e:e.order;return{barnesHutOptimize:t>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(t)}}var l=s.bind(null,!1);l.assign=s.bind(null,!0),l.inferSettings=c,t.exports=l})),y=e(t(),1),b=e(g(),1),x=v();function S(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t){if(e){if(typeof e==`string`)return S(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}function w(e){if(Array.isArray(e))return e}function T(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function E(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D(e,t){return w(e)||T(e,t)||C(e,t)||E()}function O(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=C(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function k(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function A(e,t,n){return e[0]=t,e[4]=typeof n==`number`?n:t,e}function j(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function M(e,t,n){return e[6]=t,e[7]=n,e}function N(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=t[0],f=t[1],p=t[2],m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8];return e[0]=d*n+f*a+p*c,e[1]=d*r+f*o+p*l,e[2]=d*i+f*s+p*u,e[3]=m*n+h*a+g*c,e[4]=m*r+h*o+g*l,e[5]=m*i+h*s+g*u,e[6]=_*n+v*a+y*c,e[7]=_*r+v*o+y*l,e[8]=_*i+v*s+y*u,e}function P(e,t){var n=Math.cos(t),r=Math.sin(t);return{x:n*e.x+r*e.y,y:-r*e.x+n*e.y}}function F(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],i=e[1],a=e[3],o=e[4],s=e[6],c=e[7],l=t.x,u=t.y;return{x:l*r+u*a+s*n,y:l*i+u*o+c*n}}function I(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function L(e,t,n,r,i){var a=e.angle,o=e.ratio,s=e.x,c=e.y,l=t.width,u=t.height,d=k(),f=Math.min(l,u)-2*r,p=I(t,n);return i?(N(d,M(k(),s,c)),N(d,A(k(),o)),N(d,j(k(),a)),N(d,A(k(),l/f/2/p,u/f/2/p))):(N(d,A(k(),f/l*2*p,f/u*2*p)),N(d,j(k(),-a)),N(d,A(k(),1/o)),N(d,M(k(),-s,-c))),d}function R(e,t,n){var r=F(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),i=r.x,a=r.y;return 1/Math.sqrt(i**2+a**2)/n.width}function z(e,t,n,r,i){return[Math.floor(t/i*r),Math.floor(e.drawingBufferHeight/i-n/i*r)]}var ee={black:`#000000`,silver:`#C0C0C0`,gray:`#808080`,grey:`#808080`,white:`#FFFFFF`,maroon:`#800000`,red:`#FF0000`,purple:`#800080`,fuchsia:`#FF00FF`,green:`#008000`,lime:`#00FF00`,olive:`#808000`,yellow:`#FFFF00`,navy:`#000080`,blue:`#0000FF`,teal:`#008080`,aqua:`#00FFFF`,darkblue:`#00008B`,mediumblue:`#0000CD`,darkgreen:`#006400`,darkcyan:`#008B8B`,deepskyblue:`#00BFFF`,darkturquoise:`#00CED1`,mediumspringgreen:`#00FA9A`,springgreen:`#00FF7F`,cyan:`#00FFFF`,midnightblue:`#191970`,dodgerblue:`#1E90FF`,lightseagreen:`#20B2AA`,forestgreen:`#228B22`,seagreen:`#2E8B57`,darkslategray:`#2F4F4F`,darkslategrey:`#2F4F4F`,limegreen:`#32CD32`,mediumseagreen:`#3CB371`,turquoise:`#40E0D0`,royalblue:`#4169E1`,steelblue:`#4682B4`,darkslateblue:`#483D8B`,mediumturquoise:`#48D1CC`,indigo:`#4B0082`,darkolivegreen:`#556B2F`,cadetblue:`#5F9EA0`,cornflowerblue:`#6495ED`,rebeccapurple:`#663399`,mediumaquamarine:`#66CDAA`,dimgray:`#696969`,dimgrey:`#696969`,slateblue:`#6A5ACD`,olivedrab:`#6B8E23`,slategray:`#708090`,slategrey:`#708090`,lightslategray:`#778899`,lightslategrey:`#778899`,mediumslateblue:`#7B68EE`,lawngreen:`#7CFC00`,chartreuse:`#7FFF00`,aquamarine:`#7FFFD4`,skyblue:`#87CEEB`,lightskyblue:`#87CEFA`,blueviolet:`#8A2BE2`,darkred:`#8B0000`,darkmagenta:`#8B008B`,saddlebrown:`#8B4513`,darkseagreen:`#8FBC8F`,lightgreen:`#90EE90`,mediumpurple:`#9370DB`,darkviolet:`#9400D3`,palegreen:`#98FB98`,darkorchid:`#9932CC`,yellowgreen:`#9ACD32`,sienna:`#A0522D`,brown:`#A52A2A`,darkgray:`#A9A9A9`,darkgrey:`#A9A9A9`,lightblue:`#ADD8E6`,greenyellow:`#ADFF2F`,paleturquoise:`#AFEEEE`,lightsteelblue:`#B0C4DE`,powderblue:`#B0E0E6`,firebrick:`#B22222`,darkgoldenrod:`#B8860B`,mediumorchid:`#BA55D3`,rosybrown:`#BC8F8F`,darkkhaki:`#BDB76B`,mediumvioletred:`#C71585`,indianred:`#CD5C5C`,peru:`#CD853F`,chocolate:`#D2691E`,tan:`#D2B48C`,lightgray:`#D3D3D3`,lightgrey:`#D3D3D3`,thistle:`#D8BFD8`,orchid:`#DA70D6`,goldenrod:`#DAA520`,palevioletred:`#DB7093`,crimson:`#DC143C`,gainsboro:`#DCDCDC`,plum:`#DDA0DD`,burlywood:`#DEB887`,lightcyan:`#E0FFFF`,lavender:`#E6E6FA`,darksalmon:`#E9967A`,violet:`#EE82EE`,palegoldenrod:`#EEE8AA`,lightcoral:`#F08080`,khaki:`#F0E68C`,aliceblue:`#F0F8FF`,honeydew:`#F0FFF0`,azure:`#F0FFFF`,sandybrown:`#F4A460`,wheat:`#F5DEB3`,beige:`#F5F5DC`,whitesmoke:`#F5F5F5`,mintcream:`#F5FFFA`,ghostwhite:`#F8F8FF`,salmon:`#FA8072`,antiquewhite:`#FAEBD7`,linen:`#FAF0E6`,lightgoldenrodyellow:`#FAFAD2`,oldlace:`#FDF5E6`,magenta:`#FF00FF`,deeppink:`#FF1493`,orangered:`#FF4500`,tomato:`#FF6347`,hotpink:`#FF69B4`,coral:`#FF7F50`,darkorange:`#FF8C00`,lightsalmon:`#FFA07A`,orange:`#FFA500`,lightpink:`#FFB6C1`,pink:`#FFC0CB`,gold:`#FFD700`,peachpuff:`#FFDAB9`,navajowhite:`#FFDEAD`,moccasin:`#FFE4B5`,bisque:`#FFE4C4`,mistyrose:`#FFE4E1`,blanchedalmond:`#FFEBCD`,papayawhip:`#FFEFD5`,lavenderblush:`#FFF0F5`,seashell:`#FFF5EE`,cornsilk:`#FFF8DC`,lemonchiffon:`#FFFACD`,floralwhite:`#FFFAF0`,snow:`#FFFAFA`,lightyellow:`#FFFFE0`,ivory:`#FFFFF0`},te=new Int8Array(4),ne=new Int32Array(te.buffer,0,1),re=new Float32Array(te.buffer,0,1),ie=/^\s*rgba?\s*\(/,ae=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function oe(e){var t=0,n=0,r=0,i=1,a=e.toLowerCase();if(a===`transparent`)return{r:0,g:0,b:0,a:0};if(a in ee)return oe(ee[a]);if(e[0]===`#`)e.length===4?(t=parseInt(e.charAt(1)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(2),16),r=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(4),16),r=parseInt(e.charAt(5)+e.charAt(6),16)),e.length===9&&(i=parseInt(e.charAt(7)+e.charAt(8),16)/255);else if(ie.test(e)){var o=e.match(ae);o&&(t=+o[1],n=+o[2],r=+o[3],o[4]&&(i=+o[4]))}return{r:t,g:n,b:r,a:i}}function se(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=oe(e),r=n.r,i=n.g,a=n.b,o=n.a;return t?[r/255*o,i/255*o,a/255*o,o]:[r/255,i/255,a/255,o]}var ce={};for(var le in ee)ce[le]=de(ee[le]),ce[ee[le]]=ce[le];function ue(e,t,n,r,i){return ne[0]=r<<24|n<<16|t<<8|e,i&&(ne[0]&=4278190079),re[0]}function de(e){if(e=e.toLowerCase(),ce[e]!==void 0)return ce[e];var t=oe(e),n=t.r,r=t.g,i=t.b,a=t.a;a=a*255|0;var o=ue(n,r,i,a,!0);return ce[e]=o,o}function fe(e,t){re[0]=de(e);var n=ne[0];return t&&(n|=16777216),[n&255,n>>8&255,n>>16&255,n>>24&255]}function pe(e){var t=e>>>8&255,n=e>>>16&255,r=e>>>24&255;return((e&255)<<24|r<<16|n<<8|t)>>>0}function me(e,t,n,r){return(n<<24|t<<16|e<<8|r)>>>0}function he(e,t,n,r,i,a){var o=D(z(e,n,r,i,a),2),s=o[0],c=o[1],l=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(s,c,1,1,e.RGBA,e.UNSIGNED_BYTE,l);var u=D(l,4);return[u[0],u[1],u[2],u[3]]}function ge(e){var t=oe(e),n=t.r,r=t.g,i=t.b,a=t.a;return`vec4(${(n/255).toFixed(6)}, ${(r/255).toFixed(6)}, ${(i/255).toFixed(6)}, ${a.toFixed(6)})`}function _e(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ve(e){var t=_e(e,`string`);return typeof t==`symbol`?t:t+``}function B(e,t,n){return(t=ve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ye(Object(n),!0).forEach(function(t){B(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function H(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,ve(r.key),r)}}function U(e,t,n){return t&&be(e.prototype,t),n&&be(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xe(e){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xe(e)}function Se(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Se=function(){return!!e})()}function Ce(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function we(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Ce(e)}function W(e,t,n){return t=xe(t),we(e,Se()?Reflect.construct(t,n||[],xe(e).constructor):t.apply(e,n))}function Te(e,t){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Te(e,t)}function G(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Te(e,t)}function Ee(e){if(Array.isArray(e))return S(e)}function De(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Oe(){throw TypeError(`Invalid attempt to spread non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K(e){return Ee(e)||De(e)||C(e)||Oe()}function q(e){"@babel/helpers - typeof";return q=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},q(e)}function ke(e){return q(e)===`object`&&e!==null&&`attribute`in e}function Ae(){return{name:`circle`,glsl:`
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/graph-canvas-BdNk2F9O.js","assets/studio-X7bnFrRe.js","assets/jsx-runtime-MZURdZre.js","assets/marked.esm-vFuq1cCd.js"])))=>i.map(i=>d[i]);
2
+ import{Lt as e,h as t}from"./index-D5oGyvG8.js";import"./studio-X7bnFrRe.js";import{a as n,i as r,n as i,t as a}from"./jsx-runtime-MZURdZre.js";import{it as o,nt as s,r as c}from"./button-upSzkd-q.js";import{t as l}from"./cn-BCnYnarL.js";import{s as u,ut as d}from"./studio-queries-CKtAnIKP.js";import{n as f,r as p,t as m}from"./panel-CDQ6Lryw.js";import{a as h,i as g,o as _,s as v,t as y}from"./specs-view-C6t3Y5IT.js";import{t as b}from"./preload-helper-BLdHbfdN.js";var x=n(i(),1),S={repository:8,area:5,capability:2.5},C=e=>`e${e}`;function w(e,t){let n=2166136261^t;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),16777619);return(n>>>0)%1e5/1e5}function T(e,t,n){let r=w(t,1)*Math.PI*2,i=n*(.35+.65*w(t,2));return{x:e.x+Math.cos(r)*i,y:e.y+Math.sin(r)*i}}function E(e){let t=e.nodes.map(()=>({x:0,y:0})),n=e.nodes.flatMap((e,t)=>e.kind===`repository`?[t]:[]),r=Math.sqrt(e.nodes.length)*10;n.forEach((e,i)=>{let a=i/Math.max(1,n.length)*Math.PI*2;t[e]=n.length===1?{x:0,y:0}:{x:Math.cos(a)*r,y:Math.sin(a)*r}});let i=new Map,a=new Map;return O(e,(e,t,n)=>{n===`in`&&a.set(e,t),n===`binds`&&!i.has(e)&&i.set(e,t)}),e.nodes.forEach((e,n)=>{if(e.kind!==`area`)return;let i=a.get(n);t[n]=T(i===void 0?{x:0,y:0}:t[i],e.id,r/2)}),e.nodes.forEach((e,n)=>{if(e.kind!==`capability`)return;let a=i.get(n);t[n]=a===void 0?T({x:0,y:0},e.id,r*1.4):T(t[a],e.id,r/5)}),t}function D(e,t){if(!t)return{positions:E(e),missing:e.nodes.length};let n=e.nodes.map(e=>t.get(e.id)),r=n.filter(e=>!e).length;if(r===0)return{positions:n,missing:r};let i=new Map,a=(e,t)=>{let r=n[t];if(n[e]||!r)return;let a=i.get(e)??{x:0,y:0,count:0};i.set(e,{x:a.x+r.x,y:a.y+r.y,count:a.count+1})};O(e,(e,t)=>{a(e,t),a(t,e)});let o=E(e);return{positions:n.map((t,n)=>{if(t)return t;let r=i.get(n);return r?T({x:r.x/r.count,y:r.y/r.count},e.nodes[n].id,1):o[n]}),missing:r}}function O(e,t){for(let n=0,r=0;n<e.edges.length;n+=4,r++)t(e.edges[n],e.edges[n+1],g[e.edges[n+2]],e.edges[n+3],r)}var k={hidden:new Set,minWeight:1};function A(e,t){return t.hidden.has(e.kind)?!1:e.kind!==`co-change`||e.weight>=t.minWeight}function j(e){return e.kind===`binds`||e.kind===`in`?.3:e.kind===`mentions`?1:Math.min(4,e.weight)}function M(e,t,n=8){let r=t.trim().toLowerCase();if(!r)return[];let i={capability:0,area:1,repository:2};return e.nodes.filter(e=>[e.label,e.area,e.repository].some(e=>e?.toLowerCase().includes(r))).toSorted((e,t)=>Number(t.label.toLowerCase()===r)-Number(e.label.toLowerCase()===r)||i[e.kind]-i[t.kind]||e.label.localeCompare(t.label)).slice(0,n)}function ee(e){let t=new Map(e.nodes.map((e,t)=>[e.id,t])),n=e.nodes.map(()=>[]);return O(e,(e,t,r,i,a)=>{n[e].push({other:t,kind:r,edge:a,outgoing:!0}),n[t].push({other:e,kind:r,edge:a,outgoing:!1})}),{byId:t,links:n}}function te(e,t,n){let r=new Set(e.history[n]);return e.history[t].flatMap(t=>r.has(t)?[e.archives[t]]:[])}function N(e,t){let n=t*4;return!Number.isInteger(t)||t<0||n>=e.edges.length?null:{source:e.edges[n],target:e.edges[n+1],kind:g[e.edges[n+2]],weight:e.edges[n+3]}}function P(e,t,n){if(`edge`in n){let t=N(e,n.edge);return t?`Connection ${e.nodes[t.source].label} and ${e.nodes[t.target].label}`:`Connection`}let r=t.byId.get(n.node);if(r===void 0)return`Graph`;let i=e.nodes[r];return`${F[i.kind]} ${i.label}`}var F={capability:`Spec`,area:`Area`,repository:`Repository`};function I(e){return e?`edge`in e?`edge:${e.edge}`:e.node:null}function L(e){return e.kind===`capability`?`spec`:e.kind===`area`?e.repository??``:`repository`}var R=a(),z={"proposal.md":`proposal`,"design.md":`design`,"tasks.md":`tasks`,"verification.md":`verification`},B=e=>e.label;function V({search:e,path:t,children:n}){return(0,R.jsx)(d,{className:`text-sm`,to:`/vault`,search:{companion:e.companion,studioMode:e.studioMode,path:t},children:n})}function H({archive:e,capabilities:t,search:n}){return(0,R.jsxs)(`li`,{className:`grid gap-1 border-t border-rule-soft py-2 first:border-t-0`,"data-archive":e.anchor,children:[(0,R.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate font-mono text-sm`,children:e.name}),(0,R.jsx)(`time`,{className:`ml-auto font-mono text-2xs text-muted`,dateTime:e.archivedOn,children:e.archivedOn})]}),(0,R.jsxs)(`span`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:[e.artifacts.map(t=>(0,R.jsx)(V,{search:n,path:_(e.anchor,t),children:z[t]??t},t)),t.map(r=>(0,R.jsx)(V,{search:n,path:_(e.anchor,`specs/${r}/spec.md`),children:t.length>1?`${r} delta`:`delta spec`},r))]})]})}function U({archives:e,capabilities:t,search:n,empty:r}){return e.length===0?(0,R.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:r}):(0,R.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.map(e=>(0,R.jsx)(H,{archive:e,capabilities:t,search:n},e.anchor))})}function W({nodes:e,onSelectNode:t}){return(0,R.jsx)(`ul`,{className:`m-0 grid list-none gap-0.5 p-0`,children:e.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsx)(`button`,{type:`button`,className:l(`w-full truncate rounded-[4px] border-0 bg-transparent px-1.5 py-0.5 text-left text-sm text-text hover:bg-surface`,e.kind===`capability`&&`font-mono`),"data-graph-node":e.id,onClick:()=>t(e.id),children:e.label})},e.id))})}function G(e,t,n,r,i){return t.links[n].flatMap(t=>t.kind===r&&(i===void 0||t.outgoing===i)?[e.nodes[t.other]]:[]).toSorted((e,t)=>e.label.localeCompare(t.label))}function K({wire:e,index:t,search:n,onSelectNode:r,node:i}){let a=B(e.nodes[i]),o=G(e,t,i,`binds`,!0).map(({repository:e,area:t})=>({repository:e,area:t})),s=e.history[i].map(t=>e.archives[t]),c=G(e,t,i,`mentions`,!0),l=G(e,t,i,`mentions`,!1),u=G(e,t,i,`co-change`);return(0,R.jsxs)(y,{spec:{capability:a,scopes:o},companion:n.companion,withStatus:!1,children:[(0,R.jsx)(f,{title:`History`,aside:`${s.length} archived`,children:(0,R.jsx)(U,{archives:s,capabilities:[a],search:n,empty:`No archived change names this spec.`})}),c.length+l.length+u.length>0?(0,R.jsxs)(f,{title:`Connected specs`,children:[c.length>0?(0,R.jsx)(q,{label:`Mentions`,nodes:c,onSelectNode:r}):null,l.length>0?(0,R.jsx)(q,{label:`Mentioned by`,nodes:l,onSelectNode:r}):null,u.length>0?(0,R.jsx)(q,{label:`Changed together`,nodes:u,onSelectNode:r}):null]}):null]})}function q({label:e,nodes:t,onSelectNode:n}){return(0,R.jsxs)(`div`,{className:`grid gap-1`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted`,children:e}),(0,R.jsx)(W,{nodes:t,onSelectNode:n})]})}function J({wire:e,index:t,onSelectNode:n,node:r}){let i=e.nodes[r],a=G(e,t,r,`binds`,!1),o=G(e,t,r,`in`,!0)[0];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(m,{mono:i.area!==`.`,title:i.label,kicker:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{children:`Area`}),o?(0,R.jsx)(`button`,{type:`button`,className:`ml-auto border-0 bg-transparent p-0 font-mono text-xs text-muted hover:text-text`,onClick:()=>n(o.id),children:o.label}):null]})}),(0,R.jsx)(f,{title:`Capabilities`,aside:a.length,children:(0,R.jsx)(W,{nodes:a,onSelectNode:n})})]})}function Y({wire:e,index:t,onSelectNode:n,node:r}){let i=e.nodes[r],a=G(e,t,r,`in`,!1);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(m,{mono:!0,title:i.label,kicker:(0,R.jsx)(`span`,{children:`Repository`})}),a.map(r=>{let i=G(e,t,t.byId.get(r.id),`binds`,!1);return(0,R.jsxs)(f,{title:r.area===`.`?h:r.label,aside:i.length,children:[(0,R.jsx)(`button`,{type:`button`,className:`justify-self-start border-0 bg-transparent p-0 text-xs text-muted hover:text-text`,onClick:()=>n(r.id),children:`Open Area`}),(0,R.jsx)(W,{nodes:i,onSelectNode:n})]},r.id)})]})}var X={binds:`Binds`,in:`In repository`,mentions:`Mentions`,"co-change":`Changed together`};function Z({wire:e,search:t,onSelectNode:n,edge:r}){let i=N(e,r);if(!i)return(0,R.jsx)(`p`,{className:`m-0 px-5 py-4 text-sm text-muted`,children:`This connection is no longer in the graph.`});let a=e.nodes[i.source],o=e.nodes[i.target],s=i.kind===`co-change`?te(e,i.source,i.target):[];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(m,{title:X[i.kind],kicker:i.kind===`co-change`?(0,R.jsx)(`span`,{children:`${i.weight} shared archived ${i.weight===1?`change`:`changes`}`}):null,children:(0,R.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5 font-mono text-sm`,children:[(0,R.jsx)(`button`,{type:`button`,className:`border-0 bg-transparent p-0 text-accent`,onClick:()=>n(a.id),children:a.label}),(0,R.jsx)(`span`,{className:`text-muted`,"aria-hidden":`true`,children:i.kind===`co-change`?`↔`:`→`}),(0,R.jsx)(`button`,{type:`button`,className:`border-0 bg-transparent p-0 text-accent`,onClick:()=>n(o.id),children:o.label})]})}),i.kind===`co-change`?(0,R.jsx)(f,{title:`Archived changes`,aside:s.length,children:(0,R.jsx)(U,{archives:s,capabilities:[a.label,o.label],search:t,empty:`No archive names both specs.`})}):null]})}function ne({selection:e,...t}){if(`edge`in e)return(0,R.jsx)(Z,{...t,edge:e.edge});let n=t.index.byId.get(e.node);if(n===void 0)return null;let r=t.wire.nodes[n].kind;return r===`capability`?(0,R.jsx)(K,{...t,node:n}):r===`area`?(0,R.jsx)(J,{...t,node:n}):(0,R.jsx)(Y,{...t,node:n})}var re=(0,x.lazy)(()=>b(()=>import(`./graph-canvas-BdNk2F9O.js`),__vite__mapDeps([0,1,2,3]))),ie={binds:`Areas`,in:`Repositories`,mentions:`Mentions`,"co-change":`Changed together`};function ae({search:t,node:n,onNodeChange:r}){let i=e({...u(t.companion??``),enabled:!!t.companion});return i.data?(0,R.jsx)(oe,{wire:i.data,search:t,node:n,onNodeChange:r}):i.isError?(0,R.jsx)(`section`,{className:l(o,`pb-10`),children:(0,R.jsxs)(s,{children:[`The spec graph could not be built: `,i.error.message]})}):(0,R.jsx)(`section`,{className:l(o,`pb-10`),children:(0,R.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Building the spec graph…`})})}function oe({wire:e,search:t,node:n,onNodeChange:r}){let i=(0,x.useMemo)(()=>ee(e),[e]),[a,c]=(0,x.useState)(k),[u,d]=(0,x.useState)(null),f=u?.wire===e?u.edge:null,[m,h]=(0,x.useState)(null),g=e.nodes.filter(e=>e.kind===`capability`).length,_=n!==void 0&&i.byId.has(n)?n:null,v=f===null?_?{node:_}:null:{edge:f},y=e=>{d(null),r(e??void 0)},b=e=>{y(e),h(t=>({id:e,nonce:(t?.nonce??0)+1}))};if(g===0)return(0,R.jsx)(`section`,{className:l(o,`pb-10`),children:(0,R.jsx)(s,{children:`No specs in this companion.`})});let S=I(v);return(0,R.jsxs)(`section`,{className:l(o,`flex min-h-[480px] flex-1 flex-col gap-2 pb-4`),"aria-label":`Spec graph`,"data-graph-view":!0,children:[(0,R.jsx)(se,{wire:e,filter:a,onFilter:c,onFocus:b}),(0,R.jsx)(Q,{wire:e,onSelectNode:b}),(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden rounded-card border border-rule`,children:[(0,R.jsx)(x.Suspense,{fallback:(0,R.jsx)(`p`,{className:`m-0 p-4 text-sm text-muted`,children:`Loading the renderer…`}),children:(0,R.jsx)(re,{wire:e,layoutKey:t.companion??``,filter:a,selected:_,focus:m,onSelectNode:y,onSelectEdge:t=>{r(void 0),d({wire:e,edge:t})}})}),(0,R.jsx)(ce,{})]}),(0,R.jsx)(p,{items:S?[S]:[],current:S,onSelect:e=>{e===null&&y(null)},wide:!0,title:v?P(e,i,v):`Graph`,children:v?(0,R.jsx)(ne,{selection:v,wire:e,index:i,search:t,onSelectNode:b}):null})]})}function se({wire:e,filter:t,onFilter:n,onFocus:r}){let[i,a]=(0,x.useState)(``),o=(0,x.useId)(),s=(0,x.useMemo)(()=>M(e,i),[e,i]),l=(0,x.useMemo)(()=>{let t=1;return O(e,(e,n,r,i)=>{r===`co-change`&&(t=Math.max(t,i))}),t},[e]),u=e=>{let r=new Set(t.hidden);r.has(e)?r.delete(e):r.add(e),n({...t,hidden:r})};return(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,role:`toolbar`,"aria-label":`Graph controls`,children:[(0,R.jsxs)(`form`,{className:`relative`,role:`search`,onSubmit:e=>{e.preventDefault(),s[0]&&(r(s[0].id),a(``))},children:[(0,R.jsxs)(`label`,{className:`flex h-8 items-center gap-2 rounded-control border border-rule bg-surface px-2.5`,children:[(0,R.jsx)(c,{name:`search`,className:`size-3.5 text-muted`}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Find a spec, Area or repository`}),(0,R.jsx)(`input`,{className:`w-56 border-0 bg-transparent text-sm text-text outline-none placeholder:text-muted`,placeholder:`Find a spec, Area or repository`,value:i,onChange:e=>a(e.target.value),"aria-controls":o,"aria-autocomplete":`list`,"data-graph-search":!0})]}),s.length>0?(0,R.jsx)(`ul`,{id:o,className:`absolute top-9 left-0 z-20 m-0 grid w-80 list-none gap-0.5 rounded-control border border-rule bg-surface p-1 shadow-float`,"aria-label":`Matches`,children:s.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,className:`flex w-full items-baseline gap-2 rounded-[4px] border-0 bg-transparent px-2 py-1 text-left text-sm text-text hover:bg-page`,onClick:()=>{r(e.id),a(``)},children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate font-mono`,children:e.label}),(0,R.jsx)(`span`,{className:`ml-auto text-2xs text-muted`,children:L(e)})]})},e.id))}):null]}),(0,R.jsxs)(`fieldset`,{className:`m-0 flex flex-wrap items-center gap-3 border-0 p-0`,children:[(0,R.jsx)(`legend`,{className:`sr-only`,children:`Connections shown`}),g.map(e=>(0,R.jsxs)(`label`,{className:`inline-flex items-center gap-1.5 text-xs text-muted`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:!t.hidden.has(e),onChange:()=>u(e),"data-graph-edge-kind":e}),ie[e]]},e))]}),l>1?(0,R.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-xs text-muted`,children:[`Changed together at least`,(0,R.jsx)(`input`,{type:`range`,min:1,max:l,value:t.minWeight,onChange:e=>n({...t,minWeight:Number(e.target.value)}),disabled:t.hidden.has(`co-change`),"data-graph-min-weight":!0}),(0,R.jsxs)(`span`,{className:`w-4 font-mono tabular-nums`,children:[t.minWeight,`×`]})]}):null]})}function Q({wire:e,onSelectNode:t}){if(e.unbound.length===0&&e.broken.length===0)return null;let n=[e.unbound.length>0?`${e.unbound.length} unbound ${e.unbound.length===1?`spec`:`specs`}`:null,e.broken.length>0?`${e.broken.length} broken ${e.broken.length===1?`link`:`links`}`:null].filter(Boolean);return(0,R.jsxs)(`details`,{className:`text-xs text-muted`,"data-graph-problems":!0,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer text-warn`,children:n.join(` · `)}),(0,R.jsxs)(`div`,{className:`grid gap-2 pt-2`,children:[e.unbound.length>0?(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`m-0`,children:`They name no repository/Area pair, so they bind nothing:`}),(0,R.jsx)(`p`,{className:`m-0 flex flex-wrap gap-x-2 font-mono`,children:e.unbound.map(e=>(0,R.jsx)(`button`,{type:`button`,className:`border-0 bg-transparent p-0 text-text hover:text-accent`,onClick:()=>t(v(e)),children:e},e))})]}):null,e.broken.length>0?(0,R.jsx)(`ul`,{className:`m-0 grid list-none gap-0.5 p-0 font-mono`,"aria-label":`Broken links`,children:e.broken.map(e=>(0,R.jsxs)(`li`,{children:[e.from,` → `,(0,R.jsx)(`span`,{className:`text-bad`,children:e.target})]},`${e.from}>${e.target}`))}):null]})]})}function ce(){return(0,R.jsxs)(`ul`,{className:`pointer-events-none absolute top-2 left-2 m-0 flex list-none gap-3 rounded-control bg-[color-mix(in_srgb,var(--panel)_85%,transparent)] px-2 py-1 text-2xs text-muted`,"aria-label":`Legend`,children:[(0,R.jsxs)(`li`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-accent`,"aria-hidden":`true`}),` Spec`]}),(0,R.jsxs)(`li`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`size-2 rounded-full bg-info`,"aria-hidden":`true`}),` Area`]}),(0,R.jsxs)(`li`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`size-2.5 rounded-full bg-why`,"aria-hidden":`true`}),` Repository`]})]})}var le=r({component:()=>$}),$=function(){let e=t.useSearch(),n=t.useNavigate();return e.companion?(0,R.jsx)(ae,{search:{companion:e.companion,studioMode:e.studioMode},node:e.node,onNodeChange:e=>void n({search:t=>({...t,node:e}),replace:!1})}):null};export{O as a,E as c,$ as component,A as i,S as n,j as o,C as r,D as s,le as t};
@@ -0,0 +1 @@
1
+ import{gt as e,ot as t}from"./studio-queries-CKtAnIKP.js";var n=t({method:`GET`}).handler(e(`b2e22d82aeef8a3802144ae67d3a53a4fff5860a1a0b957618e8dcc7c0ef36c8`));export{n as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t,r as n}from"./chat-DbaMXb8H.js";import{a as r,n as i,t as a}from"./jsx-runtime-MZURdZre.js";var o=r(i(),1),s=a(),c=({code:r,isIncomplete:i=!1,language:a,maxHeight:c,raw:l,className:u,startLine:d,lineNumbers:f,...p})=>{let{shikiTheme:m}=(0,o.useContext)(n),h=e(),[g,_]=(0,o.useState)(l);return(0,o.useEffect)(()=>{if(!h){_(l);return}let e=!0,t=h.highlight({code:r,isIncomplete:i,language:a,themes:m},t=>{e&&_(t)});return t&&_(t),()=>{e=!1}},[r,i,a,m,h,l]),(0,s.jsx)(t,{className:u,language:a,lineNumbers:f,maxHeight:c,result:g,startLine:d,...p})};export{c as HighlightedCodeBlockBody};