@inkeep/open-knowledge 0.28.0-beta.0 → 0.28.0-beta.2
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 +24 -9
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/awk2-BBAGSFUB-Clvg_OoV.mjs +1 -0
- package/dist/chunk-2TRDZQLB-C2G-sahM.mjs +18 -0
- package/dist/{chunk-UNYNJIFU-HSzsM3a6.mjs → chunk-3BS5SKQH-HZ1-1bfb.mjs} +36 -36
- package/dist/{chunk-YS3AZT3J-DwQ3GyQR.mjs → chunk-3H6UQG3A-DdNaIxPm.mjs} +9 -9
- package/dist/{chunk-XORM457F-CJbQLVgU.mjs → chunk-6Z5SFZXK-C3WlMqq-.mjs} +53 -53
- package/dist/{chunk-YNYSPYQ5-DHter9G3.mjs → chunk-B74TABJS-DlbqoTuk.mjs} +13 -13
- package/dist/{chunk-FEIOJCZD-D6YUa1Xl.mjs → chunk-BGSUD5R5-DQ0_iOyO.mjs} +2 -2
- package/dist/{chunk-F55TLFGB-AEzanSfe.mjs → chunk-DBKNVD4L-BVx-WyDG.mjs} +2 -2
- package/dist/{chunk-BRGMQKJV-DtyxDw61.mjs → chunk-HKLCLINH-DwmCAW4U.mjs} +16 -16
- package/dist/chunk-HL6NGDO2-978327U5.mjs +24 -0
- package/dist/{chunk-LPQPILI2-GOcK96AE.mjs → chunk-K6LIBGJA-DpjaSGfc.mjs} +2 -2
- package/dist/{chunk-BBXLRYSX-OVlWa2B-.mjs → chunk-KRBPSX3W-nYEMVABW.mjs} +2 -2
- package/dist/chunk-KX3P26DQ-Cli1PSKS.mjs +2 -0
- package/dist/{chunk-SYMJJMQ4-DUF5hY-A.mjs → chunk-PXTK5WE2-B17f9YTq.mjs} +1 -1
- package/dist/{chunk-J642UCRS-C1PS8Hwf.mjs → chunk-SNN4IESC-C-P75V1I.mjs} +2 -2
- package/dist/chunk-TP4BZANS-eJW0TOjs.mjs +21 -0
- package/dist/{chunk-YFG2CMIF-DBRGs_rZ.mjs → chunk-V5MWI2OL-CDEVEp7K.mjs} +2 -2
- package/dist/chunk-XKWWSDBF-XuPgN5BP.mjs +37 -0
- package/dist/{chunk-NYQYO467-KfHLMnUW.mjs → chunk-YMMW5UAP-uYgeXT56.mjs} +5 -5
- package/dist/chunk-YULBWSET-BYBVdNmi.mjs +14 -0
- package/dist/{chunk-OL3S66CO-CBdL6pp1.mjs → chunk-ZZO3UDB3-CdVtmXn4.mjs} +2 -2
- package/dist/cli.mjs +7 -7
- package/dist/constants-DQ9gCjtp.mjs +2 -0
- package/dist/{dist-CgMyk9vp.mjs → dist-Cj2f9yMz.mjs} +1 -1
- package/dist/{dist-C_yx5tj0.mjs → dist-Dzsbf2ES.mjs} +159 -161
- package/dist/expansion-VBDYWVZR-k3W3Rc7R.mjs +1 -0
- package/dist/expr-YYCVMXE3-CHnBeIXW.mjs +1 -0
- package/dist/file-IGDTDPLG-DQaFkvTu.mjs +1 -0
- package/dist/find-DH2ALKQS-6y8KktlA.mjs +1 -0
- package/dist/{flag-coverage-QT4N2Z44-BlPYKPtd.mjs → flag-coverage-6JEX67RU-BqC6mFKB.mjs} +2 -2
- package/dist/{git-handle-Bhgrj9qX-DBwQr-02.mjs → git-handle-B4hCEi7c-CXOP12Ds.mjs} +2 -2
- package/dist/git-handle-DG8d2xCi-C_CAAChL.mjs +1 -0
- package/dist/grep-2HUTXO5U-Dbnjl3Iq.mjs +1 -0
- package/dist/index.d.mts +30 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-ivEBwK7y.mjs → init-CylIL2_d.mjs} +24 -24
- package/dist/init-iEaa5yZe.mjs +1 -0
- package/dist/jq-LYZFFBZB-CSF_TJhe.mjs +1 -0
- package/dist/{js-exec-M6UR76J5-ZESSNIAK.mjs → js-exec-VXN6TZ7U-fCXuAS2-.mjs} +2 -2
- package/dist/{loader-u0w9n8j8.mjs → loader-DL7cugZT.mjs} +2 -2
- package/dist/loader-Dnu5tSEp.mjs +1 -0
- package/dist/preview-B5POtWPo.mjs +1 -0
- package/dist/{preview-DuGdXEFZ.mjs → preview-Bn8zUTY3.mjs} +2 -2
- package/dist/public/assets/SettingsDialogBody-BX4GP2gS.js +7 -0
- package/dist/public/assets/{index-BY2yEG8q.js → index-Br8R5akq.js} +3 -3
- package/dist/public/index.html +1 -1
- package/dist/{python3-AUFTPCU6-B7_jrPM3.mjs → python3-DNGS4G3E-bGzU9nm-.mjs} +2 -2
- package/dist/{repair-launch-json-GbJKeEYH.mjs → repair-launch-json-BkY5nlM0.mjs} +2 -2
- package/dist/repair-mcp-configs-Cz6iXpxD.mjs +2 -0
- package/dist/repair-skills-BwkQh3gJ.mjs +1 -0
- package/dist/repair-skills-DDLj2RIs.mjs +3 -0
- package/dist/rg-XNF3R3II-ivb6d3Sm.mjs +1 -0
- package/dist/sed-JAPPVBEU-BvDbOHs0.mjs +1 -0
- package/dist/{sqlite3-56UMWEY3-DNmhrHQv.mjs → sqlite3-TE5AIOTF-DW7pT7NE.mjs} +1 -1
- package/dist/{src-Cc1qY4l3.mjs → src-DL-hUlrv.mjs} +3 -3
- package/dist/{start-FRD4_VQ8.mjs → start-OiE8Ork3.mjs} +2 -2
- package/dist/start-uZWiX6-B.mjs +1 -0
- package/dist/tar-MZQD7NO4-46pC0DHj.mjs +1 -0
- package/dist/{write-project-skill-GLroKiE7.mjs → write-project-skill-C7UNscN7.mjs} +3 -3
- package/dist/xan-UD7JYIL2-DnWVVFeC.mjs +1 -0
- package/dist/xan-view-OW2TB7Z3-DBl8NjSB.mjs +1 -0
- package/dist/yq-OAKYHSXH-CpYttz-E.mjs +1 -0
- package/package.json +1 -1
- package/dist/awk2-POPGKRAI-6Q9HKhoL.mjs +0 -1
- package/dist/chunk-CR5AFCPT-BD_awIEP.mjs +0 -24
- package/dist/chunk-HWBSOZZR-DaPTwPxK.mjs +0 -37
- package/dist/chunk-OARHFVLG-Csb_cJVS.mjs +0 -21
- package/dist/chunk-VLGZJRPG-CHtdu0KZ.mjs +0 -17
- package/dist/chunk-XHM67O4N-2lBQUjKO.mjs +0 -2
- package/dist/chunk-YCFVLTST-CKzPj8PR.mjs +0 -13
- package/dist/constants-CrfIfZxB.mjs +0 -2
- package/dist/expansion-ENLSRCXJ-C5xjxYTl.mjs +0 -1
- package/dist/expr-5T3UU5KE-DrJUreFq.mjs +0 -1
- package/dist/file-ZIGAJ4YS-D07ChhI1.mjs +0 -1
- package/dist/find-TPUOAIUQ-ZPOxwUwf.mjs +0 -1
- package/dist/git-handle-DjEtQkHv-DQXg1XhZ.mjs +0 -1
- package/dist/grep-3AIAIJVR-Bh6KBg6d.mjs +0 -1
- package/dist/init-D4mCPnC2.mjs +0 -1
- package/dist/jq-ODXZBPLY-D3tmTL1R.mjs +0 -1
- package/dist/loader-ByJ07pxk.mjs +0 -1
- package/dist/preview-BSeDAUIf.mjs +0 -1
- package/dist/public/assets/SettingsDialogBody-BGLGfDpN.js +0 -7
- package/dist/repair-mcp-configs-DLSIsucG.mjs +0 -2
- package/dist/repair-skills-B-VIYM77.mjs +0 -1
- package/dist/repair-skills-DJmyw_aE.mjs +0 -3
- package/dist/rg-FOQSCCX3-ViKChHv5.mjs +0 -1
- package/dist/sed-VFTTATXJ-BfHBQ11q.mjs +0 -1
- package/dist/start-B-djBhNq.mjs +0 -1
- package/dist/tar-ANUBEFJY-Db9qg5B2.mjs +0 -1
- package/dist/xan-BXDXYEIB-I8yansvE.mjs +0 -1
- package/dist/xan-view-ECQUO7AJ-DJhdCPf3.mjs +0 -1
- package/dist/yq-MJMAR36V-BXyMiYfX.mjs +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{t as r}from"./chunk-5QMZ5MUS-_0tQyQsf.mjs";import{n as i,t as a}from"./chunk-A5O5YHGN-Kbs3GRxW.mjs";import{n as o}from"./chunk-24IMIIXA-BoP5OA93.mjs";import{n as s,t as c}from"./chunk-3THT3N7L-CBWmNncQ.mjs";import{r as l,t as u}from"./chunk-74CEPOFO-V0JXh91S.mjs";import{dirname as d,join as f,sep as p}from"node:path";import{fileURLToPath as m}from"node:url";import{existsSync as h}from"node:fs";import{randomBytes as g}from"node:crypto";import{Worker as _}from"node:worker_threads";var v=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`:pe(e,t?1:0);break;case`number`:de(e,t);break;case`string`:A(e,t,-1,-1);break;case`object`:if(t===null)fe(e);else if(t.length!=null){var n=Mt(t.length);C.set(t,n),j(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:fe(e)}}function t(e,t){for(var n=[],r=0;r<e;r+=1){var i=M(t+4*r,`i32`),a=oe(i);if(a===1||a===2)i=ue(i);else if(a===3)i=ce(i);else if(a===4){a=i,i=se(a),a=le(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:Le(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=M(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`]),v=o(`sqlite3_bind_double`,`number`,[`number`,`number`,`number`]),y=o(`sqlite3_bind_int`,`number`,[`number`,`number`,`number`]),b=o(`sqlite3_bind_parameter_index`,`number`,[`number`,`string`]),x=o(`sqlite3_step`,`number`,[`number`]),ee=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`]),ie=o(`sqlite3_finalize`,`number`,[`number`]),ae=o(`sqlite3_create_function_v2`,`number`,`number string number number number number number number number`.split(` `)),oe=o(`sqlite3_value_type`,`number`,[`number`]),se=o(`sqlite3_value_bytes`,`number`,[`number`]),ce=o(`sqlite3_value_text`,`string`,[`number`]),le=o(`sqlite3_value_blob`,`number`,[`number`]),ue=o(`sqlite3_value_double`,`number`,[`number`]),de=o(`sqlite3_result_double`,``,[`number`,`number`]),fe=o(`sqlite3_result_null`,``,[`number`]),A=o(`sqlite3_result_text`,``,[`number`,`string`,`number`,`number`]),j=o(`sqlite3_result_blob`,``,[`number`,`number`,`number`,`number`]),pe=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=x(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)?y:v)(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=b(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=ie(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);N(a),N(t);try{this.db.handleError(h(this.db.db,this.lb,-1,a,t)),this.lb=M(t,`i32`);var r=M(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=[];M(s,`i8`)!==0;){N(a),N(c),this.handleError(h(this.db,s,-1,a,c));var l=M(a,`i32`);if(s=M(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(N(a),this.handleError(f(this.db,e,-1,a,0)),e=M(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=M(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=ee(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(ae(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(ae(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 v=console.log.bind(console),y=console.error.bind(console),b,x=!1,ee,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+`)`,y(e),x=!0,new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`)}var ie;async function ae(e){if(!b)try{var t=await h(e);return new Uint8Array(t)}catch{}if(e==ie&&b)e=new Uint8Array(b);else if(g)e=g(e);else throw`both async and sync fetching of the wasm failed`;return e}async function oe(e,t){try{var n=await ae(e);return await WebAssembly.instantiate(n,t)}catch(e){y(`failed to asynchronously prepare wasm: ${e}`),k(e)}}async function se(e){var t=ie;if(!b&&!S(t)&&!u)try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){y(`wasm streaming compile failed: ${e}`),y(`falling back to ArrayBuffer instantiation`)}return oe(t,e)}class ce{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var le=e=>{for(;0<e.length;)e.shift()(s)},ue=[],de=[],fe=()=>{var e=s.preRun.shift();de.push(e)},A=0,j=null;function M(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 pe=!0;function N(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 V(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 V(60);for(var i=0,a=0;a<r;a++){try{var o=e.tty.eb.Bb(e.tty)}catch{throw new V(29)}if(o===void 0&&i===0)throw new V(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 V(60);try{for(var i=0;i<r;i++)e.tty.eb.ub(e.tty,t[n+i])}catch{throw new V(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?(v(Se(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){0<e.output?.length&&(v(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?(y(Se(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){0<e.output?.length&&(y(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 V(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=Be(e,t,n,r),W(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,W(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 V(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=U(t,n)}catch{}if(r){if(W(e.mode))for(var i in r.Na)throw new V(55);ze(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=U(e,t),r;for(r in n.Na)throw new V(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 V(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 V(28);return t},jb(e,t,n,r,i){if((e.node.mode&61440)!=32768)throw new V(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 V(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={},z=[],Me=1,B=null,Ne=!1,Pe=!0,V=class{name=`ErrnoError`;constructor(e){this.Pa=e}},Fe=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}},Ie=class{La={};Ma={};bb=null;constructor(e,t,n,r){e||=this,this.parent=e,this.Xa=e.Xa,this.id=Me++,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 H(e,t={}){if(!e)throw new V(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=U(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 V(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 V(32)}function Le(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 Re(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%B.length}function ze(e){var t=Re(e.parent.id,e.name);if(B[t]===e)B[t]=e.cb;else for(t=B[t];t;){if(t.cb===e){t.cb=e.cb;break}t=t.cb}}function U(e,t){var n=W(e.mode)?(n=Ve(e,`x`))?n:e.La.lookup?0:2:54;if(n)throw new V(n);for(n=B[Re(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 Be(e,t,n,r){return e=new Ie(e,t,n,r),t=Re(e.parent.id,e.name),e.cb=B[t],B[t]=e}function W(e){return(e&61440)==16384}function Ve(e,t){return Pe?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(!W(e.mode))return 54;try{return U(e,t),20}catch{}return Ve(e,`wx`)}function Ue(e,t,n){try{var r=U(e,t)}catch(e){return e.Pa}if(e=Ve(e,`wx`))return e;if(n){if(!W(r.mode))return 54;if(r===r.parent||Le(r)===`/`)return 10}else if(W(r.mode))return 31;return 0}function We(e){if(!e)throw new V(63);return e}function G(e){if(e=z[e],!e)throw new V(8);return e}function Ge(e,t=-1){if(e=Object.assign(new Fe,e),t==-1)a:{for(t=0;4096>=t;t++)if(!z[t])break a;throw new V(33)}return e.fd=t,z[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 V(70)}};function Ye(e,t){je[e]={Ma:t}}function Xe(e,t){var n=t===`/`;if(n&&Ae)throw new V(10);if(!n&&t){var r=H(t,{pb:!1});if(t=r.path,r=r.node,r.bb)throw new V(10);if(!W(r.mode))throw new V(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=H(e,{parent:!0}).node;if(e=ve(e),!e)throw new V(28);if(e===`.`||e===`..`)throw new V(20);var i=He(r,e);if(i)throw new V(i);if(!r.La.ib)throw new V(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 V(44);var n=H(t,{parent:!0}).node;if(!n)throw new V(44);t=ve(t);var r=He(n,t);if(r)throw new V(r);if(!n.La.symlink)throw new V(63);n.La.symlink(n,t,e)}function tt(e){var t=H(e,{parent:!0}).node;e=ve(e);var n=U(t,e),r=Ue(t,e,!0);if(r)throw new V(r);if(!t.La.rmdir)throw new V(63);if(n.bb)throw new V(10);t.La.rmdir(t,e),ze(n)}function nt(e){var t=H(e,{parent:!0}).node;if(!t)throw new V(44);e=ve(e);var n=U(t,e),r=Ue(t,e,!1);if(r)throw new V(r);if(!t.La.unlink)throw new V(63);if(n.bb)throw new V(10);t.La.unlink(t,e),ze(n)}function rt(e,t){return e=H(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`?H(e,{ab:!0}).node:e,it(null,e,t)}function ot(e,t,n){if(W(t.mode))throw new V(31);if((t.mode&61440)!=32768)throw new V(28);var r=Ve(t,`w`);if(r)throw new V(r);qe(e,t,{size:n,timestamp:Date.now()})}function st(e,t,n=438){if(e===``)throw new V(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=H(e,{ab:!(t&131072),Wb:!0});r=a.node,e=a.path}if(a=!1,t&64)if(r){if(t&128)throw new V(20)}else{if(i)throw new V(31);r=Ze(e,n|511,0),a=!0}if(!r)throw new V(44);if((r.mode&61440)==8192&&(t&=-513),t&65536&&!W(r.mode))throw new V(54);if(!a&&(r?(r.mode&61440)==40960?i=32:(i=[`r`,`w`,`rw`][t&3],t&512&&(i+=`w`),i=W(r.mode)&&(i!==`r`||t&576)?31:Ve(r,i)):i=44,i))throw new V(i);return t&512&&!a&&(i=r,i=typeof i==`string`?H(i,{ab:!0}).node:i,ot(null,i,0)),t=Ge({node:r,path:Le(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 V(8);e.rb&&=null;try{e.Ma.close&&e.Ma.close(e)}catch(e){throw e}finally{z[e.fd]=null}e.fd=null}function lt(e,t,n){if(e.fd===null)throw new V(8);if(!e.seekable||!e.Ma.Va)throw new V(70);if(n!=0&&n!=1&&n!=2)throw new V(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 V(28);if(e.fd===null||(e.flags&2097155)==1)throw new V(8);if(W(e.node.mode))throw new V(31);if(!e.Ma.read)throw new V(28);var a=i!==void 0;if(!a)i=e.position;else if(!e.seekable)throw new V(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 V(28);if(e.fd===null||!(e.flags&2097155))throw new V(8);if(W(e.node.mode))throw new V(31);if(!e.Ma.write)throw new V(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 V(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 V(29)}if(s===void 0&&a===0)throw new V(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 V(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 V(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=>{ee=e,pe||0<gt||(s.onExit?.(e),x=!0),f(e,new ce(e))},xt=e=>{if(!x)try{e()}catch(e){e instanceof ce||e==`unwind`||f(1,e)}finally{if(!(pe||0<gt))try{ee=e=ee,bt(e)}catch(e){e instanceof ce||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(B=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=Be(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(z.entries()).filter(([,e])=>e).map(([e])=>e.toString())}},t}},`/proc/self/fd`)})(),s.noExitRuntime&&(pe=s.noExitRuntime),s.print&&(v=s.print),s.printErr&&(y=s.printErr),s.wasmBinary&&(b=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=H(t,{ab:!0}).node;return r?(e=``,n&4&&(e+=`r`),n&2&&(e+=`w`),n&1&&(e+=`x`),e&&Ve(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(;z[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 V(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=H(t).node;if(!i)throw new V(44);if(!i.La.readlink)throw new V(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=H(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:()=>{pe=!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 V(2);if(!s.Ma.jb)throw new V(43);if(!e)throw new V(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 V(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:W(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,!x){if(!s.noFSInit&&!Ne){var e,t;Ne=!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(),Pe=!1,s.onRuntimeInitialized?.(),s.postRun)for(typeof s.postRun==`function`&&(s.postRun=[s.postRun]);s.postRun.length;){var n=s.postRun.shift();ue.push(n)}le(ue)}}if(0<A)j=Bt;else{if(s.preRun)for(typeof s.preRun==`function`&&(s.preRun=[s.preRun]);s.preRun.length;)fe();le(de),0<A?j=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(),A--,s.monitorRunDependencies?.(A),A==0&&j&&(e=j,j=null,e()),Vt}A++,s.monitorRunDependencies?.(A);var t={a:zt};return s.instantiateWasm?new Promise(n=>{s.instantiateWasm(t,(t,r)=>{n(e(t,r))})}):(ie??=s.locateFile?s.locateFile(`sql-wasm.wasm`,m):m+`sql-wasm.wasm`,e((await se(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 y(e,t,n){switch(n.mode){case`list`:return x(e,t,n);case`csv`:return ee(e,t,n);case`json`:return T(e,t);case`line`:return E(e,t,n);case`column`:return D(e,t,n);case`table`:return te(e,t,n);case`markdown`:return ne(e,t,n);case`tabs`:return O(e,t,n);case`box`:return re(e,t,n);case`quote`:return k(e,t,n);case`html`:return ie(e,t,n);case`ascii`:return oe(e,t,n)}}function b(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 x(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=>b(e,n.nullValue)).join(n.separator));return r.length>0?`${r.join(n.newline)}${n.newline}`:``}function ee(e,t,n){let r=[];n.header&&e.length>0&&r.push(e.map(S).join(`,`));for(let e of t)r.push(e.map(e=>S(b(e,n.nullValue))).join(`,`));return r.length>0?`${r.join(`
|
|
3
|
+
`)}
|
|
4
|
+
`:``}function S(e){return e.includes(`,`)||e.includes(`"`)||e.includes(`'`)||e.includes(`
|
|
5
|
+
`)?`"${e.replace(/"/g,`""`)}"`:e}function C(e){return e.toPrecision(17).replace(/\.?0+$/,``)}function w(e){return e===null?`null`:typeof e==`number`?Number.isInteger(e)?String(e):C(e):JSON.stringify(e)}function T(e,t){return t.length===0?``:`[${t.map(t=>`{${e.map((e,n)=>`${JSON.stringify(e)}:${w(t[n])}`).join(`,`)}}`).join(`,
|
|
6
|
+
`)}]
|
|
7
|
+
`}function E(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} = ${b(a[t],n.nullValue)}`)}return`${i.join(`
|
|
8
|
+
`)}
|
|
9
|
+
`}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=b(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)=>b(e,n.nullValue).padEnd(r[t])).join(` `));return i.length>0?`${i.join(`
|
|
10
|
+
`)}
|
|
11
|
+
`:``}function te(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=b(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)=>b(e,n.nullValue).padEnd(r[t])).join(` | `)} |`);return i.push(a),`${i.join(`
|
|
12
|
+
`)}
|
|
13
|
+
`}function ne(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=>b(e,n.nullValue)).join(` | `)} |`);return r.length>0?`${r.join(`
|
|
14
|
+
`)}
|
|
15
|
+
`:``}function O(e,t,n){let r=[];n.header&&e.length>0&&r.push(e.join(` `));for(let e of t)r.push(e.map(e=>b(e,n.nullValue)).join(` `));return r.length>0?`${r.join(n.newline)}${n.newline}`:``}function re(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=b(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)=>b(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 k(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):C(e):`'${String(e)}'`).join(`,`));return r.length>0?`${r.join(n.newline)}${n.newline}`:``}function ie(e,t,n){let r=[];n.header&&e.length>0&&(r.push(`<TR>${e.map(e=>`<TH>${ae(e)}</TH>`).join(``)}`),r.push(`</TR>`));for(let e of t)r.push(`<TR>${e.map(e=>`<TD>${ae(b(e,n.nullValue))}</TD>`).join(``)}`),r.push(`</TR>`);return r.length>0?`${r.join(`
|
|
18
|
+
`)}
|
|
19
|
+
`:``}function ae(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function oe(e,t,n){let r=[];n.header&&e.length>0&&r.push(e.join(``));for(let e of t)r.push(e.map(e=>b(e,n.nullValue)).join(``));return r.length>0?r.join(``)+``:``}var se=5e3,ce={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 le(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 ue(){let e=new(await(r.runTrustedAsync(()=>(0,v.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 de(e=d(m(import.meta.url))){let t=[f(e,`sqlite3-worker.js`),f(e,`../../commands/sqlite3/worker.js`)];(e.endsWith(`${p}commands${p}sqlite3`)||e.endsWith(`/commands/sqlite3`))&&t.push(f(e,`worker.js`)),t.push(f(e,`../../../dist/commands/sqlite3/worker.js`));for(let e of t)if(h(e))return e;throw Error(`sqlite3 worker not found. Run 'pnpm build' to compile the worker.`)}var fe={createWorker(e,t){return new _(e,{workerData:t})},findWorkerPath:de};function A(){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=de();return await new Promise((l,u)=>{let d=r.runTrusted(()=>fe.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 pe={name:`sqlite3`,async execute(e,t){if(u(e)||e.includes(`-help`))return l(ce);let n=le(e);if(`exitCode`in n)return n;let{options:r,database:i,sql:a,showVersion:o}=n;if(o)return{stdout:`${await ue()}
|
|
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??se,g={protocolToken:A(),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},b=``;r.echo&&(b+=`${d}
|
|
33
|
+
`);let x=!1;for(let e of _.results)if(e.type===`error`){if(r.bail)return{stdout:b,stderr:`Error: ${e.error}
|
|
34
|
+
`,exitCode:1};b+=`Error: ${e.error}
|
|
35
|
+
`,x=!0}else e.columns&&e.rows&&(e.rows.length>0||r.header)&&(b+=y(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:b,stderr:`sqlite3: failed to write database: ${t}
|
|
36
|
+
`,exitCode:1}}return{stdout:b,stderr:``,exitCode:x&&r.bail?1:0}}},N={name:`sqlite3`,flags:[],needsArgs:!0};export{fe as n,N as r,pe as t};
|
|
37
|
+
//# sourceMappingURL=chunk-XKWWSDBF-XuPgN5BP.mjs.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{t as e}from"./chunk-
|
|
1
|
+
import{t as e}from"./chunk-B74TABJS-DlbqoTuk.mjs";import{t}from"./chunk-IPJHKYVM-DlQCOz2c.mjs";import{n,r,t as i}from"./chunk-74CEPOFO-V0JXh91S.mjs";import{s as a}from"./chunk-7TSDKFEO-CMVuiOdP.mjs";import{n as o,r as s,t as c}from"./chunk-2TRDZQLB-C2G-sahM.mjs";import{gunzipSync as l}from"node:zlib";var u=a({js:{extensions:[`.js`,`.mjs`,`.cjs`,`.jsx`],globs:[]},ts:{extensions:[`.ts`,`.tsx`,`.mts`,`.cts`],globs:[]},html:{extensions:[`.html`,`.htm`,`.xhtml`],globs:[]},css:{extensions:[`.css`,`.scss`,`.sass`,`.less`],globs:[]},json:{extensions:[`.json`,`.jsonc`,`.json5`],globs:[]},xml:{extensions:[`.xml`,`.xsl`,`.xslt`],globs:[]},c:{extensions:[`.c`,`.h`],globs:[]},cpp:{extensions:[`.cpp`,`.cc`,`.cxx`,`.hpp`,`.hh`,`.hxx`,`.h`],globs:[]},rust:{extensions:[`.rs`],globs:[]},go:{extensions:[`.go`],globs:[]},zig:{extensions:[`.zig`],globs:[]},java:{extensions:[`.java`],globs:[]},kotlin:{extensions:[`.kt`,`.kts`],globs:[]},scala:{extensions:[`.scala`,`.sc`],globs:[]},clojure:{extensions:[`.clj`,`.cljc`,`.cljs`,`.edn`],globs:[]},py:{extensions:[`.py`,`.pyi`,`.pyw`],globs:[]},rb:{extensions:[`.rb`,`.rake`,`.gemspec`],globs:[`Rakefile`,`Gemfile`]},php:{extensions:[`.php`,`.phtml`,`.php3`,`.php4`,`.php5`],globs:[]},perl:{extensions:[`.pl`,`.pm`,`.pod`,`.t`],globs:[]},lua:{extensions:[`.lua`],globs:[]},sh:{extensions:[`.sh`,`.bash`,`.zsh`,`.fish`],globs:[`.bashrc`,`.zshrc`,`.profile`]},bat:{extensions:[`.bat`,`.cmd`],globs:[]},ps:{extensions:[`.ps1`,`.psm1`,`.psd1`],globs:[]},yaml:{extensions:[`.yaml`,`.yml`],globs:[]},toml:{extensions:[`.toml`],globs:[`Cargo.toml`,`pyproject.toml`]},ini:{extensions:[`.ini`,`.cfg`,`.conf`],globs:[]},csv:{extensions:[`.csv`,`.tsv`],globs:[]},md:{extensions:[`.md`,`.mdx`,`.markdown`,`.mdown`,`.mkd`],globs:[]},markdown:{extensions:[`.md`,`.mdx`,`.markdown`,`.mdown`,`.mkd`],globs:[]},rst:{extensions:[`.rst`],globs:[]},txt:{extensions:[`.txt`,`.text`],globs:[]},tex:{extensions:[`.tex`,`.ltx`,`.sty`,`.cls`],globs:[]},sql:{extensions:[`.sql`],globs:[]},graphql:{extensions:[`.graphql`,`.gql`],globs:[]},proto:{extensions:[`.proto`],globs:[]},make:{extensions:[`.mk`,`.mak`],globs:[`Makefile`,`GNUmakefile`,`makefile`]},docker:{extensions:[],globs:[`Dockerfile`,`Dockerfile.*`,`*.dockerfile`]},tf:{extensions:[`.tf`,`.tfvars`],globs:[]}}),d=class{types;constructor(){this.types=new Map(Object.entries(u).map(([e,t])=>[e,{extensions:[...t.extensions],globs:[...t.globs]}]))}addType(e){let t=e.indexOf(`:`);if(t===-1)return;let n=e.slice(0,t),r=e.slice(t+1);if(r.startsWith(`include:`)){let e=r.slice(8),t=this.types.get(e);if(t){let e=this.types.get(n)||{extensions:[],globs:[]};e.extensions.push(...t.extensions),e.globs.push(...t.globs),this.types.set(n,e)}}else{let e=this.types.get(n)||{extensions:[],globs:[]};if(r.startsWith(`*.`)&&!r.slice(2).includes(`*`)){let t=r.slice(1);e.extensions.includes(t)||e.extensions.push(t)}else e.globs.includes(r)||e.globs.push(r);this.types.set(n,e)}}clearType(e){let t=this.types.get(e);t&&(t.extensions=[],t.globs=[])}getType(e){return this.types.get(e)}getAllTypes(){return this.types}matchesType(t,n){let r=t.toLowerCase();for(let i of n){if(i===`all`){if(this.matchesAnyType(t))return!0;continue}let n=this.types.get(i);if(n){for(let e of n.extensions)if(r.endsWith(e))return!0;for(let i of n.globs)if(i.includes(`*`)){if(e(`^${i.replace(/\./g,`\\.`).replace(/\*/g,`.*`)}$`,`i`).test(t))return!0}else if(r===i.toLowerCase())return!0}}return!1}matchesAnyType(t){let n=t.toLowerCase();for(let r of this.types.values()){for(let e of r.extensions)if(n.endsWith(e))return!0;for(let i of r.globs)if(i.includes(`*`)){if(e(`^${i.replace(/\./g,`\\.`).replace(/\*/g,`.*`)}$`,`i`).test(t))return!0}else if(n===i.toLowerCase())return!0}return!1}};function f(){let e=[];for(let[t,n]of Object.entries(u).sort()){let r=[];for(let e of n.extensions)r.push(`*${e}`);for(let e of n.globs)r.push(e);e.push(`${t}: ${r.join(`, `)}`)}return`${e.join(`
|
|
2
2
|
`)}
|
|
3
3
|
`}function p(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:`--`,quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:`path`,json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function m(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let n=parseInt(t[1],10);switch((t[2]||``).toUpperCase()){case`K`:return n*1024;case`M`:return n*1024*1024;case`G`:return n*1024*1024*1024;default:return n}}function h(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:``,stderr:`rg: invalid --max-filesize value: ${e}
|
|
4
|
-
`,exitCode:1}}function g(e){return null}var _=[{short:`g`,long:`glob`,target:`globs`,multi:!0},{long:`iglob`,target:`iglobs`,multi:!0},{short:`t`,long:`type`,target:`types`,multi:!0,validate:g},{short:`T`,long:`type-not`,target:`typesNot`,multi:!0,validate:g},{long:`type-add`,target:`typeAdd`,multi:!0},{long:`type-clear`,target:`typeClear`,multi:!0},{short:`m`,long:`max-count`,target:`maxCount`,parse:parseInt},{short:`e`,long:`regexp`,target:`patterns`,multi:!0},{short:`f`,long:`file`,target:`patternFiles`,multi:!0},{short:`r`,long:`replace`,target:`replace`},{short:`d`,long:`max-depth`,target:`maxDepth`,parse:parseInt},{long:`max-filesize`,target:`maxFilesize`,parse:m,validate:h},{long:`context-separator`,target:`contextSeparator`},{short:`j`,long:`threads`,
|
|
4
|
+
`,exitCode:1}}function g(e){return null}var _=[{short:`g`,long:`glob`,target:`globs`,multi:!0},{long:`iglob`,target:`iglobs`,multi:!0},{short:`t`,long:`type`,target:`types`,multi:!0,validate:g},{short:`T`,long:`type-not`,target:`typesNot`,multi:!0,validate:g},{long:`type-add`,target:`typeAdd`,multi:!0},{long:`type-clear`,target:`typeClear`,multi:!0},{short:`m`,long:`max-count`,target:`maxCount`,parse:parseInt},{short:`e`,long:`regexp`,target:`patterns`,multi:!0},{short:`f`,long:`file`,target:`patternFiles`,multi:!0},{short:`r`,long:`replace`,target:`replace`},{short:`d`,long:`max-depth`,target:`maxDepth`,parse:parseInt},{long:`max-filesize`,target:`maxFilesize`,parse:m,validate:h},{long:`context-separator`,target:`contextSeparator`},{short:`j`,long:`threads`,ignored:!0},{long:`ignore-file`,target:`ignoreFiles`,multi:!0},{long:`pre`,target:`preprocessor`},{long:`pre-glob`,target:`preprocessorGlobs`,multi:!0}],v=new Map([[`i`,e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],[`--ignore-case`,e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],[`s`,e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],[`--case-sensitive`,e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],[`S`,e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],[`--smart-case`,e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],[`F`,e=>{e.fixedStrings=!0}],[`--fixed-strings`,e=>{e.fixedStrings=!0}],[`w`,e=>{e.wordRegexp=!0}],[`--word-regexp`,e=>{e.wordRegexp=!0}],[`x`,e=>{e.lineRegexp=!0}],[`--line-regexp`,e=>{e.lineRegexp=!0}],[`v`,e=>{e.invertMatch=!0}],[`--invert-match`,e=>{e.invertMatch=!0}],[`U`,e=>{e.multiline=!0}],[`--multiline`,e=>{e.multiline=!0}],[`--multiline-dotall`,e=>{e.multilineDotall=!0,e.multiline=!0}],[`c`,e=>{e.count=!0}],[`--count`,e=>{e.count=!0}],[`--count-matches`,e=>{e.countMatches=!0}],[`l`,e=>{e.filesWithMatches=!0}],[`--files`,e=>{e.files=!0}],[`--files-with-matches`,e=>{e.filesWithMatches=!0}],[`--files-without-match`,e=>{e.filesWithoutMatch=!0}],[`--stats`,e=>{e.stats=!0}],[`o`,e=>{e.onlyMatching=!0}],[`--only-matching`,e=>{e.onlyMatching=!0}],[`q`,e=>{e.quiet=!0}],[`--quiet`,e=>{e.quiet=!0}],[`N`,e=>{e.lineNumber=!1}],[`--no-line-number`,e=>{e.lineNumber=!1}],[`H`,e=>{e.withFilename=!0}],[`--with-filename`,e=>{e.withFilename=!0}],[`I`,e=>{e.noFilename=!0}],[`--no-filename`,e=>{e.noFilename=!0}],[`0`,e=>{e.nullSeparator=!0}],[`--null`,e=>{e.nullSeparator=!0}],[`b`,e=>{e.byteOffset=!0}],[`--byte-offset`,e=>{e.byteOffset=!0}],[`--column`,e=>{e.column=!0,e.lineNumber=!0}],[`--no-column`,e=>{e.column=!1}],[`--vimgrep`,e=>{e.vimgrep=!0,e.column=!0,e.lineNumber=!0}],[`--json`,e=>{e.json=!0}],[`--hidden`,e=>{e.hidden=!0}],[`--no-ignore`,e=>{e.noIgnore=!0}],[`--no-ignore-dot`,e=>{e.noIgnoreDot=!0}],[`--no-ignore-vcs`,e=>{e.noIgnoreVcs=!0}],[`L`,e=>{e.followSymlinks=!0}],[`--follow`,e=>{e.followSymlinks=!0}],[`z`,e=>{e.searchZip=!0}],[`--search-zip`,e=>{e.searchZip=!0}],[`a`,e=>{e.searchBinary=!0}],[`--text`,e=>{e.searchBinary=!0}],[`--heading`,e=>{e.heading=!0}],[`--passthru`,e=>{e.passthru=!0}],[`--include-zero`,e=>{e.includeZero=!0}],[`--glob-case-insensitive`,e=>{e.globCaseInsensitive=!0}]]),y=new Set([`n`,`--line-number`]);function b(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function x(e,t,n){let r=e[t];for(let i of _){if(r.startsWith(`--${i.long}=`)){let e=C(n,i,r.slice(`--${i.long}=`.length));return e?{newIndex:t,error:e}:{newIndex:t}}if(i.short&&r.startsWith(`-${i.short}`)&&r.length>2){let e=C(n,i,r.slice(2));return e?{newIndex:t,error:e}:{newIndex:t}}if(i.short&&r===`-${i.short}`||r===`--${i.long}`){if(t+1>=e.length)return null;let r=e[t+1],a=C(n,i,r);return a?{newIndex:t+1,error:a}:{newIndex:t+1}}}return null}function S(e){return _.find(t=>t.short===e)}function C(e,t,n){if(t.validate){let e=t.validate(n);if(e)return e}if(t.ignored||!t.target)return;let r=t.parse?t.parse(n):n;t.multi?e[t.target].push(r):e[t.target]=r}function w(e,t){let n=e[t];if(n===`--sort`&&t+1<e.length){let n=e[t+1];if(n===`path`||n===`none`)return{value:n,newIndex:t+1}}if(n.startsWith(`--sort=`)){let e=n.slice(7);if(e===`path`||e===`none`)return{value:e,newIndex:t}}return null}function T(e,t){let n=e[t],r=n.match(/^-([ABC])(\d+)$/);return r?{flag:r[1],value:parseInt(r[2],10),newIndex:t}:(n===`-A`||n===`-B`||n===`-C`)&&t+1<e.length?{flag:n[1],value:parseInt(e[t+1],10),newIndex:t+1}:null}function E(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function D(e){let t=p(),r=null,i=[],a=-1,o=-1,s=-1,c=!1;for(let l=0;l<e.length;l++){let u=e[l];if(u.startsWith(`-`)&&u!==`-`){let r=T(e,l);if(r){let{flag:e,value:t,newIndex:n}=r;e===`A`?a=Math.max(a,t):e===`B`?o=Math.max(o,t):s=t,l=n;continue}let i=E(u);if(i!==null){t.maxCount=i;continue}let d=x(e,l,t);if(d){if(d.error)return{success:!1,error:d.error};l=d.newIndex;continue}let f=w(e,l);if(f){t.sort=f.value,l=f.newIndex;continue}let p=u.startsWith(`--`)?[u]:u.slice(1).split(``);for(let r of p){if(y.has(r)){t.lineNumber=!0,c=!0;continue}if(r===`u`||r===`--unrestricted`){b(t);continue}if(r===`P`||r===`--pcre2`)return{success:!1,error:{stdout:``,stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.
|
|
5
5
|
`,exitCode:1}};if(r.length===1){let i=S(r);if(i){if(l+1>=e.length)return{success:!1,error:n(`rg`,`-${r}`)};let a=C(t,i,e[l+1]);if(a)return{success:!1,error:a};l++;continue}}let i=v.get(r);if(i){i(t);continue}if(r.startsWith(`--`))return{success:!1,error:n(`rg`,r)};if(r.length===1)return{success:!1,error:n(`rg`,`-${r}`)}}}else r===null&&t.patterns.length===0&&t.patternFiles.length===0?r=u:i.push(u)}return(a>=0||s>=0)&&(t.afterContext=Math.max(a>=0?a:0,s>=0?s:0)),(o>=0||s>=0)&&(t.beforeContext=Math.max(o>=0?o:0,s>=0?s:0)),r!==null&&t.patterns.push(r),(t.column||t.vimgrep)&&(c=!0),{success:!0,options:t,paths:i,explicitLineNumbers:c}}var O=class{patterns=[];basePath;constructor(e=`/`){this.basePath=e}parse(e){let t=e.split(`
|
|
6
6
|
`);for(let e of t){let t=e.replace(/\s+$/,``);if(!t||t.startsWith(`#`))continue;let n=!1;t.startsWith(`!`)&&(n=!0,t=t.slice(1));let r=!1;t.endsWith(`/`)&&(r=!0,t=t.slice(0,-1));let i=!1;t.startsWith(`/`)?(i=!0,t=t.slice(1)):t.includes(`/`)&&!t.startsWith(`**/`)&&(i=!0);let a=this.patternToRegex(t,i);this.patterns.push({pattern:e,regex:a,negated:n,directoryOnly:r,rooted:i})}}patternToRegex(t,n){let r=``;r=n?`^`:`(?:^|/)`;let i=0;for(;i<t.length;){let e=t[i];if(e===`*`)t[i+1]===`*`?t[i+2]===`/`?(r+=`(?:.*/)?`,i+=3):(i+2,t.length,r+=`.*`,i+=2):(r+=`[^/]*`,i++);else if(e===`?`)r+=`[^/]`,i++;else if(e===`[`){let e=i+1;for(e<t.length&&t[e]===`!`&&e++,e<t.length&&t[e]===`]`&&e++;e<t.length&&t[e]!==`]`;)e++;if(e<t.length){let n=t.slice(i,e+1);n.startsWith(`[!`)&&(n=`[^${n.slice(2)}`),r+=n,i=e+1}else r+=`\\[`,i++}else e===`/`?(r+=`/`,i++):(r+=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i++)}return r+=`(?:/.*)?$`,e(r)}matches(e,t){let n=e.replace(/^\.\//,``);n=n.replace(/^\//,``);let r=!1;for(let e of this.patterns)e.directoryOnly&&!t||e.regex.test(n)&&(r=!e.negated);return r}isWhitelisted(e,t){let n=e.replace(/^\.\//,``);n=n.replace(/^\//,``);for(let e of this.patterns)if(!(e.directoryOnly&&!t)&&e.negated&&e.regex.test(n))return!0;return!1}getBasePath(){return this.basePath}},k=class{parsers=[];fs;skipDotIgnore;skipVcsIgnore;loadedDirs=new Set;constructor(e,t,n=!1,r=!1){this.fs=e,this.skipDotIgnore=n,this.skipVcsIgnore=r}async load(e){let t=[],n=e;for(;;){t.unshift(n);let e=this.fs.resolvePath(n,`..`);if(e===n)break;n=e}let r=[];this.skipVcsIgnore||r.push(`.gitignore`),this.skipDotIgnore||r.push(`.rgignore`,`.ignore`);for(let e of t){this.loadedDirs.add(e);for(let t of r){let n=this.fs.resolvePath(e,t);try{let t=await this.fs.readFile(n),r=new O(e);r.parse(t),this.parsers.push(r)}catch{}}}}async loadForDirectory(e){if(this.loadedDirs.has(e))return;this.loadedDirs.add(e);let t=[];this.skipVcsIgnore||t.push(`.gitignore`),this.skipDotIgnore||t.push(`.rgignore`,`.ignore`);for(let n of t){let t=this.fs.resolvePath(e,n);try{let n=await this.fs.readFile(t),r=new O(e);r.parse(n),this.parsers.push(r)}catch{}}}addPatternsFromContent(e,t){let n=new O(t);n.parse(e),this.parsers.push(n)}matches(e,t){for(let n of this.parsers){let r=n.getBasePath();if(!e.startsWith(r))continue;let i=e.slice(r.length).replace(/^\//,``);if(n.matches(i,t))return!0}return!1}isWhitelisted(e,t){for(let n of this.parsers){let r=n.getBasePath();if(!e.startsWith(r))continue;let i=e.slice(r.length).replace(/^\//,``);if(n.isWhitelisted(i,t))return!0}return!1}static isCommonIgnored(e){return new Set([`node_modules`,`.git`,`.svn`,`.hg`,`__pycache__`,`.pytest_cache`,`.mypy_cache`,`venv`,`.venv`,`.next`,`.nuxt`,`.cargo`]).has(e)}};async function A(e,t,n=!1,r=!1,i=[]){let a=new k(e,t,n,r);await a.load(t);for(let n of i)try{let r=e.resolvePath(t,n),i=await e.readFile(r);a.addPatternsFromContent(i,t)}catch{}return a}function j(e){return e.length>=2&&e[0]===31&&e[1]===139}function M(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r===`[`&&!t?t=!0:r===`]`&&t&&(t=!1)}return t?`rg: glob '${e}' has an unclosed character class`:null}async function N(e){let{ctx:t,options:n,paths:r,explicitLineNumbers:i}=e;for(let e of n.globs){let t=M(e.startsWith(`!`)?e.slice(1):e);if(t)return{stdout:``,stderr:`${t}
|
|
7
7
|
`,exitCode:1}}if(n.files)return B(t,[...n.patterns,...r],n);let a=[...n.patterns];for(let e of n.patternFiles)try{let n;if(e===`-`)n=t.stdin;else{let r=t.fs.resolvePath(t.cwd,e);n=await t.fs.readFile(r)}let r=n.split(`
|
|
8
8
|
`).filter(e=>e.length>0);a.push(...r)}catch{return{stdout:``,stderr:`rg: ${e}: No such file or directory
|
|
9
9
|
`,exitCode:2}}if(a.length===0)return n.patternFiles.length>0?{stdout:``,stderr:``,exitCode:1}:{stdout:``,stderr:`rg: no pattern given
|
|
10
10
|
`,exitCode:2};let o=r.length===0?[`.`]:r,s=P(n,a),c,l;try{let e=F(a,n,s);c=e.regex,l=e.kResetGroup}catch{return{stdout:``,stderr:`rg: invalid regex: ${a.join(`, `)}
|
|
11
|
-
`,exitCode:2}}let u=null;n.noIgnore||(u=await A(t.fs,t.cwd,n.noIgnoreDot,n.noIgnoreVcs,n.ignoreFiles));let f=new d;for(let e of n.typeClear)f.clearType(e);for(let e of n.typeAdd)f.addType(e);let{files:p,singleExplicitFile:m}=await I(t,o,n,u,f);if(p.length===0)return{stdout:``,stderr:``,exitCode:1};let h=!n.noFilename&&(n.withFilename||!m||p.length>1),g=n.lineNumber;return i||(m&&p.length===1&&(g=!1),n.onlyMatching&&(g=!1)),U(t,p,c,n,h,g,l)}function P(e,t){return e.caseSensitive?!1:e.ignoreCase?!0:e.smartCase?!t.some(e=>/[A-Z]/.test(e)):!1}function F(e,t,n){let r;return r=e.length===1?e[0]:e.map(e=>t.fixedStrings?e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`):`(?:${e})`).join(`|`),
|
|
12
|
-
`;return{stdout:a.map(e=>e+o).join(``),stderr:``,exitCode:0}}function V(e,t){if(t.length===0)return!0;for(let n of t)if(z(e,n,!1))return!0;return!1}async function H(e,n,r,i){try{if(i.preprocessor&&e.exec&&V(r.split(`/`).pop()||r,i.preprocessorGlobs)){let r=await e.exec(t([i.preprocessor]),{cwd:e.cwd,signal:e.signal,args:[n]});if(r.exitCode===0&&r.stdout){let e=r.stdout.slice(0,8192);return{content:r.stdout,isBinary:e.includes(`\0`)}}}if(i.searchZip&&r.endsWith(`.gz`)){let t=await e.fs.readFileBuffer(n);if(j(t))try{let e=l(t),n=new TextDecoder().decode(e);return{content:n,isBinary:n.slice(0,8192).includes(`\0`)}}catch{return null}}let a=await e.fs.readFile(n);return{content:a,isBinary:a.slice(0,8192).includes(`\0`)}}catch{return null}}async function U(e,t,n,r,i,a,
|
|
11
|
+
`,exitCode:2}}let u=null;n.noIgnore||(u=await A(t.fs,t.cwd,n.noIgnoreDot,n.noIgnoreVcs,n.ignoreFiles));let f=new d;for(let e of n.typeClear)f.clearType(e);for(let e of n.typeAdd)f.addType(e);let{files:p,singleExplicitFile:m}=await I(t,o,n,u,f);if(p.length===0)return{stdout:``,stderr:``,exitCode:1};let h=!n.noFilename&&(n.withFilename||!m||p.length>1),g=n.lineNumber;return i||(m&&p.length===1&&(g=!1),n.onlyMatching&&(g=!1)),U(t,p,c,n,h,g,l)}function P(e,t){return e.caseSensitive?!1:e.ignoreCase?!0:e.smartCase?!t.some(e=>/[A-Z]/.test(e)):!1}function F(e,t,n){let r;return r=e.length===1?e[0]:e.map(e=>t.fixedStrings?e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`):`(?:${e})`).join(`|`),c(r,{mode:t.fixedStrings&&e.length===1?`fixed`:`perl`,ignoreCase:n,wholeWord:t.wordRegexp,lineRegexp:t.lineRegexp,multiline:t.multiline,multilineDotall:t.multilineDotall})}async function I(e,t,n,r,i){let a=[],o=0,s=0;for(let c of t){let t=e.fs.resolvePath(e.cwd,c);try{let l=await e.fs.stat(t);if(l.isFile){if(o++,n.maxFilesize>0&&l.size>n.maxFilesize)continue;R(c,n,r,t,i)&&a.push(c)}else l.isDirectory&&(s++,await L(e,c,t,0,n,r,i,a))}catch{}}return{files:n.sort===`path`?a.sort():a,singleExplicitFile:o===1&&s===0}}async function L(e,t,n,r,i,a,o,s){if(!(r>=i.maxDepth)){a&&await a.loadForDirectory(n);try{let c=e.fs.readdirWithFileTypes?await e.fs.readdirWithFileTypes(n):(await e.fs.readdir(n)).map(e=>({name:e,isFile:void 0}));for(let l of c){let c=l.name;if(!i.noIgnore&&k.isCommonIgnored(c))continue;let u=c.startsWith(`.`),d=t===`.`?c:t===`./`?`./${c}`:t.endsWith(`/`)?`${t}${c}`:`${t}/${c}`,f=e.fs.resolvePath(n,c),p,m,h=!1;if(l.isFile!==void 0&&`isDirectory`in l){let t=l;if(h=t.isSymbolicLink===!0,h&&!i.followSymlinks)continue;if(h&&i.followSymlinks)try{let t=await e.fs.stat(f);p=t.isFile,m=t.isDirectory}catch{continue}else p=t.isFile,m=t.isDirectory}else try{let t=e.fs.lstat?await e.fs.lstat(f):await e.fs.stat(f);if(h=t.isSymbolicLink===!0,h&&!i.followSymlinks)continue;let n=h&&i.followSymlinks?await e.fs.stat(f):t;p=n.isFile,m=n.isDirectory}catch{continue}if(!a?.matches(f,m)&&!(u&&!i.hidden&&!a?.isWhitelisted(f,m))){if(m)await L(e,d,f,r+1,i,a,o,s);else if(p){if(i.maxFilesize>0)try{if((await e.fs.stat(f)).size>i.maxFilesize)continue}catch{continue}R(d,i,a,f,o)&&s.push(d)}}}}catch{}}}function R(e,t,n,r,i){let a=e.split(`/`).pop()||e;if(n?.matches(r,!1)||t.types.length>0&&!i.matchesType(a,t.types)||t.typesNot.length>0&&i.matchesType(a,t.typesNot))return!1;if(t.globs.length>0){let n=t.globCaseInsensitive,r=t.globs.filter(e=>!e.startsWith(`!`)),i=t.globs.filter(e=>e.startsWith(`!`)).map(e=>e.slice(1));if(r.length>0){let t=!1;for(let i of r)if(z(a,i,n)||z(e,i,n)){t=!0;break}if(!t)return!1}for(let t of i)if(t.startsWith(`/`)){if(z(e,t.slice(1),n))return!1}else if(z(a,t,n)||z(e,t,n))return!1}if(t.iglobs.length>0){let n=t.iglobs.filter(e=>!e.startsWith(`!`)),r=t.iglobs.filter(e=>e.startsWith(`!`)).map(e=>e.slice(1));if(n.length>0){let t=!1;for(let r of n)if(z(a,r,!0)||z(e,r,!0)){t=!0;break}if(!t)return!1}for(let t of r)if(t.startsWith(`/`)){if(z(e,t.slice(1),!0))return!1}else if(z(a,t,!0)||z(e,t,!0))return!1}return!0}function z(t,n,r=!1){let i=`^`;for(let e=0;e<n.length;e++){let t=n[e];if(t===`*`)n[e+1]===`*`?(i+=`.*`,e++):i+=`[^/]*`;else if(t===`?`)i+=`[^/]`;else if(t===`[`){let t=e+1;for(t<n.length&&n[t]===`!`&&t++,t<n.length&&n[t]===`]`&&t++;t<n.length&&n[t]!==`]`;)t++;if(t<n.length){let r=n.slice(e,t+1);r.startsWith(`[!`)&&(r=`[^${r.slice(2)}`),i+=r,e=t}else i+=`\\[`}else i+=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}return i+=`$`,e(i,r?`i`:``).test(t)}async function B(e,t,n){let r=null;n.noIgnore||(r=await A(e.fs,e.cwd,n.noIgnoreDot,n.noIgnoreVcs,n.ignoreFiles));let i=new d;for(let e of n.typeClear)i.clearType(e);for(let e of n.typeAdd)i.addType(e);let{files:a}=await I(e,t.length===0?[`.`]:t,n,r,i);if(a.length===0)return{stdout:``,stderr:``,exitCode:1};if(n.quiet)return{stdout:``,stderr:``,exitCode:0};let o=n.nullSeparator?`\0`:`
|
|
12
|
+
`;return{stdout:a.map(e=>e+o).join(``),stderr:``,exitCode:0}}function V(e,t){if(t.length===0)return!0;for(let n of t)if(z(e,n,!1))return!0;return!1}async function H(e,n,r,i){try{if(i.preprocessor&&e.exec&&V(r.split(`/`).pop()||r,i.preprocessorGlobs)){let r=await e.exec(t([i.preprocessor]),{cwd:e.cwd,signal:e.signal,args:[n]});if(r.exitCode===0&&r.stdout){let e=r.stdout.slice(0,8192);return{content:r.stdout,isBinary:e.includes(`\0`)}}}if(i.searchZip&&r.endsWith(`.gz`)){let t=await e.fs.readFileBuffer(n);if(j(t))try{let e=l(t),n=new TextDecoder().decode(e);return{content:n,isBinary:n.slice(0,8192).includes(`\0`)}}catch{return null}}let a=await e.fs.readFile(n);return{content:a,isBinary:a.slice(0,8192).includes(`\0`)}}catch{return null}}async function U(e,t,n,r,i,a,c){let l=``,u=!1,d=[],f=0,p=0,m=0;e:for(let h=0;h<t.length;h+=50){let g=t.slice(h,h+50),_=await Promise.all(g.map(async t=>{let l=await H(e,e.fs.resolvePath(e.cwd,t),t,r);if(!l)return null;let{content:u,isBinary:d}=l;if(m+=u.length,d&&!r.searchBinary)return null;let f=i&&!r.heading?t:``,p=o(u,n,{invertMatch:r.invertMatch,showLineNumbers:a,countOnly:r.count,countMatches:r.countMatches,filename:f,onlyMatching:r.onlyMatching,beforeContext:r.beforeContext,afterContext:r.afterContext,maxCount:r.maxCount,contextSeparator:r.contextSeparator,showColumn:r.column,vimgrep:r.vimgrep,showByteOffset:r.byteOffset,replace:r.replace===null?null:s(r.replace),passthru:r.passthru,multiline:r.multiline,kResetGroup:c});return r.json&&p.matched?{file:t,result:p,content:u,isBinary:!1}:{file:t,result:p}}));for(let e of _){if(!e)continue;let{file:t,result:i}=e;if(i.matched){if(u=!0,p++,f+=i.matchCount,r.quiet&&!r.json)break e;if(r.json&&!r.quiet){let a=e.content||``;d.push(JSON.stringify({type:`begin`,data:{path:{text:t}}}));let o=a.split(`
|
|
13
13
|
`);n.lastIndex=0;let s=0;for(let e=0;e<o.length;e++){let i=o[e];n.lastIndex=0;let a=[];for(let e=n.exec(i);e!==null;e=n.exec(i)){let t={match:{text:e[0]},start:e.index,end:e.index+e[0].length};r.replace!==null&&(t.replacement={text:r.replace}),a.push(t),e[0].length===0&&n.lastIndex++}if(a.length>0){let n={type:`match`,data:{path:{text:t},lines:{text:`${i}
|
|
14
14
|
`},line_number:e+1,absolute_offset:s,submatches:a}};d.push(JSON.stringify(n))}s+=i.length+1}d.push(JSON.stringify({type:`end`,data:{path:{text:t},binary_offset:null,stats:{elapsed:{secs:0,nanos:0,human:`0s`},searches:1,searches_with_match:1,bytes_searched:a.length,bytes_printed:0,matched_lines:i.matchCount,matches:i.matchCount}}}))}else if(r.filesWithMatches){let e=r.nullSeparator?`\0`:`
|
|
15
15
|
`;l+=`${t}${e}`}else r.filesWithoutMatch||(r.heading&&!r.noFilename&&(l+=`${t}
|
|
@@ -30,4 +30,4 @@ EXAMPLES:
|
|
|
30
30
|
rg -g '*.ts' foo Search files matching glob
|
|
31
31
|
rg --hidden foo Include hidden files
|
|
32
32
|
rg -l foo List files with matches only`,options:[`-e, --regexp PATTERN search for PATTERN (can be used multiple times)`,`-f, --file FILE read patterns from FILE, one per line`,`-i, --ignore-case case-insensitive search`,`-s, --case-sensitive case-sensitive search (overrides smart-case)`,`-S, --smart-case smart case (default: case-insensitive unless pattern has uppercase)`,`-F, --fixed-strings treat pattern as literal string`,`-w, --word-regexp match whole words only`,`-x, --line-regexp match whole lines only`,`-v, --invert-match select non-matching lines`,`-r, --replace TEXT replace matches with TEXT`,`-c, --count print count of matching lines per file`,` --count-matches print count of individual matches per file`,`-l, --files-with-matches print only file names with matches`,` --files-without-match print file names without matches`,` --files list files that would be searched`,`-o, --only-matching print only matching parts`,`-m, --max-count NUM stop after NUM matches per file`,`-q, --quiet suppress output, exit 0 on match`,` --stats print search statistics`,`-n, --line-number print line numbers (default: on)`,`-N, --no-line-number do not print line numbers`,`-I, --no-filename suppress the prefixing of file names`,`-0, --null use NUL as filename separator`,`-b, --byte-offset show byte offset of each match`,` --column show column number of first match`,` --vimgrep show results in vimgrep format`,` --json show results in JSON Lines format`,`-A NUM print NUM lines after each match`,`-B NUM print NUM lines before each match`,`-C NUM print NUM lines before and after each match`,` --context-separator SEP separator for context groups (default: --)`,`-U, --multiline match patterns across lines`,`-z, --search-zip search in compressed files (gzip only)`,`-g, --glob GLOB include files matching GLOB`,`-t, --type TYPE only search files of TYPE (e.g., js, py, ts)`,`-T, --type-not TYPE exclude files of TYPE`,`-L, --follow follow symbolic links`,`-u, --unrestricted reduce filtering (-u: no ignore, -uu: +hidden, -uuu: +binary)`,`-a, --text search binary files as text`,` --hidden search hidden files and directories`,` --no-ignore don't respect .gitignore/.ignore files`,`-d, --max-depth NUM maximum search depth`,` --sort TYPE sort files (path, none)`,` --heading show file path above matches`,` --passthru print all lines (non-matches use - separator)`,` --include-zero include files with 0 matches in count output`,` --type-list list all available file types`,` --help display this help and exit`]},G={name:`rg`,async execute(e,t){if(i(e))return r(W);if(e.includes(`--type-list`))return{stdout:f(),stderr:``,exitCode:0};let n=D(e);return n.success?N({ctx:t,options:n.options,paths:n.paths,explicitLineNumbers:n.explicitLineNumbers}):n.error}},K={name:`rg`,flags:[{flag:`-i`,type:`boolean`},{flag:`-s`,type:`boolean`},{flag:`-S`,type:`boolean`},{flag:`-F`,type:`boolean`},{flag:`-w`,type:`boolean`},{flag:`-x`,type:`boolean`},{flag:`-v`,type:`boolean`},{flag:`-c`,type:`boolean`},{flag:`-l`,type:`boolean`},{flag:`-o`,type:`boolean`},{flag:`-n`,type:`boolean`},{flag:`-N`,type:`boolean`},{flag:`--hidden`,type:`boolean`},{flag:`--no-ignore`,type:`boolean`},{flag:`-m`,type:`value`,valueHint:`number`},{flag:`-A`,type:`value`,valueHint:`number`},{flag:`-B`,type:`value`,valueHint:`number`},{flag:`-C`,type:`value`,valueHint:`number`},{flag:`-g`,type:`value`,valueHint:`pattern`},{flag:`-t`,type:`value`,valueHint:`string`},{flag:`-T`,type:`value`,valueHint:`string`}],needsArgs:!0};export{K as n,G as t};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-YMMW5UAP-uYgeXT56.mjs.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{i as e}from"./chunk-GFQRA5P5-DigWkxW2.mjs";import{n as t}from"./chunk-5QMZ5MUS-_0tQyQsf.mjs";import{r as n,t as r}from"./chunk-24IMIIXA-BoP5OA93.mjs";import{n as i}from"./chunk-3THT3N7L-CBWmNncQ.mjs";import{n as a,r as o,t as s}from"./chunk-74CEPOFO-V0JXh91S.mjs";import{n as c}from"./chunk-7L36YK2X-B3QRwLbB.mjs";import{t as l}from"./chunk-7TSDKFEO-CMVuiOdP.mjs";import{n as u,t as d}from"./chunk-KRBPSX3W-nYEMVABW.mjs";function f(e){switch(e){case`\b`:return`\\b`;case`\f`:return`\\f`;case`
|
|
2
|
+
`:return`\\n`;case`\r`:return`\\r`;case` `:return`\\t`;default:return`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`}}function p(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;i++){let a=e[i];if(r){t+=a,r=!1;continue}if(a===`\\`){t+=a,r=!0;continue}if(a===`"`){t+=a,n=!n;continue}if(n&&a.charCodeAt(0)<=31){t+=f(a);continue}t+=a}return t}function m(e,t,n){return JSON.parse(p(e.slice(t,n)))}function h(e){let t=[],n=0,r=e.length;for(;n<r;){for(;n<r&&/\s/.test(e[n]);)n++;if(n>=r)break;let i=n,a=e[n];if(a===`{`||a===`[`){let o=a,s=a===`{`?`}`:`]`,c=1,u=!1,d=!1;for(n++;n<r&&c>0;){let t=e[n];d?d=!1:t===`\\`?d=!0:t===`"`?u=!u:u||(t===o?c++:t===s&&c--),n++}if(c!==0)throw Error(`Unexpected end of JSON input at position ${n} (unclosed ${o})`);t.push(l(m(e,i,n)))}else if(a===`"`){let a=!1;for(n++;n<r;){let t=e[n];if(a)a=!1;else if(t===`\\`)a=!0;else if(t===`"`){n++;break}n++}t.push(l(m(e,i,n)))}else if(a===`-`||a>=`0`&&a<=`9`){for(;n<r&&/[\d.eE+-]/.test(e[n]);)n++;t.push(l(m(e,i,n)))}else if(e.slice(n,n+4)===`true`)t.push(!0),n+=4;else if(e.slice(n,n+5)===`false`)t.push(!1),n+=5;else if(e.slice(n,n+4)===`null`)t.push(null),n+=4;else{let t=e.slice(n,n+10);throw Error(`Invalid JSON at position ${i}: unexpected '${t.split(/\s/)[0]}'`)}}return t}var g={name:`jq`,summary:`command-line JSON processor`,usage:`jq [OPTIONS] FILTER [FILE]`,options:[`-r, --raw-output output strings without quotes`,`-c, --compact compact output (no pretty printing)`,`-e, --exit-status set exit status based on output`,`-s, --slurp read entire input into array`,`-n, --null-input don't read any input`,`-j, --join-output don't print newlines after each output`,`-a, --ascii force ASCII output`,`-S, --sort-keys sort object keys`,`-C, --color colorize output (ignored)`,`-M, --monochrome monochrome output (ignored)`,` --tab use tabs for indentation`,` --help display this help and exit`]};function _(e,t,n,r,i,a=0){if(e==null)return`null`;if(typeof e==`boolean`)return String(e);if(typeof e==`number`)return Number.isFinite(e)?String(e):`null`;if(typeof e==`string`)return n?e:JSON.stringify(e);let o=i?` `:` `;if(Array.isArray(e))return e.length===0?`[]`:t?`[${e.map(e=>_(e,!0,!1,r,i)).join(`,`)}]`:`[
|
|
3
|
+
${e.map(e=>o.repeat(a+1)+_(e,!1,!1,r,i,a+1)).join(`,
|
|
4
|
+
`)}
|
|
5
|
+
${o.repeat(a)}]`;if(typeof e==`object`){let n=Object.keys(e);return r&&(n=n.sort()),n.length===0?`{}`:t?`{${n.map(t=>`${JSON.stringify(t)}:${_(e[t],!0,!1,r,i)}`).join(`,`)}}`:`{
|
|
6
|
+
${n.map(t=>{let n=_(e[t],!1,!1,r,i,a+1);return`${o.repeat(a+1)}${JSON.stringify(t)}: ${n}`}).join(`,
|
|
7
|
+
`)}
|
|
8
|
+
${o.repeat(a)}}`}return String(e)}var v={name:`jq`,async execute(l,f){r(f.requireDefenseContext,`jq`,`execution entry`);let p=(e,t)=>n(f.requireDefenseContext,`jq`,e,t);if(s(l))return o(g);let m=!1,v=!1,y=!1,b=!1,x=!1,S=!1,C=!1,w=!1,T=`.`,E=!1,D=[];for(let e=0;e<l.length;e++){let t=l[e];if(t===`-r`||t===`--raw-output`)m=!0;else if(t===`-c`||t===`--compact-output`)v=!0;else if(t===`-e`||t===`--exit-status`)y=!0;else if(t===`-s`||t===`--slurp`)b=!0;else if(t===`-n`||t===`--null-input`)x=!0;else if(t===`-j`||t===`--join-output`)S=!0;else if(!(t===`-a`||t===`--ascii`)){if(t===`-S`||t===`--sort-keys`)C=!0;else if(!(t===`-C`||t===`--color`)&&!(t===`-M`||t===`--monochrome`))if(t===`--tab`)w=!0;else if(t===`-`)D.push(`-`);else{if(t.startsWith(`--`))return a(`jq`,t);if(t.startsWith(`-`)){for(let e of t.slice(1))if(e===`r`)m=!0;else if(e===`c`)v=!0;else if(e===`e`)y=!0;else if(e===`s`)b=!0;else if(e===`n`)x=!0;else if(e===`j`)S=!0;else if(e!==`a`){if(e===`S`)C=!0;else if(e!==`C`&&e!==`M`)return a(`jq`,`-${e}`)}}else E?D.push(t):(T=t,E=!0)}}}let O=[];if(!x)if(D.length===0||D.length===1&&D[0]===`-`)O.push({source:`stdin`,content:f.stdin});else{let e=await p(`file read`,()=>c(f,D,{cmdName:`jq`,stopOnError:!0}));if(e.exitCode!==0)return{stdout:``,stderr:e.stderr,exitCode:2};O=e.files.map(e=>({source:e.filename||`stdin`,content:e.content}))}try{let t=d(T),n=[],r={limits:f.limits?{maxIterations:f.limits.maxJqIterations}:void 0,env:f.env,coverage:f.coverage,requireDefenseContext:f.requireDefenseContext};if(x)n=u(null,t,r);else if(b){let e=[];for(let{content:t}of O){let n=t.trim();n&&e.push(...h(n))}n=u(e,t,r)}else for(let{content:e}of O){let i=e.trim();if(!i)continue;let a=h(i);for(let e of a)n.push(...u(e,t,r))}let i=n.map(e=>_(e,v,m,C,w)),a=S?``:`
|
|
9
|
+
`,o=i.join(a),s=f.limits?.maxStringLength;if(s!==void 0&&s>0&&o.length>s)throw new e(`jq: output size limit exceeded (${s} bytes)`,`string_length`);let c=y&&(n.length===0||n.every(e=>e==null||e===!1))?1:0;return{stdout:o?S?o:`${o}
|
|
10
|
+
`:``,stderr:``,exitCode:c}}catch(n){if(n instanceof t)throw n;if(n instanceof e)return{stdout:``,stderr:`jq: ${i(n.message)}
|
|
11
|
+
`,exitCode:e.EXIT_CODE};let r=i(n.message);return r.includes(`Unknown function`)?{stdout:``,stderr:`jq: error: ${r}
|
|
12
|
+
`,exitCode:3}:{stdout:``,stderr:`jq: parse error: ${r}
|
|
13
|
+
`,exitCode:5}}}},y={name:`jq`,flags:[{flag:`-r`,type:`boolean`},{flag:`-c`,type:`boolean`},{flag:`-e`,type:`boolean`},{flag:`-s`,type:`boolean`},{flag:`-n`,type:`boolean`},{flag:`-j`,type:`boolean`},{flag:`-S`,type:`boolean`},{flag:`--tab`,type:`boolean`}],stdinType:`json`,needsArgs:!0};export{v as n,y as t};
|
|
14
|
+
//# sourceMappingURL=chunk-YULBWSET-BYBVdNmi.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-
|
|
1
|
+
import{t as e}from"./chunk-B74TABJS-DlbqoTuk.mjs";import{i as t}from"./chunk-GFQRA5P5-DigWkxW2.mjs";import{n}from"./chunk-5QMZ5MUS-_0tQyQsf.mjs";import{r,t as i}from"./chunk-24IMIIXA-BoP5OA93.mjs";import{n as a}from"./chunk-3THT3N7L-CBWmNncQ.mjs";import{n as o,r as s,t as c}from"./chunk-74CEPOFO-V0JXh91S.mjs";var l=new Map([[`alnum`,`a-zA-Z0-9`],[`alpha`,`a-zA-Z`],[`ascii`,`\\x00-\\x7F`],[`blank`,` \\t`],[`cntrl`,`\\x00-\\x1F\\x7F`],[`digit`,`0-9`],[`graph`,`!-~`],[`lower`,`a-z`],[`print`,` -~`],[`punct`,"!-/:-@\\[-`{-~"],[`space`,` \\t\\n\\r\\f\\v`],[`upper`,`A-Z`],[`word`,`a-zA-Z0-9_`],[`xdigit`,`0-9A-Fa-f`]]);function u(e){let t=``,n=0,r=!1;for(;n<e.length;){if(e[n]===`[`&&!r){if(e[n+1]===`[`&&e[n+2]===`:`){let r=e.indexOf(`:]]`,n+3);if(r!==-1){let i=e.slice(n+3,r),a=l.get(i);if(a){t+=`[${a}]`,n=r+3;continue}}}if(e[n+1]===`^`&&e[n+2]===`[`&&e[n+3]===`:`){let r=e.indexOf(`:]]`,n+4);if(r!==-1){let i=e.slice(n+4,r),a=l.get(i);if(a){t+=`[^${a}]`,n=r+3;continue}}}t+=`[`,n++,r=!0,n<e.length&&e[n]===`^`&&(t+=`^`,n++),n<e.length&&e[n]===`]`&&(t+=`\\]`,n++);continue}if(r){if(e[n]===`]`){t+=`]`,n++,r=!1;continue}if(e[n]===`[`&&e[n+1]===`:`){let r=e.indexOf(`:]`,n+2);if(r!==-1){let i=e.slice(n+2,r),a=l.get(i);if(a){t+=a,n=r+2;continue}}}if(e[n]===`\\`&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}t+=e[n],n++;continue}if(e[n]===`\\`&&n+1<e.length){let r=e[n+1];if(r===`+`||r===`?`||r===`|`){t+=r,n+=2;continue}if(r===`(`||r===`)`){t+=r,n+=2;continue}if(r===`{`||r===`}`){t+=r,n+=2;continue}if(r===`t`){t+=` `,n+=2;continue}if(r===`n`){t+=`
|
|
2
2
|
`,n+=2;continue}if(r===`r`){t+=`\r`,n+=2;continue}t+=e[n]+r,n+=2;continue}if(e[n]===`+`||e[n]===`?`||e[n]===`|`||e[n]===`(`||e[n]===`)`){t+=`\\${e[n]}`,n++;continue}if(e[n]===`^`&&!(t===``||t.endsWith(`(`))){t+=`\\^`,n++;continue}if(e[n]===`$`){let r=n===e.length-1,i=n+2<e.length&&e[n+1]===`\\`&&e[n+2]===`)`;if(!r&&!i){t+=`\\$`,n++;continue}}t+=e[n],n++}return t}function d(e){let t=``,n=!1;for(let r=0;r<e.length;r++)e[r]===`[`&&!n?(n=!0,t+=`[`,r++,r<e.length&&e[r]===`^`&&(t+=`^`,r++),r<e.length&&e[r]===`]`&&(t+=`]`,r++),r--):e[r]===`]`&&n?(n=!1,t+=`]`):!n&&e[r]===`{`&&e[r+1]===`,`?(t+=`{0,`,r++):t+=e[r];return t}function f(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n],i=r.charCodeAt(0);r===`\\`?t+=`\\\\`:r===` `?t+=`\\t`:r===`
|
|
3
3
|
`?t+=`$
|
|
4
4
|
`:r===`\r`?t+=`\\r`:r===`\x07`?t+=`\\a`:r===`\b`?t+=`\\b`:r===`\f`?t+=`\\f`:r===`\v`?t+=`\\v`:i<32||i>=127?t+=`\\${i.toString(8).padStart(3,`0`)}`:t+=r}return`${t}$`}var p=1e4;function m(e,t,n){return{patternSpace:``,holdSpace:``,lineNumber:0,totalLines:e,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,errorMessage:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],nCommandOutput:[],restartCycle:!1,inDRestartedCycle:!1,currentFilename:t,pendingFileReads:[],pendingFileWrites:[],rangeStates:n||new Map,linesConsumedInCycle:0}}function h(e){return typeof e==`object`&&`first`in e&&`step`in e}function g(e){return typeof e==`object`&&`offset`in e}function _(t,n,r,i,a){if(t===`$`)return n===r;if(typeof t==`number`)return n===t;if(h(t)){let{first:e,step:r}=t;return r===0?n===e:(n-e)%r===0&&n>=e}if(typeof t==`object`&&`pattern`in t)try{let n=t.pattern;return n===``&&a?.lastPattern?n=a.lastPattern:n!==``&&a&&(a.lastPattern=n),e(d(u(n))).test(i)}catch{return!1}return!1}function v(e){let t=e=>e===void 0?`undefined`:e===`$`?`$`:typeof e==`number`?String(e):`pattern`in e?`/${e.pattern}/`:`first`in e?`${e.first}~${e.step}`:`unknown`;return`${t(e.start)},${t(e.end)}`}function y(e,t,n,r,i,a){if(!e||!e.start&&!e.end)return!0;let o=e.start,s=e.end;if(o!==void 0&&s===void 0)return _(o,t,n,r,a);if(o!==void 0&&s!==void 0){let c=typeof o==`object`&&`pattern`in o,l=typeof s==`object`&&`pattern`in s,u=g(s);if(u&&i){let c=v(e),l=i.get(c);return l||(l={active:!1},i.set(c,l)),l.active?(t>=(l.startLine||t)+s.offset&&(l.active=!1,i.set(c,l)),!0):_(o,t,n,r,a)?(l.active=!0,l.startLine=t,i.set(c,l),s.offset===0&&(l.active=!1,i.set(c,l)),!0):!1}if(!c&&!l&&!u){let r=typeof o==`number`?o:o===`$`?n:1,a=typeof s==`number`?s:n;if(r<=a)return t>=r&&t<=a;if(i){let n=v(e),a=i.get(n);return a||(a={active:!1},i.set(n,a)),!a.completed&&t>=r?(a.completed=!0,i.set(n,a),!0):!1}return!1}if(i){let c=v(e),l=i.get(c);if(l||(l={active:!1},i.set(c,l)),l.active)return _(s,t,n,r,a)&&(l.active=!1,typeof o==`number`&&(l.completed=!0),i.set(c,l)),!0;{if(l.completed)return!1;let e=!1;return e=typeof o==`number`?t>=o:_(o,t,n,r,a),e?(l.active=!0,l.startLine=t,i.set(c,l),_(s,t,n,r,a)&&(l.active=!1,typeof o==`number`&&(l.completed=!0),i.set(c,l)),!0):!1}}return _(o,t,n,r,a)}return!0}function b(e,t,n,r,i,a){let o=y(e,t,n,r,i,a);return e?.negated?!o:o}function x(e,t,n,r){let i=``,a=0,o=!1;for(;a<=e.length;){t.lastIndex=a;let n=t.exec(e);if(!n){i+=e.slice(a);break}if(n.index!==a){i+=e.slice(a,n.index),a=n.index,o=!1;continue}let s=n[0],c=n.slice(1);if(o&&s.length===0){if(a<e.length)i+=e[a],a++;else break;o=!1;continue}if(i+=r(s,c),o=!1,s.length===0)if(a<e.length)i+=e[a],a++;else break;else a+=s.length,o=!0}return i}function S(e,t,n){let r=``,i=0;for(;i<e.length;){if(e[i]===`\\`&&i+1<e.length){let a=e[i+1];if(a===`&`){r+=`&`,i+=2;continue}if(a===`n`){r+=`
|
|
@@ -97,4 +97,4 @@ Addresses:
|
|
|
97
97
|
`),x+=r}try{let e=await u(`final processing`,()=>F(x,_,b,{limits:l.limits,filename:g.length===1?g[0]:void 0,fs:l.fs,cwd:l.cwd,coverage:l.coverage,requireDefenseContext:l.requireDefenseContext}));return{stdout:e.output,stderr:e.errorMessage?`${e.errorMessage}
|
|
98
98
|
`:``,exitCode:e.exitCode??0}}catch(e){if(e instanceof n)throw e;if(e instanceof t)return{stdout:``,stderr:`sed: ${a(e.message)}
|
|
99
99
|
`,exitCode:t.EXIT_CODE};throw e}}},L={name:`sed`,flags:[{flag:`-n`,type:`boolean`},{flag:`-i`,type:`boolean`},{flag:`-E`,type:`boolean`},{flag:`-r`,type:`boolean`},{flag:`-e`,type:`value`,valueHint:`string`}],stdinType:`text`,needsArgs:!0};export{L as n,I as t};
|
|
100
|
-
//# sourceMappingURL=chunk-
|
|
100
|
+
//# sourceMappingURL=chunk-ZZO3UDB3-CdVtmXn4.mjs.map
|