stackvitals 0.1.0__py3-none-any.whl

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 (465) hide show
  1. mergescout/__init__.py +1 -0
  2. mergescout/archive/__init__.py +0 -0
  3. mergescout/archive/__main__.py +30 -0
  4. mergescout/archive/convert.py +83 -0
  5. mergescout/archive/events.py +55 -0
  6. mergescout/archive/manifest.py +45 -0
  7. mergescout/archive/stream.py +83 -0
  8. mergescout/bench/__init__.py +1 -0
  9. mergescout/bench/__main__.py +135 -0
  10. mergescout/bench/ci.py +257 -0
  11. mergescout/bench/deploys.py +115 -0
  12. mergescout/bench/matched.py +22 -0
  13. mergescout/bench/prior.py +42 -0
  14. mergescout/bench/report.py +230 -0
  15. mergescout/bench/shared.py +112 -0
  16. mergescout/bench/stars.py +57 -0
  17. mergescout/cli.py +89 -0
  18. mergescout/config.py +35 -0
  19. mergescout/crawl/__init__.py +0 -0
  20. mergescout/crawl/__main__.py +97 -0
  21. mergescout/crawl/chain.py +34 -0
  22. mergescout/crawl/fetch.py +146 -0
  23. mergescout/crawl/outcomes.py +69 -0
  24. mergescout/crawl/queries.py +250 -0
  25. mergescout/crawl/runner.py +176 -0
  26. mergescout/crawl/seed.py +77 -0
  27. mergescout/crawl/state.py +169 -0
  28. mergescout/crawl/writer.py +87 -0
  29. mergescout/discover/__init__.py +0 -0
  30. mergescout/discover/__main__.py +58 -0
  31. mergescout/discover/sweep.py +286 -0
  32. mergescout/github/__init__.py +0 -0
  33. mergescout/github/graphql.py +202 -0
  34. mergescout/github/identities.py +35 -0
  35. mergescout/github/releases.py +137 -0
  36. mergescout/labels.py +20 -0
  37. mergescout/mcp_server.py +228 -0
  38. mergescout/measure/__init__.py +0 -0
  39. mergescout/measure/__main__.py +75 -0
  40. mergescout/measure/api_cost.py +91 -0
  41. mergescout/measure/count_repos.py +30 -0
  42. mergescout/measure/jsonl.py +14 -0
  43. mergescout/measure/report.py +56 -0
  44. mergescout/measure/sample.py +37 -0
  45. mergescout/owners.py +22 -0
  46. mergescout/setup_check.py +64 -0
  47. mergescout/signals/__init__.py +0 -0
  48. mergescout/signals/__main__.py +96 -0
  49. mergescout/signals/bump_ledger.py +258 -0
  50. mergescout/signals/bumps.py +104 -0
  51. mergescout/signals/check.py +141 -0
  52. mergescout/signals/community_bench.py +149 -0
  53. mergescout/signals/delivery_bench.py +103 -0
  54. mergescout/signals/deps_map.py +261 -0
  55. mergescout/signals/deps_trends.py +117 -0
  56. mergescout/signals/evidence.py +94 -0
  57. mergescout/signals/exploits.py +43 -0
  58. mergescout/signals/flow_bench.py +258 -0
  59. mergescout/signals/identity.py +73 -0
  60. mergescout/signals/issues.py +76 -0
  61. mergescout/signals/labels.py +79 -0
  62. mergescout/signals/osv.py +232 -0
  63. mergescout/signals/owners_watch.py +80 -0
  64. mergescout/signals/repo_stats.py +96 -0
  65. mergescout/signals/rules.py +70 -0
  66. mergescout/signals/silver.py +33 -0
  67. mergescout/signals/top_packages.py +26 -0
  68. mergescout/signals/triage.py +71 -0
  69. mergescout/signals/triage_math.py +120 -0
  70. mergescout/signals/walls.py +91 -0
  71. mergescout/snapshot/__init__.py +0 -0
  72. mergescout/snapshot/__main__.py +215 -0
  73. mergescout/snapshot/build.py +147 -0
  74. mergescout/snapshot/publish.py +70 -0
  75. mergescout/snapshot/schema.py +34 -0
  76. mergescout/snapshot/score.py +30 -0
  77. mergescout/store/__init__.py +0 -0
  78. mergescout/store/__main__.py +46 -0
  79. mergescout/store/sync.py +148 -0
  80. mergescout/timeutil.py +11 -0
  81. mergescout/tool/__init__.py +0 -0
  82. mergescout/tool/action_pack.py +62 -0
  83. mergescout/tool/live.py +201 -0
  84. mergescout/tool/queries.py +293 -0
  85. mergescout/tool/refs.py +31 -0
  86. mergescout/tool/store.py +129 -0
  87. mergescout/tool/tracking.py +83 -0
  88. stackvitals/__init__.py +2 -0
  89. stackvitals/__main__.py +4 -0
  90. stackvitals/ci/__init__.py +1 -0
  91. stackvitals/ci/action.py +574 -0
  92. stackvitals/ci/analyze.py +577 -0
  93. stackvitals/ci/api.py +218 -0
  94. stackvitals/ci/automation.py +212 -0
  95. stackvitals/ci/bench.py +195 -0
  96. stackvitals/ci/burnin.py +102 -0
  97. stackvitals/ci/cli.py +570 -0
  98. stackvitals/ci/collect.py +239 -0
  99. stackvitals/ci/cost.py +107 -0
  100. stackvitals/ci/coverage.py +155 -0
  101. stackvitals/ci/feedback.py +699 -0
  102. stackvitals/ci/fingerprint.py +220 -0
  103. stackvitals/ci/gitlab.py +121 -0
  104. stackvitals/ci/gitlab_action.py +125 -0
  105. stackvitals/ci/impact.py +125 -0
  106. stackvitals/ci/investigate.py +59 -0
  107. stackvitals/ci/kinds.py +52 -0
  108. stackvitals/ci/monitors.py +105 -0
  109. stackvitals/ci/owners.py +116 -0
  110. stackvitals/ci/quarantine_runtime.py +90 -0
  111. stackvitals/ci/report.py +435 -0
  112. stackvitals/ci/retry.py +67 -0
  113. stackvitals/ci/selfheal.py +102 -0
  114. stackvitals/ci/shards.py +120 -0
  115. stackvitals/ci/share.py +59 -0
  116. stackvitals/ci/store.py +93 -0
  117. stackvitals/ci/testreports.py +351 -0
  118. stackvitals/ci/tickets.py +106 -0
  119. stackvitals/ci/track_record.json +11 -0
  120. stackvitals/ci/triage.py +130 -0
  121. stackvitals/ci/triggers.py +147 -0
  122. stackvitals/ci/upload.py +85 -0
  123. stackvitals/ci/validate.py +91 -0
  124. stackvitals/cli.py +111 -0
  125. stackvitals/codeowners.py +69 -0
  126. stackvitals/community/__init__.py +0 -0
  127. stackvitals/community/action.py +140 -0
  128. stackvitals/community/affiliation.py +51 -0
  129. stackvitals/community/analyze.py +507 -0
  130. stackvitals/community/build.py +56 -0
  131. stackvitals/community/chaoss.py +70 -0
  132. stackvitals/community/cli.py +79 -0
  133. stackvitals/community/collect.py +240 -0
  134. stackvitals/community/context.py +54 -0
  135. stackvitals/community/report.py +250 -0
  136. stackvitals/connectors/__init__.py +244 -0
  137. stackvitals/connectors/ai_spend.py +190 -0
  138. stackvitals/connectors/base.py +82 -0
  139. stackvitals/connectors/check.py +686 -0
  140. stackvitals/connectors/copilot.py +104 -0
  141. stackvitals/connectors/discord.py +103 -0
  142. stackvitals/connectors/discourse.py +117 -0
  143. stackvitals/connectors/incident_io.py +106 -0
  144. stackvitals/connectors/jira.py +210 -0
  145. stackvitals/connectors/linear.py +140 -0
  146. stackvitals/connectors/pagerduty.py +96 -0
  147. stackvitals/connectors/slack.py +110 -0
  148. stackvitals/connectors/sonar.py +77 -0
  149. stackvitals/connectors/store.py +120 -0
  150. stackvitals/connectors/tracker.py +108 -0
  151. stackvitals/connectors/writeback.py +105 -0
  152. stackvitals/contribute/__init__.py +1 -0
  153. stackvitals/contribute/brief.py +297 -0
  154. stackvitals/contribute/cli.py +64 -0
  155. stackvitals/core/__init__.py +1 -0
  156. stackvitals/core/actors.py +103 -0
  157. stackvitals/core/agent_ledger.py +120 -0
  158. stackvitals/core/agreements.py +95 -0
  159. stackvitals/core/ai_outcomes.py +276 -0
  160. stackvitals/core/alerts.py +224 -0
  161. stackvitals/core/appdata.py +112 -0
  162. stackvitals/core/bucket.py +190 -0
  163. stackvitals/core/bugs.py +43 -0
  164. stackvitals/core/calendar.py +34 -0
  165. stackvitals/core/capex.py +57 -0
  166. stackvitals/core/change_risk.py +181 -0
  167. stackvitals/core/changes.py +133 -0
  168. stackvitals/core/chat.py +143 -0
  169. stackvitals/core/config.py +373 -0
  170. stackvitals/core/dataflow.py +168 -0
  171. stackvitals/core/decisions.py +275 -0
  172. stackvitals/core/delivery.py +954 -0
  173. stackvitals/core/delivery_peers.py +98 -0
  174. stackvitals/core/delivery_report.py +429 -0
  175. stackvitals/core/deliverycli.py +147 -0
  176. stackvitals/core/devlake_dora.sql +485 -0
  177. stackvitals/core/digest.py +333 -0
  178. stackvitals/core/explaincli.py +107 -0
  179. stackvitals/core/explore.py +296 -0
  180. stackvitals/core/export.py +342 -0
  181. stackvitals/core/exportcli.py +117 -0
  182. stackvitals/core/findings.py +350 -0
  183. stackvitals/core/health.py +94 -0
  184. stackvitals/core/identity.py +82 -0
  185. stackvitals/core/insights.py +365 -0
  186. stackvitals/core/insightscli.py +43 -0
  187. stackvitals/core/installdoc.py +69 -0
  188. stackvitals/core/investment.py +187 -0
  189. stackvitals/core/joins.py +43 -0
  190. stackvitals/core/llmsdoc.py +40 -0
  191. stackvitals/core/merge_queue.py +70 -0
  192. stackvitals/core/metrics.py +109 -0
  193. stackvitals/core/model.py +285 -0
  194. stackvitals/core/projectcli.py +66 -0
  195. stackvitals/core/propose.py +86 -0
  196. stackvitals/core/pulse.py +85 -0
  197. stackvitals/core/recorded.py +145 -0
  198. stackvitals/core/releases.py +39 -0
  199. stackvitals/core/requests.py +528 -0
  200. stackvitals/core/resync.py +35 -0
  201. stackvitals/core/schema.py +205 -0
  202. stackvitals/core/services.py +203 -0
  203. stackvitals/core/settings.py +96 -0
  204. stackvitals/core/sqlcli.py +111 -0
  205. stackvitals/core/stats.py +222 -0
  206. stackvitals/core/store.py +125 -0
  207. stackvitals/core/summary.py +104 -0
  208. stackvitals/core/time.py +29 -0
  209. stackvitals/core/tomledit.py +149 -0
  210. stackvitals/core/uicli.py +138 -0
  211. stackvitals/core/webapp.py +79 -0
  212. stackvitals/core/what_changed.py +76 -0
  213. stackvitals/core/workspace.py +194 -0
  214. stackvitals/deps/__init__.py +1 -0
  215. stackvitals/deps/action.py +299 -0
  216. stackvitals/deps/actions_vulns.py +89 -0
  217. stackvitals/deps/cli.py +77 -0
  218. stackvitals/deps/dossier.py +341 -0
  219. stackvitals/deps/evidence.py +44 -0
  220. stackvitals/deps/fixplan.py +40 -0
  221. stackvitals/deps/guarddog.py +32 -0
  222. stackvitals/deps/hygiene.py +47 -0
  223. stackvitals/deps/imports.py +113 -0
  224. stackvitals/deps/lockfiles.py +198 -0
  225. stackvitals/deps/lookalike.py +80 -0
  226. stackvitals/deps/reach.py +59 -0
  227. stackvitals/deps/release.py +110 -0
  228. stackvitals/deps/runtimes.py +161 -0
  229. stackvitals/deps/supply.py +454 -0
  230. stackvitals/deps/vulns.py +588 -0
  231. stackvitals/editors/__init__.py +40 -0
  232. stackvitals/editors/vscode/extension.js +101 -0
  233. stackvitals/editors/vscode/marks.js +92 -0
  234. stackvitals/editors/vscode/package.json +26 -0
  235. stackvitals/flow/__init__.py +1 -0
  236. stackvitals/flow/action.py +178 -0
  237. stackvitals/flow/analyze.py +418 -0
  238. stackvitals/flow/automate.py +72 -0
  239. stackvitals/flow/build.py +46 -0
  240. stackvitals/flow/cli.py +93 -0
  241. stackvitals/flow/code_hosts.py +146 -0
  242. stackvitals/flow/collect.py +451 -0
  243. stackvitals/flow/gitlab_mr.py +75 -0
  244. stackvitals/flow/knowledge.py +202 -0
  245. stackvitals/flow/peers.py +90 -0
  246. stackvitals/flow/preflight.py +210 -0
  247. stackvitals/flow/report.py +253 -0
  248. stackvitals/flow/rules.py +135 -0
  249. stackvitals/flow/store.py +108 -0
  250. stackvitals/flow/survival.py +84 -0
  251. stackvitals/flow/triage.py +62 -0
  252. stackvitals/mcp_server.py +670 -0
  253. stackvitals/portal/__init__.py +0 -0
  254. stackvitals/portal/action.py +205 -0
  255. stackvitals/portal/batch.py +80 -0
  256. stackvitals/portal/campaigns.py +104 -0
  257. stackvitals/portal/catalog.py +104 -0
  258. stackvitals/portal/checks.py +63 -0
  259. stackvitals/portal/cli.py +172 -0
  260. stackvitals/portal/descriptor.py +105 -0
  261. stackvitals/portal/export.py +43 -0
  262. stackvitals/portal/github.py +48 -0
  263. stackvitals/portal/golden.py +95 -0
  264. stackvitals/portal/history.py +30 -0
  265. stackvitals/portal/inventory.py +264 -0
  266. stackvitals/portal/owners.py +78 -0
  267. stackvitals/portal/pages.py +153 -0
  268. stackvitals/portal/rollup.py +32 -0
  269. stackvitals/portal/scorecard.py +366 -0
  270. stackvitals/security/__init__.py +2 -0
  271. stackvitals/security/probes.py +154 -0
  272. stackvitals/security/repo_checks.py +132 -0
  273. stackvitals/security/workflows.py +111 -0
  274. stackvitals/shell.py +107 -0
  275. stackvitals/site.py +51 -0
  276. stackvitals/web/app/LICENSES.md +428 -0
  277. stackvitals/web/app/boot.js +1 -0
  278. stackvitals/web/app/chunks/AddRepo-KRPZXWCY.js +1 -0
  279. stackvitals/web/app/chunks/SetupRunning-XWFQAKRZ.js +1 -0
  280. stackvitals/web/app/chunks/accuracy-data-OQTDXI7Y.js +1 -0
  281. stackvitals/web/app/chunks/agents-data-BAL6QAOF.js +11 -0
  282. stackvitals/web/app/chunks/chunk-24LFKFZ6.js +1 -0
  283. stackvitals/web/app/chunks/chunk-3G4SQNUC.js +1 -0
  284. stackvitals/web/app/chunks/chunk-3IXWEOIJ.js +154 -0
  285. stackvitals/web/app/chunks/chunk-3ROQFHPV.js +1 -0
  286. stackvitals/web/app/chunks/chunk-45PGAQRO.js +8 -0
  287. stackvitals/web/app/chunks/chunk-4H53OYLG.js +1 -0
  288. stackvitals/web/app/chunks/chunk-4LUI7O5P.js +1 -0
  289. stackvitals/web/app/chunks/chunk-4SQPQ5TB.js +1 -0
  290. stackvitals/web/app/chunks/chunk-4WKQTWUC.js +2 -0
  291. stackvitals/web/app/chunks/chunk-576YHDEK.js +8 -0
  292. stackvitals/web/app/chunks/chunk-6BDBXA6V.js +1 -0
  293. stackvitals/web/app/chunks/chunk-6RLVD2DT.js +1 -0
  294. stackvitals/web/app/chunks/chunk-763NH7PP.js +1 -0
  295. stackvitals/web/app/chunks/chunk-76WAVKUG.js +1 -0
  296. stackvitals/web/app/chunks/chunk-7II2BD5F.js +1 -0
  297. stackvitals/web/app/chunks/chunk-7TJCBOAY.js +1 -0
  298. stackvitals/web/app/chunks/chunk-ASYNLVOP.js +1 -0
  299. stackvitals/web/app/chunks/chunk-CTKDYZMG.js +1 -0
  300. stackvitals/web/app/chunks/chunk-CVB26NMC.js +1 -0
  301. stackvitals/web/app/chunks/chunk-G7NGB5UX.js +1 -0
  302. stackvitals/web/app/chunks/chunk-GPVLJRZD.js +1 -0
  303. stackvitals/web/app/chunks/chunk-GQYFN4PE.js +75 -0
  304. stackvitals/web/app/chunks/chunk-GT4EAKAO.js +2 -0
  305. stackvitals/web/app/chunks/chunk-IYMBFPCV.js +1 -0
  306. stackvitals/web/app/chunks/chunk-LAAGCPU3.js +1 -0
  307. stackvitals/web/app/chunks/chunk-MAPYGK3P.js +1 -0
  308. stackvitals/web/app/chunks/chunk-P5TXDD45.js +1 -0
  309. stackvitals/web/app/chunks/chunk-PABICGBL.js +1 -0
  310. stackvitals/web/app/chunks/chunk-RPXHAG6F.js +1 -0
  311. stackvitals/web/app/chunks/chunk-RQZPSJ2Y.js +1 -0
  312. stackvitals/web/app/chunks/chunk-S2ZBMEVA.js +1 -0
  313. stackvitals/web/app/chunks/chunk-S654BBEP.js +6 -0
  314. stackvitals/web/app/chunks/chunk-T7QVTNXF.js +1 -0
  315. stackvitals/web/app/chunks/chunk-THFUOCPC.js +273 -0
  316. stackvitals/web/app/chunks/chunk-TO4VVRZ7.js +1 -0
  317. stackvitals/web/app/chunks/chunk-VQ5YXO54.js +1 -0
  318. stackvitals/web/app/chunks/chunk-VWKSMFWJ.js +1 -0
  319. stackvitals/web/app/chunks/chunk-Y6LUXDM6.js +1 -0
  320. stackvitals/web/app/chunks/chunk-YTANGYYH.js +1 -0
  321. stackvitals/web/app/chunks/connect-KONYWYTT.js +1 -0
  322. stackvitals/web/app/chunks/connections-data-2DYS4UVW.js +32 -0
  323. stackvitals/web/app/chunks/logos-N5IINUAM.js +1 -0
  324. stackvitals/web/app/chunks/more-KMJMJQD3.js +10 -0
  325. stackvitals/web/app/chunks/more-PC6FVS3P.js +1 -0
  326. stackvitals/web/app/chunks/more-RCIVCUDE.js +2 -0
  327. stackvitals/web/app/chunks/more-ZKKRY6NO.css +1 -0
  328. stackvitals/web/app/chunks/sealbox-35YL4EUH.js +3 -0
  329. stackvitals/web/app/chunks/session-DYYTOE2K.js +1 -0
  330. stackvitals/web/app/chunks/settingsApply-2HRJEZYM.js +1 -0
  331. stackvitals/web/app/chunks/settingsReview-GX2FZQ4M.js +3 -0
  332. stackvitals/web/app/chunks/uPlot.esm-OIWT3AHJ.js +3 -0
  333. stackvitals/web/app/demo/ci/impact.json +1 -0
  334. stackvitals/web/app/demo/ci/quarantine.json +1 -0
  335. stackvitals/web/app/demo/ci/tickets.json +1 -0
  336. stackvitals/web/app/demo/mobile/alerts.json +1 -0
  337. stackvitals/web/app/demo/mobile/app.json +1 -0
  338. stackvitals/web/app/demo/mobile/community.json +1 -0
  339. stackvitals/web/app/demo/mobile/connectors.json +1 -0
  340. stackvitals/web/app/demo/mobile/data.json +1 -0
  341. stackvitals/web/app/demo/mobile/decisions.json +1 -0
  342. stackvitals/web/app/demo/mobile/delivery.json +1 -0
  343. stackvitals/web/app/demo/mobile/deps.json +1 -0
  344. stackvitals/web/app/demo/mobile/flow.json +1 -0
  345. stackvitals/web/app/demo/mobile/health.json +1 -0
  346. stackvitals/web/app/demo/mobile/insights.json +1 -0
  347. stackvitals/web/app/demo/mobile/pulse.json +1 -0
  348. stackvitals/web/app/demo/mobile/security.json +1 -0
  349. stackvitals/web/app/demo/mobile/summary/ci_jobs.jsonl +5 -0
  350. stackvitals/web/app/demo/mobile/summary/devlake_project_pr_metrics.jsonl +14 -0
  351. stackvitals/web/app/demo/mobile/summary/devlake_pull_requests.jsonl +14 -0
  352. stackvitals/web/app/demo/mobile/summary/manifest.json +1 -0
  353. stackvitals/web/app/demo/mobile/summary/prs.jsonl +19 -0
  354. stackvitals/web/app/demo/mobile/summary/tests.jsonl +1 -0
  355. stackvitals/web/app/demo/mobile/supply.json +1 -0
  356. stackvitals/web/app/demo/mobile/vulns.json +1 -0
  357. stackvitals/web/app/demo/payments-api/alerts.json +1 -0
  358. stackvitals/web/app/demo/payments-api/app.json +1 -0
  359. stackvitals/web/app/demo/payments-api/community.json +1 -0
  360. stackvitals/web/app/demo/payments-api/connectors.json +1 -0
  361. stackvitals/web/app/demo/payments-api/data.json +1 -0
  362. stackvitals/web/app/demo/payments-api/decisions.json +1 -0
  363. stackvitals/web/app/demo/payments-api/delivery.json +1 -0
  364. stackvitals/web/app/demo/payments-api/deps.json +1 -0
  365. stackvitals/web/app/demo/payments-api/flow.json +1 -0
  366. stackvitals/web/app/demo/payments-api/health.json +1 -0
  367. stackvitals/web/app/demo/payments-api/insights.json +1 -0
  368. stackvitals/web/app/demo/payments-api/pulse.json +1 -0
  369. stackvitals/web/app/demo/payments-api/security.json +1 -0
  370. stackvitals/web/app/demo/payments-api/summary/ci_jobs.jsonl +5 -0
  371. stackvitals/web/app/demo/payments-api/summary/devlake_project_pr_metrics.jsonl +14 -0
  372. stackvitals/web/app/demo/payments-api/summary/devlake_pull_requests.jsonl +14 -0
  373. stackvitals/web/app/demo/payments-api/summary/manifest.json +1 -0
  374. stackvitals/web/app/demo/payments-api/summary/prs.jsonl +22 -0
  375. stackvitals/web/app/demo/payments-api/summary/tests.jsonl +3 -0
  376. stackvitals/web/app/demo/payments-api/supply.json +1 -0
  377. stackvitals/web/app/demo/payments-api/vulns.json +1 -0
  378. stackvitals/web/app/demo/portal.json +1 -0
  379. stackvitals/web/app/demo/settings.json +1 -0
  380. stackvitals/web/app/demo/web-app/alerts.json +1 -0
  381. stackvitals/web/app/demo/web-app/app.json +1 -0
  382. stackvitals/web/app/demo/web-app/community.json +1 -0
  383. stackvitals/web/app/demo/web-app/connectors.json +1 -0
  384. stackvitals/web/app/demo/web-app/data.json +1 -0
  385. stackvitals/web/app/demo/web-app/decisions.json +1 -0
  386. stackvitals/web/app/demo/web-app/delivery.json +1 -0
  387. stackvitals/web/app/demo/web-app/deps.json +1 -0
  388. stackvitals/web/app/demo/web-app/flow.json +1 -0
  389. stackvitals/web/app/demo/web-app/health.json +1 -0
  390. stackvitals/web/app/demo/web-app/insights.json +1 -0
  391. stackvitals/web/app/demo/web-app/pulse.json +1 -0
  392. stackvitals/web/app/demo/web-app/security.json +1 -0
  393. stackvitals/web/app/demo/web-app/summary/ci_jobs.jsonl +5 -0
  394. stackvitals/web/app/demo/web-app/summary/devlake_project_pr_metrics.jsonl +14 -0
  395. stackvitals/web/app/demo/web-app/summary/devlake_pull_requests.jsonl +14 -0
  396. stackvitals/web/app/demo/web-app/summary/manifest.json +1 -0
  397. stackvitals/web/app/demo/web-app/summary/prs.jsonl +18 -0
  398. stackvitals/web/app/demo/web-app/summary/tests.jsonl +2 -0
  399. stackvitals/web/app/demo/web-app/supply.json +1 -0
  400. stackvitals/web/app/demo/web-app/vulns.json +1 -0
  401. stackvitals/web/app/fonts/plex-mono-400.woff2 +0 -0
  402. stackvitals/web/app/fonts/plex-sans-400.woff2 +0 -0
  403. stackvitals/web/app/fonts/plex-sans-600.woff2 +0 -0
  404. stackvitals/web/app/fonts/plex-sans-condensed-700.woff2 +0 -0
  405. stackvitals/web/app/help/accuracy.json +1 -0
  406. stackvitals/web/app/help/connectors.json +1 -0
  407. stackvitals/web/app/help/getting-started.json +1 -0
  408. stackvitals/web/app/help/index.json +1 -0
  409. stackvitals/web/app/help/modules.json +1 -0
  410. stackvitals/web/app/help/privacy-and-security.json +1 -0
  411. stackvitals/web/app/help/reference.json +1 -0
  412. stackvitals/web/app/main.css +1 -0
  413. stackvitals/web/app/main.js +1 -0
  414. stackvitals/web/app/pages/about.css +1 -0
  415. stackvitals/web/app/pages/about.js +1 -0
  416. stackvitals/web/app/pages/activity.css +1 -0
  417. stackvitals/web/app/pages/activity.js +1 -0
  418. stackvitals/web/app/pages/agents.css +1 -0
  419. stackvitals/web/app/pages/agents.js +2 -0
  420. stackvitals/web/app/pages/ci.css +1 -0
  421. stackvitals/web/app/pages/ci.js +1 -0
  422. stackvitals/web/app/pages/community.css +1 -0
  423. stackvitals/web/app/pages/community.js +1 -0
  424. stackvitals/web/app/pages/connections.css +1 -0
  425. stackvitals/web/app/pages/connections.js +6 -0
  426. stackvitals/web/app/pages/delivery.css +1 -0
  427. stackvitals/web/app/pages/delivery.js +45 -0
  428. stackvitals/web/app/pages/deps.css +1 -0
  429. stackvitals/web/app/pages/deps.js +7 -0
  430. stackvitals/web/app/pages/explore.css +1 -0
  431. stackvitals/web/app/pages/explore.js +7 -0
  432. stackvitals/web/app/pages/health.css +1 -0
  433. stackvitals/web/app/pages/health.js +1 -0
  434. stackvitals/web/app/pages/help.css +1 -0
  435. stackvitals/web/app/pages/help.js +6 -0
  436. stackvitals/web/app/pages/insights.css +1 -0
  437. stackvitals/web/app/pages/insights.js +1 -0
  438. stackvitals/web/app/pages/investment.css +1 -0
  439. stackvitals/web/app/pages/investment.js +3 -0
  440. stackvitals/web/app/pages/overview.css +1 -0
  441. stackvitals/web/app/pages/overview.js +1 -0
  442. stackvitals/web/app/pages/portal.css +1 -0
  443. stackvitals/web/app/pages/portal.js +51 -0
  444. stackvitals/web/app/pages/prs.css +1 -0
  445. stackvitals/web/app/pages/prs.js +4 -0
  446. stackvitals/web/app/pages/settings.css +1 -0
  447. stackvitals/web/app/pages/settings.js +1 -0
  448. stackvitals/web/app/pages/setup.css +1 -0
  449. stackvitals/web/app/pages/setup.js +2 -0
  450. stackvitals/web/app/pages/standing.css +1 -0
  451. stackvitals/web/app/pages/standing.js +1 -0
  452. stackvitals/web/app/pages/welcome-sheet.js +1 -0
  453. stackvitals/web/app/pages/welcome.js +1 -0
  454. stackvitals/web/app/settings-workflow.json +1 -0
  455. stackvitals/web/index.html +34 -0
  456. stackvitals/web/site/index.html +108 -0
  457. stackvitals/web/site/integrations.html +15 -0
  458. stackvitals/web/site/setup.html +15 -0
  459. stackvitals/web/site/site.css +68 -0
  460. stackvitals-0.1.0.dist-info/METADATA +134 -0
  461. stackvitals-0.1.0.dist-info/RECORD +465 -0
  462. stackvitals-0.1.0.dist-info/WHEEL +4 -0
  463. stackvitals-0.1.0.dist-info/entry_points.txt +3 -0
  464. stackvitals-0.1.0.dist-info/licenses/LICENSE +202 -0
  465. stackvitals-0.1.0.dist-info/licenses/NOTICE +16 -0
@@ -0,0 +1 @@
1
+ import{f as $,g as l}from"./chunk-76WAVKUG.js";import{G as _,a as f,c as p,k as c,n as h,o as y,w as i,z as g}from"./chunk-GT4EAKAO.js";import{d}from"./chunk-G7NGB5UX.js";d();var w={deployments:"Deployments counted",lead_time:"Pull requests behind the lead time",failed:"Deployments that failed",recovery:"Recoveries counted",not_first_try:"Pushes not green on the first try",phase:"Pull requests in this phase"},E={deployments:"Every deployment in the window, oldest first. Deployment frequency counts the days these landed on.",lead_time:"Each deployed pull request with its time from first commit to deployment, longest first. The lead time is their median.",failed:"Each deployment tied to an incident after it (a revert, a hotfix or an incident issue). The fail rate is these over all deployments.",recovery:"Each failed deployment and how long until its incident was resolved. Recovery is their median.",not_first_try:"Each push whose checks failed or needed a re-run, newest first, with the runs that did. The first-try share is the other pushes over all of them.",phase:"Each merged pull request's hours in this phase, longest first (up to 200). The P50 and P75 are read from these."},b=(t,s,n)=>n?s==="issue"?`https://github.com/${t}/issues/${n}`:s==="revert"||s==="hotfix"?`https://github.com/${t}/pull/${n}`:void 0:void 0,r=(t,s)=>s?`https://github.com/${t}/commit/${s}`:void 0,u=t=>typeof t=="number"?c(t/60):"\u2013";function L({kind:t,ev:s,repo:n}){let[v,m]=p(!1),o=s?.[t]||[];if(!o.length||!n)return null;let a=t==="lead_time"?s?.lead_time_total??o.length:t==="not_first_try"?s?.not_first_try_total??o.length:o.length;return i(f,{children:[i(g,{size:"sm",variant:"plain",onClick:()=>m(!0),children:["Show the ",h(a,t==="lead_time"?"pull request":t==="recovery"?"recovery":t==="not_first_try"?"push":t==="phase"?"pull request":"deployment")]}),i(_,{open:v,onClose:()=>m(!1),title:w[t],description:E[t],children:[a>o.length?i("p",{class:"mute small",children:["Showing the first ",o.length," of ",a,"."]}):null,i($,{label:w[t],children:o.map(e=>t==="deployments"?i(l,{title:y(String(e[1])),subtitle:`Commit ${e[0]}`,href:r(n,e[0]),external:!0}):t==="not_first_try"?i(l,{title:`Commit ${e[0]}`,subtitle:`${e[1]||"?"}: ${h(e[2].length,"run")} failed or re-run`,href:e[2].length?`https://github.com/${n}/actions/runs/${e[2][0]}`:r(n,e[0]),external:!0}):t==="phase"?i(l,{title:`#${e[0]}`,trailing:u(Number(e[1])*60),href:`https://github.com/${n}/pull/${e[0]}`,external:!0}):t==="lead_time"?i(l,{title:`#${e[0]}`,subtitle:`Shipped in ${e[1]}`,trailing:u(e[2]),href:`https://github.com/${n}/pull/${e[0]}`,external:!0}):t==="failed"?i(l,{title:`Deployment ${e[0]}`,subtitle:`${e[1]}${e[2]?` #${e[2]}`:""}`,href:b(n,e[1],e[2])||r(n,e[0]),external:!0}):i(l,{title:`Deployment ${e[0]}`,subtitle:`${e[1]}${e[2]?` #${e[2]}`:""}`,trailing:u(e[3]),href:b(n,e[1],e[2])||r(n,e[0]),external:!0}))})]})]})}export{L as a};
@@ -0,0 +1 @@
1
+ import{w as e}from"./chunk-GT4EAKAO.js";import{d as c}from"./chunk-G7NGB5UX.js";c();function h({values:n,tone:d="neutral",width:t=84,height:a=32,label:o}){if(n.length<2)return e("svg",{class:"spark",width:t,height:a,"aria-hidden":"true"});let i=Math.min(...n),f=Math.max(...n),l=f-i||1,p=n.map((r,s)=>[s/(n.length-1)*t,a-3-(r-i)/l*(a-6)]),m=p.map((r,s)=>`${s?"L":"M"}${r[0].toFixed(1)} ${r[1].toFixed(1)}`).join("");return e("svg",{class:`spark spark-${d}`,viewBox:`0 0 ${t} ${a}`,width:t,height:a,preserveAspectRatio:"none",role:o?"img":void 0,"aria-label":o,"aria-hidden":o?void 0:"true",children:[e("path",{class:"spark-base",d:`M0 ${p[0][1].toFixed(1)}H${t}`,"vector-effect":"non-scaling-stroke"}),e("path",{class:"spark-line",d:m,pathLength:1,"vector-effect":"non-scaling-stroke"})]})}export{h as a};
@@ -0,0 +1 @@
1
+ import{d as r}from"./chunk-G7NGB5UX.js";r();var s=(o,t="F",e=2.6,n="")=>`<path d="${o}" fill="none" stroke="${t}" stroke-width="${e}" stroke-linecap="round" stroke-linejoin="round"${n}/>`,i={id:"strata",name:"Strata",note:"Stacked layers, the top one lit",body:s("M6.5 20.5 16 25.3l9.5-4.8")+s("M6.5 15.6 16 20.4l9.5-4.8")+'<path d="M16 5.8 25.5 10.6 16 15.4 6.5 10.6Z" fill="A"/>'},u=i.id;var l=new Set(["d","x","y","width","height","rx","cx","cy","r","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","opacity","transform","stroke-dasharray"]),g=/^<(path|rect|circle)((?:\s+[a-z-]+="[^"<>&]*")*)\s*\/>/;function c(o){let t=o.trim();if(!t)return!1;for(;t;){let e=g.exec(t);if(!e)return!1;for(let n of e[2].matchAll(/([a-z-]+)="([^"]*)"/g))if(!l.has(n[1])||/url\(|:|\\/i.test(n[2]))return!1;t=t.slice(e[0].length).trimStart()}return!0}function x(o){let t=o;return t&&typeof t.id=="string"&&typeof t.name=="string"&&typeof t.body=="string"&&c(t.body)?{id:t.id,name:t.name,note:String(t.note||""),body:t.body}:i}function f(o,t={T:"var(--logo-tile)",F:"var(--logo-fg)",A:"var(--logo-acc)"},e=!0){let n=o.body.replace(/"(T|F|A)"/g,(p,a)=>`"${t[a]}"`);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">${e?`<rect width="32" height="32" rx="8" fill="${t.T}"/>`:""}${n}</svg>`}var d={T:"#2160C4",F:"#FFFFFF",A:"#7CF0B6"};function y(o){return"data:image/svg+xml,"+encodeURIComponent(f(o,d))}export{s as a,i as b,u as c,x as d,f as e,y as f};
@@ -0,0 +1 @@
1
+ import{p as l}from"./chunk-GT4EAKAO.js";import{d as a}from"./chunk-G7NGB5UX.js";a();var p={connected:"Connected",key:"Needs a key",failed:"Check failed",off:"Not set up",builtin:"Built in",recorded:"Recorded only"},g={connected:"on",builtin:"on",key:"attention",failed:"attention",recorded:"attention",off:"available"};function u(n){return(n.secrets||[]).filter(e=>!e.kind||e.kind==="secret").filter(e=>!e.optional).map(e=>e.name)}function f(n,e){if(!e)return[];let t=new Set(e.map(r=>r.toUpperCase()));return u(n).filter(r=>!t.has(r))}function s(n){if(!n.check||n.check.ok)return!1;let e=l(n.as_of),t=l(n.check.checked_at);return!(n.as_of&&!n.error&&e>t)}function h(n,e,t,r){if(n.kind==="builtin")return"builtin";if(n.kind==="local")return"off";let i=f(n,t);if(e){if(s(e)||e.error)return"failed";let c=!!e.as_of||!!e.check?.ok;if(c&&i.length&&t)return e.as_of?"recorded":"key";if(e.expiring)return"key";if(c)return"connected"}let o=u(n);return t&&o.length&&!i.length?"connected":n.kind==="nokey"?r?"connected":"off":r||t&&o.length&&i.length<o.length?"key":"off"}function b(n,e){return n?Object.entries(n).some(([t,r])=>{if(t==="key_expires"||t==="write_back")return!1;let i=e[t];return JSON.stringify(r??null)!==JSON.stringify(i??null)&&!(r===""||Array.isArray(r)&&!r.length)}):!1}export{p as a,g as b,f as c,h as d,b as e};
@@ -0,0 +1 @@
1
+ import{b as S}from"./chunk-GQYFN4PE.js";import{b as k,d as C,e as x,g as O}from"./chunk-RPXHAG6F.js";import{a as L,c as _}from"./chunk-VQ5YXO54.js";import{d as G}from"./chunk-G7NGB5UX.js";G();var et={commit:"Add the workflow file",variable:"Read every CI run",run:"First run",data:"Data branch written",pages:"Turn on the web page"},v="stackvitals-data",J="stackvitals-setup";function nt(t,e=Date.now()){let n=["commit","variable","run","data","pages"].map(a=>({id:a,status:"pending"}));return{target:t,steps:n,started:e}}function q(t){let[e="",n=""]=t.split("/");return n.toLowerCase()===`${e.toLowerCase()}.github.io`?`https://${e.toLowerCase()}.github.io/`:`https://${e.toLowerCase()}.github.io/${n}/`}function F(t){if(t?.build_type==="workflow")return{ours:!1,says:"a GitHub Actions workflow"};let e=t?.source?.branch,n=t?.source?.path||"/";return{ours:e===v&&n==="/docs",says:e?`the ${e} branch (${n})`:"another source"}}var N=t=>typeof t.data=="object"&&t.data?.message?String(t.data.message):"",M=t=>[403,409,422].includes(t.status)&&/protect|rule|pull request/i.test(N(t)),P=class extends Error{};async function K(t,e,n){let{api:a}=n,p=n.sleep||O,g=n.now||Date.now,c=t.target,b=c.repo,s=JSON.parse(JSON.stringify(t)),m=r=>{s={...s,...r},n.save?.(s),e(s)},R=(r,o)=>r==="run"&&s.reenabled&&o.note?{...o,note:`${o.note} The workflow had been turned off, so it was turned back on.`}:o,u=(r,o)=>m({steps:s.steps.map(i=>i.id===r?{id:r,status:o.status||i.status,...D(R(r,o))}:i)}),D=r=>Object.fromEntries(Object.entries(r).filter(([o,i])=>o!=="id"&&o!=="status"&&i!==void 0)),w=(r,o,i,d)=>{throw u(r,{status:"failed",note:o,fix:i,fixLink:d}),new P},y=r=>`The token needs ${r} on ${b}. Make a new token with the button below and pick this repo.`,$=r=>s.steps.find(o=>o.id===r).status;if(!L(b))return u("commit",{status:"failed",note:`"${String(c.repo).slice(0,80)}" isn't a repo name (owner/name); nothing was written.`}),s;let h=_(b),E=encodeURIComponent(c.branch);try{if($("commit")!=="done"){u("commit",{status:"running",note:`Writing ${S} on ${c.branch} in ${b}`});for(let r=0;;r++){let o=await a.call("GET",`/repos/${h}/contents/${S}?ref=${E}`);if(o.ok&&x(o.data?.content||"")===c.yaml){s.pr&&await B(a,h,E).then(f=>f&&m({headSha:f})),u("commit",{status:"done",note:s.pr?`Pull request #${s.pr.number} is merged.`:"The workflow file is already there."});break}if(s.pr&&o.ok){u("commit",{status:"done",note:`Pull request #${s.pr.number} is merged.`});break}if(s.pr){let f=await a.call("GET",`/repos/${h}/pulls/${s.pr.number}`);return f.ok&&f.data?.state==="closed"&&!f.data?.merged?(m({pr:void 0}),await K(s,e,n)):(u("commit",{status:"waiting",note:`Pull request #${s.pr.number} is open: merge it, then press Continue.`,link:s.pr.url}),s)}if(o.ok&&!c.replace){let f=await V(a,c,!0);return m({pr:f}),u("commit",{status:"waiting",note:`${S} is already there and differs, so pull request #${f.number} has the new one: review and merge it, then press Continue.`,link:f.url}),s}let d={message:o.ok?"Update the StackVitals workflow":"Add the StackVitals workflow",content:C(c.yaml),branch:c.branch,...o.ok?{sha:o.data.sha}:{}},l=await a.call("PUT",`/repos/${h}/contents/${S}`,d);if(l.ok){m({started:g(),...l.data?.commit?.sha?{headSha:String(l.data.commit.sha)}:{}}),u("commit",{status:"done",note:`Committed to ${c.branch} in ${b}.`,link:l.data?.commit?.html_url});break}if(M(l)){let f=await V(a,c,o.ok);return m({pr:f}),u("commit",{status:"waiting",note:`${c.branch} is protected, so a pull request has the file: merge #${f.number}, then press Continue.`,link:f.url}),s}l.status===409&&r===0||(l.status===409&&w("commit",`${S} changed on GitHub while setting up.`,"Press Continue to read it again."),(l.status===403||l.status===404)&&w("commit","GitHub refused to add the file.",y("Contents and Workflows: read and write"),n.tokenPage),w("commit",k(l,!0).message))}}if(!["done","skipped","failed"].includes($("variable")))if(!c.everyCiRun)u("variable",{status:"skipped",note:c.private?"Off: passing CI runs are read every 3 hours.":"Not needed for a public repo."});else{u("variable",{status:"running"});let r=await a.call("POST",`/repos/${h}/actions/variables`,{name:"STACKVITALS_EVERY_CI_RUN",value:"true"});r.status===409&&(r=await a.call("PATCH",`/repos/${h}/actions/variables/STACKVITALS_EVERY_CI_RUN`,{name:"STACKVITALS_EVERY_CI_RUN",value:"true"})),r.ok?u("variable",{status:"done",note:"STACKVITALS_EVERY_CI_RUN is true."}):u("variable",{status:"failed",note:"Couldn't set the variable.",fix:y("Variables: read and write"),fixLink:n.tokenPage})}if($("run")!=="done"){u("run",{status:"running",note:s.runId?"Watching the run":"Waiting for GitHub to start it"});let r=`/repos/${h}/actions/workflows/stackvitals.yml/runs`;if(!s.runId&&!s.reenabled){let i=await a.call("GET",`/repos/${h}/actions/workflows/stackvitals.yml`);i.ok&&i.data?.state&&i.data.state!=="active"&&((await a.call("PUT",`/repos/${h}/actions/workflows/stackvitals.yml/enable`)).ok||w("run","The StackVitals workflow is turned off and GitHub refused to turn it on.",y("Actions: read and write"),n.tokenPage),m({reenabled:!0}))}if(!s.runId){let i=s.headSha,d=i?await A(a,r,l=>l.head_sha===i,12,p):null;if(d||(d=await A(a,r,l=>l.status==="queued"||l.status==="in_progress",1,p)),d)m({runId:d.id,runUrl:d.html_url});else{let l=await Y(a,h,c.branch,p);l==="refused"&&w("run","GitHub refused to start the workflow.",y("Actions: read and write"),n.tokenPage),l==="missing"&&w("run","GitHub hasn't registered the workflow yet.","Wait a minute and press Continue. If it stays, open the Actions tab: the file may have a problem.");let f=typeof l=="number"?l-5e3:g()-6e4,I=await A(a,r,U=>U.event==="workflow_dispatch"&&Date.parse(U.created_at)>=f,12,p);if(!I)return u("run",{status:"waiting",note:"Started; GitHub hasn't listed the run yet. Press Continue in a moment."}),s;m({runId:I.id,runUrl:I.html_url})}}u("run",{status:"running",note:"Running",link:s.runUrl});let o=g()+(n.maxPollMin??30)*6e4;for(;;){let[i,d]=await Promise.all([a.call("GET",`/repos/${h}/actions/runs/${s.runId}`),a.call("GET",`/repos/${h}/actions/runs/${s.runId}/jobs?per_page=50`)]);if(i.ok||w("run",k(i,!0).message),d.ok&&m({jobs:(d.data?.jobs||[]).map(l=>({name:l.name,status:l.status,conclusion:l.conclusion,steps:(l.steps||[]).map(f=>({name:f.name,status:f.status,conclusion:f.conclusion}))}))}),i.data.status==="completed"){if(i.data.conclusion==="success"){u("run",{status:"done",note:`Run #${i.data.run_number} finished.`,link:i.data.html_url});break}w("run",`Run #${i.data.run_number} ended: ${i.data.conclusion}.`,"Open the run: its summary names what to fix (often a permission in the file). Fix it, then press Continue to run again.",i.data.html_url)}if(g()>o)return u("run",{status:"waiting",note:"Still running after 30 minutes. Press Continue to keep watching."}),s;u("run",{status:"running",note:i.data.status==="queued"?"Queued: waiting for a runner":"Running",link:i.data.html_url}),await p(n.pollMs??5e3)}}if($("data")!=="done"){u("data",{status:"running"});let r=!1;for(let o=0;o<4&&!r;o++)r=(await a.call("GET",`/repos/${h}/branches/${v}`)).ok,r||await p(3e3);r||w("data","The run finished but no stackvitals-data branch is there.","Open the run's summary: it says why nothing was written.",s.runUrl),u("data",{status:"done",note:`${v} has the first data.`})}if(!["done","skipped"].includes($("pages")))if(c.private||c.pages!=="public")u("pages",{status:"skipped",note:c.pages==="artifact"?"Artifact mode: each run uploads the app to download.":"Private: open it here in the app with your token."});else{u("pages",{status:"running"});let r={branch:v,path:"/docs"},o=await a.call("GET",`/repos/${h}/pages`),i=o.ok?F(o.data):null,d=o;if(i&&!i.ours&&!c.pagesSwitch)u("pages",{status:"skipped",note:`Pages already serves ${i.says}: kept as it is. The dashboard opens here in the app.`});else if(o.status===404?d=await a.call("POST",`/repos/${h}/pages`,{source:r}):i&&!i.ours&&(d=await a.call("PUT",`/repos/${h}/pages`,{build_type:"legacy",source:r})),d.ok||d.status===409){let l=d.data?.html_url||o.data?.html_url||q(b);m({siteUrl:l}),u("pages",{status:"done",note:i&&!i.ours?`Pages now serves the dashboard instead of ${i.says}.`:"GitHub publishes it within a minute or two.",link:l})}else d.status===403||d.status===404?u("pages",{status:"failed",note:"Couldn't turn on Pages.",fix:y("Pages: read and write"),fixLink:n.tokenPage}):u("pages",{status:"failed",note:k(d,!0).message,fix:"Turn it on in Settings, Pages: branch stackvitals-data, folder /docs.",fixLink:`https://github.com/${b}/settings/pages`})}m({finished:!0})}catch(r){if(!(r instanceof P)){let o=s.steps.find(i=>i.status==="running")?.id||"commit";u(o,{status:"failed",note:r instanceof Error?r.message:String(r),fix:"Press Continue to try again."})}}return s}async function B(t,e,n){let a=await t.call("GET",`/repos/${e}/git/ref/heads/${n}`);return a.ok?a.data?.object?.sha:void 0}async function V(t,e,n){return W(t,{repo:e.repo,base:e.branch,branch:J,file:S,content:e.yaml,message:n?"Update the StackVitals workflow":"Add the StackVitals workflow",title:n?"Update StackVitals":"Add StackVitals",body:n?"Updates `.github/workflows/stackvitals.yml` from the StackVitals app. Review the changes; merging starts a run.":"Adds `.github/workflows/stackvitals.yml`, set up from the StackVitals app. Merging it starts the first run."})}async function W(t,e){let n=_(e.repo),a=e.repo.split("/")[0],p=await t.call("GET",`/repos/${n}/pulls?state=open&head=${encodeURIComponent(`${a}:${e.branch}`)}`),g=await t.call("GET",`/repos/${n}/git/ref/heads/${encodeURIComponent(e.base)}`);if(!g.ok)throw k(g,!0);let c=await t.call("POST",`/repos/${n}/git/refs`,{ref:`refs/heads/${e.branch}`,sha:g.data.object.sha});if(!c.ok&&!(c.status===422&&/already exists/i.test(N(c))))throw k(c,!0);let b=await t.call("GET",`/repos/${n}/contents/${e.file}?ref=${e.branch}`);if(!(b.ok&&x(b.data?.content||"")===e.content)){let m=await t.call("PUT",`/repos/${n}/contents/${e.file}`,{message:e.message,content:C(e.content),branch:e.branch,...b.ok?{sha:b.data.sha}:{}});if(!m.ok)throw k(m,!0)}if(p.ok&&p.data?.length)return{number:p.data[0].number,url:p.data[0].html_url};let s=await t.call("POST",`/repos/${n}/pulls`,{title:e.title,head:e.branch,base:e.base,body:e.body});if(!s.ok)throw k(s,!0);return{number:s.data.number,url:s.data.html_url}}async function A(t,e,n,a,p){for(let g=0;g<a;g++){let c=await t.call("GET",`${e}?per_page=10`),s=(c.ok?c.data?.workflow_runs||[]:[]).filter(n).sort((m,R)=>m.id-R.id)[0];if(s)return{id:s.id,html_url:s.html_url};g<a-1&&await p(3e3)}return null}async function Y(t,e,n,a){for(let p=0;p<6;p++){let g=await t.call("POST",`/repos/${e}/actions/workflows/stackvitals.yml/dispatches`,{ref:n});if(g.ok)return Date.parse(g.headers.get("date")||"")||!0;if(g.status===403)return"refused";await a(2e3*(p+1))}return"missing"}function at(t,e=Date.now()){let n=t.steps.find(a=>a.id==="run")?.status==="failed";return{...t,finished:!1,...n?{runId:void 0,runUrl:void 0,jobs:void 0,headSha:void 0,started:e}:{},steps:t.steps.map(a=>a.status==="failed"||a.status==="waiting"?{id:a.id,status:"pending"}:a)}}var H=t=>`sv:setup:${t.toLowerCase()}`;function st(t){try{return JSON.parse(sessionStorage.getItem(H(t))||"null")}catch{return null}}function rt(t){try{sessionStorage.setItem(H(t.target.repo),JSON.stringify(t))}catch{}}var Q=9e4,T=t=>`sv:setup-lock:${t.toLowerCase()}`,j=()=>{try{return localStorage}catch{return null}};function it(t,e,n=Date.now(),a=j()){if(!a)return!0;try{let p=JSON.parse(a.getItem(T(t))||"null");if(p&&p.tab!==e&&p.until>n)return!1;a.setItem(T(t),JSON.stringify({tab:e,until:n+Q}))}catch{}return!0}function ot(t,e,n=j()){try{n&&JSON.parse(n.getItem(T(t))||"null")?.tab===e&&n.removeItem(T(t))}catch{}}export{et as a,nt as b,q as c,F as d,K as e,W as f,at as g,st as h,rt as i,it as j,ot as k};
@@ -0,0 +1 @@
1
+ import{d as l}from"./chunk-G7NGB5UX.js";l();var g="https://api.github.com",u=class extends Error{constructor(e,r,s=!1){super(e);this.status=r;this.limited=s}};function f(t){return t.status===429||t.status===403&&t.headers.get("x-ratelimit-remaining")==="0"}function w(t,n=(e,r)=>fetch(e,r)){let e=async(r,s,i)=>{if(!s.startsWith("/"))throw new Error("API paths start with /");if(s.split(/[?#]/,1)[0].split("/").some(h=>/^(\.|%2e){1,2}$/i.test(h)))throw new Error("That address has a ./.. part; nothing was sent.");let o={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};t&&(o.Authorization=`Bearer ${t}`),i!==void 0&&(o["Content-Type"]="application/json");let a;try{a=await n(g+s,{method:r,headers:o,cache:"no-store",...i!==void 0?{body:JSON.stringify(i)}:{}})}catch{throw new u("GitHub didn't answer; check your connection and try again.",0)}let c=a.status===204?"":await a.text().catch(()=>""),d=null;try{d=c?JSON.parse(c):null}catch{d=c}return{status:a.status,ok:a.ok,data:d,headers:a.headers}};return{authed:!!t,call:e,async get(r){let s=await e("GET",r);if(s.ok)return s.data;if(s.status===404)return null;throw p(s,!!t)}}}function p(t,n){let e=typeof t.data=="object"&&t.data?.message?String(t.data.message):"";return f(t)?new u(n?"GitHub's hourly limit for this token is used up; try again in a while.":"GitHub's limit for visitors without a token is reached (60 requests an hour). Connect GitHub, or try again later.",t.status,!0):t.status===401?new u("GitHub refused the token: it may be expired, revoked or mistyped.",401):t.status===403?new u(`The token isn't allowed to do this${e?` (GitHub: ${e})`:""}.`,403):new u(`GitHub answered ${t.status}${e?`: ${e}`:""}.`,t.status)}async function b(t,n,e=5,r){let s=[];for(let i=1;i<=e;i++){let o=await t.call("GET",`${n}${n.includes("?")?"&":"?"}per_page=100&page=${i}`);if(!o.ok)throw p(o,t.authed);let a=r?r(o.data):o.data;if(s.push(...a),a.length<100)break}return s}function y(t){let n="";for(let e of new TextEncoder().encode(t))n+=String.fromCharCode(e);return btoa(n)}function T(t){let n=atob(t.replace(/\s/g,""));return new TextDecoder().decode(Uint8Array.from(n,e=>e.charCodeAt(0)))}var x=t=>t.split("/").map(encodeURIComponent).join("/"),k=t=>new Promise(n=>setTimeout(n,t));export{w as a,p as b,b as c,y as d,T as e,x as f,k as g};
@@ -0,0 +1 @@
1
+ import{b as M}from"./chunk-7TJCBOAY.js";import{c as F}from"./chunk-PABICGBL.js";import{b as O}from"./chunk-GQYFN4PE.js";import{c as q}from"./chunk-763NH7PP.js";import{a as k,c as N}from"./chunk-RPXHAG6F.js";import{a as L,c as J}from"./chunk-4WKQTWUC.js";import{k as g,o as $,p as C,t as I}from"./chunk-VQ5YXO54.js";import{I as h,P as R,Q as T,c as f,d as b,f as x,g as _,i as E,j as G,w as n,x as S,z as A}from"./chunk-GT4EAKAO.js";import{d as m}from"./chunk-G7NGB5UX.js";m();async function B(e,t=5){return(await N(e,"/user/repos?sort=pushed",t)).map(o=>({full_name:o.full_name,owner:o.owner?.login||o.full_name.split("/")[0],name:o.name,private:!!o.private,default_branch:o.default_branch||"main",pushed_at:o.pushed_at||null,archived:!!o.archived,description:o.description||null}))}function U(e,t,r){let o=t.trim().toLowerCase(),i=new Map;for(let s of e)o&&!s.full_name.toLowerCase().includes(o)||(i.has(s.owner)||i.set(s.owner,[]),i.get(s.owner).push(s));return[...i.entries()].sort(([s],[a])=>s===r?-1:a===r?1:s.localeCompare(a))}var D="sv:setupcheck",Q=10*6e4,y=new Map;function H(){try{return JSON.parse(sessionStorage.getItem(D)||"{}")}catch{return{}}}function W(e,t){try{let r=H();r[e]=[t,Date.now()],sessionStorage.setItem(D,JSON.stringify(r))}catch{}}function Z(e,t){let r=H()[t];if(r&&Date.now()-r[1]<Q)return Promise.resolve(r[0]);if(!y.has(t)){let o=(async()=>{let s=(await e.call("GET",`/repos/${t}/branches/stackvitals-data`)).ok?"data":(await e.call("GET",`/repos/${t}/contents/${O}`)).ok?"workflow":"none";return W(t,s),s})();o.catch(()=>y.delete(t)),y.set(t,o)}return y.get(t)}function j(e){let t=0,r=[];return async o=>{t>=e&&await new Promise(i=>r.push(i)),t++;try{return await o()}finally{t--,r.shift()?.()}}}m();var v=new Map,Y=j(4);function V({s:e}){return e===void 0?n("span",{class:"checking","aria-label":"Checking",children:n("span",{class:"spin","aria-hidden":"true"})}):e==="data"?n(h,{tone:"good",children:"Set up"}):e==="workflow"?n(h,{tone:"watch",children:"Set up, first run pending"}):e==="error"?n(h,{tone:"neutral",icon:null,children:"Couldn't check"}):n(h,{tone:"neutral",icon:null,children:"Not set up"})}function X({r:e,token:t,onPick:r}){let o=x(null),[i,s]=f(void 0);return b(()=>{let a=o.current;if(!a)return;let l=!0,w=()=>Y(()=>Z(k(t),e.full_name)).then(u=>l&&s(u),()=>l&&s("error"));if(typeof IntersectionObserver!="function")return w(),()=>{l=!1};let d=new IntersectionObserver(([u])=>{u?.isIntersecting&&(d.disconnect(),w())},{rootMargin:"120px"});return d.observe(a),()=>{l=!1,d.disconnect()}},[e.full_name,t]),n("li",{class:"glist-item",ref:o,children:n("button",{type:"button",class:"row row-action press",onClick:()=>r(e,i==="data"||i==="workflow"?i:"none"),children:[n("span",{class:"row-lead",children:n(M,{label:e.full_name,size:32})}),n("span",{class:"row-text",children:[n("span",{class:"row-title",children:[e.name,e.private?n(S,{name:"lock",class:"repo-lock"}):null]}),e.description?n("span",{class:"row-sub",children:e.description}):null]}),n("span",{class:"row-trail",children:n(V,{s:i})}),n(S,{name:"right",class:"row-chev"})]})})}function ge({onPick:e}){let t=E(g),[r,o]=f(null),[i,s]=f(null),[a,l]=f(""),[w,d]=f(0);b(()=>{if(!t)return;let p=!0;return v.has(t.token)||v.set(t.token,B(k(t.token))),v.get(t.token).then(c=>p&&o(c),c=>{v.delete(t.token),p&&s(c instanceof Error?c.message:"Couldn't list your repos.")}),()=>{p=!1}},[t?.token,w]);let u=_(()=>U((r||[]).filter(p=>!p.archived),a,t?.login),[r,a,t?.login]);return t?i?n(R,{icon:"warn",title:"Couldn't list your repos.",action:n(A,{onClick:()=>{s(null),d(p=>p+1)},children:"Try again"}),children:i}):r?r.length?n("div",{class:"picker",children:[n("div",{class:"search-field",children:[n(S,{name:"search"}),n("input",{class:"input",type:"search",placeholder:`Search ${r.length} repos`,"aria-label":"Search your repos",value:a,onInput:p=>l(p.currentTarget.value)})]}),u.length?u.map(([p,c])=>n("div",{class:"picker-group",children:[n("h3",{class:"picker-owner",children:[p,n("span",{class:"num",children:c.length})]}),n("ul",{class:"glist card","aria-label":`${p}'s repos`,children:c.map(P=>n(X,{r:P,token:t.token,onPick:e},P.full_name))})]})):n("p",{class:"picker-none",children:["No repo matches \u201C",a,"\u201D."]})]}):n(R,{icon:"search",title:"This token reaches no repos.",children:"On GitHub's token page, under Repository access, pick the repos, then paste the new token."}):n(T,{lines:5}):null}m();function Ee(e){let t=e.trim().replace(/^https?:\/\/github\.com\//i,"").replace(/\.git$|\/$/g,"").match(/^([A-Za-z0-9-]+)\/([A-Za-z0-9._-]+)$/);return t?`${t[1]}/${t[2]}`:null}async function K(e,t){let[r="",o=""]=e.split("/"),i=t?[{kind:"branch",owner:r,repo:o,token:t}]:[{kind:"pages",url:F(e)},{kind:"branch",owner:r,repo:o}];for(let s of i){let a=await L("app.json",s);if(a&&a.repo)return{source:s,app:a}}return null}async function Ge(e,t){let r=g.get()?.token,o=await k(r,t).get(`/repos/${e}`).catch(()=>{});if(o===null)return{kind:"missing"};let i=await K(e);if(i)return{kind:"data",...i};if(r){let s=await K(e,r);if(s)return{kind:"data",...s}}return o?{kind:"none",private:!!o.private}:{kind:"missing"}}function ee(){$.set(!1);let e=new URLSearchParams(location.search);e.has("welcome")&&(e.delete("welcome"),history.replaceState(null,"",location.pathname+(e.toString()?"?"+e:"")+location.hash))}function te(e,t="#/"){J(),I(e),G.set("last",e.id),ee(),q(t)}function ne(e,t,r="#/"){let[o="",i=""]=e.split("/"),s=t?g.get()?.token:void 0,a={...C({kind:"branch",owner:o,repo:i,...s?{token:s}:{}},e),...t?{private:!0}:{}};te(a,r)}var Ae=(e,t)=>ne(e,t,`#/setup?repo=${encodeURIComponent(e)}`);export{W as a,ge as b,Ee as c,Ge as d,te as e,ne as f,Ae as g};
@@ -0,0 +1 @@
1
+ import{c as t}from"./chunk-ASYNLVOP.js";import{c as p}from"./chunk-45PGAQRO.js";import{a as o}from"./chunk-VQ5YXO54.js";import{d as e}from"./chunk-G7NGB5UX.js";e();function y(r,i,n,s){return o(r.repo)?t(r.repo,i,p(n,s)):null}export{y as a};
@@ -0,0 +1,6 @@
1
+ import{d as p}from"./chunk-G7NGB5UX.js";p();var k=[["alerts","Alerts","warn"],["agreements","Working agreements","prs"],["digest","Weekly digest","clock"],["automation","Automation","bolt"],["ci","CI health","ci"],["delivery","Delivery","delivery"],["people","People and teams","portal"],["deps","Dependencies","deps"],["community","Community","community"],["integrations","Integrations","connections"],["benchmarks","Benchmarks","investment"],["workflow","Workflow","setup"],["appearance","Appearance","sun"],["account","Account","lock"]],w={integrations:"connectors",workflow:"install",benchmarks:"coverage",appearance:"app",account:"privacy"},b=t=>t.key.startsWith("benchmarks.")?"benchmarks":t.module;function S(t,e){return e.split(".").reduce((n,i)=>n&&typeof n=="object"?n[i]:void 0,t)}var A=(t,e)=>JSON.stringify(t??null)===JSON.stringify(e??null),f={p75:"P75",p50:"P50",ms:"ms",pr:"PR",prs:"PRs",ci:"CI",jql:"JQL",url:"URL",utc:"UTC",io:"io",dora:"DORA"},g={"alerts.pickup_p75_hours":"Pickup time","alerts.review_p75_hours":"Review time","alerts.cycle_p75_hours":"Cycle time","alerts.change_failure_rate":"Change failure rate","alerts.channels":"Send alerts to","digest.channels":"Send the digest to","digest.enabled":"Weekly digest","digest.pulse":"Pulse questions","ci.mute":"Muted tests","ci.coverage.min_patch":"Patch coverage at least","identity.teams":"Teams","identity.aliases":"Renamed logins","investment.labels":"Labels per kind of work","deps.policy.min_scorecard":"Lowest Scorecard","deps.policy.max_severity":"Highest advisory severity","deps.licenses.deny":"Licences not allowed"};function d(t){if(g[t])return g[t];let i=t.split(".").pop().replace(/^wf:/,"").split(/[_-]/).map(r=>f[r]??r).join(" ");return i.charAt(0).toUpperCase()+i.slice(1)}function R(t){let e=t.split(".");return e[0]==="connectors"?e[1].replace("incident_io","incident.io").replace(/^./,n=>n.toUpperCase()):e[1]==="monitors"?d(e[2])+" monitor":e[0]==="ci"?{mute:"Mute and quarantine",quarantine:"Mute and quarantine",coverage:"Coverage",triage:"Model triage"}[e[1]]||"":e[0]==="deps"?e[1]==="policy"||e[1]==="licenses"?"Policy":"Lookups":""}var x=t=>(t.match(/^.*?[.;](?=\s|$)/)?.[0]||t).replace(/;$/,"."),l=(t,e)=>typeof t=="string"&&e.startsWith("choice")?t==="ci"?"CI":t.charAt(0).toUpperCase()+t.slice(1):t;function O(t,e,n=""){if(t==null||t==="")return e==="switch"?"Workflow input":"Not set";if(typeof t=="boolean")return t?"On":"Off";if(e==="share"&&typeof t=="number")return`${Math.round(t*1e3)/10}%`;if(Array.isArray(t))return t.length?t.map(i=>l(i,e)).join(", "):"None";if(e==="choice")return String(l(t,e));if(typeof t=="object"){let i=Object.entries(t);return i.length?i.map(([r,s])=>`${r}: ${Array.isArray(s)?s.join(", "):String(s)}`).join("; "):"None"}return typeof t=="number"&&(e==="hours"||n)?`${t} ${n||"h"}`:String(t)}function $(t,e,n){if(typeof n=="number"&&(Number.isNaN(n)||n<0))return"A number, 0 or more.";if(e==="share"&&typeof n=="number"&&n>1)return"A share from 0 to 100%.";if(typeof n!="string"||!n)return"";if(e==="regex")try{new RegExp(n.replace(/^\(\?i\)/,""))}catch{return"This pattern doesn't compile."}return t==="connectors.jira.url"&&!/^https:\/\/[A-Za-z0-9][A-Za-z0-9-]*\.atlassian\.net\/?$/.test(n)?"Only a Jira Cloud site like https://acme.atlassian.net, so the key can't go elsewhere.":(t==="connectors.discourse.url"||t==="ci.triage.url")&&!/^https:\/\//.test(n)?"Needs an https address.":t==="connectors.jira.email"&&!/^[^\s@]+@[^\s@]+$/.test(n)?"That doesn't look like an email address.":e==="date"&&!/^\d{4}-\d{2}-\d{2}$/.test(n)?"A date like 2027-10-21.":""}var m=["dates","map","teams"],h=t=>Array.isArray(t)?`[${t.map(e=>JSON.stringify(e)).join(", ")}]`:typeof t=="string"?JSON.stringify(t):String(t);function j(t,e){var i;let n={};for(let[r,s]of Object.entries(t)){let c=e[r]||"";if(m.includes(c)){n[r]=Object.entries(s||{}).map(([u,a])=>`${JSON.stringify(u)} = ${c==="dates"?a:JSON.stringify(a)}`);continue}let o=r.lastIndexOf(".");(n[i=r.slice(0,o)]||(n[i]=[])).push(s===null?`# ${r.slice(o+1)}: back to its default (remove the line)`:`${r.slice(o+1)} = ${h(s)}`)}return Object.entries(n).map(([r,s])=>`[${r}]
2
+ ${s.join(`
3
+ `)}`).join(`
4
+
5
+ `)+`
6
+ `}export{k as a,w as b,b as c,S as d,A as e,d as f,R as g,x as h,O as i,$ as j,j as k};
@@ -0,0 +1 @@
1
+ import{i as f,k as h,l as d,m,r as y,s as l}from"./chunk-VQ5YXO54.js";import{S as g}from"./chunk-GT4EAKAO.js";import{d as s,e as a}from"./chunk-G7NGB5UX.js";s();s();function C(e){let t=document.querySelector('meta[http-equiv="Content-Security-Policy"]')?.content;return t?(t.split(";").map(n=>n.trim()).find(n=>n.startsWith("connect-src"))||"").split(/\s+/).includes(e):!0}function _(e){let t=e?.auth?.relay||a.relay||"",r=e?.auth?.client_id||a.clientId||"";if(!t||!r||!/^https:\/\//.test(t))return null;try{return C(new URL(t).origin)?{relay:t.replace(/\/$/,""),clientId:r}:null}catch{return null}}s();var p="sv:oauth";function A(e){let t="";for(let r of e)t+=String.fromCharCode(r);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var k=e=>A(crypto.getRandomValues(new Uint8Array(e)));async function T(e){return A(new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))))}var b=()=>location.origin+location.pathname;async function E(e,t,r){let n=k(24),o=k(48);try{sessionStorage.setItem(p,JSON.stringify({state:n,verifier:o,remember:t,back:r,at:Date.now()}))}catch{}return`https://github.com/login/oauth/authorize?${new URLSearchParams({client_id:e.clientId,redirect_uri:b(),state:n,code_challenge:await T(o),code_challenge_method:"S256",allow_signup:"true"})}`}async function S(e,t,r){let n=await r(`${e.relay}/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"omit"}),o=await n.json().catch(()=>({}));if(!n.ok||o.error||!o.access_token)throw new Error(o.error_description||o.error||`The sign-in relay answered ${n.status}.`);return o}function w(e,t,r=Date.now()){return{token:e.access_token,kind:"app",remember:t,...e.expires_in?{expires:r+e.expires_in*1e3}:{},...e.refresh_token?{refresh:e.refresh_token}:{},...e.refresh_token_expires_in?{refreshExpires:r+e.refresh_token_expires_in*1e3}:{}}}async function U(e,t=(r,n)=>fetch(r,n)){let r=new URLSearchParams(location.search),n=r.get("code"),o=r.get("state");if(!n||!o)return null;let i=null;try{i=JSON.parse(sessionStorage.getItem(p)||"null"),sessionStorage.removeItem(p)}catch{i=null}if(r.delete("code"),r.delete("state"),history.replaceState(null,"",location.pathname+(r.toString()?"?"+r:"")+location.hash),!i||i.state!==o||Date.now()-i.at>15*6e4)throw new Error("The sign-in didn't match this tab (or took too long). Try again.");let c=await S(e,{grant_type:"authorization_code",code:n,code_verifier:i.verifier,redirect_uri:b()},t);return{account:w(c,i.remember),back:i.back}}async function x(e,t,r=(o,i)=>fetch(o,i),n=Date.now()){if(!t.expires||t.expires-n>5*6e4)return t;if(!e||!t.refresh||t.refreshExpires&&t.refreshExpires<n)return null;let o=await S(e,{grant_type:"refresh_token",refresh_token:t.refresh},r);return{...t,...w(o,!!t.remember,n),kind:t.kind}}function v(e,t){let r=n=>{if(n.source.kind!=="branch"||!n.source.token||e!==null&&n.source.token!==e)return n;let{token:o,...i}=n.source;return{...n,source:t?{...i,token:t}:i}};y.set(n=>n.map(r)),l.set(r(l.get()));try{let n=JSON.parse(sessionStorage.getItem("sv:tokens")||"{}");for(let o of Object.keys(n))(e===null||n[o]===e)&&(t?n[o]=t:delete n[o]);Object.keys(n).length?sessionStorage.setItem("sv:tokens",JSON.stringify(n)):sessionStorage.removeItem("sv:tokens")}catch{}}f(()=>v(null,void 0));var u=null;function O(e={}){return e.cfg!==void 0||e.fetchImpl?I(e):(u||(u=I(e).finally(()=>{u=null})),u)}async function I(e){let t=h.get();if(!t)return null;let r=e.say||(c=>g(c,"bad")),n=e.cfg!==void 0?e.cfg:_(e.app),o=c=>(m(),r(c),null),i;try{i=await x(n,t,e.fetchImpl)}catch{return o("Your GitHub sign-in couldn't be renewed. Sign in again to keep going.")}return i===t?t:i?(d(i),v(t.token,i.token),i):t.expires&&t.expires>Date.now()?t:o("Your GitHub sign-in has ended. Sign in again to keep going.")}async function j(e){return(await O({app:e}))?.token}export{_ as a,E as b,U as c,v as d,O as e,j as f};
@@ -0,0 +1,273 @@
1
+ import{b as K,c as q,d as J,e as y,f as Q,g as H}from"./chunk-RQZPSJ2Y.js";import{a as D,c as j,d as N,e as U,g as X}from"./chunk-3IXWEOIJ.js";import{a as W}from"./chunk-Y6LUXDM6.js";import{c as _}from"./chunk-7TJCBOAY.js";import{b as F}from"./chunk-6BDBXA6V.js";import{a as S,b as A,c as G}from"./chunk-T7QVTNXF.js";import{a as Y}from"./chunk-RPXHAG6F.js";import{j as R,k as P,l as L,p as O,r as V}from"./chunk-VQ5YXO54.js";import{I as C,S as B,a as z,c as v,d as g,f as I,i as f,j as T,w as s,z as m}from"./chunk-GT4EAKAO.js";import{d as M}from"./chunk-G7NGB5UX.js";M();M();function Z(){let[e,t]=v(""),[i,a]=v(!1),[c,l]=v(null),[n,p]=v(null);return{text:e,edit:h=>{t(h),l(null),p(null)},busy:i,err:c,found:n,go:async h=>{h?.preventDefault();let d=q(e);if(!d){l("Type it as owner/repo, for example vitejs/vite.");return}a(!0),l(null),p(null);let w=await J(d);if(a(!1),w.kind==="data"){y(O(w.source,w.app.repo)),B(`Opened ${w.app.repo}`);return}p({repo:d,res:w})}}}var ss=(e,t)=>t==="data"?Q(e.full_name,e.private):H(e.full_name,e.private);function rs(){let e=f(P),[t,i]=v(null),a=f(V).filter(l=>l.id!=="here"&&!l.demo),c=new URLSearchParams(location.search).has("welcome");return g(()=>{let l=S();if(!l||!new URLSearchParams(location.search).has("code")){let n=a.find(p=>p.id===T.get("last",""))||a[a.length-1];e&&n&&!c&&y(n);return}i("Finishing sign-in\u2026"),G(l).then(async n=>{if(!n){i(null);return}let p=await Y(n.account.token).get("/user");L({...n.account,login:p?.login,avatar:p?.avatar_url}),B(`Signed in as ${p?.login||"you"}`),i(null)},n=>{i(n instanceof Error?n.message:"Sign-in failed.")})},[]),s(E,{a:e,signing:t,known:a})}var es=`/* The Instrument design's Welcome (loads only in that design): the framed sheet, the self-drawing schematic, framed panels. */
2
+ .svw { min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.5; overflow-x: hidden; }
3
+ .svw p { margin: 0; }
4
+ .svw b { font-weight: 600; }
5
+ .svw main { padding: 0; outline: none; }
6
+
7
+ /* The sheet's frame: four hairlines that draw in turn, with centre ticks */
8
+ .svw-frame { position: relative; max-width: 1240px; margin: 24px auto; padding: clamp(20px, 4vw, 56px); }
9
+ .svw-edge, .svw-tick { position: absolute; background: var(--ink); pointer-events: none; }
10
+ .svw-edge.e-t, .svw-edge.e-b { left: 0; right: 0; height: 1px; }
11
+ .svw-edge.e-t { top: 0; transform-origin: left; } .svw-edge.e-b { bottom: 0; transform-origin: right; }
12
+ .svw-edge.e-l, .svw-edge.e-r { top: 0; bottom: 0; width: 1px; }
13
+ .svw-edge.e-r { right: 0; transform-origin: top; } .svw-edge.e-l { left: 0; transform-origin: bottom; }
14
+ .svw-tick.k-t, .svw-tick.k-b { left: 50%; width: 1px; height: 10px; } .svw-tick.k-t { top: 0; } .svw-tick.k-b { bottom: 0; }
15
+ .svw-tick.k-l, .svw-tick.k-r { top: 50%; height: 1px; width: 10px; } .svw-tick.k-l { left: 0; } .svw-tick.k-r { right: 0; }
16
+
17
+ /* Headline: the padding keeps descenders (the g in doing) inside the reveal clip; the negative margin keeps the spacing */
18
+ .svw-h1 { margin: 0 0 -.18em; padding: 0 0 .18em; font-family: var(--display); font-weight: 700; font-size: clamp(40px, 6vw, 78px); line-height: 1; letter-spacing: -.01em; max-width: 17ch; }
19
+
20
+ /* Schematic */
21
+ .svw-flow { margin: clamp(32px, 5vw, 56px) 0 clamp(28px, 4vw, 44px); }
22
+ .svw-schem { display: block; width: 100%; height: auto; overflow: visible; }
23
+ .svw-schem.is-tall { display: none; }
24
+ .svw-schem text { fill: var(--ink); }
25
+ .svw-schem .s-bx { fill: none; stroke: var(--ink); stroke-width: 1.2; }
26
+ .svw-schem .s-hl { fill: none; stroke: var(--ink); stroke-width: .8; }
27
+ .svw-schem .s-live { fill: none; stroke: var(--sv-blue); stroke-width: 1.6; }
28
+ .svw-schem .s-ah { fill: var(--sv-blue); }
29
+ .svw-schem .s-dt { fill: var(--ink); }
30
+ .svw-schem .s-lbl { font: 600 16.5px var(--font); }
31
+ .svw-schem .s-mono { font-family: var(--mono); font-weight: 400; font-size: 13px; }
32
+ .svw-schem .s-mono-sm { font-size: 13.5px; }
33
+ .svw-schem .s-dim { font: 600 15px var(--font); fill: var(--ink-2); }
34
+ .svw-schem .s-cn { font: 700 15px var(--font); }
35
+ .svw-schem .s-sl { font: 700 15px var(--font); }
36
+ .svw-schem .s-sl.s-bad { fill: var(--bad); } .svw-schem .s-sl.s-warn { fill: var(--watch); } .svw-schem .s-sl.s-ok { fill: var(--good); }
37
+ .svw-schem .s-mk { stroke: var(--dot-edge, #000); stroke-width: 1; stroke-linejoin: round; }
38
+ .svw-schem .s-mk-bad, .svw-schem .s-bar-bad { fill: var(--sv-coral); }
39
+ .svw-schem .s-mk-warn, .svw-schem .s-bar-warn { fill: var(--sv-amber); }
40
+ .svw-schem .s-mk-ok, .svw-schem .s-bar-ok { fill: var(--sv-mint); }
41
+ .svw-schem .s-mk-g { fill: none; stroke: #000; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
42
+ .svw-schem .s-rm-only { display: none; }
43
+ /* A connected token marks this app healthy: the box fills mint, like the Healthy key */
44
+ .svw-schem .s-appfill { fill: var(--sv-mint); transform-box: fill-box; transform-origin: center bottom; transform: scaleY(0); transition: transform .6s .35s var(--sv-ease); }
45
+ .svw-schem .s-applbl { transition: fill .2s .5s; }
46
+ .svw.is-ok .svw-schem .s-appfill { transform: scaleY(1); }
47
+ .svw.is-ok .svw-schem .s-applbl { fill: #000; }
48
+
49
+ /* Three points, the brand block and the colour key */
50
+ .svw-notes-row { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: end; }
51
+ .svw-notes { list-style: none; margin: 0; padding: 0; counter-reset: n; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
52
+ .svw-notes li { counter-increment: n; display: grid; grid-template-columns: 40px minmax(0, 1fr); padding-top: 14px; border-top: 2px solid var(--ink); font-size: 17px; line-height: 1.45; }
53
+ .svw-notes li::before { content: counter(n); width: 28px; height: 28px; border: 1.5px solid var(--ink); border-radius: 50% !important; display: grid; place-items: center; font: 700 15px/1 var(--font); margin-top: -1px; }
54
+ .svw-tb { font-size: 15px; background: var(--surface); border: 1.5px solid var(--frame); }
55
+ .svw-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 24px; letter-spacing: -.01em; background: var(--strip); border-bottom: 1px solid var(--line-strong); padding: 12px 16px; }
56
+ .svw-brand .logo-mark { flex: none; display: inline-block; }
57
+ .svw-brand .logo-mark svg { width: 100%; height: 100%; display: block; }
58
+ .svw-key { display: grid; gap: 8px; padding: 14px 16px 16px; }
59
+ .svw-key p { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); }
60
+ .svw-key .sv-mark { width: 14px; height: 14px; vertical-align: 0; }
61
+ .svw-key b { color: var(--ink); font-weight: 700; }
62
+ .svw-signing { display: flex; align-items: center; gap: 10px; margin-top: 28px; font-weight: 600; }
63
+
64
+ /* Panels: framed like Instrument's panels; the heading sits on a rule in the colour of the stage it acts on (Actions blue, data mint, app yellow) */
65
+ .svw-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: clamp(56px, 8vw, 96px); }
66
+ .svw-panel { --sec: var(--ink); --sec-t: var(--ink); position: relative; min-width: 0; padding: clamp(20px, 3vw, 36px); background: var(--surface); }
67
+ .svw-panel.svw-act { --sec: var(--sv-blue); --sec-t: var(--sv-blue-ink); }
68
+ .svw-panel.svw-data { --sec: var(--sv-mint); --sec-t: var(--good); }
69
+ .svw-panel.svw-app { --sec: var(--sv-yellow); --sec-t: var(--sv-yellow-ink); }
70
+ .svw-panel::before { content: ""; position: absolute; inset: 0; border: 1.5px solid var(--frame); pointer-events: none; transition: clip-path .9s var(--sv-ease); }
71
+ .svw-panel.is-wide { grid-column: 1 / -1; }
72
+ .svw-dh { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-weight: 700; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.15; letter-spacing: -.01em; }
73
+ .svw-t { border-bottom: 4px solid var(--sec); padding-bottom: 4px; transition: clip-path .7s .25s var(--sv-ease); }
74
+ .svw-lede { color: var(--ink-2); max-width: 46ch; }
75
+ .svw h3 { margin: 0 0 6px; font-weight: 700; font-size: 20px; line-height: 1.25; }
76
+ .svw-sub { color: var(--ink-2); }
77
+ .svw-panel .svw-act { margin-top: 18px; }
78
+
79
+ /* Steps: numbered in the section's colour, side by side with a rule between */
80
+ .svw-steps { list-style: none; margin: 28px 0 0; padding: 0; counter-reset: n; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
81
+ .svw-steps > li { counter-increment: n; display: grid; grid-template-columns: 42px minmax(0, 1fr); min-width: 0; }
82
+ .svw-steps > li > div { min-width: 0; }
83
+ .svw-steps > li + li { border-left: 1px solid var(--line-strong); padding-left: 40px; }
84
+ .svw-steps > li::before { content: counter(n); width: 30px; height: 30px; border: 1.5px solid var(--sec); color: var(--sec-t); border-radius: 50% !important; display: grid; place-items: center; font: 700 15px/1 var(--font); }
85
+ .svw-panel.svw-act .svw-steps > li::before { background: var(--sv-blue); color: #FFF; }
86
+ .svw-steps.is-done > li { grid-template-columns: minmax(0, 1fr); }
87
+ .svw-steps.is-done > li::before { content: none; }
88
+ .svw-signin { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 24px; }
89
+ .svw-or { font-size: 15px; font-weight: 600; color: var(--ink-2); }
90
+
91
+ /* Buttons: plain rectangles at touch size; the demo in yellow, open-by-name outlined in the data branch's mint */
92
+ .svw .btn { min-height: 44px; font-size: 16px; }
93
+ .svw .btn-sm { min-height: 36px; font-size: 14px; }
94
+ .svw .btn.svw-yel { background: var(--sv-yellow); border-color: var(--ink); color: #000; }
95
+ .svw .btn.svw-yel:hover { background: transparent; color: var(--ink); }
96
+ .svw .btn.svw-mint { border-color: var(--good); color: var(--good); }
97
+ .svw .btn.svw-mint:hover { background: var(--sv-mint); border-color: var(--good); color: #000; }
98
+
99
+ /* GitHub's page, sketched on a grey card with its own header strip */
100
+ .svw-mock { margin: 24px 0 0; background: var(--surface-2); border: 1px solid var(--line-strong); }
101
+ .svw-mock-title { font-weight: 600; font-size: 15px; color: var(--ink-2); background: var(--strip); border-bottom: 1px solid var(--line-strong); padding: 8px 16px; margin: 0 !important; }
102
+ .svw-mock > div { padding: 14px 16px 0; }
103
+ .svw-mock-k { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
104
+ .svw-radio { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 5px 0; }
105
+ .svw-radio i { width: 14px; height: 14px; border: 1.5px solid var(--ink); background: var(--surface); display: inline-grid; place-items: center; flex: none; }
106
+ .svw-radio.is-on i::after { content: ""; width: 6px; height: 6px; border-radius: 50% !important; background: var(--ink); }
107
+ .svw-repo { display: inline-block; margin: 8px 0 0 24px; border: 1px solid var(--line-strong); background: var(--surface); padding: 2px 8px; font: 400 14px var(--mono); }
108
+ .svw-mock figcaption { padding: 12px 16px 14px; font-size: 15px; color: var(--ink-2); }
109
+
110
+ /* Fields */
111
+ .svw-field { display: block; font-size: 15px; font-weight: 600; margin: 18px 0 6px; }
112
+ .svw-row { display: flex; gap: 10px; flex-wrap: wrap; }
113
+ .svw-input { flex: 1 1 220px; min-width: 0; height: 44px; border: 1.5px solid var(--ink); background: var(--field); color: var(--ink); font: 400 15px var(--mono); padding: 0 12px; }
114
+ .svw-input::placeholder { color: var(--ink-3); }
115
+ .svw-input:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
116
+ .svw-input[aria-invalid="true"] { border: 2px solid var(--bad); padding: 0 11.5px; }
117
+ .svw-help { font-size: 15px; color: var(--ink-2); margin-top: 10px !important; }
118
+ .svw-check { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 16px; cursor: pointer; }
119
+ .svw-check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--ink); margin: 0; display: grid; place-items: center; cursor: pointer; background: var(--surface); }
120
+ .svw-check input:checked::after { content: ""; width: 12px; height: 6px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-2px) rotate(-45deg); }
121
+
122
+ /* The token's route: this browser to api.github.com, dashed while waiting, drawn in blue once it checks out */
123
+ .svw-link { display: block; width: 100%; max-width: 420px; height: auto; margin-top: 22px; overflow: visible; }
124
+ .svw-link text { font: 600 15px var(--font); fill: var(--ink-2); }
125
+ .svw-link .l-end { fill: none; stroke: var(--ink); stroke-width: 1.5; }
126
+ .svw-link .l-wait { stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 4 4; }
127
+ .svw-link .l-fill { stroke: var(--sv-blue); stroke-width: 5; stroke-dasharray: 1; stroke-dashoffset: 1; }
128
+ .svw-link.is-ok .l-fill { animation: svwDraw .7s var(--sv-ease) forwards; }
129
+ .svw:not(.is-still) .svw-link.is-busy .l-wait { stroke: var(--sv-blue); animation: svwMarch .6s linear infinite; }
130
+ .svw-verdict { display: flex; align-items: center; gap: 14px; min-height: 52px; margin-top: 10px; }
131
+ /* Success: a mint block with a black check, the same mark as Healthy in the key and the filled app box */
132
+ .svw-okmark { flex: none; display: block; width: 28px; height: 28px; background: var(--sv-mint); outline: 1px solid var(--dot-edge, #000); outline-offset: -1px; animation: svwBlock .35s .55s var(--sv-ease) both; }
133
+ .svw-okmark path { fill: none; stroke: #000; stroke-width: 2.6; stroke-linecap: square; stroke-dasharray: 1; stroke-dashoffset: 1; animation: svwDraw .3s .85s var(--sv-ease) forwards; }
134
+ .svw-status { min-height: 1.5em; margin-top: 10px !important; font-size: 16px; font-weight: 600; }
135
+ .svw-verdict .svw-status { margin-top: 0 !important; }
136
+ .svw-verdict .svw-status b { font-weight: 700; }
137
+ .svw-verdict .svw-sub { font-weight: 400; }
138
+ .svw-status.is-bad { color: var(--bad); display: flex; gap: 8px; align-items: baseline; }
139
+ .svw-status .sv-mark { vertical-align: -1px; }
140
+ .svw-acct { margin-top: 14px; border-top: 1px solid var(--line-strong); padding-top: 14px; }
141
+ .svw-abil { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
142
+ .svw-picker { margin-top: 16px; }
143
+ .svw-note { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line-strong); padding: 12px 14px; font-size: 15px; margin-top: 4px; }
144
+ .svw-note .sv-mark { margin-top: 5px; }
145
+ .svw-note-act { display: block; margin-top: 8px; }
146
+
147
+ /* Recently opened and settings */
148
+ .svw-recent { display: flex; flex-wrap: wrap; gap: 10px; }
149
+ .svw-recent-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); font: 400 15px var(--mono); cursor: pointer; }
150
+ .svw-recent-btn:hover { border-color: var(--sv-blue); color: var(--sv-blue-ink); }
151
+ .svw-settings .appearance { display: flex; flex-wrap: wrap; gap: 28px 56px; padding: 0; margin-top: 6px; }
152
+ .svw-settings .pref-row { flex-direction: column; align-items: flex-start; gap: 8px; padding: 0; font-size: 15px; font-weight: 600; }
153
+ .svw-settings .seg-opt { min-height: 40px; min-width: 76px; font-size: 15px; justify-content: center; }
154
+ .svw-settings .pref-row .switch { margin: 8px 0; }
155
+
156
+ /* Motion: frame, then schematic, then the three points; the two run states cycle after. Once drawn (.is-drawn) it stays drawn on resize */
157
+ @keyframes svwDraw { to { stroke-dashoffset: 0; } }
158
+ @keyframes svwMarch { to { stroke-dashoffset: -8; } }
159
+ @keyframes svwBlock { from { transform: scale(0); } }
160
+ @keyframes svwEdgeX { from { transform: scaleX(0); } }
161
+ @keyframes svwEdgeY { from { transform: scaleY(0); } }
162
+ @keyframes svwInk { from { opacity: 0; } }
163
+ @keyframes svwLetter { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
164
+ @keyframes svwGrow { from { transform: scaleX(0); } }
165
+ @keyframes svwCycA { 0% { opacity: 0; } 5%, 45% { opacity: 1; } 51%, 100% { opacity: 0; } }
166
+ @keyframes svwCycB { 0%, 50% { opacity: 0; } 56%, 95% { opacity: 1; } 100% { opacity: 0; } }
167
+ .svw-schem .s-cyc-a, .svw-schem .s-cyc-b { opacity: 0; }
168
+ .svw:not(.is-still) .s-cyc-a { animation: svwCycA 8s 3.6s infinite both; }
169
+ .svw:not(.is-still) .s-cyc-b { animation: svwCycB 8s 3.6s infinite both; }
170
+ .svw:not(.is-still):not(.is-drawn) .s-grow { transform-box: fill-box; transform-origin: left; animation: svwGrow .7s var(--t, 0s) var(--sv-ease) both; }
171
+ .svw:not(.is-still):not(.is-drawn) .svw-schem .s-d { stroke-dasharray: 1; stroke-dashoffset: 1; animation: svwDraw .55s var(--t, 0s) var(--sv-ease) forwards; }
172
+ .svw:not(.is-still):not(.is-drawn) .svw-schem .s-f { animation: svwInk .35s var(--t, 0s) both; }
173
+ .svw:not(.is-still):not(.is-drawn) .e-t, .svw:not(.is-still):not(.is-drawn) .e-b { animation: svwEdgeX .5s var(--sv-ease) both; }
174
+ .svw:not(.is-still):not(.is-drawn) .e-r, .svw:not(.is-still):not(.is-drawn) .e-l { animation: svwEdgeY .5s var(--sv-ease) both; }
175
+ .svw:not(.is-still):not(.is-drawn) .e-r { animation-delay: .35s; } .svw:not(.is-still):not(.is-drawn) .e-b { animation-delay: .7s; } .svw:not(.is-still):not(.is-drawn) .e-l { animation-delay: 1.05s; }
176
+ .svw:not(.is-still):not(.is-drawn) .svw-tick { animation: svwInk .3s 1.3s both; }
177
+ .svw:not(.is-still):not(.is-drawn) .svw-h1 { animation: svwLetter .9s .25s var(--sv-ease) both; }
178
+ .svw:not(.is-still):not(.is-drawn) .svw-notes li { animation: svwLetter .6s var(--t, 2.6s) var(--sv-ease) both; }
179
+ .svw:not(.is-still):not(.is-drawn) .svw-tb { animation: svwInk .5s 2.9s both; }
180
+ .svw:not(.is-still):not(.is-drawn) .svw-key { animation: svwInk .5s 3.4s both; }
181
+ .svw:not(.is-still) .svw-panel:not(.is-in)::before { clip-path: inset(0 100% 100% 0); }
182
+ .svw:not(.is-still) .svw-panel:not(.is-in) .svw-t { clip-path: inset(0 100% 0 0); }
183
+ .svw:not(.is-still) .svw-panel .svw-t, .svw:not(.is-still) .svw-panel::before { clip-path: inset(0 0 0 0); }
184
+ /* Reduced motion: everything in place at once, both run states side by side */
185
+ .svw.is-still *, .svw.is-still *::before, .svw.is-still *::after { animation: none !important; transition: none !important; }
186
+ .svw.is-still .s-cyc-a, .svw.is-still .s-cyc-b { opacity: 1; }
187
+ .svw.is-still .s-rm-hide { display: none; }
188
+ .svw.is-still .s-rm-only { display: inline; }
189
+ .svw.is-still .s-sh-a { transform: translateY(-9px); }
190
+ .svw.is-still .s-sh-b { transform: translateY(11px); }
191
+ .svw.is-still .svw-link .l-fill { stroke-dashoffset: 1; }
192
+ .svw.is-still .svw-link.is-ok .l-fill, .svw.is-still .svw-okmark path { stroke-dashoffset: 0; }
193
+
194
+ /* Between these widths the route sits in a half-width step and scales down, so its labels get bigger units */
195
+ @media (min-width: 901px) and (max-width: 1100px) { .svw-link text { font-size: 19px; } }
196
+ @media (min-width: 1101px) and (max-width: 1260px) { .svw-link text { font-size: 16.5px; } }
197
+ @media (max-width: 900px) {
198
+ .svw-notes-row { grid-template-columns: 1fr; }
199
+ .svw-tb { max-width: 400px; justify-self: end; width: 100%; }
200
+ .svw-notes { grid-template-columns: 1fr; gap: 14px; }
201
+ .svw-panels { grid-template-columns: 1fr; }
202
+ .svw-steps { grid-template-columns: 1fr; gap: 32px; }
203
+ .svw-steps > li + li { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-strong); padding-top: 28px; }
204
+ }
205
+ /* Below this width the wide schematic would shrink its labels under 14px, so the stacked one takes over */
206
+ @media (max-width: 1100px) {
207
+ .svw-schem.is-wide { display: none; }
208
+ .svw-schem.is-tall { display: block; max-width: 380px; margin: 0 auto; }
209
+ .svw-schem.is-tall .s-dim, .svw-schem.is-tall .s-sl { font-size: 16px; }
210
+ .svw-schem.is-tall .s-cn { font-size: 15px; }
211
+ .svw-schem.is-tall .s-lbl { font-size: 16.5px; }
212
+ }
213
+ @media (max-width: 640px) {
214
+ .svw-frame { margin: 12px; padding: 16px; }
215
+ .svw-panel { padding: 18px 16px 20px; }
216
+ .svw-tb { justify-self: stretch; max-width: none; }
217
+ .svw-steps > li { grid-template-columns: 40px minmax(0, 1fr); }
218
+ .svw-settings .seg-opt { min-width: 64px; }
219
+ /* The route drawing scales down here, so its two end labels get bigger units to stay readable */
220
+ .svw-link text { font-size: 24px; }
221
+ }
222
+ `;document.getElementById("sv-welcome-sheet-css")||document.head.appendChild(Object.assign(document.createElement("style"),{id:"sv-welcome-sheet-css",textContent:es}));var ts=(e,t)=>`<path class="s-mk s-mk-bad" transform="translate(${e} ${t})" d="M0 -6.5 6.5 5H-6.5z"/>`,is=(e,t)=>`<g transform="translate(${e} ${t})"><circle class="s-mk s-mk-warn" r="6.5"/><path class="s-mk-g" d="M0 -3.8V0H2.8"/></g>`,as=(e,t)=>`<g transform="translate(${e} ${t})"><rect class="s-mk s-mk-ok" x="-5.5" y="-5.5" width="11" height="11"/><path class="s-mk-g" d="M-3 0l2 2.2 4-4.4"/></g>`,o=e=>`style="--t:${e}s" pathLength="1"`,r=e=>`style="--t:${e}s"`,u=(e,t,i,a,c,l,n,p)=>`<circle class="s-dt s-f" ${r(String(a))} cx="${e}" cy="${t}" r="2.4"/><path class="s-hl s-d" ${o(String(a))} d="M${e} ${t} ${c} ${l}"/><circle class="s-hl s-d" ${o((a+.1).toFixed(1))} cx="${n}" cy="${p}" r="12"/><text class="s-cn s-f" ${r((a+.2).toFixed(1))} x="${n}" y="${p+4.5}" text-anchor="middle">${i}</text>`,cs=`
223
+ <rect class="s-bx s-d" ${o(".9")} x="1" y="80" width="198" height="56"/>
224
+ <text class="s-lbl s-f" ${r("1.3")} x="100" y="113" text-anchor="middle">your repo</text>
225
+ <path class="s-live s-d" ${o("1.35")} d="M199 108H264"/><path class="s-ah s-f" ${r("1.6")} d="M258 103.5 267 108l-9 4.5z"/>
226
+ <rect class="s-bx s-d" ${o("1.4")} x="267" y="80" width="198" height="56"/>
227
+ <text class="s-lbl s-f" ${r("1.75")} x="366" y="113" text-anchor="middle">GitHub Actions run</text>
228
+ <path class="s-live s-d" ${o("1.8")} d="M465 108H530"/><path class="s-ah s-f" ${r("2.05")} d="M524 103.5 533 108l-9 4.5z"/>
229
+ <rect class="s-bx s-d" ${o("1.85")} x="533" y="80" width="198" height="56"/>
230
+ <text class="s-lbl s-f" ${r("2.2")} x="632" y="113" text-anchor="middle"><tspan class="s-mono">stackvitals-data</tspan> branch</text>
231
+ <path class="s-live s-d" ${o("2.25")} d="M731 108H798"/><path class="s-ah s-f" ${r("2.5")} d="M792 103.5 801 108l-9 4.5z"/>
232
+ <rect class="s-appfill" x="801" y="80" width="198" height="56"/>
233
+ <rect class="s-bx s-d" ${o("2.3")} x="801" y="80" width="198" height="56"/>
234
+ <text class="s-lbl s-applbl s-f" ${r("2.65")} x="900" y="113" text-anchor="middle">this app</text>
235
+ <path class="s-hl s-d" ${o("2.5")} d="M267 74V28M733 74V28"/>
236
+ <path class="s-hl s-d" ${o("2.65")} d="M267 36H392M608 36H733"/>
237
+ <path class="s-hl s-d" ${o("2.8")} d="M261 42 273 30M727 42 739 30"/>
238
+ <text class="s-dim s-f" ${r("2.85")} x="500" y="40" text-anchor="middle">every night, in Actions</text>
239
+ <path class="s-hl s-d" ${o("2.6")} d="M1 142V206M999 142V206"/>
240
+ <path class="s-hl s-d" ${o("2.75")} d="M1 198H372M628 198H999"/>
241
+ <path class="s-hl s-d" ${o("2.9")} d="M-5 204 7 192M993 204 1005 192"/>
242
+ <text class="s-dim s-f" ${r("2.95")} x="500" y="202" text-anchor="middle">no server, no account</text>
243
+ ${u(366,136,1,3,386,158,396,167)}${u(632,136,2,3.1,652,158,662,167)}${u(900,136,3,3.2,920,158,930,167)}
244
+ <g class="s-rm-hide"><rect class="s-bar-bad s-cyc-a" x="268" y="131" width="196" height="4"/><rect class="s-bar-warn s-cyc-b" x="268" y="131" width="196" height="4"/></g>
245
+ <g class="s-rm-only"><rect class="s-bar-bad" x="268" y="131" width="98" height="4"/><rect class="s-bar-warn" x="366" y="131" width="98" height="4"/></g>
246
+ <g class="s-cyc-a"><g class="s-sh-a">${ts(426,167)}<text class="s-sl s-bad" x="440" y="171.5">1 flaky test</text></g></g>
247
+ <g class="s-cyc-b"><g class="s-sh-b">${is(426,167)}<text class="s-sl s-warn" x="440" y="171.5">1 slow check</text></g></g>
248
+ <rect class="s-bar-ok s-grow" ${r("3.3")} x="534" y="131" width="196" height="4"/>
249
+ <g class="s-f" ${r("3.5")}>${as(692,167)}<text class="s-sl s-ok" x="706" y="171.5">182 days kept</text></g>`,ps=`
250
+ <rect class="s-bx s-d" ${o(".9")} x="60" y="2" width="200" height="52"/>
251
+ <text class="s-lbl s-f" ${r("1.2")} x="160" y="33" text-anchor="middle">your repo</text>
252
+ <path class="s-live s-d" ${o("1.25")} d="M160 54V105"/><path class="s-ah s-f" ${r("1.45")} d="M155.5 99 160 108l4.5-9z"/>
253
+ <rect class="s-bx s-d" ${o("1.3")} x="60" y="108" width="200" height="52"/>
254
+ <text class="s-lbl s-f" ${r("1.6")} x="160" y="139" text-anchor="middle">GitHub Actions run</text>
255
+ <path class="s-live s-d" ${o("1.65")} d="M160 160V211"/><path class="s-ah s-f" ${r("1.85")} d="M155.5 205 160 214l4.5-9z"/>
256
+ <rect class="s-bx s-d" ${o("1.7")} x="60" y="214" width="200" height="52"/>
257
+ <text class="s-lbl s-f" ${r("2")} x="160" y="245" text-anchor="middle"><tspan class="s-mono s-mono-sm">stackvitals-data</tspan> branch</text>
258
+ <path class="s-live s-d" ${o("2.05")} d="M160 266V317"/><path class="s-ah s-f" ${r("2.25")} d="M155.5 311 160 320l4.5-9z"/>
259
+ <rect class="s-appfill" x="60" y="320" width="200" height="52"/>
260
+ <rect class="s-bx s-d" ${o("2.1")} x="60" y="320" width="200" height="52"/>
261
+ <text class="s-lbl s-applbl s-f" ${r("2.4")} x="160" y="351" text-anchor="middle">this app</text>
262
+ <path class="s-hl s-d" ${o("2.4")} d="M266 108H316M266 266H316"/>
263
+ <path class="s-hl s-d" ${o("2.55")} d="M308 108V266"/>
264
+ <path class="s-hl s-d" ${o("2.7")} d="M302 114 314 102M302 272 314 260"/>
265
+ <text class="s-dim s-f" ${r("2.75")} transform="translate(326 187) rotate(90)" text-anchor="middle">every night</text>
266
+ ${u(60,134,1,2.8,34,134,22,134)}${u(60,240,2,2.9,34,240,22,240)}${u(60,346,3,3,34,346,22,346)}
267
+ <text class="s-dim s-f" ${r("3.2")} x="160" y="398" text-anchor="middle">no server, no account</text>
268
+ <g class="s-rm-hide"><rect class="s-bar-bad s-cyc-a" x="61" y="155" width="198" height="4"/><rect class="s-bar-warn s-cyc-b" x="61" y="155" width="198" height="4"/></g>
269
+ <g class="s-rm-only"><rect class="s-bar-bad" x="61" y="155" width="99" height="4"/><rect class="s-bar-warn" x="160" y="155" width="99" height="4"/></g>
270
+ <g class="s-cyc-a"><g class="s-sh-a">${ts(178,187)}<text class="s-sl s-bad" x="192" y="191.5">1 flaky test</text></g></g>
271
+ <g class="s-cyc-b"><g class="s-sh-b">${is(178,187)}<text class="s-sl s-warn" x="192" y="191.5">1 slow check</text></g></g>
272
+ <rect class="s-bar-ok s-grow" ${r("3.1")} x="61" y="261" width="198" height="4"/>
273
+ <g class="s-f" ${r("3.3")}>${as(178,293)}<text class="s-sl s-ok" x="192" y="297.5">182 days kept</text></g>`,$=typeof matchMedia=="function"?matchMedia("(prefers-reduced-motion: reduce)"):null;function ds(){let e=f(F),[t,i]=v(!!$?.matches);return g(()=>{if(!$)return;let a=()=>i($.matches);return $.addEventListener("change",a),()=>$.removeEventListener("change",a)},[]),e||t}function x({id:e,title:t,tone:i,wide:a,lede:c,children:l}){let n=I(null),[p,b]=v(!1);return g(()=>{let k=n.current;if(!k||typeof IntersectionObserver!="function"){b(!0);return}let h=new IntersectionObserver(d=>{d.some(w=>w.isIntersecting)&&(b(!0),h.disconnect())},{rootMargin:"0px 0px -12% 0px"});return h.observe(k),()=>h.disconnect()},[]),s("section",{ref:n,class:`svw-panel svw-${i}${a?" is-wide":""}${p?" is-in":""}`,"aria-labelledby":e,children:[s("h2",{class:"svw-dh",id:e,children:s("span",{class:"svw-t",children:t})}),c?s("p",{class:"svw-lede",children:c}):null,l]})}function ns({state:e}){return s("svg",{class:`svw-link is-${e}`,viewBox:"0 0 420 44","aria-hidden":"true",children:[s("rect",{class:"l-end",x:"0.5",y:"12.5",width:"10",height:"10"}),s("path",{class:"l-wait",d:"M11 17.5H409"}),s("path",{class:"l-fill",pathLength:1,d:"M11 17.5H409"}),s("rect",{class:"l-end",x:"409.5",y:"12.5",width:"10",height:"10"}),s("text",{x:"0",y:"40",children:"this browser"}),s("text",{x:"420",y:"40","text-anchor":"end",children:"api.github.com"})]})}var vs=()=>s("svg",{class:"svw-okmark",viewBox:"0 0 28 28","aria-hidden":"true",children:s("path",{pathLength:1,d:"M7.5 14.5 12 19l8.5-9"})});function hs(){let e=S(),[t,i]=v(!1),{text:a,busy:c,err:l,setErr:n,check:p,onInput:b}=U(t),k=d=>d.trim()?p(d):n("Paste the token first.");return s(z,{children:[e?s("div",{class:"svw-signin",children:[s(m,{variant:"filled",icon:"link",onClick:async()=>{e&&location.assign(await A(e,t&&R(),location.hash||"#/"))},children:"Sign in with GitHub"}),s("p",{class:"svw-or",children:"or use a token"})]}):null,s("ol",{class:"svw-steps",children:[s("li",{children:s("div",{children:[s("h3",{children:"Make a token on GitHub"}),s("p",{class:"svw-sub",children:"The page opens with the name, a 90-day expiry and the permissions filled in."}),s("div",{class:"svw-act",children:s(m,{variant:e?"tinted":"filled",href:D(),external:!0,iconEnd:"external",children:"Open GitHub's token page"})}),s("figure",{class:"svw-mock","aria-label":"On GitHub's page: Repository access, Only select repositories, then pick yours",children:[s("p",{class:"svw-mock-title",children:"What GitHub's page looks like"}),s("div",{"aria-hidden":"true",children:[s("div",{class:"svw-mock-k",children:"Repository access"}),s("div",{class:"svw-radio",children:[s("i",{class:"sv-round"}),"All repositories"]}),s("div",{class:"svw-radio is-on",children:[s("i",{class:"sv-round"}),"Only select repositories"]}),s("span",{class:"svw-repo",children:"owner/repo"})]}),s("figcaption",{children:["On GitHub's page, under ",s("b",{children:"Repository access"}),", pick the repos; GitHub can't fill that in. Then ",s("b",{children:"Generate token"})," and copy it."]})]})]})}),s("li",{children:s("div",{children:[s("h3",{children:"Paste it here"}),s("form",{noValidate:!0,onSubmit:d=>{d.preventDefault(),k(a)},children:[s("label",{class:"svw-field",for:"svw-tok",children:"GitHub token"}),s("div",{class:"svw-row",children:[s("input",{id:"svw-tok",class:"svw-input",type:"password",placeholder:"github_pat_\u2026",autoComplete:"off",spellcheck:!1,value:a,"aria-invalid":l?"true":void 0,"aria-describedby":"svw-tok-help svw-tok-status",onInput:d=>b(d.currentTarget.value)}),s(m,{type:"submit",variant:"filled",loading:c,children:"Check token"})]}),s("p",{class:"svw-help",id:"svw-tok-help",children:"Checked as soon as you paste. It goes only to api.github.com and stays in this browser."}),R()?s("label",{class:"svw-check",children:[s("input",{type:"checkbox",checked:t,onChange:d=>i(d.currentTarget.checked)})," Remember on this device"]}):s("p",{class:"svw-help",children:["Kept for this tab only: other sites under ",location.hostname," could read a remembered token. Use a custom domain or ",s("code",{children:"stackvitals ui"})," to remember it."]}),s(ns,{state:c?"busy":"wait"}),s("p",{class:"svw-status"+(l?" is-bad":""),id:"svw-tok-status",role:"status","aria-live":"polite",children:l?s(z,{children:[s("span",{class:"sv-mark sv-mark-bad","aria-hidden":"true"}),l]}):c?"Checking with api.github.com\u2026":""})]})]})})]})]})}function ws({a:e}){let t=f(N),i=t&&t.login===e.login?t:null;return s("ol",{class:"svw-steps is-done",children:[s("li",{children:s("div",{children:[s(ns,{state:"ok"}),s("div",{class:"svw-verdict",children:[s(vs,{}),s("p",{class:"svw-status",role:"status",children:["Connected as ",s("b",{children:e.login||"you"}),".",i?s("span",{class:"svw-sub",children:[" ",i.repos===null?"Classic token: every repo you can reach.":`${i.repos}${i.repos===100?"+":""} repo${i.repos===1?"":"s"} picked.`]}):null]})]}),s("div",{class:"svw-acct",children:s(X,{})}),i?s("div",{class:"svw-abil",children:[s("div",{class:"svw-ready",children:i.missing.length||i.repos===0?s(C,{tone:"watch",children:"Needs more"}):s(C,{tone:"good",children:"Ready"})}),s(j,{info:i})]}):null]})}),s("li",{children:s("div",{children:[s("h3",{children:"Pick a repo"}),s("p",{class:"svw-sub",children:"Set up ones open their dashboard; the others go to one-click setup."}),s("div",{class:"svw-picker",children:s(K,{onPick:ss})})]})})]})}function ms(){let{text:e,edit:t,busy:i,err:a,found:c,go:l}=Z();return s("form",{noValidate:!0,onSubmit:l,children:[s("label",{class:"svw-field",for:"svw-repo",children:"Repository"}),s("div",{class:"svw-row",children:[s("input",{id:"svw-repo",class:"svw-input",type:"text",placeholder:"owner/repo",value:e,autoComplete:"off",spellcheck:!1,"aria-invalid":a?"true":void 0,"aria-describedby":"svw-repo-err",onInput:n=>t(n.currentTarget.value)}),s(m,{type:"submit",variant:"tinted",class:"svw-mint",loading:i,children:"Open"})]}),s("p",{class:"svw-status is-bad",id:"svw-repo-err",role:"status","aria-live":"polite",children:a?s(z,{children:[s("span",{class:"sv-mark sv-mark-bad","aria-hidden":"true"}),a]}):null}),c?.res.kind==="none"?s("div",{class:"svw-note",role:"status",children:[s("span",{class:"sv-mark sv-mark-accent","aria-hidden":"true"}),s("span",{children:[s("b",{children:c.repo})," doesn't run StackVitals yet.",s("span",{class:"svw-note-act",children:s(m,{size:"sm",variant:"filled",onClick:()=>H(c.repo,c.res.private),children:"Set it up"})})]})]}):null,c?.res.kind==="missing"?s("div",{class:"svw-note",role:"status",children:[s("span",{class:"sv-mark sv-mark-watch","aria-hidden":"true"}),s("span",{children:["GitHub doesn't show ",s("b",{children:c.repo})," to visitors: the name is off, or it's private. Connect GitHub above to open private repos."]})]}):null]})}function E({a:e,signing:t,known:i}){let a=ds(),[c,l]=v(!1);return g(()=>{let n=setTimeout(()=>l(!0),4300);return()=>clearTimeout(n)},[]),s("div",{class:"svw"+(a?" is-still":"")+(c?" is-drawn":"")+(e?" is-ok":""),children:s("div",{class:"svw-frame",children:[s("span",{class:"svw-edge e-t"}),s("span",{class:"svw-edge e-r"}),s("span",{class:"svw-edge e-b"}),s("span",{class:"svw-edge e-l"}),s("span",{class:"svw-tick k-t"}),s("span",{class:"svw-tick k-r"}),s("span",{class:"svw-tick k-b"}),s("span",{class:"svw-tick k-l"}),s("main",{id:"main",tabIndex:-1,children:[s("section",{"aria-labelledby":"svw-hero",children:[s("h1",{id:"svw-hero",class:"svw-h1",children:"Know how your repo is really doing."}),s("figure",{class:"svw-flow","aria-label":"How it works: your repo runs a GitHub Actions job, which writes to the stackvitals-data branch, which this app reads"+(e?" (healthy: your GitHub token checked out).":" (it turns healthy once a token checks out).")+" Example states: the Actions run found 1 flaky test and 1 slow check; the data branch has 182 days of history kept.",children:[s("svg",{class:"svw-schem is-wide",viewBox:"0 0 1000 214","aria-hidden":"true",dangerouslySetInnerHTML:{__html:cs}}),s("svg",{class:"svw-schem is-tall",viewBox:"0 0 340 404","aria-hidden":"true",dangerouslySetInnerHTML:{__html:ps}})]}),s("div",{class:"svw-notes-row",children:[s("ol",{class:"svw-notes","aria-label":"What it does",children:[s("li",{style:"--t:3.3s",children:s("span",{children:"Finds flaky tests, slow checks and pull requests stuck waiting, with the evidence."})}),s("li",{style:"--t:3.45s",children:s("span",{children:"Keeps the history in your own repo, so trends and fixes are measured over months."})}),s("li",{style:"--t:3.6s",children:s("span",{children:"Runs in your GitHub Actions. Free, open source, no server, no account."})})]}),s("div",{class:"svw-tb",children:[s("div",{class:"svw-brand",children:[s(W,{size:34}),"StackVitals"]}),s("div",{class:"svw-key",children:[s("p",{children:[s("span",{class:"sv-mark sv-mark-good","aria-hidden":"true"}),s("span",{children:[s("b",{children:"Healthy"}),", kept and passing"]})]}),s("p",{children:[s("span",{class:"sv-mark sv-mark-watch","aria-hidden":"true"}),s("span",{children:[s("b",{children:"Slow"})," or waiting"]})]}),s("p",{children:[s("span",{class:"sv-mark sv-mark-bad","aria-hidden":"true"}),s("span",{children:[s("b",{children:"Failing"})," or flaky"]})]})]})]})]}),t?s("p",{class:"svw-signing",role:"status",children:[s("span",{class:"sv-mark sv-mark-watch","aria-hidden":"true"}),t]}):null]}),s("div",{class:"svw-panels",children:[e?s(x,{id:"svw-connect",title:"Your GitHub",tone:"act",wide:!0,lede:"Connected. Open a dashboard, or set StackVitals up in one click.",children:s(ws,{a:e})}):s(x,{id:"svw-connect",title:"Connect GitHub",tone:"act",wide:!0,lede:"See your repos, open private ones, and set StackVitals up in one click.",children:s(hs,{})}),s(x,{id:"svw-demo",title:"Try the demo",tone:"app",lede:"Three example repos with full data. Nothing to connect.",children:s("div",{class:"svw-act",children:s(m,{variant:"filled",class:"svw-yel",href:location.pathname+"?demo=1",children:"Open the demo"})})}),s(x,{id:"svw-open",title:e?"Or open a public repo":"Open a public repo",tone:"data",lede:"Reads its published data from its Pages site or data branch.",children:s(ms,{})}),i.length?s(x,{id:"svw-recent",title:"Recently opened",tone:"set",wide:!0,children:s("div",{class:"svw-recent",children:i.map(n=>s("button",{type:"button",class:"svw-recent-btn press",onClick:()=>y(n),children:[n.label,s("span",{"aria-hidden":"true",children:"\u2192"})]}))})}):null,s(x,{id:"svw-set",title:"Settings",tone:"set",wide:!0,children:s("div",{class:"svw-settings",children:s(_,{})})})]})]})]})})}export{E as a,Z as b,ss as c,rs as d};
@@ -0,0 +1 @@
1
+ import{w as e}from"./chunk-GT4EAKAO.js";import{d as s}from"./chunk-G7NGB5UX.js";s();function f({title:a,meta:n,tone:t,foot:p,flush:o,children:i,class:r,id:d}){return e("section",{class:"pn"+(t?` pn-${t}`:"")+(r?" "+r:""),id:d,children:[e("header",{class:"pn-strip",children:[e("h3",{class:"pn-title",children:a}),n?e("span",{class:"pn-meta",children:n}):null]}),i?e("div",{class:"pn-body"+(o?" is-flush":""),children:i}):null,p?e("footer",{class:"pn-foot",children:p}):null]})}function m({rows:a,cols:n}){return e("dl",{class:"pn-facts"+(n?` cols-${n}`:""),children:a.filter(t=>!!t).map(([t,p])=>e("div",{class:"pn-fact",children:[e("dt",{children:t}),e("dd",{children:p})]}))})}function h({items:a}){return e("ol",{class:"pn-steps",children:a.map((n,t)=>e("li",{class:n.done?"is-done":"",children:[e("span",{class:"pn-step-n num","aria-hidden":"true",children:t+1}),e("div",{class:"pn-step-text",children:[e("p",{class:"pn-step-h",children:n.title}),e("div",{class:"pn-step-p",children:n.text})]}),n.action?e("div",{class:"pn-step-act",children:n.action}):null]}))})}export{f as a,m as b,h as c};
@@ -0,0 +1 @@
1
+ import{h as l,j as c}from"./chunk-GT4EAKAO.js";import{d as s}from"./chunk-G7NGB5UX.js";s();var z=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,L=/^[A-Za-z0-9_.-]+\.ya?ml$/,S=e=>e==="."||e==="..";function g(e){return typeof e=="string"&&z.test(e)&&!e.split("/").some(S)}function N(e){if(!g(e))throw new Error(`"${String(e).slice(0,80)}" isn't a repo name (owner/name).`);return e}function Z(e){return typeof e=="string"&&L.test(e)&&!S(e)}function F(e){if(!Z(e))throw new Error(`"${String(e).slice(0,80)}" isn't a workflow file name.`);return e}var $=e=>N(e).split("/").map(encodeURIComponent).join("/"),X=e=>encodeURIComponent(F(e));s();var w="stackvitals-data";function E(e){return e.kind==="here"?"here":e.kind==="pages"?`pages:${e.url}`:`branch:${e.owner}/${e.repo}`}function te(e){return e.kind==="here"?"Files beside this page":e.kind==="pages"?`Pages site ${e.url}`:`${e.owner}/${e.repo}, ${w} branch${e.token?" (private)":""}`}function J(e,n){let t=(e+n).split("/"),r=[];for(let o of t)o===".."?r.pop():o!=="."&&o!==""&&r.push(o);return r.join("/")}function K(e,n){if(e.kind==="here")return{url:n,init:{cache:"no-cache"}};if(e.kind==="pages"){let o=new URL(e.url.endsWith("/")?e.url:e.url+"/",location.href);return{url:new URL(n,o).href,init:{cache:"no-cache"}}}let t=J("docs/",n),r=$(`${e.owner}/${e.repo}`);return e.token?{url:`https://api.github.com/repos/${r}/contents/${t.split("/").map(encodeURIComponent).join("/")}?ref=${w}`,init:{cache:"no-cache",headers:{Accept:"application/vnd.github.raw+json",Authorization:`Bearer ${e.token}`,"X-GitHub-Api-Version":"2022-11-28"}}}:{url:`https://raw.githubusercontent.com/${r}/${w}/${t.split("/").map(encodeURIComponent).join("/")}`,init:{cache:"no-cache"}}}async function ne(e,n){try{let{url:t,init:r}=K(e,n),o=await fetch(t,r);return o.ok?await o.text():null}catch{return null}}function re(e,n){let t=e.trim();if(!t)return null;let r=t.match(/^(?:https?:\/\/github\.com\/)?([A-Za-z0-9-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?\/?$/);return r&&!/\.github\.io/i.test(t)?r[2]==="."||r[2]===".."?null:{kind:"branch",owner:r[1],repo:r[2],...n?{token:n}:{}}:/^https?:\/\//.test(t)||t.startsWith("/")||t.startsWith("./")?{kind:"pages",url:t.endsWith("/")?t:t+"/"}:null}s();var A=()=>{var e;return globalThis[e=Symbol.for("sv.signout")]??(globalThis[e]=new Set)},q=e=>{A().add(e)};function I(){A().forEach(e=>{try{e()}catch{}})}s();var h="sv:gh",R=()=>{let e=[];try{e.push(sessionStorage,localStorage)}catch{}return e},D=()=>!/\.github\.io$/i.test(location.hostname||"");function H(){for(let e of R())try{let n=e.getItem(h);if(n){let t=JSON.parse(n);if(t&&typeof t.token=="string")return t}}catch{}return null}var m=l(H());function pe(e){let n=e.remember&&!D()?{...e,remember:!1}:e;for(let t of R())try{t.removeItem(h)}catch{}try{(n.remember?localStorage:sessionStorage).setItem(h,JSON.stringify(n))}catch{}m.set(n)}function le(){for(let e of R())try{let n=Array.from({length:e.length},(t,r)=>e.key(r)||"");for(let t of n)([h,"sv:tokens","sv:token","sv:oauth"].includes(t)||t.startsWith("sv:setup:"))&&e.removeItem(t)}catch{}m.set(null),I()}var U=()=>m.get()?.token,x=new URLSearchParams(location.search),fe=l(x.has("welcome")||x.has("code")&&x.has("state")),O=m.get()?.expires;O&&O-Date.now()<5*6e4&&import("./session-DYYTOE2K.js").then(e=>e.freshAccount()).catch(()=>{});s();var y={id:"here",label:"This site",source:{kind:"here"}},k=[{id:"demo:payments-api",label:"acme/payments-api",source:{kind:"pages",url:"app/demo/payments-api/"},demo:!0},{id:"demo:web-app",label:"acme/web-app",source:{kind:"pages",url:"app/demo/web-app/"},demo:!0},{id:"demo:mobile",label:"acme/mobile",source:{kind:"pages",url:"app/demo/mobile/"},demo:!0}];function P(){try{return JSON.parse(sessionStorage.getItem("sv:tokens")||"{}")}catch{return{}}}function _(e,n){try{let t=P();n?t[e]=n:delete t[e],sessionStorage.setItem("sv:tokens",JSON.stringify(t))}catch{}}function B(e){if(e.source.kind!=="branch")return e;let n=P()[e.id]||(e.private?U():void 0);return n?{...e,source:{...e.source,token:n}}:e}function M(e){if(e.source.kind!=="branch"||!e.source.token)return e;let{token:n,...t}=e.source;return{...e,source:t}}function G(e){return e?e.kind==="branch"?g(`${e.owner}/${e.repo}`):e.kind==="pages"?typeof e.url=="string"&&T(e.url):e.kind==="here":!1}function T(e){try{return["https:","http:"].includes(new URL(e,location.href).protocol)}catch{return!1}}function W(e,n){let t=E(e),r=n||(e.kind==="branch"?`${e.owner}/${e.repo}`:e.kind==="pages"?e.url.replace(/^https?:\/\//,"").replace(/\/$/,""):y.label);return{id:t,label:r,source:e}}var b=new URLSearchParams(location.search),C=b.get("demo")==="1";function V(){if(C){let i=k.find(f=>f.id===`demo:${b.get("repo")}`)||k.find(f=>f.id===c.get("demoCurrent",""))||k[0];return{list:k,current:i}}let e=c.get("repos",[]).filter(i=>i&&G(i.source)&&i.id!=="here").map(B),n=[y,...e],t=n.find(i=>i.id===c.get("current","here"))||y,r=b.get("repo"),o=b.get("pages"),p=r&&g(r)?W({kind:"branch",owner:r.split("/")[0],repo:r.split("/")[1]}):o&&T(o)?W({kind:"pages",url:o.endsWith("/")?o:o+"/"}):null;if(p){let i=n.find(f=>f.id===p.id);i||n.push(p),t=i||p}return{list:n,current:t}}var j=V(),a=l(j.list),u=l(j.current);function v(){if(C){c.set("demoCurrent",u.get().id);return}c.set("repos",a.get().filter(e=>e.id!=="here"&&!e.demo).map(M)),c.set("current",u.get().id)}function we(e){a.get().some(n=>n.id===e.id)||a.set(n=>[...n,e]),e.source.kind==="branch"&&_(e.id,e.source.token),u.set(e),v()}function xe(e){e!=="here"&&(_(e,void 0),a.set(n=>n.filter(t=>t.id!==e)),u.get().id===e&&u.set(a.get()[0]||y),v())}function Re(e,n){let t=a.get(),r=t.findIndex(p=>p.id===e);if(r<0||t[r].label===n)return;let o=t.slice();o[r]={...t[r],label:n},a.set(o),u.get().id===e&&u.set(o[r]),v()}export{g as a,Z as b,$ as c,X as d,E as e,te as f,ne as g,re as h,q as i,D as j,m as k,pe as l,le as m,U as n,fe as o,W as p,C as q,a as r,u as s,we as t,xe as u,Re as v};
@@ -0,0 +1 @@
1
+ import{c as g,e as y,f as h,w as n,x as f}from"./chunk-GT4EAKAO.js";import{d as v}from"./chunk-G7NGB5UX.js";v();function C({options:e,value:t,onChange:l,label:s,size:i,scroll:o}){let u=h(null),[c,r]=g({x:0,w:0,ready:!1});y(()=>{let a=()=>{let p=u.current?.querySelector('[aria-checked="true"]');p&&r(m=>({x:p.offsetLeft,w:p.offsetWidth,ready:m.ready||m.w>0}))};a();let b=typeof ResizeObserver=="function"?new ResizeObserver(a):null;return u.current&&b?.observe(u.current),()=>b?.disconnect()},[t,e.length]);let d=a=>{let b=e.findIndex(x=>x.value===t),p=a.key==="ArrowRight"||a.key==="ArrowDown"?1:a.key==="ArrowLeft"||a.key==="ArrowUp"?-1:0;if(!p)return;a.preventDefault();let m=e[(b+p+e.length)%e.length];l(m.value),requestAnimationFrame(()=>u.current?.querySelector('[aria-checked="true"]')?.focus())};return n("div",{class:"seg"+(i==="sm"?" seg-sm":"")+(o?" seg-scroll":""),role:"radiogroup","aria-label":s,ref:u,onKeyDown:d,children:[n("span",{class:"seg-thumb"+(c.ready?" is-ready":""),"aria-hidden":"true",style:{width:`${c.w}px`,transform:`translateX(${c.x}px)`}}),e.map(a=>n("button",{type:"button",role:"radio","aria-checked":a.value===t,"aria-label":a.aria,tabIndex:a.value===t?0:-1,class:"seg-opt",onClick:()=>l(a.value),children:a.label}))]})}function S({checked:e,onChange:t,label:l,labelledBy:s,disabled:i}){return n("button",{type:"button",role:"switch",class:"switch","aria-checked":e,"aria-label":l,"aria-labelledby":s,disabled:i,onClick:()=>t(!e),children:n("span",{class:"switch-knob","aria-hidden":"true"})})}function D({value:e,onChange:t,min:l=0,max:s=1/0,step:i=1,unit:o,label:u}){let c=a=>Math.min(s,Math.max(l,Math.round(a/i)*i)),[r,d]=g(null);return n("div",{class:"stepper",role:"group","aria-label":u,children:[n("button",{type:"button",class:"press","aria-label":`Less ${u}`,disabled:e<=l,onClick:()=>t(c(e-i)),children:"\u2212"}),n("input",{type:"number",inputMode:"decimal","aria-label":u,value:r??String(e),style:{width:`max(60px, calc(${(r??String(e)).length}ch + 26px))`},min:l,max:Number.isFinite(s)?s:void 0,step:i,onInput:a=>d(a.currentTarget.value),onBlur:()=>{r!==null&&r!==""&&!Number.isNaN(+r)&&t(c(+r)),d(null)},onKeyDown:a=>{a.key==="Enter"&&a.currentTarget.blur()}}),o?n("span",{class:"stepper-unit",children:o}):null,n("button",{type:"button",class:"press","aria-label":`More ${u}`,disabled:e>=s,onClick:()=>t(c(e+i)),children:"+"})]})}var T=0;function L({label:e,hint:t,error:l,children:s}){let i=h(`f-${++T}`).current;return n("div",{class:"field"+(l?" has-error":""),children:[n("label",{class:"field-label",for:i,children:e}),s(i),l?n("p",{class:"field-error",role:"alert",children:[n(f,{name:"warn"}),l]}):t?n("p",{class:"field-hint",children:t}):null]})}function M(e){return n("input",{id:e.id,class:"input"+(e.mono?" mono":""),type:e.type||"text",value:e.value,placeholder:e.placeholder,disabled:e.disabled,maxLength:e.maxLength,autoComplete:"off",spellcheck:!1,"aria-label":e.label,autoFocus:e.autoFocus,onInput:t=>e.onInput(t.currentTarget.value)})}function N(e){return n("input",{id:e.id,class:"input",type:"date",value:e.value,min:e.min,disabled:e.disabled,onInput:t=>e.onInput(t.currentTarget.value)})}function A({id:e,value:t,onInput:l,unit:s,min:i,max:o,step:u}){return n("span",{class:"input-unit",children:[n("input",{id:e,class:"input num",type:"number",inputMode:"decimal",value:String(t),min:i,max:o,step:u,onInput:c=>{let r=c.currentTarget.valueAsNumber;Number.isNaN(r)||l(r)}}),s?n("span",{class:"unit",children:s}):null]})}function E({id:e,value:t,onChange:l,options:s,label:i}){return n("span",{class:"select",children:[n("select",{id:e,class:"input",value:t,"aria-label":i,onChange:o=>l(o.currentTarget.value),children:s.map(o=>n("option",{value:o.value,children:o.label}))}),n(f,{name:"chev"})]})}function $({id:e,values:t,onChange:l,placeholder:s,label:i}){let[o,u]=g(""),c=()=>{let r=o.split(",").map(d=>d.trim()).filter(d=>d&&!t.includes(d));r.length&&l([...t,...r]),u("")};return n("div",{class:"chips",children:[t.map(r=>n("span",{class:"chip",children:[r,n("button",{type:"button",class:"chip-x press","aria-label":`Remove ${r}`,onClick:()=>l(t.filter(d=>d!==r)),children:n(f,{name:"x"})})]})),n("input",{id:e,class:"chip-input",value:o,placeholder:s||"Add","aria-label":`Add to ${i}`,onInput:r=>u(r.currentTarget.value),onBlur:c,onKeyDown:r=>{r.key==="Enter"||r.key===","?(r.preventDefault(),c()):r.key==="Backspace"&&!o&&t.length&&l(t.slice(0,-1))}})]})}export{C as a,S as b,D as c,L as d,M as e,N as f,A as g,E as h,$ as i};
@@ -0,0 +1 @@
1
+ import{c as i}from"./chunk-6BDBXA6V.js";import{e as g}from"./chunk-MAPYGK3P.js";import{i as t,w as n}from"./chunk-GT4EAKAO.js";import{d as r}from"./chunk-G7NGB5UX.js";r();function a({def:m,size:o=30}){let s=t(i),e=m||s;return n("span",{class:"logo-mark",style:{width:`${o}px`,height:`${o}px`},"aria-hidden":"true",dangerouslySetInnerHTML:{__html:g(e)}},e.id)}export{a};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-763NH7PP.js";import{d as s,i as l}from"./chunk-GT4EAKAO.js";import{d as i}from"./chunk-G7NGB5UX.js";i();var e=null;function p(t){e?.();let o=0,r=0,m=()=>{u(),document.getElementById(t)?.scrollIntoView({block:"start",behavior:matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"})},n=()=>{document.getElementById(t)&&(clearTimeout(o),o=setTimeout(m,250),r||(r=setTimeout(m,1e3)))},c=new MutationObserver(n),d=setTimeout(()=>u(),1e4),u=()=>{c.disconnect(),clearTimeout(d),clearTimeout(o),clearTimeout(r),e=null};c.observe(document.body,{childList:!0,subtree:!0}),e=u,n()}function h(){let t=l(a).query.get("at");s(()=>(t&&p(t),()=>e?.()),[t])}export{h as a};
@@ -0,0 +1 @@
1
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk-3IXWEOIJ.js";import"./chunk-T7QVTNXF.js";import"./chunk-RPXHAG6F.js";import"./chunk-VQ5YXO54.js";import"./chunk-76WAVKUG.js";import"./chunk-VWKSMFWJ.js";import"./chunk-GT4EAKAO.js";import"./chunk-G7NGB5UX.js";export{b as Abilities,f as AccountBar,a as Avatar,g as ConnectPanel,e as TokenWarnings,c as lastCheck,d as useTokenCheck};