sliccy 5.22.0 → 5.23.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 (273) hide show
  1. package/dist/ui/assets/__vite-browser-external-B0uIxSgw.js +1 -0
  2. package/dist/ui/assets/__vite-browser-external-SwrSgYTf.js +1 -0
  3. package/dist/ui/assets/{account-store-DOlleCyl.js → account-store-BPvwufEr.js} +3 -3
  4. package/dist/ui/assets/account-store-DRcHIayv.js +38 -0
  5. package/dist/ui/assets/addon-fit-Crogpbda.js +13 -0
  6. package/dist/ui/assets/addon-fit-DIOBYJe3.js +1 -0
  7. package/dist/ui/assets/{adobe-uTCM-4D4.js → adobe-BQa2f_tZ.js} +2 -2
  8. package/dist/ui/assets/{adobe-BApjrbPj.js → adobe-C1RMD4-d.js} +1 -1
  9. package/dist/ui/assets/{adobe-oauth-state-Dw_mocKc.js → adobe-oauth-state-CblNBQQR.js} +1 -1
  10. package/dist/ui/assets/{agent-message-to-chat-BdRCjeVB.js → agent-message-to-chat-LRySxnvm.js} +1 -1
  11. package/dist/ui/assets/{anthropic-DwYAPtk5.js → anthropic-BOEkIcb-.js} +1 -1
  12. package/dist/ui/assets/{anthropic-UMaEJx-B.js → anthropic-LjoeX6v-.js} +1 -1
  13. package/dist/ui/assets/{apps-BWPFf1Yf.js → apps-CZ4QaYIZ.js} +1 -1
  14. package/dist/ui/assets/{azure-openai-BSJnjcfJ.js → azure-openai-D-59h58z.js} +1 -1
  15. package/dist/ui/assets/{azure-openai-Bn5unC0Z.js → azure-openai-DZghfFcd.js} +1 -1
  16. package/dist/ui/assets/{azure-openai-responses-Bnxym5u-.js → azure-openai-responses-CbJrQGi8.js} +1 -1
  17. package/dist/ui/assets/{azure-openai-responses-Ds4b3a5B.js → azure-openai-responses-DPSrcT4o.js} +1 -1
  18. package/dist/ui/assets/{backend-local-D7FqJaoi.js → backend-local-BgTSBOxM.js} +1 -1
  19. package/dist/ui/assets/bedrock-camp-DjKgax8m.js +1 -0
  20. package/dist/ui/assets/{bedrock-camp-C1lmRgcD.js → bedrock-camp-DlP7CPgV.js} +2 -2
  21. package/dist/ui/assets/{browser-D0vICVpZ.js → browser-2wdq8OwU.js} +5 -5
  22. package/dist/ui/assets/{cdp-5C0rLyuM.js → cdp-D7cRI5-J.js} +1 -1
  23. package/dist/ui/assets/clipboard-DuHpK59o.js +1 -0
  24. package/dist/ui/assets/{composer-speech-DXkl5-5T.js → composer-speech-CzcwBzGA.js} +1 -1
  25. package/dist/ui/assets/{connect-surface-C597ydah.js → connect-surface-RiZUIrxS.js} +1 -1
  26. package/dist/ui/assets/{context-compaction-CFWyOzX1.js → context-compaction-DvlXtgVG.js} +1 -1
  27. package/dist/ui/assets/dip-BFDee3ZP.js +1 -0
  28. package/dist/ui/assets/{dist-jdlcYxrm.js → dist-0c-Ms6jt.js} +1 -1
  29. package/dist/ui/assets/{dist-k2Xmqc09.js → dist-BHXb30bf.js} +2 -2
  30. package/dist/ui/assets/{dist-BBhtjNOt.js → dist-Bw2SRiP7.js} +1 -1
  31. package/dist/ui/assets/dist-C30gQBcj2.js +12 -0
  32. package/dist/ui/assets/{dist-Dnh15m1q.js → dist-CC_gNVTb.js} +1 -1
  33. package/dist/ui/assets/dist-Cn_I6fkq.js +18 -0
  34. package/dist/ui/assets/{dist-DQRYKv91.js → dist-D1pcMg_U.js} +1 -1
  35. package/dist/ui/assets/{dist-CrC-F8vu.js → dist-D58cmC11.js} +1 -1
  36. package/dist/ui/assets/{dist-BmWy99kl.js → dist-D69OmKNn.js} +3 -3
  37. package/dist/ui/assets/{dist-AEf8Bitj2.js → dist-DD6YY4Ks2.js} +1 -1
  38. package/dist/ui/assets/{dist-CziJ8tXT.js → dist-SzMJHiOE.js} +1 -1
  39. package/dist/ui/assets/{ensure-speech-assets-BPhOGGfO.js → ensure-speech-assets-Bax4J0R4.js} +1 -1
  40. package/dist/ui/assets/{es-C8ey2woP.js → es-kEo2Tmh4.js} +4 -4
  41. package/dist/ui/assets/esp32-D9ZurRwV.js +1 -0
  42. package/dist/ui/assets/{esp32c2-CpROmlB0.js → esp32c2-F0yCL7ES.js} +1 -1
  43. package/dist/ui/assets/esp32c3-wVAODszM.js +1 -0
  44. package/dist/ui/assets/{esp32c5-KJSqwo2Q.js → esp32c5-ChTI-uFN.js} +1 -1
  45. package/dist/ui/assets/{esp32c6-BMEnOhZ6.js → esp32c6-IwoGEmKl.js} +1 -1
  46. package/dist/ui/assets/{esp32c61-sRp43nbI.js → esp32c61-BJScMw70.js} +1 -1
  47. package/dist/ui/assets/{esp32h2-BKv-WORi.js → esp32h2-YosZEx9u.js} +1 -1
  48. package/dist/ui/assets/{esp32p4-g1tFG0sh.js → esp32p4-BSe822vW.js} +1 -1
  49. package/dist/ui/assets/{esp32s2-BE2gO68i.js → esp32s2-Dhlhu16A.js} +1 -1
  50. package/dist/ui/assets/{esp32s3-CjMu3q4c.js → esp32s3-PqxbnxPZ.js} +1 -1
  51. package/dist/ui/assets/esp8266-CgqhR4Wc.js +1 -0
  52. package/dist/ui/assets/esp8266-CuMaVNVI.js +1 -0
  53. package/dist/ui/assets/{esptool-operations-wnHF1cOB.js → esptool-operations-CNxPdlH_.js} +2 -2
  54. package/dist/ui/assets/esptool-operations-KWVZgO7d.js +12 -0
  55. package/dist/ui/assets/{follower-navigate-watcher-CnHWEu_l.js → follower-navigate-watcher-quUh7-CS.js} +1 -1
  56. package/dist/ui/assets/fs-D6GWcrVb.js +1 -0
  57. package/dist/ui/assets/{fs-DGzEyyjW.js → fs-njSrzhNh.js} +2 -2
  58. package/dist/ui/assets/{github-DrBasfDl.js → github-C5iKeyIZ.js} +2 -2
  59. package/dist/ui/assets/{github-CrEpWTT4.js → github-CY1vTcwt.js} +1 -1
  60. package/dist/ui/assets/{github-copilot-fQiOd3tX.js → github-copilot-BkzVAtWq.js} +1 -1
  61. package/dist/ui/assets/{github-copilot-CYUdwY7c.js → github-copilot-C_XDJI-F.js} +2 -2
  62. package/dist/ui/assets/{google-CEOynCO5.js → google-C3U0TK_l.js} +1 -1
  63. package/dist/ui/assets/{google-CSaY-DQE.js → google-DPvIPcfE.js} +1 -1
  64. package/dist/ui/assets/google-shared-CFmFmYdk.js +11 -0
  65. package/dist/ui/assets/{google-shared-RiqqHuiz.js → google-shared-CwjAeP6N.js} +1 -1
  66. package/dist/ui/assets/{google-vertex-CBHKHWKe.js → google-vertex-BbeV3aSP.js} +1 -1
  67. package/dist/ui/assets/{google-vertex-C7BX8ATF.js → google-vertex-CEGsokz8.js} +1 -1
  68. package/dist/ui/assets/{handoff-link-ywwq4k0t.js → handoff-link-w8LYa3Ua.js} +1 -1
  69. package/dist/ui/assets/{hear-DH3US_c_.js → hear--VyWD7WJ.js} +1 -1
  70. package/dist/ui/assets/{hear-DcjeM2tc.js → hear-DMzpXyvS.js} +1 -1
  71. package/dist/ui/assets/hid-device-registry-6w-g8ZpF.js +1 -0
  72. package/dist/ui/assets/hid-picker-CE6gGmQt.js +1 -0
  73. package/dist/ui/assets/icons-C5g936Qd.js +1 -0
  74. package/dist/ui/assets/{index-BeMnZBAU.js → index-AMF5XZgS.js} +72 -71
  75. package/dist/ui/assets/intercepted-oauth-CaCw-rJ5.js +1 -0
  76. package/dist/ui/assets/js-realm-worker-BYZQ59hJ.js +49 -0
  77. package/dist/ui/assets/json-parse-B51EftGA.js +3 -0
  78. package/dist/ui/assets/json-parse-C7d6hyOc.js +3 -0
  79. package/dist/ui/assets/{kernel-worker--emmdYcK.js → kernel-worker-BuLAKxNE.js} +1237 -837
  80. package/dist/ui/assets/kokoro-BFFlHn4y.js +4 -0
  81. package/dist/ui/assets/kokoro-C-DxSDte.js +4 -0
  82. package/dist/ui/assets/{kokoro-engine-D6CvO4ll.js → kokoro-engine-CVpfUNNb.js} +2 -2
  83. package/dist/ui/assets/{legacy-styles-4PP74ISo.js → legacy-styles-CF6h7ytf.js} +1 -1
  84. package/dist/ui/assets/{lick-ws-bridge-BW2oth5z.js → lick-ws-bridge--Vksc7F9.js} +1 -1
  85. package/dist/ui/assets/{lick-ws-bridge-ldh3QesL.js → lick-ws-bridge-DAzGsuBg.js} +1 -1
  86. package/dist/ui/assets/llm-session-id-bZQs6gBN.js +1 -0
  87. package/dist/ui/assets/{local-llm-B-K_aJrM.js → local-llm-B3sNRJii.js} +1 -1
  88. package/dist/ui/assets/{main-ONpvMnyR.js → main-BME4pJJo.js} +4 -4
  89. package/dist/ui/assets/{main-cherry-NiJ4PeFm.js → main-cherry-DkK6hE90.js} +1 -1
  90. package/dist/ui/assets/mistral-CLF3Mo4W.js +46 -0
  91. package/dist/ui/assets/mistral-DkJAVbOW.js +46 -0
  92. package/dist/ui/assets/mount-Bix58hlG.js +1 -0
  93. package/dist/ui/assets/{mount-DcGhI7cC.js → mount-CW5miKSN.js} +2 -2
  94. package/dist/ui/assets/mount-bridge-client-DnDk55XZ.js +2 -0
  95. package/dist/ui/assets/mount-picker-popup-Cw_D7c_n.js +1 -0
  96. package/dist/ui/assets/mount-table-store-CfQUN_2R.js +1 -0
  97. package/dist/ui/assets/mount-table-store-s20mtVA3.js +1 -0
  98. package/dist/ui/assets/{navigation-watcher-BxAAD5To.js → navigation-watcher-C2s0i0h4.js} +1 -1
  99. package/dist/ui/assets/{new-session-CnM_DXhJ.js → new-session-CS1WEhLm.js} +2 -2
  100. package/dist/ui/assets/{oauth-bootstrap-BZCLo8I2.js → oauth-bootstrap-B2wuItHI.js} +2 -2
  101. package/dist/ui/assets/{oauth-service-D-lmxdpH.js → oauth-service-R7EZswi4.js} +1 -1
  102. package/dist/ui/assets/{oauth-service-ahaKd8Mt.js → oauth-service-ySAsf2gs.js} +1 -1
  103. package/dist/ui/assets/{onboarding-orchestrator-CADSztcp.js → onboarding-orchestrator-cZ36aqC6.js} +1 -1
  104. package/dist/ui/assets/{openai-Cn5LRPCm.js → openai-BeH6aC_-.js} +1 -1
  105. package/dist/ui/assets/{openai-i4HWKCeW.js → openai-BvKpRLAG.js} +1 -1
  106. package/dist/ui/assets/{openai-codex-CceLJ6J-.js → openai-codex-BnYyNqXj.js} +1 -1
  107. package/dist/ui/assets/{openai-codex-BfTcuFL3.js → openai-codex-D_k1NXCs.js} +1 -1
  108. package/dist/ui/assets/{openai-codex-responses-Cq5XDqVc.js → openai-codex-responses-B2oZ1hgB.js} +1 -1
  109. package/dist/ui/assets/{openai-codex-responses-7JN1dUxK.js → openai-codex-responses-Dumyd9t2.js} +1 -1
  110. package/dist/ui/assets/{openai-completions-DLI0t_lj.js → openai-completions-B2n4Op2S.js} +1 -1
  111. package/dist/ui/assets/openai-completions-aHU8w14d.js +5 -0
  112. package/dist/ui/assets/{openai-responses-ANbRIlpa.js → openai-responses-4ryIAXQS.js} +1 -1
  113. package/dist/ui/assets/{openai-responses-nczmKECx.js → openai-responses-BurVahs3.js} +1 -1
  114. package/dist/ui/assets/{openai-responses-shared-CM2vkuNI.js → openai-responses-shared-BebU8o_f.js} +1 -1
  115. package/dist/ui/assets/{openai-responses-shared-9YVaeX5D.js → openai-responses-shared-D9O9OCYB.js} +1 -1
  116. package/dist/ui/assets/{openrouter-Cy2dLX1Z.js → openrouter-B1ruTb6k.js} +1 -1
  117. package/dist/ui/assets/{openrouter-QETwrep8.js → openrouter-XmffhsNH.js} +1 -1
  118. package/dist/ui/assets/page-follower-tray-CKvoa8Vc.js +5 -0
  119. package/dist/ui/assets/panel-rpc-CjFVE0nK.js +1 -0
  120. package/dist/ui/assets/panel-rpc-DmJSNs0I.js +1 -0
  121. package/dist/ui/assets/panel-rpc-handlers-B-gE3pP7.js +2 -0
  122. package/dist/ui/assets/{pdfjs-C3ks1z_T.js → pdfjs-BdCnB7P8.js} +7 -7
  123. package/dist/ui/assets/preload-helper-CZgWQFsJ.js +1 -0
  124. package/dist/ui/assets/{provider-eCpA8_Iv.js → provider-DO4PGsF_.js} +2 -2
  125. package/dist/ui/assets/{provider-B3fKSgvd.js → provider-lR1ovrWJ.js} +1 -1
  126. package/dist/ui/assets/provider-store-access-4kR4SrNf.js +1 -0
  127. package/dist/ui/assets/provider-store-access-Clj85PSW.js +1 -0
  128. package/dist/ui/assets/providers-CChuPgRN.js +1 -0
  129. package/dist/ui/assets/providers-lNcU6L-a.js +2 -0
  130. package/dist/ui/assets/proxied-fetch-DzLglfG5.js +2 -0
  131. package/dist/ui/assets/proxied-fetch-R_Zw2ZFI.js +1 -0
  132. package/dist/ui/assets/py-realm-worker-Cr26Gsx8.js +244 -0
  133. package/dist/ui/assets/{pyodide-CPgzyJWn.js → pyodide-CHuPF4e3.js} +2 -2
  134. package/dist/ui/assets/{pyodide-BFyW4kyI.js → pyodide-Dp0v7U2K.js} +2 -2
  135. package/dist/ui/assets/quick-llm-BcXxSY4e.js +1 -0
  136. package/dist/ui/assets/remote-cache-D59F5FOx.js +1 -0
  137. package/dist/ui/assets/remote-cdp-transport-DTCu2BgA.js +1 -0
  138. package/dist/ui/assets/{remote-terminal-view-DIEOCe9M.js → remote-terminal-view-B_2LHY8s.js} +1 -1
  139. package/dist/ui/assets/{secret-env-Bs2du0RF.js → secret-env-guT2rdYI.js} +1 -1
  140. package/dist/ui/assets/{secret-topology-Bp0wH2ni.js → secret-topology-CC_yKaqL.js} +1 -1
  141. package/dist/ui/assets/secrets-bridge-client-C3K9ItX4.js +2 -0
  142. package/dist/ui/assets/serial-picker-1VVNQI8D.js +1 -0
  143. package/dist/ui/assets/serial-port-registry-DsPZvGpT.js +1 -0
  144. package/dist/ui/assets/session-freezer-CgXtJVLu.js +1 -0
  145. package/dist/ui/assets/session-store-DAM8GRJ0.js +1 -0
  146. package/dist/ui/assets/{setup-sprinkle-exec-C7SBZY7y.js → setup-sprinkle-exec-P2hO-taT.js} +1 -1
  147. package/dist/ui/assets/shared-CrHp2zdc.js +1 -0
  148. package/dist/ui/assets/{slicc-editor-BdfBeQCF.js → slicc-editor-DKckizoI.js} +2 -2
  149. package/dist/ui/assets/{speak-CmXyuska.js → speak-B0KXFDjL.js} +1 -1
  150. package/dist/ui/assets/{speak-7UzWyUVB.js → speak-BwWMiCus.js} +3 -3
  151. package/dist/ui/assets/speech-assets-bridge-CFYafE89.js +1 -0
  152. package/dist/ui/assets/{sprinkle-bridge-CwelAMwV.js → sprinkle-bridge-DL0PzEfD.js} +1 -1
  153. package/dist/ui/assets/{sprinkle-manager-BcNkmc-E.js → sprinkle-manager-BrnXYZNe.js} +1 -1
  154. package/dist/ui/assets/{sprinkle-renderer-GiRRbdBx.js → sprinkle-renderer-CsUow5K7.js} +3 -3
  155. package/dist/ui/assets/{sql-wasm-BWbkWL23.js → sql-wasm-JpZkOS2Q.js} +1 -1
  156. package/dist/ui/assets/store-CiLd7Ltk.js +1 -0
  157. package/dist/ui/assets/{sudo-CGD0Ki6b.js → sudo-SbEy0lx-.js} +3 -3
  158. package/dist/ui/assets/{sync-dialog-BFKWO6DT.js → sync-dialog-Ie_5SqoO.js} +1 -1
  159. package/dist/ui/assets/theme-Ca4mHxHv.js +1 -0
  160. package/dist/ui/assets/theme-engine-LmGLoWYX.js +3 -0
  161. package/dist/ui/assets/theme-presets-xiOb9AFN.js +1 -0
  162. package/dist/ui/assets/transform-messages-DiIjWKhh.js +1 -0
  163. package/dist/ui/assets/{transformers-env-ChIHsg1x.js → transformers-env-Blt6HC_1.js} +1 -1
  164. package/dist/ui/assets/{transformers-env-BQUf39mx.js → transformers-env-D24AdCVb.js} +1 -1
  165. package/dist/ui/assets/{transformers.web-BxHOGVSB.js → transformers.web-C6PlPLR-.js} +1 -1
  166. package/dist/ui/assets/{transformers.web-CuUo4MLm.js → transformers.web-DkJGoARp.js} +1 -1
  167. package/dist/ui/assets/tray-leader-Ce8YyKO5.js +1 -0
  168. package/dist/ui/assets/{tray-leave-runtime-CVAUUyWv.js → tray-leave-runtime-DWG6ewDi.js} +1 -1
  169. package/dist/ui/assets/{upgrade-detection-D6i1xD-s.js → upgrade-detection-Bahy2mfY.js} +1 -1
  170. package/dist/ui/assets/usb-device-registry-k6vTKonT.js +1 -0
  171. package/dist/ui/assets/{usb-operations-CkcrNzZw.js → usb-operations-D-YdmmuG.js} +1 -1
  172. package/dist/ui/assets/usb-picker-SsbXAvwt.js +1 -0
  173. package/dist/ui/assets/{voice-reply-DeTF05vK.js → voice-reply-CdDTbx5C.js} +1 -1
  174. package/dist/ui/assets/{wc-attach-D63LJy4C.js → wc-attach-P61GYoY8.js} +3 -3
  175. package/dist/ui/assets/wc-extension-C_Atv9M1.js +2 -0
  176. package/dist/ui/assets/wc-float-label-COQsLLC2.js +1 -0
  177. package/dist/ui/assets/wc-follower-DLWJH9Wm.js +2 -0
  178. package/dist/ui/assets/{wc-live-BjRY1nkF.js → wc-live-CKisGrn6.js} +16 -16
  179. package/dist/ui/assets/wc-nav-C8bnEda_.js +2 -0
  180. package/dist/ui/assets/{wc-onboarding-CO2r3rtk.js → wc-onboarding-DQOqFqNj.js} +2 -2
  181. package/dist/ui/assets/{wc-permissions-DmHMvdiC.js → wc-permissions-CBFvg_0i.js} +3 -3
  182. package/dist/ui/assets/{wc-permissions-providers-BufEXbhX.js → wc-permissions-providers-Cdznv6xX.js} +2 -2
  183. package/dist/ui/assets/wc-permissions-registry-Blyunq37.js +1 -0
  184. package/dist/ui/assets/wc-permissions-registry-C7PhTX3c.js +1 -0
  185. package/dist/ui/assets/{wc-placeholder-DmDCYMMv.js → wc-placeholder-ClGtIyUC.js} +3 -3
  186. package/dist/ui/assets/wc-settings-CH0fgu4m.js +48 -0
  187. package/dist/ui/assets/{wc-shell-DwWXZMDq.js → wc-shell-FqlPeZfJ.js} +4 -4
  188. package/dist/ui/assets/wc-sprinkles-BtyrEgiD.js +2 -0
  189. package/dist/ui/assets/wc-tray-Dgcd1QIL.js +2 -0
  190. package/dist/ui/assets/welcome-detection-CQY88hjL.js +1 -0
  191. package/dist/ui/assets/{whisper-engine-B4F1IZk5.js → whisper-engine-DcSK9vG0.js} +1 -1
  192. package/dist/ui/assets/{whisper-session-bkHemaIa.js → whisper-session-tJ8m9ShN.js} +2 -2
  193. package/dist/ui/assets/{xai-grok-DnE_hbXu.js → xai-grok-CEiCsU5v.js} +1 -1
  194. package/dist/ui/assets/{xai-grok-CSI7j4LP.js → xai-grok-CtCLXgPn.js} +1 -1
  195. package/dist/ui/assets/{xterm-DooSxjI5.js → xterm-DMlKjmUi.js} +2 -2
  196. package/dist/ui/assets/{xterm-B5O_KJMf.js → xterm-Dwh1I9AE.js} +2 -2
  197. package/dist/ui/index.html +16 -16
  198. package/dist/ui/packages/webapp/index.html +16 -16
  199. package/package.json +4 -4
  200. package/dist/ui/assets/__vite-browser-external-BdY91arR.js +0 -1
  201. package/dist/ui/assets/__vite-browser-external-C7iut881.js +0 -1
  202. package/dist/ui/assets/account-store-DvidGCSz.js +0 -38
  203. package/dist/ui/assets/addon-fit-CuuUKmBe.js +0 -13
  204. package/dist/ui/assets/addon-fit-DthTIhi3.js +0 -1
  205. package/dist/ui/assets/bedrock-camp-9-QEmC9Z.js +0 -1
  206. package/dist/ui/assets/clipboard-DgFtRQbq.js +0 -1
  207. package/dist/ui/assets/dip-ZwIIoTvH.js +0 -1
  208. package/dist/ui/assets/dist-4q7gK6W0.js +0 -18
  209. package/dist/ui/assets/dist-eRjRxbMY2.js +0 -12
  210. package/dist/ui/assets/esp32-CatgC_Vd.js +0 -1
  211. package/dist/ui/assets/esp32c3-heViyR1Q.js +0 -1
  212. package/dist/ui/assets/esp8266-BPLrOmN4.js +0 -1
  213. package/dist/ui/assets/esp8266-DJkN1NMD.js +0 -1
  214. package/dist/ui/assets/esptool-operations-CiX8mbpu.js +0 -12
  215. package/dist/ui/assets/fs-CNaqdxK1.js +0 -1
  216. package/dist/ui/assets/google-shared-CVRDRmWo.js +0 -11
  217. package/dist/ui/assets/hid-device-registry-D2LsJCRr.js +0 -1
  218. package/dist/ui/assets/hid-picker-DUJBI46p.js +0 -1
  219. package/dist/ui/assets/icons-BU6llBsN.js +0 -1
  220. package/dist/ui/assets/intercepted-oauth-E9BfBX02.js +0 -1
  221. package/dist/ui/assets/js-realm-worker-CPYpgfMX.js +0 -49
  222. package/dist/ui/assets/json-parse-BUunmmNl.js +0 -3
  223. package/dist/ui/assets/json-parse-CWht3lea.js +0 -3
  224. package/dist/ui/assets/kokoro-B5jJ2WUJ.js +0 -4
  225. package/dist/ui/assets/kokoro-BdpwC7DT.js +0 -4
  226. package/dist/ui/assets/llm-session-id-DVmZ9C2t.js +0 -1
  227. package/dist/ui/assets/mistral-BTNTllXI.js +0 -46
  228. package/dist/ui/assets/mistral-BzfpfZhh.js +0 -46
  229. package/dist/ui/assets/mount-BIAbddcu.js +0 -1
  230. package/dist/ui/assets/mount-bridge-client-tEnjiHyh.js +0 -2
  231. package/dist/ui/assets/mount-picker-popup-Hrvzr69c.js +0 -1
  232. package/dist/ui/assets/mount-table-store-DAENz45Q.js +0 -1
  233. package/dist/ui/assets/mount-table-store-ggb440m4.js +0 -1
  234. package/dist/ui/assets/openai-completions-YNL_qr9N.js +0 -5
  235. package/dist/ui/assets/page-follower-tray-3aCyiYwD.js +0 -4
  236. package/dist/ui/assets/panel-rpc-D0J5pskz.js +0 -1
  237. package/dist/ui/assets/panel-rpc-DqT2FG7c.js +0 -1
  238. package/dist/ui/assets/panel-rpc-handlers-CY1CkLFB.js +0 -2
  239. package/dist/ui/assets/preload-helper-zJ_50EbN.js +0 -1
  240. package/dist/ui/assets/provider-store-access-CxkFfgDe.js +0 -1
  241. package/dist/ui/assets/provider-store-access-DrEF70fE.js +0 -1
  242. package/dist/ui/assets/providers-BaPDWsNI.js +0 -2
  243. package/dist/ui/assets/providers-Dge7mhGc.js +0 -1
  244. package/dist/ui/assets/proxied-fetch-B5vr_AP8.js +0 -2
  245. package/dist/ui/assets/proxied-fetch-I4cndszg.js +0 -1
  246. package/dist/ui/assets/py-realm-worker-LVNFvu8J.js +0 -244
  247. package/dist/ui/assets/quick-llm-3huRDf4h.js +0 -1
  248. package/dist/ui/assets/remote-cache-BL6NRenp.js +0 -1
  249. package/dist/ui/assets/remote-cdp-transport-BrkfZae9.js +0 -1
  250. package/dist/ui/assets/secrets-bridge-client-DXw32cXb.js +0 -2
  251. package/dist/ui/assets/serial-picker-B6s4NeaB.js +0 -1
  252. package/dist/ui/assets/serial-port-registry-Bc4wlwED.js +0 -1
  253. package/dist/ui/assets/session-freezer-Bu6IGBjC.js +0 -1
  254. package/dist/ui/assets/session-store-CCH7W8KY.js +0 -1
  255. package/dist/ui/assets/shared-DAA_6m5R.js +0 -1
  256. package/dist/ui/assets/speech-assets-bridge-B8NqCAE8.js +0 -1
  257. package/dist/ui/assets/store-GRbFxjv_.js +0 -1
  258. package/dist/ui/assets/theme-BBwuyzvz.js +0 -1
  259. package/dist/ui/assets/transform-messages-DzB_lMo-.js +0 -1
  260. package/dist/ui/assets/tray-leader-_L-5FP9I.js +0 -1
  261. package/dist/ui/assets/usb-device-registry-BP58Vi0S.js +0 -1
  262. package/dist/ui/assets/usb-picker-D_K0weAY.js +0 -1
  263. package/dist/ui/assets/wc-extension-CoQsUqQu.js +0 -2
  264. package/dist/ui/assets/wc-float-label-dfUH87GD.js +0 -1
  265. package/dist/ui/assets/wc-follower-3KEzkDWq.js +0 -2
  266. package/dist/ui/assets/wc-nav-HoPMQ97b.js +0 -2
  267. package/dist/ui/assets/wc-permissions-registry-CR1rTd2H.js +0 -1
  268. package/dist/ui/assets/wc-permissions-registry-Dx-BRiKK.js +0 -1
  269. package/dist/ui/assets/wc-settings-Dd2Pbdn9.js +0 -24
  270. package/dist/ui/assets/wc-sprinkles-DQtTnVxO.js +0 -2
  271. package/dist/ui/assets/wc-tray-B2k2gf2c.js +0 -2
  272. package/dist/ui/assets/welcome-detection-Cr8mNEkt.js +0 -1
  273. /package/dist/ui/assets/{chunk-aKtaBQYM.js → rolldown-runtime-aKtaBQYM.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{r as e,t}from"./chunk-aKtaBQYM.js";t((e=>{(function(){var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function n(e){return i(o(e),arguments)}function r(e,t){return n.apply(null,[e].concat(t||[]))}function i(e,r){var i=1,a=e.length,o,s=``,c,l,u,d,f,p,m,h;for(c=0;c<a;c++)if(typeof e[c]==`string`)s+=e[c];else if(typeof e[c]==`object`){if(u=e[c],u.keys)for(o=r[i],l=0;l<u.keys.length;l++){if(o==null)throw Error(n(`[sprintf] Cannot access property "%s" of undefined value "%s"`,u.keys[l],u.keys[l-1]));o=o[u.keys[l]]}else o=u.param_no?r[u.param_no]:r[i++];if(t.not_type.test(u.type)&&t.not_primitive.test(u.type)&&o instanceof Function&&(o=o()),t.numeric_arg.test(u.type)&&typeof o!=`number`&&isNaN(o))throw TypeError(n(`[sprintf] expecting number but found %T`,o));switch(t.number.test(u.type)&&(m=o>=0),u.type){case`b`:o=parseInt(o,10).toString(2);break;case`c`:o=String.fromCharCode(parseInt(o,10));break;case`d`:case`i`:o=parseInt(o,10);break;case`j`:o=JSON.stringify(o,null,u.width?parseInt(u.width):0);break;case`e`:o=u.precision?parseFloat(o).toExponential(u.precision):parseFloat(o).toExponential();break;case`f`:o=u.precision?parseFloat(o).toFixed(u.precision):parseFloat(o);break;case`g`:o=u.precision?String(Number(o.toPrecision(u.precision))):parseFloat(o);break;case`o`:o=(parseInt(o,10)>>>0).toString(8);break;case`s`:o=String(o),o=u.precision?o.substring(0,u.precision):o;break;case`t`:o=String(!!o),o=u.precision?o.substring(0,u.precision):o;break;case`T`:o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=u.precision?o.substring(0,u.precision):o;break;case`u`:o=parseInt(o,10)>>>0;break;case`v`:o=o.valueOf(),o=u.precision?o.substring(0,u.precision):o;break;case`x`:o=(parseInt(o,10)>>>0).toString(16);break;case`X`:o=(parseInt(o,10)>>>0).toString(16).toUpperCase();break}t.json.test(u.type)?s+=o:(t.number.test(u.type)&&(!m||u.sign)?(h=m?`+`:`-`,o=o.toString().replace(t.sign,``)):h=``,f=u.pad_char?u.pad_char===`0`?`0`:u.pad_char.charAt(1):` `,p=u.width-(h+o).length,d=u.width&&p>0?f.repeat(p):``,s+=u.align?h+o+d:f===`0`?h+d+o:d+h+o)}return s}var a=Object.create(null);function o(e){if(a[e])return a[e];for(var n=e,r,i=[],o=0;n;){if((r=t.text.exec(n))!==null)i.push(r[0]);else if((r=t.modulo.exec(n))!==null)i.push(`%`);else if((r=t.placeholder.exec(n))!==null){if(r[2]){o|=1;var s=[],c=r[2],l=[];if((l=t.key.exec(c))!==null)for(s.push(l[1]);(c=c.substring(l[0].length))!==``;)if((l=t.key_access.exec(c))!==null)s.push(l[1]);else if((l=t.index_access.exec(c))!==null)s.push(l[1]);else throw SyntaxError(`[sprintf] failed to parse named argument key`);else throw SyntaxError(`[sprintf] failed to parse named argument key`);r[2]=s}else o|=2;if(o===3)throw Error(`[sprintf] mixing positional and named placeholders is not (yet) supported`);i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}else throw SyntaxError(`[sprintf] unexpected placeholder`);n=n.substring(r[0].length)}return a[e]=i}e!==void 0&&(e.sprintf=n,e.vsprintf=r),typeof window<`u`&&(window.sprintf=n,window.vsprintf=r,typeof define==`function`&&define.amd&&define(function(){return{sprintf:n,vsprintf:r}}))})()}))();var n=(e,t,n)=>{let a=e instanceof RegExp?r(e,n):e,o=t instanceof RegExp?r(t,n):t,s=a!==null&&o!=null&&i(a,o,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+a.length,s[1]),post:n.slice(s[1]+o.length)}},r=(e,t)=>{let n=t.match(e);return n?n[0]:null},i=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},a=`\0SLASH`+Math.random()+`\0`,o=`\0OPEN`+Math.random()+`\0`,s=`\0CLOSE`+Math.random()+`\0`,c=`\0COMMA`+Math.random()+`\0`,l=`\0PERIOD`+Math.random()+`\0`,u=new RegExp(a,`g`),d=new RegExp(o,`g`),f=new RegExp(s,`g`),p=new RegExp(c,`g`),m=new RegExp(l,`g`),h=/\\\\/g,ee=/\\{/g,te=/\\}/g,ne=/\\,/g,re=/\\\./g,ie=1e5;function ae(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function oe(e){return e.replace(h,a).replace(ee,o).replace(te,s).replace(ne,c).replace(re,l)}function se(e){return e.replace(u,`\\`).replace(d,`{`).replace(f,`}`).replace(p,`,`).replace(m,`.`)}function ce(e){if(!e)return[``];let t=[],r=n(`{`,`}`,e);if(!r)return e.split(`,`);let{pre:i,body:a,post:o}=r,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;let c=ce(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function le(e,t={}){if(!e)return[];let{max:n=ie}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),me(oe(e),n,!0).map(se)}function ue(e){return`{`+e+`}`}function de(e){return/^-?0\d/.test(e)}function fe(e,t){return e<=t}function pe(e,t){return e>=t}function me(e,t,r){let i=[],a=n(`{`,`}`,e);if(!a)return[e];let o=a.pre,c=a.post.length?me(a.post,t,!1):[``];if(/\$$/.test(a.pre))for(let e=0;e<c.length&&e<t;e++){let t=o+`{`+a.body+`}`+c[e];i.push(t)}else{let n=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),u=n||l,d=a.body.indexOf(`,`)>=0;if(!u&&!d)return a.post.match(/,(?!,).*\}/)?(e=a.pre+`{`+a.body+s+a.post,me(e,t,!0)):[e];let f;if(u)f=a.body.split(/\.\./);else if(f=ce(a.body),f.length===1&&f[0]!==void 0&&(f=me(f[0],t,!1).map(ue),f.length===1))return c.map(e=>a.pre+f[0]+e);let p;if(u&&f[0]!==void 0&&f[1]!==void 0){let e=ae(f[0]),t=ae(f[1]),n=Math.max(f[0].length,f[1].length),r=f.length===3&&f[2]!==void 0?Math.abs(ae(f[2])):1,i=fe;t<e&&(r*=-1,i=pe);let a=f.some(de);p=[];for(let o=e;i(o,t);o+=r){let e;if(l)e=String.fromCharCode(o),e===`\\`&&(e=``);else if(e=String(o),a){let t=n-e.length;if(t>0){let n=Array(t+1).join(`0`);e=o<0?`-`+n+e.slice(1):n+e}}p.push(e)}}else{p=[];for(let e=0;e<f.length;e++)p.push.apply(p,me(f[e],t,!1))}for(let e=0;e<p.length;e++)for(let n=0;n<c.length&&i.length<t;n++){let t=o+p[e]+c[n];(!r||u||t)&&i.push(t)}}return i}var he=1024*64,ge=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>he)throw TypeError(`pattern is too long`)},_e={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},ve=e=>e.replace(/[[\]\\-]/g,`\\$&`),ye=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),be=e=>e.join(``),xe=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(_e))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(ve(d)+`-`+ve(t)):t===d&&r.push(ve(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(ve(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(ve(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[ye(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+be(r)+`]`,p=`[`+(l?``:`^`)+be(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},Se=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`):t?e.replace(/\[([^\/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,`$1$2`).replace(/\\([^\/{}])/g,`$1`),Ce,we=new Set([`!`,`?`,`+`,`*`,`@`]),Te=e=>we.has(e),Ee=e=>Te(e.type),De=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),Oe=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),ke=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Ae=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),je=`(?!(?:^|/)\\.\\.?(?:$|/))`,Me=`(?!\\.)`,Ne=new Set([`[`,`.`]),Pe=new Set([`..`,`.`]),Fe=new Set(`().*{}+?[]^$\\!`),Ie=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Le=`[^/]`,Re=`[^/]*?`,ze=`[^/]+?`,Be=0,Ve=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++Be;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof Ce&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof Ce&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new Ce(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&Te(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new Ce(n,t);u=Ce.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new Ce(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&Te(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new Ce(n,d);d.push(o),u=Ce.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new Ce(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,Oe)}#m(e,t=De){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=ke){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new Ce(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!Ae.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=Ae.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new Ce(null,void 0,t);return Ce.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!Ee(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?Ce.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&Pe.has(this.#r[0]))){let n=Ne,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?je:o?Me:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,Se(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,Se(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?Me:``)+ze;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?Me:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,Se(i),this.#t=!!this.#t,this.#n]}#x(){if(Ee(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(Fe.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?ze:Re,t=!0;continue}else o=!1;if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=xe(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=Le,t=!0;continue}i+=Ie(c)}return[i,Se(e),!!t,a]}};Ce=Ve;var He=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),Ue=(e,t,n={})=>(ge(t),!n.nocomment&&t.charAt(0)===`#`?!1:new bt(t,n).match(e)),We=/^\*+([^+@!?\*\[\(]*)$/,Ge=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),Ke=e=>t=>t.endsWith(e),qe=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),Je=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Ye=/^\*+\.\*+$/,Xe=e=>!e.startsWith(`.`)&&e.includes(`.`),Ze=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Qe=/^\.\*+$/,$e=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),et=/^\*+$/,tt=e=>e.length!==0&&!e.startsWith(`.`),nt=e=>e.length!==0&&e!==`.`&&e!==`..`,rt=/^\?+([^+@!?\*\[\(]*)?$/,it=([e,t=``])=>{let n=ct([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},at=([e,t=``])=>{let n=lt([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},ot=([e,t=``])=>{let n=lt([e]);return t?e=>n(e)&&e.endsWith(t):n},st=([e,t=``])=>{let n=ct([e]);return t?e=>n(e)&&e.endsWith(t):n},ct=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},lt=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},ut=typeof process==`object`&&process?{}.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,dt={win32:{sep:`\\`},posix:{sep:`/`}};Ue.sep=ut===`win32`?dt.win32.sep:dt.posix.sep;var ft=Symbol(`globstar **`);Ue.GLOBSTAR=ft;var pt=`[^/]*?`,mt=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,ht=`(?:(?!(?:\\/|^)\\.).)*?`;Ue.filter=(e,t={})=>n=>Ue(n,e,t);var gt=(e,t={})=>Object.assign({},e,t);Ue.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return Ue;let t=Ue;return Object.assign((n,r,i={})=>t(n,r,gt(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,gt(e,n))}static defaults(n){return t.defaults(gt(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,gt(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,gt(e,r))}},unescape:(n,r={})=>t.unescape(n,gt(e,r)),escape:(n,r={})=>t.escape(n,gt(e,r)),filter:(n,r={})=>t.filter(n,gt(e,r)),defaults:n=>t.defaults(gt(e,n)),makeRe:(n,r={})=>t.makeRe(n,gt(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,gt(e,r)),match:(n,r,i={})=>t.match(n,r,gt(e,i)),sep:t.sep,GLOBSTAR:ft})};var _t=(e,t={})=>(ge(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:le(e,{max:t.braceExpandMax}));Ue.braceExpand=_t,Ue.makeRe=(e,t={})=>new bt(e,t).makeRe(),Ue.match=(e,t,n={})=>{let r=new bt(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};var vt=/[?*]|[+@!]\(.*?\)|\[|\]/,yt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),bt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){ge(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||ut,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!vt.test(e[2]))&&!vt.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(ft)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(ft,i),o=t.lastIndexOf(ft),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===ft?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,ee=e.length-u;for(let e of d)e[1]=ee-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===ft)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return _t(this.pattern,this.options)}parse(e){ge(e);let t=this.options;if(e===`**`)return ft;if(e===``)return``;let n,r=null;(n=e.match(et))?r=t.dot?nt:tt:(n=e.match(We))?r=(t.nocase?t.dot?Je:qe:t.dot?Ke:Ge)(n[1]):(n=e.match(rt))?r=(t.nocase?t.dot?at:it:t.dot?ot:st)(n):(n=e.match(Ye))?r=t.dot?Ze:Xe:(n=e.match(Qe))&&(r=$e);let i=Ve.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?pt:t.dot?mt:ht,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?yt(e):e===ft?ft:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==ft||a===ft||(a===void 0?i!==void 0&&i!==ft?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==ft&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=ft))});let i=t.filter(e=>e!==ft);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Ue.defaults(e).Minimatch}};Ue.AST=Ve,Ue.Minimatch=bt,Ue.escape=He,Ue.unescape=Se;var xt={};function St(){throw Error(`gunzipSync is not available in the browser`)}function Ct(){throw Error(`gzipSync is not available in the browser`)}var wt=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends wt{};function Tt(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function Et(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Dt(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Ot(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function kt(e,t){return Dt(e,t,``)}function At(e,t){return Ot(e,t,``)}function jt(e,t){return t.slice(0,Mt(e,t))}function Mt(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Nt(e){let t;for(t=e.length-1;t>=0&&e[t].match(/\s/);t--);return e.substring(t+1)}function Pt(e){let t=e.match(/^\s*/);return t?t[0]:``}var Ft=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,It=RegExp(`[${Ft}]+|\\s+|[^${Ft}]`,`ug`);new class extends wt{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=[];for(let t of Array.from(r.segment(e))){let e=t.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}}else n=e.match(It)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&Lt(n,i,r,e),n=e,r=null,i=null)}),(r||i)&&Lt(n,i,r,null),e}};function Lt(e,t,n,r){if(t&&n){let i=Pt(t.value),a=Nt(t.value),o=Pt(n.value),s=Nt(n.value);if(e){let r=Tt(i,o);e.value=Ot(e.value,o,r),t.value=kt(t.value,r),n.value=kt(n.value,r)}if(r){let e=Et(a,s);r.value=Dt(r.value,s,e),t.value=At(t.value,e),n.value=At(n.value,e)}}else if(n){if(e){let e=Pt(n.value);n.value=n.value.substring(e.length)}if(r){let e=Pt(r.value);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Pt(r.value),i=Pt(t.value),a=Nt(t.value),o=Tt(n,i);t.value=kt(t.value,o);let s=Et(kt(n,o),a);t.value=At(t.value,s),r.value=Dt(r.value,n,s),e.value=Ot(e.value,n,n.slice(0,n.length-s.length))}else if(r){let e=Pt(r.value),n=jt(Nt(t.value),e);t.value=At(t.value,n)}else if(e){let n=jt(Nt(e.value),Pt(t.value));t.value=kt(t.value,n)}}new class extends wt{tokenize(e){let t=RegExp(`(\\r?\\n)|[${Ft}]+|[^\\S\\n\\r]+|[^${Ft}]`,`ug`);return e.match(t)||[]}},new class extends wt{constructor(){super(...arguments),this.tokenize=Rt}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
1
+ import{r as e,t}from"./rolldown-runtime-aKtaBQYM.js";t((e=>{(function(){var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function n(e){return i(o(e),arguments)}function r(e,t){return n.apply(null,[e].concat(t||[]))}function i(e,r){var i=1,a=e.length,o,s=``,c,l,u,d,f,p,m,h;for(c=0;c<a;c++)if(typeof e[c]==`string`)s+=e[c];else if(typeof e[c]==`object`){if(u=e[c],u.keys)for(o=r[i],l=0;l<u.keys.length;l++){if(o==null)throw Error(n(`[sprintf] Cannot access property "%s" of undefined value "%s"`,u.keys[l],u.keys[l-1]));o=o[u.keys[l]]}else o=u.param_no?r[u.param_no]:r[i++];if(t.not_type.test(u.type)&&t.not_primitive.test(u.type)&&o instanceof Function&&(o=o()),t.numeric_arg.test(u.type)&&typeof o!=`number`&&isNaN(o))throw TypeError(n(`[sprintf] expecting number but found %T`,o));switch(t.number.test(u.type)&&(m=o>=0),u.type){case`b`:o=parseInt(o,10).toString(2);break;case`c`:o=String.fromCharCode(parseInt(o,10));break;case`d`:case`i`:o=parseInt(o,10);break;case`j`:o=JSON.stringify(o,null,u.width?parseInt(u.width):0);break;case`e`:o=u.precision?parseFloat(o).toExponential(u.precision):parseFloat(o).toExponential();break;case`f`:o=u.precision?parseFloat(o).toFixed(u.precision):parseFloat(o);break;case`g`:o=u.precision?String(Number(o.toPrecision(u.precision))):parseFloat(o);break;case`o`:o=(parseInt(o,10)>>>0).toString(8);break;case`s`:o=String(o),o=u.precision?o.substring(0,u.precision):o;break;case`t`:o=String(!!o),o=u.precision?o.substring(0,u.precision):o;break;case`T`:o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=u.precision?o.substring(0,u.precision):o;break;case`u`:o=parseInt(o,10)>>>0;break;case`v`:o=o.valueOf(),o=u.precision?o.substring(0,u.precision):o;break;case`x`:o=(parseInt(o,10)>>>0).toString(16);break;case`X`:o=(parseInt(o,10)>>>0).toString(16).toUpperCase();break}t.json.test(u.type)?s+=o:(t.number.test(u.type)&&(!m||u.sign)?(h=m?`+`:`-`,o=o.toString().replace(t.sign,``)):h=``,f=u.pad_char?u.pad_char===`0`?`0`:u.pad_char.charAt(1):` `,p=u.width-(h+o).length,d=u.width&&p>0?f.repeat(p):``,s+=u.align?h+o+d:f===`0`?h+d+o:d+h+o)}return s}var a=Object.create(null);function o(e){if(a[e])return a[e];for(var n=e,r,i=[],o=0;n;){if((r=t.text.exec(n))!==null)i.push(r[0]);else if((r=t.modulo.exec(n))!==null)i.push(`%`);else if((r=t.placeholder.exec(n))!==null){if(r[2]){o|=1;var s=[],c=r[2],l=[];if((l=t.key.exec(c))!==null)for(s.push(l[1]);(c=c.substring(l[0].length))!==``;)if((l=t.key_access.exec(c))!==null)s.push(l[1]);else if((l=t.index_access.exec(c))!==null)s.push(l[1]);else throw SyntaxError(`[sprintf] failed to parse named argument key`);else throw SyntaxError(`[sprintf] failed to parse named argument key`);r[2]=s}else o|=2;if(o===3)throw Error(`[sprintf] mixing positional and named placeholders is not (yet) supported`);i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}else throw SyntaxError(`[sprintf] unexpected placeholder`);n=n.substring(r[0].length)}return a[e]=i}e!==void 0&&(e.sprintf=n,e.vsprintf=r),typeof window<`u`&&(window.sprintf=n,window.vsprintf=r,typeof define==`function`&&define.amd&&define(function(){return{sprintf:n,vsprintf:r}}))})()}))();var n=(e,t,n)=>{let a=e instanceof RegExp?r(e,n):e,o=t instanceof RegExp?r(t,n):t,s=a!==null&&o!=null&&i(a,o,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+a.length,s[1]),post:n.slice(s[1]+o.length)}},r=(e,t)=>{let n=t.match(e);return n?n[0]:null},i=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},a=`\0SLASH`+Math.random()+`\0`,o=`\0OPEN`+Math.random()+`\0`,s=`\0CLOSE`+Math.random()+`\0`,c=`\0COMMA`+Math.random()+`\0`,l=`\0PERIOD`+Math.random()+`\0`,u=new RegExp(a,`g`),d=new RegExp(o,`g`),f=new RegExp(s,`g`),p=new RegExp(c,`g`),m=new RegExp(l,`g`),h=/\\\\/g,ee=/\\{/g,te=/\\}/g,ne=/\\,/g,re=/\\\./g,ie=1e5;function ae(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function oe(e){return e.replace(h,a).replace(ee,o).replace(te,s).replace(ne,c).replace(re,l)}function se(e){return e.replace(u,`\\`).replace(d,`{`).replace(f,`}`).replace(p,`,`).replace(m,`.`)}function ce(e){if(!e)return[``];let t=[],r=n(`{`,`}`,e);if(!r)return e.split(`,`);let{pre:i,body:a,post:o}=r,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;let c=ce(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function le(e,t={}){if(!e)return[];let{max:n=ie}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),me(oe(e),n,!0).map(se)}function ue(e){return`{`+e+`}`}function de(e){return/^-?0\d/.test(e)}function fe(e,t){return e<=t}function pe(e,t){return e>=t}function me(e,t,r){let i=[],a=n(`{`,`}`,e);if(!a)return[e];let o=a.pre,c=a.post.length?me(a.post,t,!1):[``];if(/\$$/.test(a.pre))for(let e=0;e<c.length&&e<t;e++){let t=o+`{`+a.body+`}`+c[e];i.push(t)}else{let n=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),u=n||l,d=a.body.indexOf(`,`)>=0;if(!u&&!d)return a.post.match(/,(?!,).*\}/)?(e=a.pre+`{`+a.body+s+a.post,me(e,t,!0)):[e];let f;if(u)f=a.body.split(/\.\./);else if(f=ce(a.body),f.length===1&&f[0]!==void 0&&(f=me(f[0],t,!1).map(ue),f.length===1))return c.map(e=>a.pre+f[0]+e);let p;if(u&&f[0]!==void 0&&f[1]!==void 0){let e=ae(f[0]),t=ae(f[1]),n=Math.max(f[0].length,f[1].length),r=f.length===3&&f[2]!==void 0?Math.abs(ae(f[2])):1,i=fe;t<e&&(r*=-1,i=pe);let a=f.some(de);p=[];for(let o=e;i(o,t);o+=r){let e;if(l)e=String.fromCharCode(o),e===`\\`&&(e=``);else if(e=String(o),a){let t=n-e.length;if(t>0){let n=Array(t+1).join(`0`);e=o<0?`-`+n+e.slice(1):n+e}}p.push(e)}}else{p=[];for(let e=0;e<f.length;e++)p.push.apply(p,me(f[e],t,!1))}for(let e=0;e<p.length;e++)for(let n=0;n<c.length&&i.length<t;n++){let t=o+p[e]+c[n];(!r||u||t)&&i.push(t)}}return i}var he=1024*64,ge=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>he)throw TypeError(`pattern is too long`)},_e={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},ve=e=>e.replace(/[[\]\\-]/g,`\\$&`),ye=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),be=e=>e.join(``),xe=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(_e))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(ve(d)+`-`+ve(t)):t===d&&r.push(ve(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(ve(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(ve(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[ye(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+be(r)+`]`,p=`[`+(l?``:`^`)+be(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},Se=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`):t?e.replace(/\[([^\/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,`$1$2`).replace(/\\([^\/{}])/g,`$1`),Ce,we=new Set([`!`,`?`,`+`,`*`,`@`]),Te=e=>we.has(e),Ee=e=>Te(e.type),De=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),Oe=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),ke=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Ae=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),je=`(?!(?:^|/)\\.\\.?(?:$|/))`,Me=`(?!\\.)`,Ne=new Set([`[`,`.`]),Pe=new Set([`..`,`.`]),Fe=new Set(`().*{}+?[]^$\\!`),Ie=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Le=`[^/]`,Re=`[^/]*?`,ze=`[^/]+?`,Be=0,Ve=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++Be;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof Ce&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof Ce&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new Ce(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&Te(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new Ce(n,t);u=Ce.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new Ce(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&Te(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new Ce(n,d);d.push(o),u=Ce.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new Ce(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,Oe)}#m(e,t=De){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=ke){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new Ce(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!Ae.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=Ae.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new Ce(null,void 0,t);return Ce.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!Ee(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?Ce.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&Pe.has(this.#r[0]))){let n=Ne,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?je:o?Me:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,Se(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,Se(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?Me:``)+ze;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?Me:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,Se(i),this.#t=!!this.#t,this.#n]}#x(){if(Ee(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(Fe.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?ze:Re,t=!0;continue}else o=!1;if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=xe(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=Le,t=!0;continue}i+=Ie(c)}return[i,Se(e),!!t,a]}};Ce=Ve;var He=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),Ue=(e,t,n={})=>(ge(t),!n.nocomment&&t.charAt(0)===`#`?!1:new bt(t,n).match(e)),We=/^\*+([^+@!?\*\[\(]*)$/,Ge=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),Ke=e=>t=>t.endsWith(e),qe=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),Je=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Ye=/^\*+\.\*+$/,Xe=e=>!e.startsWith(`.`)&&e.includes(`.`),Ze=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Qe=/^\.\*+$/,$e=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),et=/^\*+$/,tt=e=>e.length!==0&&!e.startsWith(`.`),nt=e=>e.length!==0&&e!==`.`&&e!==`..`,rt=/^\?+([^+@!?\*\[\(]*)?$/,it=([e,t=``])=>{let n=ct([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},at=([e,t=``])=>{let n=lt([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},ot=([e,t=``])=>{let n=lt([e]);return t?e=>n(e)&&e.endsWith(t):n},st=([e,t=``])=>{let n=ct([e]);return t?e=>n(e)&&e.endsWith(t):n},ct=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},lt=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},ut=typeof process==`object`&&process?{}.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,dt={win32:{sep:`\\`},posix:{sep:`/`}};Ue.sep=ut===`win32`?dt.win32.sep:dt.posix.sep;var ft=Symbol(`globstar **`);Ue.GLOBSTAR=ft;var pt=`[^/]*?`,mt=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,ht=`(?:(?!(?:\\/|^)\\.).)*?`;Ue.filter=(e,t={})=>n=>Ue(n,e,t);var gt=(e,t={})=>Object.assign({},e,t);Ue.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return Ue;let t=Ue;return Object.assign((n,r,i={})=>t(n,r,gt(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,gt(e,n))}static defaults(n){return t.defaults(gt(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,gt(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,gt(e,r))}},unescape:(n,r={})=>t.unescape(n,gt(e,r)),escape:(n,r={})=>t.escape(n,gt(e,r)),filter:(n,r={})=>t.filter(n,gt(e,r)),defaults:n=>t.defaults(gt(e,n)),makeRe:(n,r={})=>t.makeRe(n,gt(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,gt(e,r)),match:(n,r,i={})=>t.match(n,r,gt(e,i)),sep:t.sep,GLOBSTAR:ft})};var _t=(e,t={})=>(ge(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:le(e,{max:t.braceExpandMax}));Ue.braceExpand=_t,Ue.makeRe=(e,t={})=>new bt(e,t).makeRe(),Ue.match=(e,t,n={})=>{let r=new bt(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};var vt=/[?*]|[+@!]\(.*?\)|\[|\]/,yt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),bt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){ge(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||ut,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!vt.test(e[2]))&&!vt.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(ft)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(ft,i),o=t.lastIndexOf(ft),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===ft?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,ee=e.length-u;for(let e of d)e[1]=ee-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===ft)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return _t(this.pattern,this.options)}parse(e){ge(e);let t=this.options;if(e===`**`)return ft;if(e===``)return``;let n,r=null;(n=e.match(et))?r=t.dot?nt:tt:(n=e.match(We))?r=(t.nocase?t.dot?Je:qe:t.dot?Ke:Ge)(n[1]):(n=e.match(rt))?r=(t.nocase?t.dot?at:it:t.dot?ot:st)(n):(n=e.match(Ye))?r=t.dot?Ze:Xe:(n=e.match(Qe))&&(r=$e);let i=Ve.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?pt:t.dot?mt:ht,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?yt(e):e===ft?ft:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==ft||a===ft||(a===void 0?i!==void 0&&i!==ft?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==ft&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=ft))});let i=t.filter(e=>e!==ft);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Ue.defaults(e).Minimatch}};Ue.AST=Ve,Ue.Minimatch=bt,Ue.escape=He,Ue.unescape=Se;var xt={};function St(){throw Error(`gunzipSync is not available in the browser`)}function Ct(){throw Error(`gzipSync is not available in the browser`)}var wt=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends wt{};function Tt(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function Et(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Dt(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Ot(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function kt(e,t){return Dt(e,t,``)}function At(e,t){return Ot(e,t,``)}function jt(e,t){return t.slice(0,Mt(e,t))}function Mt(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Nt(e){let t;for(t=e.length-1;t>=0&&e[t].match(/\s/);t--);return e.substring(t+1)}function Pt(e){let t=e.match(/^\s*/);return t?t[0]:``}var Ft=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,It=RegExp(`[${Ft}]+|\\s+|[^${Ft}]`,`ug`);new class extends wt{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=[];for(let t of Array.from(r.segment(e))){let e=t.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}}else n=e.match(It)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&Lt(n,i,r,e),n=e,r=null,i=null)}),(r||i)&&Lt(n,i,r,null),e}};function Lt(e,t,n,r){if(t&&n){let i=Pt(t.value),a=Nt(t.value),o=Pt(n.value),s=Nt(n.value);if(e){let r=Tt(i,o);e.value=Ot(e.value,o,r),t.value=kt(t.value,r),n.value=kt(n.value,r)}if(r){let e=Et(a,s);r.value=Dt(r.value,s,e),t.value=At(t.value,e),n.value=At(n.value,e)}}else if(n){if(e){let e=Pt(n.value);n.value=n.value.substring(e.length)}if(r){let e=Pt(r.value);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Pt(r.value),i=Pt(t.value),a=Nt(t.value),o=Tt(n,i);t.value=kt(t.value,o);let s=Et(kt(n,o),a);t.value=At(t.value,s),r.value=Dt(r.value,n,s),e.value=Ot(e.value,n,n.slice(0,n.length-s.length))}else if(r){let e=Pt(r.value),n=jt(Nt(t.value),e);t.value=At(t.value,n)}else if(e){let n=jt(Nt(e.value),Pt(t.value));t.value=kt(t.value,n)}}new class extends wt{tokenize(e){let t=RegExp(`(\\r?\\n)|[${Ft}]+|[^\\S\\n\\r]+|[^${Ft}]`,`ug`);return e.match(t)||[]}},new class extends wt{constructor(){super(...arguments),this.tokenize=Rt}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
2
2
  `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
3
3
  `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
4
4
  `)&&(e=e.slice(0,-1)),t.endsWith(`
@@ -173,7 +173,7 @@ ${o.repeat(a)}}`}return String(e)}var Cl,wl;_({},{base64Command:()=>Tl,flagsForF
173
173
  `&&p.length>0){c++,s=0;let e=a+1;for(let{delim:t,stripTabs:n}of p)for(;!(e>=i);){let a=r.indexOf(`
174
174
  `,e);a===-1&&(a=i);let o=r.slice(e,a),s=n?o.replace(/^\t+/,``):o;l+=r.slice(e,Math.min(a+1,i)),a<i&&c++;let u=a>=i;if(e=a+1,s===t||u)break}p.length=0,s=0,a=Math.min(e,i);continue}if(e===`'`)n=!0,f=``;else if(e===`"`)o=!0,f=``;else if(e===`\\`&&a+1<i)l+=r[a+1],a++,s++,f=``;else if(e===`$`&&a+1<i&&r[a+1]===`{`){a++,s++,l+=r[a],a++,s++;let e=1,t=!1,n=!1;for(;e>0&&a<i;){let o=r[a];if(o===`\\`&&a+1<i&&!t){l+=o,a++,s++,l+=r[a],a++,s++;continue}l+=o,t?o===`'`&&(t=!1):n?o===`"`&&(n=!1):o===`'`?t=!0:o===`"`?n=!0:o===`{`?e++:o===`}`&&e--,o===`
175
175
  `?(c++,s=0):s++,a++}f=``;continue}else if(e===`#`&&!m&&(f===``||/\s/.test(r[a-1]||``))){for(;a+1<i&&r[a+1]!==`
176
- `;)a++,s++,l+=r[a];f=``}else /[a-zA-Z_]/.test(e)?f+=e:(f===`case`?(u++,d=!1):f===`in`&&u>0?d=!0:f===`esac`&&u>0&&(u--,d=!1),f=``,e===`(`?a>0&&r[a-1]===`$`?t++:d||t++:e===`)`?d?d=!1:t--:e===`;`&&u>0&&(a+1<i&&r[a+1]===`;`||a+1<i&&r[a+1]===`&`)&&(d=!0))}e===`
176
+ `;)a++,s++,l+=r[a];f=``}else/[a-zA-Z_]/.test(e)?f+=e:(f===`case`?(u++,d=!1):f===`in`&&u>0?d=!0:f===`esac`&&u>0&&(u--,d=!1),f=``,e===`(`?a>0&&r[a-1]===`$`?t++:d||t++:e===`)`?d?d=!1:t--:e===`;`&&u>0&&(a+1<i&&r[a+1]===`;`||a+1<i&&r[a+1]===`&`)&&(d=!0))}e===`
177
177
  `&&(c++,s=0,f=``),a++,s++}continue}if(e===`$`&&a+1<i&&r[a+1]===`[`&&!f){l+=e,a++,s++,l+=r[a],a++,s++;let t=1;for(;t>0&&a<i;){let e=r[a];l+=e,e===`[`?t++:e===`]`?t--:e===`
178
178
  `&&(c++,s=0),a++,s++}continue}if(e===`$`&&a+1<i&&r[a+1]===`{`&&!f){l+=e,a++,s++,l+=r[a],a++,s++;let t=1,n=!1,o=!1,u=c,d=s,f=c,p=s;for(;t>0&&a<i;){let e=r[a];if(e===`\\`&&a+1<i&&r[a+1]===`
179
179
  `){a+=2,c++,s=1;continue}if(e===`\\`&&a+1<i&&!n){l+=e,a++,s++,l+=r[a],a++,s++;continue}l+=e,n?e===`'`&&(n=!1):o?e===`"`&&(o=!1):e===`'`?(n=!0,u=c,d=s):e===`"`?(o=!0,f=c,p=s):e===`{`?t++:e===`}`&&t--,e===`
@@ -200,13 +200,13 @@ ${o.repeat(a)}}`}return String(e)}var Cl,wl;_({},{base64Command:()=>Tl,flagsForF
200
200
  `,i+=2;break;case`t`:r+=` `,i+=2;break;case`r`:r+=`\r`,i+=2;break;case`\\`:r+=`\\`,i+=2;break;case`'`:r+=`'`,i+=2;break;case`"`:r+=`"`,i+=2;break;case`a`:r+=`\x07`,i+=2;break;case`b`:r+=`\b`,i+=2;break;case`e`:case`E`:r+=`\x1B`,i+=2;break;case`f`:r+=`\f`,i+=2;break;case`v`:r+=`\v`,i+=2;break;case`x`:{let e=[],n=i;for(;n+1<t.length&&t[n]===`\\`&&t[n+1]===`x`;){let r=t.slice(n+2,n+4),i=parseInt(r,16);if(!Number.isNaN(i)&&r.length>0)e.push(i),n+=2+r.length;else break}e.length>0?(r+=Md(e),i=n):(r+=`\\x`,i+=2);break}case`u`:{let e=t.slice(i+2,i+6),n=parseInt(e,16);Number.isNaN(n)?(r+=`\\u`,i+=2):(r+=String.fromCharCode(n),i+=6);break}case`c`:if(i+2<t.length){let e=t[i+2].charCodeAt(0)&31;r+=String.fromCharCode(e),i+=3}else r+=`\\c`,i+=2;break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:{let e=``,n=i+1;for(;n<t.length&&n<i+4&&/[0-7]/.test(t[n]);)e+=t[n],n++;let a=parseInt(e,8);r+=String.fromCharCode(a),i=n;break}default:r+=e,i++}else r+=e,i++}return i<t.length&&t[i]===`'`&&i++,{part:U.literal(r),endIndex:i}}function Bd(e,t){let n=t.trim();return n===``?{type:`ArithmeticExpression`,expression:{type:`ArithNumber`,value:0}}:ud(e,n)}function Vd(e){let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`{`?(r++,n+=a):a===`}`?(r--,n+=a):a===`,`&&r===0?(t.push(n),n=``):n+=a}return t.push(n),t}function Hd(e,t,n,r){let i=Pd(e,t,n,`{`,`}`);if(i===-1)return null;let a=t.slice(n+1,i),o=a.match(/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/);if(o)return{part:{type:`BraceExpansion`,items:[{type:`Range`,start:Number.parseInt(o[1],10),end:Number.parseInt(o[2],10),step:o[3]?Number.parseInt(o[3],10):void 0,startStr:o[1],endStr:o[2]}]},endIndex:i+1};let s=a.match(/^([a-zA-Z])\.\.([a-zA-Z])(?:\.\.(-?\d+))?$/);return s?{part:{type:`BraceExpansion`,items:[{type:`Range`,start:s[1],end:s[2],step:s[3]?Number.parseInt(s[3],10):void 0}]},endIndex:i+1}:a.includes(`,`)&&r?{part:{type:`BraceExpansion`,items:Vd(a).map(t=>({type:`Word`,word:U.word(r(e,t,!1,!1,!1))}))},endIndex:i+1}:a.includes(`,`)?{part:{type:`BraceExpansion`,items:Vd(a).map(e=>({type:`Word`,word:U.word([U.literal(e)])}))},endIndex:i+1}:null}function Ud(e,t){let n=``;for(let r of t.parts)switch(r.type){case`Literal`:n+=r.value;break;case`SingleQuoted`:n+=`'${r.value}'`;break;case`Escaped`:n+=r.value;break;case`DoubleQuoted`:n+=`"`;for(let e of r.parts)e.type===`Literal`||e.type===`Escaped`?n+=e.value:e.type===`ParameterExpansion`&&(n+=`\${${e.parameter}}`);n+=`"`;break;case`ParameterExpansion`:n+=`\${${r.parameter}}`;break;case`Glob`:n+=r.pattern;break;case`TildeExpansion`:n+=`~`,r.user&&(n+=r.user);break;case`BraceExpansion`:{n+=`{`;let t=[];for(let n of r.items)if(n.type===`Range`){let e=n.startStr??String(n.start),r=n.endStr??String(n.end);n.step===void 0?t.push(`${e}..${r}`):t.push(`${e}..${r}..${n.step}`)}else t.push(Ud(e,n.word));t.length===1&&r.items[0].type===`Range`?n+=t[0]:n+=t.join(`,`),n+=`}`;break}default:n+=r.type}return n}function Wd(e,t){return{[W.LESS]:`<`,[W.GREAT]:`>`,[W.DGREAT]:`>>`,[W.LESSAND]:`<&`,[W.GREATAND]:`>&`,[W.LESSGREAT]:`<>`,[W.CLOBBER]:`>|`,[W.TLESS]:`<<<`,[W.AND_GREAT]:`&>`,[W.AND_DGREAT]:`&>>`,[W.DLESS]:`<`,[W.DLESSDASH]:`<`}[t]||`>`}var Gd=g(()=>{ku(),jd(),qu()});function Kd(e){let t=e.current(),n=t.type;if(n===W.NUMBER){let n=e.peek(1);return t.end===n.start?$u.has(n.type):!1}if(n===W.FD_VARIABLE){let t=e.peek(1);return ed.has(t.type)}return Qu.has(n)}function qd(e){let t=null,n;e.check(W.NUMBER)?t=Number.parseInt(e.advance().value,10):e.check(W.FD_VARIABLE)&&(n=e.advance().value);let r=e.advance(),i=Wd(e,r.type);if(r.type===W.DLESS||r.type===W.DLESSDASH)return Jd(e,i,t,r.type===W.DLESSDASH);e.isWord()||e.error(`Expected redirection target`);let a=e.parseWord();return U.redirection(i,a,t,n)}function Jd(e,t,n,r){e.isWord()||e.error(`Expected here-document delimiter`);let i=e.advance(),a=i.value,o=i.quoted||!1;(a.startsWith(`'`)&&a.endsWith(`'`)||a.startsWith(`"`)&&a.endsWith(`"`))&&(a=a.slice(1,-1));let s=U.redirection(r?`<<-`:`<<`,U.hereDoc(a,U.word([]),r,o),n);return e.addPendingHeredoc(s,a,r,o),s}function Yd(e){let t=e.current().line,n=[],r=null,i=[],a=[];for(;e.check(W.ASSIGNMENT_WORD)||Kd(e);)e.checkIterationLimit(),e.check(W.ASSIGNMENT_WORD)?n.push(Xd(e)):a.push(qd(e));if(e.isWord())r=e.parseWord();else if(n.length>0&&(e.check(W.DBRACK_START)||e.check(W.DPAREN_START))){let t=e.advance();r=U.word([U.literal(t.value)])}for(;(!e.isStatementEnd()||e.check(W.RBRACE))&&!e.check(W.PIPE,W.PIPE_AMP);)if(e.checkIterationLimit(),Kd(e))a.push(qd(e));else if(e.check(W.RBRACE)){let t=e.advance();i.push(e.parseWordFromString(t.value,!1,!1))}else if(e.check(W.LBRACE)){let t=e.advance();i.push(e.parseWordFromString(t.value,!1,!1))}else if(e.check(W.DBRACK_END)){let t=e.advance();i.push(e.parseWordFromString(t.value,!1,!1))}else if(e.isWord())i.push(e.parseWord());else if(e.check(W.ASSIGNMENT_WORD)){let t=e.advance(),n=t.value,r=n.endsWith(`=`),a=n.endsWith(`=(`);if((r||a)&&(a||e.check(W.LPAREN))){let t=a?n.slice(0,-2):n.slice(0,-1);a||e.expect(W.LPAREN);let r=Zd(e);e.expect(W.RPAREN);let o=`${t}=(${r.map(t=>Ud(e,t)).join(` `)})`;i.push(e.parseWordFromString(o,!1,!1))}else i.push(e.parseWordFromString(n,t.quoted,t.singleQuoted))}else if(e.check(W.LPAREN))e.error("syntax error near unexpected token `('");else break;let o=U.simpleCommand(r,i,n,a);return o.line=t,o}function Xd(e){let t=e.expect(W.ASSIGNMENT_WORD),n=t.value,r=n.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);r||e.error(`Invalid assignment: ${n}`);let i=r[0],a,o=i.length;if(n[o]===`[`){let t=0,r=o+1;for(;o<n.length;o++)if(n[o]===`[`)t++;else if(n[o]===`]`&&(t--,t===0))break;t!==0&&e.error(`Invalid assignment: ${n}`),a=n.slice(r,o),o++}let s=n[o]===`+`;s&&o++,n[o]!==`=`&&e.error(`Invalid assignment: ${n}`),o++;let c=n.slice(o);if(c===`(`){let t=Zd(e);e.expect(W.RPAREN);let n=a===void 0?i:`${i}[${a}]`;return U.assignment(n,null,s,t)}if(c===``&&e.check(W.LPAREN)){let n=e.current();if(t.end===n.start){e.advance();let t=Zd(e);e.expect(W.RPAREN);let n=a===void 0?i:`${i}[${a}]`;return U.assignment(n,null,s,t)}}let l=c?e.parseWordFromString(c,t.quoted,t.singleQuoted,!0):null,u=a===void 0?i:`${i}[${a}]`;return U.assignment(u,l,s,null)}function Zd(e){let t=[];for(e.skipNewlines();!e.check(W.RPAREN,W.EOF);)e.checkIterationLimit(),e.isWord()?t.push(e.parseWord()):Qd.has(e.current().type)?e.error(`syntax error near unexpected token \`${e.current().value}'`):e.advance(),e.skipNewlines();return t}var Qd,$d=g(()=>{ku(),qu(),nd(),Gd(),Qd=new Set([W.AMP,W.PIPE,W.PIPE_AMP,W.SEMICOLON,W.AND_AND,W.OR_OR,W.DSEMI,W.SEMI_AND,W.SEMI_SEMI_AND])});function ef(e,t){e.expect(W.IF);let n=[],r=e.parseCompoundList();e.expect(W.THEN);let i=e.parseCompoundList();if(i.length===0){let t=e.check(W.FI)?`fi`:e.check(W.ELSE)?`else`:e.check(W.ELIF)?`elif`:`fi`;e.error(`syntax error near unexpected token \`${t}'`)}for(n.push({condition:r,body:i});e.check(W.ELIF);){e.advance();let t=e.parseCompoundList();e.expect(W.THEN);let r=e.parseCompoundList();if(r.length===0){let t=e.check(W.FI)?`fi`:e.check(W.ELSE)?`else`:e.check(W.ELIF)?`elif`:`fi`;e.error(`syntax error near unexpected token \`${t}'`)}n.push({condition:t,body:r})}let a=null;e.check(W.ELSE)&&(e.advance(),a=e.parseCompoundList(),a.length===0&&e.error("syntax error near unexpected token `fi'")),e.expect(W.FI);let o=t?.skipRedirections?[]:e.parseOptionalRedirections();return U.ifNode(n,a,o)}function tf(e,t){let n=e.expect(W.FOR);if(e.check(W.DPAREN_START))return nf(e,t,n.line);e.isWord()||e.error(`Expected variable name in for loop`);let r=e.advance().value,i=null;if(e.skipNewlines(),e.check(W.IN))for(e.advance(),i=[];!e.check(W.SEMICOLON,W.NEWLINE,W.DO,W.EOF)&&e.isWord();)i.push(e.parseWord());e.check(W.SEMICOLON)&&e.advance(),e.skipNewlines(),e.expect(W.DO);let a=e.parseCompoundList();e.expect(W.DONE);let o=t?.skipRedirections?[]:e.parseOptionalRedirections();return U.forNode(r,i,a,o)}function nf(e,t,n){e.expect(W.DPAREN_START);let r=null,i=null,a=null,o=[``,``,``],s=0,c=0;for(;!e.check(W.DPAREN_END,W.EOF);){let t=e.advance();if(t.type===W.SEMICOLON&&c===0){if(s++,s>2)break}else t.value===`(`&&c++,t.value===`)`&&c--,o[s]+=t.value}e.expect(W.DPAREN_END),o[0].trim()&&(r=ud(e,o[0].trim())),o[1].trim()&&(i=ud(e,o[1].trim())),o[2].trim()&&(a=ud(e,o[2].trim())),e.skipNewlines(),e.check(W.SEMICOLON)&&e.advance(),e.skipNewlines();let l;e.check(W.LBRACE)?(e.advance(),l=e.parseCompoundList(),e.expect(W.RBRACE)):(e.expect(W.DO),l=e.parseCompoundList(),e.expect(W.DONE));let u=t?.skipRedirections?[]:e.parseOptionalRedirections();return{type:`CStyleFor`,init:r,condition:i,update:a,body:l,redirections:u,line:n}}function rf(e,t){e.expect(W.WHILE);let n=e.parseCompoundList();e.expect(W.DO);let r=e.parseCompoundList();r.length===0&&e.error("syntax error near unexpected token `done'"),e.expect(W.DONE);let i=t?.skipRedirections?[]:e.parseOptionalRedirections();return U.whileNode(n,r,i)}function af(e,t){e.expect(W.UNTIL);let n=e.parseCompoundList();e.expect(W.DO);let r=e.parseCompoundList();r.length===0&&e.error("syntax error near unexpected token `done'"),e.expect(W.DONE);let i=t?.skipRedirections?[]:e.parseOptionalRedirections();return U.untilNode(n,r,i)}function of(e,t){e.expect(W.CASE),e.isWord()||e.error(`Expected word after 'case'`);let n=e.parseWord();e.skipNewlines(),e.expect(W.IN),e.skipNewlines();let r=[];for(;!e.check(W.ESAC,W.EOF);){e.checkIterationLimit();let t=e.getPos(),n=sf(e);if(n&&r.push(n),e.skipNewlines(),e.getPos()===t&&!n)break}e.expect(W.ESAC);let i=t?.skipRedirections?[]:e.parseOptionalRedirections();return U.caseNode(n,r,i)}function sf(e){e.check(W.LPAREN)&&e.advance();let t=[];for(;e.isWord()&&(t.push(e.parseWord()),e.check(W.PIPE));)e.advance();if(t.length===0)return null;e.expect(W.RPAREN),e.skipNewlines();let n=[];for(;!e.check(W.DSEMI,W.SEMI_AND,W.SEMI_SEMI_AND,W.ESAC,W.EOF);){e.checkIterationLimit(),e.isWord()&&e.peek(1).type===W.RPAREN&&e.error("syntax error near unexpected token `)'"),e.check(W.LPAREN)&&e.peek(1).type===W.WORD&&e.error(`syntax error near unexpected token \`${e.peek(1).value}'`);let t=e.getPos(),r=e.parseStatement();if(r&&n.push(r),e.skipSeparators(!1),e.getPos()===t&&!r)break}let r=`;;`;return e.check(W.DSEMI)?(e.advance(),r=`;;`):e.check(W.SEMI_AND)?(e.advance(),r=`;&`):e.check(W.SEMI_SEMI_AND)&&(e.advance(),r=`;;&`),U.caseItem(t,n,r)}function cf(e,t){e.expect(W.LPAREN);let n=e.parseCompoundList();e.expect(W.RPAREN);let r=t?.skipRedirections?[]:e.parseOptionalRedirections();return U.subshell(n,r)}function lf(e,t){e.expect(W.LBRACE);let n=e.parseCompoundList();e.expect(W.RBRACE);let r=t?.skipRedirections?[]:e.parseOptionalRedirections();return U.group(n,r)}var uf=g(()=>{ku(),jd(),qu()});function df(e){return e.isWord()||e.check(W.LBRACE)||e.check(W.RBRACE)||e.check(W.ASSIGNMENT_WORD)}function ff(e){if(e.check(W.BANG)&&e.peek(1).type===W.LPAREN){e.advance(),e.advance();let t=1,n=`!(`;for(;t>0&&!e.check(W.EOF);)if(e.check(W.LPAREN))t++,n+=`(`,e.advance();else if(e.check(W.RPAREN))t--,t>0&&(n+=`)`),e.advance();else if(e.isWord())n+=e.advance().value;else if(e.check(W.PIPE))n+=`|`,e.advance();else break;return n+=`)`,e.parseWordFromString(n,!1,!1,!1,!1,!0)}return e.parseWordNoBraceExpansion()}function pf(e){return e.skipNewlines(),mf(e)}function mf(e){let t=hf(e);for(e.skipNewlines();e.check(W.OR_OR);){e.advance(),e.skipNewlines();let n=hf(e);t={type:`CondOr`,left:t,right:n},e.skipNewlines()}return t}function hf(e){let t=gf(e);for(e.skipNewlines();e.check(W.AND_AND);){e.advance(),e.skipNewlines();let n=gf(e);t={type:`CondAnd`,left:t,right:n},e.skipNewlines()}return t}function gf(e){return e.skipNewlines(),e.check(W.BANG)?(e.advance(),e.skipNewlines(),{type:`CondNot`,operand:gf(e)}):_f(e)}function _f(e){if(e.check(W.LPAREN)){e.advance();let t=pf(e);return e.expect(W.RPAREN),{type:`CondGroup`,expression:t}}if(df(e)){let t=e.current(),n=t.value;if(yf.includes(n)&&!t.quoted){if(e.advance(),e.check(W.DBRACK_END)&&e.error(`Expected operand after ${n}`),df(e))return{type:`CondUnary`,operator:n,operand:e.parseWordNoBraceExpansion()};let t=e.current();e.error(`unexpected argument \`${t.value}' to conditional unary operator`)}let r=e.parseWordNoBraceExpansion();if(e.isWord()&&bf.includes(e.current().value)){let t=e.advance().value,n;return n=t===`=~`?vf(e):t===`==`||t===`!=`?ff(e):e.parseWordNoBraceExpansion(),{type:`CondBinary`,operator:t,left:r,right:n}}return e.check(W.LESS)?(e.advance(),{type:`CondBinary`,operator:`<`,left:r,right:e.parseWordNoBraceExpansion()}):e.check(W.GREAT)?(e.advance(),{type:`CondBinary`,operator:`>`,left:r,right:e.parseWordNoBraceExpansion()}):e.isWord()&&e.current().value===`=`?(e.advance(),{type:`CondBinary`,operator:`==`,left:r,right:ff(e)}):{type:`CondWord`,word:r}}e.error(`Expected conditional expression`)}function vf(e){let t=[],n=0,r=-1,i=e.getInput(),a=()=>e.check(W.DBRACK_END)||e.check(W.AND_AND)||e.check(W.OR_OR)||e.check(W.NEWLINE)||e.check(W.EOF);for(;!a();){let a=e.current(),o=r>=0&&a.start>r;if(n===0&&o)break;if(n>0&&o){let e=i.slice(r,a.start);t.push({type:`Literal`,value:e})}if(e.isWord()||e.check(W.ASSIGNMENT_WORD)){let n=e.parseWordForRegex();t.push(...n.parts),r=e.peek(-1).end}else if(e.check(W.LPAREN)){let i=e.advance();t.push({type:`Literal`,value:`(`}),n++,r=i.end}else if(e.check(W.DPAREN_START)){let i=e.advance();t.push({type:`Literal`,value:`((`}),n+=2,r=i.end}else if(e.check(W.DPAREN_END))if(n>=2){let i=e.advance();t.push({type:`Literal`,value:`))`}),n-=2,r=i.end}else{if(n===1)break;break}else if(e.check(W.RPAREN))if(n>0){let i=e.advance();t.push({type:`Literal`,value:`)`}),n--,r=i.end}else break;else if(e.check(W.PIPE)){let n=e.advance();t.push({type:`Literal`,value:`|`}),r=n.end}else if(e.check(W.SEMICOLON))if(n>0){let n=e.advance();t.push({type:`Literal`,value:`;`}),r=n.end}else break;else if(n>0&&e.check(W.LESS)){let n=e.advance();t.push({type:`Literal`,value:`<`}),r=n.end}else if(n>0&&e.check(W.GREAT)){let n=e.advance();t.push({type:`Literal`,value:`>`}),r=n.end}else if(n>0&&e.check(W.DGREAT)){let n=e.advance();t.push({type:`Literal`,value:`>>`}),r=n.end}else if(n>0&&e.check(W.DLESS)){let n=e.advance();t.push({type:`Literal`,value:`<<`}),r=n.end}else if(n>0&&e.check(W.LESSAND)){let n=e.advance();t.push({type:`Literal`,value:`<&`}),r=n.end}else if(n>0&&e.check(W.GREATAND)){let n=e.advance();t.push({type:`Literal`,value:`>&`}),r=n.end}else if(n>0&&e.check(W.LESSGREAT)){let n=e.advance();t.push({type:`Literal`,value:`<>`}),r=n.end}else if(n>0&&e.check(W.CLOBBER)){let n=e.advance();t.push({type:`Literal`,value:`>|`}),r=n.end}else if(n>0&&e.check(W.TLESS)){let n=e.advance();t.push({type:`Literal`,value:`<<<`}),r=n.end}else if(n>0&&e.check(W.AMP)){let n=e.advance();t.push({type:`Literal`,value:`&`}),r=n.end}else if(n>0&&e.check(W.LBRACE)){let n=e.advance();t.push({type:`Literal`,value:`{`}),r=n.end}else if(n>0&&e.check(W.RBRACE)){let n=e.advance();t.push({type:`Literal`,value:`}`}),r=n.end}else break}return t.length===0&&e.error(`Expected regex pattern after =~`),{type:`Word`,parts:t}}var yf,bf,xf=g(()=>{qu(),yf=`-a.-b.-c.-d.-e.-f.-g.-h.-k.-p.-r.-s.-t.-u.-w.-x.-G.-L.-N.-O.-S.-z.-n.-o.-v.-R`.split(`.`),bf=[`==`,`!=`,`=~`,`<`,`>`,`-eq`,`-ne`,`-lt`,`-le`,`-gt`,`-ge`,`-nt`,`-ot`,`-ef`]});function Sf(e){return e.length>0?e:[U.literal(``)]}function Cf(e,t){let n=1,r=t+1;for(;r<e.length&&n>0;){let t=e[r];if(t===`\\`){r+=2;continue}if(`@*+?!`.includes(t)&&r+1<e.length&&e[r+1]===`(`){r++,n++,r++;continue}if(t===`(`)n++;else if(t===`)`&&(n--,n===0))return r;r++}return-1}function wf(e,t,n){let r=n+1,i=t[r];if(`@*#?$!-0123456789`.includes(i))return{part:U.parameterExpansion(i),endIndex:r+1};let a=``;for(;r<t.length&&/[a-zA-Z0-9_]/.test(t[r]);)a+=t[r],r++;return{part:U.parameterExpansion(a),endIndex:r}}function Tf(e,t,n,r=!1){let i=n+2,a=!1;t[i]===`!`&&(a=!0,i++);let o=!1;t[i]===`#`&&!/[}:#%/^,]/.test(t[i+1]||`}`)&&(o=!0,i++);let s=``,c=t[i];if(/[@*#?$!-]/.test(c)&&!/[a-zA-Z0-9_]/.test(t[i+1]||``))s=c,i++;else for(;i<t.length&&/[a-zA-Z0-9_]/.test(t[i]);)s+=t[i],i++;if(t[i]===`[`){let r=Pd(e,t,i,`[`,`]`);if(s+=t.slice(i,r+1),i=r+1,t[i]===`[`){let e=1,r=i;for(;r<t.length&&e>0;)t[r]===`{`?e++:t[r]===`}`&&e--,e>0&&r++;let a=t.slice(n+2,r);return{part:U.parameterExpansion(``,{type:`BadSubstitution`,text:a}),endIndex:r+1}}}if(s===``&&!a&&!o&&t[i]!==`}`){let e=1,r=i;for(;r<t.length&&e>0;)t[r]===`{`?e++:t[r]===`}`&&e--,e>0&&r++;if(e>0)throw new td(`unexpected EOF while looking for matching '}'`,0,0);let a=t.slice(n+2,r);return{part:U.parameterExpansion(``,{type:`BadSubstitution`,text:a}),endIndex:r+1}}let l=null;if(a){let n=s.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(n)if(i<t.length&&t[i]!==`}`&&/[:=\-+?#%/^,@]/.test(t[i])){let a=Ef(e,t,i,s,r);a.operation?(l={type:`Indirection`,innerOp:a.operation},i=a.endIndex):(l={type:`ArrayKeys`,array:n[1],star:n[2]===`*`},s=``)}else l={type:`ArrayKeys`,array:n[1],star:n[2]===`*`},s=``;else if(t[i]===`*`||t[i]===`@`&&!/[QPaAEKkuUL]/.test(t[i+1]||``)){let e=t[i];i++,l={type:`VarNamePrefix`,prefix:s,star:e===`*`},s=``}else if(i<t.length&&t[i]!==`}`&&/[:=\-+?#%/^,@]/.test(t[i])){let n=Ef(e,t,i,s,r);n.operation?(l={type:`Indirection`,innerOp:n.operation},i=n.endIndex):l={type:`Indirection`}}else l={type:`Indirection`}}else if(o)if(t[i]===`:`)for(l={type:`LengthSliceError`};i<t.length&&t[i]!==`}`;)i++;else t[i]!==`}`&&/[-+=?]/.test(t[i])||t[i]===`/`?e.error(`\${#${s}${t.slice(i,t.indexOf(`}`,i))}}: bad substitution`):l={type:`Length`};if(!l&&i<t.length&&t[i]!==`}`){let n=Ef(e,t,i,s,r);l=n.operation,i=n.endIndex}if(i<t.length&&t[i]!==`}`){let r=t[i];if(!/[:\-+=?#%/^,@[]/.test(r)){let r=i;for(;r<t.length&&t[r]!==`}`;)r++;let a=t.slice(n,r+1);e.error(`\${${a.slice(2,-1)}}: bad substitution`)}}for(;i<t.length&&t[i]!==`}`;)i++;if(i>=t.length)throw new td(`unexpected EOF while looking for matching '}'`,0,0);return{part:U.parameterExpansion(s,l),endIndex:i+1}}function Ef(e,t,n,r,i=!1){let a=n,o=t[a],s=t[a+1]||``;if(o===`:`){let n=s;if(`-=?+`.includes(n)){a+=2;let r=Fd(e,t,a),o=Af(e,t.slice(a,r),!1,!1,!0,!1,i,!1,!1,!0),s=U.word(Sf(o));if(n===`-`)return{operation:{type:`DefaultValue`,word:s,checkEmpty:!0},endIndex:r};if(n===`=`)return{operation:{type:`AssignDefault`,word:s,checkEmpty:!0},endIndex:r};if(n===`?`)return{operation:{type:`ErrorIfUnset`,word:s,checkEmpty:!0},endIndex:r};if(n===`+`)return{operation:{type:`UseAlternative`,word:s,checkEmpty:!0},endIndex:r}}a++;let r=Fd(e,t,a),o=t.slice(a,r),c=-1,l=0,u=0;for(let e=0;e<o.length;e++){let t=o[e];if(t===`(`||t===`[`)l++;else if(t===`)`||t===`]`)l--;else if(t===`?`&&l===0)u++;else if(t===`:`&&l===0)if(u>0)u--;else{c=e;break}}let d=c>=0?o.slice(0,c):o,f=c>=0?o.slice(c+1):null;return{operation:{type:`Substring`,offset:Bd(e,d),length:f===null?null:Bd(e,f)},endIndex:r}}if(`-=?+`.includes(o)){a++;let n=Fd(e,t,a),r=t.slice(a,n),s=Af(e,r,!1,!1,!0,!1,i,!1,!1,!0),c=U.word(Sf(s));if(o===`-`)return{operation:{type:`DefaultValue`,word:c,checkEmpty:!1},endIndex:n};if(o===`=`)return{operation:{type:`AssignDefault`,word:c,checkEmpty:!1},endIndex:n};if(o===`?`)return{operation:{type:`ErrorIfUnset`,word:r?c:null,checkEmpty:!1},endIndex:n};if(o===`+`)return{operation:{type:`UseAlternative`,word:c,checkEmpty:!1},endIndex:n}}if(o===`#`||o===`%`){let n=s===o,r=o===`#`?`prefix`:`suffix`;a+=n?2:1;let i=Fd(e,t,a),c=Af(e,t.slice(a,i),!1,!1,!1);return{operation:{type:`PatternRemoval`,pattern:U.word(Sf(c)),side:r,greedy:n},endIndex:i}}if(o===`/`){let n=s===`/`;a+=n?2:1;let r=null;t[a]===`#`?(r=`start`,a++):t[a]===`%`&&(r=`end`,a++);let i;i=r!==null&&(t[a]===`/`||t[a]===`}`)?a:Id(e,t,a);let o=Af(e,t.slice(a,i),!1,!1,!1),c=U.word(Sf(o)),l=null,u=i;if(t[i]===`/`){let n=i+1,r=Fd(e,t,n),a=Af(e,t.slice(n,r),!1,!1,!1);l=U.word(Sf(a)),u=r}return{operation:{type:`PatternReplacement`,pattern:c,replacement:l,all:n,anchor:r},endIndex:u}}if(o===`^`||o===`,`){let n=s===o,r=o===`^`?`upper`:`lower`;a+=n?2:1;let i=Fd(e,t,a),c=t.slice(a,i);return{operation:{type:`CaseModification`,direction:r,all:n,pattern:c?U.word([U.literal(c)]):null},endIndex:i}}return o===`@`&&/[QPaAEKkuUL]/.test(s)?{operation:{type:`Transform`,operator:s},endIndex:a+2}:{operation:null,endIndex:a}}function Df(e,t,n,r=!1){let i=n+1;if(i>=t.length)return{part:U.literal(`$`),endIndex:i};let a=t[i];if(a===`(`&&t[i+1]===`(`)return e.isDollarDparenSubshell(t,n)?e.parseCommandSubstitution(t,n):e.parseArithmeticExpansion(t,n);if(a===`[`){let n=1,r=i+1;for(;r<t.length&&n>0;)t[r]===`[`?n++:t[r]===`]`&&n--,n>0&&r++;if(n===0){let n=ud(e,t.slice(i+1,r));return{part:U.arithmeticExpansion(n),endIndex:r+1}}}return a===`(`?e.parseCommandSubstitution(t,n):a===`{`?Tf(e,t,n,r):/[a-zA-Z_0-9@*#?$!-]/.test(a)?wf(e,t,n):{part:U.literal(`$`),endIndex:i}}function Of(e,t){let n=[],r=0,i=``,a=()=>{i&&=(n.push(U.literal(i)),``)};for(;r<t.length;){let o=t[r];if(o===`\\`&&r+1<t.length){let e=t[r+1];if(e===`$`||e==="`"||e===`"`||e===`\\`){i+=e,r+=2;continue}i+=o,r++;continue}if(o===`$`){a();let{part:i,endIndex:o}=Df(e,t,r,!0);i&&n.push(i),r=o;continue}if(o==="`"){a();let{part:i,endIndex:o}=e.parseBacktickSubstitution(t,r,!0);n.push(i),r=o;continue}i+=o,r++}return a(),n}function kf(e,t,n){let r=[],i=n,a=``,o=()=>{a&&=(r.push(U.literal(a)),``)};for(;i<t.length&&t[i]!==`"`;){let n=t[i];if(n===`\\`&&i+1<t.length){let e=t[i+1];if(`"\\$\`
201
201
  `.includes(e)){a+=e,i+=2;continue}a+=n,i++;continue}if(n===`$`){o();let{part:n,endIndex:a}=Df(e,t,i,!0);n&&r.push(n),i=a;continue}if(n==="`"){o();let{part:n,endIndex:a}=e.parseBacktickSubstitution(t,i,!0);r.push(n),i=a;continue}a+=n,i++}return o(),{part:U.doubleQuoted(r),endIndex:i}}function Af(e,t,n=!1,r=!1,i=!1,a=!1,o=!1,s=!1,c=!1,l=!1){if(r)return[U.singleQuoted(t)];if(n){let n=Of(e,t);return[U.doubleQuoted(n)]}if(t.length>=2&&t[0]===`"`&&t[t.length-1]===`"`){let n=t.slice(1,-1),r=!1;for(let e=0;e<n.length;e++){if(n[e]===`"`){r=!0;break}n[e]===`\\`&&e+1<n.length&&e++}if(!r){let t=Of(e,n);return[U.doubleQuoted(t)]}}let u=[],d=0,f=``,p=()=>{f&&=(u.push(U.literal(f)),``)};for(;d<t.length;){let n=t[d];if(n===`\\`&&d+1<t.length){let e=t[d+1];if(c){p(),u.push(U.escaped(e)),d+=2;continue}let n=a?e===`$`||e==="`"||e===`
202
202
  `:e===`$`||e==="`"||e===`"`||e===`'`||e===`
203
- `||l&&e===`}`,r=o?`*?[]\\`.includes(e):`*?[]\\(){}.^+`.includes(e);n?f+=e:r?(p(),u.push(U.escaped(e))):f+=`\\${e}`,d+=2;continue}if(n===`'`&&!o&&!a){p();let e=t.indexOf(`'`,d+1);if(e===-1){f+=t.slice(d);break}u.push(U.singleQuoted(t.slice(d+1,e))),d=e+1;continue}if(n===`"`&&!a){p();let{part:n,endIndex:r}=kf(e,t,d+1);u.push(n),d=r+1;continue}if(n===`$`&&t[d+1]===`'`){p();let{part:n,endIndex:r}=zd(e,t,d+2);u.push(n),d=r;continue}if(n===`$`){p();let{part:n,endIndex:r}=Df(e,t,d);n&&u.push(n),d=r;continue}if(n==="`"){p();let{part:n,endIndex:r}=e.parseBacktickSubstitution(t,d);u.push(n),d=r;continue}if(n===`~`){let n=d>0?t[d-1]:``;if(d===0||n===`=`||i&&n===`:`){let n=Nd(e,t,d),r=t[n];if(r===void 0||r===`/`||r===`:`){p();let e=t.slice(d+1,n)||null;u.push({type:`TildeExpansion`,user:e}),d=n;continue}}}if(`@*+?!`.includes(n)&&d+1<t.length&&t[d+1]===`(`){let e=Cf(t,d+1);if(e!==-1){p();let n=t.slice(d,e+1);u.push({type:`Glob`,pattern:n}),d=e+1;continue}}if(n===`*`||n===`?`||n===`[`){p();let{pattern:n,endIndex:r}=Ld(e,t,d);u.push({type:`Glob`,pattern:n}),d=r;continue}if(n===`{`&&!i&&!s&&!a){let n=Hd(e,t,d,Af);if(n){p(),u.push(n.part),d=n.endIndex;continue}}f+=n,d++}return p(),u}var jf=g(()=>{ku(),jd(),nd(),Gd()}),Mf,K=g(()=>{ku(),jd(),$d(),uf(),xf(),jf(),qu(),Fu(),nd(),nd(),Mf=class e{tokens=[];pos=0;pendingHeredocs=[];parseIterations=0;parseDepth=0;_input=``;getInput(){return this._input}checkIterationLimit(){if(this.parseIterations++,this.parseIterations>Xu)throw new td(`Maximum parse iterations exceeded (possible infinite loop)`,this.current().line,this.current().column)}enterDepth(){if(this.parseDepth++,this.parseDepth>Zu)throw new td(`Maximum parser nesting depth exceeded (${Zu})`,this.current().line,this.current().column);return()=>{this.parseDepth--}}parse(e,t){if(e.length>Ju)throw new td(`Input too large: ${e.length} bytes exceeds limit of ${Ju}`,1,1);this._input=e;let n=new Ku(e,t);if(this.tokens=n.tokenize(),this.tokens.length>Yu)throw new td(`Too many tokens: ${this.tokens.length} exceeds limit of ${Yu}`,1,1);return this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}parseTokens(e){return this.tokens=e,this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}current(){return this.tokens[this.pos]||this.tokens[this.tokens.length-1]}peek(e=0){return this.tokens[this.pos+e]||this.tokens[this.tokens.length-1]}advance(){let e=this.current();return this.pos<this.tokens.length-1&&this.pos++,e}getPos(){return this.pos}check(e,t,n,r,...i){let a=this.tokens[this.pos]?.type;return a===e||t!==void 0&&a===t||n!==void 0&&a===n||r!==void 0&&a===r?!0:i.length>0?i.includes(a):!1}expect(e,t){if(this.check(e))return this.advance();let n=this.current();throw new td(t||`Expected ${e}, got ${n.type}`,n.line,n.column,n)}error(e){let t=this.current();throw new td(e,t.line,t.column,t)}skipNewlines(){for(;this.check(W.NEWLINE,W.COMMENT);)this.check(W.NEWLINE)?(this.advance(),this.processHeredocs()):this.advance()}skipSeparators(e=!0){for(;;){if(this.check(W.NEWLINE)){this.advance(),this.processHeredocs();continue}if(this.check(W.SEMICOLON,W.COMMENT)){this.advance();continue}if(e&&this.check(W.DSEMI,W.SEMI_AND,W.SEMI_SEMI_AND)){this.advance();continue}break}}addPendingHeredoc(e,t,n,r){this.pendingHeredocs.push({redirect:e,delimiter:t,stripTabs:n,quoted:r})}processHeredocs(){for(let e of this.pendingHeredocs)if(this.check(W.HEREDOC_CONTENT)){let t=this.advance(),n;n=e.quoted?U.word([U.literal(t.value)]):this.parseWordFromString(t.value,!1,!1,!1,!0),e.redirect.target=U.hereDoc(e.delimiter,n,e.stripTabs,e.quoted)}this.pendingHeredocs=[]}isStatementEnd(){return this.check(W.EOF,W.NEWLINE,W.SEMICOLON,W.AMP,W.AND_AND,W.OR_OR,W.RPAREN,W.RBRACE,W.DSEMI,W.SEMI_AND,W.SEMI_SEMI_AND)}isCommandStart(){let e=this.current().type;return e===W.WORD||e===W.NAME||e===W.NUMBER||e===W.ASSIGNMENT_WORD||e===W.IF||e===W.FOR||e===W.WHILE||e===W.UNTIL||e===W.CASE||e===W.LPAREN||e===W.LBRACE||e===W.DPAREN_START||e===W.DBRACK_START||e===W.FUNCTION||e===W.BANG||e===W.TIME||e===W.IN||e===W.LESS||e===W.GREAT||e===W.DLESS||e===W.DGREAT||e===W.LESSAND||e===W.GREATAND||e===W.LESSGREAT||e===W.DLESSDASH||e===W.CLOBBER||e===W.TLESS||e===W.AND_GREAT||e===W.AND_DGREAT}parseScript(){let e=[],t=0;for(this.skipNewlines();!this.check(W.EOF);){t++,t>1e4&&this.error(`Parser stuck: too many iterations (>10000)`);let n=this.checkUnexpectedToken();if(n){e.push(n),this.skipSeparators(!1);continue}let r=this.pos,i=this.parseStatement();i&&e.push(i),this.skipSeparators(!1),this.check(W.DSEMI,W.SEMI_AND,W.SEMI_SEMI_AND)&&this.error(`syntax error near unexpected token \`${this.current().value}'`),this.pos===r&&!this.check(W.EOF)&&this.advance()}return U.script(e)}checkUnexpectedToken(){let e=this.current().type,t=this.current().value;if((e===W.DO||e===W.DONE||e===W.THEN||e===W.ELSE||e===W.ELIF||e===W.FI||e===W.ESAC)&&this.error(`syntax error near unexpected token \`${t}'`),e===W.RBRACE||e===W.RPAREN){let e=`syntax error near unexpected token \`${t}'`;return this.advance(),U.statement([U.pipeline([U.simpleCommand(null,[],[],[])])],[],!1,{message:e,token:t})}return(e===W.DSEMI||e===W.SEMI_AND||e===W.SEMI_SEMI_AND)&&this.error(`syntax error near unexpected token \`${t}'`),e===W.SEMICOLON&&this.error(`syntax error near unexpected token \`${t}'`),(e===W.PIPE||e===W.PIPE_AMP)&&this.error(`syntax error near unexpected token \`${t}'`),null}parseStatement(){if(this.skipNewlines(),!this.isCommandStart())return null;let e=this.current().start,t=[],n=[],r=!1,i=this.parsePipeline();for(t.push(i);this.check(W.AND_AND,W.OR_OR);){let e=this.advance();n.push(e.type===W.AND_AND?`&&`:`||`),this.skipNewlines();let r=this.parsePipeline();t.push(r)}this.check(W.AMP)&&(this.advance(),r=!0);let a=this.pos>0?this.tokens[this.pos-1].end:e,o=this._input.slice(e,a);return U.statement(t,n,r,void 0,o)}parsePipeline(){let e=!1,t=!1;this.check(W.TIME)&&(this.advance(),e=!0,this.check(W.WORD,W.NAME)&&this.current().value===`-p`&&(this.advance(),t=!0));let n=0;for(;this.check(W.BANG);)this.advance(),n++;let r=n%2==1,i=[],a=[],o=this.parseCommand();for(i.push(o);this.check(W.PIPE,W.PIPE_AMP);){let e=this.advance();this.skipNewlines(),a.push(e.type===W.PIPE_AMP);let t=this.parseCommand();i.push(t)}return U.pipeline(i,r,e,t,a.length>0?a:void 0)}parseCommand(){return this.check(W.IF)?ef(this):this.check(W.FOR)?tf(this):this.check(W.WHILE)?rf(this):this.check(W.UNTIL)?af(this):this.check(W.CASE)?of(this):this.check(W.LPAREN)?cf(this):this.check(W.LBRACE)?lf(this):this.check(W.DPAREN_START)?this.dparenClosesWithSpacedParens()?this.parseNestedSubshellsFromDparen():this.parseArithmeticCommand():this.check(W.DBRACK_START)?this.parseConditionalCommand():this.check(W.FUNCTION)||this.check(W.NAME,W.WORD)&&this.peek(1).type===W.LPAREN&&this.peek(2).type===W.RPAREN?this.parseFunctionDef():Yd(this)}dparenClosesWithSpacedParens(){let e=1,t=1;for(;t<this.tokens.length-this.pos;){let n=this.peek(t);if(n.type===W.EOF)return!1;if(n.type===W.DPAREN_START||n.type===W.LPAREN)e++;else if(n.type===W.DPAREN_END){if(e-=2,e<=0)return!1}else if(n.type===W.RPAREN&&(e--,e===0&&this.peek(t+1).type===W.RPAREN))return!0;t++}return!1}parseNestedSubshellsFromDparen(){this.advance();let e=this.parseCompoundList();this.expect(W.RPAREN),this.expect(W.RPAREN);let t=this.parseOptionalRedirections(),n=U.subshell(e,[]);return U.subshell([U.statement([U.pipeline([n],!1,!1,!1)])],t)}isWord(){let e=this.current().type;return e===W.WORD||e===W.NAME||e===W.NUMBER||e===W.IF||e===W.FOR||e===W.WHILE||e===W.UNTIL||e===W.CASE||e===W.FUNCTION||e===W.ELSE||e===W.ELIF||e===W.FI||e===W.THEN||e===W.DO||e===W.DONE||e===W.ESAC||e===W.IN||e===W.SELECT||e===W.TIME||e===W.COPROC||e===W.BANG}parseWord(){let e=this.advance();return this.parseWordFromString(e.value,e.quoted,e.singleQuoted)}parseWordNoBraceExpansion(){let e=this.advance();return this.parseWordFromString(e.value,e.quoted,e.singleQuoted,!1,!1,!0)}parseWordForRegex(){let e=this.advance();return this.parseWordFromString(e.value,e.quoted,e.singleQuoted,!1,!1,!0,!0)}parseWordFromString(e,t=!1,n=!1,r=!1,i=!1,a=!1,o=!1){let s=Af(this,e,t,n,r,i,!1,a,o);return U.word(s)}parseCommandSubstitution(t,n){return Nu(t,n,()=>new e,e=>this.error(e))}parseBacktickSubstitution(t,n,r=!1){return Pu(t,n,r,()=>new e,e=>this.error(e))}isDollarDparenSubshell(e,t){return Au(e,t)}parseArithmeticExpansion(e,t){let n=t+3,r=1,i=0,a=n;for(;a<e.length-1&&r>0;)e[a]===`$`&&e[a+1]===`(`?e[a+2]===`(`?(r++,a+=3):(i++,a+=2):e[a]===`(`&&e[a+1]===`(`?(r++,a+=2):e[a]===`)`&&e[a+1]===`)`?i>0?(i--,a++):(r--,r>0&&(a+=2)):e[a]===`(`?(i++,a++):(e[a]===`)`&&i>0&&i--,a++);let o=e.slice(n,a),s=this.parseArithmeticExpression(o);return{part:U.arithmeticExpansion(s),endIndex:a+2}}parseArithmeticCommand(){let e=this.expect(W.DPAREN_START),t=``,n=1,r=0,i=!1,a=!1;for(;n>0&&!this.check(W.EOF);){if(i){if(i=!1,r>0){r--,t+=`)`;continue}if(this.check(W.RPAREN)){n--,a=!0,this.advance();continue}if(this.check(W.DPAREN_END)){n--,a=!0;continue}t+=`)`;continue}if(this.check(W.DPAREN_START))n++,t+=`((`,this.advance();else if(this.check(W.DPAREN_END))r>=2?(r-=2,t+=`))`,this.advance()):r===1?(r--,t+=`)`,i=!0,this.advance()):(n--,a=!0,n>0&&(t+=`))`),this.advance());else if(this.check(W.LPAREN))r++,t+=`(`,this.advance();else if(this.check(W.RPAREN))r>0&&r--,t+=`)`,this.advance();else{let e=this.current().value,n=t.length>0?t[t.length-1]:``;t.length>0&&!t.endsWith(` `)&&!(e===`=`&&/[|&^+\-*/%<>]$/.test(t))&&!(e===`<`&&n===`<`)&&!(e===`>`&&n===`>`)&&(t+=` `),t+=e,this.advance()}}a||this.expect(W.DPAREN_END);let o=this.parseArithmeticExpression(t.trim()),s=this.parseOptionalRedirections();return U.arithmeticCommand(o,s,e.line)}parseConditionalCommand(){let e=this.expect(W.DBRACK_START),t=pf(this);this.expect(W.DBRACK_END);let n=this.parseOptionalRedirections();return U.conditionalCommand(t,n,e.line)}parseFunctionDef(){let e;if(this.check(W.FUNCTION)){if(this.advance(),this.check(W.NAME)||this.check(W.WORD))e=this.advance().value;else{let e=this.current();throw new td(`Expected function name`,e.line,e.column,e)}this.check(W.LPAREN)&&(this.advance(),this.expect(W.RPAREN))}else e=this.advance().value,e.includes(`$`)&&this.error(`\`${e}': not a valid identifier`),this.expect(W.LPAREN),this.expect(W.RPAREN);this.skipNewlines();let t=this.parseCompoundCommandBody({forFunctionBody:!0}),n=this.parseOptionalRedirections();return U.functionDef(e,t,n)}parseCompoundCommandBody(e){let t=e?.forFunctionBody;if(this.check(W.LBRACE))return lf(this,{skipRedirections:t});if(this.check(W.LPAREN))return cf(this,{skipRedirections:t});if(this.check(W.IF))return ef(this,{skipRedirections:t});if(this.check(W.FOR))return tf(this,{skipRedirections:t});if(this.check(W.WHILE))return rf(this,{skipRedirections:t});if(this.check(W.UNTIL))return af(this,{skipRedirections:t});if(this.check(W.CASE))return of(this,{skipRedirections:t});this.error(`Expected compound command for function body`)}parseCompoundList(){let e=this.enterDepth(),t=[];for(this.skipNewlines();!this.check(W.EOF,W.FI,W.ELSE,W.ELIF,W.THEN,W.DO,W.DONE,W.ESAC,W.RPAREN,W.RBRACE,W.DSEMI,W.SEMI_AND,W.SEMI_SEMI_AND)&&this.isCommandStart();){this.checkIterationLimit();let e=this.pos,n=this.parseStatement();if(n&&t.push(n),this.skipSeparators(),this.pos===e&&!n)break}return e(),t}parseOptionalRedirections(){let e=[];for(;Kd(this);){this.checkIterationLimit();let t=this.pos;if(e.push(qd(this)),this.pos===t)break}return e}parseArithmeticExpression(e){return ud(this,e)}}});function Nf(e){return Rf.get(e)??``}function Pf(e){let t=[],n=``,r=0;for(;r<e.length;){let i=e[r];if(i===`[`){for(n+=i,r++,r<e.length&&(e[r]===`!`||e[r]===`^`)&&(n+=e[r],r++),r<e.length&&e[r]===`]`&&(n+=e[r],r++);r<e.length&&e[r]!==`]`;){if(e[r]===`[`&&r+1<e.length&&e[r+1]===`:`){let t=e.indexOf(`:]`,r+2);if(t!==-1){n+=e.slice(r,t+2),r=t+2;continue}}if(e[r]===`\\`&&r+1<e.length){n+=e[r]+e[r+1],r+=2;continue}n+=e[r],r++}r<e.length&&e[r]===`]`&&(n+=e[r],r++)}else i===`:`?(n!==``&&t.push(n),n=``,r++):i===`\\`&&r+1<e.length?(n+=i+e[r+1],r+=2):(n+=i,r++)}return n!==``&&t.push(n),t}function Ff(e){let t=`^`;for(let n=0;n<e.length;n++){let r=e[n];if(r===`*`)t+=`[^/]*`;else if(r===`?`)t+=`[^/]`;else if(r===`[`){let r=n+1,i=`[`;r<e.length&&(e[r]===`^`||e[r]===`!`)&&(i+=`^`,r++),r<e.length&&e[r]===`]`&&(i+=`\\]`,r++);let a=r;for(;a<e.length;){if(e[a]===`\\`&&a+1<e.length){a+=2;continue}if(e[a]===`[`&&a+1<e.length&&e[a+1]===`:`){let t=e.indexOf(`:]`,a+2);if(t!==-1){a=t+2;continue}}if(e[a]===`]`)break;a++}let o=r;for(;r<e.length&&e[r]!==`]`;){if(e[r]===`[`&&r+1<e.length&&e[r+1]===`:`){let t=e.indexOf(`:]`,r+2);if(t!==-1){let n=Nf(e.slice(r+2,t));i+=n,r=t+2;continue}}if(e[r]===`\\`&&r+1<e.length){i+=`\\${e[r+1]}`,r+=2;continue}if(e[r]===`-`){let e=r===o,t=r+1===a;e||t?i+=`\\-`:i+=`-`}else i+=e[r];r++}i+=`]`,t+=i,n=r}else if(r===`\\`&&n+1<e.length){let r=e[n+1];/[.+^${}()|\\*?[\]]/.test(r)?t+=`\\${r}`:t+=r,n++}else /[.+^${}()|]/.test(r)?t+=`\\${r}`:t+=r}return t+=`$`,M(t)}function If(e,t){let n=1,r=t+1;for(;r<e.length&&n>0;){let t=e[r];if(t===`\\`){r+=2;continue}if(t===`(`)n++;else if(t===`)`&&(n--,n===0))return r;r++}return-1}function Lf(e){let t=[],n=``,r=0,i=!1,a=0;for(;a<e.length;){let o=e[a];if(o===`'`&&!i){i=!0,n+=`\0QUOTE_START\0`,a++;continue}if(o===`'`&&i){i=!1,n+=`\0QUOTE_END\0`,a++;continue}if(i){n+=o,a++;continue}if(o===`\\`){n+=o,a+1<e.length?(n+=e[a+1],a+=2):a++;continue}o===`(`?(r++,n+=o):o===`)`?(r--,n+=o):o===`|`&&r===0?(t.push(n),n=``):n+=o,a++}return t.push(n),t}var Rf,zf=g(()=>{ta(),Rf=new Map([[`alnum`,`a-zA-Z0-9`],[`alpha`,`a-zA-Z`],[`ascii`,`\\x00-\\x7F`],[`blank`,` \\t`],[`cntrl`,`\\x00-\\x1F\\x7F`],[`digit`,`0-9`],[`graph`,`!-~`],[`lower`,`a-z`],[`print`,` -~`],[`punct`,"!-/:-@\\[-`{-~"],[`space`,` \\t\\n\\r\\f\\v`],[`upper`,`A-Z`],[`word`,`a-zA-Z0-9_`],[`xdigit`,`0-9a-fA-F`]])}),Bf,Vf,Hf=g(()=>{x(),ta(),tr(),zf(),Bf=5,Vf=class{fs;cwd;globignorePatterns=[];hasGlobignore=!1;globstar=!1;nullglob=!1;failglob=!1;dotglob=!1;extglob=!1;globskipdots=!0;ops={count:0};maxOps;constructor(e,t,n,r){this.fs=e,this.cwd=t,typeof r==`boolean`?(this.globstar=r,this.maxOps=1e5):r?(this.globstar=r.globstar??!1,this.nullglob=r.nullglob??!1,this.failglob=r.failglob??!1,this.dotglob=r.dotglob??!1,this.extglob=r.extglob??!1,this.globskipdots=r.globskipdots??!0,this.maxOps=r.maxGlobOperations??1e5):this.maxOps=1e5;let i=n?.get(`GLOBIGNORE`);i!==void 0&&i!==``&&(this.hasGlobignore=!0,this.globignorePatterns=Pf(i))}checkOpsLimit(){if(++this.ops.count>this.maxOps)throw new b(`Glob operation limit exceeded (${this.maxOps})`,`glob_operations`)}hasNullglob(){return this.nullglob}hasFailglob(){return this.failglob}filterGlobignore(e){return!this.hasGlobignore&&!this.globskipdots?e:e.filter(e=>{let t=e.split(`/`).pop()||e;if((this.hasGlobignore||this.globskipdots)&&(t===`.`||t===`..`))return!1;if(this.hasGlobignore){for(let t of this.globignorePatterns)if(this.matchGlobignorePattern(e,t))return!1}return!0})}matchGlobignorePattern(e,t){return Ff(t).test(e)}isGlobPattern(e){return!!(e.includes(`*`)||e.includes(`?`)||/\[.*\]/.test(e)||this.extglob&&/[@*+?!]\(/.test(e))}async expandArgs(e,t){let n=e.map((e,n)=>(t?.[n]??!1)||!this.isGlobPattern(e)?null:this.expand(e)),r=await Promise.all(n.map(e=>e||Promise.resolve(null))),i=[];for(let t=0;t<e.length;t++){let n=r[t];n===null?i.push(e[t]):n.length>0?i.push(...n):i.push(e[t])}return i}async expand(e){if(this.globstar){let t=e.split(`/`),n=0;for(let e of t)if(e===`**`&&(n++,n>Bf))throw new b(`Glob pattern has too many ** segments (max ${Bf})`,`glob_operations`)}let t;if(e.includes(`**`)&&this.globstar&&this.isGlobstarValid(e))t=await this.expandRecursive(e);else{let n=e.replace(/\*\*+/g,`*`);t=await this.expandSimple(n)}return this.filterGlobignore(t)}isGlobstarValid(e){let t=e.split(`/`);for(let e of t)if(e.includes(`**`)&&e!==`**`)return!1;return!0}hasGlobChars(e){return!!(e.includes(`*`)||e.includes(`?`)||/\[.*\]/.test(e)||this.extglob&&/[@*+?!]\(/.test(e))}async expandSimple(e){let t=e.startsWith(`/`),n=e.split(`/`).filter(e=>e!==``),r=-1;for(let e=0;e<n.length;e++)if(this.hasGlobChars(n[e])){r=e;break}if(r===-1)return[e];let i,a;if(r===0)t?(i=`/`,a=`/`):(i=this.cwd,a=``);else{let e=n.slice(0,r);t?(i=`/${e.join(`/`)}`,a=`/${e.join(`/`)}`):(i=this.fs.resolvePath(this.cwd,e.join(`/`)),a=e.join(`/`))}let o=n.slice(r);return(await this.expandSegments(i,a,o)).sort()}async expandSegments(e,t,n){if(this.checkOpsLimit(),n.length===0)return[t];let[r,...i]=n,a=[];try{if(this.fs.readdirWithFileTypes){this.checkOpsLimit();let n=await this.fs.readdirWithFileTypes(e),o=[],s=[...n],c=this.dotglob||this.hasGlobignore;if(r.startsWith(`.`)||this.dotglob){let e=n.some(e=>e.name===`.`),t=n.some(e=>e.name===`..`);e||s.push({name:`.`,isFile:!1,isDirectory:!0,isSymbolicLink:!1}),t||s.push({name:`..`,isFile:!1,isDirectory:!0,isSymbolicLink:!1})}for(let n of s)if(!(n.name.startsWith(`.`)&&!r.startsWith(`.`)&&!c)&&this.matchPattern(n.name,r)){let r=e===`/`?`/${n.name}`:`${e}/${n.name}`,a;a=t===``?n.name:t===`/`?`/${n.name}`:`${t}/${n.name}`,i.length===0?o.push(Promise.resolve([a])):n.isDirectory&&o.push(this.expandSegments(r,a,i))}let l=await Promise.all(o);for(let e of l)a.push(...e)}else{this.checkOpsLimit();let n=await this.fs.readdir(e),o=[],s=[...n],c=this.dotglob||this.hasGlobignore;(r.startsWith(`.`)||this.dotglob)&&(n.includes(`.`)||s.push(`.`),n.includes(`..`)||s.push(`..`));for(let n of s)if(!(n.startsWith(`.`)&&!r.startsWith(`.`)&&!c)&&this.matchPattern(n,r)){let r=e===`/`?`/${n}`:`${e}/${n}`,a;a=t===``?n:t===`/`?`/${n}`:`${t}/${n}`,i.length===0?o.push(Promise.resolve([a])):o.push((async()=>{try{if(this.checkOpsLimit(),(await this.fs.stat(r)).isDirectory)return this.expandSegments(r,a,i)}catch(e){if(e instanceof b)throw e}return[]})())}let l=await Promise.all(o);for(let e of l)a.push(...e)}}catch(e){if(e instanceof b)throw e}return a}async expandRecursive(e){let t=[],n=e.indexOf(`**`),r=e.slice(0,n).replace(/\/$/,``)||`.`,i=e.slice(n+2).replace(/^\//,``);return i.includes(`**`)&&this.isGlobstarValid(i)?(await this.walkDirectoryMultiGlobstar(r,i,t),[...new Set(t)].sort()):(await this.walkDirectory(r,i,t),t.sort())}async walkDirectoryMultiGlobstar(e,t,n){this.checkOpsLimit();let r=this.fs.resolvePath(this.cwd,e);try{this.checkOpsLimit();let i=this.fs.readdirWithFileTypes?await this.fs.readdirWithFileTypes(r):null;if(i){let r=[];for(let t of i){let n=e===`.`?t.name:`${e}/${t.name}`;t.isDirectory&&r.push(n)}let a=e===`.`?t:`${e}/${t}`,o=await this.expandRecursive(a);n.push(...o);for(let e=0;e<r.length;e+=100){let i=r.slice(e,e+100);await Promise.all(i.map(e=>this.walkDirectoryMultiGlobstar(e,t,n)))}}else{this.checkOpsLimit();let i=await this.fs.readdir(r),a=[];for(let t of i){let n=e===`.`?t:`${e}/${t}`,r=this.fs.resolvePath(this.cwd,n);try{this.checkOpsLimit(),(await this.fs.stat(r)).isDirectory&&a.push(n)}catch(e){if(e instanceof b)throw e}}let o=e===`.`?t:`${e}/${t}`,s=await this.expandRecursive(o);n.push(...s);for(let e=0;e<a.length;e+=100){let r=a.slice(e,e+100);await Promise.all(r.map(e=>this.walkDirectoryMultiGlobstar(e,t,n)))}}}catch(e){if(e instanceof b)throw e}}async walkDirectory(e,t,n){this.checkOpsLimit();let r=this.fs.resolvePath(this.cwd,e);try{if(this.fs.readdirWithFileTypes){this.checkOpsLimit();let i=await this.fs.readdirWithFileTypes(r),a=[],o=[];for(let n of i){let r=e===`.`?n.name:`${e}/${n.name}`;n.isDirectory?o.push(r):t&&this.matchPattern(n.name,t)&&a.push(r)}n.push(...a);for(let e=0;e<o.length;e+=100){let r=o.slice(e,e+100);await Promise.all(r.map(e=>this.walkDirectory(e,t,n)))}}else{this.checkOpsLimit();let i=await this.fs.readdir(r),a=[];for(let t=0;t<i.length;t+=100){let n=i.slice(t,t+100),r=await Promise.all(n.map(async t=>{let n=e===`.`?t:`${e}/${t}`,r=this.fs.resolvePath(this.cwd,n);try{return this.checkOpsLimit(),{name:t,path:n,isDirectory:(await this.fs.stat(r)).isDirectory}}catch(e){if(e instanceof b)throw e;return null}}));a.push(...r.filter(e=>e!==null))}for(let e of a)!e.isDirectory&&t&&this.matchPattern(e.name,t)&&n.push(e.path);let o=a.filter(e=>e.isDirectory);for(let e=0;e<o.length;e+=100){let r=o.slice(e,e+100);await Promise.all(r.map(e=>this.walkDirectory(e.path,t,n)))}}}catch(e){if(e instanceof b)throw e}}matchPattern(e,t){return this.patternToRegex(t).test(e)}patternToRegex(e){return M(`^${this.patternToRegexStr(e)}$`)}patternToRegexStr(e){let t=``,n=!1;for(let r=0;r<e.length;r++){if(e.slice(r,r+13)===`\0QUOTE_START\0`){n=!0,r+=12;continue}if(e.slice(r,r+11)===`\0QUOTE_END\0`){n=!1,r+=10;continue}let i=e[r];if(n){/[.+^${}()|\\*?[\]]/.test(i)?t+=`\\${i}`:t+=i;continue}if(this.extglob&&(i===`@`||i===`*`||i===`+`||i===`?`||i===`!`)&&r+1<e.length&&e[r+1]===`(`){let n=If(e,r+1);if(n!==-1){let a=Lf(e.slice(r+2,n)),o=a.map(e=>this.patternToRegexStr(e)),s=o.length>0?o.join(`|`):`(?:)`;if(i===`@`)t+=`(?:${s})`;else if(i===`*`)t+=`(?:${s})*`;else if(i===`+`)t+=`(?:${s})+`;else if(i===`?`)t+=`(?:${s})?`;else if(i===`!`)if(n<e.length-1){let e=a.map(e=>this.computePatternLength(e));if(e.every(e=>e!==null)&&e.every(t=>t===e[0])&&e[0]!==null){let n=e[0];if(n===0)t+=`(?:.+)`;else{let e=[];n>0&&e.push(`.{0,${n-1}}`),e.push(`.{${n+1},}`),e.push(`(?!(?:${s})).{${n}}`),t+=`(?:${e.join(`|`)})`}}else t+=`(?:(?!(?:${s})).)*?`}else t+=`(?!(?:${s})$).*`;r=n;continue}}if(i===`*`)t+=`.*`;else if(i===`?`)t+=`.`;else if(i===`[`){let n=r+1,i=`[`;n<e.length&&(e[n]===`^`||e[n]===`!`)&&(i+=`^`,n++),n<e.length&&e[n]===`]`&&(i+=`\\]`,n++);let a=n;for(;a<e.length;){if(e[a]===`\\`&&a+1<e.length){a+=2;continue}if(e[a]===`[`&&a+1<e.length&&e[a+1]===`:`){let t=e.indexOf(`:]`,a+2);if(t!==-1){a=t+2;continue}}if(e[a]===`]`)break;a++}let o=n;for(;n<e.length&&e[n]!==`]`;){if(e[n]===`[`&&n+1<e.length&&e[n+1]===`:`){let t=e.indexOf(`:]`,n+2);if(t!==-1){let r=Nf(e.slice(n+2,t));i+=r,n=t+2;continue}}if(e[n]===`\\`&&n+1<e.length){i+=`\\${e[n+1]}`,n+=2;continue}if(e[n]===`-`){let e=n===o,t=n+1===a;e||t?i+=`\\-`:i+=`-`}else i+=e[n];n++}i+=`]`,t+=i,r=n}else if(i===`\\`&&r+1<e.length){let n=e[r+1];/[.+^${}()|\\*?[\]]/.test(n)?t+=`\\${n}`:t+=n,r++}else /[.+^${}()|]/.test(i)?t+=`\\${i}`:t+=i}return t}computePatternLength(e){let t=0,n=0,r=!1;for(;n<e.length;){if(e.slice(n,n+13)===`\0QUOTE_START\0`){r=!0,n+=13;continue}if(e.slice(n,n+11)===`\0QUOTE_END\0`){r=!1,n+=11;continue}let i=e[n];if(r){t+=1,n++;continue}if((i===`@`||i===`*`||i===`+`||i===`?`||i===`!`)&&n+1<e.length&&e[n+1]===`(`){let r=If(e,n+1);if(r!==-1){if(i===`@`){let i=Lf(e.slice(n+2,r)).map(e=>this.computePatternLength(e));if(i.every(e=>e!==null)&&i.every(e=>e===i[0])){t+=i[0],n=r+1;continue}return null}return null}}if(i===`*`)return null;if(i===`?`){t+=1,n++;continue}if(i===`[`){let r=e.indexOf(`]`,n+1);if(r!==-1){t+=1,n=r+1;continue}t+=1,n++;continue}if(i===`\\`){t+=1,n+=2;continue}t+=1,n++}return t}}});function Uf(e){for(let t=0;t<e.length;t++){if(e[t]===`\\`){t++;continue}if(e[t]===`$`){let n=e[t+1];if(n===`{`||n&&/[a-zA-Z_]/.test(n))return!0}}return!1}function Wf(e){if(!e.operation)return!1;let t=e.operation,n;if((t.type===`DefaultValue`||t.type===`AssignDefault`||t.type===`UseAlternative`||t.type===`ErrorIfUnset`)&&(n=t.word?.parts),!n)return!1;for(let e of n)if(e.type===`DoubleQuoted`||e.type===`SingleQuoted`)return!0;return!1}function Gf(e){if(!e.operation)return!1;let t=e.operation,n;if((t.type===`DefaultValue`||t.type===`AssignDefault`||t.type===`UseAlternative`||t.type===`ErrorIfUnset`)&&(n=t.word?.parts),!n||n.length===0)return!1;for(let e of n)if(e.type!==`DoubleQuoted`&&e.type!==`SingleQuoted`)return!1;return!0}function Kf(e){let t=!1,n=!1,r=!1,i=!1,a=!1,o=!1,s=!1;for(let c of e){if((c.type===`SingleQuoted`||c.type===`DoubleQuoted`)&&(t=!0,c.type===`DoubleQuoted`))for(let e of c.parts)e.type===`ParameterExpansion`&&(e.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/)&&(!e.operation||e.operation.type===`PatternRemoval`||e.operation.type===`PatternReplacement`)&&(i=!0),(e.operation?.type===`VarNamePrefix`||e.operation?.type===`ArrayKeys`)&&(o=!0),e.operation?.type===`Indirection`&&(s=!0));c.type===`CommandSubstitution`&&(n=!0),c.type===`ParameterExpansion`&&(a=!0,(c.parameter===`@`||c.parameter===`*`)&&(r=!0),Wf(c)&&(t=!0),(c.operation?.type===`VarNamePrefix`||c.operation?.type===`ArrayKeys`)&&(o=!0),c.operation?.type===`Indirection`&&(s=!0)),c.type===`Glob`&&Uf(c.pattern)&&(a=!0)}return{hasQuoted:t,hasCommandSub:n,hasArrayVar:r,hasArrayAtExpansion:i,hasParamExpansion:a,hasVarNamePrefixExpansion:o,hasIndirection:s}}var qf=g(()=>{});function Jf(e,t){let n=`${t}_`,r=[];for(let t of e.state.env.keys())if(t.startsWith(n)){let e=t.slice(n.length),i=Number.parseInt(e,10);!Number.isNaN(i)&&String(i)===e&&r.push(i)}return r.sort((e,t)=>e-t)}function Yf(e,t){let n=`${t}_`,r=`${t}__length`,i=[];for(let t of e.state.env.keys())if(t!==r&&t.startsWith(n)){let e=t.slice(n.length);if(e.startsWith(`_length`))continue;i.push(e)}return i.sort()}function Xf(e){return e.startsWith(`'`)&&e.endsWith(`'`)||e.startsWith(`"`)&&e.endsWith(`"`)?e.slice(1,-1):e}var Zf=g(()=>{});function Qf(e){return e.get(`IFS`)??`
203
+ `||l&&e===`}`,r=o?`*?[]\\`.includes(e):`*?[]\\(){}.^+`.includes(e);n?f+=e:r?(p(),u.push(U.escaped(e))):f+=`\\${e}`,d+=2;continue}if(n===`'`&&!o&&!a){p();let e=t.indexOf(`'`,d+1);if(e===-1){f+=t.slice(d);break}u.push(U.singleQuoted(t.slice(d+1,e))),d=e+1;continue}if(n===`"`&&!a){p();let{part:n,endIndex:r}=kf(e,t,d+1);u.push(n),d=r+1;continue}if(n===`$`&&t[d+1]===`'`){p();let{part:n,endIndex:r}=zd(e,t,d+2);u.push(n),d=r;continue}if(n===`$`){p();let{part:n,endIndex:r}=Df(e,t,d);n&&u.push(n),d=r;continue}if(n==="`"){p();let{part:n,endIndex:r}=e.parseBacktickSubstitution(t,d);u.push(n),d=r;continue}if(n===`~`){let n=d>0?t[d-1]:``;if(d===0||n===`=`||i&&n===`:`){let n=Nd(e,t,d),r=t[n];if(r===void 0||r===`/`||r===`:`){p();let e=t.slice(d+1,n)||null;u.push({type:`TildeExpansion`,user:e}),d=n;continue}}}if(`@*+?!`.includes(n)&&d+1<t.length&&t[d+1]===`(`){let e=Cf(t,d+1);if(e!==-1){p();let n=t.slice(d,e+1);u.push({type:`Glob`,pattern:n}),d=e+1;continue}}if(n===`*`||n===`?`||n===`[`){p();let{pattern:n,endIndex:r}=Ld(e,t,d);u.push({type:`Glob`,pattern:n}),d=r;continue}if(n===`{`&&!i&&!s&&!a){let n=Hd(e,t,d,Af);if(n){p(),u.push(n.part),d=n.endIndex;continue}}f+=n,d++}return p(),u}var jf=g(()=>{ku(),jd(),nd(),Gd()}),Mf,K=g(()=>{ku(),jd(),$d(),uf(),xf(),jf(),qu(),Fu(),nd(),nd(),Mf=class e{tokens=[];pos=0;pendingHeredocs=[];parseIterations=0;parseDepth=0;_input=``;getInput(){return this._input}checkIterationLimit(){if(this.parseIterations++,this.parseIterations>Xu)throw new td(`Maximum parse iterations exceeded (possible infinite loop)`,this.current().line,this.current().column)}enterDepth(){if(this.parseDepth++,this.parseDepth>Zu)throw new td(`Maximum parser nesting depth exceeded (${Zu})`,this.current().line,this.current().column);return()=>{this.parseDepth--}}parse(e,t){if(e.length>Ju)throw new td(`Input too large: ${e.length} bytes exceeds limit of ${Ju}`,1,1);this._input=e;let n=new Ku(e,t);if(this.tokens=n.tokenize(),this.tokens.length>Yu)throw new td(`Too many tokens: ${this.tokens.length} exceeds limit of ${Yu}`,1,1);return this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}parseTokens(e){return this.tokens=e,this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}current(){return this.tokens[this.pos]||this.tokens[this.tokens.length-1]}peek(e=0){return this.tokens[this.pos+e]||this.tokens[this.tokens.length-1]}advance(){let e=this.current();return this.pos<this.tokens.length-1&&this.pos++,e}getPos(){return this.pos}check(e,t,n,r,...i){let a=this.tokens[this.pos]?.type;return a===e||t!==void 0&&a===t||n!==void 0&&a===n||r!==void 0&&a===r?!0:i.length>0?i.includes(a):!1}expect(e,t){if(this.check(e))return this.advance();let n=this.current();throw new td(t||`Expected ${e}, got ${n.type}`,n.line,n.column,n)}error(e){let t=this.current();throw new td(e,t.line,t.column,t)}skipNewlines(){for(;this.check(W.NEWLINE,W.COMMENT);)this.check(W.NEWLINE)?(this.advance(),this.processHeredocs()):this.advance()}skipSeparators(e=!0){for(;;){if(this.check(W.NEWLINE)){this.advance(),this.processHeredocs();continue}if(this.check(W.SEMICOLON,W.COMMENT)){this.advance();continue}if(e&&this.check(W.DSEMI,W.SEMI_AND,W.SEMI_SEMI_AND)){this.advance();continue}break}}addPendingHeredoc(e,t,n,r){this.pendingHeredocs.push({redirect:e,delimiter:t,stripTabs:n,quoted:r})}processHeredocs(){for(let e of this.pendingHeredocs)if(this.check(W.HEREDOC_CONTENT)){let t=this.advance(),n;n=e.quoted?U.word([U.literal(t.value)]):this.parseWordFromString(t.value,!1,!1,!1,!0),e.redirect.target=U.hereDoc(e.delimiter,n,e.stripTabs,e.quoted)}this.pendingHeredocs=[]}isStatementEnd(){return this.check(W.EOF,W.NEWLINE,W.SEMICOLON,W.AMP,W.AND_AND,W.OR_OR,W.RPAREN,W.RBRACE,W.DSEMI,W.SEMI_AND,W.SEMI_SEMI_AND)}isCommandStart(){let e=this.current().type;return e===W.WORD||e===W.NAME||e===W.NUMBER||e===W.ASSIGNMENT_WORD||e===W.IF||e===W.FOR||e===W.WHILE||e===W.UNTIL||e===W.CASE||e===W.LPAREN||e===W.LBRACE||e===W.DPAREN_START||e===W.DBRACK_START||e===W.FUNCTION||e===W.BANG||e===W.TIME||e===W.IN||e===W.LESS||e===W.GREAT||e===W.DLESS||e===W.DGREAT||e===W.LESSAND||e===W.GREATAND||e===W.LESSGREAT||e===W.DLESSDASH||e===W.CLOBBER||e===W.TLESS||e===W.AND_GREAT||e===W.AND_DGREAT}parseScript(){let e=[],t=0;for(this.skipNewlines();!this.check(W.EOF);){t++,t>1e4&&this.error(`Parser stuck: too many iterations (>10000)`);let n=this.checkUnexpectedToken();if(n){e.push(n),this.skipSeparators(!1);continue}let r=this.pos,i=this.parseStatement();i&&e.push(i),this.skipSeparators(!1),this.check(W.DSEMI,W.SEMI_AND,W.SEMI_SEMI_AND)&&this.error(`syntax error near unexpected token \`${this.current().value}'`),this.pos===r&&!this.check(W.EOF)&&this.advance()}return U.script(e)}checkUnexpectedToken(){let e=this.current().type,t=this.current().value;if((e===W.DO||e===W.DONE||e===W.THEN||e===W.ELSE||e===W.ELIF||e===W.FI||e===W.ESAC)&&this.error(`syntax error near unexpected token \`${t}'`),e===W.RBRACE||e===W.RPAREN){let e=`syntax error near unexpected token \`${t}'`;return this.advance(),U.statement([U.pipeline([U.simpleCommand(null,[],[],[])])],[],!1,{message:e,token:t})}return(e===W.DSEMI||e===W.SEMI_AND||e===W.SEMI_SEMI_AND)&&this.error(`syntax error near unexpected token \`${t}'`),e===W.SEMICOLON&&this.error(`syntax error near unexpected token \`${t}'`),(e===W.PIPE||e===W.PIPE_AMP)&&this.error(`syntax error near unexpected token \`${t}'`),null}parseStatement(){if(this.skipNewlines(),!this.isCommandStart())return null;let e=this.current().start,t=[],n=[],r=!1,i=this.parsePipeline();for(t.push(i);this.check(W.AND_AND,W.OR_OR);){let e=this.advance();n.push(e.type===W.AND_AND?`&&`:`||`),this.skipNewlines();let r=this.parsePipeline();t.push(r)}this.check(W.AMP)&&(this.advance(),r=!0);let a=this.pos>0?this.tokens[this.pos-1].end:e,o=this._input.slice(e,a);return U.statement(t,n,r,void 0,o)}parsePipeline(){let e=!1,t=!1;this.check(W.TIME)&&(this.advance(),e=!0,this.check(W.WORD,W.NAME)&&this.current().value===`-p`&&(this.advance(),t=!0));let n=0;for(;this.check(W.BANG);)this.advance(),n++;let r=n%2==1,i=[],a=[],o=this.parseCommand();for(i.push(o);this.check(W.PIPE,W.PIPE_AMP);){let e=this.advance();this.skipNewlines(),a.push(e.type===W.PIPE_AMP);let t=this.parseCommand();i.push(t)}return U.pipeline(i,r,e,t,a.length>0?a:void 0)}parseCommand(){return this.check(W.IF)?ef(this):this.check(W.FOR)?tf(this):this.check(W.WHILE)?rf(this):this.check(W.UNTIL)?af(this):this.check(W.CASE)?of(this):this.check(W.LPAREN)?cf(this):this.check(W.LBRACE)?lf(this):this.check(W.DPAREN_START)?this.dparenClosesWithSpacedParens()?this.parseNestedSubshellsFromDparen():this.parseArithmeticCommand():this.check(W.DBRACK_START)?this.parseConditionalCommand():this.check(W.FUNCTION)||this.check(W.NAME,W.WORD)&&this.peek(1).type===W.LPAREN&&this.peek(2).type===W.RPAREN?this.parseFunctionDef():Yd(this)}dparenClosesWithSpacedParens(){let e=1,t=1;for(;t<this.tokens.length-this.pos;){let n=this.peek(t);if(n.type===W.EOF)return!1;if(n.type===W.DPAREN_START||n.type===W.LPAREN)e++;else if(n.type===W.DPAREN_END){if(e-=2,e<=0)return!1}else if(n.type===W.RPAREN&&(e--,e===0&&this.peek(t+1).type===W.RPAREN))return!0;t++}return!1}parseNestedSubshellsFromDparen(){this.advance();let e=this.parseCompoundList();this.expect(W.RPAREN),this.expect(W.RPAREN);let t=this.parseOptionalRedirections(),n=U.subshell(e,[]);return U.subshell([U.statement([U.pipeline([n],!1,!1,!1)])],t)}isWord(){let e=this.current().type;return e===W.WORD||e===W.NAME||e===W.NUMBER||e===W.IF||e===W.FOR||e===W.WHILE||e===W.UNTIL||e===W.CASE||e===W.FUNCTION||e===W.ELSE||e===W.ELIF||e===W.FI||e===W.THEN||e===W.DO||e===W.DONE||e===W.ESAC||e===W.IN||e===W.SELECT||e===W.TIME||e===W.COPROC||e===W.BANG}parseWord(){let e=this.advance();return this.parseWordFromString(e.value,e.quoted,e.singleQuoted)}parseWordNoBraceExpansion(){let e=this.advance();return this.parseWordFromString(e.value,e.quoted,e.singleQuoted,!1,!1,!0)}parseWordForRegex(){let e=this.advance();return this.parseWordFromString(e.value,e.quoted,e.singleQuoted,!1,!1,!0,!0)}parseWordFromString(e,t=!1,n=!1,r=!1,i=!1,a=!1,o=!1){let s=Af(this,e,t,n,r,i,!1,a,o);return U.word(s)}parseCommandSubstitution(t,n){return Nu(t,n,()=>new e,e=>this.error(e))}parseBacktickSubstitution(t,n,r=!1){return Pu(t,n,r,()=>new e,e=>this.error(e))}isDollarDparenSubshell(e,t){return Au(e,t)}parseArithmeticExpansion(e,t){let n=t+3,r=1,i=0,a=n;for(;a<e.length-1&&r>0;)e[a]===`$`&&e[a+1]===`(`?e[a+2]===`(`?(r++,a+=3):(i++,a+=2):e[a]===`(`&&e[a+1]===`(`?(r++,a+=2):e[a]===`)`&&e[a+1]===`)`?i>0?(i--,a++):(r--,r>0&&(a+=2)):e[a]===`(`?(i++,a++):(e[a]===`)`&&i>0&&i--,a++);let o=e.slice(n,a),s=this.parseArithmeticExpression(o);return{part:U.arithmeticExpansion(s),endIndex:a+2}}parseArithmeticCommand(){let e=this.expect(W.DPAREN_START),t=``,n=1,r=0,i=!1,a=!1;for(;n>0&&!this.check(W.EOF);){if(i){if(i=!1,r>0){r--,t+=`)`;continue}if(this.check(W.RPAREN)){n--,a=!0,this.advance();continue}if(this.check(W.DPAREN_END)){n--,a=!0;continue}t+=`)`;continue}if(this.check(W.DPAREN_START))n++,t+=`((`,this.advance();else if(this.check(W.DPAREN_END))r>=2?(r-=2,t+=`))`,this.advance()):r===1?(r--,t+=`)`,i=!0,this.advance()):(n--,a=!0,n>0&&(t+=`))`),this.advance());else if(this.check(W.LPAREN))r++,t+=`(`,this.advance();else if(this.check(W.RPAREN))r>0&&r--,t+=`)`,this.advance();else{let e=this.current().value,n=t.length>0?t[t.length-1]:``;t.length>0&&!t.endsWith(` `)&&!(e===`=`&&/[|&^+\-*/%<>]$/.test(t))&&!(e===`<`&&n===`<`)&&!(e===`>`&&n===`>`)&&(t+=` `),t+=e,this.advance()}}a||this.expect(W.DPAREN_END);let o=this.parseArithmeticExpression(t.trim()),s=this.parseOptionalRedirections();return U.arithmeticCommand(o,s,e.line)}parseConditionalCommand(){let e=this.expect(W.DBRACK_START),t=pf(this);this.expect(W.DBRACK_END);let n=this.parseOptionalRedirections();return U.conditionalCommand(t,n,e.line)}parseFunctionDef(){let e;if(this.check(W.FUNCTION)){if(this.advance(),this.check(W.NAME)||this.check(W.WORD))e=this.advance().value;else{let e=this.current();throw new td(`Expected function name`,e.line,e.column,e)}this.check(W.LPAREN)&&(this.advance(),this.expect(W.RPAREN))}else e=this.advance().value,e.includes(`$`)&&this.error(`\`${e}': not a valid identifier`),this.expect(W.LPAREN),this.expect(W.RPAREN);this.skipNewlines();let t=this.parseCompoundCommandBody({forFunctionBody:!0}),n=this.parseOptionalRedirections();return U.functionDef(e,t,n)}parseCompoundCommandBody(e){let t=e?.forFunctionBody;if(this.check(W.LBRACE))return lf(this,{skipRedirections:t});if(this.check(W.LPAREN))return cf(this,{skipRedirections:t});if(this.check(W.IF))return ef(this,{skipRedirections:t});if(this.check(W.FOR))return tf(this,{skipRedirections:t});if(this.check(W.WHILE))return rf(this,{skipRedirections:t});if(this.check(W.UNTIL))return af(this,{skipRedirections:t});if(this.check(W.CASE))return of(this,{skipRedirections:t});this.error(`Expected compound command for function body`)}parseCompoundList(){let e=this.enterDepth(),t=[];for(this.skipNewlines();!this.check(W.EOF,W.FI,W.ELSE,W.ELIF,W.THEN,W.DO,W.DONE,W.ESAC,W.RPAREN,W.RBRACE,W.DSEMI,W.SEMI_AND,W.SEMI_SEMI_AND)&&this.isCommandStart();){this.checkIterationLimit();let e=this.pos,n=this.parseStatement();if(n&&t.push(n),this.skipSeparators(),this.pos===e&&!n)break}return e(),t}parseOptionalRedirections(){let e=[];for(;Kd(this);){this.checkIterationLimit();let t=this.pos;if(e.push(qd(this)),this.pos===t)break}return e}parseArithmeticExpression(e){return ud(this,e)}}});function Nf(e){return Rf.get(e)??``}function Pf(e){let t=[],n=``,r=0;for(;r<e.length;){let i=e[r];if(i===`[`){for(n+=i,r++,r<e.length&&(e[r]===`!`||e[r]===`^`)&&(n+=e[r],r++),r<e.length&&e[r]===`]`&&(n+=e[r],r++);r<e.length&&e[r]!==`]`;){if(e[r]===`[`&&r+1<e.length&&e[r+1]===`:`){let t=e.indexOf(`:]`,r+2);if(t!==-1){n+=e.slice(r,t+2),r=t+2;continue}}if(e[r]===`\\`&&r+1<e.length){n+=e[r]+e[r+1],r+=2;continue}n+=e[r],r++}r<e.length&&e[r]===`]`&&(n+=e[r],r++)}else i===`:`?(n!==``&&t.push(n),n=``,r++):i===`\\`&&r+1<e.length?(n+=i+e[r+1],r+=2):(n+=i,r++)}return n!==``&&t.push(n),t}function Ff(e){let t=`^`;for(let n=0;n<e.length;n++){let r=e[n];if(r===`*`)t+=`[^/]*`;else if(r===`?`)t+=`[^/]`;else if(r===`[`){let r=n+1,i=`[`;r<e.length&&(e[r]===`^`||e[r]===`!`)&&(i+=`^`,r++),r<e.length&&e[r]===`]`&&(i+=`\\]`,r++);let a=r;for(;a<e.length;){if(e[a]===`\\`&&a+1<e.length){a+=2;continue}if(e[a]===`[`&&a+1<e.length&&e[a+1]===`:`){let t=e.indexOf(`:]`,a+2);if(t!==-1){a=t+2;continue}}if(e[a]===`]`)break;a++}let o=r;for(;r<e.length&&e[r]!==`]`;){if(e[r]===`[`&&r+1<e.length&&e[r+1]===`:`){let t=e.indexOf(`:]`,r+2);if(t!==-1){let n=Nf(e.slice(r+2,t));i+=n,r=t+2;continue}}if(e[r]===`\\`&&r+1<e.length){i+=`\\${e[r+1]}`,r+=2;continue}if(e[r]===`-`){let e=r===o,t=r+1===a;e||t?i+=`\\-`:i+=`-`}else i+=e[r];r++}i+=`]`,t+=i,n=r}else if(r===`\\`&&n+1<e.length){let r=e[n+1];/[.+^${}()|\\*?[\]]/.test(r)?t+=`\\${r}`:t+=r,n++}else/[.+^${}()|]/.test(r)?t+=`\\${r}`:t+=r}return t+=`$`,M(t)}function If(e,t){let n=1,r=t+1;for(;r<e.length&&n>0;){let t=e[r];if(t===`\\`){r+=2;continue}if(t===`(`)n++;else if(t===`)`&&(n--,n===0))return r;r++}return-1}function Lf(e){let t=[],n=``,r=0,i=!1,a=0;for(;a<e.length;){let o=e[a];if(o===`'`&&!i){i=!0,n+=`\0QUOTE_START\0`,a++;continue}if(o===`'`&&i){i=!1,n+=`\0QUOTE_END\0`,a++;continue}if(i){n+=o,a++;continue}if(o===`\\`){n+=o,a+1<e.length?(n+=e[a+1],a+=2):a++;continue}o===`(`?(r++,n+=o):o===`)`?(r--,n+=o):o===`|`&&r===0?(t.push(n),n=``):n+=o,a++}return t.push(n),t}var Rf,zf=g(()=>{ta(),Rf=new Map([[`alnum`,`a-zA-Z0-9`],[`alpha`,`a-zA-Z`],[`ascii`,`\\x00-\\x7F`],[`blank`,` \\t`],[`cntrl`,`\\x00-\\x1F\\x7F`],[`digit`,`0-9`],[`graph`,`!-~`],[`lower`,`a-z`],[`print`,` -~`],[`punct`,"!-/:-@\\[-`{-~"],[`space`,` \\t\\n\\r\\f\\v`],[`upper`,`A-Z`],[`word`,`a-zA-Z0-9_`],[`xdigit`,`0-9a-fA-F`]])}),Bf,Vf,Hf=g(()=>{x(),ta(),tr(),zf(),Bf=5,Vf=class{fs;cwd;globignorePatterns=[];hasGlobignore=!1;globstar=!1;nullglob=!1;failglob=!1;dotglob=!1;extglob=!1;globskipdots=!0;ops={count:0};maxOps;constructor(e,t,n,r){this.fs=e,this.cwd=t,typeof r==`boolean`?(this.globstar=r,this.maxOps=1e5):r?(this.globstar=r.globstar??!1,this.nullglob=r.nullglob??!1,this.failglob=r.failglob??!1,this.dotglob=r.dotglob??!1,this.extglob=r.extglob??!1,this.globskipdots=r.globskipdots??!0,this.maxOps=r.maxGlobOperations??1e5):this.maxOps=1e5;let i=n?.get(`GLOBIGNORE`);i!==void 0&&i!==``&&(this.hasGlobignore=!0,this.globignorePatterns=Pf(i))}checkOpsLimit(){if(++this.ops.count>this.maxOps)throw new b(`Glob operation limit exceeded (${this.maxOps})`,`glob_operations`)}hasNullglob(){return this.nullglob}hasFailglob(){return this.failglob}filterGlobignore(e){return!this.hasGlobignore&&!this.globskipdots?e:e.filter(e=>{let t=e.split(`/`).pop()||e;if((this.hasGlobignore||this.globskipdots)&&(t===`.`||t===`..`))return!1;if(this.hasGlobignore){for(let t of this.globignorePatterns)if(this.matchGlobignorePattern(e,t))return!1}return!0})}matchGlobignorePattern(e,t){return Ff(t).test(e)}isGlobPattern(e){return!!(e.includes(`*`)||e.includes(`?`)||/\[.*\]/.test(e)||this.extglob&&/[@*+?!]\(/.test(e))}async expandArgs(e,t){let n=e.map((e,n)=>(t?.[n]??!1)||!this.isGlobPattern(e)?null:this.expand(e)),r=await Promise.all(n.map(e=>e||Promise.resolve(null))),i=[];for(let t=0;t<e.length;t++){let n=r[t];n===null?i.push(e[t]):n.length>0?i.push(...n):i.push(e[t])}return i}async expand(e){if(this.globstar){let t=e.split(`/`),n=0;for(let e of t)if(e===`**`&&(n++,n>Bf))throw new b(`Glob pattern has too many ** segments (max ${Bf})`,`glob_operations`)}let t;if(e.includes(`**`)&&this.globstar&&this.isGlobstarValid(e))t=await this.expandRecursive(e);else{let n=e.replace(/\*\*+/g,`*`);t=await this.expandSimple(n)}return this.filterGlobignore(t)}isGlobstarValid(e){let t=e.split(`/`);for(let e of t)if(e.includes(`**`)&&e!==`**`)return!1;return!0}hasGlobChars(e){return!!(e.includes(`*`)||e.includes(`?`)||/\[.*\]/.test(e)||this.extglob&&/[@*+?!]\(/.test(e))}async expandSimple(e){let t=e.startsWith(`/`),n=e.split(`/`).filter(e=>e!==``),r=-1;for(let e=0;e<n.length;e++)if(this.hasGlobChars(n[e])){r=e;break}if(r===-1)return[e];let i,a;if(r===0)t?(i=`/`,a=`/`):(i=this.cwd,a=``);else{let e=n.slice(0,r);t?(i=`/${e.join(`/`)}`,a=`/${e.join(`/`)}`):(i=this.fs.resolvePath(this.cwd,e.join(`/`)),a=e.join(`/`))}let o=n.slice(r);return(await this.expandSegments(i,a,o)).sort()}async expandSegments(e,t,n){if(this.checkOpsLimit(),n.length===0)return[t];let[r,...i]=n,a=[];try{if(this.fs.readdirWithFileTypes){this.checkOpsLimit();let n=await this.fs.readdirWithFileTypes(e),o=[],s=[...n],c=this.dotglob||this.hasGlobignore;if(r.startsWith(`.`)||this.dotglob){let e=n.some(e=>e.name===`.`),t=n.some(e=>e.name===`..`);e||s.push({name:`.`,isFile:!1,isDirectory:!0,isSymbolicLink:!1}),t||s.push({name:`..`,isFile:!1,isDirectory:!0,isSymbolicLink:!1})}for(let n of s)if(!(n.name.startsWith(`.`)&&!r.startsWith(`.`)&&!c)&&this.matchPattern(n.name,r)){let r=e===`/`?`/${n.name}`:`${e}/${n.name}`,a;a=t===``?n.name:t===`/`?`/${n.name}`:`${t}/${n.name}`,i.length===0?o.push(Promise.resolve([a])):n.isDirectory&&o.push(this.expandSegments(r,a,i))}let l=await Promise.all(o);for(let e of l)a.push(...e)}else{this.checkOpsLimit();let n=await this.fs.readdir(e),o=[],s=[...n],c=this.dotglob||this.hasGlobignore;(r.startsWith(`.`)||this.dotglob)&&(n.includes(`.`)||s.push(`.`),n.includes(`..`)||s.push(`..`));for(let n of s)if(!(n.startsWith(`.`)&&!r.startsWith(`.`)&&!c)&&this.matchPattern(n,r)){let r=e===`/`?`/${n}`:`${e}/${n}`,a;a=t===``?n:t===`/`?`/${n}`:`${t}/${n}`,i.length===0?o.push(Promise.resolve([a])):o.push((async()=>{try{if(this.checkOpsLimit(),(await this.fs.stat(r)).isDirectory)return this.expandSegments(r,a,i)}catch(e){if(e instanceof b)throw e}return[]})())}let l=await Promise.all(o);for(let e of l)a.push(...e)}}catch(e){if(e instanceof b)throw e}return a}async expandRecursive(e){let t=[],n=e.indexOf(`**`),r=e.slice(0,n).replace(/\/$/,``)||`.`,i=e.slice(n+2).replace(/^\//,``);return i.includes(`**`)&&this.isGlobstarValid(i)?(await this.walkDirectoryMultiGlobstar(r,i,t),[...new Set(t)].sort()):(await this.walkDirectory(r,i,t),t.sort())}async walkDirectoryMultiGlobstar(e,t,n){this.checkOpsLimit();let r=this.fs.resolvePath(this.cwd,e);try{this.checkOpsLimit();let i=this.fs.readdirWithFileTypes?await this.fs.readdirWithFileTypes(r):null;if(i){let r=[];for(let t of i){let n=e===`.`?t.name:`${e}/${t.name}`;t.isDirectory&&r.push(n)}let a=e===`.`?t:`${e}/${t}`,o=await this.expandRecursive(a);n.push(...o);for(let e=0;e<r.length;e+=100){let i=r.slice(e,e+100);await Promise.all(i.map(e=>this.walkDirectoryMultiGlobstar(e,t,n)))}}else{this.checkOpsLimit();let i=await this.fs.readdir(r),a=[];for(let t of i){let n=e===`.`?t:`${e}/${t}`,r=this.fs.resolvePath(this.cwd,n);try{this.checkOpsLimit(),(await this.fs.stat(r)).isDirectory&&a.push(n)}catch(e){if(e instanceof b)throw e}}let o=e===`.`?t:`${e}/${t}`,s=await this.expandRecursive(o);n.push(...s);for(let e=0;e<a.length;e+=100){let r=a.slice(e,e+100);await Promise.all(r.map(e=>this.walkDirectoryMultiGlobstar(e,t,n)))}}}catch(e){if(e instanceof b)throw e}}async walkDirectory(e,t,n){this.checkOpsLimit();let r=this.fs.resolvePath(this.cwd,e);try{if(this.fs.readdirWithFileTypes){this.checkOpsLimit();let i=await this.fs.readdirWithFileTypes(r),a=[],o=[];for(let n of i){let r=e===`.`?n.name:`${e}/${n.name}`;n.isDirectory?o.push(r):t&&this.matchPattern(n.name,t)&&a.push(r)}n.push(...a);for(let e=0;e<o.length;e+=100){let r=o.slice(e,e+100);await Promise.all(r.map(e=>this.walkDirectory(e,t,n)))}}else{this.checkOpsLimit();let i=await this.fs.readdir(r),a=[];for(let t=0;t<i.length;t+=100){let n=i.slice(t,t+100),r=await Promise.all(n.map(async t=>{let n=e===`.`?t:`${e}/${t}`,r=this.fs.resolvePath(this.cwd,n);try{return this.checkOpsLimit(),{name:t,path:n,isDirectory:(await this.fs.stat(r)).isDirectory}}catch(e){if(e instanceof b)throw e;return null}}));a.push(...r.filter(e=>e!==null))}for(let e of a)!e.isDirectory&&t&&this.matchPattern(e.name,t)&&n.push(e.path);let o=a.filter(e=>e.isDirectory);for(let e=0;e<o.length;e+=100){let r=o.slice(e,e+100);await Promise.all(r.map(e=>this.walkDirectory(e.path,t,n)))}}}catch(e){if(e instanceof b)throw e}}matchPattern(e,t){return this.patternToRegex(t).test(e)}patternToRegex(e){return M(`^${this.patternToRegexStr(e)}$`)}patternToRegexStr(e){let t=``,n=!1;for(let r=0;r<e.length;r++){if(e.slice(r,r+13)===`\0QUOTE_START\0`){n=!0,r+=12;continue}if(e.slice(r,r+11)===`\0QUOTE_END\0`){n=!1,r+=10;continue}let i=e[r];if(n){/[.+^${}()|\\*?[\]]/.test(i)?t+=`\\${i}`:t+=i;continue}if(this.extglob&&(i===`@`||i===`*`||i===`+`||i===`?`||i===`!`)&&r+1<e.length&&e[r+1]===`(`){let n=If(e,r+1);if(n!==-1){let a=Lf(e.slice(r+2,n)),o=a.map(e=>this.patternToRegexStr(e)),s=o.length>0?o.join(`|`):`(?:)`;if(i===`@`)t+=`(?:${s})`;else if(i===`*`)t+=`(?:${s})*`;else if(i===`+`)t+=`(?:${s})+`;else if(i===`?`)t+=`(?:${s})?`;else if(i===`!`)if(n<e.length-1){let e=a.map(e=>this.computePatternLength(e));if(e.every(e=>e!==null)&&e.every(t=>t===e[0])&&e[0]!==null){let n=e[0];if(n===0)t+=`(?:.+)`;else{let e=[];n>0&&e.push(`.{0,${n-1}}`),e.push(`.{${n+1},}`),e.push(`(?!(?:${s})).{${n}}`),t+=`(?:${e.join(`|`)})`}}else t+=`(?:(?!(?:${s})).)*?`}else t+=`(?!(?:${s})$).*`;r=n;continue}}if(i===`*`)t+=`.*`;else if(i===`?`)t+=`.`;else if(i===`[`){let n=r+1,i=`[`;n<e.length&&(e[n]===`^`||e[n]===`!`)&&(i+=`^`,n++),n<e.length&&e[n]===`]`&&(i+=`\\]`,n++);let a=n;for(;a<e.length;){if(e[a]===`\\`&&a+1<e.length){a+=2;continue}if(e[a]===`[`&&a+1<e.length&&e[a+1]===`:`){let t=e.indexOf(`:]`,a+2);if(t!==-1){a=t+2;continue}}if(e[a]===`]`)break;a++}let o=n;for(;n<e.length&&e[n]!==`]`;){if(e[n]===`[`&&n+1<e.length&&e[n+1]===`:`){let t=e.indexOf(`:]`,n+2);if(t!==-1){let r=Nf(e.slice(n+2,t));i+=r,n=t+2;continue}}if(e[n]===`\\`&&n+1<e.length){i+=`\\${e[n+1]}`,n+=2;continue}if(e[n]===`-`){let e=n===o,t=n+1===a;e||t?i+=`\\-`:i+=`-`}else i+=e[n];n++}i+=`]`,t+=i,r=n}else if(i===`\\`&&r+1<e.length){let n=e[r+1];/[.+^${}()|\\*?[\]]/.test(n)?t+=`\\${n}`:t+=n,r++}else/[.+^${}()|]/.test(i)?t+=`\\${i}`:t+=i}return t}computePatternLength(e){let t=0,n=0,r=!1;for(;n<e.length;){if(e.slice(n,n+13)===`\0QUOTE_START\0`){r=!0,n+=13;continue}if(e.slice(n,n+11)===`\0QUOTE_END\0`){r=!1,n+=11;continue}let i=e[n];if(r){t+=1,n++;continue}if((i===`@`||i===`*`||i===`+`||i===`?`||i===`!`)&&n+1<e.length&&e[n+1]===`(`){let r=If(e,n+1);if(r!==-1){if(i===`@`){let i=Lf(e.slice(n+2,r)).map(e=>this.computePatternLength(e));if(i.every(e=>e!==null)&&i.every(e=>e===i[0])){t+=i[0],n=r+1;continue}return null}return null}}if(i===`*`)return null;if(i===`?`){t+=1,n++;continue}if(i===`[`){let r=e.indexOf(`]`,n+1);if(r!==-1){t+=1,n=r+1;continue}t+=1,n++;continue}if(i===`\\`){t+=1,n+=2;continue}t+=1,n++}return t}}});function Uf(e){for(let t=0;t<e.length;t++){if(e[t]===`\\`){t++;continue}if(e[t]===`$`){let n=e[t+1];if(n===`{`||n&&/[a-zA-Z_]/.test(n))return!0}}return!1}function Wf(e){if(!e.operation)return!1;let t=e.operation,n;if((t.type===`DefaultValue`||t.type===`AssignDefault`||t.type===`UseAlternative`||t.type===`ErrorIfUnset`)&&(n=t.word?.parts),!n)return!1;for(let e of n)if(e.type===`DoubleQuoted`||e.type===`SingleQuoted`)return!0;return!1}function Gf(e){if(!e.operation)return!1;let t=e.operation,n;if((t.type===`DefaultValue`||t.type===`AssignDefault`||t.type===`UseAlternative`||t.type===`ErrorIfUnset`)&&(n=t.word?.parts),!n||n.length===0)return!1;for(let e of n)if(e.type!==`DoubleQuoted`&&e.type!==`SingleQuoted`)return!1;return!0}function Kf(e){let t=!1,n=!1,r=!1,i=!1,a=!1,o=!1,s=!1;for(let c of e){if((c.type===`SingleQuoted`||c.type===`DoubleQuoted`)&&(t=!0,c.type===`DoubleQuoted`))for(let e of c.parts)e.type===`ParameterExpansion`&&(e.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/)&&(!e.operation||e.operation.type===`PatternRemoval`||e.operation.type===`PatternReplacement`)&&(i=!0),(e.operation?.type===`VarNamePrefix`||e.operation?.type===`ArrayKeys`)&&(o=!0),e.operation?.type===`Indirection`&&(s=!0));c.type===`CommandSubstitution`&&(n=!0),c.type===`ParameterExpansion`&&(a=!0,(c.parameter===`@`||c.parameter===`*`)&&(r=!0),Wf(c)&&(t=!0),(c.operation?.type===`VarNamePrefix`||c.operation?.type===`ArrayKeys`)&&(o=!0),c.operation?.type===`Indirection`&&(s=!0)),c.type===`Glob`&&Uf(c.pattern)&&(a=!0)}return{hasQuoted:t,hasCommandSub:n,hasArrayVar:r,hasArrayAtExpansion:i,hasParamExpansion:a,hasVarNamePrefixExpansion:o,hasIndirection:s}}var qf=g(()=>{});function Jf(e,t){let n=`${t}_`,r=[];for(let t of e.state.env.keys())if(t.startsWith(n)){let e=t.slice(n.length),i=Number.parseInt(e,10);!Number.isNaN(i)&&String(i)===e&&r.push(i)}return r.sort((e,t)=>e-t)}function Yf(e,t){let n=`${t}_`,r=`${t}__length`,i=[];for(let t of e.state.env.keys())if(t!==r&&t.startsWith(n)){let e=t.slice(n.length);if(e.startsWith(`_length`))continue;i.push(e)}return i.sort()}function Xf(e){return e.startsWith(`'`)&&e.endsWith(`'`)||e.startsWith(`"`)&&e.endsWith(`"`)?e.slice(1,-1):e}var Zf=g(()=>{});function Qf(e){return e.get(`IFS`)??`
204
204
  `}function $f(e){return e.get(`IFS`)===``}function ep(e){let t=Qf(e);if(t===``)return!0;for(let e of t)if(e!==` `&&e!==` `&&e!==`
205
205
  `)return!1;return!0}function tp(e){let t=!1,n=[];for(let r of e.split(``))r===`-`?t=!0:/[\\^$.*+?()[\]{}|]/.test(r)?n.push(`\\${r}`):r===` `?n.push(`\\t`):r===`
206
206
  `?n.push(`\\n`):n.push(r);return t&&n.push(`\\-`),n.join(``)}function q(e){let t=e.get(`IFS`);return t===void 0?` `:t[0]||``}function np(e){return ap.includes(e)}function rp(e){let t=new Set,n=new Set;for(let r of e)np(r)?t.add(r):n.add(r);return{whitespace:t,nonWhitespace:n}}function ip(e,t){if(t===``)return{words:e?[e]:[],hadLeadingDelimiter:!1,hadTrailingDelimiter:!1};if(e===``)return{words:[],hadLeadingDelimiter:!1,hadTrailingDelimiter:!1};let{whitespace:n,nonWhitespace:r}=rp(t),i=[],a=0,o=!1,s=!1,c=a;for(;a<e.length&&n.has(e[a]);)a++;if(a>c&&(o=!0),a>=e.length)return{words:[],hadLeadingDelimiter:!0,hadTrailingDelimiter:!0};if(r.has(e[a]))for(i.push(``),a++;a<e.length&&n.has(e[a]);)a++;for(;a<e.length;){let t=a;for(;a<e.length;){let t=e[a];if(n.has(t)||r.has(t))break;a++}if(i.push(e.substring(t,a)),a>=e.length){s=!1;break}let o=a;for(;a<e.length&&n.has(e[a]);)a++;if(a<e.length&&r.has(e[a])){for(a++;a<e.length&&n.has(e[a]);)a++;for(;a<e.length&&r.has(e[a]);)for(i.push(``),a++;a<e.length&&n.has(e[a]);)a++}a>=e.length&&a>o&&(s=!0)}return{words:i,hadLeadingDelimiter:o,hadTrailingDelimiter:s}}function J(e,t){return ip(e,t).words}var ap,op=g(()=>{ap=`
207
- `});function sp(e,t){return e.state.namerefs?.has(t)??!1}function cp(e,t){return e.state.invalidNamerefs?.has(t)??!1}function lp(e,t,n=100){if(!sp(e,t)||cp(e,t))return t;let r=new Set,i=t;for(;n-- >0;){if(r.has(i))return;if(r.add(i),!sp(e,i))return i;let t=e.state.env.get(i);if(t===void 0||t===``||!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(t))return i;i=t}}function up(e,t){if(sp(e,t))return e.state.env.get(t)}var dp=g(()=>{});function fp(e,t){let n=t.replace(/\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,(t,n)=>e.state.env.get(n)??``);return n=n.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(t,n)=>e.state.env.get(n)??``),n}function Y(e,t){return t===`FUNCNAME`?(e.state.funcNameStack??[]).map((e,t)=>[t,e]):t===`BASH_LINENO`?(e.state.callLineStack??[]).map((e,t)=>[t,String(e)]):t===`BASH_SOURCE`?(e.state.sourceStack??[]).map((e,t)=>[t,e]):e.state.associativeArrays?.has(t)?Yf(e,t).map(n=>[n,e.state.env.get(`${t}_${n}`)??``]):Jf(e,t).map(n=>[n,e.state.env.get(`${t}_${n}`)??``])}function pp(e,t){return t===`FUNCNAME`?(e.state.funcNameStack?.length??0)>0:t===`BASH_LINENO`?(e.state.callLineStack?.length??0)>0:t===`BASH_SOURCE`?(e.state.sourceStack?.length??0)>0:e.state.associativeArrays?.has(t)?Yf(e,t).length>0:Jf(e,t).length>0}async function X(e,t,n=!0,r=!1){switch(t){case`?`:return String(e.state.lastExitCode);case`$`:return String(e.state.virtualPid);case`#`:return e.state.env.get(`#`)||`0`;case`@`:return e.state.env.get(`@`)||``;case`_`:return e.state.lastArg;case`-`:{let t=``;return t+=`h`,e.state.options.errexit&&(t+=`e`),e.state.options.noglob&&(t+=`f`),e.state.options.nounset&&(t+=`u`),e.state.options.verbose&&(t+=`v`),e.state.options.xtrace&&(t+=`x`),t+=`B`,e.state.options.noclobber&&(t+=`C`),t+=`s`,t}case`*`:{let t=Number.parseInt(e.state.env.get(`#`)||`0`,10);if(t===0)return``;let n=[];for(let r=1;r<=t;r++)n.push(e.state.env.get(String(r))||``);return n.join(q(e.state.env))}case`0`:return e.state.env.get(`0`)||`bash`;case`PWD`:return e.state.env.get(`PWD`)??``;case`OLDPWD`:return e.state.env.get(`OLDPWD`)??``;case`PPID`:return String(e.state.virtualPpid);case`UID`:return String(e.state.virtualUid);case`EUID`:return String(e.state.virtualUid);case`RANDOM`:return String(Math.floor(Math.random()*32768));case`SECONDS`:return String(Math.floor((Date.now()-e.state.startTime)/1e3));case`BASH_VERSION`:return Du;case`!`:return String(e.state.lastBackgroundPid);case`BASHPID`:return String(e.state.bashPid);case`LINENO`:return String(e.state.currentLine);case`FUNCNAME`:{let t=e.state.funcNameStack?.[0];if(t!==void 0)return t;if(n&&e.state.options.nounset)throw new ar(`FUNCNAME`);return``}case`BASH_LINENO`:{let t=e.state.callLineStack?.[0];if(t!==void 0)return String(t);if(n&&e.state.options.nounset)throw new ar(`BASH_LINENO`);return``}case`BASH_SOURCE`:{let t=e.state.sourceStack?.[0];if(t!==void 0)return t;if(n&&e.state.options.nounset)throw new ar(`BASH_SOURCE`);return``}}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[\]$/.test(t))throw new cr(`\${${t}}`);let i=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(i){let t=i[1],r=i[2];if(sp(e,t)){let n=lp(e,t);if(n&&n!==t){if(n.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return``;t=n}}if(r===`@`||r===`*`){let n=Y(e,t);if(n.length>0)return n.map(([,e])=>e).join(` `);let r=e.state.env.get(t);return r===void 0?``:r}if(t===`FUNCNAME`){let t=Number.parseInt(r,10);return!Number.isNaN(t)&&t>=0?e.state.funcNameStack?.[t]??``:``}if(t===`BASH_LINENO`){let t=Number.parseInt(r,10);if(!Number.isNaN(t)&&t>=0){let n=e.state.callLineStack?.[t];return n===void 0?``:String(n)}return``}if(t===`BASH_SOURCE`){let t=Number.parseInt(r,10);return!Number.isNaN(t)&&t>=0?e.state.sourceStack?.[t]??``:``}if(e.state.associativeArrays?.has(t)){let i=Xf(r);i=fp(e,i);let a=e.state.env.get(`${t}_${i}`);if(a===void 0&&n&&e.state.options.nounset)throw new ar(`${t}[${r}]`);return a||``}let a;if(/^-?\d+$/.test(r))a=Number.parseInt(r,10);else try{a=await $(e,ud(new Mf,r).expression)}catch{let t=e.state.env.get(r);a=t?Number.parseInt(t,10):0,Number.isNaN(a)&&(a=0)}if(a<0){let n=Y(e,t),r=e.state.currentLine;if(n.length===0)return e.state.expansionStderr=(e.state.expansionStderr||``)+`bash: line ${r}: ${t}: bad array subscript
207
+ `});function sp(e,t){return e.state.namerefs?.has(t)??!1}function cp(e,t){return e.state.invalidNamerefs?.has(t)??!1}function lp(e,t,n=100){if(!sp(e,t)||cp(e,t))return t;let r=new Set,i=t;for(;n-->0;){if(r.has(i))return;if(r.add(i),!sp(e,i))return i;let t=e.state.env.get(i);if(t===void 0||t===``||!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(t))return i;i=t}}function up(e,t){if(sp(e,t))return e.state.env.get(t)}var dp=g(()=>{});function fp(e,t){let n=t.replace(/\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,(t,n)=>e.state.env.get(n)??``);return n=n.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(t,n)=>e.state.env.get(n)??``),n}function Y(e,t){return t===`FUNCNAME`?(e.state.funcNameStack??[]).map((e,t)=>[t,e]):t===`BASH_LINENO`?(e.state.callLineStack??[]).map((e,t)=>[t,String(e)]):t===`BASH_SOURCE`?(e.state.sourceStack??[]).map((e,t)=>[t,e]):e.state.associativeArrays?.has(t)?Yf(e,t).map(n=>[n,e.state.env.get(`${t}_${n}`)??``]):Jf(e,t).map(n=>[n,e.state.env.get(`${t}_${n}`)??``])}function pp(e,t){return t===`FUNCNAME`?(e.state.funcNameStack?.length??0)>0:t===`BASH_LINENO`?(e.state.callLineStack?.length??0)>0:t===`BASH_SOURCE`?(e.state.sourceStack?.length??0)>0:e.state.associativeArrays?.has(t)?Yf(e,t).length>0:Jf(e,t).length>0}async function X(e,t,n=!0,r=!1){switch(t){case`?`:return String(e.state.lastExitCode);case`$`:return String(e.state.virtualPid);case`#`:return e.state.env.get(`#`)||`0`;case`@`:return e.state.env.get(`@`)||``;case`_`:return e.state.lastArg;case`-`:{let t=``;return t+=`h`,e.state.options.errexit&&(t+=`e`),e.state.options.noglob&&(t+=`f`),e.state.options.nounset&&(t+=`u`),e.state.options.verbose&&(t+=`v`),e.state.options.xtrace&&(t+=`x`),t+=`B`,e.state.options.noclobber&&(t+=`C`),t+=`s`,t}case`*`:{let t=Number.parseInt(e.state.env.get(`#`)||`0`,10);if(t===0)return``;let n=[];for(let r=1;r<=t;r++)n.push(e.state.env.get(String(r))||``);return n.join(q(e.state.env))}case`0`:return e.state.env.get(`0`)||`bash`;case`PWD`:return e.state.env.get(`PWD`)??``;case`OLDPWD`:return e.state.env.get(`OLDPWD`)??``;case`PPID`:return String(e.state.virtualPpid);case`UID`:return String(e.state.virtualUid);case`EUID`:return String(e.state.virtualUid);case`RANDOM`:return String(Math.floor(Math.random()*32768));case`SECONDS`:return String(Math.floor((Date.now()-e.state.startTime)/1e3));case`BASH_VERSION`:return Du;case`!`:return String(e.state.lastBackgroundPid);case`BASHPID`:return String(e.state.bashPid);case`LINENO`:return String(e.state.currentLine);case`FUNCNAME`:{let t=e.state.funcNameStack?.[0];if(t!==void 0)return t;if(n&&e.state.options.nounset)throw new ar(`FUNCNAME`);return``}case`BASH_LINENO`:{let t=e.state.callLineStack?.[0];if(t!==void 0)return String(t);if(n&&e.state.options.nounset)throw new ar(`BASH_LINENO`);return``}case`BASH_SOURCE`:{let t=e.state.sourceStack?.[0];if(t!==void 0)return t;if(n&&e.state.options.nounset)throw new ar(`BASH_SOURCE`);return``}}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[\]$/.test(t))throw new cr(`\${${t}}`);let i=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(i){let t=i[1],r=i[2];if(sp(e,t)){let n=lp(e,t);if(n&&n!==t){if(n.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return``;t=n}}if(r===`@`||r===`*`){let n=Y(e,t);if(n.length>0)return n.map(([,e])=>e).join(` `);let r=e.state.env.get(t);return r===void 0?``:r}if(t===`FUNCNAME`){let t=Number.parseInt(r,10);return!Number.isNaN(t)&&t>=0?e.state.funcNameStack?.[t]??``:``}if(t===`BASH_LINENO`){let t=Number.parseInt(r,10);if(!Number.isNaN(t)&&t>=0){let n=e.state.callLineStack?.[t];return n===void 0?``:String(n)}return``}if(t===`BASH_SOURCE`){let t=Number.parseInt(r,10);return!Number.isNaN(t)&&t>=0?e.state.sourceStack?.[t]??``:``}if(e.state.associativeArrays?.has(t)){let i=Xf(r);i=fp(e,i);let a=e.state.env.get(`${t}_${i}`);if(a===void 0&&n&&e.state.options.nounset)throw new ar(`${t}[${r}]`);return a||``}let a;if(/^-?\d+$/.test(r))a=Number.parseInt(r,10);else try{a=await $(e,ud(new Mf,r).expression)}catch{let t=e.state.env.get(r);a=t?Number.parseInt(t,10):0,Number.isNaN(a)&&(a=0)}if(a<0){let n=Y(e,t),r=e.state.currentLine;if(n.length===0)return e.state.expansionStderr=(e.state.expansionStderr||``)+`bash: line ${r}: ${t}: bad array subscript
208
208
  `,``;let i=Math.max(...n.map(([e])=>typeof e==`number`?e:0))+1+a;return i<0?(e.state.expansionStderr=(e.state.expansionStderr||``)+`bash: line ${r}: ${t}: bad array subscript
209
- `,``):e.state.env.get(`${t}_${i}`)||``}let o=e.state.env.get(`${t}_${a}`);if(o!==void 0)return o;if(a===0){let n=e.state.env.get(t);if(n!==void 0)return n}if(n&&e.state.options.nounset)throw new ar(`${t}[${a}]`);return``}if(/^[1-9][0-9]*$/.test(t)){let r=e.state.env.get(t);if(r===void 0&&n&&e.state.options.nounset)throw new ar(t);return r||``}if(sp(e,t)){let i=lp(e,t);if(i===void 0)return``;if(i!==t)return await X(e,i,n,r);let a=e.state.env.get(t);if((a===void 0||a===``)&&n&&e.state.options.nounset)throw new ar(t);return a||``}let a=e.state.env.get(t);if(a!==void 0)return e.state.tempEnvBindings?.some(e=>e.has(t))&&(e.state.accessedTempEnvVars=e.state.accessedTempEnvVars||new Set,e.state.accessedTempEnvVars.add(t)),a;if(pp(e,t)){let n=e.state.env.get(`${t}_0`);return n===void 0?``:n}if(n&&e.state.options.nounset)throw new ar(t);return``}async function mp(e,t){if(new Set([`?`,`$`,`#`,`_`,`-`,`0`,`PPID`,`UID`,`EUID`,`RANDOM`,`SECONDS`,`BASH_VERSION`,`!`,`BASHPID`,`LINENO`]).has(t))return!0;if(t===`@`||t===`*`)return Number.parseInt(e.state.env.get(`#`)||`0`,10)>0;if(t===`PWD`||t===`OLDPWD`)return e.state.env.has(t);let n=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(n){let t=n[1],r=n[2];if(sp(e,t)){let n=lp(e,t);if(n&&n!==t){if(n.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return!1;t=n}}if(r===`@`||r===`*`)return Y(e,t).length>0?!0:e.state.env.has(t);if(e.state.associativeArrays?.has(t)){let n=Xf(r);return e.state.env.has(`${t}_${n}`)}let i;if(/^-?\d+$/.test(r))i=Number.parseInt(r,10);else try{i=await $(e,ud(new Mf,r).expression)}catch{let t=e.state.env.get(r);i=t?Number.parseInt(t,10):0,Number.isNaN(i)&&(i=0)}if(i<0){let n=Y(e,t);if(n.length===0)return!1;let r=Math.max(...n.map(([e])=>typeof e==`number`?e:0))+1+i;return r<0?!1:e.state.env.has(`${t}_${r}`)}return e.state.env.has(`${t}_${i}`)}if(sp(e,t)){let n=lp(e,t);return n===void 0||n===t?e.state.env.has(t):mp(e,n)}return!!(e.state.env.has(t)||pp(e,t))}var hp=g(()=>{jd(),K(),Ou(),sg(),x(),Zf(),op(),dp()});async function gp(e,t){let n=``,r=0;for(;r<t.length;){if(t[r]===`$`){if(t[r+1]===`{`){let e=1,i=r+2;for(;i<t.length&&e>0;)t[i]===`{`?e++:t[i]===`}`&&e--,i++;n+=t.slice(r,i),r=i;continue}if(t[r+1]===`(`){let e=1,i=r+2;for(;i<t.length&&e>0;)t[i]===`(`?e++:t[i]===`)`&&e--,i++;n+=t.slice(r,i),r=i;continue}if(/[a-zA-Z_]/.test(t[r+1]||``)){let i=r+1;for(;i<t.length&&/[a-zA-Z0-9_]/.test(t[i]);)i++;let a=await X(e,t.slice(r+1,i));n+=a,r=i;continue}if(/[0-9]/.test(t[r+1]||``)){let i=r+1;for(;i<t.length&&/[0-9]/.test(t[i]);)i++;let a=await X(e,t.slice(r+1,i));n+=a,r=i;continue}if(/[*@#?\-!$]/.test(t[r+1]||``)){let i=t[r+1],a=await X(e,i);n+=a,r+=2;continue}}if(t[r]===`"`){for(n+=`"`,r++;r<t.length&&t[r]!==`"`;)if(t[r]===`$`&&/[a-zA-Z_]/.test(t[r+1]||``)){let i=r+1;for(;i<t.length&&/[a-zA-Z0-9_]/.test(t[i]);)i++;let a=await X(e,t.slice(r+1,i));n+=a,r=i}else t[r]===`\\`?(n+=t[r],r++,r<t.length&&(n+=t[r],r++)):(n+=t[r],r++);r<t.length&&(n+=`"`,r++);continue}n+=t[r],r++}return n}async function _p(e,t){let n=t,r=t.startsWith(`"`)&&t.endsWith(`"`),i=t.startsWith(`'`)&&t.endsWith(`'`);if((r||i)&&(n=t.slice(1,-1)),i)return n;let a=``,o=0;for(;o<n.length;)if(n[o]===`$`)if(n[o+1]===`(`){let t=1,r=o+2;for(;r<n.length&&t>0;)n[r]===`(`&&n[r-1]===`$`||n[r]===`(`?t++:n[r]===`)`&&t--,r++;let i=n.slice(o+2,r-1);if(e.execFn){let t=await e.execFn(i,{signal:e.state.signal});a+=t.stdout.replace(/\n+$/,``),t.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||``)+t.stderr)}o=r}else if(n[o+1]===`{`){let t=1,r=o+2;for(;r<n.length&&t>0;)n[r]===`{`?t++:n[r]===`}`&&t--,r++;let i=await X(e,n.slice(o+2,r-1));a+=i,o=r}else if(/[a-zA-Z_]/.test(n[o+1]||``)){let t=o+1;for(;t<n.length&&/[a-zA-Z0-9_]/.test(n[t]);)t++;let r=await X(e,n.slice(o+1,t));a+=r,o=t}else a+=n[o],o++;else if(n[o]==="`"){let t=o+1;for(;t<n.length&&n[t]!=="`";)t++;let r=n.slice(o+1,t);if(e.execFn){let t=await e.execFn(r,{signal:e.state.signal});a+=t.stdout.replace(/\n+$/,``),t.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||``)+t.stderr)}o=t+1}else a+=n[o],o++;return a}var vp=g(()=>{hp()});function yp(e,t,n,r,i){let a=n??1;a===0&&(a=1);let o=Math.abs(a),s=[],c=0;r?.match(/^-?0\d/)&&(c=Math.max(c,r.replace(/^-/,``).length)),i?.match(/^-?0\d/)&&(c=Math.max(c,i.replace(/^-/,``).length));let l=e=>{if(c>0){let t=e<0,n=String(Math.abs(e)).padStart(c,`0`);return t?`-${n}`:n}return String(e)};if(e<=t)for(let n=e,r=0;n<=t&&r<Sp;n+=o,r++)s.push(l(n));else for(let n=e,r=0;n>=t&&r<Sp;n-=o,r++)s.push(l(n));return s}function bp(e,t,n){let r=n??1;r===0&&(r=1);let i=e.charCodeAt(0),a=t.charCodeAt(0),o=Math.abs(r);if(e>=`A`&&e<=`Z`&&t>=`a`&&t<=`z`||e>=`a`&&e<=`z`&&t>=`A`&&t<=`Z`){let r=n===void 0?``:`..${n}`;throw new ur(`{${e}..${t}${r}}: invalid sequence`)}let s=[];if(i<=a)for(let e=i,t=0;e<=a&&t<Sp;e+=o,t++)s.push(String.fromCharCode(e));else for(let e=i,t=0;e>=a&&t<Sp;e-=o,t++)s.push(String.fromCharCode(e));return s}function xp(e,t,n,r,i){let a=n===void 0?``:`..${n}`;return typeof e==`number`&&typeof t==`number`?{expanded:yp(e,t,n,r,i),literal:`{${e}..${t}${a}}`}:typeof e==`string`&&typeof t==`string`?{expanded:bp(e,t,n),literal:`{${e}..${t}${a}}`}:{expanded:null,literal:`{${e}..${t}${a}}`}}var Sp,Cp=g(()=>{x(),Sp=1e4});function wp(e){if(e.statements.length!==1)return null;let t=e.statements[0];if(t.operators.length!==0||t.pipelines.length!==1)return null;let n=t.pipelines[0];if(n.negated||n.commands.length!==1)return null;let r=n.commands[0];if(r.type!==`SimpleCommand`)return null;let i=r;if(i.name!==null||i.args.length!==0||i.assignments.length!==0||i.redirections.length!==1)return null;let a=i.redirections[0];return a.operator!==`<`||a.target.type!==`Word`?null:{target:a.target}}var Tp=g(()=>{});function Ep(e,t){return!!(/[*?[]/.test(e)||t&&/[@*+?!]\(/.test(e))}function Dp(e){let t=``,n=0;for(;n<e.length;)e[n]===`\\`&&n+1<e.length?(t+=e[n+1],n+=2):(t+=e[n],n++);return t}function Op(e){return e.replace(/([*?[\]\\()|])/g,`\\$1`)}function kp(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`)}var Ap=g(()=>{});function Z(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var jp=g(()=>{});function Q(e,t,n=!1){let r=``,i=0;for(;i<e.length;){let a=e[i];if(n&&(a===`@`||a===`*`||a===`+`||a===`?`||a===`!`)&&i+1<e.length&&e[i+1]===`(`){let o=Mp(e,i+1);if(o!==-1){let s=Np(e.slice(i+2,o)).map(e=>Q(e,t,n)),c=s.length>0?s.join(`|`):`(?:)`;a===`@`?r+=`(?:${c})`:a===`*`?r+=`(?:${c})*`:a===`+`?r+=`(?:${c})+`:a===`?`?r+=`(?:${c})?`:a===`!`&&(r+=`(?!(?:${c})$).*`),i=o+1;continue}}if(a===`\\`)if(i+1<e.length){let t=e[i+1];/[\\^$.|+(){}[\]*?]/.test(t)?r+=`\\${t}`:r+=t,i+=2}else r+=`\\\\`,i++;else if(a===`*`)r+=t?`.*`:`.*?`,i++;else if(a===`?`)r+=`.`,i++;else if(a===`[`){let t=Pp(e,i);if(t===-1)r+=`\\[`,i++;else{let n=e.slice(i+1,t);r+=Fp(n),i=t+1}}else /[\^$.|+(){}]/.test(a)?(r+=`\\${a}`,i++):(r+=a,i++)}return r}function Mp(e,t){let n=1,r=t+1;for(;r<e.length&&n>0;){let t=e[r];if(t===`\\`){r+=2;continue}if(t===`(`)n++;else if(t===`)`&&(n--,n===0))return r;r++}return-1}function Np(e){let t=[],n=``,r=0,i=0;for(;i<e.length;){let a=e[i];if(a===`\\`){n+=a,i+1<e.length?(n+=e[i+1],i+=2):i++;continue}a===`(`?(r++,n+=a):a===`)`?(r--,n+=a):a===`|`&&r===0?(t.push(n),n=``):n+=a,i++}return t.push(n),t}function Pp(e,t){let n=t+1;for(n<e.length&&e[n]===`^`&&n++,n<e.length&&e[n]===`]`&&n++;n<e.length;){if(e[n]===`\\`&&n+1<e.length){n+=2;continue}if(e[n]===`]`)return n;if(e[n]===`'`){let t=e.indexOf(`'`,n+1);if(t!==-1){n=t+1;continue}}if(e[n]===`[`&&n+1<e.length&&e[n+1]===`:`){let t=e.indexOf(`:]`,n+2);if(t!==-1){n=t+2;continue}}n++}return-1}function Fp(e){let t=`[`,n=0;for((e[0]===`^`||e[0]===`!`)&&(t+=`^`,n++);n<e.length;){if(e[n]===`'`){let r=e.indexOf(`'`,n+1);if(r!==-1){let i=e.slice(n+1,r);for(let e of i)e===`\\`?t+=`\\\\`:e===`]`?t+=`\\]`:e===`^`&&t===`[`?t+=`\\^`:t+=e;n=r+1;continue}}if(e[n]===`[`&&n+1<e.length&&e[n+1]===`:`){let r=e.indexOf(`:]`,n+2);if(r!==-1){let i=e.slice(n+2,r);t+=Ip(i),n=r+2;continue}}let r=e[n];r===`\\`?n+1<e.length?(t+=`\\${e[n+1]}`,n+=2):(t+=`\\\\`,n++):r===`-`&&n>0&&n<e.length-1?(t+=`-`,n++):r===`^`&&n===0?(t+=`^`,n++):(r===`]`&&n===0?t+=`\\]`:t+=r,n++)}return t+=`]`,t}function Ip(e){return Lp.get(e)??``}var Lp,Rp=g(()=>{Lp=new Map([[`alnum`,`a-zA-Z0-9`],[`alpha`,`a-zA-Z`],[`ascii`,`\\x00-\\x7F`],[`blank`,` \\t`],[`cntrl`,`\\x00-\\x1F\\x7F`],[`digit`,`0-9`],[`graph`,`!-~`],[`lower`,`a-z`],[`print`,` -~`],[`punct`,"!-/:-@\\[-`{-~"],[`space`,` \\t\\n\\r\\f\\v`],[`upper`,`A-Z`],[`word`,`a-zA-Z0-9_`],[`xdigit`,`0-9A-Fa-f`]])});function zp(e,t,n,r){if(n===`prefix`)return M(`^${t}`,`s`).replace(e,``);let i=M(`${t}$`,`s`);if(r)return i.replace(e,``);for(let t=e.length;t>=0;t--){let n=e.slice(t);if(i.test(n))return e.slice(0,t)}return e}function Bp(e,t){let n=Array.from(e.state.env.keys()),r=new Set,i=e.state.associativeArrays??new Set,a=new Set;for(let e of n){let t=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);t&&a.add(t[1]);let n=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);n&&a.add(n[1])}let o=e=>{for(let t of i){let n=`${t}_`;if(e.startsWith(n)&&e!==t)return!0}return!1};for(let e of n)if(e.startsWith(t))if(e.includes(`__`)){let n=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);n?.[1].startsWith(t)&&r.add(n[1])}else if(/_\d+$/.test(e)){let n=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);n?.[1].startsWith(t)&&r.add(n[1])}else o(e)||r.add(e);return[...r].sort()}var Vp=g(()=>{ta()});function Hp(e,t){let n=(e,t=2)=>String(e).padStart(t,`0`);if(e===``)return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;let r=``,i=0;for(;i<e.length;)if(e[i]===`%`){if(i+1>=e.length){r+=`%`,i++;continue}let a=e[i+1];switch(a){case`H`:r+=n(t.getHours());break;case`M`:r+=n(t.getMinutes());break;case`S`:r+=n(t.getSeconds());break;case`d`:r+=n(t.getDate());break;case`m`:r+=n(t.getMonth()+1);break;case`Y`:r+=t.getFullYear();break;case`y`:r+=n(t.getFullYear()%100);break;case`I`:{let e=t.getHours()%12;e===0&&(e=12),r+=n(e);break}case`p`:r+=t.getHours()<12?`AM`:`PM`;break;case`P`:r+=t.getHours()<12?`am`:`pm`;break;case`%`:r+=`%`;break;case`a`:r+=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`][t.getDay()];break;case`b`:r+=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][t.getMonth()];break;default:r+=`%${a}`}i+=2}else r+=e[i],i++;return r}function Up(e,t){let n=``,r=0,i=e.state.env.get(`USER`)||e.state.env.get(`LOGNAME`)||`user`,a=e.state.env.get(`HOSTNAME`)||`localhost`,o=a.split(`.`)[0],s=e.state.env.get(`PWD`)||`/`,c=e.state.env.get(`HOME`)||`/`,l=s.startsWith(c)?`~${s.slice(c.length)}`:s,u=s.split(`/`).pop()||s,d=new Date,f=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],p=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],m=e.state.env.get(`__COMMAND_NUMBER`)||`1`;for(;r<t.length;){let e=t[r];if(e===`\\`){if(r+1>=t.length){n+=`\\`,r++;continue}let e=t[r+1];if(e>=`0`&&e<=`7`){let e=``,i=r+1;for(;i<t.length&&i<r+4&&t[i]>=`0`&&t[i]<=`7`;)e+=t[i],i++;let a=Number.parseInt(e,8)%256;n+=String.fromCharCode(a),r=i;continue}switch(e){case`\\`:n+=`\\`,r+=2;break;case`a`:n+=`\x07`,r+=2;break;case`e`:n+=`\x1B`,r+=2;break;case`n`:n+=`
209
+ `,``):e.state.env.get(`${t}_${i}`)||``}let o=e.state.env.get(`${t}_${a}`);if(o!==void 0)return o;if(a===0){let n=e.state.env.get(t);if(n!==void 0)return n}if(n&&e.state.options.nounset)throw new ar(`${t}[${a}]`);return``}if(/^[1-9][0-9]*$/.test(t)){let r=e.state.env.get(t);if(r===void 0&&n&&e.state.options.nounset)throw new ar(t);return r||``}if(sp(e,t)){let i=lp(e,t);if(i===void 0)return``;if(i!==t)return await X(e,i,n,r);let a=e.state.env.get(t);if((a===void 0||a===``)&&n&&e.state.options.nounset)throw new ar(t);return a||``}let a=e.state.env.get(t);if(a!==void 0)return e.state.tempEnvBindings?.some(e=>e.has(t))&&(e.state.accessedTempEnvVars=e.state.accessedTempEnvVars||new Set,e.state.accessedTempEnvVars.add(t)),a;if(pp(e,t)){let n=e.state.env.get(`${t}_0`);return n===void 0?``:n}if(n&&e.state.options.nounset)throw new ar(t);return``}async function mp(e,t){if(new Set([`?`,`$`,`#`,`_`,`-`,`0`,`PPID`,`UID`,`EUID`,`RANDOM`,`SECONDS`,`BASH_VERSION`,`!`,`BASHPID`,`LINENO`]).has(t))return!0;if(t===`@`||t===`*`)return Number.parseInt(e.state.env.get(`#`)||`0`,10)>0;if(t===`PWD`||t===`OLDPWD`)return e.state.env.has(t);let n=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(n){let t=n[1],r=n[2];if(sp(e,t)){let n=lp(e,t);if(n&&n!==t){if(n.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return!1;t=n}}if(r===`@`||r===`*`)return Y(e,t).length>0?!0:e.state.env.has(t);if(e.state.associativeArrays?.has(t)){let n=Xf(r);return e.state.env.has(`${t}_${n}`)}let i;if(/^-?\d+$/.test(r))i=Number.parseInt(r,10);else try{i=await $(e,ud(new Mf,r).expression)}catch{let t=e.state.env.get(r);i=t?Number.parseInt(t,10):0,Number.isNaN(i)&&(i=0)}if(i<0){let n=Y(e,t);if(n.length===0)return!1;let r=Math.max(...n.map(([e])=>typeof e==`number`?e:0))+1+i;return r<0?!1:e.state.env.has(`${t}_${r}`)}return e.state.env.has(`${t}_${i}`)}if(sp(e,t)){let n=lp(e,t);return n===void 0||n===t?e.state.env.has(t):mp(e,n)}return!!(e.state.env.has(t)||pp(e,t))}var hp=g(()=>{jd(),K(),Ou(),sg(),x(),Zf(),op(),dp()});async function gp(e,t){let n=``,r=0;for(;r<t.length;){if(t[r]===`$`){if(t[r+1]===`{`){let e=1,i=r+2;for(;i<t.length&&e>0;)t[i]===`{`?e++:t[i]===`}`&&e--,i++;n+=t.slice(r,i),r=i;continue}if(t[r+1]===`(`){let e=1,i=r+2;for(;i<t.length&&e>0;)t[i]===`(`?e++:t[i]===`)`&&e--,i++;n+=t.slice(r,i),r=i;continue}if(/[a-zA-Z_]/.test(t[r+1]||``)){let i=r+1;for(;i<t.length&&/[a-zA-Z0-9_]/.test(t[i]);)i++;let a=await X(e,t.slice(r+1,i));n+=a,r=i;continue}if(/[0-9]/.test(t[r+1]||``)){let i=r+1;for(;i<t.length&&/[0-9]/.test(t[i]);)i++;let a=await X(e,t.slice(r+1,i));n+=a,r=i;continue}if(/[*@#?\-!$]/.test(t[r+1]||``)){let i=t[r+1],a=await X(e,i);n+=a,r+=2;continue}}if(t[r]===`"`){for(n+=`"`,r++;r<t.length&&t[r]!==`"`;)if(t[r]===`$`&&/[a-zA-Z_]/.test(t[r+1]||``)){let i=r+1;for(;i<t.length&&/[a-zA-Z0-9_]/.test(t[i]);)i++;let a=await X(e,t.slice(r+1,i));n+=a,r=i}else t[r]===`\\`?(n+=t[r],r++,r<t.length&&(n+=t[r],r++)):(n+=t[r],r++);r<t.length&&(n+=`"`,r++);continue}n+=t[r],r++}return n}async function _p(e,t){let n=t,r=t.startsWith(`"`)&&t.endsWith(`"`),i=t.startsWith(`'`)&&t.endsWith(`'`);if((r||i)&&(n=t.slice(1,-1)),i)return n;let a=``,o=0;for(;o<n.length;)if(n[o]===`$`)if(n[o+1]===`(`){let t=1,r=o+2;for(;r<n.length&&t>0;)n[r]===`(`&&n[r-1]===`$`||n[r]===`(`?t++:n[r]===`)`&&t--,r++;let i=n.slice(o+2,r-1);if(e.execFn){let t=await e.execFn(i,{signal:e.state.signal});a+=t.stdout.replace(/\n+$/,``),t.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||``)+t.stderr)}o=r}else if(n[o+1]===`{`){let t=1,r=o+2;for(;r<n.length&&t>0;)n[r]===`{`?t++:n[r]===`}`&&t--,r++;let i=await X(e,n.slice(o+2,r-1));a+=i,o=r}else if(/[a-zA-Z_]/.test(n[o+1]||``)){let t=o+1;for(;t<n.length&&/[a-zA-Z0-9_]/.test(n[t]);)t++;let r=await X(e,n.slice(o+1,t));a+=r,o=t}else a+=n[o],o++;else if(n[o]==="`"){let t=o+1;for(;t<n.length&&n[t]!=="`";)t++;let r=n.slice(o+1,t);if(e.execFn){let t=await e.execFn(r,{signal:e.state.signal});a+=t.stdout.replace(/\n+$/,``),t.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||``)+t.stderr)}o=t+1}else a+=n[o],o++;return a}var vp=g(()=>{hp()});function yp(e,t,n,r,i){let a=n??1;a===0&&(a=1);let o=Math.abs(a),s=[],c=0;r?.match(/^-?0\d/)&&(c=Math.max(c,r.replace(/^-/,``).length)),i?.match(/^-?0\d/)&&(c=Math.max(c,i.replace(/^-/,``).length));let l=e=>{if(c>0){let t=e<0,n=String(Math.abs(e)).padStart(c,`0`);return t?`-${n}`:n}return String(e)};if(e<=t)for(let n=e,r=0;n<=t&&r<Sp;n+=o,r++)s.push(l(n));else for(let n=e,r=0;n>=t&&r<Sp;n-=o,r++)s.push(l(n));return s}function bp(e,t,n){let r=n??1;r===0&&(r=1);let i=e.charCodeAt(0),a=t.charCodeAt(0),o=Math.abs(r);if(e>=`A`&&e<=`Z`&&t>=`a`&&t<=`z`||e>=`a`&&e<=`z`&&t>=`A`&&t<=`Z`){let r=n===void 0?``:`..${n}`;throw new ur(`{${e}..${t}${r}}: invalid sequence`)}let s=[];if(i<=a)for(let e=i,t=0;e<=a&&t<Sp;e+=o,t++)s.push(String.fromCharCode(e));else for(let e=i,t=0;e>=a&&t<Sp;e-=o,t++)s.push(String.fromCharCode(e));return s}function xp(e,t,n,r,i){let a=n===void 0?``:`..${n}`;return typeof e==`number`&&typeof t==`number`?{expanded:yp(e,t,n,r,i),literal:`{${e}..${t}${a}}`}:typeof e==`string`&&typeof t==`string`?{expanded:bp(e,t,n),literal:`{${e}..${t}${a}}`}:{expanded:null,literal:`{${e}..${t}${a}}`}}var Sp,Cp=g(()=>{x(),Sp=1e4});function wp(e){if(e.statements.length!==1)return null;let t=e.statements[0];if(t.operators.length!==0||t.pipelines.length!==1)return null;let n=t.pipelines[0];if(n.negated||n.commands.length!==1)return null;let r=n.commands[0];if(r.type!==`SimpleCommand`)return null;let i=r;if(i.name!==null||i.args.length!==0||i.assignments.length!==0||i.redirections.length!==1)return null;let a=i.redirections[0];return a.operator!==`<`||a.target.type!==`Word`?null:{target:a.target}}var Tp=g(()=>{});function Ep(e,t){return!!(/[*?[]/.test(e)||t&&/[@*+?!]\(/.test(e))}function Dp(e){let t=``,n=0;for(;n<e.length;)e[n]===`\\`&&n+1<e.length?(t+=e[n+1],n+=2):(t+=e[n],n++);return t}function Op(e){return e.replace(/([*?[\]\\()|])/g,`\\$1`)}function kp(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`)}var Ap=g(()=>{});function Z(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var jp=g(()=>{});function Q(e,t,n=!1){let r=``,i=0;for(;i<e.length;){let a=e[i];if(n&&(a===`@`||a===`*`||a===`+`||a===`?`||a===`!`)&&i+1<e.length&&e[i+1]===`(`){let o=Mp(e,i+1);if(o!==-1){let s=Np(e.slice(i+2,o)).map(e=>Q(e,t,n)),c=s.length>0?s.join(`|`):`(?:)`;a===`@`?r+=`(?:${c})`:a===`*`?r+=`(?:${c})*`:a===`+`?r+=`(?:${c})+`:a===`?`?r+=`(?:${c})?`:a===`!`&&(r+=`(?!(?:${c})$).*`),i=o+1;continue}}if(a===`\\`)if(i+1<e.length){let t=e[i+1];/[\\^$.|+(){}[\]*?]/.test(t)?r+=`\\${t}`:r+=t,i+=2}else r+=`\\\\`,i++;else if(a===`*`)r+=t?`.*`:`.*?`,i++;else if(a===`?`)r+=`.`,i++;else if(a===`[`){let t=Pp(e,i);if(t===-1)r+=`\\[`,i++;else{let n=e.slice(i+1,t);r+=Fp(n),i=t+1}}else/[\^$.|+(){}]/.test(a)?(r+=`\\${a}`,i++):(r+=a,i++)}return r}function Mp(e,t){let n=1,r=t+1;for(;r<e.length&&n>0;){let t=e[r];if(t===`\\`){r+=2;continue}if(t===`(`)n++;else if(t===`)`&&(n--,n===0))return r;r++}return-1}function Np(e){let t=[],n=``,r=0,i=0;for(;i<e.length;){let a=e[i];if(a===`\\`){n+=a,i+1<e.length?(n+=e[i+1],i+=2):i++;continue}a===`(`?(r++,n+=a):a===`)`?(r--,n+=a):a===`|`&&r===0?(t.push(n),n=``):n+=a,i++}return t.push(n),t}function Pp(e,t){let n=t+1;for(n<e.length&&e[n]===`^`&&n++,n<e.length&&e[n]===`]`&&n++;n<e.length;){if(e[n]===`\\`&&n+1<e.length){n+=2;continue}if(e[n]===`]`)return n;if(e[n]===`'`){let t=e.indexOf(`'`,n+1);if(t!==-1){n=t+1;continue}}if(e[n]===`[`&&n+1<e.length&&e[n+1]===`:`){let t=e.indexOf(`:]`,n+2);if(t!==-1){n=t+2;continue}}n++}return-1}function Fp(e){let t=`[`,n=0;for((e[0]===`^`||e[0]===`!`)&&(t+=`^`,n++);n<e.length;){if(e[n]===`'`){let r=e.indexOf(`'`,n+1);if(r!==-1){let i=e.slice(n+1,r);for(let e of i)e===`\\`?t+=`\\\\`:e===`]`?t+=`\\]`:e===`^`&&t===`[`?t+=`\\^`:t+=e;n=r+1;continue}}if(e[n]===`[`&&n+1<e.length&&e[n+1]===`:`){let r=e.indexOf(`:]`,n+2);if(r!==-1){let i=e.slice(n+2,r);t+=Ip(i),n=r+2;continue}}let r=e[n];r===`\\`?n+1<e.length?(t+=`\\${e[n+1]}`,n+=2):(t+=`\\\\`,n++):r===`-`&&n>0&&n<e.length-1?(t+=`-`,n++):r===`^`&&n===0?(t+=`^`,n++):(r===`]`&&n===0?t+=`\\]`:t+=r,n++)}return t+=`]`,t}function Ip(e){return Lp.get(e)??``}var Lp,Rp=g(()=>{Lp=new Map([[`alnum`,`a-zA-Z0-9`],[`alpha`,`a-zA-Z`],[`ascii`,`\\x00-\\x7F`],[`blank`,` \\t`],[`cntrl`,`\\x00-\\x1F\\x7F`],[`digit`,`0-9`],[`graph`,`!-~`],[`lower`,`a-z`],[`print`,` -~`],[`punct`,"!-/:-@\\[-`{-~"],[`space`,` \\t\\n\\r\\f\\v`],[`upper`,`A-Z`],[`word`,`a-zA-Z0-9_`],[`xdigit`,`0-9A-Fa-f`]])});function zp(e,t,n,r){if(n===`prefix`)return M(`^${t}`,`s`).replace(e,``);let i=M(`${t}$`,`s`);if(r)return i.replace(e,``);for(let t=e.length;t>=0;t--){let n=e.slice(t);if(i.test(n))return e.slice(0,t)}return e}function Bp(e,t){let n=Array.from(e.state.env.keys()),r=new Set,i=e.state.associativeArrays??new Set,a=new Set;for(let e of n){let t=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);t&&a.add(t[1]);let n=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);n&&a.add(n[1])}let o=e=>{for(let t of i){let n=`${t}_`;if(e.startsWith(n)&&e!==t)return!0}return!1};for(let e of n)if(e.startsWith(t))if(e.includes(`__`)){let n=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);n?.[1].startsWith(t)&&r.add(n[1])}else if(/_\d+$/.test(e)){let n=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);n?.[1].startsWith(t)&&r.add(n[1])}else o(e)||r.add(e);return[...r].sort()}var Vp=g(()=>{ta()});function Hp(e,t){let n=(e,t=2)=>String(e).padStart(t,`0`);if(e===``)return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;let r=``,i=0;for(;i<e.length;)if(e[i]===`%`){if(i+1>=e.length){r+=`%`,i++;continue}let a=e[i+1];switch(a){case`H`:r+=n(t.getHours());break;case`M`:r+=n(t.getMinutes());break;case`S`:r+=n(t.getSeconds());break;case`d`:r+=n(t.getDate());break;case`m`:r+=n(t.getMonth()+1);break;case`Y`:r+=t.getFullYear();break;case`y`:r+=n(t.getFullYear()%100);break;case`I`:{let e=t.getHours()%12;e===0&&(e=12),r+=n(e);break}case`p`:r+=t.getHours()<12?`AM`:`PM`;break;case`P`:r+=t.getHours()<12?`am`:`pm`;break;case`%`:r+=`%`;break;case`a`:r+=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`][t.getDay()];break;case`b`:r+=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][t.getMonth()];break;default:r+=`%${a}`}i+=2}else r+=e[i],i++;return r}function Up(e,t){let n=``,r=0,i=e.state.env.get(`USER`)||e.state.env.get(`LOGNAME`)||`user`,a=e.state.env.get(`HOSTNAME`)||`localhost`,o=a.split(`.`)[0],s=e.state.env.get(`PWD`)||`/`,c=e.state.env.get(`HOME`)||`/`,l=s.startsWith(c)?`~${s.slice(c.length)}`:s,u=s.split(`/`).pop()||s,d=new Date,f=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],p=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],m=e.state.env.get(`__COMMAND_NUMBER`)||`1`;for(;r<t.length;){let e=t[r];if(e===`\\`){if(r+1>=t.length){n+=`\\`,r++;continue}let e=t[r+1];if(e>=`0`&&e<=`7`){let e=``,i=r+1;for(;i<t.length&&i<r+4&&t[i]>=`0`&&t[i]<=`7`;)e+=t[i],i++;let a=Number.parseInt(e,8)%256;n+=String.fromCharCode(a),r=i;continue}switch(e){case`\\`:n+=`\\`,r+=2;break;case`a`:n+=`\x07`,r+=2;break;case`e`:n+=`\x1B`,r+=2;break;case`n`:n+=`
210
210
  `,r+=2;break;case`r`:n+=`\r`,r+=2;break;case`$`:n+=`$`,r+=2;break;case`[`:case`]`:r+=2;break;case`u`:n+=i,r+=2;break;case`h`:n+=o,r+=2;break;case`H`:n+=a,r+=2;break;case`w`:n+=l,r+=2;break;case`W`:n+=u,r+=2;break;case`d`:{let e=String(d.getDate()).padStart(2,` `);n+=`${f[d.getDay()]} ${p[d.getMonth()]} ${e}`,r+=2;break}case`t`:{let e=String(d.getHours()).padStart(2,`0`),t=String(d.getMinutes()).padStart(2,`0`),i=String(d.getSeconds()).padStart(2,`0`);n+=`${e}:${t}:${i}`,r+=2;break}case`T`:{let e=d.getHours()%12;e===0&&(e=12);let t=String(e).padStart(2,`0`),i=String(d.getMinutes()).padStart(2,`0`),a=String(d.getSeconds()).padStart(2,`0`);n+=`${t}:${i}:${a}`,r+=2;break}case`@`:{let e=d.getHours()%12;e===0&&(e=12);let t=String(e).padStart(2,`0`),i=String(d.getMinutes()).padStart(2,`0`),a=d.getHours()<12?`AM`:`PM`;n+=`${t}:${i} ${a}`,r+=2;break}case`A`:{let e=String(d.getHours()).padStart(2,`0`),t=String(d.getMinutes()).padStart(2,`0`);n+=`${e}:${t}`,r+=2;break}case`D`:if(r+2<t.length&&t[r+2]===`{`){let e=t.indexOf(`}`,r+3);if(e!==-1){let i=t.slice(r+3,e);n+=Hp(i,d),r=e+1}else n+=`\\D`,r+=2}else n+=`\\D`,r+=2;break;case`s`:n+=`bash`,r+=2;break;case`v`:n+=`5.0`,r+=2;break;case`V`:n+=`5.0.0`,r+=2;break;case`j`:n+=`0`,r+=2;break;case`l`:n+=`tty`,r+=2;break;case`#`:n+=m,r+=2;break;case`!`:n+=m,r+=2;break;case`x`:n+=`\\x`,r+=2;break;default:n+=`\\${e}`,r+=2}}else n+=e,r++}return n}var Wp=g(()=>{});function Gp(e){if(e===``)return`''`;if(/[\n\r\t\x00-\x1f\x7f']/.test(e)){let t=`$'`;for(let n of e)switch(n){case`'`:t+=`\\'`;break;case`\\`:t+=`\\\\`;break;case`
211
211
  `:t+=`\\n`;break;case`\r`:t+=`\\r`;break;case` `:t+=`\\t`;break;default:{let e=n.charCodeAt(0);e<32||e===127?t+=`\\${e.toString(8).padStart(3,`0`)}`:t+=n}}return`${t}'`}return`'${e}'`}var Kp=g(()=>{});function qp(e,t){return e.state.readonlyVars?.has(t)??!1}var Jp=g(()=>{x()});function Yp(e,t){if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t))return``;let n=``,r=e.state.env.has(`${t}__length`)||Array.from(e.state.env.keys()).some(e=>e.startsWith(`${t}_`)&&/^[0-9]+$/.test(e.slice(t.length+1))),i=e.state.associativeArrays?.has(t)??!1;return r&&!i&&(n+=`a`),i&&(n+=`A`),e.state.integerVars?.has(t)&&(n+=`i`),sp(e,t)&&(n+=`n`),qp(e,t)&&(n+=`r`),e.state.exportedVars?.has(t)&&(n+=`x`),n}var Xp=g(()=>{dp(),Jp()});async function Zp(e,t,n,r){return e.coverage?.hit(`bash:expansion:default_value`),(n.isUnset||t.checkEmpty&&n.isEmpty)&&t.word?r(e,t.word.parts,n.inDoubleQuotes):n.effectiveValue}async function Qp(e,t,n,r,i){if(e.coverage?.hit(`bash:expansion:assign_default`),(r.isUnset||n.checkEmpty&&r.isEmpty)&&n.word){let a=await i(e,n.word.parts,r.inDoubleQuotes),o=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(o){let[,t,n]=o,r;if(/^\d+$/.test(n))r=Number.parseInt(n,10);else{try{r=await $(e,ud(new Mf,n).expression)}catch{let t=e.state.env.get(n);r=t?Number.parseInt(t,10):0}Number.isNaN(r)&&(r=0)}e.state.env.set(`${t}_${r}`,a);let i=Number.parseInt(e.state.env.get(`${t}__length`)||`0`,10);r>=i&&e.state.env.set(`${t}__length`,String(r+1))}else e.state.env.set(t,a);return a}return r.effectiveValue}async function $p(e,t,n,r,i){if(e.coverage?.hit(`bash:expansion:error_if_unset`),r.isUnset||n.checkEmpty&&r.isEmpty){let a=n.word?await i(e,n.word.parts,r.inDoubleQuotes):`${t}: parameter null or not set`;throw new or(1,``,`bash: ${a}
212
212
  `)}return r.effectiveValue}async function em(e,t,n,r){return e.coverage?.hit(`bash:expansion:use_alternative`),!(n.isUnset||t.checkEmpty&&n.isEmpty)&&t.word?r(e,t.word.parts,n.inDoubleQuotes):``}async function tm(e,t,n,r,i){e.coverage?.hit(`bash:expansion:pattern_removal`);let a=``,o=e.state.shoptOptions.extglob;if(n.pattern)for(let t of n.pattern.parts)if(t.type===`Glob`)a+=Q(t.pattern,n.greedy,o);else if(t.type===`Literal`)a+=Q(t.value,n.greedy,o);else if(t.type===`SingleQuoted`||t.type===`Escaped`)a+=Z(t.value);else if(t.type===`DoubleQuoted`){let n=await r(e,t.parts);a+=Z(n)}else if(t.type===`ParameterExpansion`){let r=await i(e,t);a+=Q(r,n.greedy,o)}else{let n=await i(e,t);a+=Z(n)}if(n.side===`prefix`)return M(`^${a}`,`s`).replace(t,``);let s=M(`${a}$`,`s`);if(n.greedy)return s.replace(t,``);for(let e=t.length;e>=0;e--){let n=t.slice(e);if(s.test(n))return t.slice(0,e)}return t}async function nm(e,t,n,r,i){e.coverage?.hit(`bash:expansion:pattern_replacement`);let a=``,o=e.state.shoptOptions.extglob;if(n.pattern)for(let t of n.pattern.parts)if(t.type===`Glob`)a+=Q(t.pattern,!0,o);else if(t.type===`Literal`)a+=Q(t.value,!0,o);else if(t.type===`SingleQuoted`||t.type===`Escaped`)a+=Z(t.value);else if(t.type===`DoubleQuoted`){let n=await r(e,t.parts);a+=Z(n)}else if(t.type===`ParameterExpansion`){let n=await i(e,t);a+=Q(n,!0,o)}else{let n=await i(e,t);a+=Z(n)}let s=n.replacement?await r(e,n.replacement.parts):``;if(n.anchor===`start`?a=`^${a}`:n.anchor===`end`&&(a=`${a}$`),a===``)return t;let c=n.all?`gs`:`s`;try{let r=M(a,c);if(n.all){let n=``,i=0,a=0,o=e.limits.maxStringLength,c=r.exec(t);for(;c!==null&&!(c[0].length===0&&c.index===t.length);){if(n+=t.slice(i,c.index)+s,i=c.index+c[0].length,c[0].length===0&&i++,a++,a%100==0&&n.length>o)throw new b(`pattern replacement: string length limit exceeded (${o} bytes)`,`string_length`);c=r.exec(t)}return n+=t.slice(i),n}return r.replace(t,s)}catch(e){if(e instanceof b)throw e;return t}}function rm(e,t,n){e.coverage?.hit(`bash:expansion:length`);let r=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(r){let t=r[1],n=Y(e,t);return n.length>0?String(n.length):e.state.env.get(t)===void 0?`0`:`1`}if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t)&&pp(e,t)){if(t===`FUNCNAME`){let t=e.state.funcNameStack?.[0]||``;return String([...t].length)}if(t===`BASH_LINENO`){let t=e.state.callLineStack?.[0];return String(t===void 0?0:[...String(t)].length)}let n=e.state.env.get(`${t}_0`)||``;return String([...n].length)}return String([...n].length)}async function im(e,t,n,r){e.coverage?.hit(`bash:expansion:substring`);let i=await $(e,r.offset.expression),a=r.length?await $(e,r.length.expression):void 0;if(t===`@`||t===`*`){let t=Number.parseInt(e.state.env.get(`#`)||`0`,10),n=[];for(let r=1;r<=t;r++)n.push(e.state.env.get(String(r))||``);let r=e.state.env.get(`0`)||`bash`,o,s;if(i<=0)if(o=[r,...n],i<0){if(s=o.length+i,s<0)return``}else s=0;else o=n,s=i-1;if(s<0||s>=o.length)return``;if(a!==void 0){let e=a<0?o.length+a:s+a;return o.slice(s,Math.max(s,e)).join(` `)}return o.slice(s).join(` `)}let o=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(o){let t=o[1];if(e.state.associativeArrays?.has(t))throw new or(1,``,`bash: \${${t}[@]: 0: 3}: bad substitution
@@ -1,4 +1,4 @@
1
- import{t as e}from"./logger-DDBAeTLF.js";import"./navigation-watcher-BxAAD5To.js";import"./remote-cdp-transport-BrkfZae9.js";var t=e(`cdp`),n=4001,r=class{ws=null;nextId=1;_superseded=!1;pending=new Map;listeners=new Map;_state=`disconnected`;get state(){return this._state}get superseded(){return this._superseded}async connect(e){if(this._state!==`disconnected`)throw Error(`Cannot connect: state is ${this._state}`);if(!e?.url)throw Error(`CDPClient.connect() requires a WebSocket URL`);let{url:n,timeout:r=5e3,protocols:i}=e;return this._state=`connecting`,new Promise((e,a)=>{let o=setTimeout(()=>{this.cleanup(),a(Error(`CDP connection timed out after ${r}ms`))},r);try{this.ws=i===void 0?new WebSocket(n):new WebSocket(n,i)}catch(e){clearTimeout(o),this._state=`disconnected`,a(e);return}this.ws.onopen=()=>{clearTimeout(o),this._state=`connected`,this._superseded=!1,t.info(`Connected`,{url:n}),e()},this.ws.onerror=e=>{clearTimeout(o),this._state===`connecting`&&(t.error(`Connection failed`,{url:n}),this.cleanup(),a(Error(`CDP WebSocket connection failed`)))},this.ws.onmessage=e=>{this.handleMessage(e.data)},this.ws.onclose=e=>{this.handleClose(e?.code)}})}disconnect(){this.ws&&(this.ws.onclose=null,this.ws.close()),this._superseded=!1,this.cleanup(),t.info(`Disconnected`)}async send(e,n,r,i=3e4){if(this._state!==`connected`||!this.ws)throw Error(`CDP client is not connected`);let a=this.nextId++,o={id:a,method:e};return n&&(o.params=n),r&&(o.sessionId=r),t.debug(`Send`,{method:e,id:a,sessionId:r}),new Promise((t,n)=>{let r=setTimeout(()=>{this.pending.delete(a),n(Error(`CDP command timed out after ${i}ms: ${e}`))},i);this.pending.set(a,{resolve:e=>{clearTimeout(r),t(e)},reject:e=>{clearTimeout(r),n(e)}}),this.ws.send(JSON.stringify(o))})}on(e,t){let n=this.listeners.get(e);n||(n=new Set,this.listeners.set(e,n)),n.add(t)}off(e,t){let n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}once(e,t=3e4){return new Promise((n,r)=>{let i=setTimeout(()=>{this.off(e,a),r(Error(`Timed out waiting for event: ${e}`))},t),a=t=>{clearTimeout(i),this.off(e,a),n(t)};this.on(e,a)})}handleMessage(e){let n;try{n=JSON.parse(e)}catch{return}if(`id`in n&&typeof n.id==`number`){let e=n;t.debug(`Response`,{id:e.id,hasError:!!e.error});let r=this.pending.get(e.id);r&&(this.pending.delete(e.id),e.error?(t.error(`Command error`,{id:e.id,code:e.error.code,message:e.error.message}),r.reject(Error(`CDP error: ${e.error.message} (${e.error.code})`))):r.resolve(e.result??{}));return}if(`method`in n){let e=n;t.debug(`Event`,{method:e.method,sessionId:e.sessionId});let r=this.listeners.get(e.method);if(r){let t=e.sessionId?{...e.params,sessionId:e.sessionId}:e.params??{};for(let e of r)try{e(t)}catch{}}}}handleClose(e){let r=e===n;r?(this._superseded=!0,t.warn(`CDP slot superseded by another SLICC tab/window on this instance`,{code:e})):t.error(`Connection closed unexpectedly`,{pendingCommands:this.pending.size});let i=r?`CDP connection superseded by another SLICC tab/window on this instance`:`CDP connection closed`;for(let[,e]of this.pending)e.reject(Error(i));this.cleanup()}cleanup(){this.ws=null,this._state=`disconnected`,this.pending.clear()}},i=`(function() {
1
+ import{t as e}from"./logger-DDBAeTLF.js";import"./navigation-watcher-C2s0i0h4.js";import"./remote-cdp-transport-DTCu2BgA.js";var t=e(`cdp`),n=4001,r=class{ws=null;nextId=1;_superseded=!1;pending=new Map;listeners=new Map;_state=`disconnected`;get state(){return this._state}get superseded(){return this._superseded}async connect(e){if(this._state!==`disconnected`)throw Error(`Cannot connect: state is ${this._state}`);if(!e?.url)throw Error(`CDPClient.connect() requires a WebSocket URL`);let{url:n,timeout:r=5e3,protocols:i}=e;return this._state=`connecting`,new Promise((e,a)=>{let o=setTimeout(()=>{this.cleanup(),a(Error(`CDP connection timed out after ${r}ms`))},r);try{this.ws=i===void 0?new WebSocket(n):new WebSocket(n,i)}catch(e){clearTimeout(o),this._state=`disconnected`,a(e);return}this.ws.onopen=()=>{clearTimeout(o),this._state=`connected`,this._superseded=!1,t.info(`Connected`,{url:n}),e()},this.ws.onerror=e=>{clearTimeout(o),this._state===`connecting`&&(t.error(`Connection failed`,{url:n}),this.cleanup(),a(Error(`CDP WebSocket connection failed`)))},this.ws.onmessage=e=>{this.handleMessage(e.data)},this.ws.onclose=e=>{this.handleClose(e?.code)}})}disconnect(){this.ws&&(this.ws.onclose=null,this.ws.close()),this._superseded=!1,this.cleanup(),t.info(`Disconnected`)}async send(e,n,r,i=3e4){if(this._state!==`connected`||!this.ws)throw Error(`CDP client is not connected`);let a=this.nextId++,o={id:a,method:e};return n&&(o.params=n),r&&(o.sessionId=r),t.debug(`Send`,{method:e,id:a,sessionId:r}),new Promise((t,n)=>{let r=setTimeout(()=>{this.pending.delete(a),n(Error(`CDP command timed out after ${i}ms: ${e}`))},i);this.pending.set(a,{resolve:e=>{clearTimeout(r),t(e)},reject:e=>{clearTimeout(r),n(e)}}),this.ws.send(JSON.stringify(o))})}on(e,t){let n=this.listeners.get(e);n||(n=new Set,this.listeners.set(e,n)),n.add(t)}off(e,t){let n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}once(e,t=3e4){return new Promise((n,r)=>{let i=setTimeout(()=>{this.off(e,a),r(Error(`Timed out waiting for event: ${e}`))},t),a=t=>{clearTimeout(i),this.off(e,a),n(t)};this.on(e,a)})}handleMessage(e){let n;try{n=JSON.parse(e)}catch{return}if(`id`in n&&typeof n.id==`number`){let e=n;t.debug(`Response`,{id:e.id,hasError:!!e.error});let r=this.pending.get(e.id);r&&(this.pending.delete(e.id),e.error?(t.error(`Command error`,{id:e.id,code:e.error.code,message:e.error.message}),r.reject(Error(`CDP error: ${e.error.message} (${e.error.code})`))):r.resolve(e.result??{}));return}if(`method`in n){let e=n;t.debug(`Event`,{method:e.method,sessionId:e.sessionId});let r=this.listeners.get(e.method);if(r){let t=e.sessionId?{...e.params,sessionId:e.sessionId}:e.params??{};for(let e of r)try{e(t)}catch{}}}}handleClose(e){let r=e===n;r?(this._superseded=!0,t.warn(`CDP slot superseded by another SLICC tab/window on this instance`,{code:e})):t.error(`Connection closed unexpectedly`,{pendingCommands:this.pending.size});let i=r?`CDP connection superseded by another SLICC tab/window on this instance`:`CDP connection closed`;for(let[,e]of this.pending)e.reject(Error(i));this.cleanup()}cleanup(){this.ws=null,this._state=`disconnected`,this.pending.clear()}},i=`(function() {
2
2
  'use strict';
3
3
 
4
4
  // ===== DOM Utilities =====
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-aKtaBQYM.js";var t=e({copyTextToClipboard:()=>n});async function n(e){if(!e)return!1;if(typeof navigator<`u`&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}if(typeof document>`u`)return!1;try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.cssText=`position:fixed; opacity:0; pointer-events:none; left:-9999px;`,document.body.appendChild(t),t.select();let n=document.execCommand?.(`copy`)??!1;return document.body.removeChild(t),n}catch{return!1}}export{n,t};
@@ -1 +1 @@
1
- import{t as e}from"./logger-DDBAeTLF.js";import{t}from"./wc-permissions-registry-CR1rTd2H.js";import{t as n}from"./speech-CqQdPtyQ.js";import{t as r}from"./speech-assets-bridge-B8NqCAE8.js";import{i}from"./transformers-env-ChIHsg1x.js";import{i as a,t as o}from"./whisper-session-bkHemaIa.js";var s=e(`speech:composer`),c=5e3,l=(e,t,n)=>new Promise((r,i)=>{let a=setTimeout(()=>i(Error(`${n} timed out after ${t}ms`)),t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e)})}),u=class{#e;#t;#n;#r;#i;#a=null;#o=!1;#s={engine:`builtin`,state:`idle`};#c=i();#l=new Set;#u=null;constructor(e={}){this.#e=e.builtin??n(),this.#t=e.loadWhisper??a,this.#n=e.startSession??o,this.#r=e.getPermissionSurface??d,this.#i=e.ensureAssets??_}permission(){return this.#e.permission()}async requestPermission(){let e=this.#r();if(e)try{let t=await e.request(`microphone`);return t?(this.#p(t.stream),!0):!1}catch(e){return s.warn(`permission surface microphone request failed`,e),!1}return this.#e.requestPermission()}microphones(){return this.#e.microphones()}status(){return this.#s}onStatus(e){return this.#l.add(e),e(this.#s),()=>this.#l.delete(e)}warmup(){this.#o||(this.#o=!0,this.#c=i(),this.#_({engine:`builtin`,state:`downloading`}),this.#d().then(e=>{this.#a=e,this.#_({engine:`enhanced`,state:`ready`})},e=>{this.#o=!1,this.#_({engine:`builtin`,state:`unavailable`,message:p(e)}),s.warn(`enhanced speech engine unavailable`,e)}))}async#d(){let e=null;try{await this.#i(e=>this.#h(e))}catch(t){e=t,s.warn(`speech asset staging failed; trying already-present assets`,t)}try{return await this.#t(e=>this.#g(e))}catch(t){throw e??t}}async start(e){let t=this.#a;if(t){let n=null;try{return n=await this.#f(e.deviceId),await this.#n(t,{deviceId:e.deviceId,lang:e.lang,onPartial:e.onPartial,onError:e.onError,stream:n??void 0})}catch(e){if(n)for(let e of n.getTracks())e.stop();s.warn(`whisper session failed to start; falling back to builtin`,e)}}return this.#e.start(e)}async#f(e){let t=e&&e!=="default"?e:void 0,n=this.#m();if(n){if(!t&&f(n))return n;for(let e of n.getTracks())e.stop()}let r=this.#r();if(!r)return null;let i={audio:t?{deviceId:{exact:t}}:!0},a=await l(r.request(`microphone`,{constraints:i}),c,`microphone capture`);if(!a)throw Error(`microphone permission denied`);return a.stream}#p(e){if(this.#u&&this.#u!==e)for(let e of this.#u.getTracks())e.stop();this.#u=e}#m(){let e=this.#u;return this.#u=null,e}get enhancedReady(){return this.#a!==null}#h(e){if(this.#s.state!==`downloading`)return;(e.bytesTotal!=null||e.bytesLoaded!=null)&&this.#c.update(e.asset,e.bytesLoaded??0,e.bytesTotal??0);let t=this.#c.snapshot();t.total<=0||this.#_({engine:`builtin`,state:`downloading`,download:{loaded:t.loaded,total:t.total,etaSeconds:t.etaSeconds}})}#g(e){this.#s.state===`downloading`&&this.#_({engine:`builtin`,state:`downloading`,download:{loaded:e.loaded,total:e.total,etaSeconds:e.etaSeconds}})}#_(e){this.#s=e;for(let t of this.#l)t(e)}};function d(){let e=t();return e?{async request(t,n){let r=await e.request(t,n);return r?.kind===`microphone`?{kind:`microphone`,stream:r.stream}:null}}:null}function f(e){let t=e.getTracks();return t.length>0&&t.some(e=>e.readyState!==`ended`)}function p(e){return`Enhanced speech unavailable: ${e instanceof Error?e.message:String(e)}`}var m=()=>typeof chrome<`u`&&!!chrome?.runtime?.id,h;function g(e){h=e}function _(e){return m()?Promise.resolve():r({instanceId:h,onProgress:e})}var v=null;function y(){return v??=new u,v}export{y as getComposerSpeech,g as setComposerSpeechInstanceId};
1
+ import{t as e}from"./logger-DDBAeTLF.js";import{t}from"./wc-permissions-registry-Blyunq37.js";import{t as n}from"./speech-CqQdPtyQ.js";import{t as r}from"./speech-assets-bridge-CFYafE89.js";import{i}from"./transformers-env-Blt6HC_1.js";import{i as a,t as o}from"./whisper-session-tJ8m9ShN.js";var s=e(`speech:composer`),c=5e3,l=(e,t,n)=>new Promise((r,i)=>{let a=setTimeout(()=>i(Error(`${n} timed out after ${t}ms`)),t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e)})}),u=class{#e;#t;#n;#r;#i;#a=null;#o=!1;#s={engine:`builtin`,state:`idle`};#c=i();#l=new Set;#u=null;constructor(e={}){this.#e=e.builtin??n(),this.#t=e.loadWhisper??a,this.#n=e.startSession??o,this.#r=e.getPermissionSurface??d,this.#i=e.ensureAssets??_}permission(){return this.#e.permission()}async requestPermission(){let e=this.#r();if(e)try{let t=await e.request(`microphone`);return t?(this.#p(t.stream),!0):!1}catch(e){return s.warn(`permission surface microphone request failed`,e),!1}return this.#e.requestPermission()}microphones(){return this.#e.microphones()}status(){return this.#s}onStatus(e){return this.#l.add(e),e(this.#s),()=>this.#l.delete(e)}warmup(){this.#o||(this.#o=!0,this.#c=i(),this.#_({engine:`builtin`,state:`downloading`}),this.#d().then(e=>{this.#a=e,this.#_({engine:`enhanced`,state:`ready`})},e=>{this.#o=!1,this.#_({engine:`builtin`,state:`unavailable`,message:p(e)}),s.warn(`enhanced speech engine unavailable`,e)}))}async#d(){let e=null;try{await this.#i(e=>this.#h(e))}catch(t){e=t,s.warn(`speech asset staging failed; trying already-present assets`,t)}try{return await this.#t(e=>this.#g(e))}catch(t){throw e??t}}async start(e){let t=this.#a;if(t){let n=null;try{return n=await this.#f(e.deviceId),await this.#n(t,{deviceId:e.deviceId,lang:e.lang,onPartial:e.onPartial,onError:e.onError,stream:n??void 0})}catch(e){if(n)for(let e of n.getTracks())e.stop();s.warn(`whisper session failed to start; falling back to builtin`,e)}}return this.#e.start(e)}async#f(e){let t=e&&e!=="default"?e:void 0,n=this.#m();if(n){if(!t&&f(n))return n;for(let e of n.getTracks())e.stop()}let r=this.#r();if(!r)return null;let i={audio:t?{deviceId:{exact:t}}:!0},a=await l(r.request(`microphone`,{constraints:i}),c,`microphone capture`);if(!a)throw Error(`microphone permission denied`);return a.stream}#p(e){if(this.#u&&this.#u!==e)for(let e of this.#u.getTracks())e.stop();this.#u=e}#m(){let e=this.#u;return this.#u=null,e}get enhancedReady(){return this.#a!==null}#h(e){if(this.#s.state!==`downloading`)return;(e.bytesTotal!=null||e.bytesLoaded!=null)&&this.#c.update(e.asset,e.bytesLoaded??0,e.bytesTotal??0);let t=this.#c.snapshot();t.total<=0||this.#_({engine:`builtin`,state:`downloading`,download:{loaded:t.loaded,total:t.total,etaSeconds:t.etaSeconds}})}#g(e){this.#s.state===`downloading`&&this.#_({engine:`builtin`,state:`downloading`,download:{loaded:e.loaded,total:e.total,etaSeconds:e.etaSeconds}})}#_(e){this.#s=e;for(let t of this.#l)t(e)}};function d(){let e=t();return e?{async request(t,n){let r=await e.request(t,n);return r?.kind===`microphone`?{kind:`microphone`,stream:r.stream}:null}}:null}function f(e){let t=e.getTracks();return t.length>0&&t.some(e=>e.readyState!==`ended`)}function p(e){return`Enhanced speech unavailable: ${e instanceof Error?e.message:String(e)}`}var m=()=>typeof chrome<`u`&&!!chrome?.runtime?.id,h;function g(e){h=e}function _(e){return m()?Promise.resolve():r({instanceId:h,onProgress:e})}var v=null;function y(){return v??=new u,v}export{y as getComposerSpeech,g as setComposerSpeechInstanceId};
@@ -1,4 +1,4 @@
1
- import{C as e,P as t,d as n,f as r}from"./account-store-DvidGCSz.js";import{n as i}from"./main-ONpvMnyR.js";var a=`slicc_cloud_model_catalog`,o=`adobe`;function s(t){if(t===o)return!1;let n=e(t);return!(n.hidden||n.onOAuthLoginIntercepted)}function c(){try{let e=r().map(e=>({providerId:e.providerId,providerName:e.providerName,models:e.models.map(e=>({id:e.id,name:e.name}))}));localStorage.setItem(a,JSON.stringify(e))}catch{}}async function l(r){for(;r.firstChild;)r.removeChild(r.firstChild);r.className=`connect-surface`;let a=document.createElement(`h1`);a.className=`connect-surface__title`,a.textContent=`Connect providers`,r.appendChild(a);let l=document.createElement(`p`);l.className=`connect-surface__desc`,l.textContent=`Log in or add API keys for the providers your cone should use, then click Done to return to the dashboard.`,r.appendChild(l);let u=document.createElement(`div`);u.className=`connect-surface__accounts`,r.appendChild(u);function d(){for(;u.firstChild;)u.removeChild(u.firstChild);let r=n().filter(e=>e.providerId!==o);if(r.length===0){let e=document.createElement(`div`);e.className=`connect-surface__empty`,e.textContent=`No providers connected yet.`,u.appendChild(e)}else{let n=document.createElement(`div`);n.className=`connect-surface__accounts-list`;for(let i of r){let r=e(i.providerId),a=document.createElement(`div`);a.className=`connect-surface__account-row`;let o=document.createElement(`div`);o.className=`connect-surface__account-info`;let s=document.createElement(`div`);s.className=`connect-surface__account-name`,s.textContent=r.name,o.appendChild(s);let l=document.createElement(`div`);l.className=`connect-surface__account-detail`,i.userName?l.textContent=i.userName:i.accessToken?l.textContent=`Logged in`:l.textContent=i.apiKey?`API key set`:`No credentials`,o.appendChild(l),a.appendChild(o);let u=document.createElement(`button`);u.className=`connect-surface__remove-btn`,u.textContent=`Remove`,u.onclick=async()=>{await t(i.providerId),c(),d()},a.appendChild(u),n.appendChild(a)}u.appendChild(n)}let a=document.createElement(`button`);a.className=`connect-surface__add-btn`,a.textContent=r.length===0?`Add provider`:`Manage providers`,a.onclick=async()=>{await i({startInAddAccount:!0,providerFilter:s})&&(c(),d())},u.appendChild(a)}d(),c();let f=document.createElement(`div`);f.className=`connect-surface__footer`;let p=document.createElement(`button`);if(p.className=`connect-surface__done-btn`,p.textContent=`Done — return to dashboard`,p.onclick=()=>{c(),window.close()},f.appendChild(p),r.appendChild(f),!document.getElementById(`connect-surface-style`)){let e=document.createElement(`style`);e.id=`connect-surface-style`,e.textContent=`
1
+ import{C as e,P as t,d as n,f as r}from"./account-store-DRcHIayv.js";import{n as i}from"./main-BME4pJJo.js";var a=`slicc_cloud_model_catalog`,o=`adobe`;function s(t){if(t===o)return!1;let n=e(t);return!(n.hidden||n.onOAuthLoginIntercepted)}function c(){try{let e=r().map(e=>({providerId:e.providerId,providerName:e.providerName,models:e.models.map(e=>({id:e.id,name:e.name}))}));localStorage.setItem(a,JSON.stringify(e))}catch{}}async function l(r){for(;r.firstChild;)r.removeChild(r.firstChild);r.className=`connect-surface`;let a=document.createElement(`h1`);a.className=`connect-surface__title`,a.textContent=`Connect providers`,r.appendChild(a);let l=document.createElement(`p`);l.className=`connect-surface__desc`,l.textContent=`Log in or add API keys for the providers your cone should use, then click Done to return to the dashboard.`,r.appendChild(l);let u=document.createElement(`div`);u.className=`connect-surface__accounts`,r.appendChild(u);function d(){for(;u.firstChild;)u.removeChild(u.firstChild);let r=n().filter(e=>e.providerId!==o);if(r.length===0){let e=document.createElement(`div`);e.className=`connect-surface__empty`,e.textContent=`No providers connected yet.`,u.appendChild(e)}else{let n=document.createElement(`div`);n.className=`connect-surface__accounts-list`;for(let i of r){let r=e(i.providerId),a=document.createElement(`div`);a.className=`connect-surface__account-row`;let o=document.createElement(`div`);o.className=`connect-surface__account-info`;let s=document.createElement(`div`);s.className=`connect-surface__account-name`,s.textContent=r.name,o.appendChild(s);let l=document.createElement(`div`);l.className=`connect-surface__account-detail`,i.userName?l.textContent=i.userName:i.accessToken?l.textContent=`Logged in`:l.textContent=i.apiKey?`API key set`:`No credentials`,o.appendChild(l),a.appendChild(o);let u=document.createElement(`button`);u.className=`connect-surface__remove-btn`,u.textContent=`Remove`,u.onclick=async()=>{await t(i.providerId),c(),d()},a.appendChild(u),n.appendChild(a)}u.appendChild(n)}let a=document.createElement(`button`);a.className=`connect-surface__add-btn`,a.textContent=r.length===0?`Add provider`:`Manage providers`,a.onclick=async()=>{await i({startInAddAccount:!0,providerFilter:s})&&(c(),d())},u.appendChild(a)}d(),c();let f=document.createElement(`div`);f.className=`connect-surface__footer`;let p=document.createElement(`button`);if(p.className=`connect-surface__done-btn`,p.textContent=`Done — return to dashboard`,p.onclick=()=>{c(),window.close()},f.appendChild(p),r.appendChild(f),!document.getElementById(`connect-surface-style`)){let e=document.createElement(`style`);e.id=`connect-surface-style`,e.textContent=`
2
2
  .connect-surface {
3
3
  padding: 2rem;
4
4
  max-width: 560px;
@@ -1,4 +1,4 @@
1
- import{t as e}from"./dist-BmWy99kl.js";import{t}from"./logger-DDBAeTLF.js";function n(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n>=10||r===0?Math.round(n):Math.round(n*10)/10} ${t[r]}`}function r(e){let t=e.mimeType||`application/octet-stream`;return`${e.name} (${t}, ${n(e.size)})`}function i(e,t=`The original file lives on a remote runtime and is not accessible here.`){return e?.length?e.map(e=>{if(!e.path)return{...e};let{path:n,...r}=e;return e.kind===`image`&&e.data||e.kind===`text`&&e.text!==void 0?r:{...r,error:r.error??t}}):[]}t(`context-compaction`);function a(e){let t=[];for(let n of e){let e=n;switch(e.role){case`user`:t.push(`<user>\n${o(e.content)}\n</user>`);break;case`assistant`:t.push(`<assistant>\n${o(e.content)}\n</assistant>`);break;case`toolResult`:{let n=e.toolName??`tool`;t.push(`<tool-result name="${n}">\n${o(e.content)}\n</tool-result>`);break}case`bashExecution`:t.push(`<bash>\n$ ${e.command??``}\n${e.output??``}\n</bash>`);break;case`branchSummary`:case`compactionSummary`:t.push(`<prior-summary>\n${e.summary??``}\n</prior-summary>`);break;default:t.push(`<${e.role}>\n${o(e.content)}\n</${e.role}>`)}}return t.join(`
1
+ import{t as e}from"./dist-D69OmKNn.js";import{t}from"./logger-DDBAeTLF.js";function n(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n>=10||r===0?Math.round(n):Math.round(n*10)/10} ${t[r]}`}function r(e){let t=e.mimeType||`application/octet-stream`;return`${e.name} (${t}, ${n(e.size)})`}function i(e,t=`The original file lives on a remote runtime and is not accessible here.`){return e?.length?e.map(e=>{if(!e.path)return{...e};let{path:n,...r}=e;return e.kind===`image`&&e.data||e.kind===`text`&&e.text!==void 0?r:{...r,error:r.error??t}}):[]}t(`context-compaction`);function a(e){let t=[];for(let n of e){let e=n;switch(e.role){case`user`:t.push(`<user>\n${o(e.content)}\n</user>`);break;case`assistant`:t.push(`<assistant>\n${o(e.content)}\n</assistant>`);break;case`toolResult`:{let n=e.toolName??`tool`;t.push(`<tool-result name="${n}">\n${o(e.content)}\n</tool-result>`);break}case`bashExecution`:t.push(`<bash>\n$ ${e.command??``}\n${e.output??``}\n</bash>`);break;case`branchSummary`:case`compactionSummary`:t.push(`<prior-summary>\n${e.summary??``}\n</prior-summary>`);break;default:t.push(`<${e.role}>\n${o(e.content)}\n</${e.role}>`)}}return t.join(`
2
2
 
3
3
  `)}function o(e){if(typeof e==`string`)return e;if(!Array.isArray(e))return``;let t=[];for(let n of e){let e=n;e.type===`text`&&e.text?t.push(e.text):e.type===`thinking`&&e.thinking?t.push(`[thinking] ${e.thinking}`):e.type===`toolCall`?t.push(`[tool-call ${e.name??`?`}] ${JSON.stringify(e.arguments??{})}`):e.type===`image`&&t.push(`[image]`)}return t.join(`
4
4
  `)}var s=`From the conversation above, extract durable memories worth persisting to a global memory file shared across future sessions.
@@ -0,0 +1 @@
1
+ import{m as e}from"./wc-live-CKisGrn6.js";export{e as setDipExecHandler};