@inkeep/open-knowledge 0.2.0 → 0.4.0-beta.6
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.
- package/dist/THIRD_PARTY_NOTICES.md +6097 -0
- package/dist/alias-JE7RI5QX-Bia4gLMF.mjs +1 -0
- package/dist/assets/skills/open-knowledge/SKILL.md +347 -0
- package/dist/awk2-POPGKRAI-DDrFV-7v.mjs +1 -0
- package/dist/banner-DdbR6AZr.mjs +3 -0
- package/dist/base64-4YMZCVJ5-DDKKOjMm.mjs +1 -0
- package/dist/basename-AA2KJYZQ-BK5zVs3W.mjs +1 -0
- package/dist/bash-IJWYRKFO-B9r1a0X9.mjs +1 -0
- package/dist/build-B6buVrsB.mjs +2 -0
- package/dist/cat-RDUMLXKC-CeNrSElK.mjs +1 -0
- package/dist/chmod-SYMGL4JA-DFJ4ylQU.mjs +1 -0
- package/dist/chokidar-CxU7f6JW.mjs +4 -0
- package/dist/chunk-24IMIIXA-B6yIPkk2.mjs +2 -0
- package/dist/chunk-3THT3N7L-DztAF386.mjs +2 -0
- package/dist/chunk-3ZUFRYJ4-qsYuZX7b.mjs +2 -0
- package/dist/chunk-44UOCSGV-CaFxJDHm.mjs +2 -0
- package/dist/chunk-4GTNDTRF-PuLVuVJW.mjs +8 -0
- package/dist/chunk-4HHKTUW3-CQ53AiA_.mjs +3 -0
- package/dist/chunk-4Q4SM6WR-BlQvqCag.mjs +5 -0
- package/dist/chunk-55VFSPNA-DLwfww5b.mjs +3 -0
- package/dist/chunk-5QMZ5MUS-CAp625aG.mjs +5 -0
- package/dist/chunk-5QVNJEHU-dbrKfPGl.mjs +9 -0
- package/dist/chunk-5V6VZH6T-DMPvCPbn.mjs +2 -0
- package/dist/chunk-62RKD26F-B9la0pfD.mjs +21 -0
- package/dist/chunk-64BAICW3-D92CLSK-.mjs +2 -0
- package/dist/chunk-74CEPOFO-BcZUJMO1.mjs +23 -0
- package/dist/chunk-7L36YK2X-D7Z_Qw_C.mjs +3 -0
- package/dist/chunk-7TSDKFEO-DUQhJkDy.mjs +2 -0
- package/dist/chunk-A4HU7SVR-DKLaJeys.mjs +3 -0
- package/dist/chunk-A4JSPFCI-CEm2r8SB.mjs +7 -0
- package/dist/chunk-A5O5YHGN-DvJz5Cpw.mjs +2 -0
- package/dist/chunk-A65PWWJC-DV6RO_es.mjs +3 -0
- package/dist/chunk-A7A2DBEE-dTNL-45u.mjs +7 -0
- package/dist/chunk-A7ICOL4V-BvXPAaHu.mjs +14 -0
- package/dist/chunk-ALLTKNUZ-Cu6JFoC4.mjs +6 -0
- package/dist/chunk-APT7OOP2-DmUrFuRy.mjs +2 -0
- package/dist/chunk-BBXLRYSX-K758HlCs.mjs +6 -0
- package/dist/chunk-BRGMQKJV-BXc-9Cgj.mjs +63 -0
- package/dist/chunk-CR5AFCPT-DxNsgM0M.mjs +24 -0
- package/dist/chunk-CWQS3NFK-Co4ALolT.mjs +2 -0
- package/dist/chunk-D4J545R4-DkHLjHX6.mjs +12 -0
- package/dist/chunk-D6CWQ5DW-7lvT8dGP.mjs +6 -0
- package/dist/chunk-D7MEQ3VN-D8jJZr4A.mjs +5 -0
- package/dist/chunk-DCAAORBQ-C3s1D8OY.mjs +2 -0
- package/dist/chunk-DXB73IDG-DIKSLkPq.mjs +2 -0
- package/dist/chunk-EEXR5ZDP-CETL3_Uw.mjs +3 -0
- package/dist/chunk-EIZGF4BS-DOoQW9jQ.mjs +9 -0
- package/dist/chunk-F23WWYKW-BK2tpXPf.mjs +17 -0
- package/dist/chunk-F55TLFGB-Vy5RU2P3.mjs +10 -0
- package/dist/chunk-FEIOJCZD-C25Und0M.mjs +75 -0
- package/dist/chunk-FK9Q3tQk.mjs +1 -0
- package/dist/chunk-GCTKCWKD-Di-RB9Qt.mjs +4 -0
- package/dist/chunk-GFQRA5P5-DnjwTqP3.mjs +8 -0
- package/dist/chunk-GOV5EKKI-CKV9jOGv.mjs +10 -0
- package/dist/chunk-GXVXFKBA-CUKDClxt.mjs +6 -0
- package/dist/chunk-HDQ56CKY-MTQ75a8z.mjs +16 -0
- package/dist/chunk-HJQJAYMS-D-8Vc6Zb.mjs +3 -0
- package/dist/chunk-HJWBQKYG-XrOcsn2f.mjs +6 -0
- package/dist/chunk-HWBSOZZR-BZF8XsyZ.mjs +37 -0
- package/dist/chunk-HWKDQ44K-wgmyck2O.mjs +4 -0
- package/dist/chunk-I57KEIP3-DipCOPKf.mjs +11 -0
- package/dist/chunk-IPJHKYVM-C3IodQq7.mjs +2 -0
- package/dist/chunk-J642UCRS-YiNealfn.mjs +2 -0
- package/dist/chunk-JVPRLUMK-VMFWXimu.mjs +8 -0
- package/dist/chunk-KMEYNNUA-pRogdye4.mjs +16 -0
- package/dist/chunk-LL3S3NLB-ByBS5IDP.mjs +2 -0
- package/dist/chunk-LPQPILI2-FRQB9gt5.mjs +12 -0
- package/dist/chunk-LTZRCH7N-46S7WKw8.mjs +32 -0
- package/dist/chunk-LWEGUNWT-DdGmM3wr.mjs +8 -0
- package/dist/chunk-MDDMCKUK-CuRdI1Uv.mjs +7 -0
- package/dist/chunk-MDLLFABN-Wd1iVjXi.mjs +73 -0
- package/dist/chunk-MHTUABJP-BWrqic3t.mjs +9 -0
- package/dist/chunk-MIZPJHVH-DWdPvcYR.mjs +8 -0
- package/dist/chunk-MLXIYONF-CiCzoeGt.mjs +16 -0
- package/dist/chunk-MYE6AGBJ-DJo74dVC.mjs +17 -0
- package/dist/chunk-NAERJDUW-CIHrNgJB.mjs +9 -0
- package/dist/chunk-NCNPKYJZ-BVljycUZ.mjs +3 -0
- package/dist/chunk-NUYSJFDK-BTseBdxv.mjs +8 -0
- package/dist/chunk-NYQYO467-BgXuDHUQ.mjs +33 -0
- package/dist/chunk-OARHFVLG-Cr0x3Si_.mjs +21 -0
- package/dist/chunk-OCLXQMOG-BW6rwyzS.mjs +7 -0
- package/dist/chunk-OCS6LSEM-D7VAOziZ.mjs +14 -0
- package/dist/chunk-OJDRYQWQ-ikvLWpfV.mjs +2 -0
- package/dist/chunk-OL3S66CO-CQnF8cPH.mjs +100 -0
- package/dist/chunk-PBXLG62G-CgbPJTiw.mjs +9 -0
- package/dist/chunk-PP6PSHAB-CO4MYU__.mjs +5 -0
- package/dist/chunk-PYSFUGCK-DsRn64Ef.mjs +11 -0
- package/dist/chunk-QCDB2VPH-BUMOhlW7.mjs +7 -0
- package/dist/chunk-QJ7O6ZN3-F0_rcDPM.mjs +6 -0
- package/dist/chunk-R6QSAL5T-CeW6f7-x.mjs +2 -0
- package/dist/chunk-R6VWJ2ZL-FwG_Za20.mjs +2 -0
- package/dist/chunk-RPNGRAAP-BmkapBPD.mjs +8 -0
- package/dist/chunk-SDNKECQQ-DkebEzkd.mjs +6 -0
- package/dist/chunk-SYMJJMQ4-DOZMaECk.mjs +22 -0
- package/dist/chunk-T56QNPHK-DPXaSSfC.mjs +15 -0
- package/dist/chunk-TLSUDHID-BovZg0r1.mjs +7 -0
- package/dist/chunk-TOMNU26N-AAglMy4J.mjs +5 -0
- package/dist/chunk-TXBZCHCQ-WeVWfqYv.mjs +6 -0
- package/dist/chunk-UNYNJIFU-CqGlXAg7.mjs +140 -0
- package/dist/chunk-V7TAPXDL-DQgGPvBY.mjs +28 -0
- package/dist/chunk-VJFXDYWH-DIo0Ia0_.mjs +11 -0
- package/dist/chunk-VLGZJRPG-DymOu90-.mjs +17 -0
- package/dist/chunk-VOBGTVA6-Bfa1NTzt.mjs +7 -0
- package/dist/chunk-VYOJP4TV-PBsHe2md.mjs +14 -0
- package/dist/chunk-WKFATFPP-KO2zkfs2.mjs +5 -0
- package/dist/chunk-X2AJGDEF-D5w6wtaX.mjs +2 -0
- package/dist/chunk-XHM67O4N-akBjDPaR.mjs +2 -0
- package/dist/chunk-XKQRETAK-RHzVmuiF.mjs +2 -0
- package/dist/chunk-XORM457F-wr_DBBnV.mjs +288 -0
- package/dist/chunk-XVDPCNWR-DxaG1FfA.mjs +12 -0
- package/dist/chunk-YCFVLTST-Dzwevuc3.mjs +13 -0
- package/dist/chunk-YFG2CMIF-BoZQym0L.mjs +5 -0
- package/dist/chunk-YNYSPYQ5-DesxOVHh.mjs +34 -0
- package/dist/chunk-YS3AZT3J-CBc9LHIy.mjs +9 -0
- package/dist/chunk-YTNYSM6T-WMIf3AF8.mjs +12 -0
- package/dist/chunk-Z6LRHWXI-DGTVoTuf.mjs +14 -0
- package/dist/chunk-Z7JVV2SM-Cb4YKOCM.mjs +12 -0
- package/dist/clear-5CZ5X4YR-CadVxKrq.mjs +1 -0
- package/dist/cli.mjs +61 -593
- package/dist/colors-BNufdynn.mjs +2 -0
- package/dist/colors-T3xmlXQT.mjs +1 -0
- package/dist/column-WLPMMSTS-6o4DDsDk.mjs +1 -0
- package/dist/comm-5SLSESQG-C2GatHU6.mjs +1 -0
- package/dist/config-schema.json +87 -0
- package/dist/config.project-local.schema.json +30 -0
- package/dist/config.project.schema.json +59 -0
- package/dist/config.user.schema.json +58 -0
- package/dist/constants-Dc6GZ6j9.mjs +2 -0
- package/dist/cp-XOYR4ABJ-DmS6dER-.mjs +1 -0
- package/dist/curl-47BFPSFW-C2kRcGkX.mjs +26 -0
- package/dist/cut-OPC3VAGB-s4tQWhL5.mjs +1 -0
- package/dist/date-DD7FVA2V-Dubgjr6a.mjs +1 -0
- package/dist/diff-HJF2MPDN-DjGBLQph.mjs +1 -0
- package/dist/dirname-LEMTZZFS-B477CImE.mjs +1 -0
- package/dist/dist-B6pNPboH.mjs +1609 -0
- package/dist/dist-DVM7wH81.mjs +359 -0
- package/dist/dist-DXLSMgBY.mjs +1 -0
- package/dist/dist-bundle-BSdjl7Rj.mjs +2 -0
- package/dist/dist-bundle-BmF5_Mcp.mjs +1 -0
- package/dist/du-WO2ENHXQ-C4c5wweW.mjs +1 -0
- package/dist/echo-O45JWWI2-TudodhHR.mjs +1 -0
- package/dist/env-5EPCWSXR-CTcNEMpy.mjs +1 -0
- package/dist/esm-BbkJd7ro.mjs +2 -0
- package/dist/esm-CEs3LWY3.mjs +20 -0
- package/dist/execAsync-CulVJBMN.mjs +2 -0
- package/dist/execAsync-CzW9fUYQ.mjs +2 -0
- package/dist/execAsync-DuQoqWaW.mjs +2 -0
- package/dist/expand-DTNXU4LQ-BT6M2Tdc.mjs +1 -0
- package/dist/expansion-ENLSRCXJ-Cy7j--Iy.mjs +1 -0
- package/dist/expr-5T3UU5KE-D2Kr5nuJ.mjs +1 -0
- package/dist/file-ZIGAJ4YS-BH3jYcuM.mjs +1 -0
- package/dist/find-TPUOAIUQ-RFxkUcGN.mjs +1 -0
- package/dist/flag-coverage-QT4N2Z44--nNG-HLV.mjs +2 -0
- package/dist/fold-LDSORVYE-CfKQmrJ1.mjs +1 -0
- package/dist/getMachineId-bsd-DAmB-Ym0.mjs +2 -0
- package/dist/getMachineId-bsd-FYDP9w5Q.mjs +2 -0
- package/dist/getMachineId-bsd-mPrX3ckm.mjs +2 -0
- package/dist/getMachineId-darwin-B0Qw-MTj.mjs +3 -0
- package/dist/getMachineId-darwin-C79HtyON.mjs +3 -0
- package/dist/getMachineId-darwin-Co8Jnu5v.mjs +3 -0
- package/dist/getMachineId-linux-BBORs2cS.mjs +2 -0
- package/dist/getMachineId-linux-BizmCjYq.mjs +2 -0
- package/dist/getMachineId-linux-BvLCCmKQ.mjs +2 -0
- package/dist/getMachineId-unsupported-Bgp-Es9j.mjs +2 -0
- package/dist/getMachineId-unsupported-CbR45h2D.mjs +2 -0
- package/dist/getMachineId-unsupported-DbGFOAw1.mjs +2 -0
- package/dist/getMachineId-win-CT_Y5i_4.mjs +2 -0
- package/dist/getMachineId-win-Cy0XHq4X.mjs +2 -0
- package/dist/getMachineId-win-D5gDnBHa.mjs +2 -0
- package/dist/git-handle-DwfYp_z--CfyPz4Dz.mjs +10 -0
- package/dist/git-handle-DwfYp_z--DreW3fNC.mjs +1 -0
- package/dist/grep-3AIAIJVR-DgQJLmW0.mjs +1 -0
- package/dist/gzip-AQXSGOVS-yXjpnIVd.mjs +1 -0
- package/dist/head-HT2B6D2J-BR4RHRTk.mjs +1 -0
- package/dist/help-VVWX7SA5-M6C6klSC.mjs +1 -0
- package/dist/history-J4QRNGRO-C1r7-kvT.mjs +1 -0
- package/dist/hostname-BK6HG2DE-BBBcRrtV.mjs +1 -0
- package/dist/html-to-markdown-TFCECAGV-B9oYuMVf.mjs +1 -0
- package/dist/index.d.mts +52 -76
- package/dist/index.mjs +1 -1
- package/dist/init-B7qJnXKB.mjs +397 -0
- package/dist/init-DiH9oQ6_.mjs +1 -0
- package/dist/{is-object-WgQ3abDo.mjs → is-object-DF0ZeuvD.mjs} +1 -1
- package/dist/join-GG2LDHE5-xeTE0Mi4.mjs +1 -0
- package/dist/jq-ODXZBPLY-C5v6qNu_.mjs +1 -0
- package/dist/js-exec-M6UR76J5-IyD-lpzv.mjs +97 -0
- package/dist/lib-BOCdCkg7.mjs +2 -0
- package/dist/libesm-YL3Bqolr.mjs +14 -0
- package/dist/ln-4TRFBYAT-4XMTO1OQ.mjs +1 -0
- package/dist/loader-BQf8AJXb.mjs +4 -0
- package/dist/loader-C8lkPKn8.mjs +1 -0
- package/dist/ls-KSXFZCWH-Bw_Cf-VY.mjs +1 -0
- package/dist/lzma-vr8hBkhz.mjs +2 -0
- package/dist/md5sum-INMIK4DX-CAIH4ZVI.mjs +1 -0
- package/dist/mkdir-TDEMSB6C-D1oUG8Jf.mjs +1 -0
- package/dist/mrmime-C2W7cgq2.mjs +2 -0
- package/dist/mv-Z6MORUFL-CN471qcL.mjs +1 -0
- package/dist/nl-U5YJDM32-CFzXKze3.mjs +1 -0
- package/dist/od-VJEF2UR5-C2R4Accu.mjs +1 -0
- package/dist/{open-browser-rbaiEzUy.mjs → open-browser-BZZK_gJj.mjs} +1 -1
- package/dist/paste-7N6AFSDS-bUl2Dwz3.mjs +1 -0
- package/dist/preview-CN1rHXBb.mjs +1 -0
- package/dist/preview-DUTos2Es.mjs +3 -0
- package/dist/printf-CX64KX2P-Ce--gWAq.mjs +1 -0
- package/dist/public/assets/ActivityModeContent-1ymqlcHI.js +2 -0
- package/dist/public/assets/ActivityPanelDiffView-DoHWP1ak.js +13 -0
- package/dist/public/assets/ActivityPanelDiffView-legcy4jI.css +1 -0
- package/dist/public/assets/DocumentContext-bvfr7pL2.js +37 -0
- package/dist/public/assets/GraphPanel-DdVygxYk.js +46 -0
- package/dist/public/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/public/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/public/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/public/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/public/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/public/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/public/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/public/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/public/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/public/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/public/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/public/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/public/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/public/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/public/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/public/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/public/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/public/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/public/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/public/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/public/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/public/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/public/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/public/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/public/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/public/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/public/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/public/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/public/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/public/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/public/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/public/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/public/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/public/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/public/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/public/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/public/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/public/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/public/assets/McpConsentDialogBody-CJwPf_uv.js +1 -0
- package/dist/public/assets/OutlinePanel-dumodx-h.js +2 -0
- package/dist/public/assets/SettingsPane-CtgbQZxP.js +6 -0
- package/dist/public/assets/SourceEditor-CR_7DOAH.js +2 -0
- package/dist/public/assets/__vite-browser-external-FEGw1XPd.js +1 -0
- package/dist/public/assets/_baseFor-CX8dsZbW.js +1 -0
- package/dist/public/assets/agent-presence-Ds2n3U5P.js +1 -0
- package/dist/public/assets/arc-BL_OKZmE.js +1 -0
- package/dist/public/assets/architecture-YZFGNWBL-DVxNz-zn.js +1 -0
- package/dist/public/assets/architectureDiagram-Q4EWVU46-BKKtWWhU.js +36 -0
- package/dist/public/assets/array-X0JlPOfd.js +1 -0
- package/dist/public/assets/blockDiagram-DXYQGD6D-fzO4vZye.js +132 -0
- package/dist/public/assets/button-BsFpqlpT.js +1 -0
- package/dist/public/assets/c4Diagram-AHTNJAMY-BkXqEjiP.js +10 -0
- package/dist/public/assets/channel-CR-xJel6.js +1 -0
- package/dist/public/assets/chunk-2KRD3SAO-DQj0pw3H.js +1 -0
- package/dist/public/assets/chunk-336JU56O-CBajDulv.js +2 -0
- package/dist/public/assets/chunk-426QAEUC-BoBKbVmN.js +1 -0
- package/dist/public/assets/chunk-4BX2VUAB-D8pbSOlJ.js +1 -0
- package/dist/public/assets/chunk-4TB4RGXK-mA6CujZO.js +206 -0
- package/dist/public/assets/chunk-55IACEB6-CqVyNzhX.js +1 -0
- package/dist/public/assets/chunk-5FUZZQ4R-BVDLgFg2.js +62 -0
- package/dist/public/assets/chunk-5PVQY5BW-Cxi5d3lT.js +2 -0
- package/dist/public/assets/chunk-67CJDMHE-CdrAY8qZ.js +1 -0
- package/dist/public/assets/chunk-7N4EOEYR-CJ3HBg3c.js +1 -0
- package/dist/public/assets/chunk-AA7GKIK3-D0ckJAXt.js +1 -0
- package/dist/public/assets/chunk-BSJP7CBP-D4bNhKd7.js +1 -0
- package/dist/public/assets/chunk-CFjPhJqf.js +1 -0
- package/dist/public/assets/chunk-CIAEETIT-D1Fpp2md.js +1 -0
- package/dist/public/assets/chunk-EDXVE4YY-ChhT3Iyo.js +1 -0
- package/dist/public/assets/chunk-ENJZ2VHE-Bby39so4.js +10 -0
- package/dist/public/assets/chunk-FMBD7UC4-pRkDIOZn.js +15 -0
- package/dist/public/assets/chunk-FOC6F5B3-BsB4oTj4.js +1 -0
- package/dist/public/assets/chunk-ICPOFSXX-CrnuSfeJ.js +122 -0
- package/dist/public/assets/chunk-K5T4RW27-CtREah_n.js +94 -0
- package/dist/public/assets/chunk-KGLVRYIC-DtDxSfKu.js +1 -0
- package/dist/public/assets/chunk-LIHQZDEY-D63TRk6j.js +1 -0
- package/dist/public/assets/chunk-ORNJ4GCN-Dv2PvYVu.js +1 -0
- package/dist/public/assets/chunk-OYMX7WX6-BhfqKepC.js +231 -0
- package/dist/public/assets/chunk-QZHKN3VN-DBRWHtgj.js +1 -0
- package/dist/public/assets/chunk-U2HBQHQK-6BAKH95D.js +70 -0
- package/dist/public/assets/chunk-X2U36JSP-Cqpkx90-.js +1 -0
- package/dist/public/assets/chunk-XPW4576I-DSytTnq4.js +32 -0
- package/dist/public/assets/chunk-YZCP3GAM-Dt9awjVh.js +1 -0
- package/dist/public/assets/chunk-ZZ45TVLE-JGFITgiO.js +1 -0
- package/dist/public/assets/classDiagram-6PBFFD2Q-oopM_Z0m.js +1 -0
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-ZAL74u9S.js +1 -0
- package/dist/public/assets/clone-C5y6xhRJ.js +1 -0
- package/dist/public/assets/colors-XIJoz9Bd.js +1 -0
- package/dist/public/assets/compiler-runtime-CVnuRdak.js +1 -0
- package/dist/public/assets/config-validation-events-BvuBj41U.js +1 -0
- package/dist/public/assets/cose-bilkent-S5V4N54A-B9nG-SHi.js +1 -0
- package/dist/public/assets/cytoscape.esm-BkjNfcSF.js +321 -0
- package/dist/public/assets/dagre-BEdPLXba.js +1 -0
- package/dist/public/assets/dagre-KV5264BT-DKn5nGCC.js +4 -0
- package/dist/public/assets/defaultLocale-ZxyFnXCb.js +1 -0
- package/dist/public/assets/diagram-5BDNPKRD-BQuwYEd0.js +10 -0
- package/dist/public/assets/diagram-G4DWMVQ6-BmzIMyV5.js +24 -0
- package/dist/public/assets/diagram-MMDJMWI5-CI5eJfgr.js +43 -0
- package/dist/public/assets/diagram-TYMM5635-Cc8TJ7v3.js +24 -0
- package/dist/public/assets/dialog-Cv1qneWl.js +45 -0
- package/dist/public/assets/dist-B4kUko7n.js +9 -0
- package/dist/public/assets/dist-BH1b1nWB.js +1 -0
- package/dist/public/assets/dist-BOapDt7N.js +1 -0
- package/dist/public/assets/dist-CIRuNcH5.js +1 -0
- package/dist/public/assets/dist-D08h1pJc.js +1 -0
- package/dist/public/assets/dist-S8LJmtzL.js +1 -0
- package/dist/public/assets/dist-VyzSEzD4.js +1 -0
- package/dist/public/assets/dist-nPpvoMNC.js +13 -0
- package/dist/public/assets/doc-hash-Q6dTjwu5.js +421 -0
- package/dist/public/assets/erDiagram-SMLLAGMA-BkrhGWMT.js +85 -0
- package/dist/public/assets/flatten-UmyAv3V9.js +1 -0
- package/dist/public/assets/flowDiagram-DWJPFMVM-qh62fanI.js +162 -0
- package/dist/public/assets/ganttDiagram-T4ZO3ILL-DXuCeCk6.js +292 -0
- package/dist/public/assets/gitGraph-7Q5UKJZL-CYhZlmk3.js +1 -0
- package/dist/public/assets/gitGraphDiagram-UUTBAWPF-BbcuenPj.js +106 -0
- package/dist/public/assets/graphlib-CasrTmMJ.js +1 -0
- package/dist/public/assets/image-preview-BJSGEOo4.png +0 -0
- package/dist/public/assets/index-B1y9QLHF.js +1858 -0
- package/dist/public/assets/index-DoXig4bf.css +1 -0
- package/dist/public/assets/info-OMHHGYJF-BslcKZhH.js +1 -0
- package/dist/public/assets/infoDiagram-42DDH7IO-WFAMbO2S.js +2 -0
- package/dist/public/assets/init-CBj3ecIW.js +1 -0
- package/dist/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/public/assets/isEmpty-DWJlzxR1.js +1 -0
- package/dist/public/assets/isObjectLike-AdQZ65l0.js +1 -0
- package/dist/public/assets/isSymbol-BP7IOIqG.js +1 -0
- package/dist/public/assets/ishikawaDiagram-UXIWVN3A-BJBiReWg.js +70 -0
- package/dist/public/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/public/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/public/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/public/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/public/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/public/assets/journeyDiagram-VCZTEJTY-Boq77pl6.js +139 -0
- package/dist/public/assets/kanban-definition-6JOO6SKY-DYMSr18F.js +89 -0
- package/dist/public/assets/katex-qwlL5fSd.js +257 -0
- package/dist/public/assets/line-_p5Px7MV.js +1 -0
- package/dist/public/assets/linear-DwuDS4qT.js +1 -0
- package/dist/public/assets/mcp-consent-store-BBTXqzE6.js +1 -0
- package/dist/public/assets/mermaid-parser.core-BcBb_Ows.js +4 -0
- package/dist/public/assets/mermaid.core-ZLTnLqVQ.js +11 -0
- package/dist/public/assets/min-HKuGSUqa.js +1 -0
- package/dist/public/assets/mindmap-definition-QFDTVHPH-BSxM4djR.js +96 -0
- package/dist/public/assets/now-BBH4UqDm.js +1 -0
- package/dist/public/assets/ordinal-CeOFUmRv.js +1 -0
- package/dist/public/assets/packet-4T2RLAQJ-QVnYA304.js +1 -0
- package/dist/public/assets/panel-BgMqDESF.js +1 -0
- package/dist/public/assets/path-rUlDLHdA.js +1 -0
- package/dist/public/assets/pdf-a35ddrIO.js +54 -0
- package/dist/public/assets/pdf.worker-B1D2UnXD.mjs +63133 -0
- package/dist/public/assets/pdf.worker-CM-zAFN-.js +1 -0
- package/dist/public/assets/pie-ZZUOXDRM-C61c5byc.js +1 -0
- package/dist/public/assets/pieDiagram-DEJITSTG-CHRE_Jie.js +30 -0
- package/dist/public/assets/preload-helper-2ej06EnG.js +1 -0
- package/dist/public/assets/propagation-api-qAYD7s-v.js +1 -0
- package/dist/public/assets/quadrantDiagram-34T5L4WZ-CQkE5TwH.js +7 -0
- package/dist/public/assets/radar-PYXPWWZC-CMxjRtd8.js +1 -0
- package/dist/public/assets/reduce-DotyoGA7.js +1 -0
- package/dist/public/assets/requirementDiagram-MS252O5E-DHK98tKS.js +84 -0
- package/dist/public/assets/rough.esm-BFJ-MgcB.js +1 -0
- package/dist/public/assets/sankeyDiagram-XADWPNL6-BIXaStZh.js +10 -0
- package/dist/public/assets/sequenceDiagram-FGHM5R23-BCNH3kJo.js +157 -0
- package/dist/public/assets/src-C9jsS3p4.js +1 -0
- package/dist/public/assets/src-zyMpT2LE.js +1 -0
- package/dist/public/assets/stateDiagram-FHFEXIEX-BC5mjB6x.js +1 -0
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-B8L3BBt1.js +1 -0
- package/dist/public/assets/stex-BKMR5xQj.js +1 -0
- package/dist/public/assets/target-navigation-intent-BfGOumP6.js +1 -0
- package/dist/public/assets/telemetry-impl-CMeDUVKn.js +2 -0
- package/dist/public/assets/timeline-definition-GMOUNBTQ-VNxUGgXp.js +120 -0
- package/dist/public/assets/tooltip-CBGDOTMI.js +1 -0
- package/dist/public/assets/trace-api-DPMyR1_m.js +1 -0
- package/dist/public/assets/treeView-SZITEDCU-DfSa_Oiv.js +1 -0
- package/dist/public/assets/treemap-W4RFUUIX-Cp0s5wEq.js +1 -0
- package/dist/public/assets/vennDiagram-DHZGUBPP-DV2Y2j0r.js +34 -0
- package/dist/public/assets/video-preview-vLovc_Vy.png +0 -0
- package/dist/public/assets/w3c-keyname-Dfj2imOv.js +1 -0
- package/dist/public/assets/wardley-RL74JXVD-CXcBKCuj.js +1 -0
- package/dist/public/assets/wardleyDiagram-NUSXRM2D-C1mMZ3kx.js +20 -0
- package/dist/public/assets/xychartDiagram-5P7HB3ND-CxFcwN2X.js +7 -0
- package/dist/public/favicon.svg +19 -4
- package/dist/public/index.html +57 -4
- package/dist/pwd-D4OZ7N27-C18XewhV.mjs +1 -0
- package/dist/python3-AUFTPCU6-BaJugIdp.mjs +12 -0
- package/dist/readlink-MI4GCHJF-CHvs7DDT.mjs +1 -0
- package/dist/rev-XOSYPP45-2mnFFZWW.mjs +1 -0
- package/dist/rg-FOQSCCX3-BJahNfSe.mjs +1 -0
- package/dist/rm-RTZG23RL-D9-0WGRY.mjs +1 -0
- package/dist/rmdir-XTQXT7RK-Br7eH9kL.mjs +1 -0
- package/dist/rolldown-runtime-twds-ZHy-Dxr-RWJs.mjs +2 -0
- package/dist/schemas/v0/config.project-local.schema.json +30 -0
- package/dist/schemas/v0/config.project.schema.json +59 -0
- package/dist/schemas/v0/config.user.schema.json +58 -0
- package/dist/sed-VFTTATXJ-mYhAmixc.mjs +1 -0
- package/dist/seq-RN5ZUASB-CKf5MNNO.mjs +1 -0
- package/dist/server-lock-D7DXNVql-B5nINglj.mjs +1 -0
- package/dist/server-lock-D7DXNVql-BRVVzA6T.mjs +2 -0
- package/dist/sha1sum-VJPNLNU6-DuOHap1X.mjs +1 -0
- package/dist/sha256sum-PI32XWXY-D9fEipQ7.mjs +1 -0
- package/dist/sleep-VZFPZFWA-B1fSoYuO.mjs +1 -0
- package/dist/sort-DCNRDA7U-DDCY4JZu.mjs +1 -0
- package/dist/split-SITCSYCZ-b9hfEJw7.mjs +1 -0
- package/dist/sqlite3-56UMWEY3-BQEx5i3P.mjs +1 -0
- package/dist/src-Cak39c0B.mjs +1 -0
- package/dist/start-BXk7J0Kh.mjs +1 -0
- package/dist/start-D6Ip3u6P.mjs +3 -0
- package/dist/stat-BT5A227F-Dzp4sgau.mjs +1 -0
- package/dist/strings-7PLOGTPD-DT41jX9d.mjs +1 -0
- package/dist/tac-SJGXQ4T2-BpdVoP8b.mjs +1 -0
- package/dist/tail-S5ULNTJU-0-sYrYik.mjs +1 -0
- package/dist/tar-ANUBEFJY-Wh3na_NU.mjs +1 -0
- package/dist/tee-O7VXZDCO-CwnGG0go.mjs +1 -0
- package/dist/time-DEUO3QV2-DzkqaQ1k.mjs +1 -0
- package/dist/timeout-VRKMCG72-BtPBpIRq.mjs +1 -0
- package/dist/touch-DX2IJOQ4-KW0Ui-lB.mjs +1 -0
- package/dist/tr-2HXZRDSW-C6Kf0M8T.mjs +1 -0
- package/dist/tree-LYXBS7DC-BN1FBqvM.mjs +1 -0
- package/dist/true-WHJNXCHG-DxCMVdqj.mjs +1 -0
- package/dist/unexpand-RGTMIGZM-DZ4Kf6Xq.mjs +1 -0
- package/dist/uniq-SUNANL47-Ceg51JdA.mjs +1 -0
- package/dist/wc-TQB3VNOX-BzWNq0MY.mjs +1 -0
- package/dist/which-XZHEH76L-DH_U2-Cj.mjs +1 -0
- package/dist/whoami-DGKU3D2X-BholYNPM.mjs +1 -0
- package/dist/xan-BXDXYEIB-b1eAtgch.mjs +1 -0
- package/dist/xan-view-ECQUO7AJ-DWDC57b_.mjs +1 -0
- package/dist/xargs-I6EZUCYF-Cov-i7kW.mjs +1 -0
- package/dist/yq-MJMAR36V-1r29nH4p.mjs +1 -0
- package/package.json +25 -19
- package/scripts/build-config-schema.mjs +69 -0
- package/scripts/postinstall.mjs +33 -0
- package/scripts/probe-exec.ts +98 -0
- package/scripts/probe-read-document.ts +100 -0
- package/dist/banner-De2a4ivv.mjs +0 -3
- package/dist/colors-C2vrt_OY.mjs +0 -1
- package/dist/colors-CshxhXdR.mjs +0 -2
- package/dist/constants-yNFhYMHH.mjs +0 -2
- package/dist/git-handle-B5vQdmjQ.mjs +0 -2
- package/dist/git-handle-DGTzeK-H.mjs +0 -1
- package/dist/init-BFZ4vnnX.mjs +0 -1
- package/dist/init-BH38QtfV.mjs +0 -6
- package/dist/init-BzEVODBI.mjs +0 -230
- package/dist/init-DCZhpKSO.mjs +0 -1
- package/dist/keepalive-Bp0nJiwT.mjs +0 -2
- package/dist/loader-CoGCjTcI.mjs +0 -3
- package/dist/loader-D8pf7fi6.mjs +0 -1
- package/dist/paths-C7TuvND0.mjs +0 -2
- package/dist/paths-CWTmBbr0.mjs +0 -1
- package/dist/preview-C-NvAf2r.mjs +0 -1
- package/dist/preview-Cmt2vdUG.mjs +0 -3
- package/dist/public/assets/dist-BDfJLgAe.js +0 -1
- package/dist/public/assets/dist-BSbGs59J.js +0 -1
- package/dist/public/assets/dist-BXK-5ZOh.js +0 -1
- package/dist/public/assets/dist-BipKfxqO.js +0 -15
- package/dist/public/assets/dist-C9Jm0v8G.js +0 -1
- package/dist/public/assets/dist-CDCPrjhY.js +0 -1
- package/dist/public/assets/dist-CHAniM6T.js +0 -9
- package/dist/public/assets/dist-CYsaeLzc.js +0 -1
- package/dist/public/assets/dist-Cq9Fm8Xi.js +0 -1
- package/dist/public/assets/dist-Ct0eqVZy.js +0 -1
- package/dist/public/assets/dist-PgXBewk9.js +0 -23
- package/dist/public/assets/index-BbLzex1v.css +0 -2
- package/dist/public/assets/index-gSm49umN.js +0 -409
- package/dist/src-B7snRveE.mjs +0 -1
- package/dist/src-CEP6NuWY.mjs +0 -1
- package/dist/src-EGbU552u.mjs +0 -278
- package/dist/start-BYXBgVJW.mjs +0 -1
- package/dist/start-DqcFf-BT.mjs +0 -2
- /package/dist/public/assets/{go-IODVg4Ok.js → go-a33xvodr.js} +0 -0
- /package/dist/public/assets/{shell-COsTRxlr.js → shell-40VLet8r.js} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{i as e,o as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{t as r}from"./chunk-5QMZ5MUS-CAp625aG.mjs";import{n as i,t as a}from"./chunk-A5O5YHGN-DvJz5Cpw.mjs";import{n as o}from"./chunk-24IMIIXA-B6yIPkk2.mjs";import{n as s,t as c}from"./chunk-3THT3N7L-DztAF386.mjs";import{r as l,t as u}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{dirname as d,join as f}from"node:path";import{existsSync as p}from"node:fs";import{fileURLToPath as m}from"node:url";import{Worker as h}from"node:worker_threads";import{randomBytes as g}from"node:crypto";var _=t(n(((t,n)=>{var r=void 0,i=function(t){return r||(r=new Promise(function(r,i){var a=t===void 0?{}:t,o=a.onAbort;a.onAbort=function(e){i(Error(e)),o&&o(e)},a.postRun=a.postRun||[],a.postRun.push(function(){r(a)}),n=void 0;var s;s||=a===void 0?{}:a;var c=!!globalThis.window,l=!!globalThis.WorkerGlobalScope,u=globalThis.process?.versions?.node&&globalThis.process?.type!=`renderer`;s.onRuntimeInitialized=function(){function e(e,t){switch(typeof t){case`boolean`:fe(e,t?1:0);break;case`number`:ue(e,t);break;case`string`:j(e,t,-1,-1);break;case`object`:if(t===null)de(e);else if(t.length!=null){var n=Mt(t.length);C.set(t,n),M(e,n,t.length,-1),Nt(n)}else P(e,`Wrong API use : tried to return a value of an unknown type (`+t+`).`,-1);break;default:de(e)}}function t(e,t){for(var n=[],r=0;r<e;r+=1){var i=N(t+4*r,`i32`),a=ae(i);if(a===1||a===2)i=le(i);else if(a===3)i=se(i);else if(a===4){a=i,i=oe(a),a=ce(a);for(var o=new Uint8Array(i),s=0;s<i;s+=1)o[s]=C[a+s];i=o}else i=null;n.push(i)}return n}function n(e,t){this.Qa=e,this.db=t,this.Oa=1,this.mb=[]}function r(e,t){if(this.db=t,this.fb=Et(e),this.fb===null)throw Error(`Unable to allocate memory for the SQL string`);this.lb=this.fb,this.$a=this.sb=null}function i(e){if(this.filename=`dbfile_`+(4294967295*Math.random()>>>0),e!=null){var t=this.filename,n=`/`,r=t;if(n&&(n=typeof n==`string`?n:Re(n),r=t?ge(n+`/`+t):n),t=ke(!0,!0),r=Qe(r,t),e){if(typeof e==`string`){n=Array(e.length);for(var i=0,o=e.length;i<o;++i)n[i]=e.charCodeAt(i);e=n}at(r,t|146),n=st(r,577),dt(n,e,0,e.length,0),ct(n),at(r,t)}}this.handleError(c(this.filename,a)),this.db=N(a,`i32`),he(this.db),this.gb={},this.Sa={}}var a=Q(4),o=s.cwrap,c=o(`sqlite3_open`,`number`,[`string`,`number`]),l=o(`sqlite3_close_v2`,`number`,[`number`]),u=o(`sqlite3_exec`,`number`,[`number`,`string`,`number`,`number`,`number`]),d=o(`sqlite3_changes`,`number`,[`number`]),f=o(`sqlite3_prepare_v2`,`number`,[`number`,`string`,`number`,`number`,`number`]),p=o(`sqlite3_sql`,`string`,[`number`]),m=o(`sqlite3_normalized_sql`,`string`,[`number`]),h=o(`sqlite3_prepare_v2`,`number`,[`number`,`number`,`number`,`number`,`number`]),g=o(`sqlite3_bind_text`,`number`,[`number`,`number`,`number`,`number`,`number`]),_=o(`sqlite3_bind_blob`,`number`,[`number`,`number`,`number`,`number`,`number`]),ee=o(`sqlite3_bind_double`,`number`,[`number`,`number`,`number`]),v=o(`sqlite3_bind_int`,`number`,[`number`,`number`,`number`]),y=o(`sqlite3_bind_parameter_index`,`number`,[`number`,`string`]),b=o(`sqlite3_step`,`number`,[`number`]),x=o(`sqlite3_errmsg`,`string`,[`number`]),S=o(`sqlite3_column_count`,`number`,[`number`]),w=o(`sqlite3_data_count`,`number`,[`number`]),T=o(`sqlite3_column_double`,`number`,[`number`,`number`]),E=o(`sqlite3_column_text`,`string`,[`number`,`number`]),D=o(`sqlite3_column_blob`,`number`,[`number`,`number`]),te=o(`sqlite3_column_bytes`,`number`,[`number`,`number`]),ne=o(`sqlite3_column_type`,`number`,[`number`,`number`]),O=o(`sqlite3_column_name`,`string`,[`number`,`number`]),re=o(`sqlite3_reset`,`number`,[`number`]),k=o(`sqlite3_clear_bindings`,`number`,[`number`]),A=o(`sqlite3_finalize`,`number`,[`number`]),ie=o(`sqlite3_create_function_v2`,`number`,`number string number number number number number number number`.split(` `)),ae=o(`sqlite3_value_type`,`number`,[`number`]),oe=o(`sqlite3_value_bytes`,`number`,[`number`]),se=o(`sqlite3_value_text`,`string`,[`number`]),ce=o(`sqlite3_value_blob`,`number`,[`number`]),le=o(`sqlite3_value_double`,`number`,[`number`]),ue=o(`sqlite3_result_double`,``,[`number`,`number`]),de=o(`sqlite3_result_null`,``,[`number`]),j=o(`sqlite3_result_text`,``,[`number`,`string`,`number`,`number`]),M=o(`sqlite3_result_blob`,``,[`number`,`number`,`number`,`number`]),fe=o(`sqlite3_result_int`,``,[`number`,`number`]),P=o(`sqlite3_result_error`,``,[`number`,`string`,`number`]),me=o(`sqlite3_aggregate_context`,`number`,[`number`,`number`]),he=o(`RegisterExtensionFunctions`,`number`,[`number`]),_e=o(`sqlite3_update_hook`,`number`,[`number`,`number`,`number`]);n.prototype.bind=function(e){if(!this.Qa)throw`Statement closed`;return this.reset(),Array.isArray(e)?this.Gb(e):typeof e==`object`&&e?this.Hb(e):!0},n.prototype.step=function(){if(!this.Qa)throw`Statement closed`;this.Oa=1;var e=b(this.Qa);switch(e){case 100:return!0;case 101:return!1;default:throw this.db.handleError(e)}},n.prototype.Ab=function(e){return e??(e=this.Oa,this.Oa+=1),T(this.Qa,e)},n.prototype.Ob=function(e){if(e??(e=this.Oa,this.Oa+=1),e=E(this.Qa,e),typeof BigInt!=`function`)throw Error(`BigInt is not supported`);return BigInt(e)},n.prototype.Tb=function(e){return e??(e=this.Oa,this.Oa+=1),E(this.Qa,e)},n.prototype.getBlob=function(e){e??(e=this.Oa,this.Oa+=1);var t=te(this.Qa,e);e=D(this.Qa,e);for(var n=new Uint8Array(t),r=0;r<t;r+=1)n[r]=C[e+r];return n},n.prototype.get=function(e,t){t||={},e!=null&&this.bind(e)&&this.step(),e=[];for(var n=w(this.Qa),r=0;r<n;r+=1)switch(ne(this.Qa,r)){case 1:var i=t.useBigInt?this.Ob(r):this.Ab(r);e.push(i);break;case 2:e.push(this.Ab(r));break;case 3:e.push(this.Tb(r));break;case 4:e.push(this.getBlob(r));break;default:e.push(null)}return e},n.prototype.qb=function(){for(var e=[],t=S(this.Qa),n=0;n<t;n+=1)e.push(O(this.Qa,n));return e},n.prototype.zb=function(e,t){e=this.get(e,t),t=this.qb();for(var n={},r=0;r<t.length;r+=1)n[t[r]]=e[r];return n},n.prototype.Sb=function(){return p(this.Qa)},n.prototype.Pb=function(){return m(this.Qa)},n.prototype.run=function(e){return e!=null&&this.bind(e),this.step(),this.reset()},n.prototype.wb=function(e,t){t??(t=this.Oa,this.Oa+=1),e=Et(e),this.mb.push(e),this.db.handleError(g(this.Qa,t,e,-1,0))},n.prototype.Fb=function(e,t){t??(t=this.Oa,this.Oa+=1);var n=Mt(e.length);C.set(e,n),this.mb.push(n),this.db.handleError(_(this.Qa,t,n,e.length,0))},n.prototype.vb=function(e,t){t??(t=this.Oa,this.Oa+=1),this.db.handleError((e===(e|0)?v:ee)(this.Qa,t,e))},n.prototype.Ib=function(e){e??(e=this.Oa,this.Oa+=1),_(this.Qa,e,0,0,0)},n.prototype.xb=function(e,t){switch(t??(t=this.Oa,this.Oa+=1),typeof e){case`string`:this.wb(e,t);return;case`number`:this.vb(e,t);return;case`bigint`:this.wb(e.toString(),t);return;case`boolean`:this.vb(e+0,t);return;case`object`:if(e===null){this.Ib(t);return}if(e.length!=null){this.Fb(e,t);return}}throw`Wrong API use : tried to bind a value of an unknown type (`+e+`).`},n.prototype.Hb=function(e){var t=this;return Object.keys(e).forEach(function(n){var r=y(t.Qa,n);r!==0&&t.xb(e[n],r)}),!0},n.prototype.Gb=function(e){for(var t=0;t<e.length;t+=1)this.xb(e[t],t+1);return!0},n.prototype.reset=function(){return this.freemem(),k(this.Qa)===0&&re(this.Qa)===0},n.prototype.freemem=function(){for(var e;(e=this.mb.pop())!==void 0;)Nt(e)},n.prototype.Ya=function(){this.freemem();var e=A(this.Qa)===0;return delete this.db.gb[this.Qa],this.Qa=0,e},r.prototype.next=function(){if(this.fb===null)return{done:!0};if(this.$a!==null&&(this.$a.Ya(),this.$a=null),!this.db.db)throw this.ob(),Error(`Database closed`);var e=Lt(),t=Q(4);pe(a),pe(t);try{this.db.handleError(h(this.db.db,this.lb,-1,a,t)),this.lb=N(t,`i32`);var r=N(a,`i32`);return r===0?(this.ob(),{done:!0}):(this.$a=new n(r,this.db),this.db.gb[r]=this.$a,{value:this.$a,done:!1})}catch(e){throw this.sb=F(this.lb),this.ob(),e}finally{It(e)}},r.prototype.ob=function(){Nt(this.fb),this.fb=null},r.prototype.Qb=function(){return this.sb===null?F(this.lb):this.sb},typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`&&(r.prototype[Symbol.iterator]=function(){return this}),i.prototype.run=function(e,t){if(!this.db)throw`Database closed`;if(t){e=this.tb(e,t);try{e.step()}finally{e.Ya()}}else this.handleError(u(this.db,e,0,0,a));return this},i.prototype.exec=function(e,t,r){if(!this.db)throw`Database closed`;var i=null,o=null,s=null;try{s=o=Et(e);var c=Q(4);for(e=[];N(s,`i8`)!==0;){pe(a),pe(c),this.handleError(h(this.db,s,-1,a,c));var l=N(a,`i32`);if(s=N(c,`i32`),l!==0){var u=null;for(i=new n(l,this),t!=null&&i.bind(t);i.step();)u===null&&(u={columns:i.qb(),values:[]},e.push(u)),u.values.push(i.get(null,r));i.Ya()}}return e}catch(e){throw i&&i.Ya(),e}finally{o&&Nt(o)}},i.prototype.Mb=function(e,t,n,r,i){typeof t==`function`&&(r=n,n=t,t=void 0),e=this.tb(e,t);try{for(;e.step();)n(e.zb(null,i))}finally{e.Ya()}if(typeof r==`function`)return r()},i.prototype.tb=function(e,t){if(pe(a),this.handleError(f(this.db,e,-1,a,0)),e=N(a,`i32`),e===0)throw`Nothing to prepare`;var r=new n(e,this);return t!=null&&r.bind(t),this.gb[e]=r},i.prototype.Ub=function(e){return new r(e,this)},i.prototype.Nb=function(){Object.values(this.gb).forEach(function(e){e.Ya()}),Object.values(this.Sa).forEach(Z),this.Sa={},this.handleError(l(this.db));var e=ft(this.filename);return this.handleError(c(this.filename,a)),this.db=N(a,`i32`),he(this.db),e},i.prototype.close=function(){this.db!==null&&(Object.values(this.gb).forEach(function(e){e.Ya()}),Object.values(this.Sa).forEach(Z),this.Sa={},this.Za&&=(Z(this.Za),void 0),this.handleError(l(this.db)),nt(`/`+this.filename),this.db=null)},i.prototype.handleError=function(e){if(e===0)return null;throw e=x(this.db),Error(e)},i.prototype.Rb=function(){return d(this.db)},i.prototype.Kb=function(n,r){Object.prototype.hasOwnProperty.call(this.Sa,n)&&(Z(this.Sa[n]),delete this.Sa[n]);var i=jt(function(n,i,a){i=t(i,a);try{var o=r.apply(null,i)}catch(e){P(n,e,-1);return}e(n,o)},`viii`);return this.Sa[n]=i,this.handleError(ie(this.db,n,r.length,1,0,i,0,0,0)),this},i.prototype.Jb=function(n,r){var i=r.init||function(){return null},a=r.finalize||function(e){return e},o=r.step;if(!o)throw`An aggregate function must have a step function in `+n;var s={};Object.hasOwnProperty.call(this.Sa,n)&&(Z(this.Sa[n]),delete this.Sa[n]),r=n+`__finalize`,Object.hasOwnProperty.call(this.Sa,r)&&(Z(this.Sa[r]),delete this.Sa[r]);var c=jt(function(e,n,r){var a=me(e,1);Object.hasOwnProperty.call(s,a)||(s[a]=i()),n=t(n,r),n=[s[a]].concat(n);try{s[a]=o.apply(null,n)}catch(t){delete s[a],P(e,t,-1)}},`viii`),l=jt(function(t){var n=me(t,1);try{var r=a(s[n])}catch(e){delete s[n],P(t,e,-1);return}e(t,r),delete s[n]},`vi`);return this.Sa[n]=c,this.Sa[r]=l,this.handleError(ie(this.db,n,o.length-1,1,0,0,c,l,0)),this},i.prototype.Zb=function(e){return this.Za&&=(_e(this.db,0,0),Z(this.Za),void 0),e?(this.Za=jt(function(t,n,r,i,a){switch(n){case 18:t=`insert`;break;case 23:t=`update`;break;case 9:t=`delete`;break;default:throw`unknown operationCode in updateHook callback: `+n}if(r=F(r),i=F(i),a>2**53-1)throw`rowId too big to fit inside a Number`;e(t,r,i,Number(a))},`viiiij`),_e(this.db,this.Za,0),this):this},n.prototype.bind=n.prototype.bind,n.prototype.step=n.prototype.step,n.prototype.get=n.prototype.get,n.prototype.getColumnNames=n.prototype.qb,n.prototype.getAsObject=n.prototype.zb,n.prototype.getSQL=n.prototype.Sb,n.prototype.getNormalizedSQL=n.prototype.Pb,n.prototype.run=n.prototype.run,n.prototype.reset=n.prototype.reset,n.prototype.freemem=n.prototype.freemem,n.prototype.free=n.prototype.Ya,r.prototype.next=r.prototype.next,r.prototype.getRemainingSQL=r.prototype.Qb,i.prototype.run=i.prototype.run,i.prototype.exec=i.prototype.exec,i.prototype.each=i.prototype.Mb,i.prototype.prepare=i.prototype.tb,i.prototype.iterateStatements=i.prototype.Ub,i.prototype.export=i.prototype.Nb,i.prototype.close=i.prototype.close,i.prototype.handleError=i.prototype.handleError,i.prototype.getRowsModified=i.prototype.Rb,i.prototype.create_function=i.prototype.Kb,i.prototype.create_aggregate=i.prototype.Jb,i.prototype.updateHook=i.prototype.Zb,s.Database=i};var d=`./this.program`,f=(e,t)=>{throw t},p=globalThis.document?.currentScript?.src;typeof __filename<`u`?p=__filename:l&&(p=self.location.href);var m=``,h,g;if(u){var _=e(`node:fs`);m=__dirname+`/`,g=e=>(e=S(e)?new URL(e):e,_.readFileSync(e)),h=async e=>(e=S(e)?new URL(e):e,_.readFileSync(e,void 0)),1<process.argv.length&&(d=process.argv[1].replace(/\\/g,`/`)),process.argv.slice(2),n!==void 0&&(n.exports=s),f=(e,t)=>{throw process.exitCode=e,t}}else if(c||l){try{m=new URL(`.`,p).href}catch{}l&&(g=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),h=async e=>{if(S(e))return new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{r.status==200||r.status==0&&r.response?t(r.response):n(r.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}var ee=console.log.bind(console),v=console.error.bind(console),y,b=!1,x,S=e=>e.startsWith(`file://`),C,w,T,E,D,te,ne,O;function re(){var e=Rt.buffer;C=new Int8Array(e),T=new Int16Array(e),w=new Uint8Array(e),new Uint16Array(e),E=new Int32Array(e),D=new Uint32Array(e),te=new Float32Array(e),ne=new Float64Array(e),O=new BigInt64Array(e),new BigUint64Array(e)}function k(e){throw s.onAbort?.(e),e=`Aborted(`+e+`)`,v(e),b=!0,new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`)}var A;async function ie(e){if(!y)try{var t=await h(e);return new Uint8Array(t)}catch{}if(e==A&&y)e=new Uint8Array(y);else if(g)e=g(e);else throw`both async and sync fetching of the wasm failed`;return e}async function ae(e,t){try{var n=await ie(e);return await WebAssembly.instantiate(n,t)}catch(e){v(`failed to asynchronously prepare wasm: ${e}`),k(e)}}async function oe(e){var t=A;if(!y&&!S(t)&&!u)try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){v(`wasm streaming compile failed: ${e}`),v(`falling back to ArrayBuffer instantiation`)}return ae(t,e)}class se{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var ce=e=>{for(;0<e.length;)e.shift()(s)},le=[],ue=[],de=()=>{var e=s.preRun.shift();ue.push(e)},j=0,M=null;function N(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:return C[e];case`i8`:return C[e];case`i16`:return T[e>>1];case`i32`:return E[e>>2];case`i64`:return O[e>>3];case`float`:return te[e>>2];case`double`:return ne[e>>3];case`*`:return D[e>>2];default:k(`invalid type for getValue: ${t}`)}}var fe=!0;function pe(e){var t=`i32`;switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:C[e]=0;break;case`i8`:C[e]=0;break;case`i16`:T[e>>1]=0;break;case`i32`:E[e>>2]=0;break;case`i64`:O[e>>3]=BigInt(0);break;case`float`:te[e>>2]=0;break;case`double`:ne[e>>3]=0;break;case`*`:D[e>>2]=0;break;default:k(`invalid type for setValue: ${t}`)}}var P=new TextDecoder,me=(e,t,n,r)=>{if(n=t+n,r)return n;for(;e[t]&&!(t>=n);)++t;return t},F=(e,t,n)=>e?P.decode(w.subarray(e,me(w,e,t,n))):``,he=(e,t)=>{for(var n=0,r=e.length-1;0<=r;r--){var i=e[r];i===`.`?e.splice(r,1):i===`..`?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift(`..`);return e},ge=e=>{var t=e.charAt(0)===`/`,n=e.slice(-1)===`/`;return(e=he(e.split(`/`).filter(e=>!!e),!t).join(`/`))||t||(e=`.`),e&&n&&(e+=`/`),(t?`/`:``)+e},_e=e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],!e&&!t?`.`:(t&&=t.slice(0,-1),e+t)},ve=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],ye=()=>{if(u){var t=e(`node:crypto`);return e=>t.randomFillSync(e)}return e=>crypto.getRandomValues(e)},be=e=>{(be=ye())(e)},xe=(...e)=>{for(var t=``,n=!1,r=e.length-1;-1<=r&&!n;r--){if(n=0<=r?e[r]:`/`,typeof n!=`string`)throw TypeError(`Arguments to path.resolve must be strings`);if(!n)return``;t=n+`/`+t,n=n.charAt(0)===`/`}return t=he(t.split(`/`).filter(e=>!!e),!n).join(`/`),(n?`/`:``)+t||`.`},Se=e=>{var t=me(e,0);return P.decode(e.buffer?e.subarray(0,t):new Uint8Array(e.slice(0,t)))},Ce=[],I=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t},L=(e,t,n,r)=>{if(!(0<r))return 0;var i=n;r=n+r-1;for(var a=0;a<e.length;++a){var o=e.codePointAt(a);if(127>=o){if(n>=r)break;t[n++]=o}else if(2047>=o){if(n+1>=r)break;t[n++]=192|o>>6,t[n++]=128|o&63}else if(65535>=o){if(n+2>=r)break;t[n++]=224|o>>12,t[n++]=128|o>>6&63,t[n++]=128|o&63}else{if(n+3>=r)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63,t[n++]=128|o>>6&63,t[n++]=128|o&63,a++}}return t[n]=0,n-i},we=[];function Te(e,t){we[e]={input:[],output:[],eb:t},Ye(e,Ee)}var Ee={open(e){var t=we[e.node.rdev];if(!t)throw new B(43);e.tty=t,e.seekable=!1},close(e){e.tty.eb.fsync(e.tty)},fsync(e){e.tty.eb.fsync(e.tty)},read(e,t,n,r){if(!e.tty||!e.tty.eb.Bb)throw new B(60);for(var i=0,a=0;a<r;a++){try{var o=e.tty.eb.Bb(e.tty)}catch{throw new B(29)}if(o===void 0&&i===0)throw new B(6);if(o==null)break;i++,t[n+a]=o}return i&&(e.node.atime=Date.now()),i},write(e,t,n,r){if(!e.tty||!e.tty.eb.ub)throw new B(60);try{for(var i=0;i<r;i++)e.tty.eb.ub(e.tty,t[n+i])}catch{throw new B(29)}return r&&(e.node.mtime=e.node.ctime=Date.now()),i}},De={Bb(){a:{if(!Ce.length){var e=null;if(u){var t=Buffer.alloc(256),n=0,r=process.stdin.fd;try{n=_.readSync(r,t,0,256)}catch(e){if(e.toString().includes(`EOF`))n=0;else throw e}0<n&&(e=t.slice(0,n).toString(`utf-8`))}else globalThis.window?.prompt&&(e=window.prompt(`Input: `),e!==null&&(e+=`
|
|
2
|
+
`));if(!e){e=null;break a}t=Array(I(e)+1),e=L(e,t,0,t.length),t.length=e,Ce=t}e=Ce.shift()}return e},ub(e,t){t===null||t===10?(ee(Se(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){0<e.output?.length&&(ee(Se(e.output)),e.output=[])},hc(){return{bc:25856,dc:5,ac:191,cc:35387,$b:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ic(){return 0},jc(){return[24,80]}},Oe={ub(e,t){t===null||t===10?(v(Se(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){0<e.output?.length&&(v(Se(e.output)),e.output=[])}},R={Wa:null,Xa(){return R.createNode(null,`/`,16895,0)},createNode(e,t,n,r){if((n&61440)==24576||(n&61440)==4096)throw new B(63);return R.Wa||={dir:{node:{Ta:R.La.Ta,Ua:R.La.Ua,lookup:R.La.lookup,ib:R.La.ib,rename:R.La.rename,unlink:R.La.unlink,rmdir:R.La.rmdir,readdir:R.La.readdir,symlink:R.La.symlink},stream:{Va:R.Ma.Va}},file:{node:{Ta:R.La.Ta,Ua:R.La.Ua},stream:{Va:R.Ma.Va,read:R.Ma.read,write:R.Ma.write,jb:R.Ma.jb,kb:R.Ma.kb}},link:{node:{Ta:R.La.Ta,Ua:R.La.Ua,readlink:R.La.readlink},stream:{}},yb:{node:{Ta:R.La.Ta,Ua:R.La.Ua},stream:Je}},n=Ve(e,t,n,r),U(n.mode)?(n.La=R.Wa.dir.node,n.Ma=R.Wa.dir.stream,n.Na={}):(n.mode&61440)==32768?(n.La=R.Wa.file.node,n.Ma=R.Wa.file.stream,n.Ra=0,n.Na=null):(n.mode&61440)==40960?(n.La=R.Wa.link.node,n.Ma=R.Wa.link.stream):(n.mode&61440)==8192&&(n.La=R.Wa.yb.node,n.Ma=R.Wa.yb.stream),n.atime=n.mtime=n.ctime=Date.now(),e&&(e.Na[t]=n,e.atime=e.mtime=e.ctime=n.atime),n},fc(e){return e.Na?e.Na.subarray?e.Na.subarray(0,e.Ra):new Uint8Array(e.Na):new Uint8Array},La:{Ta(e){var t={};return t.dev=(e.mode&61440)==8192?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,U(e.mode)?t.size=4096:(e.mode&61440)==32768?t.size=e.Ra:(e.mode&61440)==40960?t.size=e.link.length:t.size=0,t.atime=new Date(e.atime),t.mtime=new Date(e.mtime),t.ctime=new Date(e.ctime),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},Ua(e,t){for(var n of[`mode`,`atime`,`mtime`,`ctime`])t[n]!=null&&(e[n]=t[n]);t.size!==void 0&&(t=t.size,e.Ra!=t&&(t==0?(e.Na=null,e.Ra=0):(n=e.Na,e.Na=new Uint8Array(t),n&&e.Na.set(n.subarray(0,Math.min(t,e.Ra))),e.Ra=t)))},lookup(){throw R.nb||(R.nb=new B(44),R.nb.stack=`<generic error, no stack>`),R.nb},ib(e,t,n,r){return R.createNode(e,t,n,r)},rename(e,t,n){try{var r=H(t,n)}catch{}if(r){if(U(e.mode))for(var i in r.Na)throw new B(55);Be(r)}delete e.parent.Na[e.name],t.Na[n]=e,e.name=n,t.ctime=t.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,t){delete e.Na[t],e.ctime=e.mtime=Date.now()},rmdir(e,t){var n=H(e,t),r;for(r in n.Na)throw new B(55);delete e.Na[t],e.ctime=e.mtime=Date.now()},readdir(e){return[`.`,`..`,...Object.keys(e.Na)]},symlink(e,t,n){return e=R.createNode(e,t,41471,0),e.link=n,e},readlink(e){if((e.mode&61440)!=40960)throw new B(28);return e.link}},Ma:{read(e,t,n,r,i){var a=e.node.Na;if(i>=e.node.Ra)return 0;if(e=Math.min(e.node.Ra-i,r),8<e&&a.subarray)t.set(a.subarray(i,i+e),n);else for(r=0;r<e;r++)t[n+r]=a[i+r];return e},write(e,t,n,r,i,a){if(t.buffer===C.buffer&&(a=!1),!r)return 0;if(e=e.node,e.mtime=e.ctime=Date.now(),t.subarray&&(!e.Na||e.Na.subarray)){if(a)return e.Na=t.subarray(n,n+r),e.Ra=r;if(e.Ra===0&&i===0)return e.Na=t.slice(n,n+r),e.Ra=r;if(i+r<=e.Ra)return e.Na.set(t.subarray(n,n+r),i),r}a=i+r;var o=e.Na?e.Na.length:0;if(o>=a||(a=Math.max(a,o*(1048576>o?2:1.125)>>>0),o!=0&&(a=Math.max(a,256)),o=e.Na,e.Na=new Uint8Array(a),0<e.Ra&&e.Na.set(o.subarray(0,e.Ra),0)),e.Na.subarray&&t.subarray)e.Na.set(t.subarray(n,n+r),i);else for(a=0;a<r;a++)e.Na[i+a]=t[n+a];return e.Ra=Math.max(e.Ra,i+r),r},Va(e,t,n){if(n===1?t+=e.position:n===2&&(e.node.mode&61440)==32768&&(t+=e.node.Ra),0>t)throw new B(28);return t},jb(e,t,n,r,i){if((e.node.mode&61440)!=32768)throw new B(43);if(e=e.node.Na,i&2||!e||e.buffer!==C.buffer){i=!0,r=65536*Math.ceil(t/65536);var a=Pt(65536,r);if(a&&w.fill(0,a,a+r),r=a,!r)throw new B(48);e&&((0<n||n+t<e.length)&&(e=e.subarray?e.subarray(n,n+t):Array.prototype.slice.call(e,n,n+t)),C.set(e,r))}else i=!1,r=e.byteOffset;return{Xb:r,Eb:i}},kb(e,t,n,r){return R.Ma.write(e,t,0,r,n,!1),0}}},ke=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},Ae=null,je={},Me=[],Ne=1,z=null,Pe=!1,Fe=!0,B=class{name=`ErrnoError`;constructor(e){this.Pa=e}},Ie=class{hb={};node=null;get flags(){return this.hb.flags}set flags(e){this.hb.flags=e}get position(){return this.hb.position}set position(e){this.hb.position=e}},Le=class{La={};Ma={};bb=null;constructor(e,t,n,r){e||=this,this.parent=e,this.Xa=e.Xa,this.id=Ne++,this.name=t,this.mode=n,this.rdev=r,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&365)==365}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)==146}set write(e){e?this.mode|=146:this.mode&=-147}};function V(e,t={}){if(!e)throw new B(44);t.pb??=!0,e.charAt(0)===`/`||(e=`//`+e);var n=0;a:for(;40>n;n++){e=e.split(`/`).filter(e=>!!e);for(var r=Ae,i=`/`,a=0;a<e.length;a++){var o=a===e.length-1;if(o&&t.parent)break;if(e[a]!==`.`)if(e[a]===`..`)if(i=_e(i),r===r.parent){e=i+`/`+e.slice(a+1).join(`/`),n--;continue a}else r=r.parent;else{i=ge(i+`/`+e[a]);try{r=H(r,e[a])}catch(e){if(e?.Pa===44&&o&&t.Wb)return{path:i};throw e}if(!r.bb||o&&!t.pb||(r=r.bb.root),(r.mode&61440)==40960&&(!o||t.ab)){if(!r.La.readlink)throw new B(52);r=r.La.readlink(r),r.charAt(0)===`/`||(r=_e(i)+`/`+r),e=r+`/`+e.slice(a+1).join(`/`);continue a}}}return{path:i,node:r}}throw new B(32)}function Re(e){for(var t;;){if(e===e.parent)return e=e.Xa.Db,t?e[e.length-1]===`/`?e+t:`${e}/${t}`:e;t=t?`${e.name}/${t}`:e.name,e=e.parent}}function ze(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%z.length}function Be(e){var t=ze(e.parent.id,e.name);if(z[t]===e)z[t]=e.cb;else for(t=z[t];t;){if(t.cb===e){t.cb=e.cb;break}t=t.cb}}function H(e,t){var n=U(e.mode)?(n=W(e,`x`))?n:e.La.lookup?0:2:54;if(n)throw new B(n);for(n=z[ze(e.id,t)];n;n=n.cb){var r=n.name;if(n.parent.id===e.id&&r===t)return n}return e.La.lookup(e,t)}function Ve(e,t,n,r){return e=new Le(e,t,n,r),t=ze(e.parent.id,e.name),e.cb=z[t],z[t]=e}function U(e){return(e&61440)==16384}function W(e,t){return Fe?0:t.includes(`r`)&&!(e.mode&292)||t.includes(`w`)&&!(e.mode&146)||t.includes(`x`)&&!(e.mode&73)?2:0}function He(e,t){if(!U(e.mode))return 54;try{return H(e,t),20}catch{}return W(e,`wx`)}function Ue(e,t,n){try{var r=H(e,t)}catch(e){return e.Pa}if(e=W(e,`wx`))return e;if(n){if(!U(r.mode))return 54;if(r===r.parent||Re(r)===`/`)return 10}else if(U(r.mode))return 31;return 0}function We(e){if(!e)throw new B(63);return e}function G(e){if(e=Me[e],!e)throw new B(8);return e}function Ge(e,t=-1){if(e=Object.assign(new Ie,e),t==-1)a:{for(t=0;4096>=t;t++)if(!Me[t])break a;throw new B(33)}return e.fd=t,Me[t]=e}function Ke(e,t=-1){return e=Ge(e,t),e.Ma?.ec?.(e),e}function qe(e,t,n){var r=e?.Ma.Ua;e=r?e:t,r??=t.La.Ua,We(r),r(e,n)}var Je={open(e){e.Ma=je[e.node.rdev].Ma,e.Ma.open?.(e)},Va(){throw new B(70)}};function Ye(e,t){je[e]={Ma:t}}function Xe(e,t){var n=t===`/`;if(n&&Ae)throw new B(10);if(!n&&t){var r=V(t,{pb:!1});if(t=r.path,r=r.node,r.bb)throw new B(10);if(!U(r.mode))throw new B(54)}t={type:e,kc:{},Db:t,Vb:[]},e=e.Xa(t),e.Xa=t,t.root=e,n?Ae=e:r&&(r.bb=t,r.Xa&&r.Xa.Vb.push(t))}function Ze(e,t,n){var r=V(e,{parent:!0}).node;if(e=ve(e),!e)throw new B(28);if(e===`.`||e===`..`)throw new B(20);var i=He(r,e);if(i)throw new B(i);if(!r.La.ib)throw new B(63);return r.La.ib(r,e,t,n)}function Qe(e,t=438){return Ze(e,t&4095|32768,0)}function K(e,t=511){return Ze(e,t&1023|16384,0)}function $e(e,t,n){n===void 0&&(n=t,t=438),Ze(e,t|8192,n)}function et(e,t){if(!xe(e))throw new B(44);var n=V(t,{parent:!0}).node;if(!n)throw new B(44);t=ve(t);var r=He(n,t);if(r)throw new B(r);if(!n.La.symlink)throw new B(63);n.La.symlink(n,t,e)}function tt(e){var t=V(e,{parent:!0}).node;e=ve(e);var n=H(t,e),r=Ue(t,e,!0);if(r)throw new B(r);if(!t.La.rmdir)throw new B(63);if(n.bb)throw new B(10);t.La.rmdir(t,e),Be(n)}function nt(e){var t=V(e,{parent:!0}).node;if(!t)throw new B(44);e=ve(e);var n=H(t,e),r=Ue(t,e,!1);if(r)throw new B(r);if(!t.La.unlink)throw new B(63);if(n.bb)throw new B(10);t.La.unlink(t,e),Be(n)}function rt(e,t){return e=V(e,{ab:!t}).node,We(e.La.Ta)(e)}function it(e,t,n,r){qe(e,t,{mode:n&4095|t.mode&-4096,ctime:Date.now(),Lb:r})}function at(e,t){e=typeof e==`string`?V(e,{ab:!0}).node:e,it(null,e,t)}function ot(e,t,n){if(U(t.mode))throw new B(31);if((t.mode&61440)!=32768)throw new B(28);var r=W(t,`w`);if(r)throw new B(r);qe(e,t,{size:n,timestamp:Date.now()})}function st(e,t,n=438){if(e===``)throw new B(44);if(typeof t==`string`){var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if(r===void 0)throw Error(`Unknown file open mode: ${t}`);t=r}if(n=t&64?n&4095|32768:0,typeof e==`object`)r=e;else{var i=e.endsWith(`/`),a=V(e,{ab:!(t&131072),Wb:!0});r=a.node,e=a.path}if(a=!1,t&64)if(r){if(t&128)throw new B(20)}else{if(i)throw new B(31);r=Ze(e,n|511,0),a=!0}if(!r)throw new B(44);if((r.mode&61440)==8192&&(t&=-513),t&65536&&!U(r.mode))throw new B(54);if(!a&&(r?(r.mode&61440)==40960?i=32:(i=[`r`,`w`,`rw`][t&3],t&512&&(i+=`w`),i=U(r.mode)&&(i!==`r`||t&576)?31:W(r,i)):i=44,i))throw new B(i);return t&512&&!a&&(i=r,i=typeof i==`string`?V(i,{ab:!0}).node:i,ot(null,i,0)),t=Ge({node:r,path:Re(r),flags:t&-131713,seekable:!0,position:0,Ma:r.Ma,Yb:[],error:!1}),t.Ma.open&&t.Ma.open(t),a&&at(r,n&511),t}function ct(e){if(e.fd===null)throw new B(8);e.rb&&=null;try{e.Ma.close&&e.Ma.close(e)}catch(e){throw e}finally{Me[e.fd]=null}e.fd=null}function lt(e,t,n){if(e.fd===null)throw new B(8);if(!e.seekable||!e.Ma.Va)throw new B(70);if(n!=0&&n!=1&&n!=2)throw new B(28);e.position=e.Ma.Va(e,t,n),e.Yb=[]}function ut(e,t,n,r,i){if(0>r||0>i)throw new B(28);if(e.fd===null||(e.flags&2097155)==1)throw new B(8);if(U(e.node.mode))throw new B(31);if(!e.Ma.read)throw new B(28);var a=i!==void 0;if(!a)i=e.position;else if(!e.seekable)throw new B(70);return t=e.Ma.read(e,t,n,r,i),a||(e.position+=t),t}function dt(e,t,n,r,i){if(0>r||0>i)throw new B(28);if(e.fd===null||!(e.flags&2097155))throw new B(8);if(U(e.node.mode))throw new B(31);if(!e.Ma.write)throw new B(28);e.seekable&&e.flags&1024&<(e,0,2);var a=i!==void 0;if(!a)i=e.position;else if(!e.seekable)throw new B(70);return t=e.Ma.write(e,t,n,r,i,void 0),a||(e.position+=t),t}function ft(e){var t=t||0,n=`binary`;n!==`utf8`&&n!==`binary`&&k(`Invalid encoding type "${n}"`),t=st(e,t),e=rt(e).size;var r=new Uint8Array(e);return ut(t,r,0,e,0),n===`utf8`&&(r=Se(r)),ct(t),r}function q(e,t,n){e=ge(`/dev/`+e);var r=ke(!!t,!!n);q.Cb??=64;var i=q.Cb++<<8|0;Ye(i,{open(e){e.seekable=!1},close(){n?.buffer?.length&&n(10)},read(e,n,r,i){for(var a=0,o=0;o<i;o++){try{var s=t()}catch{throw new B(29)}if(s===void 0&&a===0)throw new B(6);if(s==null)break;a++,n[r+o]=s}return a&&(e.node.atime=Date.now()),a},write(e,t,r,i){for(var a=0;a<i;a++)try{n(t[r+a])}catch{throw new B(29)}return i&&(e.node.mtime=e.node.ctime=Date.now()),a}}),$e(e,r,i)}var J={};function Y(e,t,n){if(t.charAt(0)===`/`)return t;if(e=e===-100?`/`:G(e).path,t.length==0){if(!n)throw new B(44);return e}return e+`/`+t}function pt(e,t){D[e>>2]=t.dev,D[e+4>>2]=t.mode,D[e+8>>2]=t.nlink,D[e+12>>2]=t.uid,D[e+16>>2]=t.gid,D[e+20>>2]=t.rdev,O[e+24>>3]=BigInt(t.size),E[e+32>>2]=4096,E[e+36>>2]=t.blocks;var n=t.atime.getTime(),r=t.mtime.getTime(),i=t.ctime.getTime();return O[e+40>>3]=BigInt(Math.floor(n/1e3)),D[e+48>>2]=n%1e3*1e6,O[e+56>>3]=BigInt(Math.floor(r/1e3)),D[e+64>>2]=r%1e3*1e6,O[e+72>>3]=BigInt(Math.floor(i/1e3)),D[e+80>>2]=i%1e3*1e6,O[e+88>>3]=BigInt(t.ino),0}var mt=void 0,ht=()=>{var e=E[mt>>2];return mt+=4,e},gt=0,_t=[0,31,60,91,121,152,182,213,244,274,305,335],vt=[0,31,59,90,120,151,181,212,243,273,304,334],yt={},bt=e=>{x=e,fe||0<gt||(s.onExit?.(e),b=!0),f(e,new se(e))},xt=e=>{if(!b)try{e()}catch(e){e instanceof se||e==`unwind`||f(1,e)}finally{if(!(fe||0<gt))try{x=e=x,bt(e)}catch(e){e instanceof se||e==`unwind`||f(1,e)}}},St={},Ct=()=>{if(!wt){var e={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(globalThis.navigator?.language??`C`).replace(`-`,`_`)+`.UTF-8`,_:d||`./this.program`},t;for(t in St)St[t]===void 0?delete e[t]:e[t]=St[t];var n=[];for(t in e)n.push(`${t}=${e[t]}`);wt=n}return wt},wt,Tt=(e,t,n,r)=>{var i={string:e=>{var t=0;if(e!=null&&e!==0){t=I(e)+1;var n=Q(t);L(e,w,n,t),t=n}return t},array:e=>{var t=Q(e.length);return C.set(e,t),t}};e=s[`_`+e];var a=[],o=0;if(r)for(var c=0;c<r.length;c++){var l=i[n[c]];l?(o===0&&(o=Lt()),a[c]=l(r[c])):a[c]=r[c]}return n=e(...a),n=function(e){return o!==0&&It(o),t===`string`?F(e):t===`boolean`?!!e:e}(n)},Et=e=>{var t=I(e)+1,n=Mt(t);return n&&L(e,w,n,t),n},X,Dt=[],Z=e=>{X.delete($.get(e)),$.set(e,null),Dt.push(e)},Ot=e=>{let t=e.length;return[t%128|128,t>>7,...e]},kt={i:127,p:127,j:126,f:125,d:124,e:111},At=e=>Ot(Array.from(e,e=>kt[e])),jt=(e,t)=>{if(!X){X=new WeakMap;var n=$.length;if(X)for(var r=0;r<0+n;r++){var i=$.get(r);i&&X.set(i,r)}}if(n=X.get(e)||0)return n;n=Dt.length?Dt.pop():$.grow(1);try{$.set(n,e)}catch(r){if(!(r instanceof TypeError))throw r;t=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Ot([1,96,...At(t.slice(1)),...At(t[0]===`v`?``:t[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),t=new WebAssembly.Module(t),t=new WebAssembly.Instance(t,{e:{f:e}}).exports.f,$.set(n,t)}return X.set(e,n),n};if(z=Array(4096),Xe(R,`/`),K(`/tmp`),K(`/home`),K(`/home/web_user`),(function(){K(`/dev`),Ye(259,{read:()=>0,write:(e,t,n,r)=>r,Va:()=>0}),$e(`/dev/null`,259),Te(1280,De),Te(1536,Oe),$e(`/dev/tty`,1280),$e(`/dev/tty1`,1536);var e=new Uint8Array(1024),t=0,n=()=>(t===0&&(be(e),t=e.byteLength),e[--t]);q(`random`,n),q(`urandom`,n),K(`/dev/shm`),K(`/dev/shm/tmp`)})(),(function(){K(`/proc`);var e=K(`/proc/self`);K(`/proc/self/fd`),Xe({Xa(){var t=Ve(e,`fd`,16895,73);return t.Ma={Va:R.Ma.Va},t.La={lookup(e,t){e=+t;var n=G(e);return e={parent:null,Xa:{Db:`fake`},La:{readlink:()=>n.path},id:e+1},e.parent=e},readdir(){return Array.from(Me.entries()).filter(([,e])=>e).map(([e])=>e.toString())}},t}},`/proc/self/fd`)})(),s.noExitRuntime&&(fe=s.noExitRuntime),s.print&&(ee=s.print),s.printErr&&(v=s.printErr),s.wasmBinary&&(y=s.wasmBinary),s.thisProgram&&(d=s.thisProgram),s.preInit)for(typeof s.preInit==`function`&&(s.preInit=[s.preInit]);0<s.preInit.length;)s.preInit.shift()();s.stackSave=()=>Lt(),s.stackRestore=e=>It(e),s.stackAlloc=e=>Q(e),s.cwrap=(e,t,n,r)=>{var i=!n||n.every(e=>e===`number`||e===`boolean`);return t!==`string`&&i&&!r?s[`_`+e]:(...r)=>Tt(e,t,n,r)},s.addFunction=jt,s.removeFunction=Z,s.UTF8ToString=F,s.stringToNewUTF8=Et,s.writeArrayToMemory=(e,t)=>{C.set(e,t)};var Mt,Nt,Pt,Ft,It,Q,Lt,Rt,$,zt={a:(e,t,n,r)=>k(`Assertion failed: ${F(e)}, at: `+[t?F(t):`unknown filename`,n,r?F(r):`unknown function`]),i:function(e,t){try{return e=F(e),at(e,t),0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},L:function(e,t,n){try{if(t=F(t),t=Y(e,t),n&-8)return-28;var r=V(t,{ab:!0}).node;return r?(e=``,n&4&&(e+=`r`),n&2&&(e+=`w`),n&1&&(e+=`x`),e&&W(r,e)?-2:0):-44}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},j:function(e,t){try{var n=G(e);return it(n,n.node,t,!1),0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},h:function(e){try{var t=G(e);return qe(t,t.node,{timestamp:Date.now(),Lb:!1}),0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},b:function(e,t,n){mt=n;try{var r=G(e);switch(t){case 0:var i=ht();if(0>i)break;for(;Me[i];)i++;return Ke(r,i).fd;case 1:case 2:return 0;case 3:return r.flags;case 4:return i=ht(),r.flags|=i,0;case 12:return i=ht(),T[i+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},g:function(e,t){try{var n=G(e),r=n.node,i=n.Ma.Ta;return e=i?n:r,i??=r.La.Ta,We(i),pt(t,i(e))}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},H:function(e,t){t=-9007199254740992>t||9007199254740992<t?NaN:Number(t);try{if(isNaN(t))return-61;var n=G(e);if(0>t||!(n.flags&2097155))throw new B(28);return ot(n,n.node,t),0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},G:function(e,t){try{if(t===0)return-28;var n=I(`/`)+1;return t<n?-68:(L(`/`,w,e,t),n)}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},K:function(e,t){try{return e=F(e),pt(t,rt(e,!0))}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},C:function(e,t,n){try{return t=F(t),t=Y(e,t),K(t,n),0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},J:function(e,t,n,r){try{t=F(t);var i=r&256;return t=Y(e,t,r&4096),pt(n,i?rt(t,!0):rt(t))}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},x:function(e,t,n,r){mt=r;try{t=F(t),t=Y(e,t);var i=r?ht():0;return st(t,n,i).fd}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},v:function(e,t,n,r){try{if(t=F(t),t=Y(e,t),0>=r)return-28;var i=V(t).node;if(!i)throw new B(44);if(!i.La.readlink)throw new B(28);var a=i.La.readlink(i),o=Math.min(r,I(a)),s=C[n+o];return L(a,w,n,r+1),C[n+o]=s,o}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},u:function(e){try{return e=F(e),tt(e),0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},f:function(e,t){try{return e=F(e),pt(t,rt(e))}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},r:function(e,t,n){try{if(t=F(t),t=Y(e,t),n)if(n===512)tt(t);else return-28;else nt(t);return 0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},q:function(e,t,n){try{t=F(t),t=Y(e,t,!0);var r=Date.now(),i,a;if(n){var o=D[n>>2]+4294967296*E[n+4>>2],s=E[n+8>>2];i=s==1073741823?r:s==1073741822?null:1e3*o+s/1e6,n+=16,o=D[n>>2]+4294967296*E[n+4>>2],s=E[n+8>>2],a=s==1073741823?r:s==1073741822?null:1e3*o+s/1e6}else a=i=r;if((a??i)!==null){e=i;var c=V(t,{ab:!0}).node;We(c.La.Ua)(c,{atime:e,mtime:a})}return 0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},m:()=>k(``),l:()=>{fe=!1,gt=0},A:function(e,t){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e),e=new Date(1e3*e),E[t>>2]=e.getSeconds(),E[t+4>>2]=e.getMinutes(),E[t+8>>2]=e.getHours(),E[t+12>>2]=e.getDate(),E[t+16>>2]=e.getMonth(),E[t+20>>2]=e.getFullYear()-1900,E[t+24>>2]=e.getDay();var n=e.getFullYear();E[t+28>>2]=(n%4!=0||n%100==0&&n%400!=0?vt:_t)[e.getMonth()]+e.getDate()-1|0,E[t+36>>2]=-(60*e.getTimezoneOffset()),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();E[t+32>>2]=(n!=r&&e.getTimezoneOffset()==Math.min(r,n))|0},y:function(e,t,n,r,i,a,o){i=-9007199254740992>i||9007199254740992<i?NaN:Number(i);try{var s=G(r);if(t&2&&!(n&2)&&(s.flags&2097155)!=2||(s.flags&2097155)==1)throw new B(2);if(!s.Ma.jb)throw new B(43);if(!e)throw new B(28);var c=s.Ma.jb(s,e,i,t,n),l=c.Xb;return E[a>>2]=c.Eb,D[o>>2]=l,0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},z:function(e,t,n,r,i,a){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);try{var o=G(i);if(n&2){if(n=a,(o.node.mode&61440)!=32768)throw new B(43);if(!(r&2)){var s=w.slice(e,e+t);o.Ma.kb&&o.Ma.kb(o,s,n,t,r)}}}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return-e.Pa}},n:(e,t)=>(yt[e]&&(clearTimeout(yt[e].id),delete yt[e]),t&&(yt[e]={id:setTimeout(()=>{delete yt[e],xt(()=>Ft(e,performance.now()))},t),lc:t}),0),B:(e,t,n,r)=>{var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset(),D[e>>2]=60*Math.max(a,i),E[t>>2]=Number(a!=i),t=e=>{var t=Math.abs(e);return`UTC${0<=e?`-`:`+`}${String(Math.floor(t/60)).padStart(2,`0`)}${String(t%60).padStart(2,`0`)}`},e=t(a),t=t(i),i<a?(L(e,w,n,17),L(t,w,r,17)):(L(e,w,r,17),L(t,w,n,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:e=>{var t=w.length;if(e>>>=0,2147483648<e)return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);a:{r=(Math.min(2147483648,65536*Math.ceil(Math.max(e,r)/65536))-Rt.buffer.byteLength+65535)/65536|0;try{Rt.grow(r),re();var i=1;break a}catch{}i=void 0}if(i)return!0}return!1},E:(e,t)=>{var n=0,r=0,i;for(i of Ct()){var a=t+n;D[e+r>>2]=a,n+=L(i,w,a,1/0)+1,r+=4}return 0},F:(e,t)=>{var n=Ct();D[e>>2]=n.length,e=0;for(var r of n)e+=I(r)+1;return D[t>>2]=e,0},e:function(e){try{return ct(G(e)),0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return e.Pa}},p:function(e,t){try{var n=G(e);return C[t]=n.tty?2:U(n.mode)?3:(n.mode&61440)==40960?7:4,T[t+2>>1]=0,O[t+8>>3]=BigInt(0),O[t+16>>3]=BigInt(0),0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return e.Pa}},w:function(e,t,n,r){try{a:{var i=G(e);e=t;for(var a,o=t=0;o<n;o++){var s=D[e>>2],c=D[e+4>>2];e+=8;var l=ut(i,C,s,c,a);if(0>l){var u=-1;break a}if(t+=l,l<c)break;a!==void 0&&(a+=l)}u=t}return D[r>>2]=u,0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return e.Pa}},D:function(e,t,n,r){t=-9007199254740992>t||9007199254740992<t?NaN:Number(t);try{if(isNaN(t))return 61;var i=G(e);return lt(i,t,n),O[r>>3]=BigInt(i.position),i.rb&&t===0&&n===0&&(i.rb=null),0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return e.Pa}},I:function(e){try{var t=G(e);return t.Ma?.fsync?.(t)}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return e.Pa}},t:function(e,t,n,r){try{a:{var i=G(e);e=t;for(var a,o=t=0;o<n;o++){var s=D[e>>2],c=D[e+4>>2];e+=8;var l=dt(i,C,s,c,a);if(0>l){var u=-1;break a}if(t+=l,l<c)break;a!==void 0&&(a+=l)}u=t}return D[r>>2]=u,0}catch(e){if(J===void 0||e.name!==`ErrnoError`)throw e;return e.Pa}},k:bt};function Bt(){function e(){if(s.calledRun=!0,!b){if(!s.noFSInit&&!Pe){var e,t;Pe=!0,e??=s.stdin,t??=s.stdout,n??=s.stderr,e?q(`stdin`,e):et(`/dev/tty`,`/dev/stdin`),t?q(`stdout`,null,t):et(`/dev/tty`,`/dev/stdout`),n?q(`stderr`,null,n):et(`/dev/tty1`,`/dev/stderr`),st(`/dev/stdin`,0),st(`/dev/stdout`,1),st(`/dev/stderr`,1)}if(Vt.N(),Fe=!1,s.onRuntimeInitialized?.(),s.postRun)for(typeof s.postRun==`function`&&(s.postRun=[s.postRun]);s.postRun.length;){var n=s.postRun.shift();le.push(n)}ce(le)}}if(0<j)M=Bt;else{if(s.preRun)for(typeof s.preRun==`function`&&(s.preRun=[s.preRun]);s.preRun.length;)de();ce(ue),0<j?M=Bt:s.setStatus?(s.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>s.setStatus(``),1),e()},1)):e()}}var Vt;return(async function(){function e(e){return e=Vt=e.exports,s._sqlite3_free=e.P,s._sqlite3_value_text=e.Q,s._sqlite3_prepare_v2=e.R,s._sqlite3_step=e.S,s._sqlite3_reset=e.T,s._sqlite3_exec=e.U,s._sqlite3_finalize=e.V,s._sqlite3_column_name=e.W,s._sqlite3_column_text=e.X,s._sqlite3_column_type=e.Y,s._sqlite3_errmsg=e.Z,s._sqlite3_clear_bindings=e._,s._sqlite3_value_blob=e.$,s._sqlite3_value_bytes=e.aa,s._sqlite3_value_double=e.ba,s._sqlite3_value_int=e.ca,s._sqlite3_value_type=e.da,s._sqlite3_result_blob=e.ea,s._sqlite3_result_double=e.fa,s._sqlite3_result_error=e.ga,s._sqlite3_result_int=e.ha,s._sqlite3_result_int64=e.ia,s._sqlite3_result_null=e.ja,s._sqlite3_result_text=e.ka,s._sqlite3_aggregate_context=e.la,s._sqlite3_column_count=e.ma,s._sqlite3_data_count=e.na,s._sqlite3_column_blob=e.oa,s._sqlite3_column_bytes=e.pa,s._sqlite3_column_double=e.qa,s._sqlite3_bind_blob=e.ra,s._sqlite3_bind_double=e.sa,s._sqlite3_bind_int=e.ta,s._sqlite3_bind_text=e.ua,s._sqlite3_bind_parameter_index=e.va,s._sqlite3_sql=e.wa,s._sqlite3_normalized_sql=e.xa,s._sqlite3_changes=e.ya,s._sqlite3_close_v2=e.za,s._sqlite3_create_function_v2=e.Aa,s._sqlite3_update_hook=e.Ba,s._sqlite3_open=e.Ca,Mt=s._malloc=e.Da,Nt=s._free=e.Ea,s._RegisterExtensionFunctions=e.Fa,Pt=e.Ga,Ft=e.Ha,It=e.Ia,Q=e.Ja,Lt=e.Ka,Rt=e.M,$=e.O,re(),j--,s.monitorRunDependencies?.(j),j==0&&M&&(e=M,M=null,e()),Vt}j++,s.monitorRunDependencies?.(j);var t={a:zt};return s.instantiateWasm?new Promise(n=>{s.instantiateWasm(t,(t,r)=>{n(e(t,r))})}):(A??=s.locateFile?s.locateFile(`sql-wasm.wasm`,m):m+`sql-wasm.wasm`,e((await oe(t)).instance))})(),Bt(),a}),r)};typeof t==`object`&&typeof n==`object`?(n.exports=i,n.exports.default=i):typeof define==`function`&&define.amd?define([],function(){return i}):typeof t==`object`&&(t.Module=i)}))(),1);function ee(e,t,n){switch(n.mode){case`list`:return y(e,t,n);case`csv`:return b(e,t,n);case`json`:return w(e,t);case`line`:return T(e,t,n);case`column`:return E(e,t,n);case`table`:return D(e,t,n);case`markdown`:return te(e,t,n);case`tabs`:return ne(e,t,n);case`box`:return O(e,t,n);case`quote`:return re(e,t,n);case`html`:return k(e,t,n);case`ascii`:return ie(e,t,n)}}function v(e,t){return e==null?t:e instanceof Uint8Array||Buffer.isBuffer(e)?Buffer.from(e).toString(`utf8`):typeof e==`number`&&!Number.isInteger(e)?e.toPrecision(17).replace(/\.?0+$/,``):String(e)}function y(e,t,n){let r=[];n.header&&e.length>0&&r.push(e.join(n.separator));for(let e of t)r.push(e.map(e=>v(e,n.nullValue)).join(n.separator));return r.length>0?`${r.join(n.newline)}${n.newline}`:``}function b(e,t,n){let r=[];n.header&&e.length>0&&r.push(e.map(x).join(`,`));for(let e of t)r.push(e.map(e=>x(v(e,n.nullValue))).join(`,`));return r.length>0?`${r.join(`
|
|
3
|
+
`)}
|
|
4
|
+
`:``}function x(e){return e.includes(`,`)||e.includes(`"`)||e.includes(`'`)||e.includes(`
|
|
5
|
+
`)?`"${e.replace(/"/g,`""`)}"`:e}function S(e){return e.toPrecision(17).replace(/\.?0+$/,``)}function C(e){return e===null?`null`:typeof e==`number`?Number.isInteger(e)?String(e):S(e):JSON.stringify(e)}function w(e,t){return t.length===0?``:`[${t.map(t=>`{${e.map((e,n)=>`${JSON.stringify(e)}:${C(t[n])}`).join(`,`)}}`).join(`,
|
|
6
|
+
`)}]
|
|
7
|
+
`}function T(e,t,n){if(e.length===0||t.length===0)return``;let r=Math.max(5,...e.map(e=>e.length)),i=[];for(let a of t)for(let t=0;t<e.length;t++){let o=e[t].padStart(r);i.push(`${o} = ${v(a[t],n.nullValue)}`)}return`${i.join(`
|
|
8
|
+
`)}
|
|
9
|
+
`}function E(e,t,n){if(e.length===0)return``;let r=e.map(e=>e.length);for(let e of t)for(let t=0;t<e.length;t++){let i=v(e[t],n.nullValue).length;i>r[t]&&(r[t]=i)}let i=[];n.header&&(i.push(e.map((e,t)=>e.padEnd(r[t])).join(` `)),i.push(r.map(e=>`-`.repeat(e)).join(` `)));for(let e of t)i.push(e.map((e,t)=>v(e,n.nullValue).padEnd(r[t])).join(` `));return i.length>0?`${i.join(`
|
|
10
|
+
`)}
|
|
11
|
+
`:``}function D(e,t,n){if(e.length===0)return``;let r=e.map(e=>e.length);for(let e of t)for(let t=0;t<e.length;t++){let i=v(e[t],n.nullValue).length;i>r[t]&&(r[t]=i)}let i=[],a=`+${r.map(e=>`-`.repeat(e+2)).join(`+`)}+`;i.push(a),n.header&&(i.push(`| ${e.map((e,t)=>e.padEnd(r[t])).join(` | `)} |`),i.push(a));for(let e of t)i.push(`| ${e.map((e,t)=>v(e,n.nullValue).padEnd(r[t])).join(` | `)} |`);return i.push(a),`${i.join(`
|
|
12
|
+
`)}
|
|
13
|
+
`}function te(e,t,n){if(e.length===0)return``;let r=[];n.header&&(r.push(`| ${e.join(` | `)} |`),r.push(`|${e.map(()=>`---`).join(`|`)}|`));for(let e of t)r.push(`| ${e.map(e=>v(e,n.nullValue)).join(` | `)} |`);return r.length>0?`${r.join(`
|
|
14
|
+
`)}
|
|
15
|
+
`:``}function ne(e,t,n){let r=[];n.header&&e.length>0&&r.push(e.join(` `));for(let e of t)r.push(e.map(e=>v(e,n.nullValue)).join(` `));return r.length>0?`${r.join(n.newline)}${n.newline}`:``}function O(e,t,n){if(e.length===0)return``;let r=e.map(e=>e.length);for(let e of t)for(let t=0;t<e.length;t++){let i=v(e[t],n.nullValue).length;i>r[t]&&(r[t]=i)}let i=[];i.push(`\u250C${r.map(e=>`─`.repeat(e+2)).join(`┬`)}\u2510`),i.push(`\u2502 ${e.map((e,t)=>e.padEnd(r[t])).join(` │ `)} \u2502`),i.push(`\u251C${r.map(e=>`─`.repeat(e+2)).join(`┼`)}\u2524`);for(let e of t)i.push(`\u2502 ${e.map((e,t)=>v(e,n.nullValue).padEnd(r[t])).join(` │ `)} \u2502`);return i.push(`\u2514${r.map(e=>`─`.repeat(e+2)).join(`┴`)}\u2518`),`${i.join(`
|
|
16
|
+
`)}
|
|
17
|
+
`}function re(e,t,n){let r=[];n.header&&e.length>0&&r.push(e.map(e=>`'${e}'`).join(`,`));for(let e of t)r.push(e.map(e=>e==null?`NULL`:typeof e==`number`?Number.isInteger(e)?String(e):S(e):`'${String(e)}'`).join(`,`));return r.length>0?`${r.join(n.newline)}${n.newline}`:``}function k(e,t,n){let r=[];n.header&&e.length>0&&(r.push(`<TR>${e.map(e=>`<TH>${A(e)}</TH>`).join(``)}`),r.push(`</TR>`));for(let e of t)r.push(`<TR>${e.map(e=>`<TD>${A(v(e,n.nullValue))}</TD>`).join(``)}`),r.push(`</TR>`);return r.length>0?`${r.join(`
|
|
18
|
+
`)}
|
|
19
|
+
`:``}function A(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function ie(e,t,n){let r=[];n.header&&e.length>0&&r.push(e.join(``));for(let e of t)r.push(e.map(e=>v(e,n.nullValue)).join(``));return r.length>0?r.join(``)+``:``}var ae=5e3,oe={name:`sqlite3`,summary:`SQLite database CLI`,usage:`sqlite3 [OPTIONS] DATABASE [SQL]`,options:[`-list output in list mode (default)`,`-csv output in CSV mode`,`-json output in JSON mode`,`-line output in line mode`,`-column output in column mode`,`-table output as ASCII table`,`-markdown output as markdown table`,`-tabs output in tab-separated mode`,`-box output in Unicode box mode`,`-quote output in SQL quote mode`,`-html output as HTML table`,`-ascii output in ASCII mode (control chars)`,`-header show column headers`,`-noheader hide column headers`,`-separator SEP field separator for list mode (default: |)`,`-newline SEP row separator (default: \\n)`,`-nullvalue TEXT text for NULL values (default: empty)`,`-readonly open database read-only (no writeback)`,`-bail stop on first error`,`-echo print SQL before execution`,`-cmd COMMAND run SQL command before main SQL`,`-version show SQLite version`,`-- end of options`,`--help show this help`],examples:[`sqlite3 :memory: "CREATE TABLE t(x); INSERT INTO t VALUES(1); SELECT * FROM t"`,`sqlite3 -json data.db "SELECT * FROM users"`,`sqlite3 -csv -header data.db "SELECT id, name FROM products"`,`sqlite3 -box data.db "SELECT * FROM users"`]};function se(e){let t={mode:`list`,header:!1,separator:`|`,newline:`
|
|
20
|
+
`,nullValue:``,readonly:!1,bail:!1,echo:!1,cmd:null},n=null,r=null,i=!1,a=!1;for(let o=0;o<e.length;o++){let s=e[o];if(a){n===null?n=s:r===null&&(r=s);continue}if(s===`--`)a=!0;else if(s===`-version`)i=!0;else if(s===`-list`)t.mode=`list`;else if(s===`-csv`)t.mode=`csv`;else if(s===`-json`)t.mode=`json`;else if(s===`-line`)t.mode=`line`;else if(s===`-column`)t.mode=`column`;else if(s===`-table`)t.mode=`table`;else if(s===`-markdown`)t.mode=`markdown`;else if(s===`-tabs`)t.mode=`tabs`;else if(s===`-box`)t.mode=`box`;else if(s===`-quote`)t.mode=`quote`;else if(s===`-html`)t.mode=`html`;else if(s===`-ascii`)t.mode=`ascii`;else if(s===`-header`)t.header=!0;else if(s===`-noheader`)t.header=!1;else if(s===`-readonly`)t.readonly=!0;else if(s===`-bail`)t.bail=!0;else if(s===`-echo`)t.echo=!0;else if(s===`-separator`){if(o+1>=e.length)return{stdout:``,stderr:`sqlite3: Error: missing argument to -separator
|
|
21
|
+
`,exitCode:1};t.separator=e[++o]}else if(s===`-newline`){if(o+1>=e.length)return{stdout:``,stderr:`sqlite3: Error: missing argument to -newline
|
|
22
|
+
`,exitCode:1};t.newline=e[++o]}else if(s===`-nullvalue`){if(o+1>=e.length)return{stdout:``,stderr:`sqlite3: Error: missing argument to -nullvalue
|
|
23
|
+
`,exitCode:1};t.nullValue=e[++o]}else if(s===`-cmd`){if(o+1>=e.length)return{stdout:``,stderr:`sqlite3: Error: missing argument to -cmd
|
|
24
|
+
`,exitCode:1};t.cmd=e[++o]}else{if(s.startsWith(`-`))return{stdout:``,stderr:`sqlite3: Error: unknown option: ${s.startsWith(`--`)?s.slice(1):s}
|
|
25
|
+
Use -help for a list of options.
|
|
26
|
+
`,exitCode:1};n===null?n=s:r===null&&(r=s)}}return{options:t,database:n,sql:r,showVersion:i}}async function ce(){let e=new(await(r.runTrustedAsync(()=>(0,_.default)()))).Database;try{let t=e.exec(`SELECT sqlite_version()`);return t.length>0&&t[0].values.length>0?String(t[0].values[0][0]):`unknown`}finally{e.close()}}function le(){let e=d(m(import.meta.url)),t=f(e,`../../commands/sqlite3/worker.js`);if(p(t))return t;let n=f(e,`worker.js`);if(p(n))return n;let r=f(e,`../../../dist/commands/sqlite3/worker.js`);if(p(r))return r;throw Error(`sqlite3 worker not found. Run 'pnpm build' to compile the worker.`)}var ue={createWorker(e,t){return new h(e,{workerData:t})}};function de(){return g(16).toString(`hex`)}function j(e,t){if(!e||typeof e!=`object`)return{success:!1,error:`Malformed worker response`};let n=e;return typeof n.protocolToken!=`string`||n.protocolToken!==t?{success:!1,error:`Malformed worker response: invalid protocol token`}:n.type===`security-violation`?{success:!1,error:`Security violation: ${typeof n.violation?.type==`string`?n.violation.type:`unknown`}`}:typeof n.success==`boolean`?n.success?Array.isArray(n.results)?typeof n.hasModifications==`boolean`?n.dbBuffer!==null&&n.dbBuffer!==void 0&&!(n.dbBuffer instanceof Uint8Array)?{success:!1,error:`Malformed worker response: invalid dbBuffer`}:{success:!0,results:n.results,hasModifications:n.hasModifications,dbBuffer:n.dbBuffer===void 0?null:n.dbBuffer,defenseStats:n.defenseStats}:{success:!1,error:`Malformed worker response: missing hasModifications flag`}:{success:!1,error:`Malformed worker response: missing results array`}:{success:!1,error:typeof n.error==`string`&&n.error.length>0?n.error:`Worker execution failed`}:{success:!1,error:`Malformed worker response: missing success flag`}}async function M(e,t,n){try{let s=le();return await new Promise((l,u)=>{let d=r.runTrusted(()=>ue.createWorker(s,e)),f=o(n,`sqlite3`,`worker timeout callback`,()=>{d.terminate(),l({success:!1,error:`Query timeout: execution exceeded ${t}ms limit`})}),p=a(()=>{try{f()}catch(e){l({success:!1,error:c(e instanceof Error?e.message:String(e))})}},t),m=o(n,`sqlite3`,`worker message callback`,t=>{i(p),l(j(t,e.protocolToken))}),h=o(n,`sqlite3`,`worker error callback`,e=>{i(p),u(e)}),g=o(n,`sqlite3`,`worker exit callback`,e=>{i(p),e!==0&&l({success:!1,error:`Worker exited with code ${e}`})});d.on(`message`,e=>{try{m(e)}catch(e){i(p),l({success:!1,error:c(e instanceof Error?e.message:String(e))})}}),d.on(`error`,e=>{try{h(e)}catch(e){i(p);let t=e instanceof Error?e.message:String(e);u(Error(c(t)))}}),d.on(`exit`,e=>{try{g(e)}catch(e){i(p),l({success:!1,error:c(e instanceof Error?e.message:String(e))})}})})}catch(e){let t=c(e.message);throw Error(`sqlite3 worker failed to load: ${t}`)}}var N={name:`sqlite3`,async execute(e,t){if(u(e)||e.includes(`-help`))return l(oe);let n=se(e);if(`exitCode`in n)return n;let{options:r,database:i,sql:a,showVersion:o}=n;if(o)return{stdout:`${await ce()}
|
|
27
|
+
`,stderr:``,exitCode:0};if(!i)return{stdout:``,stderr:`sqlite3: missing database argument
|
|
28
|
+
`,exitCode:1};let d=a||t.stdin.trim();if(r.cmd&&(d=r.cmd+(d?`; ${d}`:``)),!d)return{stdout:``,stderr:`sqlite3: no SQL provided
|
|
29
|
+
`,exitCode:1};let f=i===`:memory:`,p=``,m=null;try{f||(p=t.fs.resolvePath(t.cwd,i),await t.fs.exists(p)&&(m=await t.fs.readFileBuffer(p)))}catch(e){return{stdout:``,stderr:`sqlite3: unable to open database "${i}": ${s(e.message)}
|
|
30
|
+
`,exitCode:1}}let h=t.limits?.maxSqliteTimeoutMs??ae,g={protocolToken:de(),dbBuffer:m,sql:d,options:{bail:r.bail,echo:r.echo}},_;try{_=await M(g,h,t.requireDefenseContext)}catch(e){return{stdout:``,stderr:`sqlite3: worker error: ${c(e.message)}
|
|
31
|
+
`,exitCode:1}}if(!_.success)return{stdout:``,stderr:`sqlite3: ${c(_.error)}
|
|
32
|
+
`,exitCode:1};let v={mode:r.mode,header:r.header,separator:r.separator,newline:r.newline,nullValue:r.nullValue},y=``;r.echo&&(y+=`${d}
|
|
33
|
+
`);let b=!1;for(let e of _.results)if(e.type===`error`){if(r.bail)return{stdout:y,stderr:`Error: ${e.error}
|
|
34
|
+
`,exitCode:1};y+=`Error: ${e.error}
|
|
35
|
+
`,b=!0}else e.columns&&e.rows&&(e.rows.length>0||r.header)&&(y+=ee(e.columns,e.rows,v));if(_.hasModifications&&!r.readonly&&!f&&p&&_.dbBuffer)try{await t.fs.writeFile(p,_.dbBuffer)}catch(e){let t=s(e.message);return{stdout:y,stderr:`sqlite3: failed to write database: ${t}
|
|
36
|
+
`,exitCode:1}}return{stdout:y,stderr:``,exitCode:b&&r.bail?1:0}}},fe={name:`sqlite3`,flags:[],needsArgs:!0};export{ue as n,fe as r,N as t};
|
|
37
|
+
//# sourceMappingURL=chunk-HWBSOZZR-BZF8XsyZ.mjs.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{n as e}from"./chunk-74CEPOFO-BcZUJMO1.mjs";function t(t,n,r){let i=new Map,a=new Map;for(let[e,t]of Object.entries(r)){let n={name:e,type:t.type};t.short&&i.set(t.short,n),t.long&&a.set(t.long,n)}let o=Object.create(null);for(let[e,t]of Object.entries(r))t.default===void 0?t.type===`boolean`&&(o[e]=!1):o[e]=t.default;let s=[],c=!1;for(let r=0;r<n.length;r++){let l=n[r];if(c||!l.startsWith(`-`)||l===`-`){s.push(l);continue}if(l===`--`){c=!0;continue}if(l.startsWith(`--`)){let i=l.indexOf(`=`),s,c;i===-1?s=l.slice(2):(s=l.slice(2,i),c=l.slice(i+1));let u=a.get(s);if(!u)return{ok:!1,error:e(t,l)};let{name:d,type:f}=u;if(f===`boolean`)o[d]=!0;else{if(c===void 0){if(r+1>=n.length)return{ok:!1,error:{stdout:``,stderr:`${t}: option '--${s}' requires an argument
|
|
2
|
+
`,exitCode:1}};c=n[++r]}o[d]=f===`number`?parseInt(c,10):c}}else{let a=l.slice(1);for(let s=0;s<a.length;s++){let c=a[s],l=i.get(c);if(!l)return{ok:!1,error:e(t,`-${c}`)};let{name:u,type:d}=l;if(d===`boolean`)o[u]=!0;else{let e;if(s+1<a.length)e=a.slice(s+1);else if(r+1<n.length)e=n[++r];else return{ok:!1,error:{stdout:``,stderr:`${t}: option requires an argument -- '${c}'
|
|
3
|
+
`,exitCode:1}};o[u]=d===`number`?parseInt(e,10):e;break}}}}return{ok:!0,result:{flags:o,positional:s}}}export{t};
|
|
4
|
+
//# sourceMappingURL=chunk-HWKDQ44K-wgmyck2O.mjs.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{t as e}from"./chunk-R6VWJ2ZL-FwG_Za20.mjs";import{i as t,n}from"./chunk-CWQS3NFK-Co4ALolT.mjs";import{n as r,t as i}from"./chunk-A5O5YHGN-DvJz5Cpw.mjs";import{t as a}from"./chunk-IPJHKYVM-C3IodQq7.mjs";import{n as o}from"./chunk-3THT3N7L-DztAF386.mjs";var s={NOOP:0,READ_FILE:1,WRITE_FILE:2,STAT:3,READDIR:4,MKDIR:5,RM:6,EXISTS:7,APPEND_FILE:8,SYMLINK:9,READLINK:10,LSTAT:11,CHMOD:12,REALPATH:13,RENAME:14,COPY_FILE:15,WRITE_STDOUT:100,WRITE_STDERR:101,EXIT:102,HTTP_REQUEST:200,EXEC_COMMAND:300},c={PENDING:0,READY:1,SUCCESS:2,ERROR:3},l={NONE:0,NOT_FOUND:1,IS_DIRECTORY:2,NOT_DIRECTORY:3,EXISTS:4,PERMISSION_DENIED:5,INVALID_PATH:6,IO_ERROR:7,TIMEOUT:8,NETWORK_ERROR:9,NETWORK_NOT_CONFIGURED:10},u={OP_CODE:0,STATUS:4,PATH_LENGTH:8,DATA_LENGTH:12,RESULT_LENGTH:16,ERROR_CODE:20,FLAGS:24,MODE:28,PATH_BUFFER:32,DATA_BUFFER:4128},d={CONTROL_REGION:32,PATH_BUFFER:4096,DATA_BUFFER:1048576,TOTAL:1052704},f={NONE:0,RECURSIVE:1,FORCE:2,MKDIR_RECURSIVE:1},p={IS_FILE:0,IS_DIRECTORY:1,IS_SYMLINK:2,MODE:4,SIZE:8,MTIME:16,TOTAL:24};function m(){return new t(d.TOTAL)}var h=class{int32View;uint8View;dataView;constructor(e){this.int32View=new Int32Array(e),this.uint8View=new Uint8Array(e),this.dataView=new DataView(e)}getOpCode(){return n.load(this.int32View,u.OP_CODE/4)}setOpCode(e){n.store(this.int32View,u.OP_CODE/4,e)}getStatus(){return n.load(this.int32View,u.STATUS/4)}setStatus(e){n.store(this.int32View,u.STATUS/4,e)}getPathLength(){return n.load(this.int32View,u.PATH_LENGTH/4)}setPathLength(e){n.store(this.int32View,u.PATH_LENGTH/4,e)}getDataLength(){return n.load(this.int32View,u.DATA_LENGTH/4)}setDataLength(e){n.store(this.int32View,u.DATA_LENGTH/4,e)}getResultLength(){return n.load(this.int32View,u.RESULT_LENGTH/4)}setResultLength(e){n.store(this.int32View,u.RESULT_LENGTH/4,e)}getErrorCode(){return n.load(this.int32View,u.ERROR_CODE/4)}setErrorCode(e){n.store(this.int32View,u.ERROR_CODE/4,e)}getFlags(){return n.load(this.int32View,u.FLAGS/4)}setFlags(e){n.store(this.int32View,u.FLAGS/4,e)}getMode(){return n.load(this.int32View,u.MODE/4)}setMode(e){n.store(this.int32View,u.MODE/4,e)}getPath(){let e=this.getPathLength(),t=this.uint8View.slice(u.PATH_BUFFER,u.PATH_BUFFER+e);return new TextDecoder().decode(t)}setPath(e){let t=new TextEncoder().encode(e);if(t.length>d.PATH_BUFFER)throw Error(`Path too long: ${t.length} > ${d.PATH_BUFFER}`);this.uint8View.set(t,u.PATH_BUFFER),this.setPathLength(t.length)}getData(){let e=this.getDataLength();return this.uint8View.slice(u.DATA_BUFFER,u.DATA_BUFFER+e)}setData(e){if(e.length>d.DATA_BUFFER)throw Error(`Data too large: ${e.length} > ${d.DATA_BUFFER}`);this.uint8View.set(e,u.DATA_BUFFER),this.setDataLength(e.length)}getDataAsString(){let e=this.getData();return new TextDecoder().decode(e)}setDataFromString(e){let t=new TextEncoder().encode(e);this.setData(t)}getResult(){let e=this.getResultLength();return this.uint8View.slice(u.DATA_BUFFER,u.DATA_BUFFER+e)}setResult(e){if(e.length>d.DATA_BUFFER)throw Error(`Result too large: ${e.length} > ${d.DATA_BUFFER}`);this.uint8View.set(e,u.DATA_BUFFER),this.setResultLength(e.length)}getResultAsString(){let e=this.getResult();return new TextDecoder().decode(e)}setResultFromString(e){let t=new TextEncoder().encode(e);this.setResult(t)}encodeStat(e){this.uint8View[u.DATA_BUFFER+p.IS_FILE]=e.isFile?1:0,this.uint8View[u.DATA_BUFFER+p.IS_DIRECTORY]=e.isDirectory?1:0,this.uint8View[u.DATA_BUFFER+p.IS_SYMLINK]=e.isSymbolicLink?1:0,this.dataView.setInt32(u.DATA_BUFFER+p.MODE,e.mode,!0);let t=Math.min(e.size,2**53-1);this.dataView.setFloat64(u.DATA_BUFFER+p.SIZE,t,!0),this.dataView.setFloat64(u.DATA_BUFFER+p.MTIME,e.mtime.getTime(),!0),this.setResultLength(p.TOTAL)}decodeStat(){return{isFile:this.uint8View[u.DATA_BUFFER+p.IS_FILE]===1,isDirectory:this.uint8View[u.DATA_BUFFER+p.IS_DIRECTORY]===1,isSymbolicLink:this.uint8View[u.DATA_BUFFER+p.IS_SYMLINK]===1,mode:this.dataView.getInt32(u.DATA_BUFFER+p.MODE,!0),size:this.dataView.getFloat64(u.DATA_BUFFER+p.SIZE,!0),mtime:new Date(this.dataView.getFloat64(u.DATA_BUFFER+p.MTIME,!0))}}waitForReady(e){return n.wait(this.int32View,u.STATUS/4,c.PENDING,e)}waitForReadyAsync(e){return n.waitAsync(this.int32View,u.STATUS/4,c.PENDING,e)}async waitUntilReady(e){let t=Date.now();for(;;){let r=this.getStatus();if(r===c.READY)return!0;let i=Date.now()-t;if(i>=e)return!1;let a=e-i,o=n.waitAsync(this.int32View,u.STATUS/4,r,a);if(o.async&&await o.value===`timed-out`)return!1}}waitForResult(e){return n.wait(this.int32View,u.STATUS/4,c.READY,e)}notify(){return n.notify(this.int32View,u.STATUS/4)}reset(){this.setOpCode(s.NOOP),this.setStatus(c.PENDING),this.setPathLength(0),this.setDataLength(0),this.setResultLength(0),this.setErrorCode(l.NONE),this.setFlags(f.NONE),this.setMode(0)}},g=class{fs;cwd;commandName;secureFetch;maxOutputSize;exec;protocol;running=!1;output={stdout:``,stderr:``,exitCode:0};outputLimitExceeded=!1;startTime=0;timeoutMs=0;constructor(e,t,n,r,i=void 0,a=0,o=void 0){this.fs=t,this.cwd=n,this.commandName=r,this.secureFetch=i,this.maxOutputSize=a,this.exec=o,this.protocol=new h(e)}remainingMs(){return Math.max(0,this.timeoutMs-(Date.now()-this.startTime))}raceDeadline(e){let t=this.remainingMs();if(t<=0)return this.running=!1,this.output.exitCode=124,this.output.stderr+=`
|
|
2
|
+
${this.commandName}: execution timeout exceeded
|
|
3
|
+
`,Promise.reject(Error(`Operation timed out`));let n=e();return new Promise((e,a)=>{let o=i(()=>{this.running=!1,this.output.exitCode=124,this.output.stderr+=`
|
|
4
|
+
${this.commandName}: execution timeout exceeded
|
|
5
|
+
`,a(Error(`Operation timed out`))},t);n.then(t=>{r(o),e(t)},e=>{r(o),a(e)})})}async run(e){for(this.running=!0,this.startTime=Date.now(),this.timeoutMs=e;this.running;){if(Date.now()-this.startTime>=e){this.output.stderr+=`
|
|
6
|
+
${this.commandName}: execution timeout exceeded
|
|
7
|
+
`,this.output.exitCode=124;break}let t=this.remainingMs();if(!await this.protocol.waitUntilReady(t)){this.output.stderr+=`
|
|
8
|
+
${this.commandName}: execution timeout exceeded
|
|
9
|
+
`,this.output.exitCode=124;break}let n=this.protocol.getOpCode();await this.handleOperation(n),this.protocol.notify()}return this.output}stop(){this.running=!1}async handleOperation(e){try{switch(e){case s.READ_FILE:await this.handleReadFile();break;case s.WRITE_FILE:await this.handleWriteFile();break;case s.STAT:await this.handleStat();break;case s.LSTAT:await this.handleLstat();break;case s.READDIR:await this.handleReaddir();break;case s.MKDIR:await this.handleMkdir();break;case s.RM:await this.handleRm();break;case s.EXISTS:await this.handleExists();break;case s.APPEND_FILE:await this.handleAppendFile();break;case s.SYMLINK:await this.handleSymlink();break;case s.READLINK:await this.handleReadlink();break;case s.CHMOD:await this.handleChmod();break;case s.REALPATH:await this.handleRealpath();break;case s.RENAME:await this.handleRename();break;case s.COPY_FILE:await this.handleCopyFile();break;case s.WRITE_STDOUT:this.handleWriteStdout();break;case s.WRITE_STDERR:this.handleWriteStderr();break;case s.EXIT:this.handleExit();break;case s.HTTP_REQUEST:await this.handleHttpRequest();break;case s.EXEC_COMMAND:await this.handleExecCommand();break;default:this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setStatus(c.ERROR)}}catch(e){this.setErrorFromException(e)}}resolvePath(e){return this.fs.resolvePath(this.cwd,e)}async handleReadFile(){let e=this.resolvePath(this.protocol.getPath());try{let t=await this.fs.readFileBuffer(e);this.protocol.setResult(t),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleWriteFile(){let e=this.resolvePath(this.protocol.getPath()),t=this.protocol.getData();try{await this.fs.writeFile(e,t),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleStat(){let e=this.resolvePath(this.protocol.getPath());try{let t=await this.fs.stat(e);this.protocol.encodeStat(t),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleLstat(){let e=this.resolvePath(this.protocol.getPath());try{let t=await this.fs.lstat(e);this.protocol.encodeStat(t),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleReaddir(){let e=this.resolvePath(this.protocol.getPath());try{let t=await this.fs.readdir(e);this.protocol.setResultFromString(JSON.stringify(t)),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleMkdir(){let e=this.resolvePath(this.protocol.getPath()),t=(this.protocol.getFlags()&f.MKDIR_RECURSIVE)!==0;try{await this.fs.mkdir(e,{recursive:t}),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleRm(){let e=this.resolvePath(this.protocol.getPath()),t=this.protocol.getFlags(),n=(t&f.RECURSIVE)!==0,r=(t&f.FORCE)!==0;try{await this.fs.rm(e,{recursive:n,force:r}),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleExists(){let e=this.resolvePath(this.protocol.getPath());try{let t=await this.fs.exists(e);this.protocol.setResult(new Uint8Array([t?1:0])),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleAppendFile(){let e=this.resolvePath(this.protocol.getPath()),t=this.protocol.getData();try{await this.fs.appendFile(e,t),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleSymlink(){let e=this.protocol.getPath(),t=this.protocol.getDataAsString(),n=this.resolvePath(e);try{await this.fs.symlink(t,n),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleReadlink(){let e=this.resolvePath(this.protocol.getPath());try{let t=await this.fs.readlink(e);this.protocol.setResultFromString(t),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleChmod(){let e=this.resolvePath(this.protocol.getPath()),t=this.protocol.getMode();try{await this.fs.chmod(e,t),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleRealpath(){let e=this.resolvePath(this.protocol.getPath());try{let t=await this.fs.realpath(e);this.protocol.setResultFromString(t),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleRename(){let e=this.resolvePath(this.protocol.getPath()),t=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.mv(e,t),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleCopyFile(){let e=this.resolvePath(this.protocol.getPath()),t=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.cp(e,t),this.protocol.setStatus(c.SUCCESS)}catch(e){this.setErrorFromException(e)}}handleWriteStdout(){let e=this.protocol.getDataAsString();if(!this.tryAppendOutput(`stdout`,e)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(`Output size limit exceeded`),this.protocol.setStatus(c.ERROR);return}this.protocol.setStatus(c.SUCCESS)}handleWriteStderr(){let e=this.protocol.getDataAsString();if(!this.tryAppendOutput(`stderr`,e)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(`Output size limit exceeded`),this.protocol.setStatus(c.ERROR);return}this.protocol.setStatus(c.SUCCESS)}handleExit(){let e=this.protocol.getFlags();this.outputLimitExceeded?this.output.exitCode===0&&(this.output.exitCode=1):this.output.exitCode=e,this.protocol.setStatus(c.SUCCESS),this.running=!1}tryAppendOutput(e,t){return this.outputLimitExceeded?!1:this.maxOutputSize<=0?(e===`stdout`?this.output.stdout+=t:this.output.stderr+=t,!0):this.output.stdout.length+this.output.stderr.length+t.length>this.maxOutputSize?!1:(e===`stdout`?this.output.stdout+=t:this.output.stderr+=t,!0)}appendOutputLimitError(){if(this.maxOutputSize<=0)return;let e=`${this.commandName}: total output size exceeded (>${this.maxOutputSize} bytes), increase executionLimits.maxOutputSize
|
|
10
|
+
`,t=e.length>this.maxOutputSize?e.slice(0,this.maxOutputSize):e;if(this.output.stderr.includes(`total output size exceeded`))return;let n=this.output.stdout.length+this.output.stderr.length+t.length-this.maxOutputSize;if(n>0)if(this.output.stdout.length>=n)this.output.stdout=this.output.stdout.slice(0,this.output.stdout.length-n);else{let e=n-this.output.stdout.length;this.output.stdout=``,e>=this.output.stderr.length?this.output.stderr=``:this.output.stderr=this.output.stderr.slice(0,this.output.stderr.length-e)}this.output.stderr+=t}async handleHttpRequest(){let t=this.secureFetch;if(!t){this.protocol.setErrorCode(l.NETWORK_NOT_CONFIGURED),this.protocol.setResultFromString(`Network access not configured. Enable network in Bash options.`),this.protocol.setStatus(c.ERROR);return}let n=this.protocol.getPath(),r=this.protocol.getDataAsString();try{let i=r?JSON.parse(r):{},a=this.remainingMs(),o=await this.raceDeadline(()=>t(n,{method:i.method,headers:i.headers,body:i.body,timeoutMs:a})),s=JSON.stringify({status:o.status,statusText:o.statusText,headers:o.headers,bodyBase64:e(o.body,`base64`),url:o.url});this.protocol.setResultFromString(s),this.protocol.setStatus(c.SUCCESS)}catch(e){let t=o(e instanceof Error?e.message:String(e));this.protocol.setErrorCode(l.NETWORK_ERROR),this.protocol.setResultFromString(t),this.protocol.setStatus(c.ERROR)}}async handleExecCommand(){let e=this.exec;if(!e){this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(`Command execution not available in this context.`),this.protocol.setStatus(c.ERROR);return}let t=this.protocol.getPath(),n=this.protocol.getDataAsString(),r=new AbortController;try{let i={cwd:this.cwd,signal:r.signal};if(n){let e=JSON.parse(n);e.stdin&&(i.stdin=e.stdin),e.args&&Array.isArray(e.args)&&(i.args=e.args.map(e=>String(e)),t=a([t]))}let o=await this.raceDeadline(()=>e(t,i)),s=JSON.stringify({stdout:o.stdout,stderr:o.stderr,exitCode:o.exitCode});this.protocol.setResultFromString(s),this.protocol.setStatus(c.SUCCESS)}catch(e){r.abort();let t=e instanceof Error?e.message:String(e);this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(t),this.protocol.setStatus(c.ERROR)}}setErrorFromException(e){let t=e instanceof Error?e.message:String(e),n=o(t),r=l.IO_ERROR,i=t.toLowerCase();i.includes(`no such file`)||i.includes(`not found`)||i.includes(`enoent`)?r=l.NOT_FOUND:i.includes(`is a directory`)||i.includes(`eisdir`)?r=l.IS_DIRECTORY:i.includes(`not a directory`)||i.includes(`enotdir`)?r=l.NOT_DIRECTORY:i.includes(`already exists`)||i.includes(`eexist`)?r=l.EXISTS:(i.includes(`permission`)||i.includes(`eperm`)||i.includes(`eacces`))&&(r=l.PERMISSION_DENIED),this.protocol.setErrorCode(r),this.protocol.setResultFromString(n),this.protocol.setStatus(c.ERROR)}};export{m as n,g as t};
|
|
11
|
+
//# sourceMappingURL=chunk-I57KEIP3-DipCOPKf.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./chunk-YNYSPYQ5-DesxOVHh.mjs";var t=2048,n=new Map;function r(e,r,a){let o=typeof a==`boolean`?{ignoreCase:a}:a??{},s=r;o.stripQuotes&&(s.startsWith(`"`)&&s.endsWith(`"`)||s.startsWith(`'`)&&s.endsWith(`'`))&&(s=s.slice(1,-1));let c=o.ignoreCase?`i:${s}`:s,l=n.get(c);if(!l){if(l=i(s,o.ignoreCase),n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}n.set(c,l)}return l.test(e)}function i(t,n){let r=`^`;for(let e=0;e<t.length;e++){let n=t[e];if(n===`*`)r+=`.*`;else if(n===`?`)r+=`.`;else if(n===`[`){let n=e+1;for(;n<t.length&&t[n]!==`]`;)n++;r+=t.slice(e,n+1),e=n}else n===`.`||n===`+`||n===`^`||n===`$`||n===`{`||n===`}`||n===`(`||n===`)`||n===`|`||n===`\\`?r+=`\\${n}`:r+=n}return r+=`$`,e(r,n?`i`:``)}export{r as t};
|
|
2
|
+
//# sourceMappingURL=chunk-J642UCRS-YiNealfn.mjs.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{r as e,t}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as n}from"./chunk-HWKDQ44K-wgmyck2O.mjs";var r={name:`paste`,summary:`merge lines of files`,usage:`paste [OPTION]... [FILE]...`,description:[`Write lines consisting of the sequentially corresponding lines from`,`each FILE, separated by TABs, to standard output.`,``,`With no FILE, or when FILE is -, read standard input.`],options:[`-d, --delimiters=LIST reuse characters from LIST instead of TABs`,`-s, --serial paste one file at a time instead of in parallel`,` --help display this help and exit`],examples:[`paste file1 file2 Merge file1 and file2 side by side`,`paste -d, file1 file2 Use comma as delimiter`,`paste -s file1 Paste all lines of file1 on one line`,`paste - - < file Paste pairs of lines from file`]},i={delimiter:{short:`d`,long:`delimiters`,type:`string`,default:` `},serial:{short:`s`,long:`serial`,type:`boolean`}},a={name:`paste`,async execute(a,s){if(t(a))return e(r);let c=n(`paste`,a,i);if(!c.ok)return c.error;let l=c.result.flags.delimiter,u=c.result.flags.serial,d=c.result.positional;if(d.length===0)return{stdout:``,stderr:`usage: paste [-s] [-d delimiters] file ...
|
|
2
|
+
`,exitCode:1};let f=s.stdin?s.stdin.split(`
|
|
3
|
+
`):[``];f.length>0&&f[f.length-1]===``&&f.pop();let p=d.filter(e=>e===`-`).length,m=[],h=0;for(let e of d)if(e===`-`){let e=[];for(let t=h;t<f.length;t+=p)e.push(f[t]);m.push(e),h++}else{let t=s.fs.resolvePath(s.cwd,e);try{let e=(await s.fs.readFile(t)).split(`
|
|
4
|
+
`);e.length>0&&e[e.length-1]===``&&e.pop(),m.push(e)}catch{return{stdout:``,stderr:`paste: ${e}: No such file or directory
|
|
5
|
+
`,exitCode:1}}}let g=``;if(u)for(let e of m)e&&(g+=`${o(e,l)}
|
|
6
|
+
`);else{let e=Math.max(...m.map(e=>e?.length??0));for(let t=0;t<e;t++){let e=[];for(let n of m)e.push(n?.[t]??``);g+=`${o(e,l)}
|
|
7
|
+
`}}return{stdout:g,stderr:``,exitCode:0}}};function o(e,t){if(e.length===0)return``;if(e.length===1)return e[0];let n=e[0];for(let r=1;r<e.length;r++){let i=(r-1)%t.length;n+=t[i]+e[r]}return n}var s={name:`paste`,flags:[{flag:`-d`,type:`value`,valueHint:`delimiter`},{flag:`-s`,type:`boolean`}],stdinType:`text`,needsFiles:!0};export{s as n,a as t};
|
|
8
|
+
//# sourceMappingURL=chunk-JVPRLUMK-VMFWXimu.mjs.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as r}from"./chunk-7L36YK2X-D7Z_Qw_C.mjs";var i=new Map([[``,1],[`k`,1024],[`m`,1048576],[`g`,1073741824],[`t`,1099511627776],[`p`,0x4000000000000],[`e`,0x1000000000000000]]),a=new Map([[`jan`,1],[`feb`,2],[`mar`,3],[`apr`,4],[`may`,5],[`jun`,6],[`jul`,7],[`aug`,8],[`sep`,9],[`oct`,10],[`nov`,11],[`dec`,12]]);function o(e){let t=e.trim(),n=t.match(/^([+-]?\d*\.?\d+)\s*([kmgtpeKMGTPE])?[iI]?[bB]?$/);if(!n){let e=parseFloat(t);return Number.isNaN(e)?0:e}let r=parseFloat(n[1]),a=(n[2]||``).toLowerCase();return r*(i.get(a)??1)}function s(e){let t=e.trim().toLowerCase().slice(0,3);return a.get(t)??0}function c(e,t){let n=e.split(/(\d+)/),r=t.split(/(\d+)/),i=Math.max(n.length,r.length);for(let e=0;e<i;e++){let t=n[e]||``,i=r[e]||``,a=/^\d+$/.test(t)?parseInt(t,10):null,o=/^\d+$/.test(i)?parseInt(i,10):null;if(a!==null&&o!==null){if(a!==o)return a-o}else if(t!==i)return t.localeCompare(i)}return 0}function l(e){return e.replace(/[^a-zA-Z0-9\s]/g,``)}function u(e,t,n){let r=n===null?/\s+/:n,i=e.split(r),a=t.startField-1;if(a>=i.length)return``;if(t.endField===void 0){let e=i[a]||``;return t.startChar!==void 0&&(e=e.slice(t.startChar-1)),t.ignoreLeading&&(e=e.trimStart()),e}let o=Math.min(t.endField-1,i.length-1),s=``;for(let e=a;e<=o&&e<i.length;e++){let r=i[e]||``;if(e===a&&t.startChar!==void 0&&(r=r.slice(t.startChar-1)),e===o&&t.endChar!==void 0){let n=e===a&&t.startChar!==void 0?t.endChar-t.startChar+1:t.endChar;r=r.slice(0,n)}e>a&&(s+=n||` `),s+=r}return t.ignoreLeading&&(s=s.trimStart()),s}function d(e,t,n){let r=e,i=t;return n.dictionaryOrder&&(r=l(r),i=l(i)),n.ignoreCase&&(r=r.toLowerCase(),i=i.toLowerCase()),n.monthSort?s(r)-s(i):n.humanNumeric?o(r)-o(i):n.versionSort?c(r,i):n.numeric?(parseFloat(r)||0)-(parseFloat(i)||0):r.localeCompare(i)}function f(e){let{keys:t,fieldDelimiter:n,numeric:r,ignoreCase:i,reverse:a,humanNumeric:o,versionSort:s,dictionaryOrder:c,monthSort:l,ignoreLeadingBlanks:f,stable:p}=e;return(e,m)=>{let h=e,g=m;if(f&&(h=h.trimStart(),g=g.trimStart()),t.length===0){let t=d(h,g,{numeric:r,ignoreCase:i,humanNumeric:o,versionSort:s,dictionaryOrder:c,monthSort:l});if(t!==0)return a?-t:t;if(!p){let t=e.localeCompare(m);return a?-t:t}return 0}for(let e of t){let t=u(h,e,n),f=u(g,e,n);e.ignoreLeading&&(t=t.trimStart(),f=f.trimStart());let p={numeric:e.numeric??r,ignoreCase:e.ignoreCase??i,humanNumeric:e.humanNumeric??o,versionSort:e.versionSort??s,dictionaryOrder:e.dictionaryOrder??c,monthSort:e.monthSort??l},m=e.reverse??a,_=d(t,f,p);if(_!==0)return m?-_:_}if(!p){let t=e.localeCompare(m);return a?-t:t}return 0}}function p(e,t){if(t.keys.length===0){if(t.ignoreCase){let t=new Set;return e.filter(e=>{let n=e.toLowerCase();return t.has(n)?!1:(t.add(n),!0)})}return[...new Set(e)]}let n=t.keys[0],r=new Set;return e.filter(e=>{let i=u(e,n,t.fieldDelimiter);return(n.ignoreCase??t.ignoreCase)&&(i=i.toLowerCase()),r.has(i)?!1:(r.add(i),!0)})}function m(e){let t={startField:1},n=``,r=e,i=r.match(/([bdfhMnrV]+)$/);i&&(n=i[1],r=r.slice(0,-n.length)),n.includes(`n`)&&(t.numeric=!0),n.includes(`r`)&&(t.reverse=!0),n.includes(`f`)&&(t.ignoreCase=!0),n.includes(`b`)&&(t.ignoreLeading=!0),n.includes(`h`)&&(t.humanNumeric=!0),n.includes(`V`)&&(t.versionSort=!0),n.includes(`d`)&&(t.dictionaryOrder=!0),n.includes(`M`)&&(t.monthSort=!0);let a=r.split(`,`);if(a.length===0||a[0]===``)return null;let o=a[0].split(`.`),s=parseInt(o[0],10);if(Number.isNaN(s)||s<1)return null;if(t.startField=s,o.length>1&&o[1]){let e=parseInt(o[1],10);!Number.isNaN(e)&&e>=1&&(t.startChar=e)}if(a.length>1&&a[1]){let e=a[1],n=e.match(/([bdfhMnrV]+)$/);if(n){let r=n[1];r.includes(`n`)&&(t.numeric=!0),r.includes(`r`)&&(t.reverse=!0),r.includes(`f`)&&(t.ignoreCase=!0),r.includes(`b`)&&(t.ignoreLeading=!0),r.includes(`h`)&&(t.humanNumeric=!0),r.includes(`V`)&&(t.versionSort=!0),r.includes(`d`)&&(t.dictionaryOrder=!0),r.includes(`M`)&&(t.monthSort=!0),e=e.slice(0,-r.length)}let r=e.split(`.`);if(r[0]){let e=parseInt(r[0],10);if(!Number.isNaN(e)&&e>=1&&(t.endField=e),r.length>1&&r[1]){let e=parseInt(r[1],10);!Number.isNaN(e)&&e>=1&&(t.endChar=e)}}}return t}var h={name:`sort`,summary:`sort lines of text files`,usage:`sort [OPTION]... [FILE]...`,options:[`-b, --ignore-leading-blanks ignore leading blanks`,`-d, --dictionary-order consider only blanks and alphanumeric characters`,`-f, --ignore-case fold lower case to upper case characters`,`-h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G)`,`-M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC'`,`-n, --numeric-sort compare according to string numerical value`,`-r, --reverse reverse the result of comparisons`,`-V, --version-sort natural sort of (version) numbers within text`,`-c, --check check for sorted input; do not sort`,`-o, --output=FILE write result to FILE instead of stdout`,`-s, --stable stabilize sort by disabling last-resort comparison`,`-u, --unique output only unique lines`,`-k, --key=KEYDEF sort via a key; KEYDEF gives location and type`,`-t, --field-separator=SEP use SEP as field separator`,` --help display this help and exit`],description:`KEYDEF is F[.C][OPTS][,F[.C][OPTS]]
|
|
2
|
+
F is a field number (1-indexed)
|
|
3
|
+
C is a character position within the field (1-indexed)
|
|
4
|
+
OPTS can be: b d f h M n r V (per-key modifiers)
|
|
5
|
+
|
|
6
|
+
Examples:
|
|
7
|
+
-k1 sort by first field
|
|
8
|
+
-k2,2 sort by second field only
|
|
9
|
+
-k1.3 sort by first field starting at 3rd character
|
|
10
|
+
-k1,2n sort by fields 1-2 numerically
|
|
11
|
+
-k2 -k1 sort by field 2, then by field 1`},g={name:`sort`,async execute(i,a){if(n(i))return t(h);let o={reverse:!1,numeric:!1,unique:!1,ignoreCase:!1,humanNumeric:!1,versionSort:!1,dictionaryOrder:!1,monthSort:!1,ignoreLeadingBlanks:!1,stable:!1,checkOnly:!1,outputFile:null,keys:[],fieldDelimiter:null},s=[];for(let t=0;t<i.length;t++){let n=i[t];if(n===`-r`||n===`--reverse`)o.reverse=!0;else if(n===`-n`||n===`--numeric-sort`)o.numeric=!0;else if(n===`-u`||n===`--unique`)o.unique=!0;else if(n===`-f`||n===`--ignore-case`)o.ignoreCase=!0;else if(n===`-h`||n===`--human-numeric-sort`)o.humanNumeric=!0;else if(n===`-V`||n===`--version-sort`)o.versionSort=!0;else if(n===`-d`||n===`--dictionary-order`)o.dictionaryOrder=!0;else if(n===`-M`||n===`--month-sort`)o.monthSort=!0;else if(n===`-b`||n===`--ignore-leading-blanks`)o.ignoreLeadingBlanks=!0;else if(n===`-s`||n===`--stable`)o.stable=!0;else if(n===`-c`||n===`--check`)o.checkOnly=!0;else if(n===`-o`||n===`--output`)o.outputFile=i[++t]||null;else if(n.startsWith(`-o`))o.outputFile=n.slice(2)||null;else if(n.startsWith(`--output=`))o.outputFile=n.slice(9)||null;else if(n===`-t`||n===`--field-separator`)o.fieldDelimiter=i[++t]||null;else if(n.startsWith(`-t`))o.fieldDelimiter=n.slice(2)||null;else if(n.startsWith(`--field-separator=`))o.fieldDelimiter=n.slice(18)||null;else if(n===`-k`||n===`--key`){let e=i[++t];if(e){let t=m(e);t&&o.keys.push(t)}}else if(n.startsWith(`-k`)){let e=m(n.slice(2));e&&o.keys.push(e)}else if(n.startsWith(`--key=`)){let e=m(n.slice(6));e&&o.keys.push(e)}else{if(n.startsWith(`--`))return e(`sort`,n);if(n.startsWith(`-`)&&!n.startsWith(`--`)){let t=!1;for(let e of n.slice(1))if(e===`r`)o.reverse=!0;else if(e===`n`)o.numeric=!0;else if(e===`u`)o.unique=!0;else if(e===`f`)o.ignoreCase=!0;else if(e===`h`)o.humanNumeric=!0;else if(e===`V`)o.versionSort=!0;else if(e===`d`)o.dictionaryOrder=!0;else if(e===`M`)o.monthSort=!0;else if(e===`b`)o.ignoreLeadingBlanks=!0;else if(e===`s`)o.stable=!0;else if(e===`c`)o.checkOnly=!0;else{t=!0;break}if(t)return e(`sort`,n)}else s.push(n)}}let c=await r(a,s,{cmdName:`sort`});if(!c.ok)return c.error;let l=c.content.split(`
|
|
12
|
+
`);l.length>0&&l[l.length-1]===``&&l.pop();let u=f(o);if(o.checkOnly){let e=s.length>0?s[0]:`-`;for(let t=1;t<l.length;t++)if(u(l[t-1],l[t])>0)return{stdout:``,stderr:`sort: ${e}:${t+1}: disorder: ${l[t]}
|
|
13
|
+
`,exitCode:1};return{stdout:``,stderr:``,exitCode:0}}l.sort(u),o.unique&&(l=p(l,o));let d=l.length>0?`${l.join(`
|
|
14
|
+
`)}
|
|
15
|
+
`:``;if(o.outputFile){let e=a.fs.resolvePath(a.cwd,o.outputFile);return await a.fs.writeFile(e,d,`binary`),{stdout:``,stderr:``,exitCode:0}}return{stdout:d,stderr:``,exitCode:0,stdoutEncoding:`binary`}}},_={name:`sort`,flags:[{flag:`-r`,type:`boolean`},{flag:`-n`,type:`boolean`},{flag:`-u`,type:`boolean`},{flag:`-f`,type:`boolean`},{flag:`-h`,type:`boolean`},{flag:`-V`,type:`boolean`},{flag:`-d`,type:`boolean`},{flag:`-M`,type:`boolean`},{flag:`-b`,type:`boolean`},{flag:`-s`,type:`boolean`},{flag:`-c`,type:`boolean`},{flag:`-k`,type:`value`,valueHint:`string`},{flag:`-t`,type:`value`,valueHint:`delimiter`},{flag:`-o`,type:`value`,valueHint:`path`}],stdinType:`text`,needsFiles:!0};export{g as n,_ as t};
|
|
16
|
+
//# sourceMappingURL=chunk-KMEYNNUA-pRogdye4.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,t}from"./chunk-74CEPOFO-BcZUJMO1.mjs";var n={name:`clear`,summary:`clear the terminal screen`,usage:`clear [OPTIONS]`,options:[` --help display this help and exit`]},r={name:`clear`,async execute(r,i){return t(r)?e(n):{stdout:`\x1B[2J\x1B[H`,stderr:``,exitCode:0}}},i={name:`clear`,flags:[]};export{r as n,i as t};
|
|
2
|
+
//# sourceMappingURL=chunk-LL3S3NLB-ByBS5IDP.mjs.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{t as e}from"./chunk-YNYSPYQ5-DesxOVHh.mjs";import{t}from"./chunk-IPJHKYVM-C3IodQq7.mjs";import{r as n,t as r}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as i}from"./chunk-X2AJGDEF-D5w6wtaX.mjs";import{t as a}from"./chunk-J642UCRS-YiNealfn.mjs";import{n as o,r as s,t as c}from"./chunk-EEXR5ZDP-CETL3_Uw.mjs";function l(t,n){switch(t.type){case`name`:{let e=t.pattern,r=e.match(/^\*(\.[a-zA-Z0-9]+)$/);if(r){let e=r[1],i=n.name;if(t.ignoreCase){if(!i.toLowerCase().endsWith(e.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!i.endsWith(e))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:a(n.name,e,t.ignoreCase),pruned:!1,printed:!1}}case`path`:{let e=t.pattern,r=n.relativePath,i=e.split(`/`);for(let e=0;e<i.length-1;e++){let n=i[e];if(n&&n!==`.`&&n!==`..`&&!n.includes(`*`)&&!n.includes(`?`)&&!n.includes(`[`)){let e=`/${n}/`;if(t.ignoreCase){if(!r.toLowerCase().includes(e.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.includes(e))return{matches:!1,pruned:!1,printed:!1}}}let o=e.match(/\*(\.[a-zA-Z0-9]+)$/);if(o){let e=o[1];if(t.ignoreCase){if(!r.toLowerCase().endsWith(e.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.endsWith(e))return{matches:!1,pruned:!1,printed:!1}}return{matches:a(r,e,t.ignoreCase),pruned:!1,printed:!1}}case`regex`:try{let r=t.ignoreCase?`i`:``;return{matches:e(t.pattern,r).test(n.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case`type`:return t.fileType===`f`?{matches:n.isFile,pruned:!1,printed:!1}:t.fileType===`d`?{matches:n.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case`empty`:return{matches:n.isEmpty,pruned:!1,printed:!1};case`mtime`:{let e=(Date.now()-n.mtime)/(1e3*60*60*24),r;return r=t.comparison===`more`?e>t.days:t.comparison===`less`?e<t.days:Math.floor(e)===t.days,{matches:r,pruned:!1,printed:!1}}case`newer`:{let e=n.newerRefTimes.get(t.refPath);return e===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:n.mtime>e,pruned:!1,printed:!1}}case`size`:{let e=t.value;switch(t.unit){case`c`:e=t.value;break;case`k`:e=t.value*1024;break;case`M`:e=t.value*1024*1024;break;case`G`:e=t.value*1024*1024*1024;break;case`b`:e=t.value*512;break}let r;return r=t.comparison===`more`?n.size>e:t.comparison===`less`?n.size<e:t.unit===`b`?Math.ceil(n.size/512)===t.value:n.size===e,{matches:r,pruned:!1,printed:!1}}case`perm`:{let e=n.mode&511,r=t.mode&511,i;return i=t.matchType===`exact`?e===r:t.matchType===`all`?(e&r)===r:(e&r)!==0,{matches:i,pruned:!1,printed:!1}}case`prune`:return{matches:!0,pruned:!0,printed:!1};case`print`:return{matches:!0,pruned:!1,printed:!0};case`not`:{let e=l(t.expr,n);return{matches:!e.matches,pruned:e.pruned,printed:!1}}case`and`:{let e=l(t.left,n);if(!e.matches)return{matches:!1,pruned:e.pruned,printed:!1};let r=l(t.right,n);return{matches:r.matches,pruned:e.pruned||r.pruned,printed:e.printed||r.printed}}case`or`:{let e=l(t.left,n);if(e.matches)return e;let r=l(t.right,n);return{matches:r.matches,pruned:e.pruned||r.pruned,printed:r.printed}}}}function u(e){if(!e)return!1;switch(e.type){case`name`:case`path`:case`regex`:case`type`:case`prune`:case`print`:return!1;case`empty`:case`mtime`:case`newer`:case`size`:case`perm`:return!0;case`not`:return u(e.expr);case`and`:case`or`:return u(e.left)||u(e.right)}}function d(e){if(!e)return!1;switch(e.type){case`empty`:return!0;case`not`:return d(e.expr);case`and`:case`or`:return d(e.left)||d(e.right);default:return!1}}function f(e){let t={terminalDirName:null,requiredExtension:null};if(!e)return t;let n=p(e);if(m(e)&&n.length===1){let e=n[0].split(`/`).filter(e=>e.length>0);if(e.length>=2)for(let n=e.length-2;n>=0;n--){let r=e[n];if(!r.includes(`*`)&&!r.includes(`?`)&&!r.includes(`[`)&&r!==`.`&&r!==`..`){let i=e[n+1];if(i&&(i.includes(`*`)||i.includes(`?`))){t.terminalDirName=r;let e=i.match(/^\*(\.[a-zA-Z0-9]+)$/);e&&(t.requiredExtension=e[1])}break}}}return t}function p(e){let t=[],n=e=>{e.type===`path`?t.push(e.pattern):e.type===`not`?n(e.expr):(e.type===`and`||e.type===`or`)&&(n(e.left),n(e.right))};return n(e),t}function m(e){let t=e=>e.type===`type`&&e.fileType===`f`?!0:e.type===`not`?t(e.expr):e.type===`and`||e.type===`or`?t(e.left)||t(e.right):!1;return t(e)}function h(e){let t=[],n=e=>{e&&(e.type===`newer`?t.push(e.refPath):e.type===`not`?n(e.expr):(e.type===`and`||e.type===`or`)&&(n(e.left),n(e.right)))};return n(e),t}function g(e){if(!e)return!0;switch(e.type){case`name`:case`path`:case`regex`:case`type`:case`prune`:case`print`:return!0;case`empty`:case`mtime`:case`newer`:case`size`:case`perm`:return!1;case`not`:return g(e.expr);case`and`:case`or`:return g(e.left)&&g(e.right)}}function _(t,n,r,i,o){switch(t.type){case`name`:{let e=t.pattern,r=e.match(/^\*(\.[a-zA-Z0-9]+)$/);if(r){let e=r[1];if(t.ignoreCase){if(!n.toLowerCase().endsWith(e.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(e))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:a(n,e,t.ignoreCase),pruned:!1,printed:!1}}case`path`:{let e=t.pattern,n=e.split(`/`);for(let e=0;e<n.length-1;e++){let i=n[e];if(i&&i!==`.`&&i!==`..`&&!i.includes(`*`)&&!i.includes(`?`)&&!i.includes(`[`)){let e=`/${i}/`;if(t.ignoreCase){if(!r.toLowerCase().includes(e.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.includes(e))return{matches:!1,pruned:!1,printed:!1}}}let i=e.match(/\*(\.[a-zA-Z0-9]+)$/);if(i){let e=i[1];if(t.ignoreCase){if(!r.toLowerCase().endsWith(e.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.endsWith(e))return{matches:!1,pruned:!1,printed:!1}}return{matches:a(r,e,t.ignoreCase),pruned:!1,printed:!1}}case`regex`:try{let n=t.ignoreCase?`i`:``;return{matches:e(t.pattern,n).test(r),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case`type`:return t.fileType===`f`?{matches:i,pruned:!1,printed:!1}:t.fileType===`d`?{matches:o,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case`prune`:return{matches:!0,pruned:!0,printed:!1};case`print`:return{matches:!0,pruned:!1,printed:!0};case`not`:{let e=_(t.expr,n,r,i,o);return{matches:!e.matches,pruned:e.pruned,printed:!1}}case`and`:{let e=_(t.left,n,r,i,o);if(!e.matches)return{matches:!1,pruned:e.pruned,printed:!1};let a=_(t.right,n,r,i,o);return{matches:a.matches,pruned:e.pruned||a.pruned,printed:e.printed||a.printed}}case`or`:{let e=_(t.left,n,r,i,o);if(e.matches)return e;let a=_(t.right,n,r,i,o);return{matches:a.matches,pruned:e.pruned||a.pruned,printed:a.printed}}default:return{matches:!1,pruned:!1,printed:!1}}}function v(e){if(!e)return!1;switch(e.type){case`prune`:return!0;case`not`:return v(e.expr);case`and`:case`or`:return v(e.left)||v(e.right);default:return!1}}function y(e){switch(e.type){case`name`:case`path`:case`regex`:case`type`:case`prune`:case`print`:return!0;case`empty`:case`mtime`:case`newer`:case`size`:case`perm`:return!1;case`not`:return y(e.expr);case`and`:case`or`:return y(e.left)&&y(e.right)}}function b(e,t){return!e||!t.isDirectory?{shouldPrune:!1}:y(e)?{shouldPrune:l(e,{name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map}).pruned}:x(e,t)}function x(e,t){switch(e.type){case`or`:if(y(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(l(e.left,n).pruned)return{shouldPrune:!0}}return x(e.right,t);case`and`:if(y(e.left)&&y(e.right))return{shouldPrune:l(e,{name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map}).pruned};if(y(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return l(e.left,n).matches?x(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1};case`not`:return{shouldPrune:!1};default:return{shouldPrune:!1}}}function S(e,t){let n=[],r=[],i=t;for(;i<e.length;){let t=e[i];if(t===`(`||t===`\\(`){n.push({type:`lparen`}),i++;continue}if(t===`)`||t===`\\)`){n.push({type:`rparen`}),i++;continue}if(t===`-name`&&i+1<e.length)n.push({type:`expr`,expr:{type:`name`,pattern:e[++i]}});else if(t===`-iname`&&i+1<e.length)n.push({type:`expr`,expr:{type:`name`,pattern:e[++i],ignoreCase:!0}});else if(t===`-path`&&i+1<e.length)n.push({type:`expr`,expr:{type:`path`,pattern:e[++i]}});else if(t===`-ipath`&&i+1<e.length)n.push({type:`expr`,expr:{type:`path`,pattern:e[++i],ignoreCase:!0}});else if(t===`-regex`&&i+1<e.length)n.push({type:`expr`,expr:{type:`regex`,pattern:e[++i]}});else if(t===`-iregex`&&i+1<e.length)n.push({type:`expr`,expr:{type:`regex`,pattern:e[++i],ignoreCase:!0}});else if(t===`-type`&&i+1<e.length){let t=e[++i];if(t===`f`||t===`d`)n.push({type:`expr`,expr:{type:`type`,fileType:t}});else return{expr:null,pathIndex:i,error:`find: Unknown argument to -type: ${t}
|
|
2
|
+
`,actions:[]}}else if(t===`-empty`)n.push({type:`expr`,expr:{type:`empty`}});else if(t===`-mtime`&&i+1<e.length){let t=e[++i],r=`exact`,a=t;t.startsWith(`+`)?(r=`more`,a=t.slice(1)):t.startsWith(`-`)&&(r=`less`,a=t.slice(1));let o=parseInt(a,10);Number.isNaN(o)||n.push({type:`expr`,expr:{type:`mtime`,days:o,comparison:r}})}else if(t===`-newer`&&i+1<e.length){let t=e[++i];n.push({type:`expr`,expr:{type:`newer`,refPath:t}})}else if(t===`-size`&&i+1<e.length){let t=e[++i],r=`exact`,a=t;t.startsWith(`+`)?(r=`more`,a=t.slice(1)):t.startsWith(`-`)&&(r=`less`,a=t.slice(1));let o=a.match(/^(\d+)([ckMGb])?$/);if(o){let e=parseInt(o[1],10),t=o[2]||`b`;n.push({type:`expr`,expr:{type:`size`,value:e,unit:t,comparison:r}})}}else if(t===`-perm`&&i+1<e.length){let t=e[++i],r=`exact`,a=t;t.startsWith(`-`)?(r=`all`,a=t.slice(1)):t.startsWith(`/`)&&(r=`any`,a=t.slice(1));let o=parseInt(a,8);Number.isNaN(o)||n.push({type:`expr`,expr:{type:`perm`,mode:o,matchType:r}})}else if(t===`-prune`)n.push({type:`expr`,expr:{type:`prune`}});else if(t===`-not`||t===`!`)n.push({type:`not`});else if(t===`-o`||t===`-or`)n.push({type:`op`,op:`or`});else if(t===`-a`||t===`-and`)n.push({type:`op`,op:`and`});else if(t===`-maxdepth`||t===`-mindepth`)i++;else if(t!==`-depth`)if(t===`-exec`){let t=[];for(i++;i<e.length&&e[i]!==`;`&&e[i]!==`+`;)t.push(e[i]),i++;if(i>=e.length)return{expr:null,pathIndex:i,error:`find: missing argument to \`-exec'
|
|
3
|
+
`,actions:[]};let n=e[i]===`+`;r.push({type:`exec`,command:t,batchMode:n})}else if(t===`-print`)n.push({type:`expr`,expr:{type:`print`}}),r.push({type:`print`});else if(t===`-print0`)r.push({type:`print0`});else if(t===`-printf`&&i+1<e.length){let t=e[++i];r.push({type:`printf`,format:t})}else if(t===`-delete`)r.push({type:`delete`});else{if(t.startsWith(`-`))return{expr:null,pathIndex:i,error:`find: unknown predicate '${t}'
|
|
4
|
+
`,actions:[]};if(n.length===0){i++;continue}break}i++}if(n.length===0)return{expr:null,pathIndex:i,actions:r};let a=C(n);return a.error?{expr:null,pathIndex:i,error:a.error,actions:r}:{expr:a.expr,pathIndex:i,actions:r}}function C(e){let t=0;function n(){let n=r();if(!n)return null;for(;t<e.length;){let i=e[t];if(i.type===`op`&&i.op===`or`){t++;let e=r();if(!e)return n;n={type:`or`,left:n,right:e}}else break}return n}function r(){let n=i();if(!n)return null;for(;t<e.length;){let r=e[t];if(r.type===`op`&&r.op===`and`){t++;let e=i();if(!e)return n;n={type:`and`,left:n,right:e}}else if(r.type===`expr`||r.type===`not`||r.type===`lparen`){let e=i();if(!e)return n;n={type:`and`,left:n,right:e}}else break}return n}function i(){if(t<e.length&&e[t].type===`not`){t++;let e=i();return e?{type:`not`,expr:e}:null}return a()}function a(){if(t>=e.length)return null;let r=e[t];if(r.type===`lparen`){t++;let r=n();return t<e.length&&e[t].type===`rparen`&&t++,r}return r.type===`expr`?(t++,r.expr):(r.type,null)}return{expr:n()}}var w=500;function T(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function E(e,t,n){e({category:`find`,name:`summary`,durationMs:n,details:{readdirCalls:t.readdirCalls,readdirTimeMs:t.readdirTime,statCalls:t.statCalls,statTimeMs:t.statTime,evalCalls:t.evalCalls,evalTimeMs:t.evalTime,nodeCount:t.nodeCount,batchCount:t.batchCount,batchTimeMs:t.batchTime,earlyPrunes:t.earlyPrunes,otherTimeMs:n-t.readdirTime-t.statTime-t.evalTime-t.batchTime}})}var D={name:`find`,summary:`search for files in a directory hierarchy`,usage:`find [path...] [expression]`,options:`-name PATTERN file name matches shell pattern PATTERN.-iname PATTERN like -name but case insensitive.-path PATTERN file path matches shell pattern PATTERN.-ipath PATTERN like -path but case insensitive.-regex PATTERN file path matches regular expression PATTERN.-iregex PATTERN like -regex but case insensitive.-type TYPE file is of type: f (regular file), d (directory).-empty file is empty or directory is empty.-mtime N file's data was modified N*24 hours ago.-newer FILE file was modified more recently than FILE.-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks).-perm MODE file's permission bits are exactly MODE (octal).-perm -MODE all permission bits MODE are set.-perm /MODE any permission bits MODE are set.-maxdepth LEVELS descend at most LEVELS directories.-mindepth LEVELS do not apply tests at levels less than LEVELS.-depth process directory contents before directory itself.-prune do not descend into this directory.-not, ! negate the following expression.-a, -and logical AND (default).-o, -or logical OR.-exec CMD {} ; execute CMD on each file ({} is replaced by filename).-exec CMD {} + execute CMD with multiple files at once.-print print the full file name (default action).-print0 print the full file name followed by a null character.-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t.-delete delete found files/directories. --help display this help and exit`.split(`.`)},O=new Set([`-name`,`-iname`,`-path`,`-ipath`,`-regex`,`-iregex`,`-type`,`-maxdepth`,`-mindepth`,`-mtime`,`-newer`,`-size`,`-perm`]),k={name:`find`,async execute(e,i){if(r(e))return n(D);let a=[],o=null,s=null,c=!1,p=!1;for(let t=0;t<e.length;t++){let n=e[t];if(n===`-maxdepth`&&t+1<e.length)p=!0,o=parseInt(e[++t],10);else if(n===`-mindepth`&&t+1<e.length)p=!0,s=parseInt(e[++t],10);else if(n===`-depth`)p=!0,c=!0;else if(n===`-exec`)for(p=!0,t++;t<e.length&&e[t]!==`;`&&e[t]!==`+`;)t++;else !n.startsWith(`-`)&&n!==`;`&&n!==`+`&&n!==`(`&&n!==`)`&&n!==`\\(`&&n!==`\\)`&&n!==`!`?p||a.push(n):O.has(n)?(p=!0,t++):(n.startsWith(`-`)||n===`(`||n===`\\(`||n===`!`)&&(p=!0)}a.length===0&&a.push(`.`);let{expr:m,error:y,actions:x}=S(e,0);if(y)return{stdout:``,stderr:y,exitCode:1};let C=x.some(e=>e.type===`print`),k=x.length===0,j=[],M=x.some(e=>e.type===`printf`),N=[],P=``,F=0,I=h(m),L=new Map;for(let e of I){let t=i.fs.resolvePath(i.cwd,e);try{let n=await i.fs.stat(t);L.set(e,n.mtime?.getTime()??Date.now())}catch{}}let R=x.some(e=>{if(e.type!==`printf`)return!1;let t=e.format.replace(/%%/g,``);return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(t)}),z=u(m)||R,B=d(m),V=f(m),H=v(m),U=g(m),W=typeof i.fs.readdirWithFileTypes==`function`;for(let e of a){let t=function(t){let n=s===null||t.depth>=s,i=!1;if(n&&m!==null){let e=Date.now(),a;a=U?_(m,t.name,t.relativePath,t.isFile,t.isDirectory):l(m,{name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:t.isEmpty,mtime:t.stat?.mtime?.getTime()??Date.now(),size:t.stat?.size??0,mode:t.stat?.mode??420,newerRefTimes:L}),n=a.matches,i=C?a.printed:n,r.evalCalls++,r.evalTime+=Date.now()-e}else n&&(i=!0);return i?{print:!0,printfData:M?{path:t.relativePath,name:t.name,size:t.stat?.size??0,mtime:t.stat?.mtime?.getTime()??Date.now(),mode:t.stat?.mode??420,isDirectory:t.isDirectory,depth:t.depth,startingPoint:e}:null}:{print:!1,printfData:null}};e.length>1&&e.endsWith(`/`)&&(e=e.slice(0,-1));let n=i.fs.resolvePath(i.cwd,e);try{await i.fs.stat(n)}catch{P+=`find: ${e}: No such file or directory
|
|
5
|
+
`,F=1;continue}let r=T(),a=Date.now();async function u(t){let{path:a,depth:s,typeInfo:u}=t;if(r.nodeCount++,s>(o??256))return null;let d,f,p;if(u&&!z)d=u.isFile,f=u.isDirectory;else{try{let e=Date.now();p=await i.fs.stat(a),r.statCalls++,r.statTime+=Date.now()-e}catch{return null}if(!p)return null;d=p.isFile,f=p.isDirectory}let h;h=a===n?e.split(`/`).pop()||e:a.split(`/`).pop()||``;let g=a===n?e:e===`.`?`./${a.slice(n===`/`?n.length:n.length+1)}`:e+a.slice(n.length),_=[],v=null,y=null,x=!1;f&&H&&!c&&(x=b(m,{name:h,relativePath:g,isFile:d,isDirectory:f}).shouldPrune,x&&r.earlyPrunes++);let S=s>=(o??256),C=V.terminalDirName!==null&&h===V.terminalDirName,w=!S&&!C&&!x;if(f&&(w||B||C)&&!x){let e=Date.now();if(W&&i.fs.readdirWithFileTypes){if(v=await i.fs.readdirWithFileTypes(a),y=v.map(e=>e.name),r.readdirCalls++,r.readdirTime+=Date.now()-e,w)_=v.map((e,t)=>({path:a===`/`?`/${e.name}`:`${a}/${e.name}`,depth:s+1,typeInfo:{isFile:e.isFile,isDirectory:e.isDirectory},resultIndex:t}));else if(C){let e=V.requiredExtension;_=v.filter(t=>t.isFile&&(!e||t.name.endsWith(e))).map((e,t)=>({path:a===`/`?`/${e.name}`:`${a}/${e.name}`,depth:s+1,typeInfo:{isFile:e.isFile,isDirectory:e.isDirectory},resultIndex:t}))}}else y=await i.fs.readdir(a),r.readdirCalls++,r.readdirTime+=Date.now()-e,w&&(_=y.map((e,t)=>({path:a===`/`?`/${e}`:`${a}/${e}`,depth:s+1,resultIndex:t})))}let T=d?(p?.size??0)===0:y!==null&&y.length===0,E=x;if(!c&&m!==null&&!x&&H){let e=Date.now();E=l(m,{name:h,relativePath:g,isFile:d,isDirectory:f,isEmpty:T,mtime:p?.mtime?.getTime()??Date.now(),size:p?.size??0,mode:p?.mode??420,newerRefTimes:L}).pruned,r.evalCalls++,r.evalTime+=Date.now()-e}return{relativePath:g,name:h,isFile:d,isDirectory:f,isEmpty:T,stat:p,depth:s,children:E?[]:_,pruned:E}}async function d(){let e={paths:[],printfData:[]};if(c){let i=function(e){let n={paths:[],printfData:[]},r=a[e];if(!r)return n;for(let e of r.childIndices){let t=i(e);n.paths.push(...t.paths),n.printfData.push(...t.printfData)}let{print:o,printfData:s}=t(r.node);return o&&(n.paths.push(r.node.relativePath),s&&n.printfData.push(s)),n},a=[],o=[{item:{path:n,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],s=new Map;for(;o.length>0;){let e=Date.now(),t=o.splice(0,w),n=await Promise.all(t.map(e=>u(e.item)));r.batchCount++,r.batchTime+=Date.now()-e;for(let e=0;e<t.length;e++){let r=n[e],i=t[e];if(!r)continue;let c=a.length;if(i.parentIndex>=0){let e=s.get(i.parentIndex)||[];e.push(c),s.set(i.parentIndex,e)}a.push({node:r,parentIndex:i.parentIndex,childIndices:[]});for(let e=0;e<r.children.length;e++)o.push({item:r.children[e],parentIndex:c,childOrderInParent:e})}}for(let[e,t]of s)e>=0&&e<a.length&&(a[e].childIndices=t);if(a.length>0){let t=i(0);e.paths.push(...t.paths),e.printfData.push(...t.printfData)}}else{let i=function(t){let n=a.get(t);n&&(e.paths.push(n.path),n.printfData&&e.printfData.push(n.printfData));let r=c.get(t);if(r)for(let e of r)i(e)},a=new Map,o=0,s=[{item:{path:n,depth:0,resultIndex:0},orderIndex:o++}],c=new Map;for(;s.length>0;){let e=Date.now(),n=s.splice(0,w),i=await Promise.all(n.map(async({item:e,orderIndex:t})=>{let n=await u(e);return n?{node:n,orderIndex:t}:null}));r.batchCount++,r.batchTime+=Date.now()-e;for(let e of i){if(!e)continue;let{node:n,orderIndex:r}=e,{print:i,printfData:l}=t(n);if(i&&a.set(r,{path:n.relativePath,printfData:l}),n.children.length>0){let e=[];for(let t of n.children){let n=o++;e.push(n),s.push({item:t,orderIndex:n})}c.set(r,e)}}}i(0)}return e}let f=await d();if(j.push(...f.paths),N.push(...f.printfData),i.trace){let t=Date.now()-a;E(i.trace,r,t),i.trace({category:`find`,name:`searchPath`,durationMs:t,details:{path:e,resultsFound:f.paths.length}})}}let G=``;if(x.length>0)for(let e of x)switch(e.type){case`print`:G+=j.length>0?`${j.join(`
|
|
6
|
+
`)}
|
|
7
|
+
`:``;break;case`print0`:G+=j.length>0?`${j.join(`\0`)}\0`:``;break;case`delete`:{let e=[...j].sort((e,t)=>t.length-e.length);for(let t of e){let e=i.fs.resolvePath(i.cwd,t);try{await i.fs.rm(e,{recursive:!1})}catch(e){let n=e instanceof Error?e.message:String(e);P+=`find: cannot delete '${t}': ${n}
|
|
8
|
+
`,F=1}}break}case`printf`:for(let t of N)G+=A(e.format,t);break;case`exec`:if(!i.exec)return{stdout:``,stderr:`find: -exec not supported in this context
|
|
9
|
+
`,exitCode:1};if(e.batchMode){let n=[];for(let t of e.command)t===`{}`?n.push(...j):n.push(t);let r=await i.exec(t([n[0]]),{cwd:i.cwd,signal:i.signal,args:n.slice(1)});G+=r.stdout,P+=r.stderr,r.exitCode!==0&&(F=r.exitCode)}else for(let n of j){let r=e.command.map(e=>e===`{}`?n:e),a=await i.exec(t([r[0]]),{cwd:i.cwd,signal:i.signal,args:r.slice(1)});G+=a.stdout,P+=a.stderr,a.exitCode!==0&&(F=a.exitCode)}break}else k&&(G=j.length>0?`${j.join(`
|
|
10
|
+
`)}
|
|
11
|
+
`:``);return{stdout:G,stderr:P,exitCode:F}}};function A(e,t){let n=s(e),r=``,a=0;for(;a<n.length;)if(n[a]===`%`&&a+1<n.length){if(a++,n[a]===`%`){r+=`%`,a++;continue}let[e,s,l]=c(n,a);if(a+=l,a>=n.length){r+=`%`;break}let u=n[a],d;switch(u){case`f`:d=t.name,a++;break;case`h`:{let e=t.path.lastIndexOf(`/`);d=e>0?t.path.slice(0,e):`.`,a++;break}case`p`:d=t.path,a++;break;case`P`:{let e=t.startingPoint;d=t.path===e?``:t.path.startsWith(`${e}/`)?t.path.slice(e.length+1):e===`.`&&t.path.startsWith(`./`)?t.path.slice(2):t.path,a++;break}case`s`:d=String(t.size),a++;break;case`d`:d=String(t.depth),a++;break;case`m`:d=(t.mode&511).toString(8),a++;break;case`M`:d=i(t.mode,t.isDirectory),a++;break;case`t`:d=j(new Date(t.mtime)),a++;break;case`T`:if(a+1<n.length){let e=n[a+1];d=M(new Date(t.mtime),e),a+=2}else d=`%T`,a++;break;default:r+=`%${e!==0||s!==-1?`${e}.${s}`:``}${u}`,a++;continue}r+=o(d,e,s)}else r+=n[a],a++;return r}function j(e){return`${[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`][e.getDay()]} ${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][e.getMonth()]} ${String(e.getDate()).padStart(2,` `)} ${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}:${String(e.getSeconds()).padStart(2,`0`)} ${e.getFullYear()}`}function M(e,t){switch(t){case`@`:return String(e.getTime()/1e3);case`Y`:return String(e.getFullYear());case`m`:return String(e.getMonth()+1).padStart(2,`0`);case`d`:return String(e.getDate()).padStart(2,`0`);case`H`:return String(e.getHours()).padStart(2,`0`);case`M`:return String(e.getMinutes()).padStart(2,`0`);case`S`:return String(e.getSeconds()).padStart(2,`0`);case`T`:return`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}:${String(e.getSeconds()).padStart(2,`0`)}`;case`F`:return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`;default:return`%T${t}`}}var N={name:`find`,flags:[{flag:`-name`,type:`value`,valueHint:`pattern`},{flag:`-iname`,type:`value`,valueHint:`pattern`},{flag:`-type`,type:`value`,valueHint:`string`},{flag:`-maxdepth`,type:`value`,valueHint:`number`},{flag:`-mindepth`,type:`value`,valueHint:`number`},{flag:`-empty`,type:`boolean`},{flag:`-print`,type:`boolean`},{flag:`-print0`,type:`boolean`}],needsFiles:!0};export{k as n,N as t};
|
|
12
|
+
//# sourceMappingURL=chunk-LPQPILI2-FRQB9gt5.mjs.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import{r as e,t}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as n}from"./chunk-HWKDQ44K-wgmyck2O.mjs";import{constants as r,gunzipSync as i,gzipSync as a}from"node:zlib";var o={name:`gzip`,summary:`compress or expand files`,usage:`gzip [OPTION]... [FILE]...`,description:`Compress FILEs (by default, in-place).
|
|
2
|
+
|
|
3
|
+
When no FILE is given, or when FILE is -, read from standard input.
|
|
4
|
+
|
|
5
|
+
With -d, decompress instead.`,options:[`-c, --stdout write to standard output, keep original files`,`-d, --decompress decompress`,`-f, --force force overwrite of output file`,`-k, --keep keep (don't delete) input files`,`-l, --list list compressed file contents`,`-n, --no-name do not save or restore the original name and timestamp`,`-N, --name save or restore the original file name and timestamp`,`-q, --quiet suppress all warnings`,`-r, --recursive operate recursively on directories`,`-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)`,`-t, --test test compressed file integrity`,`-v, --verbose verbose mode`,`-1, --fast compress faster`,`-9, --best compress better`,` --help display this help and exit`]},s={name:`gunzip`,summary:`decompress files`,usage:`gunzip [OPTION]... [FILE]...`,description:`Decompress FILEs (by default, in-place).
|
|
6
|
+
|
|
7
|
+
When no FILE is given, or when FILE is -, read from standard input.`,options:[`-c, --stdout write to standard output, keep original files`,`-f, --force force overwrite of output file`,`-k, --keep keep (don't delete) input files`,`-l, --list list compressed file contents`,`-n, --no-name do not restore the original name and timestamp`,`-N, --name restore the original file name and timestamp`,`-q, --quiet suppress all warnings`,`-r, --recursive operate recursively on directories`,`-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)`,`-t, --test test compressed file integrity`,`-v, --verbose verbose mode`,` --help display this help and exit`]},c={name:`zcat`,summary:`decompress files to stdout`,usage:`zcat [OPTION]... [FILE]...`,description:`Decompress FILEs to standard output.
|
|
8
|
+
|
|
9
|
+
When no FILE is given, or when FILE is -, read from standard input.`,options:[`-f, --force force; read compressed data even from a terminal`,`-l, --list list compressed file contents`,`-q, --quiet suppress all warnings`,`-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)`,`-t, --test test compressed file integrity`,`-v, --verbose verbose mode`,` --help display this help and exit`]},l={stdout:{short:`c`,long:`stdout`,type:`boolean`},toStdout:{long:`to-stdout`,type:`boolean`},decompress:{short:`d`,long:`decompress`,type:`boolean`},uncompress:{long:`uncompress`,type:`boolean`},force:{short:`f`,long:`force`,type:`boolean`},keep:{short:`k`,long:`keep`,type:`boolean`},list:{short:`l`,long:`list`,type:`boolean`},noName:{short:`n`,long:`no-name`,type:`boolean`},name:{short:`N`,long:`name`,type:`boolean`},quiet:{short:`q`,long:`quiet`,type:`boolean`},recursive:{short:`r`,long:`recursive`,type:`boolean`},suffix:{short:`S`,long:`suffix`,type:`string`,default:`.gz`},test:{short:`t`,long:`test`,type:`boolean`},verbose:{short:`v`,long:`verbose`,type:`boolean`},fast:{short:`1`,long:`fast`,type:`boolean`},level2:{short:`2`,type:`boolean`},level3:{short:`3`,type:`boolean`},level4:{short:`4`,type:`boolean`},level5:{short:`5`,type:`boolean`},level6:{short:`6`,type:`boolean`},level7:{short:`7`,type:`boolean`},level8:{short:`8`,type:`boolean`},best:{short:`9`,long:`best`,type:`boolean`}};function u(e){return e.best?r.Z_BEST_COMPRESSION:e.level8?8:e.level7?7:e.level6?6:e.level5?5:e.level4?4:e.level3?3:e.level2?2:e.fast?r.Z_BEST_SPEED:r.Z_DEFAULT_COMPRESSION}function d(e){if(e.length<10||e[0]!==31||e[1]!==139)return{originalName:null,mtime:null,headerSize:0};let t=e[3],n=e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r=10;if(t&4){if(r+2>e.length)return{originalName:null,mtime:null,headerSize:0};let t=e[r]|e[r+1]<<8;r+=2+t}let i=null;if(t&8){let t=r;for(;r<e.length&&e[r]!==0;)r++;r<e.length&&(i=new TextDecoder().decode(e.slice(t,r)),r++)}if(t&16){for(;r<e.length&&e[r]!==0;)r++;r++}return t&2&&(r+=2),{originalName:i,mtime:n>0?new Date(n*1e3):null,headerSize:r}}function f(e){if(e.length<4)return 0;let t=e.length;return e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24}function p(e){return e.length>=2&&e[0]===31&&e[1]===139}function m(e){return Buffer.from(e).toString(`latin1`)}function h(e){return e.limits?.maxOutputSize??0}function g(e,t){if(t>0){if(f(e)>t)throw Error(`decompressed data exceeds limit (${t} bytes)`);return i(e,{maxOutputLength:t})}return i(e)}async function _(e,t,n,r,i,o){let s=n.suffix,c,l,f,_=h(e);if(t===`-`||t===``)if(f=Uint8Array.from(e.stdin,e=>e.charCodeAt(0)),i){if(!p(f))return n.quiet?{stdout:``,stderr:``,exitCode:1}:{stdout:``,stderr:`${r}: stdin: not in gzip format
|
|
10
|
+
`,exitCode:1};try{return{stdout:m(g(f,_)),stderr:``,exitCode:0}}catch(e){return{stdout:``,stderr:`${r}: stdin: ${e instanceof Error?e.message:`unknown error`}
|
|
11
|
+
`,exitCode:1}}}else{let e=u(n);return{stdout:m(a(f,{level:e})),stderr:``,exitCode:0}}c=e.fs.resolvePath(e.cwd,t);try{if((await e.fs.stat(c)).isDirectory)return n.recursive?await v(e,c,n,r,i,o):n.quiet?{stdout:``,stderr:``,exitCode:1}:{stdout:``,stderr:`${r}: ${t}: is a directory -- ignored
|
|
12
|
+
`,exitCode:1}}catch{return{stdout:``,stderr:`${r}: ${t}: No such file or directory
|
|
13
|
+
`,exitCode:1}}try{f=await e.fs.readFileBuffer(c)}catch{return{stdout:``,stderr:`${r}: ${t}: No such file or directory
|
|
14
|
+
`,exitCode:1}}if(i){if(!t.endsWith(s))return n.quiet?{stdout:``,stderr:``,exitCode:1}:{stdout:``,stderr:`${r}: ${t}: unknown suffix -- ignored
|
|
15
|
+
`,exitCode:1};if(!p(f))return n.quiet?{stdout:``,stderr:``,exitCode:1}:{stdout:``,stderr:`${r}: ${t}: not in gzip format
|
|
16
|
+
`,exitCode:1};let i;try{i=g(f,_)}catch(e){return{stdout:``,stderr:`${r}: ${t}: ${e instanceof Error?e.message:`unknown error`}
|
|
17
|
+
`,exitCode:1}}if(o)return{stdout:m(i),stderr:``,exitCode:0};if(n.name){let t=d(f);l=t.originalName?e.fs.resolvePath(e.cwd,t.originalName):c.slice(0,-s.length)}else l=c.slice(0,-s.length);if(!n.force)try{return await e.fs.stat(l),{stdout:``,stderr:`${r}: ${l} already exists; not overwritten
|
|
18
|
+
`,exitCode:1}}catch{}return await e.fs.writeFile(l,i),!n.keep&&!o&&await e.fs.rm(c),n.verbose?{stdout:``,stderr:`${t}: ${f.length>0?((1-f.length/i.length)*100).toFixed(1):`0.0`}% -- replaced with ${l.split(`/`).pop()}
|
|
19
|
+
`,exitCode:0}:{stdout:``,stderr:``,exitCode:0}}else{if(t.endsWith(s))return n.quiet?{stdout:``,stderr:``,exitCode:1}:{stdout:``,stderr:`${r}: ${t} already has ${s} suffix -- unchanged
|
|
20
|
+
`,exitCode:1};let i=u(n),d;try{d=a(f,{level:i})}catch(e){return{stdout:``,stderr:`${r}: ${t}: ${e instanceof Error?e.message:`unknown error`}
|
|
21
|
+
`,exitCode:1}}if(o)return{stdout:m(d),stderr:``,exitCode:0};if(l=c+s,!n.force)try{return await e.fs.stat(l),{stdout:``,stderr:`${r}: ${l} already exists; not overwritten
|
|
22
|
+
`,exitCode:1}}catch{}return await e.fs.writeFile(l,d),!n.keep&&!o&&await e.fs.rm(c),n.verbose?{stdout:``,stderr:`${t}: ${f.length>0?((1-d.length/f.length)*100).toFixed(1):`0.0`}% -- replaced with ${l.split(`/`).pop()}
|
|
23
|
+
`,exitCode:0}:{stdout:``,stderr:``,exitCode:0}}}async function v(e,t,n,r,i,a){let o=await e.fs.readdir(t),s=``,c=``,l=0;for(let u of o){let o=e.fs.resolvePath(t,u),d=await e.fs.stat(o);if(d.isDirectory){let t=await v(e,o,n,r,i,a);s+=t.stdout,c+=t.stderr,t.exitCode!==0&&(l=t.exitCode)}else if(d.isFile){let t=n.suffix;if(i&&!u.endsWith(t)||!i&&u.endsWith(t))continue;let d=await _(e,o.startsWith(`${e.cwd}/`)?o.slice(e.cwd.length+1):o,n,r,i,a);s+=d.stdout,c+=d.stderr,d.exitCode!==0&&(l=d.exitCode)}}return{stdout:s,stderr:c,exitCode:l}}async function y(e,t,n,r){let i;if(t===`-`||t===``)i=Uint8Array.from(e.stdin,e=>e.charCodeAt(0));else{let n=e.fs.resolvePath(e.cwd,t);try{i=await e.fs.readFileBuffer(n)}catch{return{stdout:``,stderr:`${r}: ${t}: No such file or directory
|
|
24
|
+
`,exitCode:1}}}if(!p(i))return n.quiet?{stdout:``,stderr:``,exitCode:1}:{stdout:``,stderr:`${r}: ${t}: not in gzip format
|
|
25
|
+
`,exitCode:1};let a=i.length,o=f(i),s=o>0?((1-a/o)*100).toFixed(1):`0.0`,c=d(i).originalName||(t===`-`?``:t.replace(/\.gz$/,``));return{stdout:`${a.toString().padStart(10)} ${o.toString().padStart(10)} ${s.padStart(5)}% ${c}
|
|
26
|
+
`,stderr:``,exitCode:0}}async function b(e,t,n,r){let i;if(t===`-`||t===``)i=Uint8Array.from(e.stdin,e=>e.charCodeAt(0));else{let n=e.fs.resolvePath(e.cwd,t);try{i=await e.fs.readFileBuffer(n)}catch{return{stdout:``,stderr:`${r}: ${t}: No such file or directory
|
|
27
|
+
`,exitCode:1}}}if(!p(i))return n.quiet?{stdout:``,stderr:``,exitCode:1}:{stdout:``,stderr:`${r}: ${t}: not in gzip format
|
|
28
|
+
`,exitCode:1};try{return g(i,h(e)),n.verbose?{stdout:``,stderr:`${t}: OK
|
|
29
|
+
`,exitCode:0}:{stdout:``,stderr:``,exitCode:0}}catch(e){return{stdout:``,stderr:`${r}: ${t}: ${e instanceof Error?e.message:`invalid`}
|
|
30
|
+
`,exitCode:1}}}async function x(r,i,a){let u=a===`zcat`?c:a===`gunzip`?s:o;if(t(r))return e(u);let d=n(a,r,l);if(!d.ok)return d.error.stderr.includes(`unrecognized option`),d.error;let f=d.result.flags,p=d.result.positional,m=a===`gunzip`||a===`zcat`||f.decompress||f.uncompress,h=a===`zcat`||f.stdout||f.toStdout;if(f.list){p.length===0&&(p=[`-`]);let e=` compressed uncompressed ratio uncompressed_name
|
|
31
|
+
`,t=``,n=0;for(let r of p){let o=await y(i,r,f,a);e+=o.stdout,t+=o.stderr,o.exitCode!==0&&(n=o.exitCode)}return{stdout:e,stderr:t,exitCode:n}}if(f.test){p.length===0&&(p=[`-`]);let e=``,t=``,n=0;for(let r of p){let o=await b(i,r,f,a);e+=o.stdout,t+=o.stderr,o.exitCode!==0&&(n=o.exitCode)}return{stdout:e,stderr:t,exitCode:n}}p.length===0&&(p=[`-`]);let g=``,v=``,x=0;for(let e of p){let t=await _(i,e,f,a,m,h);g+=t.stdout,v+=t.stderr,t.exitCode!==0&&(x=t.exitCode)}return{stdout:g,stderr:v,exitCode:x}}var S={name:`gzip`,async execute(e,t){return{...await x(e,t,`gzip`),stdoutEncoding:`binary`}}},C={name:`gunzip`,async execute(e,t){return{...await x(e,t,`gunzip`),stdoutEncoding:`binary`}}},w={name:`zcat`,async execute(e,t){return{...await x(e,t,`zcat`),stdoutEncoding:`binary`}}},T={name:`gzip`,flags:[{flag:`-c`,type:`boolean`},{flag:`-d`,type:`boolean`},{flag:`-f`,type:`boolean`},{flag:`-k`,type:`boolean`},{flag:`-l`,type:`boolean`},{flag:`-n`,type:`boolean`},{flag:`-q`,type:`boolean`},{flag:`-r`,type:`boolean`},{flag:`-t`,type:`boolean`},{flag:`-v`,type:`boolean`},{flag:`-1`,type:`boolean`},{flag:`-9`,type:`boolean`}],stdinType:`binary`,needsFiles:!0},E={name:`gunzip`,flags:[{flag:`-c`,type:`boolean`},{flag:`-f`,type:`boolean`},{flag:`-k`,type:`boolean`},{flag:`-q`,type:`boolean`},{flag:`-v`,type:`boolean`}],stdinType:`binary`,needsFiles:!0},D={name:`zcat`,flags:[{flag:`-f`,type:`boolean`},{flag:`-q`,type:`boolean`},{flag:`-v`,type:`boolean`}],stdinType:`binary`,needsFiles:!0};export{w as a,T as i,E as n,D as o,C as r,S as t};
|
|
32
|
+
//# sourceMappingURL=chunk-LTZRCH7N-46S7WKw8.mjs.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{r as e,t}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as n}from"./chunk-HWKDQ44K-wgmyck2O.mjs";var r={name:`column`,summary:`columnate lists`,usage:`column [OPTION]... [FILE]...`,description:`Format input into multiple columns. By default, fills rows first. Use -t to create a table based on whitespace-delimited input.`,options:[`-t Create a table (determine columns from input)`,`-s SEP Input field delimiter (default: whitespace)`,`-o SEP Output field delimiter (default: two spaces)`,`-c WIDTH Output width for fill mode (default: 80)`,`-n Don't merge multiple adjacent delimiters`],examples:[`ls | column # Fill columns with ls output`,`cat data | column -t # Format as table`,`column -t -s ',' file # Format CSV as table`,`column -c 40 file # Fill 40-char wide columns`]},i={table:{short:`t`,long:`table`,type:`boolean`},separator:{short:`s`,type:`string`},outputSep:{short:`o`,type:`string`},width:{short:`c`,type:`number`,default:80},noMerge:{short:`n`,type:`boolean`}};function a(e,t,n){return t?n?e.split(t):e.split(t).filter(e=>e.length>0):n?e.split(/[ \t]/):e.split(/[ \t]+/).filter(e=>e.length>0)}function o(e){let t=[];for(let n of e)for(let e=0;e<n.length;e++){let r=n[e].length;(t[e]===void 0||r>t[e])&&(t[e]=r)}return t}function s(e,t){if(e.length===0)return``;let n=o(e),r=[];for(let i of e){let e=[];for(let t=0;t<i.length;t++)t===i.length-1?e.push(i[t]):e.push(i[t].padEnd(n[t]));r.push(e.join(t))}return r.join(`
|
|
2
|
+
`)}function c(e,t,n){if(e.length===0)return``;let r=Math.max(...e.map(e=>e.length)),i=n.length,a=r+i,o=Math.max(1,Math.floor((t+i)/a)),s=Math.ceil(e.length/o),c=[];for(let t=0;t<s;t++){let i=[];for(let n=0;n<o;n++){let a=n*s+t;a<e.length&&(n===o-1||(n+1)*s+t>=e.length?i.push(e[a]):i.push(e[a].padEnd(r)))}c.push(i.join(n))}return c.join(`
|
|
3
|
+
`)}var l={name:`column`,execute:async(o,l)=>{if(t(o))return e(r);let u=n(`column`,o,i);if(!u.ok)return u.error;let{table:d,separator:f,outputSep:p,width:m,noMerge:h}=u.result.flags,g=u.result.positional,_=p??` `,v;if(g.length===0)v=l.stdin??``;else{let e=[];for(let t of g)if(t===`-`)e.push(l.stdin??``);else{let n=l.fs.resolvePath(l.cwd,t),r=await l.fs.readFile(n);if(r===null)return{exitCode:1,stdout:``,stderr:`column: ${t}: No such file or directory
|
|
4
|
+
`};e.push(r)}v=e.join(``)}if(v===``||v.trim()===``)return{exitCode:0,stdout:``,stderr:``};let y=v.split(`
|
|
5
|
+
`);v.endsWith(`
|
|
6
|
+
`)&&y[y.length-1]===``&&y.pop();let b=y.filter(e=>e.trim().length>0),x;if(d)x=s(b.map(e=>a(e,f,h)),_);else{let e=[];for(let t of b){let n=a(t,f,h);e.push(...n)}x=c(e,m,_)}return x.length>0&&(x+=`
|
|
7
|
+
`),{exitCode:0,stdout:x,stderr:``}}},u={name:`column`,flags:[{flag:`-t`,type:`boolean`},{flag:`-s`,type:`value`,valueHint:`delimiter`},{flag:`-o`,type:`value`,valueHint:`string`},{flag:`-c`,type:`value`,valueHint:`number`},{flag:`-n`,type:`boolean`}],stdinType:`text`,needsFiles:!0};export{u as n,l as t};
|
|
8
|
+
//# sourceMappingURL=chunk-LWEGUNWT-DdGmM3wr.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{n as e}from"./chunk-3THT3N7L-DztAF386.mjs";import{t}from"./chunk-44UOCSGV-CaFxJDHm.mjs";import{t as n}from"./chunk-HWKDQ44K-wgmyck2O.mjs";var r={recursive:{short:`p`,long:`parents`,type:`boolean`},verbose:{short:`v`,long:`verbose`,type:`boolean`}},i={name:`mkdir`,async execute(i,a){let o=n(`mkdir`,i,r);if(!o.ok)return o.error;let s=o.result.flags.recursive,c=o.result.flags.verbose,l=o.result.positional;if(l.length===0)return{stdout:``,stderr:`mkdir: missing operand
|
|
2
|
+
`,exitCode:1};let u=``,d=``,f=0;for(let n of l)try{let e=a.fs.resolvePath(a.cwd,n);await a.fs.mkdir(e,{recursive:s}),c&&(u+=`mkdir: created directory '${n}'
|
|
3
|
+
`)}catch(r){let i=t(r);i.includes(`ENOENT`)||i.includes(`no such file`)?d+=`mkdir: cannot create directory '${n}': No such file or directory
|
|
4
|
+
`:i.includes(`EEXIST`)||i.includes(`already exists`)?d+=`mkdir: cannot create directory '${n}': File exists
|
|
5
|
+
`:d+=`mkdir: cannot create directory '${n}': ${e(i)}
|
|
6
|
+
`,f=1}return{stdout:u,stderr:d,exitCode:f}}},a={name:`mkdir`,flags:[{flag:`-p`,type:`boolean`},{flag:`-v`,type:`boolean`}],needsArgs:!0};export{a as n,i as t};
|
|
7
|
+
//# sourceMappingURL=chunk-MDDMCKUK-CuRdI1Uv.mjs.map
|