sliccy 6.164.1 → 6.166.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/dist/node-server/_shared/agent-wire-types.d.ts +7 -1
  2. package/dist/node-server/_shared/agent-wire-types.d.ts.map +1 -1
  3. package/dist/node-server/_shared/computer-protocol.d.ts +108 -0
  4. package/dist/node-server/_shared/computer-protocol.d.ts.map +1 -0
  5. package/dist/node-server/_shared/computer-protocol.js +10 -0
  6. package/dist/node-server/_shared/computer-protocol.js.map +1 -0
  7. package/dist/node-server/_shared/index.d.ts +1 -0
  8. package/dist/node-server/_shared/index.d.ts.map +1 -1
  9. package/dist/node-server/_shared/index.js +1 -0
  10. package/dist/node-server/_shared/index.js.map +1 -1
  11. package/dist/ui/.vite/manifest.json +184 -174
  12. package/dist/ui/assets/{SKILL-C8DJkgFD.js → SKILL-BGEZa-y0.js} +1 -1
  13. package/dist/ui/assets/SKILL-DB5CVwyu.js +1 -0
  14. package/dist/ui/assets/SKILL-DEFDsScb.js +1 -0
  15. package/dist/ui/assets/SKILL-DZoCcID_.js +1 -0
  16. package/dist/ui/assets/{SKILL-BXSAhY0E.js → SKILL-cOU0zXaK.js} +3 -0
  17. package/dist/ui/assets/__vite-browser-external-C-cVeSv_.js +1 -0
  18. package/dist/ui/assets/{account-store-CScbFg3i.js → account-store-BEqmysw9.js} +1 -1
  19. package/dist/ui/assets/{account-store-DEob4Tob.js → account-store-C35GYvum.js} +1 -1
  20. package/dist/ui/assets/{adobe-CgamcTLU.js → adobe-BDH5oLAN.js} +1 -1
  21. package/dist/ui/assets/adobe-BcTGFCnQ.js +1 -0
  22. package/dist/ui/assets/{agent-panels-XcqgFmF4.js → agent-panels-DvqNnkLk.js} +1 -1
  23. package/dist/ui/assets/almost-bash-shell-headless-DqTtE9CM.js +3500 -0
  24. package/dist/ui/assets/{apply-layout-BDanZxtJ.js → apply-layout-CjYRGs37.js} +1 -1
  25. package/dist/ui/assets/{approver-agent-CCkU0PVa.js → approver-agent-CvnFt_s6.js} +1 -1
  26. package/dist/ui/assets/{apps-CU2dHbHf.js → apps-dzoLZ_5W.js} +1 -1
  27. package/dist/ui/assets/{azure-openai-kjz9Dci1.js → azure-openai-BffwoCtp.js} +1 -1
  28. package/dist/ui/assets/{azure-openai-Cl5VKD9d.js → azure-openai-DKGdcr4S.js} +1 -1
  29. package/dist/ui/assets/{backend-hostfs-DU0NS-tW.js → backend-hostfs-CWIlIhve.js} +1 -1
  30. package/dist/ui/assets/bridge-protocol-31SWTdS5.js +1 -0
  31. package/dist/ui/assets/{browser-fOe3v0iv.js → browser-eoO4vY7w.js} +1 -1
  32. package/dist/ui/assets/buffer-polyfill-BccMjOKj.js +1 -0
  33. package/dist/ui/assets/{cdp-Cry6h07Z.js → cdp-DXT6yEL1.js} +1 -1
  34. package/dist/ui/assets/{cerebras-DrMQuNWj.js → cerebras-BF5efkRL.js} +1 -1
  35. package/dist/ui/assets/{cerebras-CWXTOiZB.js → cerebras-By0l7t0i.js} +1 -1
  36. package/dist/ui/assets/{composer-speech-HE7hDylv.js → composer-speech-DIEePbQC.js} +1 -1
  37. package/dist/ui/assets/{connect-surface-DTj_-b2c.js → connect-surface-DBqs7oHf.js} +1 -1
  38. package/dist/ui/assets/{cost-command-DlIH8zCh.js → cost-command-BULzLcvz.js} +1 -1
  39. package/dist/ui/assets/descriptor-S4Jug1iP.js +1 -0
  40. package/dist/ui/assets/directed-approval-D1lGElvD.js +1 -0
  41. package/dist/ui/assets/engine-B-OPe78i.js +1 -0
  42. package/dist/ui/assets/{ensure-speech-assets-Bdq2ASEA.js → ensure-speech-assets-BJXemBO4.js} +1 -1
  43. package/dist/ui/assets/esp8266-l8ELjmQJ.js +1 -0
  44. package/dist/ui/assets/esptool-operations-h8-8jVn_.js +13 -0
  45. package/dist/ui/assets/fake-computer-1f2_4vxY.js +65 -0
  46. package/dist/ui/assets/{frozen-archive-writer-B1ANvJgT.js → frozen-archive-writer-DYPhPMg7.js} +2 -2
  47. package/dist/ui/assets/{fs-Dlit1SL1.js → fs-BapOupIM.js} +2 -2
  48. package/dist/ui/assets/{fs-DZGgOIET.js → fs-CBH-hQcI.js} +1 -1
  49. package/dist/ui/assets/gelatiere-store-C2u47uk0.js +1 -0
  50. package/dist/ui/assets/gelatiere-unit-wvDEO7gH.js +1 -0
  51. package/dist/ui/assets/{github-C5AdaH2F.js → github-Bx7_6LBm.js} +2 -2
  52. package/dist/ui/assets/{github-CGPZBKqk.js → github-Db015Tee.js} +1 -1
  53. package/dist/ui/assets/{github-auth-BEjdODKn.js → github-auth-DtKS6UIX.js} +1 -1
  54. package/dist/ui/assets/{github-copilot-D5K0xdpB.js → github-copilot-CtOjxhqK.js} +1 -1
  55. package/dist/ui/assets/{github-copilot-6b_0-c1B.js → github-copilot-eCfmryv6.js} +1 -1
  56. package/dist/ui/assets/{github-install-DLv9ZHaT.js → github-install-B6W4-xcc.js} +1 -1
  57. package/dist/ui/assets/{github-zip-pP3IhiBQ.js → github-zip-Bv1smNmy.js} +1 -1
  58. package/dist/ui/assets/handoff-link-B3It6xQY.js +1 -0
  59. package/dist/ui/assets/{hear-CybMJQVi.js → hear-BZHckZJM.js} +1 -1
  60. package/dist/ui/assets/{help-C1nN0w8V.js → help-BU2Hjl0P.js} +1 -1
  61. package/dist/ui/assets/host-BQ2qKD-D.js +1 -0
  62. package/dist/ui/assets/{installer-Chacgw8i.js → installer-BbtH3u7z.js} +1 -1
  63. package/dist/ui/assets/js-realm-worker-BT3mfq3w.js +50 -0
  64. package/dist/ui/assets/jsh-CrSWPG4t.js +1 -0
  65. package/dist/ui/assets/jsh-discovery-D3Gk1cKA.js +1 -0
  66. package/dist/ui/assets/jsh-executor-BWlgcE2N.js +18 -0
  67. package/dist/ui/assets/jsh-runtime-extensions-BnLXkzqP.js +1 -0
  68. package/dist/ui/assets/just-bash-compat-B-SPHuh_.js +1 -0
  69. package/dist/ui/assets/kernel-worker-Dseu067f.js +1185 -0
  70. package/dist/ui/assets/{key-GVxFyssW.js → key-6HWbWSGF.js} +1 -1
  71. package/dist/ui/assets/keys-n5_C9sHW.js +1 -0
  72. package/dist/ui/assets/lick-urls-DdKPDlgq.js +1 -0
  73. package/dist/ui/assets/{lick-ws-bridge-BMov8z0m.js → lick-ws-bridge-Cc9sToY7.js} +1 -1
  74. package/dist/ui/assets/lick-ws-bridge-ChigxI36.js +1 -0
  75. package/dist/ui/assets/live-session-snapshot-B70raB09.js +1 -0
  76. package/dist/ui/assets/{local-llm-B7zAVGSm.js → local-llm-Dcp5IIP-.js} +1 -1
  77. package/dist/ui/assets/{local-llm-ByCXv2P-.js → local-llm-DpSg-Oe3.js} +1 -1
  78. package/dist/ui/assets/{main-yKaIA_zV.js → main-CfF8CFBr.js} +3 -3
  79. package/dist/ui/assets/{main-cherry-BNWE5vJO.js → main-cherry-VckJPHm5.js} +1 -1
  80. package/dist/ui/assets/memory-curation-seam-DUaZFZG9.js +1 -0
  81. package/dist/ui/assets/memory-health-D7uEvfAx.js +1 -0
  82. package/dist/ui/assets/memory-v2-flag-BHVbti6Z.js +1 -0
  83. package/dist/ui/assets/memory-write-execute-rXtR1z76.js +1 -0
  84. package/dist/ui/assets/merge-file-core-VJlzucJY.js +11 -0
  85. package/dist/ui/assets/{mount-DvrzOwsL.js → mount-8lU2iH4k.js} +3 -3
  86. package/dist/ui/assets/mount-DoM0CLGG.js +1 -0
  87. package/dist/ui/assets/{new-session-C4AXW_7S.js → new-session-DEhAjxP1.js} +2 -2
  88. package/dist/ui/assets/{oauth-bootstrap-mNVnQZ_Q.js → oauth-bootstrap-DNTgbEZF.js} +2 -2
  89. package/dist/ui/assets/{onboarding-orchestrator-BwCfbdlW.js → onboarding-orchestrator-DzPQ0pVG.js} +1 -1
  90. package/dist/ui/assets/{openai-codex-DRyLvc3I.js → openai-codex-CsAhfz0D.js} +1 -1
  91. package/dist/ui/assets/{openai-codex-Subg_Vg8.js → openai-codex-DYRKYWTe.js} +1 -1
  92. package/dist/ui/assets/{openrouter-D5mJU1oF.js → openrouter-D9T6tXUF.js} +1 -1
  93. package/dist/ui/assets/{openrouter-B52vd-zH.js → openrouter-IyZlRHg4.js} +1 -1
  94. package/dist/ui/assets/{openrouter-free-CYBINFem.js → openrouter-free-CPshAgQD.js} +1 -1
  95. package/dist/ui/assets/{openrouter-free-CKmFPQ3y.js → openrouter-free-DfbYsnmf.js} +1 -1
  96. package/dist/ui/assets/{openrouter-oauth-BUFYoKT3.js → openrouter-oauth-hZg6oH0A.js} +1 -1
  97. package/dist/ui/assets/{openrouter-oauth-BML-cBKi.js → openrouter-oauth-xKlWi_wI.js} +1 -1
  98. package/dist/ui/assets/{opfs-mount-DmOQi3qJ.js → opfs-mount-C9Iamj6N.js} +1 -1
  99. package/dist/ui/assets/panel-rpc-handlers-Nu-wOrG9.js +2 -0
  100. package/dist/ui/assets/{panelize-shell-CJS6Q9hY.js → panelize-shell-tFElgHWF.js} +1 -1
  101. package/dist/ui/assets/pi-edit-execution-D6vx5LyF.js +2 -0
  102. package/dist/ui/assets/provider-3--cEcAF.js +1 -0
  103. package/dist/ui/assets/{provider-G-FXP5U3.js → provider-Z5aj7SzG.js} +2 -2
  104. package/dist/ui/assets/provider-settings-D9sjEfYE.js +1 -0
  105. package/dist/ui/assets/provider-store-access-M0PvJ08M.js +1 -0
  106. package/dist/ui/assets/provider-store-access-RxIHhH6d.js +1 -0
  107. package/dist/ui/assets/{providers-BT71Fchh.js → providers-CnoKdyLc.js} +2 -2
  108. package/dist/ui/assets/{providers-C1P4Z_in.js → providers-DVvrXbtx.js} +1 -1
  109. package/dist/ui/assets/{py-realm-worker-BRyQamcA.js → py-realm-worker-DXmzJqJi.js} +2 -2
  110. package/dist/ui/assets/{pyodide-DwR4k6wB.js → pyodide-b5uAaIjj.js} +2 -2
  111. package/dist/ui/assets/{quick-llm-BOu12xbc.js → quick-llm-DjWE-wQw.js} +1 -1
  112. package/dist/ui/assets/realm-inprocess-D0iWBQzz.js +30 -0
  113. package/dist/ui/assets/record-ChU1ND2B.js +1 -0
  114. package/dist/ui/assets/{recovery-screen-D_LwQpCA.js → recovery-screen-Y1CSyfR-.js} +1 -1
  115. package/dist/ui/assets/registry-Bq_j-EXx.js +1 -0
  116. package/dist/ui/assets/restore-DOkDX8BI.js +1 -0
  117. package/dist/ui/assets/{run-BFLhWKKw.js → run-B-fA26ea.js} +1 -1
  118. package/dist/ui/assets/run-BEt0RS3J.js +52 -0
  119. package/dist/ui/assets/{run-BGSKahNd.js → run-BOc9XLhg.js} +1 -1
  120. package/dist/ui/assets/run-BOkp5G58.js +91 -0
  121. package/dist/ui/assets/{run-CS-v8Znz.js → run-BWJSDhS7.js} +2 -2
  122. package/dist/ui/assets/{run-Dfw_vahy.js → run-Bld9B0W0.js} +1 -1
  123. package/dist/ui/assets/{run-CrPSdmNd.js → run-CISIYZMm.js} +1 -1
  124. package/dist/ui/assets/{run-MvSXwrUs.js → run-D0C4PgZM.js} +4 -4
  125. package/dist/ui/assets/{run-_2GCYBFU.js → run-DgNh1E56.js} +2 -2
  126. package/dist/ui/assets/{run-DWBPrvVI.js → run-DniTiLYn.js} +1 -1
  127. package/dist/ui/assets/run-a67LpkRp.js +42 -0
  128. package/dist/ui/assets/{run-BCXMG6On.js → run-vEDh-Me-.js} +6 -6
  129. package/dist/ui/assets/screencapture-media-B1iFS6Qy.js +1 -0
  130. package/dist/ui/assets/{screencapture-run-CfJW-gGP.js → screencapture-run-XrgS6hEd.js} +2 -2
  131. package/dist/ui/assets/script-catalog-CgT8L-OG.js +2 -0
  132. package/dist/ui/assets/{session-command-memory-0P878oz2.js → session-command-memory-DB2GmPSU.js} +2 -2
  133. package/dist/ui/assets/{session-jsonl-MJMdfn6X.js → session-jsonl-DFC-2T76.js} +1 -1
  134. package/dist/ui/assets/{session-jsonl-f7vG8uaN.js → session-jsonl-D_pTYppB.js} +1 -1
  135. package/dist/ui/assets/{session-search-index-BQmbRVuk.js → session-search-index-CN1zDLlx.js} +2 -2
  136. package/dist/ui/assets/{setup-feature-flags-remote-KCi8ndrR.js → setup-feature-flags-remote-BVd31Z12.js} +1 -1
  137. package/dist/ui/assets/signed-fetch-BY2Mdjqe.js +1 -0
  138. package/dist/ui/assets/{silent-renew-backoff-B06r5ZL-.js → silent-renew-backoff-CKAAh6GN.js} +1 -1
  139. package/dist/ui/assets/{silent-renew-backoff-DIMz5UqB.js → silent-renew-backoff-Dmz3DJHb.js} +1 -1
  140. package/dist/ui/assets/slicc-version-BZyTvfoc.js +1 -0
  141. package/dist/ui/assets/{snapshot-features-vq3FCiv5.js → snapshot-features-DjMJkCGq.js} +1 -1
  142. package/dist/ui/assets/{snapshot-BykuJ4wW.js → snapshot-gi8tDzvN.js} +1 -1
  143. package/dist/ui/assets/{soundscape-DQGEZGwB.js → soundscape-Bl3LhUk9.js} +1 -1
  144. package/dist/ui/assets/{speak-DivfwK0_.js → speak-BY_fDou2.js} +1 -1
  145. package/dist/ui/assets/{sprinkle-manager-rSxSSd0J.js → sprinkle-manager-C-NUJqPy.js} +1 -1
  146. package/dist/ui/assets/{sprinkle-renderer-Ul_GPDpn.js → sprinkle-renderer-CcA6ie5u.js} +1 -1
  147. package/dist/ui/assets/{state-CGafQVGp.js → state-z3wOHLww.js} +1 -1
  148. package/dist/ui/assets/{store-qzvn3yV9.js → store-ByUcAFUa.js} +1 -1
  149. package/dist/ui/assets/{store-BbZGuhdS.js → store-ChWzn_H8.js} +1 -1
  150. package/dist/ui/assets/{sudo-BLaOJiyv.js → sudo-DNZFIZ-H.js} +1 -1
  151. package/dist/ui/assets/sudo-fs-D620mZry.js +3 -0
  152. package/dist/ui/assets/supervisor-BtH2-9sE.js +1 -0
  153. package/dist/ui/assets/{sync-dialog-CfQLao_i.js → sync-dialog-Jqz74VkZ.js} +1 -1
  154. package/dist/ui/assets/sync-sab-wire-CC30v4TL.js +252 -0
  155. package/dist/ui/assets/tab-ToMhjbM4.js +1 -0
  156. package/dist/ui/assets/{transformers-env-7c5cDYNs.js → transformers-env-pq1E2H6B.js} +1 -1
  157. package/dist/ui/assets/{tray-leader-DqDL2jwl.js → tray-leader-Bas0lH9O.js} +1 -1
  158. package/dist/ui/assets/{tray-leave-runtime-Fs59e1NT.js → tray-leave-runtime-B9aV_guA.js} +1 -1
  159. package/dist/ui/assets/tray-runtime-config-BZoJXfW0.js +1 -0
  160. package/dist/ui/assets/{tray-sidecar-DuSizsy1.js → tray-sidecar-DA8NfCV6.js} +1 -1
  161. package/dist/ui/assets/upgrade-detection-B5ym__Gu.js +1 -0
  162. package/dist/ui/assets/{upskill-lick-skip-B0aTroa_.js → upskill-lick-skip-CZGM2OFA.js} +1 -1
  163. package/dist/ui/assets/v86-DseFx8Yp.js +1 -0
  164. package/dist/ui/assets/v86-vm-DCm7zA2r.js +2 -0
  165. package/dist/ui/assets/{voice-reply-BDW4paEk.js → voice-reply-CL5tDo0l.js} +1 -1
  166. package/dist/ui/assets/{wc-attach-C1JExhF6.js → wc-attach-C5yXIQNU.js} +2 -2
  167. package/dist/ui/assets/{wc-detached-YxBsBh4A.js → wc-detached-f_qit-5b.js} +1 -1
  168. package/dist/ui/assets/{wc-extension-CVnsFSuW.js → wc-extension-DRx21-cq.js} +2 -2
  169. package/dist/ui/assets/{wc-follower-CUovZlpa.js → wc-follower-DcKt92kM.js} +3 -3
  170. package/dist/ui/assets/{wc-follower-oauth-Bxhy8p-W.js → wc-follower-oauth-BF3qXDTt.js} +1 -1
  171. package/dist/ui/assets/{wc-gelatiere-CxkjwV-m.js → wc-gelatiere-qAW7lWGW.js} +1 -1
  172. package/dist/ui/assets/{wc-live-br4wUYv7.js → wc-live-DOMCfDT6.js} +6 -6
  173. package/dist/ui/assets/{wc-nav-ChrnrxPa.js → wc-nav-DzPuXq_n.js} +2 -2
  174. package/dist/ui/assets/{wc-onboarding-D2v396gn.js → wc-onboarding-CXM-z-7_.js} +2 -2
  175. package/dist/ui/assets/{wc-placeholder-Bw-g85Ke.js → wc-placeholder-BBqbsuml.js} +3 -3
  176. package/dist/ui/assets/{wc-secret-request-BK3k0VlW.js → wc-secret-request-BSUlxVVi.js} +1 -1
  177. package/dist/ui/assets/{wc-settings-D84UzOS6.js → wc-settings-55mC-jVS.js} +3 -3
  178. package/dist/ui/assets/{wc-shell-CKhQ3qyn.js → wc-shell-C71iKreG.js} +4 -4
  179. package/dist/ui/assets/{wc-shortcut-config-DFPLI7su.js → wc-shortcut-config-Crjq_rF1.js} +1 -1
  180. package/dist/ui/assets/{wc-sprinkles-Cf6JnkDK.js → wc-sprinkles-Caji5y7n.js} +2 -2
  181. package/dist/ui/assets/{wc-transcript-export-BbJ1QcHb.js → wc-transcript-export-Dqe3SH1t.js} +2 -2
  182. package/dist/ui/assets/{wc-tray-BEzyYj77.js → wc-tray-B7ayzT1W.js} +4 -4
  183. package/dist/ui/assets/welcome-detection-CEARSpAq.js +1 -0
  184. package/dist/ui/assets/{whisper-session-Ch3Rub5j.js → whisper-session-DfILe4Yb.js} +2 -2
  185. package/dist/ui/assets/workspace-mode-D0kUKBVS.js +1 -0
  186. package/dist/ui/assets/{xai-grok-D4lk5fCR.js → xai-grok-CVLBrxdD.js} +1 -1
  187. package/dist/ui/assets/{xai-grok-BT_WDAT_.js → xai-grok-Dp8n52fO.js} +1 -1
  188. package/dist/ui/index.html +3 -3
  189. package/dist/ui/packages/webapp/index.html +3 -3
  190. package/package.json +1 -1
  191. package/dist/ui/assets/SKILL-CtxHowg1.js +0 -96
  192. package/dist/ui/assets/__vite-browser-external-CCBdZzAl.js +0 -1
  193. package/dist/ui/assets/adobe-CjAD_QGX.js +0 -1
  194. package/dist/ui/assets/agent-bridge-D_5Sd3oe.js +0 -12
  195. package/dist/ui/assets/agent-message-to-chat-w7n13QEN.js +0 -7
  196. package/dist/ui/assets/attachments-u2K0aIPI.js +0 -6
  197. package/dist/ui/assets/bridge-protocol-DdqxTTSu.js +0 -1
  198. package/dist/ui/assets/budget-usage-source-BW8-RCSb.js +0 -1
  199. package/dist/ui/assets/clipboard-CknViQHB.js +0 -1
  200. package/dist/ui/assets/cone-memory-budget-Cmi9vXV5.js +0 -15
  201. package/dist/ui/assets/db-DSIYsBgP.js +0 -1
  202. package/dist/ui/assets/derive-CZLe75z_.js +0 -1
  203. package/dist/ui/assets/descriptor-D-6Koktu.js +0 -1
  204. package/dist/ui/assets/directed-approval-D9smLm9q.js +0 -1
  205. package/dist/ui/assets/engine-BnH9pfmR.js +0 -1
  206. package/dist/ui/assets/esp8266-BN3fFVWu.js +0 -1
  207. package/dist/ui/assets/esptool-operations-lUvXx3gs.js +0 -13
  208. package/dist/ui/assets/feature-flags-Dl-xb1DG.js +0 -1
  209. package/dist/ui/assets/frozen-archive-format-B4efpvB9.js +0 -1
  210. package/dist/ui/assets/gelatiere-constants-BYJlhm8R.js +0 -1
  211. package/dist/ui/assets/gelatiere-store-CE_Ssheh.js +0 -1
  212. package/dist/ui/assets/gelatiere-unit-BMHtZLOW.js +0 -1
  213. package/dist/ui/assets/js-realm-worker-AwpbqZPU.js +0 -50
  214. package/dist/ui/assets/jsh-runtime-extensions-Bcb8_nba.js +0 -1
  215. package/dist/ui/assets/just-bash-compat-BwD6SoTi.js +0 -1
  216. package/dist/ui/assets/kernel-worker-BAcS3WAP.js +0 -4673
  217. package/dist/ui/assets/lick-manager-ULemXDKa.js +0 -2
  218. package/dist/ui/assets/lick-urls-BZVq_P3x.js +0 -1
  219. package/dist/ui/assets/lick-ws-bridge-CDToX4F0.js +0 -1
  220. package/dist/ui/assets/live-session-snapshot-Dv20JKP2.js +0 -1
  221. package/dist/ui/assets/manager-Bl9b7X9m.js +0 -1
  222. package/dist/ui/assets/memory-curation-seam-BAJK5Abp.js +0 -1
  223. package/dist/ui/assets/memory-health-MhSOmzAf.js +0 -1
  224. package/dist/ui/assets/memory-v2-flag-D85UWdUr.js +0 -1
  225. package/dist/ui/assets/memory-write-execute-BOjUkUIG.js +0 -1
  226. package/dist/ui/assets/mount-CTTWc8xh.js +0 -1
  227. package/dist/ui/assets/mount-recovery-T6cjQxeX.js +0 -2
  228. package/dist/ui/assets/panel-rpc-handlers-BG91KHPa.js +0 -2
  229. package/dist/ui/assets/pi-edit-execution-NnXkvjSi.js +0 -2
  230. package/dist/ui/assets/provider-CbAKIAon.js +0 -1
  231. package/dist/ui/assets/provider-settings-BuhBOwFs.js +0 -1
  232. package/dist/ui/assets/provider-store-access-CrH5offR.js +0 -1
  233. package/dist/ui/assets/provider-store-access-DgZnuRxY.js +0 -1
  234. package/dist/ui/assets/realm-inprocess-Bmsz-kPh.js +0 -30
  235. package/dist/ui/assets/record-YqlVEfh_.js +0 -1
  236. package/dist/ui/assets/run-33hnsiVQ.js +0 -91
  237. package/dist/ui/assets/screencapture-media-Dc-3ljgR.js +0 -1
  238. package/dist/ui/assets/screencapture-media-shared-BDUdmMOP.js +0 -1
  239. package/dist/ui/assets/script-catalog-Bt94D0RP.js +0 -2
  240. package/dist/ui/assets/skills-DWkSI8sH.js +0 -5
  241. package/dist/ui/assets/slicc-version-DAFTorvi.js +0 -1
  242. package/dist/ui/assets/sync-sab-wire-Cacrunmz.js +0 -252
  243. package/dist/ui/assets/tray-runtime-config-CRZxBChd.js +0 -1
  244. package/dist/ui/assets/upgrade-detection-CyCnJlGg.js +0 -1
  245. package/dist/ui/assets/welcome-detection-DjgSxU4V.js +0 -1
  246. package/dist/ui/assets/write-verification-BOaZdtyk.js +0 -1
@@ -1,30 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./__vite-browser-external-5eBdwsFd.js";import{r as n,t as r}from"./multipart-form-data-DopbgwRR.js";import{n as i}from"./slicc-version-DAFTorvi.js";import{I as a,M as o,Q as s,R as c,T as l,_ as u,c as d,g as f,i as p,j as m,l as h,n as g,r as _,s as v,w as y}from"./sync-sab-wire-Cacrunmz.js";import{t as b}from"./buffer-B5d1xHaH.js";import{F as x,I as S,N as C,P as w}from"./shared-C_68vn79.js";import{t as T}from"./tmpdir-env-ate4iNcK.js";import{t as E}from"./realm-browser-fetch-V3uggGbM.js";function D(e){if(!e||e===`/`)return`/`;e.startsWith(`/`)||(e=`/`+e);let t=e.split(`/`),n=[];for(let e of t)e!==``&&e!==`.`&&(e===`..`?n.pop():n.push(e));return`/`+n.join(`/`)}function O(e){let t=D(e);if(t===`/`)return`/`;let n=t.lastIndexOf(`/`);return n===0?`/`:t.slice(0,n)}function k(e){return Object.assign(Error(`ENOENT: no such file or directory, '${e}'`),{code:`ENOENT`})}function ee(e){return Object.assign(Error(`ENOSYNC: file too large for sync access, '${e}' — use async readFile() instead`),{code:`ENOSYNC`})}function te(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var ne=class{tree=new Map;initialPaths=new Set;initialContent=new Map;initialKind=new Map;mkdtempCounter=0;tombstones=new Set;removedDirs=new Set;touched=!1;constructor(e){this.loadSnapshot(e)}loadSnapshot(e){this.tree=new Map,this.tombstones=new Set,this.removedDirs=new Set,this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map,this.tree.set(`/`,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(`/`),this.initialKind.set(`/`,`directory`);for(let t of e.entries){let e=D(t.path);this.tree.set(e,{content:t.content,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,symlinkTarget:t.symlinkTarget,truncated:t.truncated,size:t.size}),this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}for(let t of e.entries){let e=O(D(t.path));for(;e!==`/`&&!this.tree.has(e);)this.tree.set(e,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(e),this.initialKind.set(e,`directory`),e=O(e)}}wasUsed(){return this.touched}applySnapshot(e){this.loadSnapshot(e)}applySnapshotPreservingMutations(e){let t=this.getMutations();this.loadSnapshot(e);for(let e of t.deleted){if(this.tree.get(e)?.isDirectory){let t=e===`/`?`/`:e+`/`;for(let n of Array.from(this.tree.keys()))n!==e&&n.startsWith(t)&&this.tree.delete(n)}this.tree.delete(e)}for(let e of t.created)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink,symlinkTarget:e.symlinkTarget});for(let e of t.modified)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:!1})}invalidate(){this.loadSnapshot({entries:[]})}resetBaseline(){this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map;for(let[e,t]of this.tree.entries())this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}entryKind(e){return e.isSymbolicLink?`symlink`:e.isDirectory?`directory`:`file`}resolveEntry(e,t=!1){let n=D(e),r=n.split(`/`).filter(Boolean),i=[],a=new Set,o=0;if(r.length===0){let e=this.tree.get(`/`);return e?{path:`/`,entry:e}:void 0}for(;r.length>0;){let e=r.shift(),s=`/${[...i,e].join(`/`)}`,c=this.tree.get(s);if(!c)return;let l=r.length===0;if(c.isSymbolicLink&&!(t&&l)){if(a.has(s)||o++===40)throw Object.assign(Error(`ELOOP: too many symbolic links, '${n}'`),{code:`ELOOP`});a.add(s);let e=c.symlinkTarget??``;r=[...D(e.startsWith(`/`)?e:`${O(s)}/${e}`).split(`/`).filter(Boolean),...r],i=[];continue}if(!l&&!c.isDirectory)return;if(i.push(e),l)return{path:s,entry:c}}}ensureParentDirs(e){let t=O(e);t!==`/`&&(this.tree.has(t)||this.mkdir(t,!0,!0))}isPartial(e){return this.tree.get(D(e))?.partial===!0}commitWrite(e,t){this.writeFile(e,t);let n=D(e);for(this.initialContent.set(n,t);n!==`/`;){let e=this.tree.get(n);e&&(this.initialPaths.add(n),this.initialKind.set(n,this.entryKind(e))),n=O(n)}}readFile(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t)?.entry;if(!n||n.isDirectory)throw k(t);if(n.truncated)throw ee(t);return n.content}writeFile(e,t){this.touched=!0;let n=D(e);this.ensureParentDirs(n),this.tree.set(n,{content:t,isDirectory:!1}),this.tombstones.delete(n),this.removedDirs.delete(n)}exists(e){this.touched=!0;let t=D(e);return this.tree.has(t)}stat(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t);if(!n)throw k(t);return this.toStat(n.entry)}lstat(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t,!0);if(!n)throw k(t);return this.toStat(n.entry)}toStat(e){return{isFile:!e.isDirectory&&!e.isSymbolicLink,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink===!0,size:e.isDirectory?0:e.size??e.content.byteLength}}readdir(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t);if(!n?.entry.isDirectory)throw k(t);let r=n.path===`/`?`/`:n.path+`/`,i=new Set;for(let e of this.tree.keys()){if(e===t||e===`/`||!e.startsWith(r))continue;let n=e.slice(r.length).split(`/`)[0];n&&i.add(n)}return Array.from(i)}mkdir(e,t,n=!1){this.touched=!0;let r=D(e);if(this.tree.has(r)){if(this.tree.get(r).isDirectory)return;throw Object.assign(Error(`EEXIST: file already exists, '${r}'`),{code:`EEXIST`})}let i=O(r);if(i!==`/`&&!this.tree.has(i)){if(!t)throw k(r);this.mkdir(i,!0,n)}this.tree.set(r,{content:new Uint8Array,isDirectory:!0,...n?{partial:!0}:{}}),this.tombstones.delete(r),this.removedDirs.delete(r)}rm(e,t){this.touched=!0;let n=D(e),r=this.tree.get(n);if(!r)throw k(n);if(r.isDirectory&&!r.isSymbolicLink){let e=n===`/`?`/`:n+`/`,r=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));if(r.length>0&&!t)throw Object.assign(Error(`ENOTEMPTY: directory not empty, '${n}'`),{code:`ENOTEMPTY`});for(let e of r)this.tree.delete(e),this.tombstones.add(e);t&&this.removedDirs.add(n)}this.tree.delete(n),this.tombstones.add(n)}copyFile(e,t){this.touched=!0;let n=D(e),r=this.tree.get(n);if(!r||r.isDirectory)throw k(n);if(r.truncated)throw ee(n);let i=D(t);this.ensureParentDirs(i),this.tree.set(i,{content:r.content.slice(),isDirectory:!1}),this.tombstones.delete(i),this.removedDirs.delete(i)}rename(e,t){this.touched=!0;let n=D(e),r=this.tree.get(n);if(!r)throw k(n);let i=D(t);if(r.isDirectory){let e=n===`/`?`/`:n+`/`,t=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n);for(let e of t){let t=this.tree.get(e),r=i+e.slice(n.length);this.tree.set(r,t),this.tree.delete(e)}this.tombstones.add(n),this.removedDirs.add(n),this.tombstones.delete(i),this.removedDirs.delete(i);return}this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n),this.tombstones.add(n),this.tombstones.delete(i),this.removedDirs.delete(i)}unlink(e){this.touched=!0;let t=D(e),n=this.tree.get(t);if(!n)throw k(t);if(n.isDirectory&&!n.isSymbolicLink)throw Object.assign(Error(`EISDIR: illegal operation on a directory, unlink '${t}'`),{code:`EISDIR`});this.tree.delete(t),this.tombstones.add(t)}markRemoved(e,t=!1){this.touched=!0;let n=D(e);this.tombstones.add(n),t&&this.removedDirs.add(n)}isTombstoned(e){let t=D(e);if(this.tombstones.has(t))return!0;for(let e of this.removedDirs)if(t===e||t.startsWith(`${e}/`))return!0;return!1}mkdtemp(e){this.touched=!0;for(let t=0;t<100;t++){let t=`_${String(this.mkdtempCounter).padStart(6,`0`)}`;this.mkdtempCounter++;let n=D(e+t);if(!this.tree.has(n))return this.mkdir(n,!0),n}throw Error(`mkdtemp: failed to create unique directory after 100 attempts`)}getMutations(){let e=[],t=[],n=[];for(let[r,i]of this.tree.entries()){if(r===`/`)continue;if(!this.initialPaths.has(r)){e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}let a=this.initialKind.get(r);if(a!==void 0&&a!==this.entryKind(i)){n.push(r),e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}if(!i.isDirectory&&!i.isSymbolicLink){let e=this.initialContent.get(r);e&&!te(e,i.content)&&t.push({path:r,content:i.content})}}for(let e of this.initialPaths)e!==`/`&&(this.tree.has(e)||n.push(e));return{created:e,modified:t,deleted:n}}};function re(){return globalThis.Buffer}function ie(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}function ae(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t}function oe(e,t){return Object.assign(Error(`EBADF: bad file descriptor, ${e} ${String(t)}`),{code:`EBADF`})}function A(e){return e===`/dev/stdin`||e===`/dev/stdout`||e===`/dev/stderr`}function se(e){if(e===0||e===`/dev/stdin`)return 0;if(e===1||e===`/dev/stdout`)return 1;if(e===2||e===`/dev/stderr`)return 2}function ce(e,t){let n=se(e);if(n===0)return!0;if(n!==void 0||typeof e==`number`)throw oe(t,e);return!1}function le(e,t,n){let r=se(t);if(r===1)return e.writeStdout;if(r===2)return e.writeStderr;if(r!==void 0||typeof t==`number`)throw oe(n,t)}function ue(e){return typeof e==`string`?e:ae(xe(e))}function de(e,t){if(t===`utf8`||t===`utf-8`)return new TextDecoder().decode(e);let n=re();return n?n.from(e):e}function fe(e){return typeof e==`string`?e:e?.encoding}function pe(){return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,isCharacterDevice:()=>!0,size:0}}function me(e,t){if(!t)return;let n={readFile:e.readFile,readFileBinary:e.readFileBinary,writeFile:e.writeFile,writeFileBinary:e.writeFileBinary,appendFile:e.appendFile,access:e.access,exists:e.exists,stat:e.stat};e.readFile=async(e,r)=>{if(!ce(e,`read`))return n.readFile(e,r);let i=fe(r);if(i===null||i===`buffer`){let e=re(),n=t.readStdinBytes();return e?e.from(n):n}return new TextDecoder().decode(t.readStdinBytes())},e.readFileBinary=async e=>ce(e,`read`)?t.readStdinBytes():n.readFileBinary(e),e.writeFile=async(e,r)=>{let i=le(t,e,`write`);return i?(i(ue(r)),!0):n.writeFile(e,r)},e.writeFileBinary=async(e,r)=>{let i=le(t,e,`write`);return i?(i(ae(r)),!0):n.writeFileBinary(e,r)},e.appendFile=async(e,r)=>{let i=le(t,e,`append`);if(!i)return n.appendFile(e,r);i(ue(r))},e.access=async e=>{if(!A(e))return n.access(e)},e.exists=async e=>A(e)||n.exists(e),e.stat=async e=>A(e)?{isFile:!0,isDirectory:!1,size:0}:n.stat(e)}function he(e,t,n){function r(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return e instanceof ArrayBuffer?new Uint8Array(e):new TextEncoder().encode(typeof e==`string`?e:String(e))}async function i(t,n){let r=typeof n==`string`?n:n?.encoding;if(r===null||r===`buffer`){let n=await e.call(`vfs`,`readFileBinary`,[t]),r=re();return r?r.from(n instanceof Uint8Array?n:new Uint8Array(n)):n}return e.call(`vfs`,`readFile`,[t])}async function a(t,n){return typeof n==`string`?e.call(`vfs`,`writeFile`,[t,n]):e.call(`vfs`,`writeFileBinary`,[t,r(n)])}async function o(t,n){if(typeof n==`string`){await e.call(`vfs`,`appendFile`,[t,n]);return}await e.call(`vfs`,`appendFile`,[t,r(n)])}async function s(t,n,r){let i=await e.call(`vfs`,`stat`,[t]);if(i.isFile){let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]);return}if(!i.isDirectory||!r?.recursive)throw Error(`cp: '${t}' is a directory (use {recursive: true})`);await l(n);let a=await e.call(`vfs`,`readDir`,[t]);for(let e of a)await s(`${t}/${e}`,`${n}/${e}`,r)}async function c(t,n){if(n?.force&&!await e.call(`vfs`,`exists`,[t]))return!0;if((await e.call(`vfs`,`stat`,[t])).isFile)return e.call(`vfs`,`rm`,[t]);if(!n?.recursive)throw Error(`rm: '${t}' is a directory (use {recursive: true})`);let r=await e.call(`vfs`,`readDir`,[t]);for(let e of r)await c(`${t}/${e}`,n);return e.call(`vfs`,`rm`,[t])}async function l(t){await e.call(`vfs`,`mkdir`,[t])}async function u(t){for(let n=0;n<5;n++){let n=`${t}${Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,6)}`;if(!await e.call(`vfs`,`exists`,[n]))return await e.call(`vfs`,`mkdir`,[n]),n}throw Error(`mkdtemp: failed to create unique directory after 5 attempts`)}async function d(t,n){try{await e.call(`vfs`,`rename`,[t,n])}catch{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]),await e.call(`vfs`,`rm`,[t])}}async function f(t){if(!await e.call(`vfs`,`exists`,[t]))throw Object.assign(Error(`ENOENT: no such file or directory, access '${t}'`),{code:`ENOENT`})}let p={readFile:i,readFileBinary:t=>e.call(`vfs`,`readFileBinary`,[t]),writeFile:a,writeFileBinary:(t,n)=>e.call(`vfs`,`writeFileBinary`,[t,n]),appendFile:o,cp:s,rm:c,readDir:t=>e.call(`vfs`,`readDir`,[t]),readdir:t=>e.call(`vfs`,`readDir`,[t]),exists:t=>e.call(`vfs`,`exists`,[t]),stat:t=>e.call(`vfs`,`stat`,[t]),mkdir:(t,n)=>e.call(`vfs`,`mkdir`,[t]),mkdtemp:u,rename:d,access:f,unlink:t=>e.call(`vfs`,`rm`,[t]),rmdir:t=>e.call(`vfs`,`rm`,[t]),copyFile:async(t,n)=>{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r])},fetchToFile:async(n,r)=>{let i=await t(n);if(!i.ok)throw Error(`fetch ${i.status} ${i.statusText}`);let a=new Uint8Array(await i.arrayBuffer());return await e.call(`vfs`,`writeFileBinary`,[r,a]),a.byteLength},promises:null};return me(p,n),p.promises=p,p}function j(e,t,n=``){return Object.assign(Error(`${e}: sync-fs, ${n?`${n} `:``}'${t}'`),{code:e})}function ge(e,t,n,r={},i){let a=r.recursive===!0;try{return r.requireFile?e.unlink(n):e.rm(n,a),i?.(n),!0}catch(e){if(e?.code!==`ENOENT`)throw e}let o=t;if(!o?.rm||e.isTombstoned(n))return!1;try{if(!o.exists(n))return!1}catch{return!1}return o.rm(n),e.markRemoved(n,a),!0}function _e(e){let{syncFs:t,bridge:n,resolve:r,existsResolved:i,lstatResolved:a,statResolved:o,readBytes:s,writeThrough:c,persistDelete:l}=e,u=(e,r)=>ge(t,n,e,r,l);return{rmSync(e,t){let n=r(e);if(!(t?.force&&!i(n))&&!u(n,{recursive:t?.recursive===!0})&&!t?.force)throw j(`ENOENT`,n,`rm`)},rmdirSync(e,t){let n=r(e);if(i(n)&&!a(n).isDirectory)throw j(`ENOTDIR`,n,`rmdir`);if(!u(n,{recursive:t?.recursive===!0}))throw j(`ENOENT`,n,`rmdir`)},unlinkSync(e){let t=r(e);if(!u(t,{requireFile:!0}))throw j(`ENOENT`,t,`unlink`)},renameSync(e,i){let a=r(e),l=r(i);try{t.rename(a,l);return}catch(e){if(e?.code!==`ENOENT`)throw e}if(!n||t.isTombstoned(a))throw j(`ENOENT`,a,`rename`);if(o(a).isDirectory)throw j(`EISDIR`,a,`rename`);if(c(l,s(a)),!u(a,{requireFile:!0}))throw j(`ENOENT`,a,`rename`)}}}function ve(e,t){if(!t)return;let n={readFileSync:e.readFileSync,writeFileSync:e.writeFileSync,appendFileSync:e.appendFileSync,existsSync:e.existsSync,accessSync:e.accessSync,statSync:e.statSync,lstatSync:e.lstatSync};e.readFileSync=(e,r)=>ce(e,`read`)?de(t.readStdinBytes(),fe(r)):n.readFileSync(e,r),e.writeFileSync=(e,r)=>{let i=le(t,e,`write`);i?i(ue(r)):n.writeFileSync(e,r)},e.appendFileSync=(e,r)=>{let i=le(t,e,`append`);i?i(ue(r)):n.appendFileSync(e,r)},e.existsSync=e=>A(e)||n.existsSync(e),e.accessSync=e=>{A(e)||n.accessSync(e)},e.statSync=e=>A(e)?pe():n.statSync(e),e.lstatSync=e=>A(e)?pe():n.lstatSync(e)}function ye(e,t,n,r){let i=t=>e===`/`?`/${t}`:`${e}/${t}`,a=new Set(n);for(let e of t)a.add(e);for(let e of a)r(i(e))&&a.delete(e);return[...a]}function be(e,t,n){let r=t=>e.isTombstoned(t);try{let i=e.readdir(n);if(!t||!e.isPartial(n)||r(n))return i;try{return ye(n,i,t.readdir(n),r)}catch(e){if(e?.code===`ENOENT`)return i;throw e}}catch(e){let i=e?.code;if(!t||r(n)||i!==`ENOENT`)throw e;return ye(n,[],t.readdir(n),r)}}function xe(e){if(typeof e==`string`)return new TextEncoder().encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return new TextEncoder().encode(String(e))}function Se(e,t,n,r,i){t?(t.writeFile(r,i),e.commitWrite(r,i)):(e.writeFile(r,i),n?.write?.(r,i))}function Ce(e,t,n,r,i){function a(e){return D(e.startsWith(`/`)?e:t+(t.endsWith(`/`)?``:`/`)+e)}function o(t){try{return e.readFile(t)}catch(r){let i=r?.code;if(n&&!e.isTombstoned(t)&&(i===`ENOENT`||i===`ENOSYNC`))return n.readFile(t);throw r}}let s=(t,r)=>Se(e,n,i,t,r);function c(t){if(e.exists(t))return!0;if(!n||e.isTombstoned(t))return!1;try{return n.exists(t)}catch{return!1}}function l(t){try{return e.stat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.stat(t)}}function u(t){try{return e.lstat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.lstat(t)}}let d=e=>({isFile:()=>e.isFile,isDirectory:()=>e.isDirectory,isSymbolicLink:()=>e.isSymbolicLink===!0,isCharacterDevice:()=>!1,size:e.size}),f=(e,t)=>e===`/`?`/${t}`:`${e}/${t}`;function p(t,r){if(!l(t).isDirectory){s(r,o(t));return}e.mkdir(r,!0);for(let i of be(e,n,t))p(f(t,i),f(r,i))}let m={..._e({syncFs:e,bridge:n,persistDelete:i?.delete,resolve:a,existsResolved:c,statResolved:l,lstatResolved:u,readBytes:o,writeThrough:s}),readFileSync(e,t){return de(o(a(e)),fe(t))},writeFileSync(e,t){s(a(e),xe(t))},appendFileSync(e,t){let n=a(e),r=new Uint8Array;try{r=o(n)}catch(e){if(e?.code!==`ENOENT`)throw e}let i=xe(t),c=new Uint8Array(r.byteLength+i.byteLength);c.set(r),c.set(i,r.byteLength),s(n,c)},truncateSync(e,t=0){let n=a(e),r=o(n),i=new Uint8Array(t);i.set(r.subarray(0,Math.min(t,r.byteLength))),s(n,i)},existsSync(e){return c(a(e))},accessSync(e){let t=a(e);if(!c(t))throw j(`ENOENT`,t,`access`)},mkdirSync(t,n){e.mkdir(a(t),n?.recursive)},statSync:e=>d(l(a(e))),lstatSync:e=>d(u(a(e))),realpathSync(e){let t=a(e);if(!c(t))throw j(`ENOENT`,t,`realpath`);return t},readdirSync(t){return be(e,n,a(t))},copyFileSync(e,t){s(a(t),o(a(e)))},cpSync(e,t){p(a(e),a(t))},chmodSync(e){let t=a(e);if(!c(t))throw j(`ENOENT`,t,`chmod`)},mkdtempSync(t){return e.mkdtemp(a(t))}};return ve(m,r),m}function we(e){let t=e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}},n=(e,t,n)=>t===void 0?`${e(`Error:`)} ${n}\n`:t===``?`${e(n)}\n`:`${e(`${t}:`)} ${n}\n`,r=(t,n)=>t===void 0?`${e.color.yellow(`Warning:`)} ${n}\n`:t===``?`${e.color.yellow(n)}\n`:`${e.color.yellow(`${t}:`)} ${n}\n`;return{die(r,i){let a=typeof i==`number`?i:i?.exitCode??1,o=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0,s=t(r);throw e.writeStderr(n(e.color.red,o,s)),e.exit(a),Error(`unreachable`)},out(t){if(typeof t==`string`){e.writeStdout(t.endsWith(`
2
- `)?t:`${t}\n`);return}try{e.writeStdout(`${JSON.stringify(t,null,2)}\n`)}catch{e.writeStdout(`${String(t)}\n`)}},warn(n,i){let a=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0;e.writeStderr(r(a,t(n)))},help(t){throw e.writeStdout(t.endsWith(`
3
- `)?t:`${t}\n`),e.exit(0),Error(`unreachable`)}}}const M={reset:`\x1B[0m`,green:`\x1B[32m`,red:`\x1B[31m`,yellow:`\x1B[33m`,gray:`\x1B[90m`,bold:`\x1B[1m`,cyan:`\x1B[36m`,dim:`\x1B[2m`};function Te(e){let t=e.isTTY&&!e.noColor,n=e=>n=>t?`${e}${n}${M.reset}`:String(n);return{enabled:t,green:n(M.green),red:n(M.red),yellow:n(M.yellow),gray:n(M.gray),bold:n(M.bold),cyan:n(M.cyan),dim:n(M.dim)}}const Ee=/\u001b\[[0-9;]*m/g;function De(e){return e.replace(Ee,``)}function Oe(e){return De(e).length}function ke(e,t){let n=String(e??``);return t<=0?``:Oe(n)<=t?n:t<=1?n.slice(0,t):`${De(n).slice(0,t-1)}…`}function Ae(e,t){let n=String(e??``),r=Oe(n);return r===t?n:r>t?ke(n,t):n+` `.repeat(t-r)}function je(e,t){if(!e.length)return``;let n=Math.max(...e.map(e=>e.length)),r=[];for(let i=0;i<n;i++)if(t&&t[i]!==void 0)r[i]=t[i];else{let t=0;for(let n of e){let e=i<n.length?String(n[i]??``):``;t=Math.max(t,Oe(e))}r[i]=t}return e.map(e=>r.map((t,n)=>Ae(n<e.length?String(e[n]??``):``,t)).join(` `).replace(/\s+$/,``)).join(`
4
- `)}function Me(e){return e instanceof Date?e:new Date(e)}function Ne(e){return e<10?`0${e}`:String(e)}function Pe(e,t=`short`){let n=Me(e);if(Number.isNaN(n.getTime()))return String(e);if(t===`iso`)return n.toISOString();if(t===`locale`)return new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}).format(n);if(t===`human`){let e=Date.now()-n.getTime(),t=Math.abs(e);if(t<6e4)return e>=0?`just now`:`in a moment`;let r=(t,n)=>e>=0?`${t} ${n}${t===1?``:`s`} ago`:`in ${t} ${n}${t===1?``:`s`}`;return t<36e5?r(Math.round(t/6e4),`minute`):t<864e5?r(Math.round(t/36e5),`hour`):t<26298e5?r(Math.round(t/864e5),`day`):t<315576e5?r(Math.round(t/26298e5),`month`):r(Math.round(t/315576e5),`year`)}return`${n.getFullYear()}-${Ne(n.getMonth()+1)}-${Ne(n.getDate())}`}const Fe={trunc:ke,col:Ae,table:je,date:Pe};var N=class extends Error{actual;expected;operator;generatedMessage;code;constructor(e={}){let t=!e.message;super(e.message||`${Ie(e.actual)} ${e.operator||`!=`} ${Ie(e.expected)}`),this.name=`AssertionError`,this.actual=e.actual,this.expected=e.expected,this.operator=e.operator||``,this.generatedMessage=t,this.code=`ERR_ASSERTION`}};function Ie(e){if(typeof e==`string`)return JSON.stringify(e);if(e==null)return String(e);if(typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function P(e,t){return e instanceof Error?e:typeof e==`string`?new N({message:e}):t()}function Le(e,t,n,r){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!ze(e[i],t[i],n,r))return!1;return!0}function Re(e,t,n,r){let i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(let a of i)if(!Object.prototype.hasOwnProperty.call(t,a)||!ze(Reflect.get(e,a),Reflect.get(t,a),n,r))return!1;return!0}function ze(e,t,n,r){if((n?Object.is(e,t):e===t)||!n&&e==t)return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null)return!1;let i=e,a=t;return n&&Object.getPrototypeOf(i)!==Object.getPrototypeOf(a)?!1:r.get(i)===a||(r.set(i,a),Array.isArray(e)===Array.isArray(t)?Array.isArray(e)&&Array.isArray(t)?Le(e,t,n,r):Re(i,a,n,r):!1)}function Be(e,t){try{if(e instanceof t)return!0}catch{}try{return!!t(e)}catch{return!1}}function Ve(e,t){for(let[n,r]of Object.entries(t)){let t=Reflect.get(e,n);if(r instanceof RegExp){if(typeof t!=`string`||!r.test(t))return!1}else if(t!==r)return!1}return!0}function He(e,t){if(t===void 0)return!0;if(t instanceof RegExp){let n=e instanceof Error?e.message:String(e);return t.test(n)}return typeof t==`function`?Be(e,t):t&&typeof t==`object`?!e||typeof e!=`object`?!1:Ve(e,t):!1}function Ue(e){let t=(e,t)=>{if(!e)throw P(t,()=>new N({message:`The expression evaluated to a falsy value`,actual:e,expected:!0,operator:`==`}))},n=((e,n)=>t(e,n)),r=(e,t,n)=>{if(!Object.is(e,t))throw P(n,()=>new N({actual:e,expected:t,operator:`strictEqual`}))},i=(t,n,i)=>{if(e){r(t,n,i);return}if(t!=n)throw P(i,()=>new N({actual:t,expected:n,operator:`==`}))},a=(e,t,n)=>{if(Object.is(e,t))throw P(n,()=>new N({actual:e,expected:t,operator:`notStrictEqual`}))},o=(t,n,r)=>{if(e){a(t,n,r);return}if(t==n)throw P(r,()=>new N({actual:t,expected:n,operator:`!=`}))},s=(e,t,n)=>{if(!ze(e,t,!0,new WeakMap))throw P(n,()=>new N({actual:e,expected:t,operator:`deepStrictEqual`}))},c=(t,n,r)=>{if(e){s(t,n,r);return}if(!ze(t,n,!1,new WeakMap))throw P(r,()=>new N({actual:t,expected:n,operator:`deepEqual`}))},l=(e,t,n)=>{if(ze(e,t,!0,new WeakMap))throw P(n,()=>new N({actual:e,expected:t,operator:`notDeepStrictEqual`}))};return n.ok=t,n.equal=i,n.notEqual=o,n.strictEqual=r,n.notStrictEqual=a,n.deepEqual=c,n.deepStrictEqual=s,n.notDeepEqual=(t,n,r)=>{if(e){l(t,n,r);return}if(ze(t,n,!1,new WeakMap))throw P(r,()=>new N({actual:t,expected:n,operator:`notDeepEqual`}))},n.notDeepStrictEqual=l,n.throws=(e,t,n)=>{let r,i=!1;try{e()}catch(e){r=e,i=!0}if(!i)throw P(typeof t==`string`?t:n,()=>new N({message:`Missing expected exception`,operator:`throws`}));if(!(typeof t==`string`||t instanceof Error)&&!He(r,t))throw P(n,()=>new N({message:`Got unwanted exception`,actual:r,operator:`throws`}))},n.doesNotThrow=(e,t)=>{try{e()}catch(e){throw P(t,()=>new N({message:`Got unwanted exception`,actual:e,operator:`doesNotThrow`}))}},n.fail=e=>{throw P(e,()=>new N({message:`Failed`,operator:`fail`}))},n.AssertionError=N,n}const We=Ue(!0);We.strict=We;const Ge=Ue(!1);Ge.strict=We;function Ke(e,t){let n=globalThis.Buffer;if(!n)throw Error(`crypto.createHash: Buffer is unavailable in this environment`);return t?n.from(e,t):n.from(e)}var qe=class{_events=new Map;on(e,t){let n=this._events.get(e);return n?n.push(t):this._events.set(e,[t]),this}addListener(e,t){return this.on(e,t)}off(e,t){let n=this._events.get(e);if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&this._events.delete(e)}return this}removeListener(e,t){return this.off(e,t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}emit(e,...t){let n=this._events.get(e);if(!n||n.length===0)return!1;for(let e of[...n])e(...t);return!0}removeAllListeners(e){return e===void 0?this._events.clear():this._events.delete(e),this}listenerCount(e){return this._events.get(e)?.length??0}listeners(e){return[...this._events.get(e)??[]]}};const Je=Object.assign(qe,{EventEmitter:qe,default:qe});var Ye=class{_events=new Map;closeScheduled=!1;writable=!0;readable=!0;on(e,t){let n=this._events.get(e);return n?n.push(t):this._events.set(e,[t]),this}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}off(e,t){let n=this._events.get(e);if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}return this}emit(e,...t){let n=this._events.get(e);if(!n||n.length===0)return!1;for(let e of[...n])e(...t);return!0}pipe(e){return this.on(`data`,t=>e.write(t)),this.once(`end`,()=>e.end()),e}closeOnDestroy(){return this.closeScheduled?this:(this.closeScheduled=!0,queueMicrotask(()=>this.emit(`close`)),this)}removeListener(e,t){return this.off(e,t)}removeAllListeners(){return this._events.clear(),this}},Xe=class extends Ye{read(){return null}destroy(){return this.closeOnDestroy()}},Ze=class extends Ye{write(e,t,n){return n&&queueMicrotask(n),!0}end(e){return e&&queueMicrotask(e),this}destroy(){return this.closeOnDestroy()}},Qe=class extends Ye{write(e,t,n){return n&&queueMicrotask(n),!0}end(e){return e&&queueMicrotask(e),this}read(){return null}destroy(){return this.closeOnDestroy()}};const $e={Readable:Xe,Writable:Ze,Transform:Qe,PassThrough:class extends Qe{},Stream:Ye},et=Symbol.for(`nodejs.util.inspect.custom`),tt=Symbol.for(`nodejs.util.promisify.custom`);function nt(e){return`'${e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`).replace(/\n/g,`\\n`)}'`}function rt(e){if(e===null)return`null`;let t=typeof e;if(t===`string`)return nt(e);if(t===`number`)return Object.is(e,-0)?`-0`:String(e);if(t===`bigint`)return`${String(e)}n`;if(t===`boolean`||t===`undefined`)return String(e);if(t===`symbol`)return e.toString();if(t===`function`){let t=e.name;return t?`[Function: ${t}]`:`[Function (anonymous)]`}return null}function it(e){return e instanceof RegExp?e.toString():e instanceof Date?Number.isNaN(e.getTime())?`Invalid Date`:e.toISOString():e instanceof Error?e.stack||`${e.name}: ${e.message}`:null}function at(e,t,n){if(Array.isArray(e))return e.length===0?`[]`:`[ ${e.map(e=>ot(e,t+1,n)).join(`, `)} ]`;if(e instanceof Map){let r=[...e].map(([e,r])=>`${ot(e,t+1,n)} => ${ot(r,t+1,n)}`);return`Map(${e.size}) {${r.length?` ${r.join(`, `)} `:``}}`}if(e instanceof Set){let r=[...e].map(e=>ot(e,t+1,n));return`Set(${e.size}) {${r.length?` ${r.join(`, `)} `:``}}`}let r=Object.keys(e),i=e.constructor?e.constructor.name:``,a=i&&i!==`Object`?`${i} `:``;return r.length===0?`${a}{}`:`${a}{ ${r.map(r=>`${/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(r)?r:nt(r)}: ${ot(e[r],t+1,n)}`).join(`, `)} }`}function ot(e,t,n){let r=rt(e);if(r!==null)return r;let i=e,a=it(i);if(a!==null)return a;let o=i[et];if(typeof o==`function`)try{return String(o.call(i,n.maxDepth,n.opts))}catch{}if(n.seen.has(e))return`[Circular *1]`;if(n.maxDepth!==null&&t>n.maxDepth)return Array.isArray(e)?`[Array]`:`[Object]`;n.seen.add(e);try{return at(i,t,n)}finally{n.seen.delete(e)}}function st(e,t={}){let n=t.depth===void 0?2:t.depth;return ot(e,0,{seen:new Set,maxDepth:n,opts:t})}function ct(e,t,n,r){if(e===`%%`)return`%`;if(n.i>=t.length)return e;let i=t[n.i];switch(e){case`%s`:return n.i++,typeof i==`string`?i:typeof i==`bigint`?`${String(i)}n`:i==null||typeof i==`number`||typeof i==`boolean`?String(i):st(i,{depth:r.depth===void 0?2:r.depth});case`%d`:return n.i++,typeof i==`bigint`?`${String(i)}n`:Number.isNaN(Number(i))?`NaN`:String(Number(i));case`%i`:return n.i++,typeof i==`bigint`?`${String(i)}n`:String(Number.parseInt(i,10));case`%f`:return n.i++,String(typeof i==`bigint`?i:Number.parseFloat(i));case`%j`:n.i++;try{return JSON.stringify(i)??`undefined`}catch{return`[Circular]`}case`%o`:return n.i++,st(i,{depth:4});case`%O`:return n.i++,st(i,{depth:null});case`%c`:return n.i++,``;default:return e}}function lt(e,...t){let n=t[0];if(typeof n!=`string`)return t.map(e=>typeof e==`string`?e:st(e)).join(` `);let r={i:1},i=n.replace(/%[sdifjoOc%]/g,n=>ct(n,t,r,e));for(;r.i<t.length;r.i++){let e=t[r.i];i+=` ${typeof e==`string`?e:st(e)}`}return i}function ut(...e){return lt({},...e)}function dt(e,t){if(e==null)throw TypeError(`The constructor to "inherits" must not be null or undefined`);if(t==null)throw TypeError(`The super constructor to "inherits" must not be null or undefined`);if(t.prototype===void 0)throw TypeError(`The super constructor to "inherits" must have a prototype`);e.super_=t,Object.setPrototypeOf(e.prototype,t.prototype)}function ft(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type function`);let t=e[tt];if(t){if(typeof t!=`function`)throw TypeError(`The [util.promisify.custom] property must be of type function`);return t}function n(...t){return new Promise((n,r)=>{e.call(this,...t,(e,...t)=>{if(e){r(e);return}n(t.length>1?t:t[0])})})}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)),n}function pt(e){return function(t,n,r){if(typeof t!=`function`)throw TypeError(`The "fn" argument must be of type function`);let i=!1;function a(...a){return i||(i=!0,e(r?`[${r}] DeprecationWarning: ${n}`:`DeprecationWarning: ${n}`)),new.target?Reflect.construct(t,a,new.target):t.apply(this,a)}return Object.setPrototypeOf(a,Object.getPrototypeOf(t)),t.prototype&&(a.prototype=t.prototype),a}}const mt=st;mt.custom=et;const ht=ft;ht.custom=tt;function gt(e){return{format:ut,formatWithOptions:lt,inspect:mt,inherits:dt,promisify:ht,deprecate:pt(e)}}const _t=gt(()=>{});let vt=1;function yt(e){if(typeof e==`string`)return e;if(ArrayBuffer.isView(e)){let t=e;return new TextDecoder().decode(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}return e==null?``:String(e)}function bt(e,t,n){return Object.assign(TypeError(`The "${e}" argument must be of type ${t}. Received ${n===null?`null`:Array.isArray(n)?`array`:typeof n}`),{code:`ERR_INVALID_ARG_TYPE`})}function xt(e){if(e===void 0)return;if(typeof e!=`object`||!e||Array.isArray(e))throw bt(`options.env`,`object`,e);let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){if(typeof r!=`string`)throw bt(`options.env[${n}]`,`string`,r);t[n]=r}return t}function St(e){if(e!==void 0){if(typeof e!=`string`)throw bt(`options.cwd`,`string`,e);return e}}function Ct(e,t){return t===void 0||t===`utf8`||t===`utf-8`?e:t===`buffer`||t===null?Ke(e):Ke(e).toString(t)}function wt(e,t){if(e.length===0)return Ct(``,t);if(typeof e[0]==`string`)return e.join(``);let n=globalThis.Buffer;return n?n.concat(e):e[0]}function Tt(e,t,n){t.length>0&&e.emit(`data`,Ct(t,n)),e.readable=!1,e.emit(`end`)}function Et(e){let t=e=>{typeof e==`function`&&queueMicrotask(e)};return{writable:!0,write(n,r,i){return e.stdin.write(yt(n)),t(typeof r==`function`?r:i),!0},end(n,r,i){n!==void 0&&typeof n!=`function`&&e.stdin.write(yt(n)),e.stdin.end(),this.writable=!1,t(typeof n==`function`?n:typeof r==`function`?r:i)}}}var Dt=class extends qe{stdout;stderr;stdin;pid;exitCode=null;signalCode=null;killed=!1;spawnfile;spawnargs;handle;constructor(e,t,n,r){super(),this.handle=e,this.pid=vt++,this.spawnfile=n,this.spawnargs=r,this.stdout=new Xe,this.stderr=new Xe,this.stdin=Et(e),e.done.then(e=>this.finish(e,t),e=>this.emit(`error`,e instanceof Error?e:Error(String(e))))}finish(e,t){Tt(this.stdout,e.stdout,t),Tt(this.stderr,e.stderr,t),this.exitCode=e.exitCode;let n=this.killed?null:e.exitCode,r=this.killed?this.signalCode:null;this.emit(`exit`,n,r),this.emit(`close`,n,r)}kill(e=`SIGTERM`){return this.killed=!0,this.signalCode=e,this.handle.kill(e).catch(()=>{}),!0}};function Ot(e){let t=(t,n,r)=>{if(!e)throw Error(`child_process.${t} is not available in this browser realm (no synchronous bridge — the page has no controlling Service Worker). Use the async form instead: await promisify(${t.replace(/Sync$/,``)})(…).`);return e.run(n,r)},n=e=>{let t=St(e.cwd),n=xt(e.env);return{...e.input===void 0?{}:{input:yt(e.input)},...e.timeout===void 0?{}:{timeout:e.timeout},...t===void 0?{}:{cwd:t},...n===void 0?{}:{env:n}}},r=(e,r,i,a)=>{let o=a.encoding===void 0?`buffer`:a.encoding,s=t(e,r,n(a)),c=Ct(s.stdout,o),l=Ct(s.stderr,o);if(s.exitCode===0)return c;throw Object.assign(Error(`Command failed: ${i}\n${s.stderr}`),{status:s.exitCode,signal:null,stdout:c,stderr:l,output:[null,c,l],pid:vt++})},i=(e,t)=>({args:Array.isArray(e)?e:[],options:(Array.isArray(e)?t:e)??{}});return{execSync:(e,t={})=>r(`execSync`,e,e,t),execFileSync:(e,t,n)=>{let{args:a,options:o}=i(t,n),s=[e,...a];return r(`execFileSync`,s,s.join(` `),o)},spawnSync:(e,r,a)=>{let{args:o,options:s}=i(r,a),c=s.encoding===void 0?`buffer`:s.encoding,l=vt++,u=s.shell?`${e}${o.length?` ${o.join(` `)}`:``}`:[e,...o],d;try{d=t(`spawnSync`,u,n(s))}catch(e){if(e instanceof TypeError)throw e;let t=Ct(``,c);return{pid:l,status:null,signal:null,stdout:t,stderr:t,output:[null,t,t],error:e instanceof Error?e:Error(String(e))}}let f=Ct(d.stdout,c),p=Ct(d.stderr,c);return{pid:l,status:d.exitCode,signal:null,stdout:f,stderr:p,output:[null,f,p]}}}}function kt(e,t){let n=(t,n,r,i,a)=>{let o=St(n.cwd),s=xt(n.env),c={...o===void 0?{}:{cwd:o},...s===void 0?{}:{env:s}},l=e.start(t,c),u=new Dt(l,r,i,a);return n.input!==void 0&&u.stdin.write(yt(n.input)),queueMicrotask(()=>l.stdin.end()),u},r=(e,t,n,r)=>{if(typeof r!=`function`)return;let i=[],a=[];e.stdout.on(`data`,e=>i.push(e)),e.stderr.on(`data`,e=>a.push(e)),e.once(`error`,e=>r(e,wt(i,t),wt(a,t))),e.once(`close`,(o,s)=>{let c=wt(i,t),l=wt(a,t);if(o===0){r(null,c,l);return}r(Object.assign(Error(`Command failed: ${n}\n${yt(l)}`),{code:o===null?void 0:o,killed:e.killed,signal:s??null,cmd:n}),c,l)})},i=(e,t,i)=>{let a=typeof t==`function`?t:i,o=t&&typeof t==`object`?t:{},s=o.encoding===void 0?`utf8`:o.encoding,c=n(e,o,s,e,[]);return r(c,s,e,a),c},a=(e,t,i,a)=>{let o=[],s={},c;Array.isArray(t)?(o=t,typeof i==`function`?c=i:(s=i??{},c=typeof a==`function`?a:void 0)):typeof t==`function`?c=t:t&&typeof t==`object`&&(s=t,c=typeof i==`function`?i:void 0);let l=s.encoding===void 0?`utf8`:s.encoding,u=[e,...o],d=n(u,s,l,e,o);return r(d,l,u.join(` `),c),d},o=(e,t,r)=>{let i=[],a={};Array.isArray(t)?(i=t,a=r??{}):t&&typeof t==`object`&&(a=t);let o=a.encoding===void 0?`buffer`:a.encoding,s=a.shell?`${e}${i.length?` ${i.join(` `)}`:``}`:[e,...i];return n(s,a,o,e,i)},s=(e,t)=>new Promise((n,r)=>{i(e,t,(e,t,i)=>{if(e){r(Object.assign(e,{stdout:t,stderr:i}));return}n({stdout:t,stderr:i})})}),c=(e,t,n)=>new Promise((r,i)=>{a(e,Array.isArray(t)?t:[],Array.isArray(t)?n:t,(e,t,n)=>{if(e){i(Object.assign(e,{stdout:t,stderr:n}));return}r({stdout:t,stderr:n})})}),l=e=>()=>{throw Error(`child_process.${e} is not available in the browser realm`)},u=Ot(t),d=(e,t)=>{Object.defineProperty(e,tt,{value:t,enumerable:!1,configurable:!0})};return d(i,s),d(a,c),{exec:i,execFile:a,spawn:o,execSync:u.execSync,spawnSync:u.spawnSync,execFileSync:u.execFileSync,fork:l(`fork`),ChildProcess:Dt}}function At(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var jt={exports:{}};
5
- /**
6
- * [js-md5]{@link https://github.com/emn178/js-md5}
7
- *
8
- * @namespace md5
9
- * @version 0.9.2
10
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
11
- * @copyright Chen, Yi-Cyuan 2014-2026
12
- * @license MIT
13
- */
14
- (function(e){(function(){var t=`input is invalid type`,n=typeof window==`object`,r=n?window:{};r.JS_MD5_NO_WINDOW&&(n=!1),typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope&&(r=self);var i=!r.JS_MD5_NO_COMMON_JS&&e.exports,a=!r.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,o=`0123456789abcdef`.split(``),s=[128,32768,8388608,-2147483648],c=[0,8,16,24],l=[`hex`,`array`,`digest`,`arrayBuffer`];l.push(`buffer`),l.push(`base64`);var u=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),d=[],f;if(a){var p=new ArrayBuffer(68);f=new Uint8Array(p),d=new Uint32Array(p)}var m=Array.isArray;(r.JS_MD5_NO_NODE_JS||!m)&&(m=function(e){return Object.prototype.toString.call(e)===`[object Array]`});var h=ArrayBuffer.isView;a&&(r.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!h)&&(h=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});var g=function(e){var n=typeof e;if(n===`string`)return[e,!0];if(n!==`object`||e===null)throw Error(t);if(a&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!m(e)&&!h(e))throw Error(t);return[e,!1]},_=function(e){return function(t){return new x(!0).update(t)[e]()}},v=function(){var e=_(`hex`);e.create=function(){return new x},e.update=function(t){return e.create().update(t)};for(var t=0;t<l.length;++t){var n=l[t];e[n]=_(n)}return e},y=function(e){return function(t,n){return new S(t,!0).update(n)[e]()}},b=function(){var e=y(`hex`);e.create=function(e){return new S(e)},e.update=function(t,n){return e.create(t).update(n)};for(var t=0;t<l.length;++t){var n=l[t];e[n]=y(n)}return e};function x(e){if(e)d[0]=d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0,this.blocks=d,this.buffer8=f;else if(a){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}x.prototype.update=function(e){if(this.finalized)throw Error(`finalize already called`);var t=g(e);e=t[0];for(var n=t[1],r,i=0,o,s=e.length,l=this.blocks,u=this.buffer8;i<s;){if(this.hashed&&(this.hashed=!1,l[0]=l[16],l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),n){if(a)for(o=this.start;i<s&&o<64;++i)r=e.charCodeAt(i),r<128?u[o++]=r:r<2048?(u[o++]=192|r>>>6,u[o++]=128|r&63):r<55296||r>=57344?(u[o++]=224|r>>>12,u[o++]=128|r>>>6&63,u[o++]=128|r&63):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),u[o++]=240|r>>>18,u[o++]=128|r>>>12&63,u[o++]=128|r>>>6&63,u[o++]=128|r&63);else for(o=this.start;i<s&&o<64;++i)r=e.charCodeAt(i),r<128?l[o>>>2]|=r<<c[o++&3]:r<2048?(l[o>>>2]|=(192|r>>>6)<<c[o++&3],l[o>>>2]|=(128|r&63)<<c[o++&3]):r<55296||r>=57344?(l[o>>>2]|=(224|r>>>12)<<c[o++&3],l[o>>>2]|=(128|r>>>6&63)<<c[o++&3],l[o>>>2]|=(128|r&63)<<c[o++&3]):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),l[o>>>2]|=(240|r>>>18)<<c[o++&3],l[o>>>2]|=(128|r>>>12&63)<<c[o++&3],l[o>>>2]|=(128|r>>>6&63)<<c[o++&3],l[o>>>2]|=(128|r&63)<<c[o++&3])}else if(a)for(o=this.start;i<s&&o<64;++i)u[o++]=e[i];else for(o=this.start;i<s&&o<64;++i)l[o>>>2]|=e[i]<<c[o++&3];this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes%=4294967296),this},x.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=s[t&3],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},x.prototype.hash=function(){var e,t,n,r,i,a,o=this.blocks;this.first?(e=o[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,r=(-1732584194^e&2004318071)+o[1]-117830708,r=(r<<12|r>>>20)+e<<0,n=(-271733879^r&(e^-271733879))+o[2]-1126478375,n=(n<<17|n>>>15)+r<<0,t=(e^n&(r^e))+o[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,r=this.h3,e+=(r^t&(n^r))+o[0]-680876936,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+o[1]-389564586,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+o[2]+606105819,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+o[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(r^t&(n^r))+o[4]-176418897,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+o[5]+1200080426,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+o[6]-1473231341,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+o[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+o[8]+1770035416,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+o[9]-1958414417,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+o[10]-42063,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+o[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+o[12]+1804603682,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+o[13]-40341101,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+o[14]-1502002290,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+o[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^r&(t^n))+o[1]-165796510,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+o[6]-1069501632,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+o[11]+643717713,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+o[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+o[5]-701558691,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+o[10]+38016083,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+o[15]-660478335,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+o[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+o[9]+568446438,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+o[14]-1019803690,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+o[3]-187363961,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+o[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+o[13]-1444681467,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+o[2]-51403784,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+o[7]+1735328473,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+o[12]-1926607734,t=(t<<20|t>>>12)+n<<0,i=t^n,e+=(i^r)+o[5]-378558,e=(e<<4|e>>>28)+t<<0,r+=(i^e)+o[8]-2022574463,r=(r<<11|r>>>21)+e<<0,a=r^e,n+=(a^t)+o[11]+1839030562,n=(n<<16|n>>>16)+r<<0,t+=(a^n)+o[14]-35309556,t=(t<<23|t>>>9)+n<<0,i=t^n,e+=(i^r)+o[1]-1530992060,e=(e<<4|e>>>28)+t<<0,r+=(i^e)+o[4]+1272893353,r=(r<<11|r>>>21)+e<<0,a=r^e,n+=(a^t)+o[7]-155497632,n=(n<<16|n>>>16)+r<<0,t+=(a^n)+o[10]-1094730640,t=(t<<23|t>>>9)+n<<0,i=t^n,e+=(i^r)+o[13]+681279174,e=(e<<4|e>>>28)+t<<0,r+=(i^e)+o[0]-358537222,r=(r<<11|r>>>21)+e<<0,a=r^e,n+=(a^t)+o[3]-722521979,n=(n<<16|n>>>16)+r<<0,t+=(a^n)+o[6]+76029189,t=(t<<23|t>>>9)+n<<0,i=t^n,e+=(i^r)+o[9]-640364487,e=(e<<4|e>>>28)+t<<0,r+=(i^e)+o[12]-421815835,r=(r<<11|r>>>21)+e<<0,a=r^e,n+=(a^t)+o[15]+530742520,n=(n<<16|n>>>16)+r<<0,t+=(a^n)+o[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~r))+o[0]-198630844,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+o[7]+1126891415,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+o[14]-1416354905,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+o[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+o[12]+1700485571,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+o[3]-1894986606,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+o[10]-1051523,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+o[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+o[8]+1873313359,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+o[15]-30611744,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+o[6]-1560198380,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+o[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+o[4]-145523070,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+o[11]-1120210379,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+o[2]+718787259,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+o[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=r+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0)},x.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return o[e>>>4&15]+o[e&15]+o[e>>>12&15]+o[e>>>8&15]+o[e>>>20&15]+o[e>>>16&15]+o[e>>>28&15]+o[e>>>24&15]+o[t>>>4&15]+o[t&15]+o[t>>>12&15]+o[t>>>8&15]+o[t>>>20&15]+o[t>>>16&15]+o[t>>>28&15]+o[t>>>24&15]+o[n>>>4&15]+o[n&15]+o[n>>>12&15]+o[n>>>8&15]+o[n>>>20&15]+o[n>>>16&15]+o[n>>>28&15]+o[n>>>24&15]+o[r>>>4&15]+o[r&15]+o[r>>>12&15]+o[r>>>8&15]+o[r>>>20&15]+o[r>>>16&15]+o[r>>>28&15]+o[r>>>24&15]},x.prototype.toString=x.prototype.hex,x.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return[e&255,e>>>8&255,e>>>16&255,e>>>24&255,t&255,t>>>8&255,t>>>16&255,t>>>24&255,n&255,n>>>8&255,n>>>16&255,n>>>24&255,r&255,r>>>8&255,r>>>16&255,r>>>24&255]},x.prototype.array=x.prototype.digest,x.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},x.prototype.buffer=x.prototype.arrayBuffer,x.prototype.base64=function(){for(var e,t,n,r=``,i=this.array(),a=0;a<15;)e=i[a++],t=i[a++],n=i[a++],r+=u[e>>>2]+u[(e<<4|t>>>4)&63]+u[(t<<2|n>>>6)&63]+u[n&63];return e=i[a],r+=u[e>>>2]+u[e<<4&63]+`==`,r};function S(e,t){var n,r=g(e);if(e=r[0],r[1]){var i=[],a=e.length,o=0,s;for(n=0;n<a;++n)s=e.charCodeAt(n),s<128?i[o++]=s:s<2048?(i[o++]=192|s>>>6,i[o++]=128|s&63):s<55296||s>=57344?(i[o++]=224|s>>>12,i[o++]=128|s>>>6&63,i[o++]=128|s&63):(s=65536+((s&1023)<<10|e.charCodeAt(++n)&1023),i[o++]=240|s>>>18,i[o++]=128|s>>>12&63,i[o++]=128|s>>>6&63,i[o++]=128|s&63);e=i}e.length>64&&(e=new x(!0).update(e).array());var c=[],l=[];for(n=0;n<64;++n){var u=e[n]||0;c[n]=92^u,l[n]=54^u}x.call(this,t),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=t}S.prototype=new x,S.prototype.finalize=function(){if(x.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();x.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),x.prototype.finalize.call(this)}};var C=v();C.md5=C,C.md5.hmac=b(),i?e.exports=C:r.md5=C})()})(jt);var Mt=jt.exports,Nt=At(Mt),Pt=e(((e,n)=>{
15
- /*
16
- * [js-sha1]{@link https://github.com/emn178/js-sha1}
17
- *
18
- * @version 0.7.0
19
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
20
- * @copyright Chen, Yi-Cyuan 2014-2024
21
- * @license MIT
22
- */
23
- (function(){var e=`input is invalid type`,r=typeof window==`object`,i=r?window:{};i.JS_SHA1_NO_WINDOW&&(r=!1);var a=!r&&typeof self==`object`,o=!i.JS_SHA1_NO_NODE_JS&&typeof process==`object`&&process.versions&&process.versions.node;o?i=globalThis:a&&(i=self);var s=!i.JS_SHA1_NO_COMMON_JS&&typeof n==`object`&&n.exports,c=typeof define==`function`&&define.amd,l=!i.JS_SHA1_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,u=`0123456789abcdef`.split(``),d=[-2147483648,8388608,32768,128],f=[24,16,8,0],p=[`hex`,`array`,`digest`,`arrayBuffer`],m=[],h=Array.isArray;(i.JS_SHA1_NO_NODE_JS||!h)&&(h=function(e){return Object.prototype.toString.call(e)===`[object Array]`});var g=ArrayBuffer.isView;l&&(i.JS_SHA1_NO_ARRAY_BUFFER_IS_VIEW||!g)&&(g=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});var _=function(t){var n=typeof t;if(n===`string`)return[t,!0];if(n!==`object`||t===null)throw Error(e);if(l&&t.constructor===ArrayBuffer)return[new Uint8Array(t),!1];if(!h(t)&&!g(t))throw Error(e);return[t,!1]},v=function(e){return function(t){return new w(!0).update(t)[e]()}},y=function(){var e=v(`hex`);o&&(e=x(e)),e.create=function(){return new w},e.update=function(t){return e.create().update(t)};for(var t=0;t<p.length;++t){var n=p[t];e[n]=v(n)}return e},x=function(n){var r=t(),a=b().Buffer,o=a.from&&!i.JS_SHA1_NO_BUFFER_FROM?a.from:function(e){return new a(e)};return function(t){if(typeof t==`string`)return r.createHash(`sha1`).update(t,`utf8`).digest(`hex`);if(t==null)throw Error(e);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),h(t)||g(t)||t.constructor===a?r.createHash(`sha1`).update(o(t)).digest(`hex`):n(t)}},S=function(e){return function(t,n){return new T(t,!0).update(n)[e]()}},C=function(){var e=S(`hex`);e.create=function(e){return new T(e)},e.update=function(t,n){return e.create(t).update(n)};for(var t=0;t<p.length;++t){var n=p[t];e[n]=S(n)}return e};function w(e){e?(m[0]=m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0,this.blocks=m):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}w.prototype.update=function(e){if(this.finalized)throw Error(`finalize already called`);var t=_(e);e=t[0];for(var n=t[1],r,i=0,a,o=e.length||0,s=this.blocks;i<o;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,this.block=s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),n)for(a=this.start;i<o&&a<64;++i)r=e.charCodeAt(i),r<128?s[a>>>2]|=r<<f[a++&3]:r<2048?(s[a>>>2]|=(192|r>>>6)<<f[a++&3],s[a>>>2]|=(128|r&63)<<f[a++&3]):r<55296||r>=57344?(s[a>>>2]|=(224|r>>>12)<<f[a++&3],s[a>>>2]|=(128|r>>>6&63)<<f[a++&3],s[a>>>2]|=(128|r&63)<<f[a++&3]):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),s[a>>>2]|=(240|r>>>18)<<f[a++&3],s[a>>>2]|=(128|r>>>12&63)<<f[a++&3],s[a>>>2]|=(128|r>>>6&63)<<f[a++&3],s[a>>>2]|=(128|r&63)<<f[a++&3]);else for(a=this.start;i<o&&a<64;++i)s[a>>>2]|=e[i]<<f[a++&3];this.lastByteIndex=a,this.bytes+=a-this.start,a>=64?(this.block=s[16],this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes%=4294967296),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=d[t&3],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,a,o,s,c=this.blocks;for(o=16;o<80;++o)s=c[o-3]^c[o-8]^c[o-14]^c[o-16],c[o]=s<<1|s>>>31;for(o=0;o<20;o+=5)a=t&n|~t&r,s=e<<5|e>>>27,i=s+a+i+1518500249+c[o]<<0,t=t<<30|t>>>2,a=e&t|~e&n,s=i<<5|i>>>27,r=s+a+r+1518500249+c[o+1]<<0,e=e<<30|e>>>2,a=i&e|~i&t,s=r<<5|r>>>27,n=s+a+n+1518500249+c[o+2]<<0,i=i<<30|i>>>2,a=r&i|~r&e,s=n<<5|n>>>27,t=s+a+t+1518500249+c[o+3]<<0,r=r<<30|r>>>2,a=n&r|~n&i,s=t<<5|t>>>27,e=s+a+e+1518500249+c[o+4]<<0,n=n<<30|n>>>2;for(;o<40;o+=5)a=t^n^r,s=e<<5|e>>>27,i=s+a+i+1859775393+c[o]<<0,t=t<<30|t>>>2,a=e^t^n,s=i<<5|i>>>27,r=s+a+r+1859775393+c[o+1]<<0,e=e<<30|e>>>2,a=i^e^t,s=r<<5|r>>>27,n=s+a+n+1859775393+c[o+2]<<0,i=i<<30|i>>>2,a=r^i^e,s=n<<5|n>>>27,t=s+a+t+1859775393+c[o+3]<<0,r=r<<30|r>>>2,a=n^r^i,s=t<<5|t>>>27,e=s+a+e+1859775393+c[o+4]<<0,n=n<<30|n>>>2;for(;o<60;o+=5)a=t&n|t&r|n&r,s=e<<5|e>>>27,i=s+a+i-1894007588+c[o]<<0,t=t<<30|t>>>2,a=e&t|e&n|t&n,s=i<<5|i>>>27,r=s+a+r-1894007588+c[o+1]<<0,e=e<<30|e>>>2,a=i&e|i&t|e&t,s=r<<5|r>>>27,n=s+a+n-1894007588+c[o+2]<<0,i=i<<30|i>>>2,a=r&i|r&e|i&e,s=n<<5|n>>>27,t=s+a+t-1894007588+c[o+3]<<0,r=r<<30|r>>>2,a=n&r|n&i|r&i,s=t<<5|t>>>27,e=s+a+e-1894007588+c[o+4]<<0,n=n<<30|n>>>2;for(;o<80;o+=5)a=t^n^r,s=e<<5|e>>>27,i=s+a+i-899497514+c[o]<<0,t=t<<30|t>>>2,a=e^t^n,s=i<<5|i>>>27,r=s+a+r-899497514+c[o+1]<<0,e=e<<30|e>>>2,a=i^e^t,s=r<<5|r>>>27,n=s+a+n-899497514+c[o+2]<<0,i=i<<30|i>>>2,a=r^i^e,s=n<<5|n>>>27,t=s+a+t-899497514+c[o+3]<<0,r=r<<30|r>>>2,a=n^r^i,s=t<<5|t>>>27,e=s+a+e-899497514+c[o+4]<<0,n=n<<30|n>>>2;this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0,this.h4=this.h4+i<<0},w.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4;return u[e>>>28&15]+u[e>>>24&15]+u[e>>>20&15]+u[e>>>16&15]+u[e>>>12&15]+u[e>>>8&15]+u[e>>>4&15]+u[e&15]+u[t>>>28&15]+u[t>>>24&15]+u[t>>>20&15]+u[t>>>16&15]+u[t>>>12&15]+u[t>>>8&15]+u[t>>>4&15]+u[t&15]+u[n>>>28&15]+u[n>>>24&15]+u[n>>>20&15]+u[n>>>16&15]+u[n>>>12&15]+u[n>>>8&15]+u[n>>>4&15]+u[n&15]+u[r>>>28&15]+u[r>>>24&15]+u[r>>>20&15]+u[r>>>16&15]+u[r>>>12&15]+u[r>>>8&15]+u[r>>>4&15]+u[r&15]+u[i>>>28&15]+u[i>>>24&15]+u[i>>>20&15]+u[i>>>16&15]+u[i>>>12&15]+u[i>>>8&15]+u[i>>>4&15]+u[i&15]},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4;return[e>>>24&255,e>>>16&255,e>>>8&255,e&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255]},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};function T(e,t){var n,r=_(e);if(e=r[0],r[1]){var i=[],a=e.length,o=0,s;for(n=0;n<a;++n)s=e.charCodeAt(n),s<128?i[o++]=s:s<2048?(i[o++]=192|s>>>6,i[o++]=128|s&63):s<55296||s>=57344?(i[o++]=224|s>>>12,i[o++]=128|s>>>6&63,i[o++]=128|s&63):(s=65536+((s&1023)<<10|e.charCodeAt(++n)&1023),i[o++]=240|s>>>18,i[o++]=128|s>>>12&63,i[o++]=128|s>>>6&63,i[o++]=128|s&63);e=i}e.length>64&&(e=new w(!0).update(e).array());var c=[],l=[];for(n=0;n<64;++n){var u=e[n]||0;c[n]=92^u,l[n]=54^u}w.call(this,t),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=t}T.prototype=new w,T.prototype.finalize=function(){if(w.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();w.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),w.prototype.finalize.call(this)}};var E=y();E.sha1=E,E.sha1.hmac=C(),s?n.exports=E:(i.sha1=E,c&&define(function(){return E}))})()}))();const Ft=65536,It={md5:Nt,sha1:Pt.sha1,sha256:s};function Lt(e,t){return typeof e==`string`?t===`hex`||t===`base64`||t===`base64url`||t===`latin1`||t===`binary`?new Uint8Array(Ke(e,t===`binary`?`latin1`:t)):e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Rt(e){let t=String(e).toLowerCase().replace(`-`,``),n=It[t];if(!n)throw Error(`Digest method not supported: ${e}`);let r=n.create(),i=!1,a={update(e,t){if(i)throw Error(`Digest already called`);return r.update(Lt(e,t)),a},digest(e){i=!0;let t=Ke(r.array());return e?t.toString(e):t}};return a}function zt(){let e=globalThis.crypto;if(!e||typeof e.getRandomValues!=`function`)throw Error(`crypto: globalThis.crypto is unavailable in this environment`);return e}function Bt(e){return zt().getRandomValues(e)}function Vt(e){for(let t=0;t<e.length;t+=Ft){let n=Math.min(t+Ft,e.length);Bt(e.subarray(t,n))}}function Ht(e){return e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}const F=Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));function Ut(){let e=zt();if(typeof e.randomUUID==`function`)return e.randomUUID();let t=Bt(new Uint8Array(16));return t[6]=t[6]&15|64,t[8]=t[8]&63|128,`${F[t[0]]}${F[t[1]]}${F[t[2]]}${F[t[3]]}-${F[t[4]]}${F[t[5]]}-${F[t[6]]}${F[t[7]]}-${F[t[8]]}${F[t[9]]}-${F[t[10]]}${F[t[11]]}${F[t[12]]}${F[t[13]]}${F[t[14]]}${F[t[15]]}`}const Wt={randomFillSync(e,t=0,n){let r=Ht(e),i=t,a=n===void 0?r.length:i+n;return Vt(r.subarray(i,a)),e},randomBytes(e){let t=globalThis.Buffer,n=t&&typeof t.allocUnsafe==`function`?t.allocUnsafe(e):new Uint8Array(e);return Vt(Ht(n)),n},randomUUID:Ut,getRandomValues(e){return Bt(e)},createHash:Rt,get webcrypto(){return zt()},get subtle(){return zt().subtle}};function Gt(e,t){let n=[];for(let r of e)r!==``&&r!==`.`&&(r===`..`?n.length>0&&n[n.length-1]!==`..`?n.pop():t&&n.push(`..`):n.push(r));return n}function Kt(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47,r=Gt(e.split(`/`),!t).join(`/`);return r.length===0&&!t&&(r=`.`),r.length>0&&n&&(r+=`/`),(t?`/`:``)+r}function qt(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0).join(`/`);return t.length===0?`.`:Kt(t)}function Jt(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=-1,r=!0;for(let t=e.length-1;t>=1;t--)if(e.charCodeAt(t)===47){if(!r){n=t;break}}else r=!1;return n===-1?t?`/`:`.`:t&&n===1?`//`:e.slice(0,n)}function Yt(e,t){let n=0,r=-1,i=!0;for(let t=e.length-1;t>=0;t--)if(e.charCodeAt(t)===47){if(!i){n=t+1;break}}else r===-1&&(i=!1,r=t+1);let a=r===-1?``:e.slice(n,r);return t&&a.endsWith(t)&&a!==t?a.slice(0,a.length-t.length):a}function Xt(e){let t=Yt(e),n=t.lastIndexOf(`.`);return n<=0?``:t.slice(n)}function Zt(){let e=globalThis.process?.cwd?.();return typeof e==`string`&&e.length>0?e:`/`}function Qt(e,t){let n=``,r=!1;for(let i=t.length-1;i>=-1&&!r;i--){let a=i>=0?t[i]:e();typeof a==`string`&&a.length!==0&&(n=n.length>0?`${a}/${n}`:a,r=a.charCodeAt(0)===47)}let i=Gt(n.split(`/`),!r).join(`/`);return r?i.length>0?`/${i}`:`/`:i.length>0?i:`.`}function $t(e,t,n){let r=Qt(e,[t]),i=Qt(e,[n]);if(r===i)return``;let a=r.split(`/`).filter(Boolean),o=i.split(`/`).filter(Boolean),s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s++;return[...a.slice(s).map(()=>`..`),...o.slice(s)].join(`/`)}function en(e){let t=e.charCodeAt(0)===47?`/`:``,n=Yt(e),r=Xt(e),i=r?n.slice(0,n.length-r.length):n,a=Jt(e);return a===`.`&&t===``&&(a=``),{root:t,dir:a,base:n,ext:r,name:i}}function tn(e){let t=e.dir||e.root||``,n=e.base||`${e.name||``}${e.ext||``}`;return t?t===e.root?`${t}${n}`:`${t}/${n}`:n}function nn(e=Zt){return{sep:`/`,delimiter:`:`,basename:Yt,dirname:Jt,extname:Xt,isAbsolute:e=>e.length>0&&e.charCodeAt(0)===47,join:qt,normalize:Kt,resolve:(...t)=>Qt(e,t),relative:(t,n)=>$t(e,t,n),parse:en,format:tn}}const rn=nn();function an(e){let t=typeof e==`string`?e:e.href;if(!t.startsWith(`file://`))throw TypeError(`fileURLToPath: not a file URL`);let n=t.slice(7);return decodeURIComponent(n)}function on(e){let t=e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`);return new URL(`file://${t}`)}const sn={URL:globalThis.URL,URLSearchParams:globalThis.URLSearchParams,fileURLToPath:an,pathToFileURL:on},cn=Object.freeze([...C]);function ln(e){return typeof e==`string`&&S(e)}function un(e){let t=[],n=e;for(;(n===`/`?``:n.slice(n.lastIndexOf(`/`)+1))!==`node_modules`&&t.push(n===`/`||n===``?`/node_modules`:`${n}/node_modules`),n!==`/`&&n!==``;){let e=n.lastIndexOf(`/`);n=e<=0?e===0?`/`:``:n.slice(0,e)}return t}function dn(e){if(e instanceof URL)return sn.fileURLToPath(e);if(typeof e==`string`){if(e.startsWith(`file:`))return sn.fileURLToPath(e);if(e.startsWith(`/`))return e}throw TypeError(`The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ${String(e)}`)}function fn(e,t){let n=t.startsWith(`/`)?rn.normalize(t):rn.resolve(e,t);return/\.(?:js|json|cjs|mjs)$/.test(n)?[n]:[n,`${n}.js`,`${n}.json`,`${n}.cjs`,`${n}/index.js`,`${n}/index.json`]}function pn(e,t,n){for(let r of fn(e,t))if(n(r))return r}function mn(e,t,n){for(let r of un(e)){let e=pn(r,t,n);if(e)return e}}function hn(e){return e.startsWith(`.`)||e.startsWith(`/`)}function gn(e){function t(e){return{exports:{},id:e??``,filename:e??``,loaded:!1}}let n=t;return n.createRequire=t=>_n(e,t),n.builtinModules=cn,n.isBuiltin=ln,n._nodeModulePaths=un,n.Module=n,n}function _n(e,t){let n=dn(t),r=(t=>e.requireFrom(n,t));return r.resolve=(t,r)=>{if(r?.paths&&r.paths.length>0){let n;for(let i of r.paths)try{return e.resolveFrom(vn(i),t)}catch(e){n=e}throw n instanceof Error?n:Error(`Cannot find module '${t}'`)}return e.resolveFrom(n,t)},r}function vn(e){return`${e.endsWith(`/`)&&e!==`/`?e.slice(0,-1):e}/noop.js`}const yn={platform:()=>`linux`,arch:()=>`x64`,EOL:`
24
- `,cpus:()=>[{model:`virtual`,speed:0}],hostname:()=>`slicc`,type:()=>`Linux`,release:()=>`0.0.0`};function bn(e){return{...yn,tmpdir:()=>T(e),homedir:()=>e?.HOME?.trim()?e.HOME:`/home/user`}}const xn=bn(),Sn={isatty:e=>!1,ReadStream:class{},WriteStream:class{}};var Cn=4,wn=0,Tn=1,En=2;function Dn(e){let t=e.length;for(;--t>=0;)e[t]=0}var On=29,kn=256,An=286,jn=30,Mn=19,Nn=573,Pn=15,Fn=16,In=7,Ln=256,Rn=16,zn=17,Bn=18,Vn=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Hn=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Un=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Wn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gn=512,I=Array(576);Dn(I);var Kn=Array(jn*2);Dn(Kn);var qn=Array(Gn);Dn(qn);var Jn=Array(256);Dn(Jn);var Yn=Array(On);Dn(Yn);var Xn=Array(jn);Dn(Xn);var Zn=class{constructor(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}},Qn,$n,er,tr=class{constructor(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}},nr=e=>e<256?qn[e]:qn[256+(e>>>7)],rr=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},L=(e,t,n)=>{e.bi_valid>Fn-n?(e.bi_buf|=t<<e.bi_valid&65535,rr(e,e.bi_buf),e.bi_buf=t>>Fn-e.bi_valid,e.bi_valid+=n-Fn):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},R=(e,t,n)=>{L(e,n[t*2],n[t*2+1])},ir=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},ar=e=>{e.bi_valid===16?(rr(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},or=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=Pn;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<Nn;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},sr=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=Pn;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=ir(r[t]++,t))}},cr=()=>{let e,t,n,r,i,a=Array(16);for(n=0,r=0;r<On-1;r++)for(Yn[r]=n,e=0;e<1<<Vn[r];e++)Jn[n++]=r;for(Jn[n-1]=r,i=0,r=0;r<16;r++)for(Xn[r]=i,e=0;e<1<<Hn[r];e++)qn[i++]=r;for(i>>=7;r<jn;r++)for(Xn[r]=i<<7,e=0;e<1<<Hn[r]-7;e++)qn[256+i++]=r;for(t=0;t<=Pn;t++)a[t]=0;for(e=0;e<=143;)I[e*2+1]=8,e++,a[8]++;for(;e<=255;)I[e*2+1]=9,e++,a[9]++;for(;e<=279;)I[e*2+1]=7,e++,a[7]++;for(;e<=287;)I[e*2+1]=8,e++,a[8]++;for(sr(I,287,a),e=0;e<jn;e++)Kn[e*2+1]=5,Kn[e*2]=ir(e,5);Qn=new Zn(I,Vn,257,An,Pn),$n=new Zn(Kn,Hn,0,jn,Pn),er=new Zn([],Un,0,Mn,In)},lr=e=>{let t;for(t=0;t<An;t++)e.dyn_ltree[t*2]=0;for(t=0;t<jn;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Mn;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Ln*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},ur=e=>{e.bi_valid>8?rr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},dr=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},fr=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&dr(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!dr(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},pr=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],r===0?R(e,i,t):(o=Jn[i],R(e,o+kn+1,t),s=Vn[o],s!==0&&(i-=Yn[o],L(e,i,s)),r--,o=nr(r),R(e,o,n),s=Hn[o],s!==0&&(r-=Xn[o],L(e,r,s)));while(a<e.sym_next);R(e,Ln,t)},mr=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=Nn,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)fr(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],fr(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,fr(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],or(e,t),sr(n,c,e.bl_count)},hr=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},gr=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do R(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(R(e,zn,e.bl_tree),L(e,s-3,3)):(R(e,Bn,e.bl_tree),L(e,s-11,7)):(a!==i&&(R(e,a,e.bl_tree),s--),R(e,Rn,e.bl_tree),L(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},_r=e=>{let t;for(hr(e,e.dyn_ltree,e.l_desc.max_code),hr(e,e.dyn_dtree,e.d_desc.max_code),mr(e,e.bl_desc),t=18;t>=3&&e.bl_tree[Wn[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},vr=(e,t,n,r)=>{let i;for(L(e,t-257,5),L(e,n-1,5),L(e,r-4,4),i=0;i<r;i++)L(e,e.bl_tree[Wn[i]*2+1],3);gr(e,e.dyn_ltree,t-1),gr(e,e.dyn_dtree,n-1)},yr=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return wn;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return Tn;for(n=32;n<kn;n++)if(e.dyn_ltree[n*2]!==0)return Tn;return wn},br=!1,xr=e=>{br||=(cr(),!0),e.l_desc=new tr(e.dyn_ltree,Qn),e.d_desc=new tr(e.dyn_dtree,$n),e.bl_desc=new tr(e.bl_tree,er),e.bi_buf=0,e.bi_valid=0,lr(e)},Sr=(e,t,n,r)=>{L(e,0+ +!!r,3),ur(e),rr(e,n),rr(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Cr=e=>{L(e,2,3),R(e,Ln,I),ar(e)},wr=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===En&&(e.strm.data_type=yr(e)),mr(e,e.l_desc),mr(e,e.d_desc),o=_r(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?Sr(e,t,n,r):e.strategy===Cn||a===i?(L(e,2+ +!!r,3),pr(e,I,Kn)):(L(e,4+ +!!r,3),vr(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),pr(e,e.dyn_ltree,e.dyn_dtree)),lr(e),r&&ur(e)},z=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Jn[n]+kn+1)*2]++,e.dyn_dtree[nr(t)*2]++),e.sym_next===e.sym_end),Tr=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},Er=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t})()),B=(e,t,n,r)=>{let i=Er,a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t[n])&255];return e^-1},V={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`},Dr=9,Or=573,H=3,U=258,W=262,kr=32,Ar=42,jr=57,Mr=69,Nr=73,Pr=91,Fr=103,Ir=113,Lr=666,G=1,Rr=2,zr=3,Br=4,Vr=3,Hr=(e,t)=>(e.msg=V[t],t),Ur=e=>e*2-(e>4?9:0),K=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Wr=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},Gr=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Kr=(e,t)=>{let n;if(e.legacy_hash)n=e.ins_h=Gr(e,e.ins_h,e.window[t+H-1]);else{let r=e.window,i=r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24;n=e.ins_h=Math.imul(i,66521)+66521>>>16&e.hash_mask}let r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},q=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},J=(e,t)=>{wr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,q(e.strm)},Y=(e,t)=>{e.pending_buf[e.pending++]=t},qr=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Jr=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=Tr(e.adler,t,i,n):e.state.wrap===2&&(e.adler=B(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Yr=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-W?e.strstart-(e.w_size-W):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+U,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=U-(f-r),r=f-U,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},Xr=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-W)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Wr(e),r+=t),e.strm.avail_in===0)break;if(n=Jr(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,!e.legacy_hash){if(e.lookahead+e.insert>H)for(i=e.strstart-e.insert;e.insert&&(Kr(e,i),i++,e.insert--,!(e.lookahead+e.insert<=H)););}else if(e.lookahead+e.insert>=H)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Gr(e,e.ins_h,e.window[i+1]);e.insert&&(Kr(e,i),i++,e.insert--,!(e.lookahead+e.insert<H)););}while(e.lookahead<W&&e.strm.avail_in!==0)},Zr=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==4||t===0||r!==i+e.strm.avail_in)))break;o=+(t===4&&r===i+e.strm.avail_in),Sr(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,q(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(Jr(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?Br:t!==0&&t!==4&&e.strm.avail_in===0&&e.strstart===e.block_start?Rr:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Jr(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===4)&&t!==0&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=+(t===4&&e.strm.avail_in===0&&r===i),Sr(e,e.block_start,r,o),e.block_start+=r,q(e.strm)),o?zr:G)},Qr=(e,t)=>{let n,r;for(;;){if(e.lookahead<W){if(Xr(e),e.lookahead<W&&t===0)return G;if(e.lookahead===0)break}if(n=0,e.lookahead>=H&&(n=Kr(e,e.strstart)),n!==0&&e.strstart-n<=e.w_size-W&&(e.match_length=Yr(e,n)),e.match_length>=H){if(r=z(e,e.strstart-e.match_start,e.match_length-H),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=H){e.match_length--;do e.strstart++,n=Kr(e,e.strstart);while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=Gr(e,e.ins_h,e.window[e.strstart+1]))}else r=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(J(e,!1),e.strm.avail_out===0))return G}return e.insert=e.strstart<H-1?e.strstart:H-1,t===4?(J(e,!0),e.strm.avail_out===0?zr:Br):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?G:Rr},$r=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<W){if(Xr(e),e.lookahead<W&&t===0)return G;if(e.lookahead===0)break}if(n=0,e.lookahead>=H&&(n=Kr(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=H-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-W&&(e.match_length=Yr(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===H&&e.strstart-e.match_start>4096)&&(e.match_length=H-1)),e.prev_length>=H&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-H,r=z(e,e.strstart-1-e.prev_match,e.prev_length-H),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(n=Kr(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=H-1,e.strstart++,r&&(J(e,!1),e.strm.avail_out===0))return G}else if(e.match_available){if(r=z(e,0,e.window[e.strstart-1]),r&&J(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return G}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=z(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<H-1?e.strstart:H-1,t===4?(J(e,!0),e.strm.avail_out===0?zr:Br):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?G:Rr},ei=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=U){if(Xr(e),e.lookahead<=U&&t===0)return G;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=H&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+U;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=U-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=H?(n=z(e,1,e.match_length-H),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(J(e,!1),e.strm.avail_out===0))return G}return e.insert=0,t===4?(J(e,!0),e.strm.avail_out===0?zr:Br):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?G:Rr},ti=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Xr(e),e.lookahead===0)){if(t===0)return G;break}if(e.match_length=0,n=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(J(e,!1),e.strm.avail_out===0))return G}return e.insert=0,t===4?(J(e,!0),e.strm.avail_out===0?zr:Br):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?G:Rr},X=class{constructor(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}},ni=[new X(0,0,0,0,Zr),new X(4,4,8,4,Qr),new X(4,5,16,8,Qr),new X(4,6,32,32,Qr),new X(4,4,16,16,$r),new X(8,16,32,32,$r),new X(8,16,128,128,$r),new X(8,32,128,256,$r),new X(32,128,258,1024,$r),new X(32,258,258,4096,$r)],ri=e=>{e.window_size=2*e.w_size,K(e.head),e.max_lazy_match=ni[e.level].max_lazy,e.good_match=ni[e.level].good_length,e.nice_match=ni[e.level].nice_length,e.max_chain_length=ni[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=H-1,e.match_available=0,e.ins_h=0},ii=class{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Or*2),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),K(this.dyn_ltree),K(this.dyn_dtree),K(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),K(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),K(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}},ai=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.status!==Ar&&t.status!==jr&&t.status!==Mr&&t.status!==Nr&&t.status!==Pr&&t.status!==Fr&&t.status!==Ir&&t.status!==Lr)},oi=e=>{if(ai(e))return Hr(e,-2);e.total_in=e.total_out=0,e.data_type=2;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?jr:t.wrap?Ar:Ir,e.adler=t.wrap===2?0:1,t.last_flush=-2,xr(t),0},si=e=>{let t=oi(e);return t===0&&ri(e.state),t},ci=(e,t,n,r,i,a,o)=>{if(!e)return-2;let s=1;if(t===-1&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>Dr||n!==8||r<8||r>15||t<0||t>9||a<0||a>4||r===8&&s!==1)return Hr(e,-2);r===8&&(r=9);let c=new ii;return e.state=c,c.strm=e,c.status=Ar,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.legacy_hash=+!!o,c.hash_bits=i+7,!c.legacy_hash&&c.hash_bits<15&&(c.hash_bits=15),c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+H-1)/H),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=t,c.strategy=a,c.method=n,si(e)},li=(e,t)=>{if(ai(e)||t>5||t<0)return e?Hr(e,-2):-2;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Lr&&t!==4)return Hr(e,e.avail_out===0?-5:-2);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(q(e),e.avail_out===0)return n.last_flush=-1,0}else if(e.avail_in===0&&Ur(t)<=Ur(r)&&t!==4)return Hr(e,-5);if(n.status===Lr&&e.avail_in!==0)return Hr(e,-5);if(n.status===Ar&&n.wrap===0&&(n.status=Ir),n.status===Ar){let t=8+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=2||n.level<2?0:n.level<6?1:n.level===6?2:3,t|=r<<6,n.strstart!==0&&(t|=kr),t+=31-t%31,qr(n,t),n.strstart!==0&&(qr(n,e.adler>>>16),qr(n,e.adler&65535)),e.adler=1,n.status=Ir,q(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===jr){if(e.adler=0,Y(n,31),Y(n,139),Y(n,8),n.gzhead)Y(n,+!!n.gzhead.text+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Y(n,n.gzhead.time&255),Y(n,n.gzhead.time>>8&255),Y(n,n.gzhead.time>>16&255),Y(n,n.gzhead.time>>24&255),Y(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),Y(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Y(n,n.gzhead.extra.length&255),Y(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=B(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Mr;else if(Y(n,0),Y(n,0),Y(n,0),Y(n,0),Y(n,0),Y(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),Y(n,Vr),n.status=Ir,q(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===Mr){if(n.gzhead.extra){let t=n.pending,r=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,q(e),n.pending!==0)return n.last_flush=-1,0;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=Nr}if(n.status===Nr){if(n.gzhead.name){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),q(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.name.length?n.gzhead.name.charCodeAt(n.gzindex++)&255:0,Y(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=Pr}if(n.status===Pr){if(n.gzhead.comment){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),q(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.comment.length?n.gzhead.comment.charCodeAt(n.gzindex++)&255:0,Y(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t))}n.status=Fr}if(n.status===Fr){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(q(e),n.pending!==0))return n.last_flush=-1,0;Y(n,e.adler&255),Y(n,e.adler>>8&255),e.adler=0}if(n.status=Ir,q(e),n.pending!==0)return n.last_flush=-1,0}if(e.avail_in!==0||n.lookahead!==0||t!==0&&n.status!==Lr){let r=n.level===0?Zr(n,t):n.strategy===2?ti(n,t):n.strategy===3?ei(n,t):ni[n.level].func(n,t);if((r===zr||r===Br)&&(n.status=Lr),r===G||r===zr)return e.avail_out===0&&(n.last_flush=-1),0;if(r===Rr&&(t===1?Cr(n):t!==5&&(Sr(n,0,0,!1),t===3&&(K(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),q(e),e.avail_out===0))return n.last_flush=-1,0}return t===4?n.wrap<=0?1:(n.wrap===2?(Y(n,e.adler&255),Y(n,e.adler>>8&255),Y(n,e.adler>>16&255),Y(n,e.adler>>24&255),Y(n,e.total_in&255),Y(n,e.total_in>>8&255),Y(n,e.total_in>>16&255),Y(n,e.total_in>>24&255)):(qr(n,e.adler>>>16),qr(n,e.adler&65535)),q(e),n.wrap>0&&(n.wrap=-n.wrap),+(n.pending===0)):0},ui=e=>{if(ai(e))return-2;let t=e.state.status;return e.state=null,t===Ir?Hr(e,-3):0},di=(e,t)=>{let n=t.length;if(ai(e))return-2;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==Ar||r.lookahead)return-2;if(i===1&&(e.adler=Tr(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(K(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Xr(r);r.lookahead>=H;){let e=r.strstart,t=r.lookahead-(H-1);do Kr(r,e),e++;while(--t);r.strstart=e,r.lookahead=H-1,Xr(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=H-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,0},fi=16209,pi=16191;function mi(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=e.state;n=e.next_in,w=e.input,r=n+(e.avail_in-5),i=e.next_out,T=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=E.dmax,c=E.wsize,l=E.whave,u=E.wnext,d=E.window,f=E.hold,p=E.bits,m=E.lencode,h=E.distcode,g=(1<<E.lenbits)-1,_=(1<<E.distbits)-1;top:do{p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=m[f&g];dolen:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y===0)T[i++]=v&65535;else if(y&16){b=v&65535,y&=15,y&&(p<y&&(f+=w[n++]<<p,p+=8),b+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=h[f&_];dodist:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y&16){if(x=v&65535,y&=15,p<y&&(f+=w[n++]<<p,p+=8,p<y&&(f+=w[n++]<<p,p+=8)),x+=f&(1<<y)-1,x>s){e.msg=`invalid distance too far back`,E.mode=fi;break top}if(f>>>=y,p-=y,y=i-a,x>y){if(y=x-y,y>l&&E.sane){e.msg=`invalid distance too far back`,E.mode=fi;break top}if(S=0,C=d,u===0){if(S+=c-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}else if(u<y){if(S+=c+u-y,y-=u,y<b){b-=y;do T[i++]=d[S++];while(--y);if(S=0,u<b){y=u,b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}}else if(S+=u-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}for(;b>2;)T[i++]=C[S++],T[i++]=C[S++],T[i++]=C[S++],b-=3;b&&(T[i++]=C[S++],b>1&&(T[i++]=C[S++]))}else{S=i-x;do T[i++]=T[S++],T[i++]=T[S++],T[i++]=T[S++],b-=3;while(b>2);b&&(T[i++]=T[S++],b>1&&(T[i++]=T[S++]))}}else if(y&64){e.msg=`invalid distance code`,E.mode=fi;break top}else{v=h[(v&65535)+(f&(1<<y)-1)];continue dodist}break}}else if(!(y&64)){v=m[(v&65535)+(f&(1<<y)-1)];continue dolen}else if(y&32){E.mode=pi;break top}else{e.msg=`invalid literal/length code`,E.mode=fi;break top}break}}while(n<r&&i<o);b=p>>3,n-=b,p-=b<<3,f&=(1<<p)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?5+(r-n):5-(n-r),e.avail_out=i<o?257+(o-i):257-(i-o),E.hold=f,E.bits=p}var hi=15,gi=852,_i=592,vi=0,yi=1,bi=2,xi=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Si=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),Ci=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),wi=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Ti=(e,t,n,r,i,a,o,s)=>{let c=s.bits,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y,b,x,S,C,w=null,T,E=new Uint16Array(16),D=new Uint16Array(16),O=null,k,ee,te;for(l=0;l<=hi;l++)E[l]=0;for(u=0;u<r;u++)E[t[n+u]]++;for(p=c,f=hi;f>=1&&E[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(d=1;d<f&&E[d]===0;d++);for(p<d&&(p=d),g=1,l=1;l<=hi;l++)if(g<<=1,g-=E[l],g<0)return-1;if(g>0&&(e===vi||f!==1))return-1;for(D[1]=0,l=1;l<hi;l++)D[l+1]=D[l]+E[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[D[t[n+u]]++]=u);if(e===vi?(w=O=o,T=20):e===yi?(w=xi,O=Si,T=257):(w=Ci,O=wi,T=0),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===yi&&_>gi||e===bi&&_>_i)return 1;for(;;){k=l-h,o[u]+1<T?(ee=0,te=o[u]):o[u]>=T?(ee=O[o[u]-T],te=w[o[u]-T]):(ee=96,te=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=k<<24|ee<<16|te|0;while(b!==0);for(y=1<<l-1;v&y;)y>>=1;if(y===0?v=0:(v&=y-1,v+=y),u++,--E[l]===0){if(l===f)break;l=t[n+o[u]]}if(l>p&&(v&S)!==x){for(h===0&&(h=p),C+=d,m=l-h,g=1<<m;m+h<f&&(g-=E[m+h],!(g<=0));)m++,g<<=1;if(_+=1<<m,e===yi&&_>gi||e===bi&&_>_i)return 1;x=v&S,i[x]=p<<24|m<<16|C-a|0}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0},Ei=0,Di=1,Oi=2,ki=16180,Ai=16181,ji=16182,Mi=16183,Ni=16184,Pi=16185,Fi=16186,Ii=16187,Li=16188,Ri=16189,zi=16190,Z=16191,Bi=16192,Vi=16193,Hi=16194,Ui=16195,Wi=16196,Gi=16197,Ki=16198,qi=16199,Ji=16200,Yi=16201,Xi=16202,Zi=16203,Qi=16204,$i=16205,ea=16206,ta=16207,na=16208,Q=16209,ra=16210,ia=16211,aa=852,oa=592,sa=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24),ca=class{constructor(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}},la=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.mode<ki||t.mode>ia)},ua=e=>{if(la(e))return-2;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=ki,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(aa),t.distcode=t.distdyn=new Int32Array(oa),t.sane=1,t.back=-1,0},da=e=>{if(la(e))return-2;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ua(e)},fa=(e,t)=>{let n;if(la(e))return-2;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?-2:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,da(e))},pa=(e,t)=>{if(!e)return-2;let n=new ca;e.state=n,n.strm=e,n.window=null,n.mode=ki;let r=fa(e,t);return r!==0&&(e.state=null),r},ma=!0,ha,ga,_a=e=>{if(ma){ha=new Int32Array(512),ga=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ti(Di,e.lens,0,288,ha,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ti(Oi,e.lens,0,32,ga,0,e.work,{bits:5}),ma=!1}e.lencode=ha,e.lenbits=9,e.distcode=ga,e.distbits=5},va=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.window=new Uint8Array(1<<a.wbits)),a.wsize===0&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},ya=(e,t)=>{let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=0,_,v,y,b,x,S,C,w,T=new Uint8Array(4),E,D,O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(la(e)||!e.output||!e.input&&e.avail_in!==0)return-2;n=e.state,n.mode===Z&&(n.mode=Bi),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,d=s,f=c,w=0;inf_leave:for(;;)switch(n.mode){case ki:if(n.wrap===0){n.mode=Bi;break}for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0),l=0,u=0,n.mode=Ai;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=Q;break}if((l&15)!=8){e.msg=`unknown compression method`,n.mode=Q;break}if(l>>>=4,u-=4,C=(l&15)+8,n.wbits===0&&(n.wbits=C),C>15||C>n.wbits){e.msg=`invalid window size`,n.mode=Q;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?Ri:Z,l=0,u=0;break;case Ai:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!=8){e.msg=`unknown compression method`,n.mode=Q;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=Q;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0)),l=0,u=0,n.mode=ji;case ji:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,n.check=B(n.check,T,4,0)),l=0,u=0,n.mode=Mi;case Mi:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0)),l=0,u=0,n.mode=Ni;case Ni:if(n.flags&1024){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=Pi;case Pi:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+p),C)),n.flags&512&&n.wrap&4&&(n.check=B(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break inf_leave;n.length=0,n.mode=Fi;case Fi:if(n.flags&2048){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=B(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=Ii;case Ii:if(n.flags&4096){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.comment+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=B(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.comment=null);n.mode=Li;case Li:if(n.flags&512){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=Q;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Z;break;case Ri:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=sa(l),l=0,u=0,n.mode=zi;case zi:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,2;e.adler=n.check=1,n.mode=Z;case Z:if(t===5||t===6)break inf_leave;case Bi:if(n.last){l>>>=u&7,u-=u&7,n.mode=ea;break}for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,--u,l&3){case 0:n.mode=Vi;break;case 1:if(_a(n),n.mode=qi,t===6){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=Wi;break;case 3:e.msg=`invalid block type`,n.mode=Q}l>>>=2,u-=2;break;case Vi:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if((l&65535)!=(l>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=Q;break}if(n.length=l&65535,l=0,u=0,n.mode=Hi,t===6)break inf_leave;case Hi:n.mode=Ui;case Ui:if(p=n.length,p){if(p>s&&(p=s),p>c&&(p=c),p===0)break inf_leave;i.set(r.subarray(a,a+p),o),s-=p,a+=p,c-=p,o+=p,n.length-=p;break}n.mode=Z;break;case Wi:for(;u<14;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=Q;break}n.have=0,n.mode=Gi;case Gi:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.lens[O[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[O[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},w=Ti(Ei,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=Q;break}n.have=0,n.mode=Ki;case Ki:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(y<16)l>>>=_,u-=_,n.lens[n.have++]=y;else{if(y===16){for(D=_+2;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l>>>=_,u-=_,n.have===0){e.msg=`invalid bit length repeat`,n.mode=Q;break}C=n.lens[n.have-1],p=3+(l&3),l>>>=2,u-=2}else if(y===17){for(D=_+3;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=3+(l&7),l>>>=3,u-=3}else{for(D=_+7;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=11+(l&127),l>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=Q;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===Q)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=Q;break}if(n.lenbits=9,E={bits:n.lenbits},w=Ti(Di,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=Q;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=Ti(Oi,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=Q;break}if(n.mode=qi,t===6)break inf_leave;case qi:n.mode=Ji;case Ji:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,mi(e,f),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===Z&&(n.back=-1);break}for(n.back=0;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(v&&!(v&240)){for(b=_,x=v,S=y;g=n.lencode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,n.length=y,v===0){n.mode=$i;break}if(v&32){n.back=-1,n.mode=Z;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=Q;break}n.extra=v&15,n.mode=Yi;case Yi:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Xi;case Xi:for(;g=n.distcode[l&(1<<n.distbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(!(v&240)){for(b=_,x=v,S=y;g=n.distcode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,v&64){e.msg=`invalid distance code`,n.mode=Q;break}n.offset=y,n.extra=v&15,n.mode=Zi;case Zi:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=Q;break}n.mode=Qi;case Qi:if(c===0)break inf_leave;if(p=f-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=Q;break}p>n.wnext?(p-=n.wnext,m=n.wsize-p):m=n.wnext-p,p>n.length&&(p=n.length),h=n.window}else h=i,m=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=h[m++];while(--p);n.length===0&&(n.mode=Ji);break;case $i:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=Ji;break;case ea:if(n.wrap){for(;u<32;){if(s===0)break inf_leave;s--,l|=r[a++]<<u,u+=8}if(f-=c,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?B(n.check,i,f,o-f):Tr(n.check,i,f,o-f)),f=c,n.wrap&4&&(n.flags?l:sa(l))!==n.check){e.msg=`incorrect data check`,n.mode=Q;break}l=0,u=0}n.mode=ta;case ta:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=Q;break}l=0,u=0}n.mode=na;case na:w=1;break inf_leave;case Q:w=-3;break inf_leave;case ra:return-4;case ia:default:return-2}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<Q&&(n.mode<ea||t!==4))&&va(e,e.output,e.next_out,f-e.avail_out)?(n.mode=ra,-4):(d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?B(n.check,i,f,e.next_out-f):Tr(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Z?128:0)+(n.mode===qi||n.mode===Hi?256:0),(d===0&&f===0||t===4)&&w===0&&(w=-5),w)},ba=e=>{if(la(e))return-2;let t=e.state;return t.window&&=null,e.state=null,0},xa=(e,t)=>{let n=t.length,r,i,a;return la(e)||(r=e.state,r.wrap!==0&&r.mode!==zi)?-2:r.mode===zi&&(i=1,i=Tr(i,t,n,0),i!==r.check)?-3:(a=va(e,t,n,n),a?(r.mode=ra,-4):(r.havedict=1,0))},Sa=class{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},Ca=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},wa=Object.prototype.toString,Ta={level:-1,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,raw:!1,gzip:!1,legacyHash:!1,dictionary:new Uint8Array},Ea=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},Ta,e);let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new Sa,this.strm.avail_out=0;let n=ci(this.strm,t.level,8,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(n!==0)throw Error(V[n]);wa.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(r.length){if(t.gzip)throw Error(`dictionary is not supported with gzip`);if(n=di(this.strm,r),n!==0)throw Error(V[n])}}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;for(a=typeof t==`number`?t:t===!0?4:0,n.input=typeof e==`string`?new TextEncoder().encode(e):wa.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===2||a===3)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=li(n,a),i===-2)break;if(i===1){n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=ui(this.strm);break}if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)return!0}return this.err=i,this.msg=n.msg||V[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=Ca(this.chunks)),this.chunks=[]}};function Da(e,t={}){let n=new Ea(t);if(n.push(e,!0),n.err)throw Error(n.msg);return n.result}function Oa(e,t={}){return Da(e,Object.assign({},t,{raw:!0}))}function ka(e,t={}){return Da(e,Object.assign({},t,{gzip:!0}))}var Aa=Object.prototype.toString,ja={chunkSize:65536,windowBits:15,raw:!1,dictionary:new Uint8Array},Ma=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},ja,e);let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!e.windowBits&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new Sa,this.strm.avail_out=0;let n=pa(this.strm,t.windowBits);if(n!==0)throw Error(V[n]);Aa.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(t.raw&&r.length&&(n=xa(this.strm,r),n!==0))throw Error(V[n])}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a,o;if(this.ended)return this.err===0;for(a=typeof t==`number`?t:t===!0?4:0,n.input=Aa.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=ya(n,a),i===2){let e=this.options.dictionary;e.length&&(i=xa(n,e),i===0?i=ya(n,a):i===-3&&(i=2))}for(;n.avail_in>0&&i===1&&n.state.wrap&2&&n.state.flags!==0&&n.input[n.next_in]!==0;)da(n),i=ya(n,a);if(i===-2||i===-3||i===2||i===-4)break;if(o=n.avail_out,n.next_out&&(n.avail_out===0||i===1||a>0)&&(this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out)),n.avail_out=0,n.next_out=0),i!==0&&i!==-5||o!==0){if(i===1){i=ba(this.strm);break}if(n.avail_in===0){if(a===4){i=ba(this.strm),i===0&&(i=-5);break}return!0}}}return this.err=i,this.msg=n.msg||V[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=Ca(this.chunks)),this.chunks=[]}};function Na(e,t={}){let n=new Ma(t);if(n.push(e,!0),n.err)throw Error(n.msg);let r=n.result;return t.toText?new TextDecoder().decode(r):r}function Pa(e,t={}){return Na(e,{...t,raw:!0})}function Fa(e){return typeof e==`string`?new Uint8Array(Ke(e,`utf8`)):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function Ia(e){let t={};return e&&(typeof e.level==`number`&&(t.level=e.level),typeof e.windowBits==`number`&&(t.windowBits=e.windowBits),typeof e.memLevel==`number`&&(t.memLevel=e.memLevel),typeof e.strategy==`number`&&(t.strategy=e.strategy)),t}function La(e,t,n){return Ke(e(Fa(t),Ia(n)))}function Ra(e,t,n,r){let i=typeof n==`function`?n:r,a=typeof n==`function`?void 0:n;if(typeof i!=`function`)throw TypeError(`zlib: callback is required`);let o;try{o=La(e,t,a)}catch(e){queueMicrotask(()=>i(e instanceof Error?e:Error(String(e))));return}queueMicrotask(()=>i(null,o))}const za={gzipSync:(e,t)=>La(ka,e,t),gunzipSync:(e,t)=>La(Na,e,t),deflateSync:(e,t)=>La(Da,e,t),inflateSync:(e,t)=>La(Na,e,t),deflateRawSync:(e,t)=>La(Oa,e,t),inflateRawSync:(e,t)=>La(Pa,e,t),gzip:(e,t,n)=>Ra(ka,e,t,n),gunzip:(e,t,n)=>Ra(Na,e,t,n),deflate:(e,t,n)=>Ra(Da,e,t,n),inflate:(e,t,n)=>Ra(Na,e,t,n),deflateRaw:(e,t,n)=>Ra(Oa,e,t,n),inflateRaw:(e,t,n)=>Ra(Pa,e,t,n),constants:{Z_NO_FLUSH:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1}};function Ba(e){let t=[],n={},r=[],i=(e,t)=>{if(e in n){let r=n[e];Array.isArray(r)?r.push(String(t)):n[e]=[String(r),String(t)]}else n[e]=t},a=2;for(;a<e.length;){let n=e[a];if(n===`--`){r.push(...e.slice(a+1));break}if(n.startsWith(`--`)){let t=n.slice(2),r=t.indexOf(`=`);if(r!==-1){i(t.slice(0,r),t.slice(r+1)),a++;continue}let o=e[a+1];if(o!==void 0&&!o.startsWith(`-`)){i(t,o),a+=2;continue}i(t,!0),a++;continue}if(n.startsWith(`-`)&&n.length>1){for(let e of n.slice(1))i(e,!0);a++;continue}t.push(n),a++}return{positional:t,flags:n,subcommand:t.length>0&&/^[a-z][\w-]*$/i.test(t[0])?t[0]:null,passthrough:r}}function Va(e){let t=[...e];return Object.defineProperty(t,"parseFlags",{value:()=>Ba(t),enumerable:!1,writable:!1,configurable:!1}),t}const Ha=async(e,t,n)=>{let r=Math.max(1,Math.trunc(e)||1),i=Array(t.length),a=0,o=[],s=async()=>{for(;;){let e=a++;if(e>=t.length)return;i[e]=await n(t[e],e)}};for(let e=0;e<Math.min(r,t.length);e++)o.push(s());return await Promise.all(o),i},Ua={ms:1,s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5,M:26298e5,y:315576e5};function Wa(e){if(typeof e==`number`&&Number.isFinite(e))return Math.trunc(e);if(typeof e!=`string`)throw TypeError(`time.parseDuration: spec must be string or number`);let t=e.trim(),n=/^([0-9]+(?:\.[0-9]+)?)\s*(ms|s|m|h|d|w|M|y)?$/.exec(t);if(!n)throw RangeError(`time.parseDuration: unrecognized spec "${e}"`);let r=Number(n[1]),i=n[2]??`ms`;return Math.trunc(r*Ua[i])}function Ga(e){return e<10?`0${e}`:String(e)}const Ka={parseDuration:Wa,ago(e,t=new Date){return new Date(t.getTime()-Wa(e))},range(e,t=new Date){let n=new Date(t.getTime());return{start:new Date(n.getTime()-Wa(e)),end:n}},future(e,t=new Date){let n=new Date(t.getTime());return{start:n,end:new Date(n.getTime()+Wa(e))}},gmailDate(e,t=new Date){let n=new Date(t.getTime()-Wa(e));return`${n.getFullYear()}/${Ga(n.getMonth()+1)}/${Ga(n.getDate())}`}};function qa(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t<0?``:t===0?`/`:e.substring(0,t)}var Ja=class extends Error{code;constructor(e){super(`Process exited with code ${e}`),this.code=e,this.name=`NodeExitError`}};function Ya(e){let t=Number(e);return Number.isFinite(t)?t:0}function Xa(e){return typeof e==`string`?`type string ('${e}')`:typeof e==`boolean`?`type boolean (${e})`:typeof e==`bigint`?`type bigint (${e}n)`:Array.isArray(e)?`an instance of Array`:typeof e==`object`&&e?`an instance of Object`:`type ${typeof e}`}function Za(e){let t=TypeError(`The "code" argument must be of type number. Received ${Xa(e)}`);return t.code=`ERR_INVALID_ARG_TYPE`,t}function Qa(e){let t=RangeError(`The value of "code" is out of range. It must be an integer. Received ${String(e)}`);return t.code=`ERR_OUT_OF_RANGE`,t}function $a(e){if(e!=null){if(typeof e==`string`){let t=Number(e);if(e!==``&&Number.isInteger(t))return t===0?0:t;throw Za(e)}if(typeof e==`number`){if(Number.isInteger(e))return e===0?0:e;throw Qa(e)}throw Za(e)}}function eo(e){if(typeof e==`string`)return e;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function to(e){return`${e.map(eo).join(` `)}\n`}function no(e){return e===void 0?`default`:String(e)}function ro(){return typeof performance<`u`?performance.now():Date.now()}function io(e){return`${e.toFixed(3)}ms`}function ao(e,t,n){let r=to(n);e(t>0?`${` `.repeat(t)}${r}`:r)}function oo(e,t,n){if(t)return;if(n.length===0){e(`Assertion failed`);return}let[r,...i]=n;e(`Assertion failed: ${eo(r)}`,...i)}function so(e,t,n,r){e(r.length>0?`Trace: ${r.map(eo).join(` `)}`:`Trace:`);let i=Error().stack;if(!i)return;let a=i.split(`
25
- `).slice(3).join(`
26
- `);if(!a)return;let o=a.endsWith(`
27
- `)?a:`${a}\n`;t(n>0?`${` `.repeat(n)}${o}`:o)}function co(e,t,n){let r=no(n);if(e.has(r)){t(`Label '${r}' already exists for console.time()`);return}e.set(r,ro())}function lo(e,t,n,r){let i=no(r),a=e.get(i);if(a===void 0){t(`No such label '${i}' for console.timeEnd()`);return}e.delete(i),n(`${i}: ${io(ro()-a)}`)}function uo(e,t,n,r,i){let a=no(r),o=e.get(a);if(o===void 0){t(`No such label '${a}' for console.timeLog()`);return}let s=`${a}: ${io(ro()-o)}`;i.length===0?n(s):n(s,...i)}function fo(e,t,n){let r=no(n),i=(e.get(r)??0)+1;e.set(r,i),t(`${r}: ${i}`)}function po(e,t,n){let r=no(n);if(!e.has(r)){t(`Count for '${r}' does not exist`);return}e.set(r,0)}function mo(e,t,n){n.length>0&&t(...n),e.depth+=1}function ho(e){e.depth>0&&--e.depth}function go(e,t){let n=new Map,r=new Map,i={depth:0},a=(...t)=>ao(e,i.depth,t),o=(...e)=>ao(t,i.depth,e),s=(...e)=>mo(i,a,e);return{log:a,info:a,debug:a,dirxml:a,table:a,warn:o,error:o,dir:(e,t)=>a(e),clear:()=>void 0,group:s,groupCollapsed:s,groupEnd:()=>ho(i),assert:(e,...t)=>oo(o,e,t),trace:(...e)=>so(o,t,i.depth,e),time:e=>co(r,o,e),timeEnd:e=>lo(r,o,a,e),timeLog:(e,...t)=>uo(r,o,a,e,t),count:e=>fo(n,a,e),countReset:e=>po(n,o,e)}}function _o(e,t,n){let r=!!e.env?.NO_COLOR,i=!1,a,o,s=e=>{i=!0,o=e,a=e},c=yo(e.stdin??``,s),l=Va(e.argv),u={write:t,end:()=>void 0,isTTY:!r},d={write:n,end:()=>void 0,isTTY:!r};return{processShim:{argv:l,env:e.env,versions:{node:x},version:`v${x}`,platform:`linux`,arch:`x64`,cwd:()=>e.cwd,get exitCode(){return a},set exitCode(e){a=$a(e)},exit:(...e)=>{if(e.length===0){let e=Ya(a);throw s(e),new Ja(e)}a=$a(e[0]);let t=Ya(a);throw s(t),new Ja(t)},stdin:c,stdout:u,stderr:d},getDidCallProcessExit:()=>i,getExitCode:()=>Ya(i?o:a),recordExit:s}}var vo=class extends $e.Stream{isTTY=!1;consumed=!1;flowScheduled=!1;paused=!1;buffer;onExit;constructor(e,t){super(),this.buffer=e,this.onExit=t}read(){return this.consumed?null:(this.consumed=!0,this.buffer.length>0?this.buffer:null)}toString(){return this.buffer}setEncoding(e){return this}pause(){return this.paused=!0,this}resume(){return this.paused=!1,this.scheduleFlow(),this}on(e,t){return super.on(e,t),e===`data`&&this.scheduleFlow(),this}addListener(e,t){return this.on(e,t)}once(e,t){return super.once(e,t),e===`data`&&this.scheduleFlow(),this}scheduleFlow(){this.flowScheduled||(this.flowScheduled=!0,queueMicrotask(()=>this.flush()))}flush(){if(this.paused){this.flowScheduled=!1;return}try{this.consumed||(this.consumed=!0,this.buffer.length>0&&this.emit(`data`,this.buffer)),this.readable=!1,this.emit(`end`),this.emit(`close`)}catch(e){if(e instanceof Ja){this.onExit(e.code);return}throw e}}[Symbol.asyncIterator](){return{next:async()=>this.consumed?{value:void 0,done:!0}:(this.consumed=!0,{value:this.buffer,done:!1})}}};function yo(e,t){return new vo(e,t)}function bo(e){if(e===``)return[];let t=e.split(`
28
- `);return t[t.length-1]===``&&t.pop(),t.map(e=>e.endsWith(`\r`)?e.slice(0,-1):e)}function xo(e){if(typeof e==`string`)return e;if(e&&typeof e.read==`function`){let t=e.read();return typeof t==`string`?t:``}return``}function So(e){return new TextDecoder(`utf-8`).decode(ie(e))}function Co(e){if(e&&typeof e.write==`function`)return e}var wo=class extends qe{terminal=!1;lines;cursor=0;closed=!1;flushScheduled=!1;output;onExit;constructor(e,t,n){super(),this.lines=bo(So(xo(e))),this.output=t??n.output,this.onExit=n.onExit}on(e,t){return super.on(e,t),e===`line`&&this.scheduleFlush(),this}once(e,t){return super.once(e,t),e===`line`&&this.scheduleFlush(),this}pause(){return this}resume(){return this}close(){this.closed||(this.closed=!0,this.emit(`close`))}question(e,t,n){let r=typeof t==`function`?t:typeof n==`function`?n:void 0;this.output?.write(String(e));let i=this.cursor<this.lines.length?this.lines[this.cursor++]:``;if(r){queueMicrotask(()=>this.runHandler(()=>r(i)));return}return Promise.resolve(i)}[Symbol.asyncIterator](){return{next:async()=>!this.closed&&this.cursor<this.lines.length?{value:this.lines[this.cursor++],done:!1}:(this.close(),{value:void 0,done:!0})}}scheduleFlush(){this.flushScheduled||this.closed||(this.flushScheduled=!0,queueMicrotask(()=>this.flush()))}flush(){this.flushScheduled=!1,this.runHandler(()=>{for(;!this.closed&&this.cursor<this.lines.length;)this.emit(`line`,this.lines[this.cursor++]);this.close()})}runHandler(e){try{e()}catch(e){if(e instanceof Ja&&this.onExit){this.closed=!0,this.onExit(e.code);return}throw e}}};function To(e){let t=(t,n)=>{let r,i;if(t&&typeof t==`object`&&`input`in t){let e=t;r=e.input,i=Co(e.output)}else r=t,i=Co(n);if(r==null)throw TypeError(`readline.createInterface: an 'input' stream is required`);return new wo(r,i,e)},n=(...e)=>{let t=e[e.length-1];return typeof t==`function`&&queueMicrotask(()=>t()),!0},r={createInterface:t,Interface:wo,emitKeypressEvents:()=>void 0,cursorTo:n,moveCursor:n,clearLine:n,clearScreenDown:n};return{...r,promises:r}}var Eo=class extends Error{status;statusText;url;body;constructor(e,t,n,r){let i=typeof r==`string`&&r?`: ${r.slice(0,200)}`:r&&typeof r==`object`?`: ${Do(r).slice(0,200)}`:``;super(`HTTP ${e} ${t} ${n}${i}`),this.status=e,this.statusText=t,this.url=n,this.body=r,this.name=`HttpError`}};function Do(e){try{return JSON.stringify(e)}catch{return String(e)}}function Oo(e){return new Promise(t=>setTimeout(t,e))}function ko(e,t){let n=[];for(let[e,r]of Object.entries(t))if(r!=null){if(Array.isArray(r))for(let t of r)t!=null&&n.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(t))}`);else n.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`)}return n.length===0?e:e+(e.includes(`?`)?`&`:`?`)+n.join(`&`)}function Ao(e,t,n){let r;return r=/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:e?`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`:t,n?ko(r,n):r}function jo(e,t){let n={};if(e)for(let[t,r]of Object.entries(e))n[t]=r;if(t)for(let[e,r]of Object.entries(t))n[e]=r;return n}function Mo(e){if(!e)return!1;let t=e.toLowerCase();return t.startsWith(`application/json`)||/[+/]json(;|$|\s)/.test(t)}function No(e){if(!e)return null;let t=e.trim();if(!t)return null;if(/^\d+(\.\d+)?$/.test(t)){let e=Number(t);if(Number.isFinite(e)&&e>=0)return Math.round(e*1e3)}let n=Date.parse(t);if(Number.isFinite(n)){let e=n-Date.now();return e>0?e:0}return null}async function Po(e){if(Mo(e.headers.get(`content-type`))){let t=await e.text();if(!t)return null;try{return JSON.parse(t)}catch{return t}}return e.text()}function Fo(e,t){if(e!=null)return typeof e==`string`||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof Blob<`u`&&e instanceof Blob||typeof FormData<`u`&&e instanceof FormData||typeof URLSearchParams<`u`&&e instanceof URLSearchParams||typeof ReadableStream<`u`&&e instanceof ReadableStream?e:typeof e==`object`?(Object.keys(t).some(e=>e.toLowerCase()===`content-type`)||(t[`Content-Type`]=`application/json`),JSON.stringify(e)):String(e)}function Io(e,t){return Object.keys(e).some(e=>e.toLowerCase()===t.toLowerCase())}async function Lo(e,t,n){let r=await t(n);r&&!Io(e,`authorization`)&&(e.Authorization=`Bearer ${r}`)}function Ro(e,t){if(!t)return{signal:e,clearTimeout:null};let n=new AbortController,r=setTimeout(()=>n.abort(Error(`timeout`)),t),i=()=>clearTimeout(r);return e?{signal:AbortSignal.any([e,n.signal]),clearTimeout:i}:{signal:n.signal,clearTimeout:i}}function zo(e,t){return{body:t,headers:Object.fromEntries(e.headers.entries()),status:e.status}}async function Bo(e,t){let n=await Po(e);return t?zo(e,n):n}async function Vo(e,t){let n=await Po(e).catch(()=>null);throw new Eo(e.status,e.statusText,t,n)}function Ho(e,t){let n=No(e.headers.get(`retry-after`));return n===null?500*2**t:n}async function Uo(e,t,n,r){let i=null;for(let a=0;a<e.maxAttempts;a++){let{signal:o,clearTimeout:s}=Ro(r.signal,e.timeoutMs),c=o?{...n,signal:o}:n,l;try{l=await e.fetch(t,c)}finally{s?.()}if(i=l,l.ok)return Bo(l,r.raw);if(!(a+1<e.maxAttempts&&e.retryOn.has(l.status)))return Vo(l,t);await e.sleep(Ho(l,a))}if(i)return Vo(i,t);throw Error(`http: no attempts made for ${n.method??`GET`} ${t}`)}function Wo(e){let t=e.sleep??Oo;function n(n){let r=new Set(n.retry?.on??[]),i=Math.max(1,Math.trunc(n.retry?.maxAttempts??1));async function a(a,o,s={}){let c=Ao(n.baseUrl,o,s.params),l=jo(n.headers,s.headers);n.token&&await Lo(l,n.token,{method:a,path:o,url:c});let u=Fo(s.body,l),d={method:a,headers:l};return u!==void 0&&(d.body=u),Uo({fetch:e.fetch,sleep:t,maxAttempts:i,retryOn:r,timeoutMs:n.timeoutMs},c,d,s)}return Object.freeze({get:((e,t)=>a(`GET`,e,t)),post:((e,t)=>a(`POST`,e,t)),put:((e,t)=>a(`PUT`,e,t)),patch:((e,t)=>a(`PATCH`,e,t)),delete:((e,t)=>a(`DELETE`,e,t))})}return Object.freeze({client:n})}function Go(e){let t=new TextEncoder().encode(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function Ko(e,t,n){let r=[];t.model&&r.push(`--model`,String(t.model)),t.thinking&&r.push(`--thinking`,String(t.thinking)),t.schema&&r.push(`--schema-b64`,Go(JSON.stringify(t.schema))),t.readOnly!==void 0&&r.push(`--read-only`,Array.isArray(t.readOnly)?t.readOnly.join(`,`):String(t.readOnly));let i=t.cwd===void 0?n||`.`:String(t.cwd),a=t.allowedCommands===void 0?`*`:String(t.allowedCommands);return[`agent`,...r,i,a,String(e)]}function qo(e,t){let n=t.cwd,r=async(t,r)=>{let i=r??{},a=await e.spawn(Ko(t,i,n)),o=typeof a.exitCode==`number`?a.exitCode:0;return{finalText:String(a.stdout??``).replace(/\n+$/,``),exitCode:o,stderr:String(a.stderr??``).replace(/\n+$/,``)}},i=(async(e,t)=>{let n=t??{},i=await r(e,n);if(i.exitCode!==0)throw Error(`agent: exited with code ${i.exitCode}${i.stderr?`: ${i.stderr}`:``}`);if(n.schema)try{return JSON.parse(i.finalText)}catch{throw Error(`agent: schema response was not valid JSON (exit ${i.exitCode}): ${i.finalText.slice(0,200)}`)}return i.finalText});return i.spawn=r,i}function Jo(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`&&typeof e.targetId==`string`)return e.targetId;throw TypeError(`browser: expected a tab handle or targetId string`)}function Yo(e){function t(t){return{...t,async update(n){let r={};return n.urlMatch!==void 0&&(r.urlMatch=n.urlMatch===null?null:n.urlMatch instanceof RegExp?n.urlMatch.source:n.urlMatch),n.filter!==void 0&&(r.filter=n.filter),e.call(`browser`,`wsUpdate`,[t.id,r])},async close(){return e.call(`browser`,`wsClose`,[t.id])}}}return{on(n,r={}){let i=Jo(n),a=r.urlMatch===void 0?void 0:r.urlMatch instanceof RegExp?r.urlMatch.source:r.urlMatch,o,s={filter(e){if(typeof e==`function`||typeof e==`string`)throw TypeError(`browser.websocket: filter must be a declarative JSON object, not a function or string`);return o=e,s},async forward(n){return t(await e.call(`browser`,`wsObserve`,[{targetId:i,urlMatch:a,filter:o,forward:n}]))}};return s},async list(){return e.call(`browser`,`wsList`,[])}}}async function Xo(e,t){if(!e&&!(t instanceof Request))return;let n=t instanceof Request?t:null,r=(e?.method??n?.method??`GET`).toUpperCase(),i={};if(e?.headers){if(e.headers instanceof Headers)e.headers.forEach((e,t)=>{i[t]=e});else if(Array.isArray(e.headers))for(let[t,n]of e.headers)i[t]=n;else Object.assign(i,e.headers)}else n&&n.headers.forEach((e,t)=>{i[t]=e});let a,o;if(r!==`GET`&&r!==`HEAD`&&e?.body!==void 0&&e?.body!==null&&e?.body!==``){let t=await Zo(e.body);a=t.body,o=t.defaultContentType}return o&&!Object.keys(i).some(e=>e.toLowerCase()===`content-type`)&&(i[`Content-Type`]=o),{method:r,headers:i,body:a}}async function Zo(e){if(typeof e==`string`)return{body:e};if(e instanceof URLSearchParams)return{body:e.toString(),defaultContentType:`application/x-www-form-urlencoded;charset=UTF-8`};if(e instanceof Blob)return{body:new Uint8Array(await e.arrayBuffer()),defaultContentType:e.type||`application/octet-stream`};if(e instanceof ArrayBuffer)return{body:new Uint8Array(e).slice(),defaultContentType:`application/octet-stream`};if(ArrayBuffer.isView(e))return{body:new Uint8Array(e.buffer,e.byteOffset,e.byteLength).slice(),defaultContentType:`application/octet-stream`};if(n(e)){let t=await r(e);return{body:t.bytes,defaultContentType:t.contentType}}throw typeof ReadableStream<`u`&&e instanceof ReadableStream?Error(`node fetch shim: ReadableStream request bodies are not supported (collect into a Uint8Array or string before calling fetch)`):Error(`node fetch shim: unsupported request body type (${Object.prototype.toString.call(e)}); use a string, Uint8Array, ArrayBuffer, Blob, FormData, or URLSearchParams`)}function Qo(e){return{findTab:t=>e.call(`browser`,`findTab`,[es(t)]),ensureTab:(t,n={})=>e.call(`browser`,`ensureTab`,[t,ts(n)]),eval:(t,n)=>e.call(`browser`,`eval`,[Jo(t),$o(n,!1)]),evalAsync:(t,n)=>e.call(`browser`,`evalAsync`,[Jo(t),$o(n,!0)]),cookie:(t,n)=>e.call(`browser`,`cookie`,[Jo(t),n]),localStorage:(t,n)=>e.call(`browser`,`localStorage`,[Jo(t),n]),fetch:(t,n,r={})=>E(n,r).then(n=>e.call(`browser`,`evalAsync`,[Jo(t),n])),websocket:Yo(e)}}function $o(e,t){if(typeof e==`function`)return`(${e.toString()})()`;if(typeof e==`string`)return e;throw TypeError(`browser.eval/evalAsync: source must be a function or string`)}function es(e){let t={};return e.domain!==void 0&&(t.domain=e.domain),e.urlMatch!==void 0&&(t.urlMatch=e.urlMatch instanceof RegExp?e.urlMatch.source:e.urlMatch),t}function ts(e){return e.matchUrl===void 0?{}:{matchUrl:e.matchUrl instanceof RegExp?e.matchUrl.source:e.matchUrl}}function ns(e){return e===`SIGKILL`?137:e===`SIGINT`?130:143}function rs(e,t,n,r){let i=async()=>{if(!t?.wasUsed())return;let n=t.getMutations();if(n.created.length||n.modified.length||n.deleted.length)try{await e.call(`vfs`,`flushWrites`,[n])}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[realm-exec] pre-exec sync-fs flush failed (will retry at exit): ${t}`);return}t.resetBaseline()},a=async(i=!1)=>{if(t?.wasUsed())try{let r=await e.call(`vfs`,`snapshot`,[n]);i?t.applySnapshotPreservingMutations(r):t.applySnapshot(r)}catch(e){let t=e instanceof Error?e.message:String(e);r?.(`[sync-fs] re-snapshot after exec failed: ${t}\n`)}},o=async t=>{await i();try{return await e.call(`exec`,`run`,[t])}finally{await a()}},s=async t=>{await i();try{return await e.call(`exec`,`spawn`,[t])}finally{await a()}},c=1,l=Object.assign(o,{spawn:s,start:(t,n)=>{let r=c++,o=[],s=!1,l=!1,u=!1,d,f,p=new Promise((e,t)=>{d=e,f=t}),m=()=>{if(s||u||l)return;l=!0;let c=o.length>0?o.join(``):n?.stdin,p={};c!==void 0&&(p.stdin=c),n?.stdinKind!==void 0&&(p.stdinKind=n.stdinKind),n?.args!==void 0&&(p.args=n.args),n?.cwd!==void 0&&(p.cwd=n.cwd),n?.env!==void 0&&(p.env=n.env),(async()=>{try{if(await i(),u){await a(!0);return}s=!0;let n=await e.call(`exec`,`start`,[r,t,p]);await a(!0),d(n)}catch(e){await a(!0),f(e)}})()};return{kill:t=>s?e.call(`exec`,`kill`,[r,t]):(u=!0,d({stdout:``,stderr:``,exitCode:ns(t)}),Promise.resolve(!0)),stdin:{write:e=>{!s&&!u&&o.push(e)},end:()=>m()},done:p}}});return l.exec=l,l}const is=new Set([204,205,304]),as=new Set([`content-encoding`,`transfer-encoding`,`content-length`]);function os(e,t){let n=ss(e.body),r=cs(e.headers),i=is.has(e.status)||n.byteLength===0,a=new Response(i?null:n,{status:e.status,statusText:e.statusText,headers:r});try{Object.defineProperty(a,"url",{value:e.url||t,writable:!1,configurable:!0,enumerable:!1})}catch{}return us(a,n),a}function ss(e){return e.byteLength===0?new Uint8Array:e.slice()}function cs(e){let t=new Headers;for(let[n,r]of Object.entries(e))if(!as.has(n.toLowerCase()))try{t.set(n,r)}catch{}return t}const ls=Symbol(`slicc.realmBufferedBody`);function us(e,t){if(ls in e)return;Object.defineProperty(e,ls,{value:!0,configurable:!0});let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`bodyUsed`),r=!1,i=()=>{if(r)throw TypeError(`Failed to read response body: body already used`);return r=!0,ds(e),t},a=async()=>new TextDecoder().decode(i()),o=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);Object.defineProperties(e,{bodyUsed:{configurable:!0,enumerable:!1,get(){return r?!0:n?.get?!!n.get.call(e):!1}},text:{value:a,configurable:!0},json:{value:async()=>JSON.parse(await a()),configurable:!0},arrayBuffer:{value:async()=>o(i()),configurable:!0},blob:{value:async()=>new Blob([o(i())]),configurable:!0},bytes:{value:async()=>i(),configurable:!0}})}function ds(e){try{let t=e.body;t&&!t.locked&&t.getReader()}catch{}}function fs(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e);throw TypeError(`expected an ArrayBuffer or typed array`)}function ps(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ms(e){return e==null?[]:Array.isArray(e)?e:[e]}function hs(e,t){let n=t.handle,r=new Set,i=new Set,a=!1,o=null,s=e=>{let t=e;if(!t||t.handle!==n)return;let i={reportId:t.reportId,data:ps(t.bytes)};for(let e of[...r])try{e(i)}catch{}},c=()=>{a||(a=!0,o=e.onEvent?e.onEvent(`hid-input-report`,s):null,e.call(`hid`,`subscribeInputReports`,[n]).catch(()=>{a=!1,o?.(),o=null}))},l=()=>{!a||r.size>0||(a=!1,o?.(),o=null,e.call(`hid`,`unsubscribeInputReports`,[n]).catch(()=>{}))};return{...t,open:()=>e.call(`hid`,`open`,[n]),close:()=>e.call(`hid`,`close`,[n]),sendReport:(t,r)=>e.call(`hid`,`sendReport`,[n,t,fs(r)]),sendFeatureReport:(t,r)=>e.call(`hid`,`sendFeatureReport`,[n,t,fs(r)]),receiveFeatureReport:async t=>ps((await e.call(`hid`,`receiveFeatureReport`,[n,t])).bytes),addEventListener(e,t){if(e===`inputreport`)r.add(t),c();else if(e===`disconnect`)i.add(t);else throw TypeError(`hid device: unknown event type '${String(e)}'`)},removeEventListener(e,t){e===`inputreport`?(r.delete(t),l()):e===`disconnect`&&i.delete(t)},onInputReport(e){r.add(e),c()}}}function gs(e){return{list:async()=>(await e.call(`hid`,`list`,[])).map(t=>hs(e,t)),request:async t=>{let n=(await e.call(`hid`,`request`,[ms(t)]))[0];if(!n)throw Error(`No device selected.`);return hs(e,n)}}}function _s(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var vs=class{rpc;targetId;selector;index;constructor(e,t,n,r){this.rpc=e,this.targetId=t,this.selector=n,this.index=r}evalOnElement(e){let t=`(() => { const els = document.querySelectorAll(${JSON.stringify(this.selector)}); const el = els[${this.index}]; ${e} })()`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,t])}async textContent(){return this.evalOnElement(`return el ? el.textContent : null;`)}async getAttribute(e){return this.evalOnElement(`return el ? el.getAttribute(${JSON.stringify(e)}) : null;`)}async isVisible(){return this.evalOnElement(`if (!el) return false; const s = getComputedStyle(el); if (s.display === 'none' || s.visibility === 'hidden' || s.opacity === '0') return false; const r = el.getBoundingClientRect(); return r.width > 0 && r.height > 0;`)}async boundingBox(){return this.evalOnElement(`if (!el) return null; const r = el.getBoundingClientRect(); return { x: r.x, y: r.y, width: r.width, height: r.height };`)}},ys=class{rpc;targetId;onClose;closed=!1;constructor(e,t,n){this.rpc=e,this.targetId=t,this.onClose=n}async goto(e,t){await this.rpc.call(`browser`,`navigateTab`,[this.targetId,e])}async waitForLoadState(e){await this.rpc.call(`browser`,`waitForLoadState`,[this.targetId,e??`load`])}async waitForTimeout(e){await new Promise(t=>setTimeout(t,e))}async evaluate(e,...t){let n=typeof e==`string`?e:`(${e.toString()}).apply(null, JSON.parse(${JSON.stringify(JSON.stringify(t))}))`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,n])}async screenshot(e){let t={};e?.fullPage!==void 0&&(t.fullPage=e.fullPage);let n=_s(await this.rpc.call(`browser`,`screenshotTab`,[this.targetId,t]));return e?.path&&await this.rpc.call(`vfs`,`writeFileBinary`,[e.path,n]),n}async $(e){return await this.rpc.call(`browser`,`evalAsync`,[this.targetId,`!!document.querySelector(${JSON.stringify(e)})`])?new vs(this.rpc,this.targetId,e,0):null}async $$(e){let t=await this.rpc.call(`browser`,`evalAsync`,[this.targetId,`document.querySelectorAll(${JSON.stringify(e)}).length`]),n=[];for(let r=0;r<t;r++)n.push(new vs(this.rpc,this.targetId,e,r));return n}async $$eval(e,t,...n){if(typeof t==`string`)return this.rpc.call(`browser`,`evalAsync`,[this.targetId,t]);let r=`(${t.toString()}).apply(null, [Array.from(document.querySelectorAll(${JSON.stringify(e)}))].concat(JSON.parse(${JSON.stringify(JSON.stringify(n))})))`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,r])}async content(){return this.rpc.call(`browser`,`evalAsync`,[this.targetId,`document.documentElement.outerHTML`])}async setViewportSize(e){await this.rpc.call(`browser`,`setViewport`,[this.targetId,e.width,e.height])}async close(){this.closed||(this.closed=!0,await this.rpc.call(`browser`,`closeTab`,[this.targetId]),this.onClose?.())}},bs=class{rpc;openPages=[];constructor(e){this.rpc=e}async newPage(e){let t=await this.rpc.call(`browser`,`createTab`,[`about:blank`]);e?.viewport&&await this.rpc.call(`browser`,`setViewport`,[t,e.viewport.width,e.viewport.height]);let n=new ys(this.rpc,t,()=>{let e=this.openPages.indexOf(n);e!==-1&&this.openPages.splice(e,1)});return this.openPages.push(n),n}pages(){return[...this.openPages]}async close(){let e=this.openPages.splice(0,this.openPages.length);for(let t of e)await t.close()}},xs=class{rpc;openPages=[];openContexts=[];constructor(e){this.rpc=e}async newPage(e){let t=await this.rpc.call(`browser`,`createTab`,[`about:blank`]);e?.viewport&&await this.rpc.call(`browser`,`setViewport`,[t,e.viewport.width,e.viewport.height]);let n=new ys(this.rpc,t,()=>{let e=this.openPages.indexOf(n);e!==-1&&this.openPages.splice(e,1)});return this.openPages.push(n),n}async newContext(e){let t=new bs(this.rpc);return this.openContexts.push(t),t}contexts(){return[...this.openContexts]}async close(){let e=this.openPages.splice(0,this.openPages.length);for(let t of e)await t.close();let t=this.openContexts.splice(0,this.openContexts.length);for(let e of t)await e.close()}};function Ss(e){let t=async t=>new xs(e),n=async(t,n)=>new xs(e);return{chromium:{launch:t,connect:n,connectOverCDP:n},firefox:{launch:t,connect:n},webkit:{launch:t,connect:n}}}function Cs(e){return{...e,time:Ka,fmt:Fe,pool:Ha}}function ws(e,t){return e?.startsWith(`/`)?qa(e):t}function Ts(e){return e.includes(`require`)||e.includes(`import`)||/(?:^|[;\n}])\s*export\b/.test(e)}async function Es(e,t,n,r){return Ts(t)?e.call(`module`,`buildGraph`,[t,ws(r,n),r]):{files:[],entryMap:{},edges:{},edgeErrors:{},errors:{}}}function Ds(e){if(typeof e!=`object`||!e)return;let t=e;if(t.__esModule&&!Object.prototype.hasOwnProperty.call(t,`default`)&&Object.isExtensible(t))try{Object.defineProperty(t,"default",{value:t,enumerable:!1,configurable:!0})}catch{}}function Os(e){return{playwright:Ss(e)}}function ks(e){let{graph:t,fsBridge:n,processShim:r,childProcess:i,nodeConsole:a,sliccyModules:s,shimmedPackages:c={},nodeReadline:l,nodeOsModule:u=xn,nodeUtilModule:d=_t}=e,f=new Map(t.files.map(e=>[e.path,e.cjsSource])),p=new Map(t.files.map(e=>[e.path,e.kind])),h=new Map,g=gn({requireFrom:(e,t)=>T(e,t),resolveFrom:(e,t)=>C(e,t)}),_=nn(()=>{let e=r?.cwd?.();return typeof e==`string`&&e.length>0?e:`/`}),v=e=>{if(typeof e==`string`&&e.startsWith(`sliccy:`))return{hit:!0,value:Ms(e,s)};let t=e.startsWith(`node:`)?e.slice(5):e,a=As(t,{fsBridge:n,processShim:r,childProcess:i,nodeOsModule:u,nodeUtilModule:d,nodePathModule:_,nodeReadline:l,nodeModule:g});if(a.hit)return a;if(m.has(t))throw o(e,t);if(w.has(t))throw Ps(e,t);return t in c?{hit:!0,value:c[t]}:{hit:!1}},y=(e,n,r)=>{let i=v(n);if(i.hit)return i.value;let a=e?.[n];if(a)return b(a);let o=r===null?t.errors[n]:t.edgeErrors?.[r]?.[n];throw o?Error(o):js(n)};function b(e){let n=h.get(e);if(n)return n.exports;let i=f.get(e);if(i===void 0)throw Error(`Cannot find module '${e}'`);let o={exports:{}};h.set(e,o);let s=n=>y(t.edges[e],n,e),c=qa(e);return Function(`module`,`exports`,`require`,`__dirname`,`__filename`,`process`,`console`,`Buffer`,`global`,i)(o,o.exports,s,c,e,r,a,globalThis.Buffer,globalThis),p.get(e)===`cjs`&&Ds(o.exports),o.exports}function x(e){return f.has(e)}function C(e,n){if(S(n))return n;let r=t.edges[e]?.[n];if(r)return r;let i=qa(e);if(hn(n)){let e=pn(i,n,x);if(e)return e}else{let e=mn(i,n,x);if(e)return e}let a=t.edgeErrors?.[e]?.[n];throw a?Error(a):js(n)}function T(e,t){let n=v(t);return n.hit?n.value:b(C(e,t))}return{require:e=>y(t.entryMap,e,null)}}function As(e,t){let{fsBridge:n,processShim:r,childProcess:i,nodeOsModule:a,nodeUtilModule:o,nodePathModule:s,nodeReadline:c,nodeModule:l}=t;return e===`fs`||e===`fs/promises`?{hit:!0,value:n}:e===`path`?{hit:!0,value:s}:e===`crypto`?{hit:!0,value:Wt}:e===`child_process`?{hit:!0,value:i}:e===`process`?{hit:!0,value:r}:e===`buffer`?{hit:!0,value:{Buffer:globalThis.Buffer}}:e===`assert`?{hit:!0,value:Ge}:e===`assert/strict`?{hit:!0,value:We}:e===`util`?{hit:!0,value:o}:e===`events`?{hit:!0,value:Je}:e===`os`?{hit:!0,value:a}:e===`tty`?{hit:!0,value:Sn}:e===`stream`?{hit:!0,value:$e}:e===`url`?{hit:!0,value:sn}:e===`zlib`?{hit:!0,value:za}:e===`readline`&&c?{hit:!0,value:c}:e===`readline/promises`&&c?{hit:!0,value:c.promises}:e===`module`&&l?{hit:!0,value:l}:{hit:!1}}function js(e){if(e.startsWith(`.`)||e.startsWith(`/`)||e.startsWith(`node:`))return Error(`Cannot find module '${e}'`);let t=e.startsWith(`@`)?e.split(`/`).slice(0,2).join(`/`):e.split(`/`)[0];return Error(`Cannot find module '${e}' (run: ipk install ${t})`)}function Ms(e,t){let n=e.slice(7);if(n===``)throw Error(`require('sliccy:'): empty sliccy: module name`);if(!Object.prototype.hasOwnProperty.call(t,n))throw Error(`require('${e}'): unknown sliccy: module '${n}'. Known names: ${Object.keys(t).sort().join(`, `)}`);return t[n]}const Ns={http:` Use fetch() instead.`,https:` Use fetch() instead.`,crypto:` Use globalThis.crypto (Web Crypto API) instead.`};function Ps(e,t){return Error(`require('${e}'): Node built-in '${t}' is not available in the browser environment.${Ns[t]||``}`)}async function Fs(e,t,n,r){let i=Object.keys(t),a=i.map(e=>t[e]),o=Object.getPrototypeOf(async function(){}).constructor,s=new o(...i,`${r?`"use strict";
29
- `:``}${e}`);try{return await s(...a),0}catch(e){return e instanceof Ja?e.code:(n(`${e instanceof Error?e.stack??e.message:String(e)}\n`),1)}}function Is(e,t){let n=t.handle;return{...t,open:t=>e.call(`serial`,`open`,[n,t]),close:()=>e.call(`serial`,`close`,[n]),read:(t={})=>e.call(`serial`,`read`,[n,{maxBytes:t.maxBytes??t.bytes,until:t.until?fs(t.until):void 0,timeoutMs:t.timeoutMs}]),write:t=>e.call(`serial`,`write`,[n,fs(t)]),getSignals:()=>e.call(`serial`,`getSignals`,[n]),setSignals:t=>e.call(`serial`,`setSignals`,[n,t])}}function Ls(e){return{list:async()=>(await e.call(`serial`,`list`,[])).map(t=>Is(e,t)),request:async t=>Is(e,await e.call(`serial`,`request`,[ms(t)]))}}function Rs(e=globalThis,t){let n=e.setTimeout,r=e.clearTimeout,i=e.setInterval,a=e.clearInterval,o=n.bind(e),s=r.bind(e),c=i.bind(e),l=a.bind(e),u=new Set,d=new Set,f=new Set,p=!1,m=()=>{if(f.size===0)return;let e=[...f];f.clear();for(let t of e)t()},h=e=>{if(e==null)return!1;let t=u.delete(e),n=d.delete(e);return t||n},g=(e,n)=>{try{e(...n)}catch(e){if(t?.onCallbackError?.(e),!t?.onCallbackError)throw e}finally{m()}};return{get pendingCount(){return u.size+d.size},install(){p||(p=!0,e.setTimeout=((e,t,...n)=>{if(typeof e!=`function`)return o(e,t,...n);let r=o(()=>{u.delete(r),g(e,n)},t);return u.add(r),r}),e.clearTimeout=(e=>{let t=h(e);s(e),t&&m()}),e.setInterval=((e,t,...n)=>{if(typeof e!=`function`)return c(e,t,...n);let r=c(()=>{g(e,n)},t);return d.add(r),r}),e.clearInterval=(e=>{let t=h(e);l(e),t&&m()}))},restore(){p&&(p=!1,e.setTimeout=n,e.clearTimeout=r,e.setInterval=i,e.clearInterval=a)},clearPending(){for(let e of u)s(e);u.clear();for(let e of d)l(e);d.clear(),m()},tick(){return new Promise(e=>{o(e,0)})},waitForProgress(){return u.size+d.size===0?Promise.resolve():new Promise(e=>{f.add(e)})}}}function zs(e,t){let n=t.handle,r=e=>({status:e.status,data:ps(e.bytes)}),i=new Set,a=new Set,o=!1,s=null,c=e=>{let t=e;if(!t||t.handle!==n)return;let r=t.type===`disconnect`?i:a;for(let e of[...r])try{e(t)}catch{}},l=()=>{o||(o=!0,s=e.onEvent?e.onEvent(`usb-claim-event`,c):null,e.call(`usb`,`subscribeClaimEvents`,[n]).catch(()=>{o=!1,s?.(),s=null}))},u=()=>{!o||i.size>0||a.size>0||(o=!1,s?.(),s=null,e.call(`usb`,`unsubscribeClaimEvents`,[n]).catch(()=>{}))};return{...t,open:()=>e.call(`usb`,`open`,[n]),close:t=>e.call(`usb`,`close`,t?.force?[n,{force:!0}]:[n]),reset:t=>e.call(`usb`,`reset`,t?.force?[n,{force:!0}]:[n]),clearHalt:(t,r)=>e.call(`usb`,`clearHalt`,[n,t,r]),selectConfiguration:t=>e.call(`usb`,`selectConfig`,[n,t]),claimInterface:(t,r)=>e.call(`usb`,`claim`,r?.wait?[n,t,{wait:!0}]:[n,t]),releaseInterface:t=>e.call(`usb`,`release`,[n,t]),controlTransferIn:async(t,i)=>r(await e.call(`usb`,`controlIn`,[n,t,i])),controlTransferOut:(t,r)=>e.call(`usb`,`controlOut`,[n,t,fs(r)]),transferIn:async(t,i)=>r(await e.call(`usb`,`transferIn`,[n,t,i])),transferOut:(t,r)=>e.call(`usb`,`transferOut`,[n,t,fs(r)]),addEventListener(e,t){if(e===`disconnect`)i.add(t);else if(e===`claim-lost`)a.add(t);else throw TypeError(`usb device: unknown event type '${String(e)}'`);l()},removeEventListener(e,t){e===`disconnect`?i.delete(t):e===`claim-lost`&&a.delete(t),u()}}}function Bs(e){return{list:async()=>(await e.call(`usb`,`list`,[])).map(t=>zs(e,t)),request:async t=>zs(e,await e.call(`usb`,`request`,[ms(t)]))}}function Vs(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t<0?``:t===0?`/`:e.substring(0,t)}function Hs(e){if(!e)return e;let t=e.startsWith(`/`),n=e.split(`/`).filter(e=>e.length>0),r=n.indexOf(`scripts`);if(r<0)return e;let i=n.slice(0,r);return i.length===0?t?`/`:``:(t?`/`:``)+i.join(`/`)}function Us(e){return/^[A-Za-z0-9_\-./:@]+$/.test(e)?e:`'`+e.replace(/'/g,`'\\''`)+`'`}function Ws(e,t){return e===``?t:e===`/`?`/${t}`:`${e}/${t}`}function Gs(e){let t=Vs(e.argv[1]??``),n=Hs(t),r=Ws(n,`references`),i=Ws(n,`assets`),a=Ws(t,`.config`);async function o(){let t;try{t=await e.fs.exists(a)}catch{return null}if(!t)return null;let n;try{n=await e.fs.readFile(a)}catch{return null}let r=typeof n==`string`?n:String(n);if(!r.trim())return null;let i;try{i=JSON.parse(r)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`skill.config(): failed to parse ${a}: ${t}`)}if(i&&typeof i==`object`&&!Array.isArray(i))return i;throw Error(`skill.config(): ${a} must contain a JSON object`)}async function s(t){let n=await o();if(t===void 0)return n;if(typeof t!=`object`||!t||Array.isArray(t))throw TypeError(`skill.config(updates): updates must be a plain object`);let r={...n??{},...t};return await e.fs.writeFile(a,JSON.stringify(r,null,2)+`
30
- `),r}async function c(t){if(typeof t!=`string`||!t.trim())throw TypeError(`skill.token(providerId): providerId must be a non-empty string`);let n=`oauth-token ${Us(t)}`,{stdout:r,stderr:i,exitCode:a}=await e.exec(n);if(a!==0){let e=i.trim()||`oauth-token exited with code ${a}`;throw Error(`skill.token('${t}'): ${e}`)}return r.replace(/\r?\n+$/,``)}return Object.freeze({dir:t,root:n,refs:r,assets:i,config:s,token:c})}function $(e,t){return Object.assign(Error(`${e}: ${t}`),{code:e})}function Ks(e){let t=Js(e);if(Ys(t))return new Uint8Array(t.response);if(t.status>=200&&t.status<300)throw $(`EIO`,e.label);Xs(t,e.label)}function qs(e){let t=Ks(e);try{return JSON.parse(new TextDecoder().decode(t))}catch{throw $(`EIO`,e.label)}}function Js(e){let t=new XMLHttpRequest;try{t.open(e.method,e.url,!1),t.responseType=`arraybuffer`,t.timeout=e.timeoutMs,t.setRequestHeader(l,e.token),e.body?t.send(new Uint8Array(e.body)):t.send()}catch{throw $(`EIO`,e.label)}return t}function Ys(e){return e.status>=200&&e.status<300&&e.getResponseHeader(`x-slicc-fs`)===`1`}function Xs(e,t){throw $(e.getResponseHeader(`x-slicc-fs`)===`1`&&e.getResponseHeader(`x-slicc-fs-errno`)||`EIO`,t)}function Zs(e){return(t,n,r)=>{let i=qs({method:`POST`,url:f,token:e,body:new TextEncoder().encode(JSON.stringify({...t,channel:d})),timeoutMs:n+u,label:r});if(!i||typeof i.stdout!=`string`||typeof i.stderr!=`string`||typeof i.exitCode!=`number`)throw $(`EIO`,r);return{stdout:i.stdout,stderr:i.stderr,exitCode:i.exitCode}}}function Qs(e,t){let n=e.getMutations();for(let e of n.deleted)t.rm(e);for(let e of n.created)e.isDirectory?t.mkdir(e.path):t.writeFile(e.path,e.content);for(let e of n.modified)t.writeFile(e.path,e.content);e.resetBaseline()}function $s(e,t={}){let n=t.timeoutMs??12e4,{syncFs:r,fsBridge:i}=t,a=t.transport??Zs(e);return{run(e,t={}){let o=r?.wasUsed()===!0&&i!==void 0;o&&Qs(r,i);let s=`sync-exec bridge, '${Array.isArray(e)?e.join(` `):e}'`,c=h(t.timeout,n),l={command:e,...t.args===void 0?{}:{args:t.args},...t.input===void 0?{}:{stdin:t.input},...t.cwd===void 0?{}:{cwd:t.cwd},...t.env===void 0?{}:{env:t.env},timeoutMs:c};try{return a(l,c,s)}finally{o&&r.invalidate()}}}}function ec(e,t){return $(e,`sync-fs bridge, '${t}'`)}function tc(e,t){let n=e.startsWith(`/`)?e:`/${e}`,r=y+n.split(`/`).map(encodeURIComponent).join(`/`);return t?`${r}?op=${t}`:r}function nc(e,t={}){let n=t.timeoutMs??3e4;function r(t,r,i,a){return{method:t,url:tc(r,a),token:e,...i?{body:i}:{},timeoutMs:n,label:`sync-fs bridge, '${r}'`}}return{readFile(e){return Ks(r(`GET`,e))},writeFile(e,t){Ks(r(`POST`,e,t))},stat(e){let t=qs(r(`GET`,e,void 0,`stat`));if(!t||typeof t.isFile!=`boolean`||typeof t.isDirectory!=`boolean`||typeof t.size!=`number`)throw ec(`EIO`,e);return{isFile:t.isFile,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,size:t.size}},lstat(e){let t=qs(r(`GET`,e,void 0,`lstat`));if(!t||typeof t.isFile!=`boolean`||typeof t.isDirectory!=`boolean`||typeof t.size!=`number`)throw ec(`EIO`,e);return{isFile:t.isFile,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,size:t.size}},readdir(e){let t=qs(r(`GET`,e,void 0,`readdir`));if(!Array.isArray(t)||!t.every(e=>typeof e==`string`))throw ec(`EIO`,e);return t},exists(e){let t=qs(r(`GET`,e,void 0,`exists`));if(typeof t!=`boolean`)throw ec(`EIO`,e);return t},mkdir(e){Ks(r(`POST`,e,void 0,`mkdir`))},rm(e){Ks(r(`POST`,e,void 0,`rm`))}}}function rc(e,t,n={}){let{header:r,window:i}=v(e),a=n.wait??((e,t,n,r)=>Atomics.wait(e,t,n,r)),o=n.now??(()=>performance.now()),s=0;function c(e,t,n){for(;;){let i=t-o();if(i<=0)throw $(`ETIMEDOUT`,n);if(a(r,0,1,i),Atomics.load(r,0)===2&&Atomics.load(r,1)===e)return;Atomics.load(r,0)===2&&Atomics.store(r,0,1)}}return{call(e,n,a){let l=++s,u=o()+n,d=null,f=0,m=0;try{for(;;){Atomics.store(r,0,1);let n=m===0?{type:_,id:l,req:e}:{type:g,id:l,offset:m};try{t.postMessage(n)}catch{throw $(`EIO`,a)}c(l,u,a);let o=Atomics.load(r,3),s=Atomics.load(r,4);if(Atomics.load(r,5)!==m||s<0||o<0||m+s>o)throw $(`EIO`,a);if(d===null&&(f=Atomics.load(r,2),d=new Uint8Array(o)),d.set(i.subarray(0,s),m),m+=s,m>=o)break;if(s===0)throw $(`EIO`,a)}}finally{Atomics.store(r,0,0)}return p(f,d)}}}function ic(e,t){return $(e,`sync-sab bridge, '${t}'`)}function ac(e){let t=e;return!!t&&typeof t.isFile==`boolean`&&typeof t.isDirectory==`boolean`&&typeof t.size==`number`}function oc(e,t={}){let n=t.timeoutMs??25e3;function r(t,r){let i=e.call(t,n,`sync-sab bridge, '${r}'`);if(!i.ok)throw ic(i.errno,r);return i}function i(e,t){let n=r(e,t);if(n.ok&&n.kind===`bytes`)return n.bytes;throw ic(`EIO`,t)}function a(e,t){let n=r(e,t);if(n.ok&&n.kind===`json`)return n.json;throw ic(`EIO`,t)}return{readFile:e=>i({op:`read`,path:e},e),writeFile:(e,t)=>{r({op:`write`,path:e,body:t},e)},stat:e=>{let t=a({op:`stat`,path:e},e);if(!ac(t))throw ic(`EIO`,e);return t},lstat:e=>{let t=a({op:`lstat`,path:e},e);if(!ac(t))throw ic(`EIO`,e);return t},readdir:e=>{let t=a({op:`readdir`,path:e},e);if(!Array.isArray(t)||!t.every(e=>typeof e==`string`))throw ic(`EIO`,e);return t},exists:e=>{let t=a({op:`exists`,path:e},e);if(typeof t!=`boolean`)throw ic(`EIO`,e);return t},mkdir:e=>{r({op:`mkdir`,path:e},e)},rm:e=>{r({op:`rm`,path:e},e)}}}function sc(e){return(t,n,r)=>{let i=e.call({...t,channel:d},n+u,r);if(!i.ok)throw $(i.errno,r);let a=i.kind===`json`?i.json:null;if(!a||typeof a.stdout!=`string`||typeof a.stderr!=`string`||typeof a.exitCode!=`number`)throw $(`EIO`,r);return{stdout:a.stdout,stderr:a.stderr,exitCode:a.exitCode}}}async function cc(e,t,n){let r;try{r=await e.call(`vfs`,`snapshot`,[t])}catch(e){n?.(e instanceof Error?e.message:String(e)),r={entries:[]}}return new ne(r)}function lc(e,t){if(e.syncFsToken)return e=>t(`[sync-fs] snapshot failed, sync metadata will be incomplete: ${e}\n`)}function uc(e,t){return t?oc(t):e.syncFsToken?nc(e.syncFsToken):void 0}function dc(e,t){if(!(!e.syncSab||typeof Atomics>`u`||typeof Atomics.wait!=`function`))return rc(e.syncSab,t)}function fc(e,t,n,r,i){let a=dc(e,t),o=uc(e,a);if(Object.assign(r,Ce(n,e.cwd,o,i,{write:(e,n)=>{t.postMessage({type:`realm-fs-write`,path:e,bytes:n})},delete:e=>{t.postMessage({type:`realm-fs-delete`,path:e})}})),e.syncFsToken)return $s(e.syncFsToken,{syncFs:n,...o?{fsBridge:o}:{},...a?{transport:sc(a)}:{}})}function pc(e=globalThis){Object.prototype.hasOwnProperty.call(e,`SLICC_VERSION`)||Object.defineProperty(e,"SLICC_VERSION",{value:i().version,writable:!1,enumerable:!1,configurable:!1})}function mc(e,t,n){let r=Te({isTTY:!e,noColor:e});return{colorApi:r,cliApi:we({writeStdout:t,writeStderr:n,exit:e=>{throw new Ja(e)},color:r})}}function hc(e,t,n){return{readStdinBytes:()=>ie(e.stdin??``),writeStdout:t,writeStderr:n}}function gc(e){return{usbBridge:Bs(e),serialBridge:Ls(e),hidBridge:gs(e)}}async function _c(e,t){let n=[],r=[],i=(e,n,r)=>{let i=typeof r==`string`?r:String(r);n.push(i),t.postMessage({type:`realm-output`,stream:e,chunk:i})},a=e=>{i(`stdout`,n,e)},o=e=>{i(`stderr`,r,e)},s=go(a,o),l=_o(e,a,o),{colorApi:u,cliApi:d}=mc(!!e.env?.NO_COLOR,a,o),f=new c(t),p=hc(e,a,o),m=he(f,T,p),h=await cc(f,e.cwd,lc(e,o)),g=fc(e,t,h,m,p),_=rs(f,h,e.cwd,o),v=qo(_,{cwd:e.cwd}),y=Gs({argv:e.argv,fs:m,exec:_}),b=Qo(f),{usbBridge:x,serialBridge:S,hidBridge:C}=gc(f),w=Wo({fetch:T});async function T(e,t){let n=e instanceof Request?e.url:e instanceof URL?e.toString():String(e);return os(await f.call(`fetch`,`request`,[n,await Xo(t,e)]),n)}let E=Cs({exec:_,agent:v,skill:y,http:w,browser:b,usb:x,serial:S,hid:C,cli:d,color:u}),D=e.filename,O=qa(D),k=await Es(f,e.code,e.cwd,D),ee=ks({graph:k,fsBridge:m,processShim:l.processShim,childProcess:kt(_,g),nodeConsole:s,sliccyModules:E,shimmedPackages:Os(f),nodeReadline:To({output:{write:a},onExit:l.recordExit}),nodeOsModule:bn(e.env),nodeUtilModule:gt(e=>o(`${e}\n`))}).require,te={exports:{},filename:e.filename},ne=k.entrySource!==void 0;await vc({entryCode:k.entrySource??e.code,isEsmEntry:ne,filename:D,dirname:O,proc:l,nodeConsole:s,requireShim:ee,moduleShim:te,realmFetch:T,writeStderr:o,rpc:f,syncFs:h,stdoutChunks:n,stderrChunks:r,port:t})}async function vc(e){let t=globalThis;pc(),t.__slicc_compileWasm=t=>e.rpc.call(`wasm`,`compile`,[t]);let n=Rs(globalThis,{onCallbackError(e){if(!(e instanceof Ja))throw e}}),{createBodyReadHandleTracker:r}=await import(`./realm-body-handles-DtLxL_rB.js`),i=r(globalThis);n.install(),i.install();try{let r=await yc({entryCode:e.entryCode,bridges:{process:e.proc.processShim,console:e.nodeConsole,require:e.requireShim,module:e.moduleShim,exports:e.moduleShim.exports,fetch:e.realmFetch,__dirname:e.dirname,__filename:e.filename},writeStderr:e.writeStderr,isEsmEntry:e.isEsmEntry,rpc:e.rpc,syncFs:e.syncFs,proc:e.proc,timers:n,bodyReads:i});delete t.__slicc_compileWasm,e.rpc.dispose(),e.port.postMessage({type:`realm-done`,stdout:e.stdoutChunks.join(``),stderr:e.stderrChunks.join(``),exitCode:r})}finally{n.clearPending(),n.restore(),i.restore()}}async function yc(e){let t=await Fs(e.entryCode,e.bridges,e.writeStderr,e.isEsmEntry);return await bc(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()?(e.timers.clearPending(),e.proc.getExitCode()):(await xc(e.rpc,e.timers,e.bodyReads,e.proc),e.proc.getDidCallProcessExit()&&e.timers.clearPending(),await bc(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()||t===0?e.proc.getExitCode():t)}async function bc(e,t,n){let r=t.getMutations();if(r.created.length||r.modified.length||r.deleted.length)try{await e.call(`vfs`,`flushWrites`,[r]),t.resetBaseline()}catch(e){let t=e instanceof Error?e.message:String(e);n(`[sync-fs] ERROR: flush failed — ${r.created.length+r.modified.length} write(s) + ${r.deleted.length} delete(s) were NOT persisted: ${t}\n`)}}async function xc(e,t,n,r){for(await t.tick();!r.getDidCallProcessExit()&&(e.pendingCount>0||t.pendingCount>0||n.pendingCount>0);){let i=[];if(e.pendingCount>0&&i.push(e.waitForProgress()),t.pendingCount>0&&i.push(t.waitForProgress()),n.pendingCount>0&&i.push(n.waitForProgress()),i.length===0)break;await Promise.race(i),r.getDidCallProcessExit()||await t.tick()}}function Sc(){let e=new Set,t=new Set;return{realmSide:{postMessage:e=>{queueMicrotask(()=>{for(let n of[...t])n({data:e})})},addEventListener:(t,n)=>{e.add(n)},removeEventListener:(t,n)=>{e.delete(n)}},hostSide:{postMessage:t=>{queueMicrotask(()=>{for(let n of[...e])n({data:t})})},addEventListener:(e,n)=>{t.add(n)},removeEventListener:(e,n)=>{t.delete(n)}}}}function Cc(){return async({kind:e})=>{if(e!==`js`)throw Error(`createInProcessJsRealmFactory: only kind:js is supported`);let{realmSide:t,hostSide:n}=Sc(),r=e=>{if(e.data?.type!==`realm-init`)return;t.removeEventListener(`message`,r);let n=e.data;n.kind===`js`&&_c(n,t).catch(e=>{let n={type:`realm-error`,message:e instanceof Error?e.message:String(e)};t.postMessage(n)})};return t.addEventListener(`message`,r),{controlPort:n,terminate(){t.removeEventListener(`message`,r)}}}}function wc(){return async({kind:e})=>{if(e!==`py`)throw Error(`createInProcessPyRealmFactory: only kind:py is supported`);let{realmSide:t,hostSide:n}=Sc(),r=e=>{if(e.data?.type!==`realm-init`)return;t.removeEventListener(`message`,r);let n=e.data;n.kind===`py`&&a(n,t).catch(e=>{let n={type:`realm-error`,message:e instanceof Error?e.message:String(e)};t.postMessage(n)})};return t.addEventListener(`message`,r),{controlPort:n,terminate(){t.removeEventListener(`message`,r)}}}}export{Cc as createInProcessJsRealmFactory,wc as createInProcessPyRealmFactory};
@@ -1 +0,0 @@
1
- import{t as e}from"./slugify-BYJ6QVAt.js";import{n as t}from"./path-utils-DNJG-zQf.js";const n=`shared-readonly`,r=[`private`,`shared-readonly`],i=[`snapshot`,`shared-live`];[...r,...i];function a(e){return r.includes(e)}function o(e){return Error(`Workspace isolation mode '${e}' is not implemented. Use 'private' or 'shared-readonly'. Copy-on-write snapshots are deferred (RFC open question 4).`)}function s(e){return e===void 0||e===``?{ok:!0,mode:n}:a(e)?{ok:!0,mode:e}:e===`snapshot`||e===`shared-live`?{ok:!1,error:o(e).message}:{ok:!1,error:`Unknown workspace isolation mode '${e}'. Use 'private' or 'shared-readonly' (snapshot and shared-live are not implemented).`}}function c(e){let t=s(e);if(!t.ok)throw Error(t.error);return t.mode}function l(e){switch(e){case`private`:return 0;case`shared-readonly`:return 1;case`snapshot`:return 2;case`shared-live`:return 3}}function u(e){return e!==`private`}function d(e){return e.parentJid===null}function f(){return{filesystem:{kind:`full-workspace`},canCreateChildren:!0,canManageChildren:!0,canWriteSharedMemory:!0,canResolveApprovals:!0,approvalAuthority:`user`,sudoDefaultDisposition:`allow`,persistCommandGrants:!0}}function p(e,t={}){let n=t.canCreateChildren===!0;return{filesystem:{kind:`restricted`,mode:t.mode??`shared-readonly`,writablePaths:[...t.writablePaths??[]],visiblePaths:[...t.visiblePaths??[]]},...t.allowedCommands===void 0?{}:{allowedCommands:[...t.allowedCommands]},canCreateChildren:n,canManageChildren:n,canWriteSharedMemory:!1,canResolveApprovals:t.approvesGuestRequests===!0,approvalAuthority:{parentId:e},sudoDefaultDisposition:`require-approval`,persistCommandGrants:!1}}function m(e){return e.parentJid===null?f():p(e.parentJid,{writablePaths:e.config?.writablePaths,visiblePaths:e.config?.visiblePaths,allowedCommands:e.config?.allowedCommands,mode:h(e.config?.workspaceMode),approvesGuestRequests:e.approvesGuestRequests===!0,canCreateChildren:e.config?.canCreateChildren===!0})}function h(e){if(e===`snapshot`||e===`shared-live`)return e;let t=s(e);return t.ok?t.mode:n}function g(e){return e.parentJid===null?{mode:`interactive`}:e.notifyOnComplete===!1?{mode:`silent`}:{mode:`notify-parent`}}function _(e){return e.parentJid===null?`cascade`:e.onParentClose===`detach`?`detach`:`cascade`}const v=[`canCreateChildren`,`canManageChildren`,`canWriteSharedMemory`,`canResolveApprovals`,`persistCommandGrants`];function y(e){let n=t(e);return n.endsWith(`/`)?n:`${n}/`}function b(e,t){let n=y(e),r=y(t);return n===r||n.startsWith(r)}function x(e,t){return e.every(e=>t.some(t=>b(e,t)))}function S(e){return[...e.writablePaths,...e.visiblePaths]}function C(e){return e===void 0||e.includes(`*`)}function w(e,t){if(C(t))return!0;if(e===void 0||e.includes(`*`))return!1;let n=new Set(t);return e.every(e=>n.has(e))}function T(e,t){return e.kind===`full-workspace`?t.kind===`full-workspace`:t.kind===`full-workspace`||!(!x(e.writablePaths,t.writablePaths)||!x(e.visiblePaths,S(t)))}function E(e,t){for(let n of v)if(e[n]&&!t[n])return!1;return!(e.sudoDefaultDisposition===`allow`&&t.sudoDefaultDisposition!==`allow`||!T(e.filesystem,t.filesystem)||!w(e.allowedCommands,t.allowedCommands)||e.filesystem.kind===`restricted`&&t.filesystem.kind===`restricted`&&l(e.filesystem.mode)>l(t.filesystem.mode))}function D(e,t){let n=m(t);if(!E(m(e),n))throw Error(`Child policy of "${e.name}" is not a subset of parent ${t.jid} (isPolicySubset)`);if(!n.canCreateChildren)throw Error(`Work unit ${t.jid} cannot create children (policy.canCreateChildren is false)`)}function O(e,t){let n=[];for(let r of e)r.parentJid===t&&n.push(r);return n}function k(e,t){let n=new Set([t]);for(let t=0;t<e.length;t++){let t=!1;for(let r of e)n.has(r.jid)||r.parentJid!==null&&n.has(r.parentJid)&&(n.add(r.jid),t=!0);if(!t)break}return e.filter(e=>n.has(e.jid))}function A(e,t){if(!t?.parentJid)return;let n=new Map;for(let t of e)n.set(t.jid,t);let r=new Set,i=n.get(t.parentJid);for(;i&&!r.has(i.jid);){if(r.add(i.jid),i.parentJid===null||i.approvesGuestRequests===!0)return i;i=i.parentJid?n.get(i.parentJid):void 0}}function j(e,t){if(!t)return{kind:`dangling`};let n=new Map;for(let t of e)n.set(t.jid,t);let r=new Set,i=t;for(;i.parentJid!==null;){if(r.has(i.jid))return{kind:`cycle`};r.add(i.jid);let e=n.get(i.parentJid);if(!e)return{kind:`dangling`};i=e}return{kind:`root`,root:i}}function M(e,t){let n=j(e,t);return n.kind===`root`?n.root:void 0}function N(e){let t=[];for(let n of e)n.parentJid===null&&t.push(n);return t.sort((e,t)=>e.addedAt.localeCompare(t.addedAt)||e.jid.localeCompare(t.jid))}function P(e){return e.isCone===!0}function F(e){Z(e);let t=e;return delete t.isCone,delete t.type,d(e)&&(e.trigger=void 0,e.requiresTrigger=!1,e.assistantLabel=e.assistantLabel||`sliccy`,e.approvesGuestRequests=void 0,e.onParentClose=void 0),e}function I(e,t){let n=new Set(t);if(!n.has(e))return e;for(let t=2;t<=n.size+2;t++){let r=`${e}-${t}`;if(!n.has(r))return r}return`${e}-${n.size+3}`}const L=`cone`;function R(e){return`session-${e.folder}`}function z(e){return d(e)&&e.folder===`cone`}function B(e){let t=N(e);return t.find(e=>z(e))??t[0]}function V(t){return e(t,{maxLen:40,fallback:`cone`})}function H(e,t){let n=new Set;for(let e of t)n.add(e.folder);if(!n.has(`cone`))return L;let r=`cone-${V(e)}`;if(!n.has(r))return r;for(let e=2;;e++){let t=`${r}-${e}`;if(!n.has(t))return t}}function U(e){return d(e)?`cone`:`scoop`}function W(e){return d(e)?`cone`:e.name??e.folder}function G(e){if(e.model)return e.model;let t=e.config?.modelId,n=e.config?.modelProviderId;return t!==void 0&&n!==void 0?{provider:n,id:t}:void 0}function K(e){return e.model?.id??e.config?.modelId}function q(e){return e.model?.provider??e.config?.modelProviderId}function J(e){if(e.thinking)return e.thinking;let t=e.config?.thinkingLevel,n=e.config?.effortOverride;return t===void 0&&n===void 0?{}:{level:t,effortOverride:n}}function Y(e,t){return e.model=t?{provider:t.provider,id:t.id}:void 0,Q(e),e}function X(e,t){return e.thinking=t&&(t.level!==void 0||t.effortOverride!==void 0)?{level:t.level,effortOverride:t.effortOverride}:void 0,$(e),e}function Z(e){let t=e.config;t&&(!e.model&&t.modelId!==void 0&&t.modelProviderId!==void 0&&(e.model={provider:t.modelProviderId,id:t.modelId}),!e.thinking&&(t.thinkingLevel!==void 0||t.effortOverride!==void 0)&&(e.thinking={level:t.thinkingLevel,effortOverride:t.effortOverride}),e.model&&Q(e),e.thinking&&$(e))}function Q(e){if(!e.config||e.config.modelId===void 0&&e.config.modelProviderId===void 0)return;let{modelId:t,modelProviderId:n,...r}=e.config;e.config=r}function $(e){if(!e.config||e.config.thinkingLevel===void 0&&e.config.effortOverride===void 0)return;let{thinkingLevel:t,effortOverride:n,...r}=e.config;e.config=r}export{s as A,d as C,k as D,N as E,n as O,m as S,M as T,D as _,B as a,g as b,K as c,U as d,Y as f,I as g,J as h,z as i,c as j,u as k,q as l,W as m,R as n,P as o,X as p,H as r,G as s,L as t,F as u,A as v,j as w,_ as x,O as y};
@@ -1,91 +0,0 @@
1
- import{n as e,r as t}from"./panel-rpc-BPwAqRch.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l}from"./ffmpeg-wasm-B77gfnB_.js";import{t as u}from"./permissions-surface-registry-BqPdUk9w.js";import{ffmpegCoreFromEnv as d}from"./engine-BnH9pfmR.js";import{n as f,t as p}from"./extension-media-capture-BvLVZFQ0.js";async function m(e,t,n){let r=e;if(typeof r.getNativeFile==`function`)try{let e=await r.getNativeFile(t);if(e){let i=await g(e,t,n);if(await h(r,t,i,n))return i}}catch{}return _(await e.readFileBuffer(t))}async function h(e,t,n,r){if(typeof e.readFileRange!=`function`)return!0;let i,a;try{i=await e.readFileRange(t,0,64),a=(await e.stat(t)).size}catch{return!0}let o=new Uint8Array(await n.slice(0,64).arrayBuffer()),s=(a===void 0||a===n.size)&&o.byteLength===i.byteLength&&o.every((e,t)=>e===i[t]);return s||r?.(`ffmpeg: ${t}: native File (${n.size} bytes) does not match the VFS (${a??`?`} bytes, head differs=${o.byteLength!==i.byteLength||o.some((e,t)=>e!==i[t])}); reading it through the VFS instead`),s}async function g(e,t,n,r=e=>void structuredClone(e)){let i=``,a=e=>{try{return r(e),!0}catch(e){return i=e instanceof Error?`${e.name}: ${e.message}`:String(e),!1}};if(a(e))return e;let o=new Blob([e],{type:e.type});return a(o)?(n?.(`ffmpeg: ${t}: native File is not transferable to the worker (${v(e)}; ${i}); wrapped it in a Blob`),o):(n?.(`ffmpeg: ${t}: native File is not transferable to the worker and neither is a Blob over it; read ${e.size} bytes into memory instead`),new Blob([await e.arrayBuffer()],{type:e.type}))}function _(e){return new Blob([e])}function v(e){return`${e.constructor?.name??`unknown`}, instanceof File=${typeof File<`u`&&e instanceof File}, instanceof Blob=${e instanceof Blob}, size=${e.size}, type=${JSON.stringify(e.type)}`}let y=0;function b(){y=y+1>>>0;let e=`${y}_${Date.now().toString(36)}`;return{id:e,dir:`__in${e}`}}function x(e,t){return`${e.dir}/${t}`}function S(e){return e.slice(e.lastIndexOf(`/`)+1)}function C(e,t){return`__out${e.id}_${t.split(`/`).pop()||`out.bin`}`}async function w(e,t,n){n.length!==0&&(await e.createDir(`/${t.dir}`),await e.mount(`WORKERFS`,{blobs:n},`/${t.dir}`))}async function T(e,t){try{await e.unmount(`/${t.dir}`)}catch(e){if(s(e))throw e}try{await e.deleteDir(`/${t.dir}`)}catch(e){if(s(e))throw e}}async function E(e,t){try{await e.deleteFile(t)}catch(e){if(s(e))throw e}}function ee(){return{stdout:`ffmpeg - two engines behind the ffmpeg CLI
2
-
3
- Usage:
4
- ffmpeg [global-opts] -i input [input-opts] ... output [output-opts]
5
-
6
- Common flags pass through to ffmpeg unchanged. Inputs/outputs are
7
- resolved against the current VFS working directory.
8
-
9
- Engines (chosen automatically; stderr names the one that ran):
10
- mediabunny WebCodecs (hardware encoders, streams from disk, nothing
11
- to install). Takes one-input → one-output jobs whose
12
- every option it can express: remux, -c copy, transcode to
13
- h264/hevc/vp8/vp9/av1 + aac/opus/mp3/vorbis/flac/pcm,
14
- -ss/-t/-to, -vf crop,scale,fps (in that order; transpose
15
- only on its own), -s, -r/-g, -ac/-ar, -an/-vn,
16
- -b:v/-b:a/-crf/-q:a, -movflags, -metadata.
17
- Without an explicit -c, streams the container can hold are
18
- copied rather than re-encoded; an explicit encoder always
19
- re-encodes; -c copy never re-encodes (a codec the container
20
- cannot hold falls to the wasm core, which fails like ffmpeg).
21
- wasm @ffmpeg/core (ipk-installed; see -version). Everything
22
- else: lavfi sources, -f concat, filtergraphs, -f null
23
- analysis sinks, image/GIF output, codecs the browser lacks.
24
- FFMPEG_CORE=mt opts into @ffmpeg/core-mt on a cross-origin-
25
- isolated leader: multi-threaded, SINGLE-INPUT jobs only
26
- (multi-input deadlocks and is refused), -threads/-filter_threads
27
- capped unless you pass them.
28
- FFMPEG_ENGINE=wasm ffmpeg ... force byte-identical ffmpeg behaviour
29
- FFMPEG_ENGINE=mediabunny ffmpeg ... fail (and say why) instead of falling back
30
-
31
- Concatenating (concat demuxer):
32
- printf "file 'a.mp4'\\nfile 'b.mp4'\\n" > list.txt
33
- ffmpeg -f concat -safe 0 -i list.txt -c copy joined.mp4
34
-
35
- Files named inside the list are read from the VFS too, resolved
36
- against the LIST FILE's directory. As in ffmpeg, absolute and
37
- parent-traversing members need -safe 0. The \`concat:\` protocol
38
- form (-i "concat:a.ts|b.ts") is not supported — use -f concat.
39
-
40
- Webcam capture (avfoundation-style):
41
- ffmpeg -f avfoundation -video_size 1280x720 -framerate 30 \\
42
- -i "0" -frames:v 1 -update 1 -y photo.jpg
43
- ffmpeg -f avfoundation -i "0" -t 5 clip.webm
44
- ffmpeg -f avfoundation -i "0:0" -t 5 clip.webm # video + audio
45
- ffmpeg -f avfoundation -i ":0" -t 5 audio.webm # audio only
46
- ffmpeg -f avfoundation -list_devices true -i "" # list devices
47
-
48
- Avfoundation-specific options:
49
- -warmup MS Photo mode: ms to wait for auto-exposure to settle
50
- before grabbing the frame. Default 1500. Pass 0 to
51
- capture immediately (will look dark / noisy on most
52
- webcams because the AE algorithm hasn't converged).
53
- -exact_size Use exact:{w,h,frameRate} constraints rather than
54
- ideal:. Falls back to ideal: with a warning if the
55
- camera can't deliver the requested mode.
56
-
57
- Captured streams can be transcoded through the WASM core in the same
58
- invocation. Output options like -c:v, -c:a, -crf, -preset, -pix_fmt,
59
- -vf, -b:v, -b:a, and a mismatched output extension all trigger a
60
- post-capture wasm pass so the produced file matches what the user asked
61
- for (e.g. real H.264 mp4 instead of webm bytes in a .mp4 wrapper).
62
-
63
- Analysis sinks (no output file — results are on stderr):
64
- ffmpeg -i in.mp4 -af silencedetect=noise=-30dB:d=0.5 -f null -
65
- ffmpeg -i in.mp4 -af loudnorm=print_format=json -f null /dev/null
66
- ffmpeg -i in.mp4 -af loudnorm /dev/null
67
- With output \`-\` or \`/dev/null\`, the wrapper skips VFS writeback
68
- and returns the core log (filter measurements) on stderr. \`-\`
69
- requires \`-f null\` (stdout is not emulated). Bare \`/dev/null\`
70
- is accepted and gets \`-f null\` injected (MEMFS has no /dev/null).
71
-
72
- Notes:
73
- - The wasm engine needs an ipk-installed core: \`ipk add -g @ffmpeg/core@<pinned>\`
74
- (\`@ffmpeg/core-mt\` for the FFMPEG_CORE=mt opt-in); \`ffmpeg -version\`
75
- prints which one is loaded. Inputs are mounted lazily (never copied into
76
- the wasm heap); only the output is buffered.
77
- - The browser will prompt for camera/mic permission on first capture.
78
- - Numeric -i values index into the per-kind enumerateDevices() list,
79
- matching ffmpeg's native avfoundation device numbering on macOS.
80
- `,stderr:``,exitCode:0}}async function D(e){let t=d(e.env)===`mt`,n=await a(W(e),void 0,t);return n?{stdout:`ffmpeg (wasm via @ffmpeg/ffmpeg)\ncore: ${c(n)}\n`,stderr:``,exitCode:0}:{stdout:``,stderr:`ffmpeg: ${i(t)}\n`,exitCode:1}}function O(e){if(!e.includes(`:`))return{video:e};let t=e.indexOf(`:`),n=e.slice(0,t),r=e.slice(t+1);return{...n?{video:n}:{},...r?{audio:r}:{}}}const k=new Set(`-f.-safe.-i.-c.-c:v.-c:a.-vf.-af.-filter:v.-filter:a.-filter_complex.-r.-b:v.-b:a.-s.-t.-ss.-to.-pix_fmt.-vcodec.-acodec.-ar.-ac.-frames:v.-frames:a.-q:v.-q:a.-crf.-preset.-tune.-movflags.-map.-metadata.-loglevel.-threads.-video_size.-framerate.-pixel_format.-update.-list_devices.-warmup.-bsf.-bsf:v.-bsf:a.-profile:v.-level.-g.-keyint_min.-sc_threshold.-max_muxing_queue_size.-fflags.-avoid_negative_ts.-start_number.-strict.-vsync.-fps_mode.-async.-disposition.-map_metadata.-c:s.-scodec.-ab.-aspect`.split(`.`)),A=new Set(`-y.-n.-vn.-an.-sn.-dn.-re.-stats.-nostats.-nostdin.-shortest.-copyts.-hide_banner.-autorotate.-noautorotate.-ignore_unknown.-exact_size.-bitexact.-xerror.-benchmark.-benchmark_all.-dump.-hex.-stdin.-noautoscale.-accurate_seek.-noaccurate_seek.-fix_sub_duration.-recast_media`.split(`.`));function te(){return{inputs:[],outputOpts:[],outputPath:null,listDevices:!1,exactSize:!1,pendingOpts:[]}}function j(e,t,n){let r=e[t+1];if(typeof r!=`string`)throw Error(`ffmpeg: ${n} requires a value`);return r}function ne(e,t,n){let r=j(t,n,`-i`);return e.inputs.push({path:r,format:e.pendingFormat,videoSize:e.pendingVideoSize,frameRate:e.pendingFrameRate,raw:[...e.pendingOpts,`-i`,r]}),e.pendingFormat=void 0,e.pendingVideoSize=void 0,e.pendingFrameRate=void 0,e.pendingOpts=[],n+2}function re(e,t,n){let r=j(t,n,`-video_size`),i=/^(\d+)x(\d+)$/.exec(r);return i&&(e.pendingVideoSize={width:parseInt(i[1],10),height:parseInt(i[2],10)}),e.pendingOpts.push(`-video_size`,r),n+2}function ie(e,t,n){let r=j(t,n,`-framerate`),i=parseFloat(r);return Number.isNaN(i)||(e.pendingFrameRate=i),e.pendingOpts.push(`-framerate`,r),n+2}function M(e,t,n){let r=j(t,n,`-list_devices`);return/^(true|1|yes)$/i.test(r)&&(e.listDevices=!0),e.pendingOpts.push(`-list_devices`,r),n+2}function N(e,t,n){let r=j(t,n,`-warmup`),i=parseInt(r,10);return!Number.isNaN(i)&&i>=0&&(e.warmupMs=i),n+2}function P(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(!t.startsWith(`-`)||t===`-`)return!0;k.has(t)&&(n+=1)}return!1}function F(e,t){let n=e[t+1];return typeof n!=`string`||n.startsWith(`-`)?!1:P(e,t+2)}function I(e,t,n,r){if(k.has(r)){let i=j(t,n,r);return e.pendingOpts.push(r,i),n+2}return!A.has(r)&&F(t,n)?(e.pendingOpts.push(r,t[n+1]),n+2):(e.pendingOpts.push(r),n+1)}function L(e,t,n){return e.outputPath=t,e.outputOpts=e.pendingOpts,e.pendingOpts=[],n+1}function R(e){let t=te(),n=0;for(;n<e.length;){let r=e[n];if(r===`-i`){n=ne(t,e,n);continue}if(r===`-f`){let r=j(e,n,`-f`);t.pendingFormat=r,t.pendingOpts.push(`-f`,r),n+=2;continue}if(r===`-video_size`){n=re(t,e,n);continue}if(r===`-framerate`){n=ie(t,e,n);continue}if(r===`-list_devices`){n=M(t,e,n);continue}if(r===`-warmup`){n=N(t,e,n);continue}if(r===`-exact_size`){t.exactSize=!0,n+=1;continue}if(r===`-`&&V(t.pendingOpts)){n=L(t,r,n);continue}if(r.startsWith(`-`)){n=I(t,e,n,r);continue}n=L(t,r,n)}return{inputs:t.inputs,outputOpts:t.outputOpts,outputPath:t.outputPath,listDevices:t.listDevices,...t.warmupMs===void 0?{}:{warmupMs:t.warmupMs},exactSize:t.exactSize}}function z(e){return e.inputs.some(e=>e.format===`avfoundation`)}const B=new Set([`-`,`/dev/null`]);function V(e){for(let t=0;t<e.length-1;t++)if(e[t]===`-f`&&e[t+1]===`null`)return!0;return!1}function H(e){let t=e.outputPath;return t===null||!B.has(t)?!1:t===`/dev/null`||V(e.outputOpts)}function U(e){return V(e)?e:[...e,`-f`,`null`]}function W(e){return{reader:{exists:t=>e.fs.exists(t),isDirectory:async t=>{try{return(await e.fs.stat(t)).isDirectory}catch{return!1}},readFile:t=>e.fs.readFile(t)},readBytes:t=>e.fs.readFileBuffer(t),fromDir:e.cwd}}function G(e){let t=[];return(e.mode===`photo`||e.captureVideo!==!1)&&t.push(`camera`),e.mode===`video`&&e.captureAudio&&t.push(`microphone`),t}function K(e){return e.length===0?`media devices`:e.length===1?e[0]:`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`}function q(e){for(let t of e){let e=t.stream;if(e)for(let t of e.getTracks())t.stop()}}async function J(e,t){let n=u();if(!n)return null;try{let r=await n.prompt({kinds:e,description:t,skipIfGranted:!0});if(q(r.grants),r.status===`granted`)return{ok:!0};let i=r.message?`: ${r.message}`:``;return{ok:!1,message:`${r.reason??r.status}${i}`}}catch{return null}}async function Y(t){if(t.length===0)return{ok:!0};let n=`ffmpeg is requesting access to your ${K(t)}.`,r=await J(t,n);if(r)return r;let i=e();if(i)try{return await i.call(`permission-request`,{kinds:t,description:n,skipIfGranted:!0},{timeoutMs:3e5}),{ok:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return/permission surface unavailable/i.test(t)?{ok:!0}:{ok:!1,message:t}}return{ok:!0}}function ae(e){let t=e.inputs.find(e=>e.format===`avfoundation`);if(!t)throw Error(`ffmpeg: no avfoundation input found`);if(!e.outputPath)throw Error(`ffmpeg: output path is required`);let n=e.outputOpts.indexOf(`-frames:v`),r=n>=0&&e.outputOpts[n+1]===`1`,i=e.outputOpts.indexOf(`-update`),a=i>=0&&e.outputOpts[i+1]===`1`,o=e.outputOpts.indexOf(`-t`),s=o>=0?parseFloat(e.outputOpts[o+1]):NaN,c=O(t.path),l=oe(e.outputPath),u=/^image\//.test(l),d=!c.video&&!!c.audio;if(!d&&(r||a||u)){let n=u&&/^image\/(jpeg|png|webp)$/.test(l)?l:`image/jpeg`;return{outputPath:e.outputPath,captureMime:n,needsTranscode:X(e.outputOpts,`photo`)||n!==l,request:{mode:`photo`,deviceId:c.video,width:t.videoSize?.width,height:t.videoSize?.height,frameRate:t.frameRate,exactSize:e.exactSize,mimeType:n,quality:.92,...e.warmupMs===void 0?{}:{warmupMs:e.warmupMs}}}}let f=d||!!c.audio,p=`video/webm`;return{outputPath:e.outputPath,captureMime:p,needsTranscode:X(e.outputOpts,`video`)||p!==l,request:{mode:`video`,deviceId:c.video,captureVideo:!d,...f?{captureAudio:!0}:{},...c.audio?{audioDeviceId:c.audio}:{},width:t.videoSize?.width,height:t.videoSize?.height,frameRate:t.frameRate,exactSize:e.exactSize,mimeType:p,durationMs:Number.isFinite(s)?s*1e3:void 0}}}function X(e,t){let n=t===`photo`?new Set([`-vf`,`-filter:v`,`-filter_complex`,`-pix_fmt`,`-q:v`,`-vcodec`,`-c:v`]):new Set([`-c`,`-c:v`,`-c:a`,`-vcodec`,`-acodec`,`-vf`,`-af`,`-filter:v`,`-filter:a`,`-filter_complex`,`-pix_fmt`,`-pixel_format`,`-crf`,`-preset`,`-tune`,`-b:v`,`-b:a`,`-ar`,`-ac`,`-q:v`,`-q:a`,`-movflags`,`-r`]);return e.some(e=>n.has(e))}function oe(e){let t=e.toLowerCase();return t.endsWith(`.jpg`)||t.endsWith(`.jpeg`)?`image/jpeg`:t.endsWith(`.png`)?`image/png`:t.endsWith(`.webp`)?`image/webp`:t.endsWith(`.gif`)?`image/gif`:t.endsWith(`.webm`)?`video/webm`:t.endsWith(`.mp4`)?`video/mp4`:t.endsWith(`.mov`)?`video/quicktime`:t.endsWith(`.mkv`)?`video/x-matroska`:t.endsWith(`.m4a`)?`audio/mp4`:t.endsWith(`.mp3`)?`audio/mpeg`:t.endsWith(`.wav`)?`audio/wav`:t.endsWith(`.ogg`)?`audio/ogg`:`application/octet-stream`}function se(e){return e===`image/jpeg`?`jpg`:e===`image/png`?`png`:e===`image/webp`?`webp`:e===`video/webm`?`webm`:e===`video/mp4`?`mp4`:e===`audio/webm`?`webm`:`bin`}function ce(e,t){let n=e.path.lastIndexOf(`/`),r=n>=0?e.path.slice(n+1):e.path;return r?`__in${t}_${r}`:`__in${t}.bin`}async function le(e,t){if(e.length===0||e.includes(`--help`))return ee();if(e.includes(`-version`)||e.includes(`--version`))return D(t);let n;try{n=R(e)}catch(e){return{stdout:``,stderr:`${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}return n.listDevices&&z(n)?ue():n.outputPath?n.inputs.length===0?{stdout:``,stderr:`ffmpeg: at least one input file must be specified
81
- `,exitCode:1}:z(n)?ge(n,t):Re(n,t):{stdout:``,stderr:`ffmpeg: at least one output file must be specified
82
- `,exitCode:1}}async function ue(){let e;try{e=await de()}catch(e){return{stdout:``,stderr:`ffmpeg: failed to enumerate devices: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}let t=[];return t.push(`[AVFoundation indev @ 0x0] AVFoundation video devices:`),e.videoinputs.length===0?t.push(`[AVFoundation indev @ 0x0] (none)`):e.videoinputs.forEach((e,n)=>{t.push(`[AVFoundation indev @ 0x0] [${n}] ${e.label||`Camera ${n}`}`)}),t.push(`[AVFoundation indev @ 0x0] AVFoundation audio devices:`),e.audioinputs.length===0?t.push(`[AVFoundation indev @ 0x0] (none)`):e.audioinputs.forEach((e,n)=>{t.push(`[AVFoundation indev @ 0x0] [${n}] ${e.label||`Microphone ${n}`}`)}),{stdout:``,stderr:`${t.join(`
83
- `)}\n`,exitCode:0}}async function de(){if(t()&&typeof navigator<`u`&&navigator.mediaDevices?.enumerateDevices){let e=await navigator.mediaDevices.enumerateDevices(),t=e=>({deviceId:e.deviceId,label:e.label||``,...e.groupId?{groupId:e.groupId}:{}});return{videoinputs:e.filter(e=>e.kind===`videoinput`).map(t),audioinputs:e.filter(e=>e.kind===`audioinput`).map(t)}}let n=e();if(!n)throw Error(`device enumeration requires a browser context`);return n.call(`enumerate-media-devices`,void 0,{timeoutMs:1e4})}async function fe(e){let t=await p({kind:`camera`,...e.request}),n=new ArrayBuffer(t.bytes.byteLength);return new Uint8Array(n).set(t.bytes),{bytes:n,mimeType:t.mimeType,width:t.width,height:t.height,...t.durationMs===void 0?{}:{durationMs:t.durationMs}}}async function pe(t){let n=e();if(!n)return null;let r=await n.call(`capture-camera`,t.request,{timeoutMs:3e5});return{bytes:r.bytes,mimeType:r.mimeType,width:r.width,height:r.height,durationMs:r.durationMs}}async function me(e){try{if(f())return{result:await fe(e)};let t=await pe(e);return t?{result:t}:{error:{stdout:``,stderr:`ffmpeg: camera capture requires a browser context — not available in this runtime
84
- `,exitCode:1}}}catch(e){return{error:{stdout:``,stderr:he(e),exitCode:1}}}}function he(e){let t=e instanceof Error?e.message:String(e);return/NotAllowedError|Permission denied/i.test(t)?`ffmpeg: camera permission denied
85
- `:/NotFoundError/i.test(t)?`ffmpeg: no camera device found
86
- `:`ffmpeg: ${t}\n`}async function ge(e,t){let n;try{n=ae(e)}catch(e){return{stdout:``,stderr:`${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}let r=await Y(G(n.request));if(!r.ok)return{stdout:``,stderr:`ffmpeg: camera permission denied (${r.message})\n`,exitCode:1};let i=await me(n);if(`error`in i)return i.error;let a=i.result,o=Math.round(a.bytes.byteLength/1024),s=`${a.width}x${a.height}`,c=n.request.mode===`video`&&a.durationMs?`${s}, ${Math.round(a.durationMs)}ms`:s,l=new Uint8Array(a.bytes),u=``;if(n.needsTranscode)try{let r=await _e({bytes:l,captureMime:n.captureMime,outputName:n.outputPath,outputOpts:e.outputOpts,ipk:W(t),onLog:e=>{u+=`${e}\n`}});l=new Uint8Array(r.byteLength),l.set(r)}catch(e){let t=e instanceof Error?e.message:String(e);return{stdout:``,stderr:`${u}ffmpeg: captured ${c} (${o} KB) but transcode failed: ${t}\n`,exitCode:1}}let d=t.fs.resolvePath(t.cwd,n.outputPath);try{await t.fs.writeFile(d,l)}catch(e){return{stdout:``,stderr:`ffmpeg: failed to write ${n.outputPath}: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}let f=Math.round(l.byteLength/1024),p=n.needsTranscode?`${o} KB → ${f} KB`:`${o} KB`;return{stdout:``,stderr:`${u}ffmpeg: captured ${c} (${p}) to ${n.outputPath}\n`,exitCode:0}}async function _e(e){let t=b(),i=`capture.${se(e.captureMime)}`,a=x(t,i),o=C(t,e.outputName);e.onLog(`transcoding captured stream...`);let c=await n({onProgress:e.onLog,ipk:e.ipk}),l=t=>{e.onLog(t.message)};c.on(`log`,l);let u=!1;try{await w(c,t,[{name:i,data:_(e.bytes)}]);let n=[`-i`,a,...e.outputOpts,o],r=await c.exec(n);if(r!==0)throw Error(`ffmpeg-core exited with code ${r}`);let s=await c.readFile(o);if(s instanceof Uint8Array)return s;if(typeof s==`string`)return new TextEncoder().encode(s);throw Error(`ffmpeg-core returned an unknown payload type`)}catch(e){throw s(e)&&(u=!0,r(c)),e}finally{try{c.off(`log`,l)}catch{}if(!u)try{await T(c,t),await E(c,o)}catch{}}}function ve(e){return e.format===`concat`}function ye(e){return e.split(`
87
- `).map(e=>{let t=e.trim();if(!t.startsWith(`file `))return{raw:e};let n=be(t.slice(4).trim());return n?{raw:e,file:n}:{raw:e}})}function be(e){let t=e[0];if(t!==`'`&&t!==`"`)return e.replace(/\\(.)/g,`$1`);let n=``;for(let r=1;r<e.length;r++){let i=e[r];if(i===`\\`&&t===`"`&&r+1<e.length){n+=e[r+1],r+=1;continue}if(i!==t){n+=i;continue}if(t===`'`&&e.slice(r,r+4)===`'\\''`){n+=`'`,r+=3;continue}return n}return n}function xe(e,t,n){return`__cat${t}_${n}_${e.slice(e.lastIndexOf(`/`)+1).replace(/[^A-Za-z0-9._-]/g,`_`)||`part.bin`}`}function Se(e){return e.startsWith(`/`)||/^[A-Za-z]:/.test(e)?!1:!e.split(`/`).includes(`..`)}function Ce(e){let t=e.raw.lastIndexOf(`-safe`);if(t<0)return!0;let n=e.raw[t+1];return!(n===`0`||n?.startsWith(`-`))}async function we(e,t,n,r,i,a,o){let s=ye(new TextDecoder().decode(t)),c=e.slice(0,e.lastIndexOf(`/`))||`/`,l=[],u=[];for(let e of s){if(e.file===void 0){u.push(e.raw);continue}if(r&&!Se(e.file))return{error:{kind:`unsafe`,file:e.file}};let t=a.fs.resolvePath(c,e.file);if(!await a.fs.exists(t))return{error:{kind:`missing`,file:e.file}};let s=x(i,xe(e.file,n,l.length));l.push({ffmpegName:s,data:await m(a.fs,t,o)}),u.push(`file '${s}'`)}return{listBytes:new TextEncoder().encode(u.join(`
88
- `)),extraFiles:l}}function Te(e){return e.format===`lavfi`}async function Ee(e,t,n,r=()=>{}){let i=[];for(let[a,o]of e.inputs.entries()){if(Te(o)){i.push({ffmpegName:o.path,data:null,virtual:!0});continue}let e=n.fs.resolvePath(n.cwd,o.path);if(!await n.fs.exists(e))return{error:{stdout:``,stderr:`ffmpeg: input file not found: ${o.path}\n`,exitCode:1}};let s=x(t,ce(o,a));if(ve(o)){let c=await we(e,await n.fs.readFileBuffer(e),a,Ce(o),t,n,r);if(`error`in c){let{kind:e,file:t}=c.error,n=e===`unsafe`?`unsafe file name: ${t} (pass -safe 0 to allow it)`:`file not found: ${t}`;return{error:{stdout:``,stderr:`ffmpeg: concat list ${o.path}: ${n}\n`,exitCode:1}}}i.push({ffmpegName:s,data:_(c.listBytes),virtual:!1,extraFiles:c.extraFiles});continue}i.push({ffmpegName:s,data:await m(n.fs,e,r),virtual:!1})}return{inputs:i}}const De={threads:8,filterThreads:2};function Z(e){return e.some(e=>e===`-threads`||e.startsWith(`-threads:`))}function Oe(e,t=De,n=typeof navigator<`u`?navigator.hardwareConcurrency:void 0){let r=String(Math.max(1,Math.min(t.threads,n??t.threads))),i=[...e.inputs.flatMap(e=>e.raw),...e.outputOpts],a=[];i.includes(`-filter_threads`)||a.push(`-filter_threads`,String(t.filterThreads)),i.includes(`-filter_complex_threads`)||a.push(`-filter_complex_threads`,String(t.filterThreads));let o=e.inputs.map((e,t)=>{let n=[...t===0?a:[],...Z(e.raw)?[]:[`-threads`,r]];return n.length>0?{...e,raw:[...n,...e.raw]}:e}),s=Z(e.outputOpts)?e.outputOpts:[`-threads`,r,...e.outputOpts];return{...e,inputs:o,outputOpts:s}}function Q(e){return{stdout:``,stderr:`${e}ffmpeg: the multi-threaded core deadlocks with more than one input (ffmpeg starts a demux thread per input; emscripten proxies their pthread_create to a main thread blocked in exec; see #2810). Run without FFMPEG_CORE=mt so the single-threaded @ffmpeg/core handles this job.
89
- `,exitCode:1}}function ke(e,t,n){let r=[];for(let[n,i]of e.inputs.entries()){let e=t[n],a=i.raw;for(let t=0;t<a.length;t++){if(a[t]===`-i`){r.push(`-i`,e.virtual?a[t+1]:e.ffmpegName),t+=1;continue}r.push(a[t])}}return r.push(...e.outputOpts),r.push(n),r}function Ae(e){let t=[];for(let n of e)if(n.data!==null){for(let e of n.extraFiles??[])t.push({name:S(e.ffmpegName),data:e.data});t.push({name:S(n.ffmpegName),data:n.data})}return t}async function je(e){let t=`__health_probe`;try{await e.writeFile(t,new Uint8Array([0])),await e.deleteFile(t)}catch(e){if(s(e))throw e}}async function Me(e,t,n){await T(e,t),await E(e,n)}async function Ne(e,t,n,r){let i;try{i=await e.readFile(t)}catch(e){if(s(e))throw e;return{error:{stdout:``,stderr:r()||`ffmpeg: produced no output file for ${n}\n`,exitCode:1}}}let a=i instanceof Uint8Array?i:new TextEncoder().encode(typeof i==`string`?i:``);return a.byteLength===0?{error:{stdout:``,stderr:r()||`ffmpeg: produced an empty output file for ${n}\n`,exitCode:1}}:{bytes:a}}function Pe(e,t,n){return n?`__null_sink${e.id}`:C(e,t)}function $(e,t){return{stdout:``,stderr:`${e}ffmpeg: ${t instanceof Error?t.message:String(t)}\nffmpeg: the wasm core faulted and was recycled; retry the command (a large input may need to be split into smaller passes)
90
- `,exitCode:1}}async function Fe(e){let{ffmpeg:t,parsed:n,resolvedInputs:r,stage:i,outputName:a,outputPath:s,analysisSink:c,readStderr:u}=e,d=l()===o;if(d&&n.inputs.length>1)return{early:Q(u()),outputBytes:null};await w(t,i,Ae(r));let f=c?{...n,outputOpts:U(n.outputOpts)}:n,p=ke(d?Oe(f):f,r,a),m=await t.exec(p);if(m!==0)return{early:{stdout:``,stderr:u()||`ffmpeg: exited with code ${m}\n`,exitCode:m||1},outputBytes:null};if(c)return await je(t),{early:{stdout:``,stderr:u(),exitCode:0},outputBytes:null};let h=await Ne(t,a,s,u);return`error`in h?{early:h.error,outputBytes:null}:{early:null,outputBytes:h.bytes}}async function Ie(e){let{ffmpeg:t,logHandler:n,stage:i,outputName:a,readStderr:o,faulted:c}=e;try{t.off(`log`,n)}catch{}if(c)return null;try{return await Me(t,i,a),null}catch(e){return s(e)?(r(t),$(o(),e)):null}}async function Le(e,t,n,r,i){let{ffmpegEngineFromEnv:a}=await import(`./engine-BnH9pfmR.js`),o=a(i.env),s=t.length===1?t[0].data:null;if(o===`wasm`||r||s===null)return o===`mediabunny`?{result:{stdout:``,stderr:`ffmpeg: FFMPEG_ENGINE=mediabunny cannot run this: analysis sinks, lavfi and concat inputs are wasm-only
91
- `,exitCode:1}}:{fallback:!0,note:null};let{runFfmpegFastPath:c}=await import(`./fast-path-CYxpDuii.js`);return c({parsed:e,input:s,outputPath:i.fs.resolvePath(i.cwd,n),fs:i.fs,engine:o})}async function Re(e,t){let n=b(),r=[],i=await Ee(e,n,t,e=>r.push(e));if(`error`in i)return i.error;let a=i.inputs,o=e.outputPath,s=H(e),c=await Le(e,a,o,s,t);if(`result`in c)return c.result;let l=await ze({parsed:e,ctx:t,stage:n,resolvedInputs:a,outputPath:o,analysisSink:s}),u=[...c.note?[`ffmpeg: ${c.note}`]:[],...r].map(e=>`${e}\n`).join(``);return u?{...l,stderr:`${u}${l.stderr}`}:l}async function ze(e){let{parsed:t,ctx:i,stage:a,resolvedInputs:o,outputPath:s,analysisSink:c}=e,l=Pe(a,s,c),u=``,f;try{f=await n({onProgress:e=>{u+=`${e}\n`},ipk:W(i),preferMt:d(i.env)===`mt`})}catch(e){return{stdout:``,stderr:`${u}ffmpeg: failed to load wasm: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}let p=e=>{u+=`${e.message}\n`};f.on(`log`,p);let m=!1,h=null,g=null;try{let e=await Fe({ffmpeg:f,parsed:t,resolvedInputs:o,stage:a,outputName:l,outputPath:s,analysisSink:c,readStderr:()=>u});h=e.early,g=e.outputBytes}catch(e){m=!0,r(f),h=$(u,e)}finally{let e=await Ie({ffmpeg:f,logHandler:p,stage:a,outputName:l,readStderr:()=>u,faulted:m});e&&(h=e)}if(h)return h;try{await i.fs.writeFile(i.fs.resolvePath(i.cwd,s),g??new Uint8Array)}catch(e){return{stdout:``,stderr:`${u}ffmpeg: cannot write ${s}: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}return{stdout:``,stderr:u,exitCode:0}}export{m as a,W as createIpkContextFromCtx,T as i,b as n,x as r,le as runFfmpeg,w as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./screencapture-media-shared-BDUdmMOP.js";async function n(t){if(!navigator.mediaDevices?.getDisplayMedia)throw Error(`screen capture is not supported in this browser`);await s();let n=t.mode===`video`&&!!t.audio,a;try{a=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:n})}catch(t){throw Error(e(t))}try{return t.mode===`video`?await i(a,t):await r(a,t)}finally{for(let e of a.getTracks())try{e.stop()}catch{}}}async function r(e,t){let n=await o(e);try{await new Promise(e=>setTimeout(e,100));let e=n.videoWidth,r=n.videoHeight,i=document.createElement(`canvas`);i.width=e,i.height=r;let a=i.getContext(`2d`);if(!a)throw Error(`Failed to get canvas context`);a.drawImage(n,0,0,e,r);let o=await new Promise((e,n)=>{i.toBlob(t=>t?e(t):n(Error(`Failed to create image blob`)),t.mimeType,t.quality)});return{bytes:new Uint8Array(await o.arrayBuffer()),mimeType:o.type||t.mimeType,width:e,height:r}}finally{n.srcObject=null}}async function i(e,n){if(typeof MediaRecorder>`u`)throw Error(`MediaRecorder is not supported in this browser`);let r=await o(e),i=r.videoWidth,s=r.videoHeight,c=t(n.durationMs),l=a(n.mimeType),u=new MediaRecorder(e,{mimeType:l}),d=[];u.ondataavailable=e=>{e.data&&e.data.size>0&&d.push(e.data)};let f=new Promise(e=>{u.onstop=()=>e()}),p=new Promise(t=>{let n=e.getTracks(),r=n.length;if(r===0){t();return}for(let e of n)e.addEventListener(`ended`,()=>{--r,r<=0&&t()},{once:!0})}),m=Date.now();u.start(),await Promise.race([new Promise(e=>setTimeout(e,c)),p]),u.state!==`inactive`&&u.stop(),await f;let h=Math.max(100,Date.now()-m);r.srcObject=null;let g=new Blob(d,{type:l});if(g.size===0)throw Error(`video capture produced no data (was sharing stopped immediately?)`);return{bytes:new Uint8Array(await g.arrayBuffer()),mimeType:g.type||l,width:i,height:s,durationMs:Math.min(h,c)}}function a(e){if(MediaRecorder.isTypeSupported(e))return e;for(let e of[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`])if(MediaRecorder.isTypeSupported(e))return e;return`video/webm`}async function o(e){let t=document.createElement(`video`);return t.srcObject=e,t.muted=!0,t.playsInline=!0,await new Promise((e,n)=>{t.onloadedmetadata=()=>t.play().then(()=>e()).catch(n),t.onerror=()=>n(Error(`Failed to load video stream`))}),t}async function s(e=5e3){if(typeof document>`u`)return;let t=()=>typeof document.visibilityState!=`string`||document.visibilityState===`visible`,n=typeof document.hasFocus==`function`?()=>document.hasFocus():()=>!0;t()&&n()||await new Promise(r=>{let i=()=>{window.removeEventListener(`focus`,a),document.removeEventListener(`visibilitychange`,a),clearTimeout(o)},a=()=>{t()&&n()&&(i(),r())},o=setTimeout(()=>{i(),r()},e);window.addEventListener(`focus`,a),document.addEventListener(`visibilitychange`,a),a()})}export{n as captureDisplayMedia};
@@ -1 +0,0 @@
1
- function e(e){return Math.max(100,Math.min(e??5e3,6e4))}function t(e){let t=e instanceof DOMException?e.name:void 0,n=e instanceof Error?e.message:String(e);return t===`InvalidStateError`||/^Invalid state$/i.test(n.trim())||/InvalidStateError/i.test(n)?`display capture unavailable (Invalid state): another tab or page may still hold a screen-share session, or this page is not focused/visible. Stop other getDisplayMedia captures, focus the SLICC window, and retry; if it stays wedged, reload the session`:t===`NotAllowedError`||/Permission denied|NotAllowedError/i.test(n)?`user cancelled or permission denied`:t===`NotFoundError`?`no screen, window, or tab was available to capture`:t===`NotReadableError`||t===`AbortError`?n||t:n}export{t as n,e as t};
@@ -1,2 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./logger-LESFN7Hj.js";const n=[`/workspace/skills`,`/workspace/.mcp/aliases`,`/workspace/bin`,`/shared/bin`],r=`/usr/bin:${n.join(`:`)}`,i=/\/(node_modules|\.[^/]+)\//;function a(e){let t=[];for(let n of(e??``).split(`:`)){let e=n.trim().replace(/\/+$/,``);!e||e===`/usr/bin`||e===`/bin`||e.startsWith(`/`)&&(t.includes(e)||t.push(e))}return t}async function o(e,t=n){let r=new Map;for(let n of t)await e.exists(n).catch(()=>!1)&&await s(e,n,r);return r}async function s(e,t,n){let r=t.replace(/\/+$/,``);for await(let a of e.walk(t)){if(!a.endsWith(`.jsh`)||i.test(a.slice(r.length)))continue;let e=c(a);n.has(e)||n.set(e,a)}}function c(e){let t=e.split(`/`).pop()??e;return t.endsWith(`.jsh`)?t.slice(0,-4):t}const l=[`/workspace`,`/shared`];async function u(e){let t=[],n=new Set;for(let r of l)await e.exists(r)&&await d(e,r,t,n);return t}async function d(e,t,n,r){for await(let i of e.walk(t)){if(!i.endsWith(`.bsh`)||r.has(i))continue;r.add(i);let t=f(i);if(!t)continue;let a=await e.readFile(i,{encoding:`utf-8`}),o=p(typeof a==`string`?a:new TextDecoder().decode(a));n.push({path:i,hostnamePattern:t,matchPatterns:o})}}function f(e){let t=e.split(`/`).pop()??``;if(!t.endsWith(`.bsh`))return null;let n=t.slice(0,-4);return n?n.startsWith(`-.`)?`*`+n.slice(1):n:null}function p(e){let t=e.split(`
2
- `).slice(0,10),n=[];for(let e of t){let t=e.match(/^\s*\/\/\s*@match\s+(.+)$/);t&&n.push(t[1].trim())}return n}function m(e,t){if(t.startsWith(`*.`)){let n=t.slice(1);return e===t.slice(2)||e.endsWith(n)&&e.length>n.length}return e===t}function h(e,t){try{let n=new URL(e),r=t.match(/^(\*|https?):\/\/([^/]+)(\/.*)?$/);if(!r)return!1;let[,i,a,o]=r;return i!==`*`&&n.protocol.slice(0,-1)!==i||!m(n.hostname,a)?!1:!o||g(n.pathname+n.search,o)}catch{return!1}}function g(e,t){let n=`^`+t.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`)+`$`;return new RegExp(n).test(e)}function _(e,t){try{let n=new URL(t);return e.filter(e=>m(n.hostname,e.hostnamePattern)?e.matchPatterns.length>0?e.matchPatterns.some(e=>h(t,e)):!0:!1)}catch{return[]}}const v=t(`workflow-discovery`),y=`/workspace/.workflows`,b=`/workspace/skills`,x=[y,b],S=`.workflow.js`,C=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;async function w(e){let t=new Map;try{await e.exists(y)&&await T(e,t)}catch(e){v.warn(`workflow discovery: ${y} scan failed`,e)}try{await e.exists(b)&&await E(e,t)}catch(e){v.warn(`workflow discovery: ${b} scan failed`,e)}return t}async function T(e,t){for await(let n of e.walk(y)){if(!n.endsWith(S))continue;let e=D(n);if(!C.test(e)){v.warn(`skipping saved workflow with invalid command name: '${e}' (${n})`);continue}t.has(e)||t.set(e,{path:n,kind:`saved`})}}async function E(e,t){for await(let n of e.walk(b)){if(!n.endsWith(S))continue;let e=O(n);if(!e)continue;let r=D(n);if(!C.test(e)||!C.test(r)){v.warn(`skipping skill workflow with invalid name segment: '${e}:${r}' (${n})`);continue}let i=`${e}:${r}`;t.has(i)||t.set(i,{path:n,kind:`skill`,skill:e})}}function D(e){let t=e.split(`/`).pop()??e;return t.endsWith(S)?t.slice(0,-12):t}function O(e){let t=e.slice(18).split(`/`);return t.length>=3&&t[1]===`.workflows`?t[0]:null}function k(e,t){let n=!1,r=[],i=!1;for(let e of t){if(i){r.push(e);continue}if(e===`--`){i=!0;continue}if(e===`--wait`){n=!0;continue}r.push(e)}let a=[`workflow`,`run`,e];return n&&a.push(`--wait`),r.length===1?a.push(`--args`,A(r[0])):r.length>1&&a.push(`--args`,JSON.stringify(r)),a}function A(e){try{return JSON.parse(e),e}catch{return JSON.stringify(e)}}var j=e({ScriptCatalog:()=>V});const M=[`/workspace`,`/shared`];function N(e){return new Map(e)}function P(e){return new Map([...e].map(([e,t])=>[e,{...t}]))}function F(e){return e.map(e=>({...e,matchPatterns:[...e.matchPatterns]}))}function I(e){if(e&&typeof e.listMounts==`function`)return e;if(e&&typeof e.getUnderlyingFS==`function`){let t=e.getUnderlyingFS?.();if(t&&typeof t.listMounts==`function`)return t}return null}function L(e,t){return(I(e)?.listMounts?.()??[]).some(e=>t.some(t=>e===t||e.startsWith(`${t}/`)||t.startsWith(`${e}/`)))}function R(e){return e?(I(e)?.listMounts?.()??[]).some(e=>M.some(t=>e===t||e.startsWith(t+`/`))):!1}function z(){return{cache:null,inflight:null,generation:0}}function B(e){e.generation++,e.cache=null,e.inflight=null}var V=class{jshFs;bshFs;watcher;watcherUnsubs=[];jshByRoots=new Map;bsh=z();workflow=z();constructor(e){if(this.jshFs=e.jshFs,this.bshFs=e.bshFs,this.watcher=e.watcher??null,this.watcher&&(this.watcherUnsubs.push(this.watcher.watch(`/`,()=>!0,()=>{this.invalidateJsh(),this.invalidateWorkflows()})),this.bshFs))for(let e of M)this.watcherUnsubs.push(this.watcher.watch(e,()=>!0,()=>this.invalidateBsh()))}dispose(){for(let e of this.watcherUnsubs)e();this.watcherUnsubs.length=0,this.invalidateAll()}invalidateAll(){this.invalidateJsh(),this.invalidateBsh(),this.invalidateWorkflows()}invalidateJsh(){for(let e of this.jshByRoots.values())B(e)}invalidateBsh(){B(this.bsh)}invalidateWorkflows(){B(this.workflow)}async getJshCommands(e=n){return N(await this.loadJshCommands(e))}async getJshCommandNames(e){return[...(await this.getJshCommands(e)).keys()]}async getBshEntries(){return this.bshFs?F(await this.loadBshEntries()):[]}async findMatchingBshScripts(e){return this.bshFs?F(_(await this.loadBshEntries(),e)):[]}async getWorkflowCommands(){return P(await this.loadWorkflowCommands())}shouldCacheJsh(e){return!!this.watcher&&!L(this.jshFs,e)}shouldCacheBsh(){return!!this.watcher&&!!this.bshFs&&!R(this.bshFs)}shouldCacheWorkflows(){return!!this.watcher&&!L(this.jshFs,x)}loadCached(e,t,n,r){if(t&&e.cache)return Promise.resolve(e.cache);if(!e.inflight){let i=e.generation,a=n().then(n=>{let a=r(n);return t&&e.generation===i&&(e.cache=a),a}).finally(()=>{e.inflight===a&&(e.inflight=null)});e.inflight=a}return e.inflight}loadJshCommands(e){let t=e.join(`:`),n=this.jshByRoots.get(t);n||(n=z(),this.jshByRoots.set(t,n));let r=[...e];return this.loadCached(n,this.shouldCacheJsh(r),()=>o(this.jshFs,r),N)}loadBshEntries(){if(!this.bshFs)return Promise.resolve([]);let e=this.bshFs;return this.loadCached(this.bsh,this.shouldCacheBsh(),()=>u(e),F)}loadWorkflowCommands(){return this.loadCached(this.workflow,this.shouldCacheWorkflows(),()=>w(this.jshFs),P)}};export{n as a,a as c,w as i,j as n,r as o,k as r,o as s,V as t};