@qitqode/qitqode-android-arm64 0.1.24 → 0.1.25
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/bundle/{chunk-4kse3awh.js → chunk-0304b7xg.js} +1 -1
- package/bundle/{chunk-hqg5qbxk.js → chunk-08ba67f4.js} +1 -1
- package/bundle/chunk-0eneddjj.js +2 -0
- package/bundle/{chunk-6nhje520.js → chunk-0hsb4knd.js} +1 -1
- package/bundle/{chunk-bas6x25m.js → chunk-0jaxgrq0.js} +2 -2
- package/bundle/chunk-0ke6x10y.js +5 -0
- package/bundle/{chunk-hh4c02fh.js → chunk-0rmmg3g4.js} +1 -1
- package/bundle/chunk-0vqrakhw.js +3 -0
- package/bundle/{chunk-sgtgvzv6.js → chunk-0x7dbj5e.js} +1 -1
- package/bundle/{chunk-7yf15a3a.js → chunk-0xmx2zfg.js} +1 -1
- package/bundle/chunk-0yb4pxjv.js +2 -0
- package/bundle/chunk-129kq1w7.js +2 -0
- package/bundle/{chunk-8cr7ks31.js → chunk-14qvaxtp.js} +1 -1
- package/bundle/chunk-1a5hq7d5.js +2 -0
- package/bundle/{chunk-k16hzy2q.js → chunk-1ce5jpdc.js} +1 -1
- package/bundle/{chunk-xv8gnkh5.js → chunk-1e8mja6v.js} +1 -1
- package/bundle/{chunk-cy2586rv.js → chunk-1n1dh6zj.js} +1 -1
- package/bundle/{chunk-pb7rnkke.js → chunk-1txkz6dt.js} +1 -1
- package/bundle/chunk-1w3y1dkk.js +2 -0
- package/bundle/{chunk-v7r9np94.js → chunk-23f6rc7a.js} +1 -1
- package/bundle/chunk-26qt44f1.js +3 -0
- package/bundle/{chunk-6mscvf6y.js → chunk-2armxd20.js} +1 -1
- package/bundle/{chunk-21ejqv4v.js → chunk-2je5tp0x.js} +1 -1
- package/bundle/{chunk-0rtshz2r.js → chunk-2k2axg73.js} +1 -1
- package/bundle/chunk-2pkake0h.js +2 -0
- package/bundle/{chunk-7y3y3j51.js → chunk-2rxt1s22.js} +2 -2
- package/bundle/{chunk-te1zfpzv.js → chunk-2s28fdbp.js} +1 -1
- package/bundle/{chunk-8pe047p0.js → chunk-2sy1wx99.js} +1 -1
- package/bundle/{chunk-9easaxy7.js → chunk-2z35ewwc.js} +1 -1
- package/bundle/{chunk-zeh481tm.js → chunk-2zj3h3xj.js} +2 -2
- package/bundle/chunk-32188rww.js +2 -0
- package/bundle/chunk-334tc1rh.js +2 -0
- package/bundle/{chunk-tzc4jkzg.js → chunk-3dvyfmgc.js} +1 -1
- package/bundle/{chunk-q3x4x2tq.js → chunk-3e8p4a3y.js} +1 -1
- package/bundle/{chunk-7mhffm9f.js → chunk-3f054f69.js} +183 -183
- package/bundle/chunk-3ff94m8r.js +2 -0
- package/bundle/{chunk-7a6p7dfx.js → chunk-3fy57jcy.js} +1 -1
- package/bundle/{chunk-ve5gb789.js → chunk-3h08jdq8.js} +2 -2
- package/bundle/{chunk-w7p2x973.js → chunk-3j7skhxg.js} +2 -2
- package/bundle/{chunk-p4hpr8d7.js → chunk-3jhx8g5d.js} +1 -1
- package/bundle/{chunk-jr9xnvjq.js → chunk-3nhth7c2.js} +1 -1
- package/bundle/{chunk-8ace31r2.js → chunk-3tnek022.js} +1 -1
- package/bundle/{chunk-rvvfs9ps.js → chunk-3xna2rk5.js} +1 -1
- package/bundle/{chunk-k9d927xe.js → chunk-42t25nkb.js} +1 -1
- package/bundle/chunk-4aqd2bty.js +2 -0
- package/bundle/{chunk-am73j1bt.js → chunk-4kb2efq3.js} +1 -1
- package/bundle/{chunk-wmw2gne9.js → chunk-4pssh5d3.js} +2 -2
- package/bundle/{chunk-pyq01301.js → chunk-4stgw33j.js} +1 -1
- package/bundle/{chunk-k9g77a02.js → chunk-4w5t515p.js} +1 -1
- package/bundle/chunk-4wa0gf8y.js +28 -0
- package/bundle/{chunk-jegn6jc3.js → chunk-4wgb80jm.js} +2 -2
- package/bundle/{chunk-jbd9k041.js → chunk-4wyjapes.js} +2 -2
- package/bundle/chunk-4xg5ptk9.js +2 -0
- package/bundle/{chunk-23geekk5.js → chunk-54pk7nna.js} +1 -1
- package/bundle/chunk-58680z2j.js +3 -0
- package/bundle/{chunk-ygj1cy0n.js → chunk-5mdsrv0a.js} +1 -1
- package/bundle/{chunk-xj73j10a.js → chunk-5mp82az0.js} +1 -1
- package/bundle/chunk-5nm36wxa.js +2 -0
- package/bundle/{chunk-7tgm8wp5.js → chunk-5zw7knvd.js} +1 -1
- package/bundle/{chunk-yz7rqzby.js → chunk-61ks7c71.js} +3 -3
- package/bundle/chunk-64jet8nc.js +2 -0
- package/bundle/chunk-6584d9m8.js +2 -0
- package/bundle/chunk-66hv9bbw.js +2 -0
- package/bundle/{chunk-mj24ntn9.js → chunk-692vn48b.js} +1 -1
- package/bundle/chunk-6a1g6jzn.js +2 -0
- package/bundle/chunk-6be8p915.js +2 -0
- package/bundle/{chunk-8651hq0k.js → chunk-6ddp36ar.js} +1 -1
- package/bundle/chunk-6f03158n.js +2 -0
- package/bundle/{chunk-zavtsfxz.js → chunk-6gbaw2pk.js} +1 -1
- package/bundle/{chunk-5h2hcp46.js → chunk-6rrmjrm2.js} +1 -1
- package/bundle/{chunk-ps543k72.js → chunk-6s2f5sv4.js} +1 -1
- package/bundle/{chunk-9jf67xb0.js → chunk-754varfr.js} +2 -2
- package/bundle/{chunk-wa2ce2sg.js → chunk-78h5dd4t.js} +2 -2
- package/bundle/{chunk-4d1a547n.js → chunk-7d6jhzng.js} +1 -1
- package/bundle/{chunk-kc3hpmr2.js → chunk-7fx6x8x9.js} +2 -2
- package/bundle/chunk-7jnjttqx.js +2 -0
- package/bundle/{chunk-jz3aav8a.js → chunk-7q5srx7q.js} +2 -2
- package/bundle/chunk-7q8pa6s8.js +2 -0
- package/bundle/{chunk-vvypb02q.js → chunk-7qvkyjjg.js} +1 -1
- package/bundle/{chunk-8r79zf3y.js → chunk-7rjf9b8n.js} +2 -2
- package/bundle/{chunk-t488d66k.js → chunk-7v4fzkbb.js} +1 -1
- package/bundle/chunk-7w84hfxs.js +3 -0
- package/bundle/{chunk-8717htya.js → chunk-7ws3gdjq.js} +1 -1
- package/bundle/{chunk-va4davgy.js → chunk-87x607rz.js} +259 -253
- package/bundle/{chunk-vftqwdpg.js → chunk-8ahpk8td.js} +1 -1
- package/bundle/{chunk-9vcw33dv.js → chunk-8atry88r.js} +1 -1
- package/bundle/chunk-8casywce.js +2 -0
- package/bundle/{chunk-tsn1jkr7.js → chunk-8cty50g7.js} +1 -1
- package/bundle/{chunk-qywwj58s.js → chunk-8gy99gfb.js} +2 -2
- package/bundle/chunk-8hxwxt5p.js +2 -0
- package/bundle/{chunk-58enbars.js → chunk-8jcx4tep.js} +2 -2
- package/bundle/chunk-8y8140dm.js +2 -0
- package/bundle/{chunk-frdc3ysq.js → chunk-8za87zkr.js} +1 -1
- package/bundle/{chunk-2qcndbxv.js → chunk-99p5m2f1.js} +1 -1
- package/bundle/{chunk-y3n31nnx.js → chunk-9dpn4792.js} +2 -2
- package/bundle/chunk-9dqcyt6x.js +2 -0
- package/bundle/{chunk-7gczzccz.js → chunk-9f6pqped.js} +1 -1
- package/bundle/chunk-9he248a8.js +2 -0
- package/bundle/{chunk-8h9r6c8g.js → chunk-9jncnqbj.js} +2 -2
- package/bundle/{chunk-cvchztkc.js → chunk-9jvnc14g.js} +1 -1
- package/bundle/chunk-9qmmse2n.js +2 -0
- package/bundle/chunk-9r6bvkp4.js +8 -0
- package/bundle/{chunk-dkv2mg97.js → chunk-9va5eh9s.js} +1 -1
- package/bundle/{chunk-hg563h5r.js → chunk-9w5rx0fb.js} +2 -2
- package/bundle/{chunk-xccs5c50.js → chunk-a27yjp71.js} +1 -1
- package/bundle/chunk-aabrsxrq.js +2 -0
- package/bundle/{chunk-dkm7x8rj.js → chunk-ag9thqkv.js} +2 -2
- package/bundle/chunk-amx3x4kd.js +3 -0
- package/bundle/{chunk-ktmazmas.js → chunk-aqm597px.js} +2 -2
- package/bundle/chunk-atd0q4v8.js +3 -0
- package/bundle/{chunk-ewyk4py6.js → chunk-av290sja.js} +1 -1
- package/bundle/chunk-avaba4sr.js +2 -0
- package/bundle/{chunk-dgzyn27r.js → chunk-aw0q4y3s.js} +1 -1
- package/bundle/{chunk-4k149ews.js → chunk-b2xya6pq.js} +1 -1
- package/bundle/{chunk-3tdqsm5c.js → chunk-b50t4jc5.js} +1 -1
- package/bundle/chunk-bdy1etja.js +2 -0
- package/bundle/{chunk-6szvs3k9.js → chunk-bnc4626b.js} +1 -1
- package/bundle/{chunk-fm4xa6yx.js → chunk-bpnpxdyv.js} +2 -2
- package/bundle/chunk-bqdvqmjc.js +2 -0
- package/bundle/chunk-bqs6a1ts.js +14 -0
- package/bundle/{chunk-78bajmqm.js → chunk-bsqcfqya.js} +1 -1
- package/bundle/{chunk-ecwz9nhs.js → chunk-c1ypbbka.js} +2 -2
- package/bundle/{chunk-1jsywey3.js → chunk-c27rpvdz.js} +1 -1
- package/bundle/chunk-cdws8ggq.js +2 -0
- package/bundle/{chunk-6j0365q3.js → chunk-cjxp72dv.js} +2 -2
- package/bundle/chunk-cqs9a2cs.js +2 -0
- package/bundle/{chunk-3wzqs241.js → chunk-crap29f6.js} +1 -1
- package/bundle/{chunk-1jh5p5qw.js → chunk-d0m7nbbx.js} +2 -2
- package/bundle/chunk-d0rjst58.js +2 -0
- package/bundle/{chunk-2eardzxs.js → chunk-d1bsxz2t.js} +1 -1
- package/bundle/{chunk-b6m4yyww.js → chunk-d5b0bqbr.js} +1 -1
- package/bundle/chunk-d833a2fj.js +2 -0
- package/bundle/{chunk-tk3bve0x.js → chunk-dd11kryy.js} +2 -2
- package/bundle/chunk-dday4nm2.js +2 -0
- package/bundle/{chunk-qw2hgs5b.js → chunk-ddxjc803.js} +2 -2
- package/bundle/{chunk-3tkp27x7.js → chunk-dee1a3yk.js} +2 -2
- package/bundle/{chunk-q6fbyvpq.js → chunk-dgggvses.js} +1 -1
- package/bundle/{chunk-apq38bt4.js → chunk-dk3z4k46.js} +3 -3
- package/bundle/{chunk-wf09j72q.js → chunk-e075v4e9.js} +2 -2
- package/bundle/{chunk-1xyn0sp2.js → chunk-e1pwnf0b.js} +2 -2
- package/bundle/chunk-e2sj30hk.js +2 -0
- package/bundle/{chunk-dann9gfq.js → chunk-eaatrmcg.js} +1 -1
- package/bundle/{chunk-1y9t7nxn.js → chunk-eg7drzzt.js} +1 -1
- package/bundle/chunk-enc0fykg.js +2 -0
- package/bundle/chunk-evan93av.js +2 -0
- package/bundle/{chunk-9f7y0dj0.js → chunk-evmfntm3.js} +1 -1
- package/bundle/{chunk-2gxjjqfx.js → chunk-ey4ktbyb.js} +1 -1
- package/bundle/{chunk-sswbfqcq.js → chunk-f55txcsa.js} +1 -1
- package/bundle/chunk-f600dzsr.js +2 -0
- package/bundle/chunk-f6jzwydk.js +2 -0
- package/bundle/{chunk-s9amvacw.js → chunk-f84cd0a1.js} +2 -2
- package/bundle/{chunk-6sdh1q7g.js → chunk-fgw420gb.js} +1 -1
- package/bundle/chunk-fv67ng8z.js +2 -0
- package/bundle/{chunk-x6z2b63w.js → chunk-g3s2z5xa.js} +1 -1
- package/bundle/{chunk-9xvctnjr.js → chunk-g4qwkcdv.js} +1 -1
- package/bundle/{chunk-3nhqd8wg.js → chunk-g73drh98.js} +3 -3
- package/bundle/{chunk-0pvbk8ks.js → chunk-gaen9ya4.js} +2 -2
- package/bundle/{chunk-ac202abt.js → chunk-gefh32jb.js} +1 -1
- package/bundle/chunk-gevazsx3.js +2 -0
- package/bundle/{chunk-n1chdwrs.js → chunk-gfmfrkxc.js} +1 -1
- package/bundle/{chunk-sjrmhd3e.js → chunk-ggeena9t.js} +1 -1
- package/bundle/chunk-gh18pzkx.js +2 -0
- package/bundle/chunk-gnvvgr4y.js +2 -0
- package/bundle/{chunk-4q9w2yve.js → chunk-grkkzrg1.js} +2 -2
- package/bundle/chunk-gsbjs2ws.js +2 -0
- package/bundle/{chunk-gff87y4n.js → chunk-gsz1wqy6.js} +1 -1
- package/bundle/{chunk-vf1r5ckp.js → chunk-gvtw9c44.js} +1 -1
- package/bundle/chunk-gw0j8hr9.js +3 -0
- package/bundle/{chunk-cesrhm09.js → chunk-h19ty95q.js} +1 -1
- package/bundle/{chunk-9nx8hm57.js → chunk-h2fh1g8g.js} +1 -1
- package/bundle/{chunk-p54bzjtv.js → chunk-h56jxxvj.js} +1 -1
- package/bundle/{chunk-jmjg8d8a.js → chunk-hmfefq0d.js} +4 -4
- package/bundle/{chunk-gn7xgd4c.js → chunk-hvpe07pt.js} +1 -1
- package/bundle/{chunk-gvzfffr4.js → chunk-hwbxehhf.js} +1 -1
- package/bundle/{chunk-zp2ffbc2.js → chunk-hznsed5n.js} +2 -2
- package/bundle/{chunk-w1atxyz0.js → chunk-j5b5h08g.js} +1 -1
- package/bundle/chunk-j7pdz979.js +2 -0
- package/bundle/{chunk-02txthqv.js → chunk-j9s62g01.js} +2 -2
- package/bundle/chunk-jfe2qbv8.js +2 -0
- package/bundle/{chunk-wj6aq50n.js → chunk-jgs6ngte.js} +1 -1
- package/bundle/{chunk-ep8zn49w.js → chunk-jhq5bvhs.js} +2 -2
- package/bundle/{chunk-2z6fzwyc.js → chunk-jq81hb32.js} +2 -2
- package/bundle/{chunk-dcx8hjbs.js → chunk-jqzejny3.js} +1 -1
- package/bundle/{chunk-j1veq3zr.js → chunk-jtrcnpm7.js} +2 -2
- package/bundle/{chunk-hbnr0j7h.js → chunk-jv98gw88.js} +2 -2
- package/bundle/{chunk-e346x00p.js → chunk-jvaffe5d.js} +1 -1
- package/bundle/chunk-k6zvb8xm.js +2 -0
- package/bundle/{chunk-5y8efy5b.js → chunk-k8bp3jjv.js} +1 -1
- package/bundle/{chunk-0ae5q6ck.js → chunk-kb14wxcs.js} +2 -2
- package/bundle/chunk-kcht9kvx.js +2 -0
- package/bundle/{chunk-edvcz2gd.js → chunk-kdcspxvq.js} +1 -1
- package/bundle/{chunk-t6w96xq2.js → chunk-kdct3e8s.js} +1 -1
- package/bundle/{chunk-1fnmkm0z.js → chunk-kgsq240v.js} +2 -2
- package/bundle/chunk-knvsa1d4.js +2 -0
- package/bundle/chunk-kp6d68hd.js +2 -0
- package/bundle/{chunk-jpygkh1c.js → chunk-kwm87f18.js} +1 -1
- package/bundle/{chunk-1p34bx7c.js → chunk-kyny0t2g.js} +2 -2
- package/bundle/{chunk-b8ag61vj.js → chunk-m2ang7yb.js} +1 -1
- package/bundle/{chunk-99n6czag.js → chunk-mbh1pdv9.js} +2 -2
- package/bundle/{chunk-y1srca0c.js → chunk-mczw8e3s.js} +2 -2
- package/bundle/chunk-me78p9x4.js +2 -0
- package/bundle/{chunk-g7vkkmsk.js → chunk-meaybtcc.js} +3 -3
- package/bundle/{chunk-9rqrm9y8.js → chunk-mkdyknbz.js} +1 -1
- package/bundle/{chunk-bf146hz2.js → chunk-mkyrg7gt.js} +2 -2
- package/bundle/{chunk-0pbt75ev.js → chunk-mr7agwgn.js} +1 -1
- package/bundle/{chunk-0w4v0fbs.js → chunk-msm3r7ny.js} +2 -2
- package/bundle/chunk-mv1d7wyt.js +2 -0
- package/bundle/{chunk-hh3w51wp.js → chunk-mybpgrjj.js} +2 -2
- package/bundle/{chunk-gf4ek7rv.js → chunk-n8dcmjph.js} +1 -1
- package/bundle/chunk-n8xmmxh5.js +2 -0
- package/bundle/chunk-n90219q9.js +2 -0
- package/bundle/chunk-nckg3ydx.js +2 -0
- package/bundle/{chunk-a5zjrwqy.js → chunk-nf8gkxbk.js} +2 -2
- package/bundle/chunk-nhaenjw3.js +2 -0
- package/bundle/chunk-nhtrt5ec.js +2 -0
- package/bundle/{chunk-6dxaty1v.js → chunk-nhx2xp2x.js} +1 -1
- package/bundle/{chunk-najzfhb2.js → chunk-nmnsf3fc.js} +1 -1
- package/bundle/{chunk-84gnbzky.js → chunk-nqefvn28.js} +1 -1
- package/bundle/{chunk-v2kyarwz.js → chunk-p409grvp.js} +2 -2
- package/bundle/chunk-p72n0tfq.js +2 -0
- package/bundle/{chunk-jr8qcf99.js → chunk-p80dc6kt.js} +2 -2
- package/bundle/{chunk-2wp1w8cy.js → chunk-p883sz67.js} +1 -1
- package/bundle/{chunk-fdezde1z.js → chunk-p8enedkf.js} +1 -1
- package/bundle/chunk-pd33qvr0.js +2 -0
- package/bundle/{chunk-d56zc21w.js → chunk-pepn5jp4.js} +1 -1
- package/bundle/chunk-pf7cj4jd.js +3 -0
- package/bundle/{chunk-bd21p9zz.js → chunk-pfn1db1m.js} +2 -2
- package/bundle/{chunk-srf73nm4.js → chunk-pk0tytcm.js} +1 -1
- package/bundle/chunk-pq3622ae.js +2 -0
- package/bundle/{chunk-ebjhggdw.js → chunk-psveqqv2.js} +1 -1
- package/bundle/{chunk-wfnk2vsd.js → chunk-pvee151a.js} +1 -1
- package/bundle/chunk-qatj4h6b.js +2 -0
- package/bundle/{chunk-3vbtra1j.js → chunk-qdnxv55k.js} +1 -1
- package/bundle/{chunk-gen6f3dn.js → chunk-qe0sfafy.js} +2 -2
- package/bundle/chunk-qfz0a58d.js +2 -0
- package/bundle/chunk-qjwfj51e.js +2 -0
- package/bundle/chunk-qkg73rs9.js +2 -0
- package/bundle/{chunk-5kmfnkzv.js → chunk-qm9ezq93.js} +1 -1
- package/bundle/{chunk-5rkmhzq0.js → chunk-qnqqrvvs.js} +2 -2
- package/bundle/{chunk-9pe4agdz.js → chunk-qnv2v02g.js} +2 -2
- package/bundle/{chunk-7dckfame.js → chunk-qpm5afdz.js} +1 -1
- package/bundle/chunk-qvcfst7n.js +11 -0
- package/bundle/{chunk-r48g0kaq.js → chunk-rgecc41f.js} +2 -2
- package/bundle/chunk-rjcptzem.js +8 -0
- package/bundle/{chunk-hh9a709t.js → chunk-rjf21v5c.js} +1 -1
- package/bundle/chunk-rmsqb6r4.js +10 -0
- package/bundle/{chunk-2mmspnr3.js → chunk-rq4hqwjy.js} +1 -1
- package/bundle/chunk-rqrpbcm6.js +2 -0
- package/bundle/{chunk-ftk58wxe.js → chunk-rs1mm5ef.js} +1 -1
- package/bundle/{chunk-a9y27zd2.js → chunk-rze20q68.js} +1 -1
- package/bundle/chunk-s76hdgw6.js +2 -0
- package/bundle/chunk-s7vhjg9e.js +2 -0
- package/bundle/{chunk-fkvccmgk.js → chunk-se79ke63.js} +2 -2
- package/bundle/chunk-sec3a60m.js +2 -0
- package/bundle/chunk-sjnt5e6w.js +2 -0
- package/bundle/chunk-sntb757q.js +2 -0
- package/bundle/chunk-svscftd7.js +2 -0
- package/bundle/chunk-sx0cabcs.js +2 -0
- package/bundle/{chunk-gn9p1d50.js → chunk-sx5m81em.js} +1 -1
- package/bundle/chunk-syhay5ye.js +7 -0
- package/bundle/{chunk-9798jffg.js → chunk-t07a5431.js} +1 -1
- package/bundle/{chunk-c31k8yh0.js → chunk-t0amhhsk.js} +1 -1
- package/bundle/{chunk-pfhp78cr.js → chunk-t2tsyazc.js} +1 -1
- package/bundle/{chunk-spm1yy6w.js → chunk-tdmaxc6n.js} +1 -1
- package/bundle/{chunk-gc9q0x8z.js → chunk-tf1me2r4.js} +3 -3
- package/bundle/{chunk-zfnbk5gy.js → chunk-tfggzzqw.js} +1 -1
- package/bundle/chunk-tmdm6vm6.js +2 -0
- package/bundle/{chunk-9sy9ws1w.js → chunk-v4xgceeq.js} +1 -1
- package/bundle/chunk-v6g0ksks.js +2 -0
- package/bundle/chunk-v7ah9gg0.js +3 -0
- package/bundle/{chunk-kr0fsqas.js → chunk-vb4e7y4d.js} +1 -1
- package/bundle/chunk-vbf73c7z.js +2 -0
- package/bundle/chunk-vbf9jpas.js +2 -0
- package/bundle/{chunk-r3yqe7x0.js → chunk-veev25yg.js} +1 -1
- package/bundle/{chunk-kaeyhw2n.js → chunk-vfj5nwab.js} +2 -2
- package/bundle/{chunk-6g3m7yxf.js → chunk-vmgknvxs.js} +2 -2
- package/bundle/{chunk-2y8qz8te.js → chunk-vq6bh2z9.js} +1 -1
- package/bundle/{chunk-b643cra9.js → chunk-vqq5vmh1.js} +195 -195
- package/bundle/chunk-vrcf5q4s.js +2 -0
- package/bundle/chunk-vxrsp6n7.js +2 -0
- package/bundle/chunk-w8ax3pvh.js +2 -0
- package/bundle/chunk-w98r39gd.js +9 -0
- package/bundle/{chunk-j1a64ade.js → chunk-wb69d52j.js} +2 -2
- package/bundle/{chunk-hg9nk090.js → chunk-wrgg270f.js} +1 -1
- package/bundle/{chunk-yzdty5t9.js → chunk-ww8ear80.js} +2 -2
- package/bundle/{chunk-ha1w0xzh.js → chunk-x36jhtex.js} +1 -1
- package/bundle/{chunk-hjbks7r9.js → chunk-x6b99nt3.js} +1 -1
- package/bundle/{chunk-yh174jhg.js → chunk-xdde80rf.js} +2 -2
- package/bundle/{chunk-17ggas8k.js → chunk-xjrt0dta.js} +1 -1
- package/bundle/chunk-xk2cmh49.js +2 -0
- package/bundle/{chunk-f819a7ec.js → chunk-xqa6qkx2.js} +1 -1
- package/bundle/{chunk-f3kjp838.js → chunk-xw283h2r.js} +2 -2
- package/bundle/{chunk-82gs5cmn.js → chunk-xy4t5qf8.js} +1 -1
- package/bundle/{chunk-0w0jfzb4.js → chunk-xyn3xxfs.js} +1 -1
- package/bundle/chunk-xzhkfctf.js +2 -0
- package/bundle/chunk-y0xt5a6g.js +2 -0
- package/bundle/{chunk-hxgb0y1w.js → chunk-ybn8tb09.js} +1 -1
- package/bundle/chunk-ydmrvx7q.js +2 -0
- package/bundle/{chunk-ns0pswww.js → chunk-ydsen7w0.js} +1 -1
- package/bundle/{chunk-hv4nhx6q.js → chunk-yhqk8bzk.js} +2 -2
- package/bundle/{chunk-g0v9g37f.js → chunk-ykfq8bem.js} +1 -1
- package/bundle/{chunk-r7xp0xcn.js → chunk-ym4ydwrz.js} +2 -2
- package/bundle/{chunk-4tn69nqs.js → chunk-yzchwmb4.js} +1 -1
- package/bundle/{chunk-1d64dywx.js → chunk-z015twaq.js} +2 -2
- package/bundle/chunk-z2rtcgad.js +3 -0
- package/bundle/{chunk-ms1fd6h4.js → chunk-z3zx6g09.js} +1 -1
- package/bundle/chunk-z9b3t2jm.js +2 -0
- package/bundle/{chunk-agdfqncf.js → chunk-zbdbsagd.js} +2 -2
- package/bundle/{chunk-evqxvhdb.js → chunk-zh808d4t.js} +1 -1
- package/bundle/{chunk-fhng5her.js → chunk-zny2qaqa.js} +2 -2
- package/bundle/{chunk-y2jmtfdh.js → chunk-zsnbxsdx.js} +2 -2
- package/bundle/{chunk-pv8jcpnf.js → chunk-zss93r48.js} +1 -1
- package/bundle/chunk-zzr8smtm.js +2 -0
- package/bundle/index.js +16 -16
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-0bvde0cx.js +0 -2
- package/bundle/chunk-0kbxnazj.js +0 -2
- package/bundle/chunk-0z3z0gk1.js +0 -5
- package/bundle/chunk-19z5q33z.js +0 -2
- package/bundle/chunk-1a0wnwna.js +0 -2
- package/bundle/chunk-1ddm2wxv.js +0 -2
- package/bundle/chunk-1fk4vsmc.js +0 -2
- package/bundle/chunk-1j2f9nd5.js +0 -2
- package/bundle/chunk-27s736an.js +0 -2
- package/bundle/chunk-2j17xrzj.js +0 -2
- package/bundle/chunk-2zca3nak.js +0 -2
- package/bundle/chunk-2zcvcfq4.js +0 -2
- package/bundle/chunk-38hwkfj5.js +0 -2
- package/bundle/chunk-3afqxvsn.js +0 -2
- package/bundle/chunk-3avc1ppg.js +0 -7
- package/bundle/chunk-3v4vtah1.js +0 -2
- package/bundle/chunk-3ypk0j2f.js +0 -2
- package/bundle/chunk-3z1y040p.js +0 -3
- package/bundle/chunk-4aykrj51.js +0 -9
- package/bundle/chunk-4dtbmqmq.js +0 -2
- package/bundle/chunk-4zjb6rps.js +0 -2
- package/bundle/chunk-5hkcjgwh.js +0 -2
- package/bundle/chunk-5snrz263.js +0 -2
- package/bundle/chunk-653c0mxr.js +0 -11
- package/bundle/chunk-6av7hrrk.js +0 -7
- package/bundle/chunk-6bswn7w5.js +0 -2
- package/bundle/chunk-6epghftw.js +0 -2
- package/bundle/chunk-6jjhxh8p.js +0 -2
- package/bundle/chunk-6ws7xyc5.js +0 -2
- package/bundle/chunk-7g28zhar.js +0 -2
- package/bundle/chunk-7v02b2ms.js +0 -2
- package/bundle/chunk-7vmp2034.js +0 -2
- package/bundle/chunk-7wxrypkr.js +0 -2
- package/bundle/chunk-8kk9gvdy.js +0 -2
- package/bundle/chunk-8ygpp4y3.js +0 -2
- package/bundle/chunk-95q60g1p.js +0 -2
- package/bundle/chunk-9mjbenja.js +0 -2
- package/bundle/chunk-9vn1gy8h.js +0 -2
- package/bundle/chunk-ajp3f08k.js +0 -2
- package/bundle/chunk-aptkpdkc.js +0 -2
- package/bundle/chunk-bky5a42k.js +0 -3
- package/bundle/chunk-bry94ar5.js +0 -2
- package/bundle/chunk-btzyvqkf.js +0 -2
- package/bundle/chunk-c94pjdfh.js +0 -2
- package/bundle/chunk-cct9ds5c.js +0 -2
- package/bundle/chunk-czn535v0.js +0 -2
- package/bundle/chunk-d7wd5hz1.js +0 -2
- package/bundle/chunk-d86cmjrp.js +0 -2
- package/bundle/chunk-dnq65xvn.js +0 -2
- package/bundle/chunk-dpqv8rtn.js +0 -2
- package/bundle/chunk-e9mh7s3z.js +0 -2
- package/bundle/chunk-ek2y5f6g.js +0 -2
- package/bundle/chunk-epdsay73.js +0 -2
- package/bundle/chunk-f89gntcy.js +0 -3
- package/bundle/chunk-ffnsn7tv.js +0 -2
- package/bundle/chunk-fkezc7ew.js +0 -2
- package/bundle/chunk-fsxddgj0.js +0 -2
- package/bundle/chunk-gbcsfg6v.js +0 -2
- package/bundle/chunk-gfmz85hp.js +0 -2
- package/bundle/chunk-gk63k4t6.js +0 -2
- package/bundle/chunk-j0vf8s12.js +0 -2
- package/bundle/chunk-j1bxt69x.js +0 -2
- package/bundle/chunk-jcem8s30.js +0 -2
- package/bundle/chunk-jjwjb9w0.js +0 -3
- package/bundle/chunk-jpham2a3.js +0 -2
- package/bundle/chunk-jzkymnr5.js +0 -2
- package/bundle/chunk-k0qtwnhb.js +0 -2
- package/bundle/chunk-k2rsky7z.js +0 -2
- package/bundle/chunk-kcetcysa.js +0 -2
- package/bundle/chunk-kjfc5v3s.js +0 -2
- package/bundle/chunk-kkvb2c2z.js +0 -8
- package/bundle/chunk-km2ayfyf.js +0 -2
- package/bundle/chunk-knrh89eb.js +0 -2
- package/bundle/chunk-ksqfjawv.js +0 -2
- package/bundle/chunk-m8djypsy.js +0 -11
- package/bundle/chunk-mjhb1q0n.js +0 -3
- package/bundle/chunk-mxcger73.js +0 -2
- package/bundle/chunk-nazkrkeb.js +0 -2
- package/bundle/chunk-nk01s49e.js +0 -2
- package/bundle/chunk-ns8b7rx1.js +0 -2
- package/bundle/chunk-ny6vpkx2.js +0 -2
- package/bundle/chunk-q0dd3ak6.js +0 -3
- package/bundle/chunk-q2s057bm.js +0 -2
- package/bundle/chunk-q5cqg2c0.js +0 -28
- package/bundle/chunk-qk2wnp2x.js +0 -2
- package/bundle/chunk-r012q335.js +0 -3
- package/bundle/chunk-rbdjbgkb.js +0 -2
- package/bundle/chunk-rxjprhgh.js +0 -2
- package/bundle/chunk-s3w9bmze.js +0 -2
- package/bundle/chunk-s3zste1a.js +0 -2
- package/bundle/chunk-sbt7qmwm.js +0 -3
- package/bundle/chunk-sf6h44pb.js +0 -2
- package/bundle/chunk-sgvzxs7m.js +0 -2
- package/bundle/chunk-sp9bndyh.js +0 -2
- package/bundle/chunk-vavrczqm.js +0 -3
- package/bundle/chunk-vg4styg5.js +0 -2
- package/bundle/chunk-vh09hhcs.js +0 -2
- package/bundle/chunk-vhktpm0n.js +0 -2
- package/bundle/chunk-vzjcmwry.js +0 -14
- package/bundle/chunk-wtp0yvqw.js +0 -2
- package/bundle/chunk-xmzs7q66.js +0 -2
- package/bundle/chunk-xv80476w.js +0 -2
- package/bundle/chunk-yjvr0et1.js +0 -2
- package/bundle/chunk-zk8n8hnh.js +0 -3
- package/bundle/chunk-zx3kcfkj.js +0 -2
package/bundle/parser.worker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`)}static async fetchHighlightQuery(J,K,Z){let Y=await this.downloadOrLoad(J,K,"queries",".scm",!0,Z);if(Y.error)return console.error(`Error fetching highlight query from ${J}:`,Y.error),"";if(Y.content)return new TextDecoder().decode(Y.content);return""}}function f(J){return J.includes("$bunfs")||/^B:[\\/]~BUN/i.test(J)}function u(){return process.platform==="win32"?"B:\\~BUN\\root":"/$bunfs/root"}function g(J){return h(u(),P(J))}function o({onlyFirst:J=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",J?void 0:"g")}var s=o();function b(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(s,"")}function n(J){return J===161||J===164||J===167||J===168||J===170||J===173||J===174||J>=176&&J<=180||J>=182&&J<=186||J>=188&&J<=191||J===198||J===208||J===215||J===216||J>=222&&J<=225||J===230||J>=232&&J<=234||J===236||J===237||J===240||J===242||J===243||J>=247&&J<=250||J===252||J===254||J===257||J===273||J===275||J===283||J===294||J===295||J===299||J>=305&&J<=307||J===312||J>=319&&J<=322||J===324||J>=328&&J<=331||J===333||J===338||J===339||J===358||J===359||J===363||J===462||J===464||J===466||J===468||J===470||J===472||J===474||J===476||J===593||J===609||J===708||J===711||J>=713&&J<=715||J===717||J===720||J>=728&&J<=731||J===733||J===735||J>=768&&J<=879||J>=913&&J<=929||J>=931&&J<=937||J>=945&&J<=961||J>=963&&J<=969||J===1025||J>=1040&&J<=1103||J===1105||J===8208||J>=8211&&J<=8214||J===8216||J===8217||J===8220||J===8221||J>=8224&&J<=8226||J>=8228&&J<=8231||J===8240||J===8242||J===8243||J===8245||J===8251||J===8254||J===8308||J===8319||J>=8321&&J<=8324||J===8364||J===8451||J===8453||J===8457||J===8467||J===8470||J===8481||J===8482||J===8486||J===8491||J===8531||J===8532||J>=8539&&J<=8542||J>=8544&&J<=8555||J>=8560&&J<=8569||J===8585||J>=8592&&J<=8601||J===8632||J===8633||J===8658||J===8660||J===8679||J===8704||J===8706||J===8707||J===8711||J===8712||J===8715||J===8719||J===8721||J===8725||J===8730||J>=8733&&J<=8736||J===8739||J===8741||J>=8743&&J<=8748||J===8750||J>=8756&&J<=8759||J===8764||J===8765||J===8776||J===8780||J===8786||J===8800||J===8801||J>=8804&&J<=8807||J===8810||J===8811||J===8814||J===8815||J===8834||J===8835||J===8838||J===8839||J===8853||J===8857||J===8869||J===8895||J===8978||J>=9312&&J<=9449||J>=9451&&J<=9547||J>=9552&&J<=9587||J>=9600&&J<=9615||J>=9618&&J<=9621||J===9632||J===9633||J>=9635&&J<=9641||J===9650||J===9651||J===9654||J===9655||J===9660||J===9661||J===9664||J===9665||J>=9670&&J<=9672||J===9675||J>=9678&&J<=9681||J>=9698&&J<=9701||J===9711||J===9733||J===9734||J===9737||J===9742||J===9743||J===9756||J===9758||J===9792||J===9794||J===9824||J===9825||J>=9827&&J<=9829||J>=9831&&J<=9834||J===9836||J===9837||J===9839||J===9886||J===9887||J===9919||J>=9926&&J<=9933||J>=9935&&J<=9939||J>=9941&&J<=9953||J===9955||J===9960||J===9961||J>=9963&&J<=9969||J===9972||J>=9974&&J<=9977||J===9979||J===9980||J===9982||J===9983||J===10045||J>=10102&&J<=10111||J>=11094&&J<=11097||J>=12872&&J<=12879||J>=57344&&J<=63743||J>=65024&&J<=65039||J===65533||J>=127232&&J<=127242||J>=127248&&J<=127277||J>=127280&&J<=127337||J>=127344&&J<=127373||J===127375||J===127376||J>=127387&&J<=127404||J>=917760&&J<=917999||J>=983040&&J<=1048573||J>=1048576&&J<=1114109}function i(J){return J===12288||J>=65281&&J<=65376||J>=65504&&J<=65510}function r(J){return J>=4352&&J<=4447||J===8986||J===8987||J===9001||J===9002||J>=9193&&J<=9196||J===9200||J===9203||J===9725||J===9726||J===9748||J===9749||J>=9776&&J<=9783||J>=9800&&J<=9811||J===9855||J>=9866&&J<=9871||J===9875||J===9889||J===9898||J===9899||J===9917||J===9918||J===9924||J===9925||J===9934||J===9940||J===9962||J===9970||J===9971||J===9973||J===9978||J===9981||J===9989||J===9994||J===9995||J===10024||J===10060||J===10062||J>=10067&&J<=10069||J===10071||J>=10133&&J<=10135||J===10160||J===10175||J===11035||J===11036||J===11088||J===11093||J>=11904&&J<=11929||J>=11931&&J<=12019||J>=12032&&J<=12245||J>=12272&&J<=12287||J>=12289&&J<=12350||J>=12353&&J<=12438||J>=12441&&J<=12543||J>=12549&&J<=12591||J>=12593&&J<=12686||J>=12688&&J<=12773||J>=12783&&J<=12830||J>=12832&&J<=12871||J>=12880&&J<=42124||J>=42128&&J<=42182||J>=43360&&J<=43388||J>=44032&&J<=55203||J>=63744&&J<=64255||J>=65040&&J<=65049||J>=65072&&J<=65106||J>=65108&&J<=65126||J>=65128&&J<=65131||J>=94176&&J<=94180||J>=94192&&J<=94198||J>=94208&&J<=101589||J>=101631&&J<=101662||J>=101760&&J<=101874||J>=110576&&J<=110579||J>=110581&&J<=110587||J===110589||J===110590||J>=110592&&J<=110882||J===110898||J>=110928&&J<=110930||J===110933||J>=110948&&J<=110951||J>=110960&&J<=111355||J>=119552&&J<=119638||J>=119648&&J<=119670||J===126980||J===127183||J===127374||J>=127377&&J<=127386||J>=127488&&J<=127490||J>=127504&&J<=127547||J>=127552&&J<=127560||J===127568||J===127569||J>=127584&&J<=127589||J>=127744&&J<=127776||J>=127789&&J<=127797||J>=127799&&J<=127868||J>=127870&&J<=127891||J>=127904&&J<=127946||J>=127951&&J<=127955||J>=127968&&J<=127984||J===127988||J>=127992&&J<=128062||J===128064||J>=128066&&J<=128252||J>=128255&&J<=128317||J>=128331&&J<=128334||J>=128336&&J<=128359||J===128378||J===128405||J===128406||J===128420||J>=128507&&J<=128591||J>=128640&&J<=128709||J===128716||J>=128720&&J<=128722||J>=128725&&J<=128728||J>=128732&&J<=128735||J===128747||J===128748||J>=128756&&J<=128764||J>=128992&&J<=129003||J===129008||J>=129292&&J<=129338||J>=129340&&J<=129349||J>=129351&&J<=129535||J>=129648&&J<=129660||J>=129664&&J<=129674||J>=129678&&J<=129734||J===129736||J>=129741&&J<=129756||J>=129759&&J<=129770||J>=129775&&J<=129784||J>=131072&&J<=196605||J>=196608&&J<=262141}function a(J){if(!Number.isSafeInteger(J))throw TypeError(`Expected a code point, got \`${typeof J}\`.`)}function t(J,{ambiguousAsWide:K=!1}={}){if(a(J),i(J)||r(J)||K&&n(J))return 2;return 1}var x=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},e=new Intl.Segmenter,JJ=/^\p{Default_Ignorable_Code_Point}$/u;function KJ(J,K={}){if(typeof J!=="string"||J.length===0)return 0;let{ambiguousIsNarrow:Z=!0,countAnsiEscapeCodes:Y=!1}=K;if(!Y)J=b(J);if(J.length===0)return 0;let X=0,V={ambiguousAsWide:!Z};for(let{segment:z}of e.segment(J)){let $=z.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if(JJ.test(z))continue;if(x().test(z)){X+=2;continue}X+=t($,V)}return X}var YJ=new TextEncoder,C=globalThis.Bun,AJ=C?.sleep??$J,vJ=C?.stringWidth??KJ,OJ=C?.stripANSI??b,MJ=C?.write??XJ;async function ZJ(J,K,Z){if(!C){let X=typeof K==="function"?K():K;return H(X instanceof URL?X:new URL(X,Z))}let Y=(await J()).default;if(Y.startsWith("file:"))return H(Y);if(c(Y))return Y;return l(j(H(Z)),Y)}function $J(J){let K=J instanceof Date?J.getTime()-Date.now():J;return new Promise((Z)=>setTimeout(Z,K))}async function XJ(J,K,Z){let Y=J instanceof URL?H(J):J;if(Z?.createPath)await p(j(Y),{recursive:!0});let X=typeof K==="string"?YJ.encode(K):new Uint8Array(K.buffer,K.byteOffset,K.byteLength);return await d(Y,X,{mode:Z?.mode}),X.byteLength}var A=globalThis;class S{bufferParsers=new Map;filetypeParserOptions=new Map;filetypeAliases=new Map;filetypeParsers=new Map;filetypeParserPromises=new Map;reusableParsers=new Map;reusableParserPromises=new Map;initializePromise;performance;dataPath;tsDataPath;initialized=!1;constructor(){this.performance={averageParseTime:0,parseTimes:[],averageQueryTime:0,queryTimes:[]}}async fetchQueries(J,K){if(!this.tsDataPath)return"";return w.fetchHighlightQueries(J,this.tsDataPath,K)}async initialize({dataPath:J}){if(this.initializePromise)return this.initializePromise;return this.initializePromise=(async()=>{this.dataPath=J,this.tsDataPath=M.join(J,"tree-sitter"),await W(M.join(this.tsDataPath,"languages"),{recursive:!0}),await W(M.join(this.tsDataPath,"queries"),{recursive:!0});let K=await ZJ(()=>import("./chunk-6ws7xyc5.js",{with:{type:"wasm"}}),()=>import.meta.resolve("web-tree-sitter/tree-sitter.wasm"),import.meta.url);if(f(K))K=g(M.parse(K).base);await D.init({locateFile(){return K}}),this.initialized=!0})(),this.initializePromise}addFiletypeParser(J){let K=this.filetypeParserOptions.get(J.filetype)?.aliases??[];for(let Y of K)if(this.filetypeAliases.get(Y)===J.filetype)this.filetypeAliases.delete(Y);let Z=[...new Set((J.aliases??[]).filter((Y)=>Y!==J.filetype))];this.filetypeAliases.delete(J.filetype),this.filetypeParserOptions.set(J.filetype,{...J,aliases:Z});for(let Y of Z)this.filetypeAliases.set(Y,J.filetype);this.invalidateParserCaches(J.filetype)}resolveCanonicalFiletype(J){if(this.filetypeParserOptions.has(J))return J;return this.filetypeAliases.get(J)??J}invalidateParserCaches(J){this.filetypeParsers.delete(J),this.filetypeParserPromises.delete(J);let K=this.reusableParsers.get(J);if(K)K.parser.delete(),this.reusableParsers.delete(J);this.reusableParserPromises.delete(J)}async createQueries(J,K){try{let Z=await this.fetchQueries(J.queries.highlights,J.filetype);if(!Z){console.error("Failed to fetch highlight queries for:",J.filetype);return}let X={highlights:new L(K,Z)};if(J.queries.injections&&J.queries.injections.length>0){let V=await this.fetchQueries(J.queries.injections,J.filetype);if(V)X.injections=new L(K,V)}return X}catch(Z){console.error("Error creating queries for",J.filetype,J.queries),console.error(Z);return}}async loadLanguage(J){if(!this.initialized||!this.tsDataPath)return;let K=await w.downloadOrLoad(J,this.tsDataPath,"languages",".wasm",!1);if(K.error){console.error(`Error loading language ${J}:`,K.error);return}if(!K.filePath)return;let Z=K.filePath.replaceAll("\\","/");try{return await I.load(Z)}catch(Y){console.error(`Error loading language from ${Z}:`,Y);return}}async resolveFiletypeParser(J){let K=this.resolveCanonicalFiletype(J);if(this.filetypeParsers.has(K))return this.filetypeParsers.get(K);if(this.filetypeParserPromises.has(K))return this.filetypeParserPromises.get(K);let Z=this.loadFiletypeParser(K);this.filetypeParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.filetypeParsers.set(K,Y);return Y}finally{this.filetypeParserPromises.delete(K)}}async loadFiletypeParser(J){let K=this.filetypeParserOptions.get(J);if(!K)return;let Z=await this.loadLanguage(K.wasm);if(!Z)return;let Y=await this.createQueries(K,Z);if(!Y){console.error("Failed to create queries for:",J);return}return{...K,queries:Y,language:Z}}async preloadParser(J){return this.resolveFiletypeParser(J)}async getReusableParser(J){let K=this.resolveCanonicalFiletype(J);if(this.reusableParsers.has(K))return this.reusableParsers.get(K);if(this.reusableParserPromises.has(K))return this.reusableParserPromises.get(K);let Z=this.createReusableParser(K);this.reusableParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.reusableParsers.set(K,Y);return Y}finally{this.reusableParserPromises.delete(K)}}async createReusableParser(J){let K=await this.resolveFiletypeParser(J);if(!K)return;let Z=new D;return Z.setLanguage(K.language),{parser:Z,filetypeParser:K,queries:K.queries}}async handleInitializeParser(J,K,Z,Y,X){let V=await this.resolveFiletypeParser(Y);if(!V){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,warning:`No parser available for filetype ${Y}`});return}let z=new D;z.setLanguage(V.language);let $=z.parse(Z);if(!$){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,error:"Failed to parse buffer"});return}let Q={parser:z,tree:$,queries:V.queries,filetype:Y,content:Z,injectionMapping:V.injectionMapping};this.bufferParsers.set(J,Q),A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!0});let B=await this.initialQuery(Q);A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:J,version:K,...B})}async initialQuery(J){let Z=J.queries.highlights.captures(J.tree.rootNode),Y=new Map;if(J.queries.injections){let X=await this.processInjections(J);Z.push(...X.captures),Y=X.injectionRanges}return this.getHighlights(J,Z,Y)}getNodeText(J,K){return K.substring(J.startIndex,J.endIndex)}async processInjections(J){let K=[],Z=new Map;if(!J.queries.injections)return{captures:K,injectionRanges:Z};let Y=J.content,X=J.queries.injections.captures(J.tree.rootNode),V=new Map,z=J.injectionMapping;for(let $ of X){let Q=$.name;if(Q==="injection.content"||Q.includes("injection")){let B=$.node.type,G;if(z?.nodeTypes&&z.nodeTypes[B])G=z.nodeTypes[B];else if(B==="code_fence_content"){let v=$.node.parent;if(v){let O=v.children.find((E)=>E.type==="info_string");if(O){let E=O.children.find((q)=>q.type==="language");if(E){let q=this.getNodeText(E,Y);if(z?.infoStringMap&&z.infoStringMap[q])G=z.infoStringMap[q];else G=q}}}}if(G){if(!V.has(G))V.set(G,[]);V.get(G).push({node:$.node,name:$.name})}}}for(let[$,Q]of V.entries()){let B=await this.getReusableParser($);if(!B){console.warn(`No parser found for injection language: ${$}`);continue}if(!Z.has($))Z.set($,[]);let G=B.parser;for(let{node:v}of Q)try{Z.get($).push({start:v.startIndex,end:v.endIndex});let O=this.getNodeText(v,Y),E=G.parse(O);if(E){let q=B.queries.highlights.captures(E.rootNode);for(let _ of q){let T={name:_.name,patternIndex:_.patternIndex,_injectedQuery:B.queries.highlights,node:{..._.node,startPosition:{row:_.node.startPosition.row+v.startPosition.row,column:_.node.startPosition.row===0?_.node.startPosition.column+v.startPosition.column:_.node.startPosition.column},endPosition:{row:_.node.endPosition.row+v.startPosition.row,column:_.node.endPosition.row===0?_.node.endPosition.column+v.startPosition.column:_.node.endPosition.column},startIndex:_.node.startIndex+v.startIndex,endIndex:_.node.endIndex+v.startIndex}};K.push(T)}E.delete()}}catch(O){console.error(`Error processing injection for language ${$}:`,O)}}return{captures:K,injectionRanges:Z}}editToRange(J){return{startPosition:{column:J.startPosition.column,row:J.startPosition.row},endPosition:{column:J.newEndPosition.column,row:J.newEndPosition.row},startIndex:J.startIndex,endIndex:J.newEndIndex}}async handleEdits(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=K;for(let q of Z)Y.tree.edit(q);let X=performance.now(),V=Y.parser.parse(K,Y.tree),$=performance.now()-X;if(this.performance.parseTimes.push($),this.performance.parseTimes.length>10)this.performance.parseTimes.shift();if(this.performance.averageParseTime=this.performance.parseTimes.reduce((q,_)=>q+_,0)/this.performance.parseTimes.length,!V)return{error:"Failed to parse buffer"};let Q=Y.tree.getChangedRanges(V);Y.tree=V;let B=performance.now(),G=[];if(Q.length===0)Z.forEach((q)=>{let _=this.editToRange(q);Q.push(_)});for(let q of Q){let _=Y.tree.rootNode.descendantForPosition(q.startPosition,q.endPosition);if(!_)continue;if(_.equals(Y.tree.rootNode)){let m=Y.queries.highlights.captures(_,{startIndex:q.startIndex-100,endIndex:q.endIndex+1000});G.push(...m);continue}while(_&&!this.nodeContainsRange(_,q))_=_.parent;if(!_)_=Y.tree.rootNode;let T=Y.queries.highlights.captures(_);G.push(...T)}let v=new Map;if(Y.queries.injections){let q=await this.processInjections(Y);G.push(...q.captures),v=q.injectionRanges}let E=performance.now()-B;if(this.performance.queryTimes.push(E),this.performance.queryTimes.length>10)this.performance.queryTimes.shift();return this.performance.averageQueryTime=this.performance.queryTimes.reduce((q,_)=>q+_,0)/this.performance.queryTimes.length,this.getHighlights(Y,G,v)}nodeContainsRange(J,K){return J.startPosition.row<=K.startPosition.row&&J.endPosition.row>=K.endPosition.row&&(J.startPosition.row<K.startPosition.row||J.startPosition.column<=K.startPosition.column)&&(J.endPosition.row>K.endPosition.row||J.endPosition.column>=K.endPosition.column)}getHighlights(J,K,Z){let Y=new Map,X=new Map;for(let V of K){let z=V.node,$=z.startPosition.row,Q=z.endPosition.row,B={startCol:z.startPosition.column,endCol:z.endPosition.column,group:V.name};if(!Y.has($))Y.set($,new Map),X.set($,new Map);if(Y.get($)?.has(z.id))X.get($)?.set(z.id,Y.get($)?.get(z.id));if(Y.get($)?.set(z.id,B),$!==Q)for(let G=$+1;G<=Q;G++){if(!Y.has(G))Y.set(G,new Map);let v={startCol:0,endCol:z.endPosition.column,group:V.name};Y.get(G)?.set(z.id,v)}}return{highlights:Array.from(Y.entries()).map(([V,z])=>({line:V,highlights:Array.from(z.values()),droppedHighlights:X.get(V)?Array.from(X.get(V).values()):[]}))}}getSimpleHighlights(J,K){let Z=[],Y=[];for(let[X,V]of K.entries())for(let z of V)Y.push({...z,lang:X});for(let X of J){let V=X.node,z=!1,$,Q=!1;for(let q of Y)if(V.startIndex>=q.start&&V.endIndex<=q.end){z=!0,$=q.lang;break}else if(V.startIndex<=q.start&&V.endIndex>=q.end){Q=!0;break}let G=X._injectedQuery?.setProperties?.[X.patternIndex],v=G?.conceal??X.setProperties?.conceal,O=G?.conceal_lines??X.setProperties?.conceal_lines,E={};if(z&&$)E.isInjection=!0,E.injectionLang=$;if(Q)E.containsInjection=!0;if(v!==void 0)E.conceal=v;if(O!==void 0)E.concealLines=O;if(Object.keys(E).length>0)Z.push([V.startIndex,V.endIndex,X.name,E]);else Z.push([V.startIndex,V.endIndex,X.name])}return Z.sort((X,V)=>X[0]-V[0]),Z}async handleResetBuffer(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=Z;let X=Y.parser.parse(Z);if(!X)return{error:"Failed to parse buffer during reset"};Y.tree=X;let V=Y.queries.highlights.captures(Y.tree.rootNode),z=new Map;if(Y.queries.injections){let $=await this.processInjections(Y);V.push(...$.captures),z=$.injectionRanges}return this.getHighlights(Y,V,z)}disposeBuffer(J){let K=this.bufferParsers.get(J);if(!K)return;K.tree.delete(),K.parser.delete(),this.bufferParsers.delete(J)}async handleOneShotHighlight(J,K,Z){let Y=await this.getReusableParser(K);if(!Y){A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!1,warning:`No parser available for filetype ${K}`});return}let X=K==="markdown"&&J.endsWith("```")?J+`
|
|
2
|
+
import{YN as L,ZN as I,aO as D}from"./chunk-qnv2v02g.js";import{hO as F}from"./chunk-0rmmg3g4.js";import{mkdir as W}from"fs/promises";import*as M from"path";import{mkdir as R,readFile as N,writeFile as k}from"fs/promises";import*as U from"path";import{isMainThread as y}from"worker_threads";import{basename as P,join as h}from"path";import{mkdir as p,writeFile as d}from"fs/promises";import{dirname as j,isAbsolute as c,resolve as l}from"path";import{fileURLToPath as H}from"url";class w{static hashUrl(J){let K=0;for(let Z=0;Z<J.length;Z++){let Y=J.charCodeAt(Z);K=(K<<5)-K+Y,K=K&K}return Math.abs(K).toString(16)}static async downloadOrLoad(J,K,Z,Y,X=!0,V){if(J.startsWith("http://")||J.startsWith("https://")){let $;if(X){let B=this.hashUrl(J);$=V?`${V}-${B}${Y}`:`${B}${Y}`}else $=U.basename(J);let Q=U.join(K,Z,$);await R(U.dirname(Q),{recursive:!0});try{let B=await N(Q);if(B.byteLength>0)return console.log(`Loaded from cache: ${Q} (${J})`),{content:B,filePath:Q}}catch(B){}try{console.log(`Downloading from URL: ${J}`);let B=await fetch(J);if(!B.ok)return{error:`Failed to fetch from ${J}: ${B.statusText}`};let G=Buffer.from(await B.arrayBuffer());try{await k(Q,Buffer.from(G)),console.log(`Cached: ${J}`)}catch(v){console.warn(`Failed to cache: ${v}`)}return{content:G,filePath:Q}}catch(B){return{error:`Error downloading from ${J}: ${B}`}}}else try{return console.log(`Loading from local path: ${J}`),{content:await N(J),filePath:J}}catch($){return{error:`Error loading from local path ${J}: ${$}`}}}static async downloadToPath(J,K){let Z=J.startsWith("http://")||J.startsWith("https://");if(await R(U.dirname(K),{recursive:!0}),Z)try{console.log(`Downloading from URL: ${J}`);let Y=await fetch(J);if(!Y.ok)return{error:`Failed to fetch from ${J}: ${Y.statusText}`};let X=Buffer.from(await Y.arrayBuffer());return await k(K,Buffer.from(X)),console.log(`Downloaded: ${J} -> ${K}`),{content:X,filePath:K}}catch(Y){return{error:`Error downloading from ${J}: ${Y}`}}else try{console.log(`Copying from local path: ${J}`);let Y=await N(J);return await k(K,Buffer.from(Y)),{content:Y,filePath:K}}catch(Y){return{error:`Error copying from local path ${J}: ${Y}`}}}static async fetchHighlightQueries(J,K,Z){let Y=J.map((z)=>this.fetchHighlightQuery(z,K,Z));return(await Promise.all(Y)).filter((z)=>z.trim().length>0).join(`
|
|
3
|
+
`)}static async fetchHighlightQuery(J,K,Z){let Y=await this.downloadOrLoad(J,K,"queries",".scm",!0,Z);if(Y.error)return console.error(`Error fetching highlight query from ${J}:`,Y.error),"";if(Y.content)return new TextDecoder().decode(Y.content);return""}}function f(J){return J.includes("$bunfs")||/^B:[\\/]~BUN/i.test(J)}function u(){return process.platform==="win32"?"B:\\~BUN\\root":"/$bunfs/root"}function g(J){return h(u(),P(J))}function o({onlyFirst:J=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",J?void 0:"g")}var s=o();function b(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(s,"")}function n(J){return J===161||J===164||J===167||J===168||J===170||J===173||J===174||J>=176&&J<=180||J>=182&&J<=186||J>=188&&J<=191||J===198||J===208||J===215||J===216||J>=222&&J<=225||J===230||J>=232&&J<=234||J===236||J===237||J===240||J===242||J===243||J>=247&&J<=250||J===252||J===254||J===257||J===273||J===275||J===283||J===294||J===295||J===299||J>=305&&J<=307||J===312||J>=319&&J<=322||J===324||J>=328&&J<=331||J===333||J===338||J===339||J===358||J===359||J===363||J===462||J===464||J===466||J===468||J===470||J===472||J===474||J===476||J===593||J===609||J===708||J===711||J>=713&&J<=715||J===717||J===720||J>=728&&J<=731||J===733||J===735||J>=768&&J<=879||J>=913&&J<=929||J>=931&&J<=937||J>=945&&J<=961||J>=963&&J<=969||J===1025||J>=1040&&J<=1103||J===1105||J===8208||J>=8211&&J<=8214||J===8216||J===8217||J===8220||J===8221||J>=8224&&J<=8226||J>=8228&&J<=8231||J===8240||J===8242||J===8243||J===8245||J===8251||J===8254||J===8308||J===8319||J>=8321&&J<=8324||J===8364||J===8451||J===8453||J===8457||J===8467||J===8470||J===8481||J===8482||J===8486||J===8491||J===8531||J===8532||J>=8539&&J<=8542||J>=8544&&J<=8555||J>=8560&&J<=8569||J===8585||J>=8592&&J<=8601||J===8632||J===8633||J===8658||J===8660||J===8679||J===8704||J===8706||J===8707||J===8711||J===8712||J===8715||J===8719||J===8721||J===8725||J===8730||J>=8733&&J<=8736||J===8739||J===8741||J>=8743&&J<=8748||J===8750||J>=8756&&J<=8759||J===8764||J===8765||J===8776||J===8780||J===8786||J===8800||J===8801||J>=8804&&J<=8807||J===8810||J===8811||J===8814||J===8815||J===8834||J===8835||J===8838||J===8839||J===8853||J===8857||J===8869||J===8895||J===8978||J>=9312&&J<=9449||J>=9451&&J<=9547||J>=9552&&J<=9587||J>=9600&&J<=9615||J>=9618&&J<=9621||J===9632||J===9633||J>=9635&&J<=9641||J===9650||J===9651||J===9654||J===9655||J===9660||J===9661||J===9664||J===9665||J>=9670&&J<=9672||J===9675||J>=9678&&J<=9681||J>=9698&&J<=9701||J===9711||J===9733||J===9734||J===9737||J===9742||J===9743||J===9756||J===9758||J===9792||J===9794||J===9824||J===9825||J>=9827&&J<=9829||J>=9831&&J<=9834||J===9836||J===9837||J===9839||J===9886||J===9887||J===9919||J>=9926&&J<=9933||J>=9935&&J<=9939||J>=9941&&J<=9953||J===9955||J===9960||J===9961||J>=9963&&J<=9969||J===9972||J>=9974&&J<=9977||J===9979||J===9980||J===9982||J===9983||J===10045||J>=10102&&J<=10111||J>=11094&&J<=11097||J>=12872&&J<=12879||J>=57344&&J<=63743||J>=65024&&J<=65039||J===65533||J>=127232&&J<=127242||J>=127248&&J<=127277||J>=127280&&J<=127337||J>=127344&&J<=127373||J===127375||J===127376||J>=127387&&J<=127404||J>=917760&&J<=917999||J>=983040&&J<=1048573||J>=1048576&&J<=1114109}function i(J){return J===12288||J>=65281&&J<=65376||J>=65504&&J<=65510}function r(J){return J>=4352&&J<=4447||J===8986||J===8987||J===9001||J===9002||J>=9193&&J<=9196||J===9200||J===9203||J===9725||J===9726||J===9748||J===9749||J>=9776&&J<=9783||J>=9800&&J<=9811||J===9855||J>=9866&&J<=9871||J===9875||J===9889||J===9898||J===9899||J===9917||J===9918||J===9924||J===9925||J===9934||J===9940||J===9962||J===9970||J===9971||J===9973||J===9978||J===9981||J===9989||J===9994||J===9995||J===10024||J===10060||J===10062||J>=10067&&J<=10069||J===10071||J>=10133&&J<=10135||J===10160||J===10175||J===11035||J===11036||J===11088||J===11093||J>=11904&&J<=11929||J>=11931&&J<=12019||J>=12032&&J<=12245||J>=12272&&J<=12287||J>=12289&&J<=12350||J>=12353&&J<=12438||J>=12441&&J<=12543||J>=12549&&J<=12591||J>=12593&&J<=12686||J>=12688&&J<=12773||J>=12783&&J<=12830||J>=12832&&J<=12871||J>=12880&&J<=42124||J>=42128&&J<=42182||J>=43360&&J<=43388||J>=44032&&J<=55203||J>=63744&&J<=64255||J>=65040&&J<=65049||J>=65072&&J<=65106||J>=65108&&J<=65126||J>=65128&&J<=65131||J>=94176&&J<=94180||J>=94192&&J<=94198||J>=94208&&J<=101589||J>=101631&&J<=101662||J>=101760&&J<=101874||J>=110576&&J<=110579||J>=110581&&J<=110587||J===110589||J===110590||J>=110592&&J<=110882||J===110898||J>=110928&&J<=110930||J===110933||J>=110948&&J<=110951||J>=110960&&J<=111355||J>=119552&&J<=119638||J>=119648&&J<=119670||J===126980||J===127183||J===127374||J>=127377&&J<=127386||J>=127488&&J<=127490||J>=127504&&J<=127547||J>=127552&&J<=127560||J===127568||J===127569||J>=127584&&J<=127589||J>=127744&&J<=127776||J>=127789&&J<=127797||J>=127799&&J<=127868||J>=127870&&J<=127891||J>=127904&&J<=127946||J>=127951&&J<=127955||J>=127968&&J<=127984||J===127988||J>=127992&&J<=128062||J===128064||J>=128066&&J<=128252||J>=128255&&J<=128317||J>=128331&&J<=128334||J>=128336&&J<=128359||J===128378||J===128405||J===128406||J===128420||J>=128507&&J<=128591||J>=128640&&J<=128709||J===128716||J>=128720&&J<=128722||J>=128725&&J<=128728||J>=128732&&J<=128735||J===128747||J===128748||J>=128756&&J<=128764||J>=128992&&J<=129003||J===129008||J>=129292&&J<=129338||J>=129340&&J<=129349||J>=129351&&J<=129535||J>=129648&&J<=129660||J>=129664&&J<=129674||J>=129678&&J<=129734||J===129736||J>=129741&&J<=129756||J>=129759&&J<=129770||J>=129775&&J<=129784||J>=131072&&J<=196605||J>=196608&&J<=262141}function a(J){if(!Number.isSafeInteger(J))throw TypeError(`Expected a code point, got \`${typeof J}\`.`)}function t(J,{ambiguousAsWide:K=!1}={}){if(a(J),i(J)||r(J)||K&&n(J))return 2;return 1}var x=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},e=new Intl.Segmenter,JJ=/^\p{Default_Ignorable_Code_Point}$/u;function KJ(J,K={}){if(typeof J!=="string"||J.length===0)return 0;let{ambiguousIsNarrow:Z=!0,countAnsiEscapeCodes:Y=!1}=K;if(!Y)J=b(J);if(J.length===0)return 0;let X=0,V={ambiguousAsWide:!Z};for(let{segment:z}of e.segment(J)){let $=z.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if(JJ.test(z))continue;if(x().test(z)){X+=2;continue}X+=t($,V)}return X}var YJ=new TextEncoder,C=globalThis.Bun,AJ=C?.sleep??$J,vJ=C?.stringWidth??KJ,OJ=C?.stripANSI??b,MJ=C?.write??XJ;async function ZJ(J,K,Z){if(!C){let X=typeof K==="function"?K():K;return H(X instanceof URL?X:new URL(X,Z))}let Y=(await J()).default;if(Y.startsWith("file:"))return H(Y);if(c(Y))return Y;return l(j(H(Z)),Y)}function $J(J){let K=J instanceof Date?J.getTime()-Date.now():J;return new Promise((Z)=>setTimeout(Z,K))}async function XJ(J,K,Z){let Y=J instanceof URL?H(J):J;if(Z?.createPath)await p(j(Y),{recursive:!0});let X=typeof K==="string"?YJ.encode(K):new Uint8Array(K.buffer,K.byteOffset,K.byteLength);return await d(Y,X,{mode:Z?.mode}),X.byteLength}var A=globalThis;class S{bufferParsers=new Map;filetypeParserOptions=new Map;filetypeAliases=new Map;filetypeParsers=new Map;filetypeParserPromises=new Map;reusableParsers=new Map;reusableParserPromises=new Map;initializePromise;performance;dataPath;tsDataPath;initialized=!1;constructor(){this.performance={averageParseTime:0,parseTimes:[],averageQueryTime:0,queryTimes:[]}}async fetchQueries(J,K){if(!this.tsDataPath)return"";return w.fetchHighlightQueries(J,this.tsDataPath,K)}async initialize({dataPath:J}){if(this.initializePromise)return this.initializePromise;return this.initializePromise=(async()=>{this.dataPath=J,this.tsDataPath=M.join(J,"tree-sitter"),await W(M.join(this.tsDataPath,"languages"),{recursive:!0}),await W(M.join(this.tsDataPath,"queries"),{recursive:!0});let K=await ZJ(()=>import("./chunk-1w3y1dkk.js",{with:{type:"wasm"}}),()=>import.meta.resolve("web-tree-sitter/tree-sitter.wasm"),import.meta.url);if(f(K))K=g(M.parse(K).base);await D.init({locateFile(){return K}}),this.initialized=!0})(),this.initializePromise}addFiletypeParser(J){let K=this.filetypeParserOptions.get(J.filetype)?.aliases??[];for(let Y of K)if(this.filetypeAliases.get(Y)===J.filetype)this.filetypeAliases.delete(Y);let Z=[...new Set((J.aliases??[]).filter((Y)=>Y!==J.filetype))];this.filetypeAliases.delete(J.filetype),this.filetypeParserOptions.set(J.filetype,{...J,aliases:Z});for(let Y of Z)this.filetypeAliases.set(Y,J.filetype);this.invalidateParserCaches(J.filetype)}resolveCanonicalFiletype(J){if(this.filetypeParserOptions.has(J))return J;return this.filetypeAliases.get(J)??J}invalidateParserCaches(J){this.filetypeParsers.delete(J),this.filetypeParserPromises.delete(J);let K=this.reusableParsers.get(J);if(K)K.parser.delete(),this.reusableParsers.delete(J);this.reusableParserPromises.delete(J)}async createQueries(J,K){try{let Z=await this.fetchQueries(J.queries.highlights,J.filetype);if(!Z){console.error("Failed to fetch highlight queries for:",J.filetype);return}let X={highlights:new L(K,Z)};if(J.queries.injections&&J.queries.injections.length>0){let V=await this.fetchQueries(J.queries.injections,J.filetype);if(V)X.injections=new L(K,V)}return X}catch(Z){console.error("Error creating queries for",J.filetype,J.queries),console.error(Z);return}}async loadLanguage(J){if(!this.initialized||!this.tsDataPath)return;let K=await w.downloadOrLoad(J,this.tsDataPath,"languages",".wasm",!1);if(K.error){console.error(`Error loading language ${J}:`,K.error);return}if(!K.filePath)return;let Z=K.filePath.replaceAll("\\","/");try{return await I.load(Z)}catch(Y){console.error(`Error loading language from ${Z}:`,Y);return}}async resolveFiletypeParser(J){let K=this.resolveCanonicalFiletype(J);if(this.filetypeParsers.has(K))return this.filetypeParsers.get(K);if(this.filetypeParserPromises.has(K))return this.filetypeParserPromises.get(K);let Z=this.loadFiletypeParser(K);this.filetypeParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.filetypeParsers.set(K,Y);return Y}finally{this.filetypeParserPromises.delete(K)}}async loadFiletypeParser(J){let K=this.filetypeParserOptions.get(J);if(!K)return;let Z=await this.loadLanguage(K.wasm);if(!Z)return;let Y=await this.createQueries(K,Z);if(!Y){console.error("Failed to create queries for:",J);return}return{...K,queries:Y,language:Z}}async preloadParser(J){return this.resolveFiletypeParser(J)}async getReusableParser(J){let K=this.resolveCanonicalFiletype(J);if(this.reusableParsers.has(K))return this.reusableParsers.get(K);if(this.reusableParserPromises.has(K))return this.reusableParserPromises.get(K);let Z=this.createReusableParser(K);this.reusableParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.reusableParsers.set(K,Y);return Y}finally{this.reusableParserPromises.delete(K)}}async createReusableParser(J){let K=await this.resolveFiletypeParser(J);if(!K)return;let Z=new D;return Z.setLanguage(K.language),{parser:Z,filetypeParser:K,queries:K.queries}}async handleInitializeParser(J,K,Z,Y,X){let V=await this.resolveFiletypeParser(Y);if(!V){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,warning:`No parser available for filetype ${Y}`});return}let z=new D;z.setLanguage(V.language);let $=z.parse(Z);if(!$){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,error:"Failed to parse buffer"});return}let Q={parser:z,tree:$,queries:V.queries,filetype:Y,content:Z,injectionMapping:V.injectionMapping};this.bufferParsers.set(J,Q),A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!0});let B=await this.initialQuery(Q);A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:J,version:K,...B})}async initialQuery(J){let Z=J.queries.highlights.captures(J.tree.rootNode),Y=new Map;if(J.queries.injections){let X=await this.processInjections(J);Z.push(...X.captures),Y=X.injectionRanges}return this.getHighlights(J,Z,Y)}getNodeText(J,K){return K.substring(J.startIndex,J.endIndex)}async processInjections(J){let K=[],Z=new Map;if(!J.queries.injections)return{captures:K,injectionRanges:Z};let Y=J.content,X=J.queries.injections.captures(J.tree.rootNode),V=new Map,z=J.injectionMapping;for(let $ of X){let Q=$.name;if(Q==="injection.content"||Q.includes("injection")){let B=$.node.type,G;if(z?.nodeTypes&&z.nodeTypes[B])G=z.nodeTypes[B];else if(B==="code_fence_content"){let v=$.node.parent;if(v){let O=v.children.find((E)=>E.type==="info_string");if(O){let E=O.children.find((q)=>q.type==="language");if(E){let q=this.getNodeText(E,Y);if(z?.infoStringMap&&z.infoStringMap[q])G=z.infoStringMap[q];else G=q}}}}if(G){if(!V.has(G))V.set(G,[]);V.get(G).push({node:$.node,name:$.name})}}}for(let[$,Q]of V.entries()){let B=await this.getReusableParser($);if(!B){console.warn(`No parser found for injection language: ${$}`);continue}if(!Z.has($))Z.set($,[]);let G=B.parser;for(let{node:v}of Q)try{Z.get($).push({start:v.startIndex,end:v.endIndex});let O=this.getNodeText(v,Y),E=G.parse(O);if(E){let q=B.queries.highlights.captures(E.rootNode);for(let _ of q){let T={name:_.name,patternIndex:_.patternIndex,_injectedQuery:B.queries.highlights,node:{..._.node,startPosition:{row:_.node.startPosition.row+v.startPosition.row,column:_.node.startPosition.row===0?_.node.startPosition.column+v.startPosition.column:_.node.startPosition.column},endPosition:{row:_.node.endPosition.row+v.startPosition.row,column:_.node.endPosition.row===0?_.node.endPosition.column+v.startPosition.column:_.node.endPosition.column},startIndex:_.node.startIndex+v.startIndex,endIndex:_.node.endIndex+v.startIndex}};K.push(T)}E.delete()}}catch(O){console.error(`Error processing injection for language ${$}:`,O)}}return{captures:K,injectionRanges:Z}}editToRange(J){return{startPosition:{column:J.startPosition.column,row:J.startPosition.row},endPosition:{column:J.newEndPosition.column,row:J.newEndPosition.row},startIndex:J.startIndex,endIndex:J.newEndIndex}}async handleEdits(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=K;for(let q of Z)Y.tree.edit(q);let X=performance.now(),V=Y.parser.parse(K,Y.tree),$=performance.now()-X;if(this.performance.parseTimes.push($),this.performance.parseTimes.length>10)this.performance.parseTimes.shift();if(this.performance.averageParseTime=this.performance.parseTimes.reduce((q,_)=>q+_,0)/this.performance.parseTimes.length,!V)return{error:"Failed to parse buffer"};let Q=Y.tree.getChangedRanges(V);Y.tree=V;let B=performance.now(),G=[];if(Q.length===0)Z.forEach((q)=>{let _=this.editToRange(q);Q.push(_)});for(let q of Q){let _=Y.tree.rootNode.descendantForPosition(q.startPosition,q.endPosition);if(!_)continue;if(_.equals(Y.tree.rootNode)){let m=Y.queries.highlights.captures(_,{startIndex:q.startIndex-100,endIndex:q.endIndex+1000});G.push(...m);continue}while(_&&!this.nodeContainsRange(_,q))_=_.parent;if(!_)_=Y.tree.rootNode;let T=Y.queries.highlights.captures(_);G.push(...T)}let v=new Map;if(Y.queries.injections){let q=await this.processInjections(Y);G.push(...q.captures),v=q.injectionRanges}let E=performance.now()-B;if(this.performance.queryTimes.push(E),this.performance.queryTimes.length>10)this.performance.queryTimes.shift();return this.performance.averageQueryTime=this.performance.queryTimes.reduce((q,_)=>q+_,0)/this.performance.queryTimes.length,this.getHighlights(Y,G,v)}nodeContainsRange(J,K){return J.startPosition.row<=K.startPosition.row&&J.endPosition.row>=K.endPosition.row&&(J.startPosition.row<K.startPosition.row||J.startPosition.column<=K.startPosition.column)&&(J.endPosition.row>K.endPosition.row||J.endPosition.column>=K.endPosition.column)}getHighlights(J,K,Z){let Y=new Map,X=new Map;for(let V of K){let z=V.node,$=z.startPosition.row,Q=z.endPosition.row,B={startCol:z.startPosition.column,endCol:z.endPosition.column,group:V.name};if(!Y.has($))Y.set($,new Map),X.set($,new Map);if(Y.get($)?.has(z.id))X.get($)?.set(z.id,Y.get($)?.get(z.id));if(Y.get($)?.set(z.id,B),$!==Q)for(let G=$+1;G<=Q;G++){if(!Y.has(G))Y.set(G,new Map);let v={startCol:0,endCol:z.endPosition.column,group:V.name};Y.get(G)?.set(z.id,v)}}return{highlights:Array.from(Y.entries()).map(([V,z])=>({line:V,highlights:Array.from(z.values()),droppedHighlights:X.get(V)?Array.from(X.get(V).values()):[]}))}}getSimpleHighlights(J,K){let Z=[],Y=[];for(let[X,V]of K.entries())for(let z of V)Y.push({...z,lang:X});for(let X of J){let V=X.node,z=!1,$,Q=!1;for(let q of Y)if(V.startIndex>=q.start&&V.endIndex<=q.end){z=!0,$=q.lang;break}else if(V.startIndex<=q.start&&V.endIndex>=q.end){Q=!0;break}let G=X._injectedQuery?.setProperties?.[X.patternIndex],v=G?.conceal??X.setProperties?.conceal,O=G?.conceal_lines??X.setProperties?.conceal_lines,E={};if(z&&$)E.isInjection=!0,E.injectionLang=$;if(Q)E.containsInjection=!0;if(v!==void 0)E.conceal=v;if(O!==void 0)E.concealLines=O;if(Object.keys(E).length>0)Z.push([V.startIndex,V.endIndex,X.name,E]);else Z.push([V.startIndex,V.endIndex,X.name])}return Z.sort((X,V)=>X[0]-V[0]),Z}async handleResetBuffer(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=Z;let X=Y.parser.parse(Z);if(!X)return{error:"Failed to parse buffer during reset"};Y.tree=X;let V=Y.queries.highlights.captures(Y.tree.rootNode),z=new Map;if(Y.queries.injections){let $=await this.processInjections(Y);V.push(...$.captures),z=$.injectionRanges}return this.getHighlights(Y,V,z)}disposeBuffer(J){let K=this.bufferParsers.get(J);if(!K)return;K.tree.delete(),K.parser.delete(),this.bufferParsers.delete(J)}async handleOneShotHighlight(J,K,Z){let Y=await this.getReusableParser(K);if(!Y){A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!1,warning:`No parser available for filetype ${K}`});return}let X=K==="markdown"&&J.endsWith("```")?J+`
|
|
4
4
|
`:J,V=Y.parser.parse(X);if(!V){A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!1,error:"Failed to parse content"});return}try{let z=Y.filetypeParser.queries.highlights.captures(V.rootNode),$=new Map;if(Y.filetypeParser.queries.injections){let B={parser:Y.parser,tree:V,queries:Y.filetypeParser.queries,filetype:K,content:J,injectionMapping:Y.filetypeParser.injectionMapping},G=await this.processInjections(B);z.push(...G.captures),$=G.injectionRanges}let Q=this.getSimpleHighlights(z,$);A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!0,highlights:Q})}finally{V.delete()}}async updateDataPath(J){this.dataPath=J,this.tsDataPath=M.join(J,"tree-sitter");try{await W(M.join(this.tsDataPath,"languages"),{recursive:!0}),await W(M.join(this.tsDataPath,"queries"),{recursive:!0})}catch(K){throw Error(`Failed to update data path: ${K}`)}}async clearCache(){if(!this.dataPath||!this.tsDataPath)throw Error("No data path configured");let{rm:J}=await import("fs/promises");try{let K=M.join(this.dataPath,"tree-sitter");await J(K,{recursive:!0,force:!0}),await W(M.join(K,"languages"),{recursive:!0}),await W(M.join(K,"queries"),{recursive:!0}),this.filetypeParsers.clear(),this.filetypeParserPromises.clear(),this.reusableParsers.clear(),this.reusableParserPromises.clear()}catch(K){throw Error(`Failed to clear cache: ${K}`)}}}if(!y){let J=function(Z,...Y){A.postMessage({type:"WORKER_LOG",logType:Z,data:Y})},K=new S;console.log=(...Z)=>J("log",...Z),console.error=(...Z)=>J("error",...Z),console.warn=(...Z)=>J("warn",...Z),A.onmessage=async(Z)=>{let{type:Y,bufferId:X,version:V,content:z,filetype:$,edits:Q,filetypeParser:B,messageId:G,dataPath:v}=Z.data;try{switch(Y){case"INIT":try{await K.initialize({dataPath:v}),A.postMessage({type:"INIT_RESPONSE"})}catch(_){A.postMessage({type:"INIT_RESPONSE",error:_ instanceof Error?_.stack||_.message:String(_)})}break;case"ADD_FILETYPE_PARSER":K.addFiletypeParser(B);break;case"PRELOAD_PARSER":let O=await K.preloadParser($);A.postMessage({type:"PRELOAD_PARSER_RESPONSE",messageId:G,hasParser:!!O});break;case"INITIALIZE_PARSER":await K.handleInitializeParser(X,V,z,$,G);break;case"HANDLE_EDITS":let E=await K.handleEdits(X,z,Q);if(E.highlights&&E.highlights.length>0)A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:X,version:V,...E});else if(E.warning)A.postMessage({type:"WARNING",bufferId:X,warning:E.warning});else if(E.error)A.postMessage({type:"ERROR",bufferId:X,error:E.error});break;case"GET_PERFORMANCE":A.postMessage({type:"PERFORMANCE_RESPONSE",performance:K.performance,messageId:G});break;case"RESET_BUFFER":let q=await K.handleResetBuffer(X,V,z);if(q.highlights&&q.highlights.length>0)A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:X,version:V,...q});else if(q.warning)A.postMessage({type:"WARNING",bufferId:X,warning:q.warning});else if(q.error)A.postMessage({type:"ERROR",bufferId:X,error:q.error});break;case"DISPOSE_BUFFER":K.disposeBuffer(X),A.postMessage({type:"BUFFER_DISPOSED",bufferId:X});break;case"ONESHOT_HIGHLIGHT":await K.handleOneShotHighlight(z,$,G);break;case"UPDATE_DATA_PATH":try{await K.updateDataPath(v),A.postMessage({type:"UPDATE_DATA_PATH_RESPONSE",messageId:G})}catch(_){A.postMessage({type:"UPDATE_DATA_PATH_RESPONSE",messageId:G,error:_ instanceof Error?_.message:String(_)})}break;case"CLEAR_CACHE":try{await K.clearCache(),A.postMessage({type:"CLEAR_CACHE_RESPONSE",messageId:G})}catch(_){A.postMessage({type:"CLEAR_CACHE_RESPONSE",messageId:G,error:_ instanceof Error?_.message:String(_)})}break;default:A.postMessage({type:"ERROR",bufferId:X,error:`Unknown message type: ${Y}`})}}catch(O){A.postMessage({type:"ERROR",bufferId:X,error:O instanceof Error?O.stack||O.message:String(O)})}}}
|
package/bundle/worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Wf as H}from"./chunk-jq81hb32.js";import{$f as x}from"./chunk-bqs6a1ts.js";import"./chunk-cjxp72dv.js";import"./chunk-2rxt1s22.js";import"./chunk-w98r39gd.js";import"./chunk-atd0q4v8.js";import"./chunk-nfg7nt13.js";import"./chunk-aqm597px.js";import"./chunk-8gy99gfb.js";import{_g as V,uh as O}from"./chunk-87x607rz.js";import"./chunk-9w5rx0fb.js";import"./chunk-wb69d52j.js";import"./chunk-pfn1db1m.js";import"./chunk-h56jxxvj.js";import"./chunk-x36jhtex.js";import"./chunk-c1ypbbka.js";import"./chunk-qnqqrvvs.js";import{el as Z,yj as Y}from"./chunk-3f054f69.js";import{gl as N}from"./chunk-26qt44f1.js";import{Ol as q,rl as C}from"./chunk-0ke6x10y.js";import"./chunk-meaybtcc.js";import"./chunk-rmsqb6r4.js";import"./chunk-3j7skhxg.js";import"./chunk-4pssh5d3.js";import"./chunk-9dpn4792.js";import"./chunk-pf7cj4jd.js";import"./chunk-9r6bvkp4.js";import"./chunk-amx3x4kd.js";import"./chunk-b50t4jc5.js";import"./chunk-nf8gkxbk.js";import"./chunk-zny2qaqa.js";import"./chunk-9va5eh9s.js";import"./chunk-mkyrg7gt.js";import"./chunk-7v4fzkbb.js";import"./chunk-cqtkxwd8.js";import"./chunk-pk0tytcm.js";import"./chunk-ww8ear80.js";import"./chunk-kyny0t2g.js";import"./chunk-3e8p4a3y.js";import"./chunk-qpm5afdz.js";import"./chunk-jtrcnpm7.js";import"./chunk-gaen9ya4.js";import"./chunk-dd11kryy.js";import"./chunk-msm3r7ny.js";import"./chunk-e075v4e9.js";import"./chunk-jv98gw88.js";import"./chunk-jhq5bvhs.js";import{tr as k}from"./chunk-p80dc6kt.js";import"./chunk-xw283h2r.js";import"./chunk-8cty50g7.js";import{Ar as G,Cs as W,as as j,ms as z,ts as T,xr as X}from"./chunk-v7ah9gg0.js";import"./chunk-d0m7nbbx.js";import"./chunk-vfj5nwab.js";import"./chunk-7w84hfxs.js";import"./chunk-ym4ydwrz.js";import"./chunk-vmgknvxs.js";import"./chunk-p409grvp.js";import"./chunk-ag9thqkv.js";import"./chunk-qnv2v02g.js";import"./chunk-7fx6x8x9.js";import"./chunk-0rmmg3g4.js";var $=W.create({service:"upgrade"});function L(D,E){if(D===!1)return"disabled";if(D===!0&&E==="patch")return"install";return"notify"}async function M(){if(G)return;let D=await O.runPromise(Z.Service.use((J)=>J.getGlobal())),E=await O.runPromise(N.Service.use((J)=>J.method())),K=await O.runPromise(N.Service.use((J)=>J.latest(E))).catch((J)=>{$.warn("failed to check for updates",{method:E,error:String(J)})});if(!K)return;if(!N.isNewerVersion(X,K)){$.warn("ignoring non-newer update version",{current:X,latest:K});return}if(T.QITQODE_ALWAYS_NOTIFY_UPDATE){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(T.QITQODE_DISABLE_AUTOUPDATE)return;let _=N.getReleaseType(X,K),Q=L(D.autoupdate,_);if(Q==="disabled")return;if(Q==="notify"){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(E==="unknown")return;await O.runPromise(N.Service.use((J)=>J.upgrade(E,K))).then(()=>Y.publish(N.Event.Updated,{version:K})).catch((J)=>{$.warn("auto-upgrade failed",{method:E,target:K,error:String(J)})})}import{writeHeapSnapshot as P}from"v8";j("worker");await W.init({print:process.argv.includes("--print-logs"),dev:N.isLocal(),level:(()=>{if(N.isLocal())return"DEBUG";return"INFO"})()});H.start();k("worker");C.on("event",(D)=>{z.emit("global.event",D)});var U,S={async fetch(D){let E={...D.headers},K=w();if(K&&!E.authorization&&!E.Authorization)E.Authorization=K;let _=new Request(D.url,{method:D.method,headers:E,body:D.body}),Q=await x.Default().app.fetch(_),J=await Q.text();return{status:Q.status,headers:Object.fromEntries(Q.headers.entries()),body:J}},snapshot(){return P("server.heapsnapshot")},async server(D){if(U)await U.stop(!0);return U=await x.listen(D),{url:U.url.toString()}},async checkUpgrade(D){await q.provide({directory:D.directory,init:()=>O.runPromise(V),fn:async()=>{await M().catch(()=>{})}})},async reload(){await O.runPromise(Z.Service.use((D)=>D.invalidate(!0)))},async shutdown(){if(W.Default.info("worker shutting down"),await q.disposeAll(),U)await U.stop(!0)}};z.listen(S);function w(){let D=T.QITQODE_SERVER_PASSWORD;if(!D)return;let E=T.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${btoa(`${E}:${D}`)}`}export{S as rpc};
|
package/package.json
CHANGED
package/bundle/chunk-0bvde0cx.js
DELETED
package/bundle/chunk-0kbxnazj.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Af as l}from"./chunk-aptkpdkc.js";import"./chunk-zfnbk5gy.js";import{Eg as q}from"./chunk-sbt7qmwm.js";import"./chunk-nfg7nt13.js";import"./chunk-ktmazmas.js";import{CP as C}from"./chunk-hh4c02fh.js";function J(){return async(f,b)=>{if("_zod"in f)return l()(f,{components:b.components,options:{io:"input",...b.options}});try{let{createSchema:w}=await import("./chunk-pyq01301.js"),{schema:B,components:k}=w(f,{schemaType:"input",...b.options});if(k)b.components.schemas={...b.components.schemas,...k};return B}catch{throw Error(q('Missing dependencies "zod-openapi v4".'))}}}export{J as default};
|
package/bundle/chunk-0z3z0gk1.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Tl as no,Ul as Vi,Vl as oo,Wl as ci,Yl as $i,Zl as Qi}from"./chunk-g7vkkmsk.js";import{$l as _r,$m as gt,$n as Xt,Am as Pr,An as lt,Bm as Ur,Bn as At,Cm as Zr,Cn as Ot,Co as Zi,Dm as vr,Dn as dt,Em as Xr,En as Lo,Fm as Yr,Fn as Go,Gm as H,Gn as $t,Hm as zr,Hn as Qt,Im as kr,In as Bt,Jm as Vr,Jn as Dt,Km as cr,Kn as It,Lm as wr,Ln as Lt,Mm as qr,Mn as Gt,Nm as Fr,Nn as Mt,Om as ar,On as xt,Pm as jr,Pn as Ct,Qm as br,Qn as Jt,Rm as hr,Rn as Ht,Sm as nt,Sn as Kt,Tm as ot,Tn as Rt,Um as rt,Un as St,Vm as tt,Vn as Et,Wm as it,Wn as Wt,Xm as et,Xn as Pt,Ym as mt,Yn as Ut,Zm as yt,Zn as Zt,_l as pr,_m as ft,_n as vt,am as En,an as a,ao as Yt,bm as Wn,bn as Q,bo as zt,cm as Nr,cn as fn,co as kt,dm as Tr,dn as yn,do as Vt,em as lr,en as Yo,eo as ct,fn as ut,fo as wt,gm as Ar,gn as X,go as qt,hm as Or,hn as so,ho as Ft,im as dr,in as Pn,io as at,jm as $r,jn as po,jo as jt,km as Qr,kn as _o,ko as bt,lm as Br,ln as No,lo as ht,mm as Dr,mn as To,mo as ni,nm as Ir,nn as lo,no as oi,om as Lr,on as Ao,oo as ri,pm as Gr,pn as Oo,po as ti,qm as Mr,qn as st,qo as ii,rm as xr,rn as $o,ro as ei,sm as Cr,sn as Qo,so as mi,tm as Jr,tn as Bo,to as yi,um as Hr,un as pt,uo as ao,vm as Kr,vn as Do,vo as fi,wm as Rr,wn as _t,wo as gi,xm as Sr,xn as Io,xo as ui,ym as Er,yn as Nt,zm as Wr,zn as Tt}from"./chunk-m8djypsy.js";import{gp as bn,kp as hn}from"./chunk-3z1y040p.js";import{Ap as Yi}from"./chunk-3tdqsm5c.js";import{Bp as Jo}from"./chunk-a5zjrwqy.js";import{Dr as Xn,Er as ro,Fr as Nn,Gr as Hi,Hr as Wi,Jr as Ki}from"./chunk-tk3bve0x.js";import{Kr as Si}from"./chunk-0w4v0fbs.js";import{Qs as eo}from"./chunk-f3kjp838.js";import{Us as Wo,ft as un,pt as dn,qt as nn,zt as V}from"./chunk-zk8n8hnh.js";import{Lt as di,Ot as wo,Pt as c,Tt as go}from"./chunk-1jh5p5qw.js";import{Vt as j}from"./chunk-f89gntcy.js";import{CA as Kn,gA as Tn,oA as Cn}from"./chunk-v2kyarwz.js";import{BJ as Ln,LF as h,ON as N,TE as Eo,ZO as Oi,_E as kn,_N as vo,fF as sn,mI as r,rC as wn,vF as Ai,wD as Qn}from"./chunk-dkm7x8rj.js";import{AP as On}from"./chunk-hh4c02fh.js";var qo={};On(qo,{run:()=>ji});var mn={time_created:a().notNull().$default(()=>Date.now()),time_updated:a().notNull().$onUpdate(()=>Date.now())};var x=yn("project",{id:Q().$type().primaryKey(),worktree:Q().notNull(),vcs:Q(),name:Q(),icon_url:Q(),icon_color:Q(),...mn,time_initialized:a(),sandboxes:Q({mode:"json"}).notNull().$type(),commands:Q({mode:"json"}).$type()});var gn=yn("session",{id:Q().$type().primaryKey(),project_id:Q().$type().notNull().references(()=>x.id,{onDelete:"cascade"}),workspace_id:Q().$type(),parent_id:Q().$type(),context_from:Q().$type(),context_watermark:Q().$type(),slug:Q().notNull(),directory:Q().notNull(),title:Q().notNull(),version:Q().notNull(),share_url:Q(),summary_additions:a(),summary_deletions:a(),summary_files:a(),summary_diffs:Q({mode:"json"}).$type(),revert:Q({mode:"json"}).$type(),permission:Q({mode:"json"}).$type(),...mn,time_compacting:a(),time_archived:a(),last_checkpoint_message_id:Q().$type()},(n)=>[fn("session_project_idx").on(n.project_id),fn("session_workspace_idx").on(n.workspace_id),fn("session_parent_idx").on(n.parent_id),fn("session_context_from_idx").on(n.context_from)]),fo=yn("message",{id:Q().$type().primaryKey(),session_id:Q().$type().notNull().references(()=>gn.id,{onDelete:"cascade"}),agent_id:Q().notNull().default("main"),...mn,data:Q({mode:"json"}).notNull().$type()},(n)=>[fn("message_session_time_created_id_idx").on(n.session_id,n.time_created,n.id),fn("message_session_agent_idx").on(n.session_id,n.agent_id,n.id)]),zo=yn("part",{id:Q().$type().primaryKey(),message_id:Q().$type().notNull().references(()=>fo.id,{onDelete:"cascade"}),session_id:Q().$type().notNull(),...mn,data:Q({mode:"json"}).notNull().$type()},(n)=>[fn("part_message_id_id_idx").on(n.message_id,n.id),fn("part_session_idx").on(n.session_id)]),ko=yn("todo",{session_id:Q().$type().notNull().references(()=>gn.id,{onDelete:"cascade"}),content:Q().notNull(),status:Q().notNull(),position:a().notNull(),...mn},(n)=>[Yo({columns:[n.session_id,n.position]}),fn("todo_session_idx").on(n.session_id)]),Vo=yn("permission",{project_id:Q().primaryKey().references(()=>x.id,{onDelete:"cascade"}),...mn,data:Q({mode:"json"}).notNull().$type()});var co=yn("session_share",{session_id:Q().primaryKey().references(()=>gn.id,{onDelete:"cascade"}),id:Q().notNull(),secret:Q().notNull(),url:Q().notNull(),...mn});import k from"path";var v=V.create({service:"json-migration"});async function ji(n,o){let t=k.join(dn.Path.data,"storage");if(!await go.exists(t))return v.info("storage directory does not exist, skipping migration"),{projects:0,sessions:0,messages:0,parts:0,todos:0,permissions:0,shares:0,errors:[]};v.info("starting json to sqlite migration",{storageDir:t});let s=performance.now();n.run("PRAGMA journal_mode = WAL"),n.run("PRAGMA synchronous = OFF"),n.run("PRAGMA cache_size = 10000"),n.run("PRAGMA temp_store = MEMORY");let e={projects:0,sessions:0,messages:0,parts:0,todos:0,permissions:0,shares:0,errors:[]},l={sessions:0,todos:0,permissions:0,shares:0},_=e.errors,A=1000,C=Date.now();async function S(g){return wo.scan(g,{cwd:t,absolute:!0})}async function K(g,G,J){let B=J-G,T=Array(B);for(let P=0;P<B;P++)T[P]=go.readJson(g[G+P]);let M=await Promise.allSettled(T),Z=Array(B);for(let P=0;P<M.length;P++){let w=M[P];if(w.status==="fulfilled"){Z[P]=w.value;continue}_.push(`failed to read ${g[G+P]}: ${w.reason}`)}return Z}function R(g,G,J){if(g.length===0)return 0;try{return n.insert(G).values(g).onConflictDoNothing().run(),g.length}catch(B){return _.push(`failed to migrate ${J} batch: ${B}`),0}}v.info("scanning files...");let[E,d,D,L,u,p,m]=await Promise.all([S("project/*.json"),S("session/*/*.json"),S("message/*/*.json"),S("part/*/*.json"),S("todo/*.json"),S("permission/*.json"),S("session_share/*.json")]);v.info("file scan complete",{projects:E.length,sessions:d.length,messages:D.length,parts:L.length,todos:u.length,permissions:p.length,shares:m.length});let f=Math.max(1,E.length+d.length+D.length+L.length+u.length+p.length+m.length),i=o?.progress,y=0,$=(g,G)=>{y=Math.min(f,y+G),i?.({current:y,total:f,label:g})};i?.({current:y,total:f,label:"starting"}),n.run("BEGIN TRANSACTION");let I=new Set,O=[];for(let g=0;g<E.length;g+=A){let G=Math.min(g+A,E.length),J=await K(E,g,G);O.length=0;for(let B=0;B<J.length;B++){let T=J[B];if(!T)continue;let M=k.basename(E[g+B],".json");I.add(M),O.push({id:M,worktree:T.worktree??"/",vcs:T.vcs,name:T.name??void 0,icon_url:T.icon?.url,icon_color:T.icon?.color,time_created:T.time?.created??C,time_updated:T.time?.updated??C,time_initialized:T.time?.initialized,sandboxes:T.sandboxes??[],commands:T.commands})}e.projects+=R(O,x,"project"),$("projects",G-g)}v.info("migrated projects",{count:e.projects,duration:Math.round(performance.now()-s)});let U=d.map((g)=>k.basename(k.dirname(g))),z=new Set,en=[];for(let g=0;g<d.length;g+=A){let G=Math.min(g+A,d.length),J=await K(d,g,G);en.length=0;for(let B=0;B<J.length;B++){let T=J[B];if(!T)continue;let M=k.basename(d[g+B],".json"),Z=U[g+B];if(!I.has(Z)){l.sessions++;continue}z.add(M),en.push({id:M,project_id:Z,parent_id:T.parentID??null,slug:T.slug??"",directory:T.directory??"",title:T.title??"",version:T.version??"",share_url:T.share?.url??null,summary_additions:T.summary?.additions??null,summary_deletions:T.summary?.deletions??null,summary_files:T.summary?.files??null,summary_diffs:T.summary?.diffs??null,revert:T.revert??null,permission:T.permission??null,time_created:T.time?.created??C,time_updated:T.time?.updated??C,time_compacting:T.time?.compacting??null,time_archived:T.time?.archived??null})}e.sessions+=R(en,gn,"session"),$("sessions",G-g)}if(v.info("migrated sessions",{count:e.sessions}),l.sessions>0)v.warn("skipped orphaned sessions",{count:l.sessions});let pn=[],W=[],qn=new Map;for(let g of D){let G=k.basename(k.dirname(g));if(!z.has(G))continue;pn.push(g),W.push(G)}for(let g=0;g<pn.length;g+=A){let G=Math.min(g+A,pn.length),J=await K(pn,g,G),B=Array(J.length),T=0;for(let M=0;M<J.length;M++){let Z=J[M];if(!Z)continue;let P=pn[g+M],w=k.basename(P,".json"),Sn=W[g+M];qn.set(w,Sn);let Bn=Z;delete Bn.id,delete Bn.sessionID,B[T++]={id:w,session_id:Sn,time_created:Z.time?.created??C,time_updated:Z.time?.updated??C,data:Bn}}B.length=T,e.messages+=R(B,fo,"message"),$("messages",G-g)}v.info("migrated messages",{count:e.messages});for(let g=0;g<L.length;g+=A){let G=Math.min(g+A,L.length),J=await K(L,g,G),B=Array(J.length),T=0;for(let M=0;M<J.length;M++){let Z=J[M];if(!Z)continue;let P=L[g+M],w=k.basename(P,".json"),Sn=k.basename(k.dirname(P)),Bn=qn.get(Sn);if(!Bn){_.push(`part missing message session: ${P}`);continue}if(!z.has(Bn))continue;let jn=Z;delete jn.id,delete jn.messageID,delete jn.sessionID,B[T++]={id:w,message_id:Sn,session_id:Bn,time_created:Z.time?.created??C,time_updated:Z.time?.updated??C,data:jn}}B.length=T,e.parts+=R(B,zo,"part"),$("parts",G-g)}v.info("migrated parts",{count:e.parts});let An=u.map((g)=>k.basename(g,".json"));for(let g=0;g<u.length;g+=A){let G=Math.min(g+A,u.length),J=await K(u,g,G),B=[];for(let T=0;T<J.length;T++){let M=J[T];if(!M)continue;let Z=An[g+T];if(!z.has(Z)){l.todos++;continue}if(!Array.isArray(M)){_.push(`todo not an array: ${u[g+T]}`);continue}for(let P=0;P<M.length;P++){let w=M[P];if(!w?.content||!w?.status)continue;B.push({session_id:Z,content:w.content,status:w.status,position:P,time_created:C,time_updated:C})}}e.todos+=R(B,ko,"todo"),$("todos",G-g)}if(v.info("migrated todos",{count:e.todos}),l.todos>0)v.warn("skipped orphaned todos",{count:l.todos});let Fn=p.map((g)=>k.basename(g,".json")),Rn=[];for(let g=0;g<p.length;g+=A){let G=Math.min(g+A,p.length),J=await K(p,g,G);Rn.length=0;for(let B=0;B<J.length;B++){let T=J[B];if(!T)continue;let M=Fn[g+B];if(!I.has(M)){l.permissions++;continue}Rn.push({project_id:M,data:T})}e.permissions+=R(Rn,Vo,"permission"),$("permissions",G-g)}if(v.info("migrated permissions",{count:e.permissions}),l.permissions>0)v.warn("skipped orphaned permissions",{count:l.permissions});let an=m.map((g)=>k.basename(g,".json")),Gn=[];for(let g=0;g<m.length;g+=A){let G=Math.min(g+A,m.length),J=await K(m,g,G);Gn.length=0;for(let B=0;B<J.length;B++){let T=J[B];if(!T)continue;let M=an[g+B];if(!z.has(M)){l.shares++;continue}if(!T?.id||!T?.secret||!T?.url){_.push(`session_share missing id/secret/url: ${m[g+B]}`);continue}Gn.push({session_id:M,id:T.id,secret:T.secret,url:T.url})}e.shares+=R(Gn,co,"session_share"),$("shares",G-g)}if(v.info("migrated session shares",{count:e.shares}),l.shares>0)v.warn("skipped orphaned session shares",{count:l.shares});if(n.run("COMMIT"),v.info("json migration complete",{projects:e.projects,sessions:e.sessions,messages:e.messages,parts:e.parts,todos:e.todos,permissions:e.permissions,shares:e.shares,errorCount:e.errors.length,duration:Math.round(performance.now()-s)}),e.errors.length>0)v.warn("migration errors",{errors:e.errors.slice(0,20)});return i?.({current:f,total:f,label:"complete"}),e}var In={};On(In,{use:()=>Je,transaction:()=>Ke,textDecoder:()=>mt,sumDistinct:()=>tr,sum:()=>rr,sql:()=>H,relationsOrderToSQL:()=>ii,relationsFilterToSQL:()=>ti,relationToSQL:()=>mi,relationExtrasToSQL:()=>ei,processRelations:()=>Wt,placeholder:()=>kr,param:()=>Yr,orderSelectedFields:()=>ar,orderByOperators:()=>Vt,or:()=>po,operators:()=>kt,notLike:()=>Nt,notInArray:()=>st,notIlike:()=>lt,notExists:()=>pt,notBetween:()=>_t,not:()=>_o,noopMapper:()=>vr,noopEncoder:()=>Zr,noopDecoder:()=>Ur,ne:()=>so,name:()=>Wr,min:()=>er,max:()=>ir,mapUpdateSet:()=>br,mapResultRow:()=>Fr,mapRelationalRow:()=>wt,mapColumnsInSQLToAlias:()=>Ht,mapColumnsInAliasedSQLToAlias:()=>Jt,lte:()=>Ao,lt:()=>lo,like:()=>Io,l2Distance:()=>mr,l1Distance:()=>yr,jaccardDistance:()=>sr,isWithEnum:()=>ft,isView:()=>wr,isTable:()=>Lr,isSQLWrapper:()=>Kr,isNull:()=>$o,isNotNull:()=>Qo,isDriverValueEncoder:()=>Pr,isConfig:()=>et,is:()=>En,innerProduct:()=>fr,inArray:()=>Oo,ilike:()=>Tt,haveSameKeys:()=>jr,hasOwnEntityKind:()=>_r,hammingDistance:()=>ur,gte:()=>To,gt:()=>No,getViewSelectedFields:()=>ot,getViewName:()=>qr,getTableUniqueName:()=>Mr,getTableName:()=>Gr,getTableLikeName:()=>tt,getTableColumns:()=>nt,getTableAsAliasSQL:()=>yi,getOriginalColumnFromAlias:()=>Kt,getOrderByOperators:()=>ct,getColumns:()=>rt,getColumnTable:()=>Nr,getColumnNameAndConfig:()=>it,getChannelPath:()=>zi,fillPlaceholders:()=>Vr,fieldSelectionToSQL:()=>ri,extractTablesFromSchema:()=>ht,extractExtendedColumnType:()=>Tr,exists:()=>Bo,eq:()=>X,entityKind:()=>pr,effect:()=>He,desc:()=>Go,defineRelationsPart:()=>oi,defineRelations:()=>ni,createRelationsHelper:()=>bt,countDistinct:()=>ho,count:()=>uo,cosineDistance:()=>gr,close:()=>Ce,buildRelationsParts:()=>Ut,buildRelations:()=>Pt,bindIfParam:()=>ut,between:()=>Do,avgDistinct:()=>or,avg:()=>nr,assertUnreachable:()=>yt,asc:()=>Lo,arrayOverlaps:()=>dt,arrayContains:()=>At,arrayContained:()=>Ot,applyMixins:()=>hr,and:()=>Pn,aliasedTableColumn:()=>Ct,aliasedTable:()=>Gt,aliasedRelation:()=>xt,aliasedColumn:()=>Mt,WithSubquery:()=>Cr,ViewSelectionAliasProxyHandler:()=>Bt,ViewBaseConfig:()=>Jr,View:()=>cr,TransactionRollbackError:()=>Et,TableSchema:()=>Ar,TableColumns:()=>Or,TableAliasProxyHandler:()=>Dt,Table:()=>Ir,Subquery:()=>xr,StringChunk:()=>Rr,SQL:()=>Sr,RelationsHelperStatic:()=>jt,RelationsBuilderTable:()=>qt,RelationsBuilderJunctionColumn:()=>at,RelationsBuilderColumn:()=>Ft,RelationTableAliasProxyHandler:()=>Lt,Relation:()=>Zt,QueryPromise:()=>$t,Placeholder:()=>zr,Path:()=>Po,Param:()=>Xr,OriginalName:()=>$r,One:()=>vt,NotFoundError:()=>xe,NoopLogger:()=>ui,Name:()=>Er,Many:()=>Xt,IsAlias:()=>Br,FakePrimitiveParam:()=>Hr,ExtraConfigColumns:()=>dr,ExtraConfigBuilder:()=>Dr,DrizzleQueryError:()=>St,DrizzleError:()=>Rt,DefaultLogger:()=>gi,Count:()=>zt,ConsoleLogWriter:()=>fi,ColumnTableAliasProxyHandler:()=>Qt,ColumnBuilder:()=>lr,ColumnAliasProxyHandler:()=>It,Column:()=>Wn,Client:()=>Jn,CONSTANTS:()=>gt,BaseName:()=>Qr,AggregatedField:()=>Yt});import bi from"crypto";import Fo,{existsSync as hi,readdirSync as ne}from"fs";import{join as oe}from"path";function jo(n){if(Fo.existsSync(`${n.migrationsFolder}/meta/_journal.json`))throw Error('We detected that you have old drizzle-kit migration folders. You must upgrade drizzle-kit and run "drizzle-kit up"');let o=n.migrationsFolder,t=[],s=ne(o).map((e)=>({path:oe(o,e,"migration.sql"),name:e})).filter((e)=>hi(e.path));s.sort((e,l)=>e.name.localeCompare(l.name));for(let e of s){let l=e.path,_=e.name.slice(0,14),A=Fo.readFileSync(l).toString(),C=A.split("--> statement-breakpoint").map((K)=>{return K}),S=ao(_);t.push({sql:C,bps:!0,folderMillis:S,hash:bi.createHash("sha256").update(A).digest("hex"),name:e.name})}return t}function bo(n,o){if(Array.isArray(o)||"migrationsJournal"in o){let s=Array.isArray(o)?o:o.migrationsJournal,e=Array.isArray(o)?void 0:o.migrationsTable,l=s.map((_)=>({sql:_.sql.split("--> statement-breakpoint"),folderMillis:_.timestamp,hash:"",bps:!0,name:_.name}));return n.dialect.migrate(l,n.session,{migrationsTable:e})}let t=jo(o);return n.dialect.migrate(t,n.session,o)}function uo(n){return H`count(${n||H.raw("*")})`.mapWith(Number)}function ho(n){return H`count(distinct ${n})`.mapWith(Number)}function nr(n){return H`avg(${n})`.mapWith(String)}function or(n){return H`avg(distinct ${n})`.mapWith(String)}function rr(n){return H`sum(${n})`.mapWith(String)}function tr(n){return H`sum(distinct ${n})`.mapWith(String)}function ir(n){return H`max(${n})`.mapWith(En(n,Wn)?n:String)}function er(n){return H`min(${n})`.mapWith(En(n,Wn)?n:String)}function Mn(n){return JSON.stringify(n)}function mr(n,o){if(Array.isArray(o))return H`${n} <-> ${Mn(o)}`;return H`${n} <-> ${o}`}function yr(n,o){if(Array.isArray(o))return H`${n} <+> ${Mn(o)}`;return H`${n} <+> ${o}`}function fr(n,o){if(Array.isArray(o))return H`${n} <#> ${Mn(o)}`;return H`${n} <#> ${o}`}function gr(n,o){if(Array.isArray(o))return H`${n} <=> ${Mn(o)}`;return H`${n} <=> ${o}`}function ur(n,o){if(Array.isArray(o))return H`${n} <~> ${Mn(o)}`;return H`${n} <~> ${o}`}function sr(n,o){if(Array.isArray(o))return H`${n} <%> ${Mn(o)}`;return H`${n} <%> ${o}`}import io from"path";var Yn={};On(Yn,{workspaceID:()=>de,useEffect:()=>Be,use:()=>Qe,make:()=>$e,invalidate:()=>Ie,has:()=>De,get:()=>So,directory:()=>to,context:()=>Ro,bind:()=>Oe});import{EventEmitter as re}from"events";var Un=new re;var Mo=new Set;function si(n){return Mo.add(n),()=>{Mo.delete(n)}}async function xo(n){await Promise.allSettled([...Mo].map((o)=>o(n)))}function Zn(n){return n()}var xi={};On(xi,{setInitialized:()=>se,list:()=>ge,layer:()=>Mi,get:()=>ue,fromRow:()=>_n,defaultLayer:()=>Ko,UpdateInput:()=>fe,Service:()=>xn,Info:()=>Li,Event:()=>Gi});import*as F from"fs/promises";import*as Bi from"os";import*as $n from"path";var te=N.String.pipe(N.brand("ProjectID")),q=te.pipe(bn((n)=>({global:n.make("global"),zod:j.string().pipe(j.custom())})));import*as Dn from"fs/promises";import*as b from"path";import*as Ni from"crypto";async function Co(n){let o=b.resolve(n);while(!0){let t=b.join(o,".git"),s=await Dn.stat(t).catch(()=>null);if(s){if(s.isDirectory())return t;let _=(await Dn.readFile(t,"utf-8")).trim().match(/^gitdir:\s*(.+)$/);if(!_)return null;let A=b.isAbsolute(_[1])?_[1]:b.resolve(o,_[1]);return b.resolve(A,"../..")}let e=b.dirname(o);if(e===o)return null;o=e}}async function pi(n){let o=await Dn.readFile(n,"utf-8").catch(()=>null);if(o===null)return null;return o.trim()||null}async function _i(n){let o=await pi(n);if(o)return o;let t=Ni.randomUUID();try{return await Dn.writeFile(n,t,{flag:"wx"}),t}catch(s){if(s.code!=="EEXIST")throw s;let e=await pi(n);if(e)return e;throw Error(`Project ID file was concurrently created but is empty: ${n}`)}}async function Ti(n){let o=await Co(n);if(o){let s=b.join(o,"qitqode-project-id");return q.make(await _i(s))}let t=b.join(n,".qitqode-project-id");return q.make(await _i(t))}async function ee(n){let o=await Co(n);if(!o)return;let t=$n.join(n,".qitqode-project-id"),s=$n.join(o,"qitqode-project-id"),e=(A)=>F.access(A).then(()=>!0).catch(()=>!1);if(await e(t)){if(!await e(s)){let A=await F.readFile(t,"utf-8");await F.writeFile(s,A)}await F.unlink(t).catch(()=>{})}let l=$n.join(o,"info","exclude");if(await F.mkdir($n.dirname(l),{recursive:!0}),!(await F.readFile(l,"utf-8").catch(()=>"")).includes(".qitqode-project-id"))await F.appendFile(l,`
|
|
3
|
-
.qitqode-project-id
|
|
4
|
-
`)}var li=V.create({service:"project"}),me=262144,Ho=N.Literal("git"),Di=N.Struct({url:N.optional(N.String),override:N.optional(N.String),color:N.optional(N.String)}),Ii=N.Struct({start:N.optional(N.String.annotate({description:"Startup script to run when creating a new workspace (worktree)"}))}),ye=N.Struct({created:N.Number,updated:N.Number,initialized:N.optional(N.Number)}),Li=N.Struct({id:q,worktree:N.String,vcs:N.optional(Ho),name:N.optional(N.String),icon:N.optional(Di),commands:N.optional(Ii),time:ye,sandboxes:N.Array(N.String)}).annotate({identifier:"Project"}).pipe(bn((n)=>({zod:hn(n)}))),Gi={Updated:Qi.define("project.updated",Li.zod)};function _n(n){let o=n.icon_url||n.icon_color?{url:n.icon_url??void 0,color:n.icon_color??void 0}:void 0;return{id:n.id,worktree:n.worktree,vcs:n.vcs?N.decodeUnknownSync(Ho)(n.vcs):void 0,name:n.name??void 0,icon:o,time:{created:n.time_created,updated:n.time_updated,initialized:n.time_initialized??void 0},sandboxes:n.sandboxes,commands:n.commands??void 0}}var fe=j.object({projectID:q.zod,name:j.string().optional(),icon:hn(Di).optional(),commands:hn(Ii).optional()});class xn extends Qn.Service()("@qitqode/Project"){}var Mi=h.effect(xn,r.gen(function*(){let n=yield*c.Service,o=yield*Oi.Path,t=yield*no.ChildProcessSpawner,s=r.fnUntraced(function*(i,y){return yield*$i(t,i,y)},r.catch(()=>r.succeed({code:1,text:"",stderr:""}))),e=(i)=>r.sync(()=>In.use(i)),l=(i)=>r.sync(()=>Un.emit("event",{directory:"global",project:i.id,payload:{type:Gi.Updated.type,properties:i}})),_=N.decodeUnknownSync(N.optional(Ho))(nn.QITQODE_FAKE_VCS),A=(i,y)=>{if(!y)return i;if(y=y.replace(/[\r\n]+$/,""),!y)return i;if(y=c.windowsPath(y),o.isAbsolute(y))return o.normalize(y);return o.resolve(i,y)},C=yield*Ai.Scope,S=r.fn("Project.fromDirectory")(function*(i){li.info("fromDirectory",{directory:i});let y=yield*r.gen(function*(){if(nn.QITQODE_DISABLE_GIT)return{id:q.global,worktree:i,sandbox:i,vcs:_};let z=(yield*n.up({targets:[".git"],start:i}).pipe(r.orDie))[0];if(!z)return{id:q.global,worktree:"/",sandbox:"/",vcs:_};let en=o.dirname(z),pn=process.env.HOME??process.env.USERPROFILE??Bi.homedir();if(en===pn||$n.parse(en).root===en)return li.warn("ignoring .git at home or filesystem root, snapshots disabled",{dotgit:z}),{id:q.global,worktree:i,sandbox:i,vcs:_};let W=en,qn=yield*r.sync(()=>Jo("git")),An;if(!qn)return{id:An??q.global,worktree:W,sandbox:W,vcs:_};let Fn=yield*s(["rev-parse","--git-common-dir"],{cwd:W});if(Fn.code!==0)return{id:An??q.global,worktree:W,sandbox:W,vcs:_};let Rn=(()=>{let Gn=A(W,Fn.text.trim());return Gn===W?W:o.dirname(Gn)})();if(An==null)yield*r.promise(()=>ee(W)),An=yield*r.promise(()=>Ti(W));let an=yield*s(["rev-parse","--show-toplevel"],{cwd:W});if(an.code!==0)return{id:An,worktree:W,sandbox:W,vcs:_};return W=A(W,an.text.trim()),{id:An,sandbox:W,worktree:Rn,vcs:"git"}}),$=yield*e((U)=>U.select().from(x).where(X(x.id,y.id)).get()),I=$?_n($):{id:y.id,worktree:y.worktree,vcs:y.vcs,sandboxes:[],time:{created:Date.now(),updated:Date.now()}};if(nn.QITQODE_EXPERIMENTAL_ICON_DISCOVERY)yield*K(I).pipe(r.ignore,r.forkIn(C));let O={...I,worktree:y.worktree,vcs:y.vcs,time:{...I.time,updated:Date.now()}};if(y.sandbox!==O.worktree&&!O.sandboxes.includes(y.sandbox))O.sandboxes.push(y.sandbox);if(O.sandboxes=yield*r.forEach(O.sandboxes,(U)=>n.exists(U).pipe(r.orDie,r.map((z)=>z?U:void 0)),{concurrency:16}).pipe(r.map((U)=>U.filter((z)=>z!==void 0))),yield*e((U)=>U.insert(x).values({id:O.id,worktree:O.worktree,vcs:O.vcs??null,name:O.name,icon_url:O.icon?.url,icon_color:O.icon?.color,time_created:O.time.created,time_updated:O.time.updated,time_initialized:O.time.initialized,sandboxes:O.sandboxes,commands:O.commands}).onConflictDoUpdate({target:x.id,set:{worktree:O.worktree,vcs:O.vcs??null,name:O.name,icon_url:O.icon?.url,icon_color:O.icon?.color,time_updated:O.time.updated,time_initialized:O.time.initialized,sandboxes:O.sandboxes,commands:O.commands}}).run()),y.id!==q.global)yield*e((U)=>U.update(gn).set({project_id:y.id}).where(Pn(X(gn.project_id,q.global),X(gn.directory,y.worktree))).run());return yield*l(O),{project:O,sandbox:y.sandbox}}),K=r.fn("Project.discover")(function*(i){if(i.vcs!=="git")return;if(i.icon?.override)return;if(i.icon?.url)return;let $=(yield*n.glob("**/favicon.{ico,png,svg,jpg,jpeg,webp}",{cwd:i.worktree,absolute:!0,include:"file"}).pipe(r.orDie)).sort((pn,W)=>pn.length-W.length)[0];if(!$)return;let I=yield*n.stat($).pipe(r.orDie);if(Number(I.size)>me)return;let O=yield*n.readFile($).pipe(r.orDie),U=Buffer.from(O).toString("base64"),en=`data:${c.mimeType($)};base64,${U}`;yield*d({projectID:i.id,icon:{url:en}})}),R=r.fn("Project.list")(function*(){return yield*e((i)=>i.select().from(x).all().map(_n))}),E=r.fn("Project.get")(function*(i){let y=yield*e(($)=>$.select().from(x).where(X(x.id,i)).get());return y?_n(y):void 0}),d=r.fn("Project.update")(function*(i){let y=yield*e((I)=>I.update(x).set({name:i.name,icon_url:i.icon?.url,icon_color:i.icon?.color,commands:i.commands,time_updated:Date.now()}).where(X(x.id,i.projectID)).returning().get());if(!y)throw Error(`Project not found: ${i.projectID}`);let $=_n(y);return yield*l($),$}),D=r.fn("Project.initGit")(function*(i){if(i.project.vcs==="git")return i.project;if(!(yield*r.sync(()=>Jo("git"))))throw Error("Git is not installed");let y=yield*s(["init","--quiet"],{cwd:i.directory});if(y.code!==0)throw Error(y.stderr.trim()||y.text.trim()||"Failed to initialize git repository");let{project:$}=yield*S(i.directory);return $}),L=r.fn("Project.setInitialized")(function*(i){yield*e((y)=>y.update(x).set({time_initialized:Date.now()}).where(X(x.id,i)).run())}),u=r.fn("Project.sandboxes")(function*(i){let y=yield*e((I)=>I.select().from(x).where(X(x.id,i)).get());if(!y)return[];let $=_n(y);return yield*r.forEach($.sandboxes,(I)=>n.isDir(I).pipe(r.orDie,r.map((O)=>O?I:void 0)),{concurrency:16}).pipe(r.map((I)=>I.filter((O)=>O!==void 0)))}),p=r.fnUntraced(function*(i,y){let $=yield*e((I)=>I.update(x).set({sandboxes:y,time_updated:Date.now()}).where(X(x.id,i)).returning().get());if(!$)throw Error(`Project not found: ${i}`);yield*l(_n($))}),m=r.fn("Project.addSandbox")(function*(i,y){let $=yield*e((O)=>O.select().from(x).where(X(x.id,i)).get());if(!$)throw Error(`Project not found: ${i}`);let I=[...$.sandboxes];if(!I.includes(y))I.push(y);yield*p(i,I)}),f=r.fn("Project.removeSandbox")(function*(i,y){let $=yield*e((O)=>O.select().from(x).where(X(x.id,i)).get());if(!$)throw Error(`Project not found: ${i}`);let I=$.sandboxes.filter((O)=>O!==y);yield*p(i,I)});return xn.of({fromDirectory:S,discover:K,list:R,get:E,update:d,initGit:D,setInitialized:L,sandboxes:u,addSandbox:m,removeSandbox:f})})),Ko=Mi.pipe(h.provide(oo),h.provide(c.defaultLayer),h.provide(di.layer));function ge(){return In.use((n)=>n.select().from(x).all().map((o)=>_n(o)))}function ue(n){let o=In.use((t)=>t.select().from(x).where(X(x.id,n)).get());if(!o)return;return _n(o)}function se(n){In.use((o)=>o.update(x).set({time_initialized:Date.now()}).where(X(x.id,n)).run())}import{parse as pe}from"path";var rn=un.create("instance");Hi(()=>rn.use());var tn=new Map,_e=Ki(xn,Ko),Ne=new Set(["/etc","/proc","/sys","/dev","/boot","/root","/var","/private/etc","/private/var"]);function Te(n){if(n===pe(n).root)return"filesystem root is not a valid project directory";for(let o of Ne)if(n===o||c.contains(o,n))return"target is a protected system directory";return null}function le(n){let o=Te(n);if(o)throw Error("Access denied: "+o)}var vn={all:void 0};function Ci(n){return Zn(async()=>{let o=n.project&&n.worktree?{directory:n.directory,worktree:n.worktree,project:n.project}:await _e.runPromise((t)=>t.fromDirectory(n.directory)).then(({project:t,sandbox:s})=>({directory:n.directory,worktree:s,project:t}));return await rn.provide(o,async()=>{await n.init?.()}),o})}function Ji(n,o){let t=o.catch((s)=>{if(tn.get(n)===t)tn.delete(n);throw s});return tn.set(n,t),t}var on={async provide(n){let o=c.resolve(n.directory);le(o);let t=tn.get(o);if(!t)V.Default.info("creating instance",{directory:o}),t=Ji(o,Ci({directory:o,init:n.init}));let s=await t;return rn.provide(s,async()=>{return n.fn()})},get current(){return rn.use()},get directory(){return rn.use().directory},get worktree(){return rn.use().worktree},get project(){return rn.use().project},containsPath(n,o){let t=o??on;if(c.contains(t.directory,n))return!0;if(t.worktree==="/")return!1;return c.contains(t.worktree,n)},bind(n){let o=rn.use();return(...t)=>rn.provide(o,()=>n(...t))},restore(n,o){return rn.provide(n,o)},async reload(n){let o=c.resolve(n.directory);V.Default.info("reloading instance",{directory:o}),await xo(o),tn.delete(o);let t=Ji(o,Ci({...n,directory:o}));return Un.emit("event",{directory:o,project:n.project?.id,workspace:Nn.workspaceID,payload:{type:"server.instance.disposed",properties:{directory:o}}}),await t},async dispose(){let{directory:n,project:o}=on;V.Default.info("disposing instance",{directory:n}),await xo(n),tn.delete(n),Un.emit("event",{directory:n,project:o.id,workspace:Nn.workspaceID,payload:{type:"server.instance.disposed",properties:{directory:n}}})},async disposeAll(){if(vn.all)return vn.all;return vn.all=Zn(async()=>{V.Default.info("disposing all instances");let n=[...tn.entries()];for(let[o,t]of n){if(tn.get(o)!==t)continue;let s=await t.catch((e)=>{V.Default.warn("instance dispose failed",{key:o,error:e});return});if(!s){if(tn.get(o)===t)tn.delete(o);continue}if(tn.get(o)!==t)continue;await rn.provide(s,async()=>{await on.dispose()})}}).finally(()=>{vn.all=void 0}),vn.all}};var Ri="~qitqode/InstanceState",Oe=(n)=>{try{return on.bind(n)}catch(s){if(!(s instanceof un.NotFound))throw s}let o=Ln.getCurrent(),t=o?Qn.getReferenceUnsafe(o.context,Xn):void 0;if(!t)return n;return(...s)=>on.restore(t,()=>n(...s))},Ro=r.gen(function*(){return(yield*Xn)??on.current}),de=r.gen(function*(){return(yield*ro)??Nn.workspaceID}),to=r.map(Ro,(n)=>n.directory),$e=(n)=>r.gen(function*(){let o=yield*Cn.make({capacity:Number.POSITIVE_INFINITY,lookup:()=>r.gen(function*(){return yield*n(yield*Ro)})}),t=si((s)=>r.runPromise(Cn.invalidate(o,s).pipe(r.provide(Si))));return yield*r.addFinalizer(()=>r.sync(t)),{[Ri]:Ri,cache:o}}),So=(n)=>r.gen(function*(){return yield*Cn.get(n.cache,yield*to)}),Qe=(n,o)=>r.map(So(n),o),Be=(n,o)=>r.flatMap(So(n),o),De=(n)=>r.gen(function*(){return yield*Cn.has(n.cache,yield*to)}),Ie=(n)=>r.gen(function*(){return yield*Cn.invalidate(n.cache,yield*to)});var Pi={};On(Pi,{make:()=>Le});function Ei(n,o,t){if(n&&o!==void 0)return Nn.restore(o,()=>on.restore(n,t));if(n)return on.restore(n,t);if(o!==void 0)return Nn.restore(o,t);return t()}function Le(){return r.gen(function*(){let n=yield*r.context(),t=(yield*Xn)??(()=>{try{return on.current}catch(_){if(!(_ instanceof un.NotFound))throw _}})(),s=(yield*ro)??Nn.workspaceID,e=(_)=>Wi(_,{instance:t,workspace:s}),l=(_)=>e(_).pipe(r.provide(n));return{promise:(_)=>Ei(t,s,()=>r.runPromise(l(_))),fork:(_)=>Ei(t,s,()=>r.runFork(l(_)))}})}var Ui={};On(Ui,{make:()=>Ge,Cancelled:()=>zn});class zn extends N.TaggedErrorClass()("RunnerCancelled",{}){}var Ge=(n,o)=>{let t=Tn.makeUnsafe({_tag:"Idle"}),s=o?.onIdle??r.void,e=o?.onBusy??r.void,l=o?.onInterrupt,_=0,A=()=>Tn.getUnsafe(t),C=()=>{return _+=1,_},S=(m,f)=>kn.isFailure(f)&&Eo.hasInterruptsOnly(f.cause)?sn.fail(m,new zn).pipe(r.asVoid):sn.done(m,f).pipe(r.asVoid),K=()=>Tn.modify(t,(m)=>[m._tag==="Idle"?s:r.void,m]).pipe(r.flatten),R=(m,f,i)=>Tn.modify(t,(y)=>[r.gen(function*(){if(y._tag==="Running"&&y.run.id===m)yield*s;yield*S(f,i)}),y._tag==="Running"&&y.run.id===m?{_tag:"Idle"}:y]).pipe(r.flatten),E=(m,f)=>r.gen(function*(){let i=C(),y=yield*m.pipe(r.onExit(($)=>R(i,f,$)),r.forkIn(n));return{id:i,done:f,fiber:y}}),d=(m)=>Tn.modifyEffect(t,r.fnUntraced(function*(f){if(f._tag==="Shell"&&f.shell.id===m)return[s,{_tag:"Idle"}];if(f._tag==="ShellThenRun"&&f.shell.id===m){let i=yield*E(f.run.work,f.run.done);return[r.void,{_tag:"Running",run:i}]}return[r.void,f]})).pipe(r.flatten),D=(m)=>Ln.interrupt(m.fiber),L=(m)=>Tn.modifyEffect(t,r.fnUntraced(function*(f){switch(f._tag){case"Running":case"ShellThenRun":if(o?.onReentryWarn)yield*o.onReentryWarn({label:o.label??"(unlabeled)",existingRunId:f.run.id});return[sn.await(f.run.done),f];case"Shell":{let i={id:C(),done:yield*sn.make(),work:m};return[sn.await(i.done),{_tag:"ShellThenRun",shell:f.shell,run:i}]}case"Idle":{let i=yield*sn.make(),y=yield*E(m,i);return[sn.await(i),{_tag:"Running",run:y}]}}})).pipe(r.flatten,r.catch((f)=>f instanceof zn?l??r.die(f):r.fail(f))),u=(m)=>Tn.modifyEffect(t,r.fnUntraced(function*(f){if(f._tag!=="Idle")return[r.sync(()=>{if(o?.busy)o.busy();throw Error("Runner is busy")}),f];yield*e;let i=C(),y=yield*m.pipe(r.ensuring(d(i)),r.forkChild),$={id:i,fiber:y};return[r.gen(function*(){let I=yield*Ln.await(y);if(kn.isSuccess(I))return I.value;if(Eo.hasInterruptsOnly(I.cause)&&l)return yield*l;return yield*r.failCause(I.cause)}),{_tag:"Shell",shell:$}]})).pipe(r.flatten),p=Tn.modify(t,(m)=>{switch(m._tag){case"Idle":return[r.void,m];case"Running":return[r.gen(function*(){yield*Ln.interrupt(m.run.fiber);let f=yield*Ln.await(m.run.fiber);yield*S(m.run.done,f),yield*sn.await(m.run.done).pipe(r.exit,r.asVoid),yield*K()}),{_tag:"Idle"}];case"Shell":return[r.gen(function*(){yield*D(m.shell),yield*K()}),{_tag:"Idle"}];case"ShellThenRun":return[r.gen(function*(){yield*sn.fail(m.run.done,new zn).pipe(r.asVoid),yield*D(m.shell),yield*K()}),{_tag:"Idle"}]}}).pipe(r.flatten);return{get state(){return A()},get busy(){return A()._tag!=="Idle"},ensureRunning:L,startShell:u,cancel:p}};import{Database as Me}from"bun:sqlite";function vi(n){let o=new Me(n,{create:!0});return Zi({client:o})}var xe=eo.create("NotFoundError",j.object({message:j.string()})),Xi=V.create({service:"db"});function zi(){if(["latest","beta","prod"].includes(Wo)||nn.QITQODE_DISABLE_CHANNEL_DB)return io.join(dn.Path.data,"qitqode.db");let n=Wo.replace(/[^a-zA-Z0-9._-]/g,"-");return io.join(dn.Path.data,`qitqode-${n}.db`)}var Po=Zn(()=>{if(nn.QITQODE_DB){if(nn.QITQODE_DB===":memory:"||io.isAbsolute(nn.QITQODE_DB))return nn.QITQODE_DB;return io.join(dn.Path.data,nn.QITQODE_DB)}return zi()}),Jn=Yi(()=>{Xi.info("opening database",{path:Po});let n=vi(Po);n.run("PRAGMA journal_mode = WAL"),n.run("PRAGMA synchronous = NORMAL"),n.run("PRAGMA busy_timeout = 5000"),n.run("PRAGMA cache_size = -64000"),n.run("PRAGMA foreign_keys = ON"),n.run("PRAGMA wal_checkpoint(PASSIVE)");let o=[{sql:"CREATE TABLE `project` (\n\t`id` text PRIMARY KEY,\n\t`worktree` text NOT NULL,\n\t`vcs` text,\n\t`name` text,\n\t`icon_url` text,\n\t`icon_color` text,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`time_initialized` integer,\n\t`sandboxes` text NOT NULL\n);\n--> statement-breakpoint\nCREATE TABLE `message` (\n\t`id` text PRIMARY KEY,\n\t`session_id` text NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`data` text NOT NULL,\n\tCONSTRAINT `fk_message_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE TABLE `part` (\n\t`id` text PRIMARY KEY,\n\t`message_id` text NOT NULL,\n\t`session_id` text NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`data` text NOT NULL,\n\tCONSTRAINT `fk_part_message_id_message_id_fk` FOREIGN KEY (`message_id`) REFERENCES `message`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE TABLE `permission` (\n\t`project_id` text PRIMARY KEY,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`data` text NOT NULL,\n\tCONSTRAINT `fk_permission_project_id_project_id_fk` FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE TABLE `session` (\n\t`id` text PRIMARY KEY,\n\t`project_id` text NOT NULL,\n\t`parent_id` text,\n\t`slug` text NOT NULL,\n\t`directory` text NOT NULL,\n\t`title` text NOT NULL,\n\t`version` text NOT NULL,\n\t`share_url` text,\n\t`summary_additions` integer,\n\t`summary_deletions` integer,\n\t`summary_files` integer,\n\t`summary_diffs` text,\n\t`revert` text,\n\t`permission` text,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`time_compacting` integer,\n\t`time_archived` integer,\n\tCONSTRAINT `fk_session_project_id_project_id_fk` FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE TABLE `todo` (\n\t`session_id` text NOT NULL,\n\t`content` text NOT NULL,\n\t`status` text NOT NULL,\n\t`priority` text NOT NULL,\n\t`position` integer NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\tCONSTRAINT `todo_pk` PRIMARY KEY(`session_id`, `position`),\n\tCONSTRAINT `fk_todo_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE TABLE `session_share` (\n\t`session_id` text PRIMARY KEY,\n\t`id` text NOT NULL,\n\t`secret` text NOT NULL,\n\t`url` text NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\tCONSTRAINT `fk_session_share_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE INDEX `message_session_idx` ON `message` (`session_id`);--> statement-breakpoint\nCREATE INDEX `part_message_idx` ON `part` (`message_id`);--> statement-breakpoint\nCREATE INDEX `part_session_idx` ON `part` (`session_id`);--> statement-breakpoint\nCREATE INDEX `session_project_idx` ON `session` (`project_id`);--> statement-breakpoint\nCREATE INDEX `session_parent_idx` ON `session` (`parent_id`);--> statement-breakpoint\nCREATE INDEX `todo_session_idx` ON `todo` (`session_id`);",timestamp:1769552633000,name:"20260127222353_familiar_lady_ursula"},{sql:"ALTER TABLE `project` ADD `commands` text;",timestamp:1770830228000,name:"20260211171708_add_project_commands"},{sql:"CREATE TABLE `control_account` (\n\t`email` text NOT NULL,\n\t`url` text NOT NULL,\n\t`access_token` text NOT NULL,\n\t`refresh_token` text NOT NULL,\n\t`token_expiry` integer,\n\t`active` integer NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\tCONSTRAINT `control_account_pk` PRIMARY KEY(`email`, `url`)\n);\n",timestamp:1770993676000,name:"20260213144116_wakeful_the_professor"},{sql:"CREATE TABLE `workspace` (\n\t`id` text PRIMARY KEY,\n\t`branch` text,\n\t`project_id` text NOT NULL,\n\t`config` text NOT NULL,\n\tCONSTRAINT `fk_workspace_project_id_project_id_fk` FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON DELETE CASCADE\n);\n",timestamp:1772056728000,name:"20260225215848_workspace"},{sql:"ALTER TABLE `session` ADD `workspace_id` text;--> statement-breakpoint\nCREATE INDEX `session_workspace_idx` ON `session` (`workspace_id`);",timestamp:1772228279000,name:"20260227213759_add_session_workspace_id"},{sql:"CREATE TABLE `account` (\n\t`id` text PRIMARY KEY,\n\t`email` text NOT NULL,\n\t`url` text NOT NULL,\n\t`access_token` text NOT NULL,\n\t`refresh_token` text NOT NULL,\n\t`token_expiry` integer,\n\t`selected_org_id` text,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL\n);\n--> statement-breakpoint\nCREATE TABLE `account_state` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`active_account_id` text,\n\tFOREIGN KEY (`active_account_id`) REFERENCES `account`(`id`) ON UPDATE no action ON DELETE set null\n);\n",timestamp:1772310750000,name:"20260228203230_blue_harpoon"},{sql:"ALTER TABLE `workspace` ADD `type` text NOT NULL;--> statement-breakpoint\nALTER TABLE `workspace` ADD `name` text;--> statement-breakpoint\nALTER TABLE `workspace` ADD `directory` text;--> statement-breakpoint\nALTER TABLE `workspace` ADD `extra` text;--> statement-breakpoint\nALTER TABLE `workspace` DROP COLUMN `config`;",timestamp:1772579546000,name:"20260303231226_add_workspace_fields"},{sql:"ALTER TABLE `account_state` ADD `active_org_id` text;--> statement-breakpoint\nUPDATE `account_state` SET `active_org_id` = (SELECT `selected_org_id` FROM `account` WHERE `account`.`id` = `account_state`.`active_account_id`);--> statement-breakpoint\nALTER TABLE `account` DROP COLUMN `selected_org_id`;\n",timestamp:1773097200000,name:"20260309230000_move_org_to_state"},{sql:"DROP INDEX IF EXISTS `message_session_idx`;--> statement-breakpoint\nDROP INDEX IF EXISTS `part_message_idx`;--> statement-breakpoint\nCREATE INDEX `message_session_time_created_id_idx` ON `message` (`session_id`,`time_created`,`id`);--> statement-breakpoint\nCREATE INDEX `part_message_id_id_idx` ON `part` (`message_id`,`id`);",timestamp:1773290071000,name:"20260312043431_session_message_cursor"},{sql:"CREATE TABLE `event_sequence` (\n\t`aggregate_id` text PRIMARY KEY,\n\t`seq` integer NOT NULL\n);\n--> statement-breakpoint\nCREATE TABLE `event` (\n\t`id` text PRIMARY KEY,\n\t`aggregate_id` text NOT NULL,\n\t`seq` integer NOT NULL,\n\t`type` text NOT NULL,\n\t`data` text NOT NULL,\n\tCONSTRAINT `fk_event_aggregate_id_event_sequence_aggregate_id_fk` FOREIGN KEY (`aggregate_id`) REFERENCES `event_sequence`(`aggregate_id`) ON DELETE CASCADE\n);\n",timestamp:1774309702000,name:"20260323234822_events"},{sql:"PRAGMA foreign_keys=OFF;--> statement-breakpoint\nCREATE TABLE `__new_workspace` (\n\t`id` text PRIMARY KEY,\n\t`type` text NOT NULL,\n\t`name` text DEFAULT '' NOT NULL,\n\t`branch` text,\n\t`directory` text,\n\t`extra` text,\n\t`project_id` text NOT NULL,\n\tCONSTRAINT `fk_workspace_project_id_project_id_fk` FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nINSERT INTO `__new_workspace`(`id`, `type`, `branch`, `name`, `directory`, `extra`, `project_id`) SELECT `id`, `type`, `branch`, `name`, `directory`, `extra`, `project_id` FROM `workspace`;--> statement-breakpoint\nDROP TABLE `workspace`;--> statement-breakpoint\nALTER TABLE `__new_workspace` RENAME TO `workspace`;--> statement-breakpoint\nPRAGMA foreign_keys=ON;",timestamp:1775843113000,name:"20260410174513_workspace-name"},{sql:"CREATE TABLE `session_entry` (\n\t`id` text PRIMARY KEY,\n\t`session_id` text NOT NULL,\n\t`type` text NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`data` text NOT NULL,\n\tCONSTRAINT `fk_session_entry_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE INDEX `session_entry_session_idx` ON `session_entry` (`session_id`);--> statement-breakpoint\nCREATE INDEX `session_entry_session_type_idx` ON `session_entry` (`session_id`,`type`);--> statement-breakpoint\nCREATE INDEX `session_entry_time_created_idx` ON `session_entry` (`time_created`);",timestamp:1776103196000,name:"20260413175956_chief_energizer"},{sql:"ALTER TABLE `session` ADD `context_from` text;--> statement-breakpoint\nALTER TABLE `session` ADD `context_watermark` text;--> statement-breakpoint\nCREATE INDEX `session_context_from_idx` ON `session` (`context_from`);\n",timestamp:1776873600000,name:"20260422160000_context_inheritance"},{sql:"CREATE TABLE `task_registry` (\n `id` text PRIMARY KEY,\n `parent_session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `status` text NOT NULL,\n `agent` text NOT NULL,\n `description` text NOT NULL,\n `context_mode` text NOT NULL,\n `background` integer NOT NULL,\n `last_turn_time` integer NOT NULL,\n `turn_count` integer NOT NULL DEFAULT 0,\n `error` text,\n `time_completed` integer,\n `time_created` integer NOT NULL,\n `time_updated` integer NOT NULL\n);--> statement-breakpoint\nCREATE INDEX `task_registry_parent_idx` ON `task_registry` (`parent_session_id`);--> statement-breakpoint\nCREATE INDEX `task_registry_status_idx` ON `task_registry` (`status`);--> statement-breakpoint\nCREATE INDEX `task_registry_status_last_turn_idx` ON `task_registry` (`status`, `last_turn_time`);\n",timestamp:1776877200000,name:"20260422170000_task_registry"},{sql:"DROP INDEX IF EXISTS `session_entry_session_idx`;--> statement-breakpoint\nDROP INDEX IF EXISTS `session_entry_session_type_idx`;--> statement-breakpoint\nDROP INDEX IF EXISTS `session_entry_time_created_idx`;--> statement-breakpoint\nDROP TABLE IF EXISTS `session_entry`;\n",timestamp:1776956061000,name:"20260423145421_remove_session_entry"},{sql:"DROP INDEX IF EXISTS `task_registry_parent_idx`;--> statement-breakpoint\nDROP INDEX IF EXISTS `task_registry_status_idx`;--> statement-breakpoint\nDROP INDEX IF EXISTS `task_registry_status_last_turn_idx`;--> statement-breakpoint\nALTER TABLE `task_registry` RENAME TO `actor_registry`;--> statement-breakpoint\nCREATE INDEX `actor_registry_parent_idx` ON `actor_registry` (`parent_session_id`);--> statement-breakpoint\nCREATE INDEX `actor_registry_status_idx` ON `actor_registry` (`status`);--> statement-breakpoint\nCREATE INDEX `actor_registry_status_last_turn_idx` ON `actor_registry` (`status`, `last_turn_time`);\n",timestamp:1778803200000,name:"20260515000000_actor_rename"},{sql:"CREATE TABLE `memory_fts` (\n `path` text PRIMARY KEY NOT NULL,\n `scope` text NOT NULL,\n `scope_id` text DEFAULT '' NOT NULL,\n `type` text NOT NULL,\n `body` text NOT NULL,\n `fingerprint` text NOT NULL,\n `last_indexed_at` integer NOT NULL\n);\n--> statement-breakpoint\nCREATE INDEX `memory_fts_scope_idx` ON `memory_fts` (`scope`, `scope_id`);\n--> statement-breakpoint\nCREATE INDEX `memory_fts_type_idx` ON `memory_fts` (`type`);\n--> statement-breakpoint\nCREATE VIRTUAL TABLE `memory_fts_idx` USING fts5(\n body,\n content='memory_fts',\n content_rowid='rowid',\n tokenize='unicode61 remove_diacritics 1'\n);\n--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ai` AFTER INSERT ON `memory_fts` BEGIN\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.rowid, NEW.body);\nEND;\n--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ad` AFTER DELETE ON `memory_fts` BEGIN\n DELETE FROM `memory_fts_idx` WHERE rowid = OLD.rowid;\nEND;\n--> statement-breakpoint\nCREATE TRIGGER `memory_fts_au` AFTER UPDATE ON `memory_fts` BEGIN\n DELETE FROM `memory_fts_idx` WHERE rowid = OLD.rowid;\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.rowid, NEW.body);\nEND;\n",timestamp:1778806800000,name:"20260515010000_memory_fts"},{sql:"CREATE TABLE `task` (\n `id` text NOT NULL,\n `session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `parent_task_id` text,\n `kind` text NOT NULL DEFAULT 'user',\n `status` text NOT NULL,\n `focus` integer NOT NULL DEFAULT 0,\n `summary` text NOT NULL,\n `created_at` integer NOT NULL,\n `last_event_at` integer NOT NULL,\n `ended_at` integer,\n `cleanup_after` integer,\n PRIMARY KEY (`session_id`, `id`)\n);--> statement-breakpoint\nCREATE INDEX `task_session_idx` ON `task` (`session_id`);--> statement-breakpoint\nCREATE INDEX `task_parent_idx` ON `task` (`session_id`, `parent_task_id`);--> statement-breakpoint\nCREATE INDEX `task_status_idx` ON `task` (`status`);--> statement-breakpoint\nCREATE INDEX `task_kind_idx` ON `task` (`kind`);--> statement-breakpoint\nCREATE UNIQUE INDEX `task_focus_per_session_idx` ON `task` (`session_id`) WHERE focus = 1;--> statement-breakpoint\nCREATE TABLE `task_event` (\n `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n `session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `task_id` text NOT NULL,\n `at` integer NOT NULL,\n `kind` text NOT NULL,\n `summary` text,\n FOREIGN KEY (`session_id`, `task_id`) REFERENCES `task`(`session_id`, `id`) ON DELETE CASCADE\n);--> statement-breakpoint\nCREATE INDEX `task_event_task_idx` ON `task_event` (`session_id`, `task_id`, `at`);\n",timestamp:1778810400000,name:"20260515020000_user_task"},{sql:"ALTER TABLE `session` ADD `last_checkpoint_message_id` text;\n",timestamp:1779148800000,name:"20260519000000_last_checkpoint_message_id"},{sql:"ALTER TABLE `message` ADD `agent_id` text;--> statement-breakpoint\nCREATE INDEX `message_session_agent_idx` ON `message` (`session_id`,`agent_id`,`id`);\n",timestamp:1779321600000,name:"20260521000000_message_agent_id"},{sql:"DROP TABLE `actor_registry`;--> statement-breakpoint\nCREATE TABLE `actor_registry` (\n `session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `actor_id` text NOT NULL,\n `mode` text NOT NULL,\n `parent_actor_id` text,\n `status` text NOT NULL,\n `agent` text NOT NULL,\n `description` text NOT NULL,\n `context_mode` text NOT NULL,\n `context_watermark` text,\n `background` integer NOT NULL,\n `tools` text,\n `last_turn_time` integer NOT NULL,\n `turn_count` integer NOT NULL DEFAULT 0,\n `error` text,\n `time_completed` integer,\n `time_created` integer NOT NULL,\n `time_updated` integer NOT NULL,\n PRIMARY KEY (`session_id`, `actor_id`)\n);--> statement-breakpoint\nCREATE INDEX `actor_registry_session_agent_idx` ON `actor_registry` (`session_id`, `agent`);--> statement-breakpoint\nCREATE INDEX `actor_registry_session_parent_idx` ON `actor_registry` (`session_id`, `parent_actor_id`);--> statement-breakpoint\nCREATE INDEX `actor_registry_status_idx` ON `actor_registry` (`status`);--> statement-breakpoint\nCREATE INDEX `actor_registry_status_last_turn_idx` ON `actor_registry` (`status`, `last_turn_time`);\n",timestamp:1779321660000,name:"20260521000100_actor_registry_v6"},{sql:"DROP TRIGGER IF EXISTS `memory_fts_ai`;--> statement-breakpoint\nDROP TRIGGER IF EXISTS `memory_fts_ad`;--> statement-breakpoint\nDROP TRIGGER IF EXISTS `memory_fts_au`;--> statement-breakpoint\nDROP TABLE IF EXISTS `memory_fts_idx`;--> statement-breakpoint\nDROP TABLE IF EXISTS `memory_fts`;--> statement-breakpoint\nCREATE TABLE `memory_fts` (\n `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n `path` text NOT NULL UNIQUE,\n `scope` text NOT NULL,\n `scope_id` text DEFAULT '' NOT NULL,\n `type` text NOT NULL,\n `body` text NOT NULL,\n `fingerprint` text NOT NULL,\n `last_indexed_at` integer NOT NULL\n);--> statement-breakpoint\nCREATE INDEX `memory_fts_scope_idx` ON `memory_fts` (`scope`, `scope_id`);--> statement-breakpoint\nCREATE INDEX `memory_fts_type_idx` ON `memory_fts` (`type`);--> statement-breakpoint\nCREATE VIRTUAL TABLE `memory_fts_idx` USING fts5(\n body,\n content='memory_fts',\n content_rowid='id',\n tokenize='unicode61 remove_diacritics 1'\n);--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ai` AFTER INSERT ON `memory_fts` BEGIN\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.id, NEW.body);\nEND;--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ad` AFTER DELETE ON `memory_fts` BEGIN\n DELETE FROM `memory_fts_idx` WHERE rowid = OLD.id;\nEND;--> statement-breakpoint\nCREATE TRIGGER `memory_fts_au` AFTER UPDATE ON `memory_fts` BEGIN\n DELETE FROM `memory_fts_idx` WHERE rowid = OLD.id;\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.id, NEW.body);\nEND;\n",timestamp:1779325200000,name:"20260521010000_memory_fts_v6"},{sql:"-- Fix v6.1 trigger pattern: external content FTS5 vtab requires the 'delete'\n-- magic command to remove OLD body's tokens, NOT a plain DELETE FROM the vtab.\n-- The previous DELETE FROM pattern was contentless-mode syntax misapplied to\n-- external-content mode, leaving stale tokens accumulating until vtab corrupts.\nDROP TRIGGER IF EXISTS `memory_fts_ai`;--> statement-breakpoint\nDROP TRIGGER IF EXISTS `memory_fts_ad`;--> statement-breakpoint\nDROP TRIGGER IF EXISTS `memory_fts_au`;--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ai` AFTER INSERT ON `memory_fts` BEGIN\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.id, NEW.body);\nEND;--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ad` AFTER DELETE ON `memory_fts` BEGIN\n INSERT INTO `memory_fts_idx`(`memory_fts_idx`, rowid, body) VALUES('delete', OLD.id, OLD.body);\nEND;--> statement-breakpoint\nCREATE TRIGGER `memory_fts_au` AFTER UPDATE ON `memory_fts` BEGIN\n INSERT INTO `memory_fts_idx`(`memory_fts_idx`, rowid, body) VALUES('delete', OLD.id, OLD.body);\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.id, NEW.body);\nEND;\n",timestamp:1779328800000,name:"20260521020000_memory_fts_triggers"},{sql:"UPDATE `message` SET `agent_id` = 'main' WHERE `agent_id` IS NULL;--> statement-breakpoint\nCREATE TABLE `message_new` (\n `id` text PRIMARY KEY NOT NULL,\n `session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `agent_id` text NOT NULL DEFAULT 'main',\n `time_created` integer NOT NULL,\n `time_updated` integer NOT NULL,\n `data` text NOT NULL\n);--> statement-breakpoint\nINSERT INTO `message_new` SELECT `id`, `session_id`, COALESCE(`agent_id`, 'main'), `time_created`, `time_updated`, `data` FROM `message`;--> statement-breakpoint\nDROP TABLE `message`;--> statement-breakpoint\nALTER TABLE `message_new` RENAME TO `message`;--> statement-breakpoint\nCREATE INDEX `message_session_time_created_id_idx` ON `message` (`session_id`,`time_created`,`id`);--> statement-breakpoint\nCREATE INDEX `message_session_agent_idx` ON `message` (`session_id`,`agent_id`,`id`);\n",timestamp:1779753600000,name:"20260526000000_agent_id_main"},{sql:"ALTER TABLE `actor_registry` ADD COLUMN `last_outcome` text;--> statement-breakpoint\nALTER TABLE `actor_registry` ADD COLUMN `lifecycle` text NOT NULL DEFAULT 'ephemeral';--> statement-breakpoint\nALTER TABLE `actor_registry` RENAME COLUMN `error` TO `last_error`;--> statement-breakpoint\nUPDATE `actor_registry` SET `last_outcome` = 'success' WHERE `status` = 'completed';--> statement-breakpoint\nUPDATE `actor_registry` SET `last_outcome` = 'failure' WHERE `status` = 'failed';--> statement-breakpoint\nUPDATE `actor_registry` SET `last_outcome` = 'cancelled' WHERE `status` = 'cancelled';--> statement-breakpoint\nUPDATE `actor_registry` SET `status` = 'idle' WHERE `status` IN ('completed','failed','cancelled');--> statement-breakpoint\nUPDATE `actor_registry` SET `lifecycle` = CASE `mode` WHEN 'peer' THEN 'persistent' WHEN 'main' THEN 'persistent' ELSE 'ephemeral' END;\n",timestamp:1779840000000,name:"20260527000000_actor_lifecycle"},{sql:"CREATE TABLE `inbox` (\n `id` text PRIMARY KEY NOT NULL,\n `receiver_session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `receiver_actor_id` text NOT NULL,\n `sender_session_id` text,\n `sender_actor_id` text,\n `type` text NOT NULL DEFAULT 'text',\n `content` text NOT NULL,\n `created_at` integer NOT NULL\n);--> statement-breakpoint\nCREATE INDEX `inbox_receiver_idx` ON `inbox` (`receiver_session_id`,`receiver_actor_id`,`id`);--> statement-breakpoint\nCREATE INDEX `inbox_created_idx` ON `inbox` (`created_at`);\n",timestamp:1779840060000,name:"20260527000100_inbox"},{sql:"-- todo: drop priority column\nALTER TABLE `todo` DROP COLUMN `priority`;\n--> statement-breakpoint\n\n-- task: drop focus-dependent index before dropping its column\nDROP INDEX `task_focus_per_session_idx`;\n--> statement-breakpoint\nDROP INDEX `task_kind_idx`;\n--> statement-breakpoint\nALTER TABLE `task` DROP COLUMN `focus`;\n--> statement-breakpoint\nALTER TABLE `task` DROP COLUMN `kind`;\n--> statement-breakpoint\n\n-- migrate status values: proposed/active -> open\nUPDATE `task` SET `status` = 'open' WHERE `status` IN ('proposed', 'active');\n",timestamp:1780012800000,name:"20260529000000_task_todo_redesign"},{sql:"ALTER TABLE `task` ADD COLUMN `owner` text;\n",timestamp:1780444800000,name:"20260603000000_task_in_progress_owner"},{sql:"CREATE TABLE `workflow_run` (\n `id` text PRIMARY KEY NOT NULL,\n `session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `name` text NOT NULL,\n `status` text NOT NULL,\n `running` integer NOT NULL DEFAULT 0,\n `succeeded` integer NOT NULL DEFAULT 0,\n `failed` integer NOT NULL DEFAULT 0,\n `current_phase` text,\n `parent_actor_id` text,\n `args` text,\n `error` text,\n `time_created` integer NOT NULL,\n `time_updated` integer NOT NULL\n);--> statement-breakpoint\nCREATE INDEX `workflow_run_session_idx` ON `workflow_run` (`session_id`);--> statement-breakpoint\nCREATE INDEX `workflow_run_status_idx` ON `workflow_run` (`status`);\n",timestamp:1780444800000,name:"20260603000000_workflow_run"},{sql:"ALTER TABLE `workflow_run` ADD COLUMN `script_sha` text;\n",timestamp:1780531200000,name:"20260604000000_workflow_script_sha"},{sql:"CREATE TABLE `claude_import` (\n `source_uuid` text PRIMARY KEY NOT NULL,\n `session_id` text NOT NULL,\n `source_path` text NOT NULL,\n `source_mtime` integer NOT NULL,\n `time_imported` integer NOT NULL\n);\n",timestamp:1780876800000,name:"20260608000000_claude_import"},{sql:"ALTER TABLE `claude_import` ADD `message_ids` text;\n",timestamp:1780880400000,name:"20260608010000_claude_import_message_ids"},{sql:"CREATE TABLE `history_fts` (\n `part_id` text PRIMARY KEY NOT NULL,\n `session_id` text NOT NULL,\n `message_id` text NOT NULL,\n `project_id` text NOT NULL,\n `kind` text NOT NULL,\n `tool_name` text,\n `body` text NOT NULL,\n `time_created` integer NOT NULL\n);--> statement-breakpoint\nCREATE INDEX `history_fts_session_idx` ON `history_fts` (`session_id`, `time_created`);--> statement-breakpoint\nCREATE INDEX `history_fts_project_idx` ON `history_fts` (`project_id`, `time_created`);--> statement-breakpoint\nCREATE INDEX `history_fts_message_idx` ON `history_fts` (`message_id`);--> statement-breakpoint\nCREATE VIRTUAL TABLE `history_fts_idx` USING fts5(\n body,\n content='history_fts',\n content_rowid='rowid',\n tokenize='unicode61 remove_diacritics 1'\n);--> statement-breakpoint\nCREATE TRIGGER `history_fts_ai` AFTER INSERT ON `history_fts` BEGIN\n INSERT INTO `history_fts_idx`(rowid, body) VALUES (NEW.rowid, NEW.body);\nEND;--> statement-breakpoint\nCREATE TRIGGER `history_fts_ad` AFTER DELETE ON `history_fts` BEGIN\n INSERT INTO `history_fts_idx`(`history_fts_idx`, rowid, body) VALUES('delete', OLD.rowid, OLD.body);\nEND;--> statement-breakpoint\nCREATE TRIGGER `history_fts_au` AFTER UPDATE ON `history_fts` BEGIN\n INSERT INTO `history_fts_idx`(`history_fts_idx`, rowid, body) VALUES('delete', OLD.rowid, OLD.body);\n INSERT INTO `history_fts_idx`(rowid, body) VALUES (NEW.rowid, NEW.body);\nEND;\n",timestamp:1780963200000,name:"20260609000000_history_fts"},{sql:"ALTER TABLE `workflow_run` ADD COLUMN `agent_timeout_ms` integer;\n",timestamp:1781046000000,name:"20260609230000_workflow_agent_timeout"},{sql:"CREATE TABLE `external_import` (\n `source` text NOT NULL,\n `source_key` text NOT NULL,\n `session_id` text NOT NULL,\n `source_path` text NOT NULL,\n `source_mtime` integer NOT NULL,\n `time_imported` integer NOT NULL,\n `message_ids` text,\n PRIMARY KEY (`source`, `source_key`)\n);\n\nINSERT INTO `external_import` (`source`, `source_key`, `session_id`, `source_path`, `source_mtime`, `time_imported`, `message_ids`)\nSELECT 'cc', `source_uuid`, `session_id`, `source_path`, `source_mtime`, `time_imported`, `message_ids`\nFROM `claude_import`;\n\nDROP TABLE `claude_import`;\n",timestamp:1781222400000,name:"20260612000000_external_import"}];if(o.length>0){if(Xi.info("applying migrations",{count:o.length,mode:"bundled"}),nn.QITQODE_SKIP_MIGRATIONS)for(let t of o)t.sql="select 1;";bo(n,o)}return n});function Ce(){Jn().$client.close(),Jn.reset()}var Vn=un.create("database");function Je(n){try{return n(Vn.use().tx)}catch(o){if(o instanceof un.NotFound){let t=[],s=Vn.provide({effects:t,tx:Jn()},()=>n(Jn()));for(let e of t)e();return s}throw o}}function He(n){let o=Yn.bind(n);try{Vn.use().effects.push(o)}catch{o()}}function Ke(n,o){try{return n(Vn.use().tx)}catch(t){if(t instanceof un.NotFound){let s=[],e=Yn.bind((_)=>Vn.provide({tx:_,effects:s},()=>n(_))),l=Jn().transaction(e,{behavior:o?.behavior});for(let _ of s)_();return l}throw t}}var ai={};On(ai,{layer:()=>Fi,defaultLayer:()=>we,Service:()=>yo,NotFoundError:()=>Xo});import Y from"path";var Hn={};On(Hn,{layer:()=>wi,defaultLayer:()=>Ee,Service:()=>mo,Git:()=>Hn});var Re=["--no-optional-locks","-c","core.autocrlf=false","-c","core.fsmonitor=false","-c","core.longpaths=true","-c","core.symlinks=true","-c","core.quotepath=false"],cn=(n)=>n.text().trim(),Uo=(n)=>n.split("\x00").filter(Boolean),Se=(n)=>({exitCode:1,text:()=>"",stdout:Buffer.alloc(0),stderr:Buffer.from(n instanceof Error?n.message:String(n))}),ki=(n)=>{if(n==="??")return"added";if(n.includes("U"))return"modified";if(n.includes("A")&&!n.includes("D"))return"added";if(n.includes("D")&&!n.includes("A"))return"deleted";return"modified"};class mo extends Qn.Service()("@qitqode/Git"){}var wi=h.effect(mo,r.gen(function*(){let n=yield*no.ChildProcessSpawner,o=r.fn("Git.run")(function*(u,p){let m=Vi.make("git",[...Re,...u],{cwd:p.cwd,env:p.env,extendEnv:!0,stdin:"ignore",stdout:"pipe",stderr:"pipe"}),f=yield*ci(n,m);return{exitCode:f.code,text:()=>f.text,stdout:Buffer.from(f.text),stderr:Buffer.from(f.stderr)}},r.scoped,r.catch((u)=>r.succeed(Se(u)))),t=r.fn("Git.text")(function*(u,p){return(yield*o(u,p)).text()}),s=r.fn("Git.lines")(function*(u,p){return(yield*t(u,p)).split(/\r?\n/).map((m)=>m.trim()).filter(Boolean)}),e=r.fnUntraced(function*(u){return yield*s(["for-each-ref","--format=%(refname:short)","refs/heads"],{cwd:u})}),l=r.fnUntraced(function*(u,p){let m=yield*o(["config","init.defaultBranch"],{cwd:u}),f=cn(m);if(!f||!p.includes(f))return;return{name:f,ref:f}}),_=r.fnUntraced(function*(u){let p=yield*s(["remote"],{cwd:u});if(p.includes("origin"))return"origin";if(p.length===1)return p[0];if(p.includes("upstream"))return"upstream";return p[0]}),A=r.fn("Git.branch")(function*(u){let p=yield*o(["symbolic-ref","--quiet","--short","HEAD"],{cwd:u});if(p.exitCode!==0)return;return cn(p)||void 0}),C=r.fn("Git.prefix")(function*(u){let p=yield*o(["rev-parse","--show-prefix"],{cwd:u});if(p.exitCode!==0)return"";return cn(p)}),S=r.fn("Git.defaultBranch")(function*(u){let p=yield*_(u);if(p){let i=yield*o(["symbolic-ref",`refs/remotes/${p}/HEAD`],{cwd:u});if(i.exitCode===0){let y=cn(i).replace(/^refs\/remotes\//,""),$=y.startsWith(`${p}/`)?y.slice(`${p}/`.length):"";if($)return{name:$,ref:y}}}let m=yield*e(u),f=yield*l(u,m);if(f)return f;if(m.includes("main"))return{name:"main",ref:"main"};if(m.includes("master"))return{name:"master",ref:"master"}}),K=r.fn("Git.hasHead")(function*(u){return(yield*o(["rev-parse","--verify","HEAD"],{cwd:u})).exitCode===0}),R=r.fn("Git.mergeBase")(function*(u,p,m="HEAD"){let f=yield*o(["merge-base",p,m],{cwd:u});if(f.exitCode!==0)return;return cn(f)||void 0}),E=r.fn("Git.show")(function*(u,p,m,f=""){let i=f?`${f}${m}`:m,y=yield*o(["show",`${p}:${i}`],{cwd:u});if(y.exitCode!==0)return"";if(y.stdout.includes(0))return"";return y.text()}),d=r.fn("Git.status")(function*(u){return Uo(yield*t(["status","--porcelain=v1","--untracked-files=all","--no-renames","-z","--","."],{cwd:u})).flatMap((p)=>{let m=p.slice(3);if(!m)return[];let f=p.slice(0,2);return[{file:m,code:f,status:ki(f)}]})}),D=r.fn("Git.diff")(function*(u,p){let m=Uo(yield*t(["diff","--no-ext-diff","--no-renames","--name-status","-z",p,"--","."],{cwd:u}));return m.flatMap((f,i)=>{if(i%2!==0)return[];let y=m[i+1];if(!f||!y)return[];return[{file:y,code:f,status:ki(f)}]})}),L=r.fn("Git.stats")(function*(u,p){return Uo(yield*t(["diff","--no-ext-diff","--no-renames","--numstat","-z",p,"--","."],{cwd:u})).flatMap((m)=>{let f=m.indexOf("\t"),i=m.indexOf("\t",f+1);if(f===-1||i===-1)return[];let y=m.slice(i+1);if(!y)return[];let $=m.slice(0,f),I=m.slice(f+1,i),O=$==="-"?0:Number.parseInt($||"0",10),U=I==="-"?0:Number.parseInt(I||"0",10);return[{file:y,additions:Number.isFinite(O)?O:0,deletions:Number.isFinite(U)?U:0}]})});return mo.of({run:o,branch:A,prefix:C,defaultBranch:S,hasHead:K,mergeBase:R,show:E,status:d,diff:D,stats:L})})),Ee=wi.pipe(h.provide(oo));var ln=V.create({service:"storage"}),Xo=eo.create("NotFoundError",j.object({message:j.string()})),We=N.Struct({path:N.optional(N.Struct({root:N.optional(N.String)}))}),Pe=N.Struct({id:N.String}),Ue=N.Struct({id:N.String}),Ze=N.Struct({additions:N.Number,deletions:N.Number}),ve=N.Struct({id:N.String,projectID:N.String,summary:N.Struct({diffs:N.Array(Ze)})}),Xe=N.decodeUnknownOption(We),Ye=N.decodeUnknownOption(Pe),ze=N.decodeUnknownOption(Ue),ke=N.decodeUnknownOption(ve);class yo extends Qn.Service()("@qitqode/Storage"){}function Ve(n,o){return Y.join(n,...o)+".json"}function Zo(n){if(!n||typeof n!=="object")return!1;if("code"in n&&n.code==="ENOENT")return!0;if("reason"in n&&n.reason&&typeof n.reason==="object"&&"_tag"in n.reason)return n.reason._tag==="NotFound";return!1}function ce(n){let o=Number.parseInt(n,10);return Number.isNaN(o)?0:o}var qi=[r.fn("Storage.migration.1")(function*(n,o,t){let s=Y.resolve(n,"../project");if(!(yield*o.isDir(s)))return;let e=yield*o.glob("*",{cwd:s,include:"all"});for(let l of e){let _=Y.join(s,l);if(!(yield*o.isDir(_)))continue;ln.info(`migrating project ${l}`);let A=l,C="/";if(A!=="global"){for(let R of yield*o.glob("storage/session/message/*/*.json",{cwd:_,absolute:!0})){let E=Xe(yield*o.readJson(R),{onExcessProperty:"preserve"}),d=wn.isSome(E)?E.value.path?.root:void 0;if(!d)continue;C=d;break}if(!C)continue;if(!(yield*o.isDir(C)))continue;let S=yield*t.run(["rev-list","--max-parents=0","--all"],{cwd:C}),[K]=S.text().split(`
|
|
5
|
-
`).filter(Boolean).map((R)=>R.trim()).toSorted();if(!K)continue;A=K,yield*o.writeWithDirs(Y.join(n,"project",A+".json"),JSON.stringify({id:K,vcs:"git",worktree:C,time:{created:Date.now(),initialized:Date.now()}},null,2)),ln.info(`migrating sessions for project ${A}`);for(let R of yield*o.glob("storage/session/info/*.json",{cwd:_,absolute:!0})){let E=Y.join(n,"session",A,Y.basename(R));ln.info("copying",{sessionFile:R,dest:E});let d=yield*o.readJson(R),D=Ye(d,{onExcessProperty:"preserve"});if(yield*o.writeWithDirs(E,JSON.stringify(d,null,2)),wn.isNone(D))continue;ln.info(`migrating messages for session ${D.value.id}`);for(let L of yield*o.glob(`storage/session/message/${D.value.id}/*.json`,{cwd:_,absolute:!0})){let u=Y.join(n,"message",D.value.id,Y.basename(L));ln.info("copying",{msgFile:L,dest:u});let p=yield*o.readJson(L),m=ze(p,{onExcessProperty:"preserve"});if(yield*o.writeWithDirs(u,JSON.stringify(p,null,2)),wn.isNone(m))continue;ln.info(`migrating parts for message ${m.value.id}`);for(let f of yield*o.glob(`storage/session/part/${D.value.id}/${m.value.id}/*.json`,{cwd:_,absolute:!0})){let i=Y.join(n,"part",m.value.id,Y.basename(f)),y=yield*o.readJson(f);ln.info("copying",{partFile:f,dest:i}),yield*o.writeWithDirs(i,JSON.stringify(y,null,2))}}}}}}),r.fn("Storage.migration.2")(function*(n,o){for(let t of yield*o.glob("session/*/*.json",{cwd:n,absolute:!0})){let s=yield*o.readJson(t),e=ke(s,{onExcessProperty:"preserve"});if(wn.isNone(e))continue;let l=e.value.summary.diffs;yield*o.writeWithDirs(Y.join(n,"session_diff",e.value.id+".json"),JSON.stringify(l,null,2)),yield*o.writeWithDirs(Y.join(n,"session",e.value.projectID,e.value.id+".json"),JSON.stringify({...s,summary:{additions:l.reduce((_,A)=>_+A.additions,0),deletions:l.reduce((_,A)=>_+A.deletions,0)}},null,2))}})],Fi=h.effect(yo,r.gen(function*(){let n=yield*c.Service,o=yield*Hn.Service,t=yield*vo.make({lookup:()=>Kn.make(),idleTimeToLive:0}),s=yield*r.cached(r.gen(function*(){let d=Y.join(dn.Path.data,"storage"),D=Y.join(d,"migration"),L=yield*n.readFileString(D).pipe(r.map(ce),r.catchIf(Zo,()=>r.succeed(0)),r.orElseSucceed(()=>0));for(let u=L;u<qi.length;u++){ln.info("running migration",{index:u});let p=qi[u],m=yield*r.exit(p(d,n,o));if(kn.isFailure(m)){ln.error("failed to run migration",{index:u,cause:m.cause});break}yield*n.writeWithDirs(D,String(u+1))}return{dir:d}})),e=(d)=>r.fail(new Xo({message:`Resource not found: ${d}`})),l=(d,D)=>D.pipe(r.catchIf(Zo,()=>e(d))),_=r.fnUntraced(function*(d,D){yield*n.writeWithDirs(d,JSON.stringify(D,null,2))}),A=(d,D)=>r.scoped(r.gen(function*(){let L=Ve((yield*s).dir,d);return yield*D(L,yield*vo.get(t,L))})),C=r.fn("Storage.remove")(function*(d){yield*A(d,(D,L)=>Kn.withWriteLock(L,n.remove(D).pipe(r.catchIf(Zo,()=>r.void))))}),S=(d)=>r.gen(function*(){return yield*A(d,(L,u)=>Kn.withReadLock(u,l(L,n.readJson(L))))}),K=(d,D)=>r.gen(function*(){return yield*A(d,(u,p)=>Kn.withWriteLock(p,r.gen(function*(){let m=yield*l(u,n.readJson(u));return D(m),yield*_(u,m),m})))}),R=(d,D)=>r.gen(function*(){yield*A(d,(L,u)=>Kn.withWriteLock(u,_(L,D)))}),E=r.fn("Storage.list")(function*(d){let D=(yield*s).dir,L=Y.join(D,...d);return(yield*n.glob("**/*",{cwd:L,include:"file"}).pipe(r.catch(()=>r.succeed([])))).map((p)=>[...d,...p.slice(0,-5).split(Y.sep)]).toSorted((p,m)=>p.join("/").localeCompare(m.join("/")))});return yo.of({remove:C,read:S,update:K,write:R,list:E})})),we=Fi.pipe(h.provide(c.defaultLayer),h.provide(Hn.defaultLayer));export{Un as ql,si as rl,Zn as sl,mn as tl,x as ul,gn as vl,fo as wl,zo as xl,ko as yl,Vo as zl,co as Al,qo as Bl,uo as Cl,In as Dl,Hn as El,Xo as Fl,ai as Gl,q as Hl,Co as Il,Ti as Jl,se as Kl,xi as Ll,Te as Ml,on as Nl,Yn as Ol,Le as Pl,Pi as Ql,Ui as Rl};
|
package/bundle/chunk-19z5q33z.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ag as k,Bg as l,Cg as m,Dg as n,qg as a,rg as b,sg as c,tg as d,ug as e,vg as f,wg as g,xg as h,yg as i,zg as j}from"./chunk-4aykrj51.js";import"./chunk-j1a64ade.js";import"./chunk-kkvb2c2z.js";import"./chunk-dkv2mg97.js";import"./chunk-1p34bx7c.js";import"./chunk-q3x4x2tq.js";import"./chunk-tsn1jkr7.js";import"./chunk-zk8n8hnh.js";import"./chunk-1jh5p5qw.js";import"./chunk-kaeyhw2n.js";import"./chunk-f89gntcy.js";import"./chunk-bky5a42k.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-v2kyarwz.js";import"./chunk-dkm7x8rj.js";import"./chunk-hh4c02fh.js";export{e as resolveDevicePoll,j as refreshAccessToken,i as probeToken,k as loginDevice,m as loginBrowser,l as login,c as isReplitEnv,g as isNearExpiry,d as getConfig,f as getCallbackUri,h as fetchQreditsBalance,n as checkoutApiKey,a as ForgewiseError,b as DeviceFlowUnsupportedError};
|
package/bundle/chunk-1a0wnwna.js
DELETED
package/bundle/chunk-1ddm2wxv.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{rh as a,sh as b}from"./chunk-va4davgy.js";import"./chunk-hg563h5r.js";import"./chunk-j1a64ade.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-ecwz9nhs.js";import"./chunk-5rkmhzq0.js";import"./chunk-7mhffm9f.js";import"./chunk-r012q335.js";import"./chunk-0z3z0gk1.js";import"./chunk-g7vkkmsk.js";import"./chunk-m8djypsy.js";import"./chunk-w7p2x973.js";import"./chunk-wmw2gne9.js";import"./chunk-y3n31nnx.js";import"./chunk-3z1y040p.js";import"./chunk-kkvb2c2z.js";import"./chunk-3tdqsm5c.js";import"./chunk-a5zjrwqy.js";import"./chunk-fhng5her.js";import"./chunk-dkv2mg97.js";import"./chunk-bf146hz2.js";import"./chunk-t488d66k.js";import"./chunk-cqtkxwd8.js";import"./chunk-srf73nm4.js";import"./chunk-yzdty5t9.js";import"./chunk-1p34bx7c.js";import"./chunk-q3x4x2tq.js";import"./chunk-7dckfame.js";import"./chunk-j1veq3zr.js";import"./chunk-0pvbk8ks.js";import"./chunk-tk3bve0x.js";import"./chunk-0w4v0fbs.js";import"./chunk-wf09j72q.js";import"./chunk-hbnr0j7h.js";import"./chunk-ep8zn49w.js";import"./chunk-f3kjp838.js";import"./chunk-tsn1jkr7.js";import"./chunk-zk8n8hnh.js";import"./chunk-1jh5p5qw.js";import"./chunk-kaeyhw2n.js";import"./chunk-f89gntcy.js";import"./chunk-bky5a42k.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-v2kyarwz.js";import"./chunk-dkm7x8rj.js";import"./chunk-9pe4agdz.js";import"./chunk-kc3hpmr2.js";import"./chunk-hh4c02fh.js";export{b as AppRuntime,a as AppLayer};
|
package/bundle/chunk-1fk4vsmc.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{g as G}from"./chunk-vavrczqm.js";import{E as x,F,G as Z}from"./chunk-d56zc21w.js";import"./chunk-mjhb1q0n.js";import{Pd as P}from"./chunk-9xvctnjr.js";import{Tf as j}from"./chunk-gen6f3dn.js";import{xg as v}from"./chunk-4aykrj51.js";import{sh as X}from"./chunk-va4davgy.js";import"./chunk-hg563h5r.js";import"./chunk-j1a64ade.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-ecwz9nhs.js";import"./chunk-5rkmhzq0.js";import{xj as $}from"./chunk-7mhffm9f.js";import"./chunk-r012q335.js";import"./chunk-0z3z0gk1.js";import"./chunk-g7vkkmsk.js";import"./chunk-m8djypsy.js";import"./chunk-w7p2x973.js";import"./chunk-wmw2gne9.js";import"./chunk-y3n31nnx.js";import"./chunk-3z1y040p.js";import"./chunk-kkvb2c2z.js";import"./chunk-3tdqsm5c.js";import"./chunk-a5zjrwqy.js";import"./chunk-fhng5her.js";import"./chunk-dkv2mg97.js";import"./chunk-bf146hz2.js";import"./chunk-t488d66k.js";import"./chunk-cqtkxwd8.js";import"./chunk-srf73nm4.js";import"./chunk-yzdty5t9.js";import"./chunk-1p34bx7c.js";import"./chunk-q3x4x2tq.js";import"./chunk-7dckfame.js";import"./chunk-j1veq3zr.js";import"./chunk-0pvbk8ks.js";import"./chunk-tk3bve0x.js";import"./chunk-0w4v0fbs.js";import"./chunk-wf09j72q.js";import"./chunk-hbnr0j7h.js";import"./chunk-ep8zn49w.js";import"./chunk-f3kjp838.js";import"./chunk-tsn1jkr7.js";import"./chunk-zk8n8hnh.js";import"./chunk-1jh5p5qw.js";import"./chunk-kaeyhw2n.js";import"./chunk-f89gntcy.js";import"./chunk-bky5a42k.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-v2kyarwz.js";import{mI as D}from"./chunk-dkm7x8rj.js";import"./chunk-9pe4agdz.js";import"./chunk-kc3hpmr2.js";import"./chunk-hh4c02fh.js";var Y="forgewise";function _(J){return D.gen(function*(){let z=yield*J.get(Y);if(!z||z.type!=="api")return null;let M=(z.metadata??{}).sub,V=z.key;if(!M)return null;return{sub:M,accessToken:V}})}var H=()=>D.gen(function*(){if((yield*G())==="revoked")return null;let J=yield*$.Service,z=yield*_(J);if(!z)return yield*D.sync(()=>j.println(j.Style.TEXT_DANGER+"Not signed in to Forgewise. Run `qitqode auth login` first."+j.Style.TEXT_NORMAL)),null;return z}),k=()=>D.gen(function*(){let J=yield*H();if(!J)return;let z=yield*D.tryPromise({try:()=>v(J.accessToken),catch:()=>null}).pipe(D.orElseSucceed(()=>null));if(!z){yield*D.sync(()=>j.println(j.Style.TEXT_DANGER+"Could not fetch balance."+j.Style.TEXT_NORMAL));return}yield*D.sync(()=>j.println(j.Style.TEXT_SUCCESS+"Qredits balance: "+j.Style.TEXT_NORMAL+j.Style.TEXT_HIGHLIGHT_BOLD+Z(z.balance)+j.Style.TEXT_NORMAL))}).pipe(D.withSpan("qredits.balance")),w=()=>D.gen(function*(){let J=yield*H();if(!J)return;let z=yield*D.tryPromise({try:()=>F({userId:J.sub,accessToken:J.accessToken,limit:20}),catch:(L)=>L});if(z instanceof Error){let L=z instanceof x?z.message:String(z);yield*D.sync(()=>j.println(j.Style.TEXT_DANGER+"Could not fetch history: "+L+j.Style.TEXT_NORMAL));return}if(z.length===0){yield*D.sync(()=>j.println("No spend history yet."));return}let N=j.Style.TEXT_DIM,M=j.Style.TEXT_NORMAL,V=j.Style.TEXT_DANGER;yield*D.sync(()=>{j.println(N+" Date Description Amount"+M),j.println(N+" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500"+M);for(let L of z){let K=(L.date||"").slice(0,10).padEnd(18),O=(L.description||"").slice(0,32).padEnd(32),T=(L.amount<0?"-":" ")+Z(Math.abs(L.amount)),W=L.amount<0?V:M;j.println(` ${N}${K}${M} ${O} ${W}${T}${M}`)}})}).pipe(D.withSpan("qredits.history")),g=P({command:"qredits <command>",describe:"Check Qredits balance and spend history",builder:(J)=>J.command(P({command:"balance",describe:"Show current Qredits balance",builder:(z)=>z,async handler(){j.empty(),await X.runPromise(k())}})).command(P({command:"history",describe:"Show recent Qredit spend history",builder:(z)=>z,async handler(){j.empty(),await X.runPromise(w())}})).demandCommand(),async handler(){}});export{w as historyEffect,k as balanceEffect,g as QreditsCommand};
|
package/bundle/chunk-1j2f9nd5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Hr as a,Ir as b,Jr as c}from"./chunk-tk3bve0x.js";import"./chunk-0w4v0fbs.js";import"./chunk-wf09j72q.js";import"./chunk-zk8n8hnh.js";import"./chunk-1jh5p5qw.js";import"./chunk-kaeyhw2n.js";import"./chunk-f89gntcy.js";import"./chunk-bky5a42k.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-v2kyarwz.js";import"./chunk-dkm7x8rj.js";import"./chunk-hh4c02fh.js";export{c as makeRuntime,a as attachWith,b as attach};
|
package/bundle/chunk-27s736an.js
DELETED
package/bundle/chunk-2j17xrzj.js
DELETED
package/bundle/chunk-2zca3nak.js
DELETED
package/bundle/chunk-2zcvcfq4.js
DELETED
package/bundle/chunk-38hwkfj5.js
DELETED
package/bundle/chunk-3afqxvsn.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ot as a,pt as b}from"./chunk-zk8n8hnh.js";import"./chunk-1jh5p5qw.js";import"./chunk-kaeyhw2n.js";import"./chunk-f89gntcy.js";import"./chunk-bky5a42k.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-v2kyarwz.js";import"./chunk-dkm7x8rj.js";import"./chunk-hh4c02fh.js";export{a as Path,b as Global};
|
package/bundle/chunk-3avc1ppg.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{I}from"./chunk-a9y27zd2.js";import{J as i,L as r}from"./chunk-ve5gb789.js";import{ud as c}from"./chunk-8pe047p0.js";import{vd as g}from"./chunk-4kse3awh.js";import{wd as y}from"./chunk-ps543k72.js";import{xd as k}from"./chunk-3wzqs241.js";import{yd as A}from"./chunk-23geekk5.js";import{Dd as w,Ed as u,Gd as W,Hd as L,Id as T,Kd as p,Ld as o,Md as b,Nd as P}from"./chunk-8h9r6c8g.js";import"./chunk-9jf67xb0.js";import{Pd as z}from"./chunk-9xvctnjr.js";import{Tf as Y}from"./chunk-gen6f3dn.js";import{sh as M}from"./chunk-va4davgy.js";import"./chunk-hg563h5r.js";import"./chunk-j1a64ade.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-ecwz9nhs.js";import"./chunk-5rkmhzq0.js";import{Qk as a,dl as s,xj as R}from"./chunk-7mhffm9f.js";import{pl as V}from"./chunk-r012q335.js";import{Nl as n}from"./chunk-0z3z0gk1.js";import"./chunk-g7vkkmsk.js";import"./chunk-m8djypsy.js";import"./chunk-w7p2x973.js";import"./chunk-wmw2gne9.js";import"./chunk-y3n31nnx.js";import"./chunk-3z1y040p.js";import"./chunk-kkvb2c2z.js";import"./chunk-3tdqsm5c.js";import"./chunk-a5zjrwqy.js";import"./chunk-fhng5her.js";import"./chunk-dkv2mg97.js";import"./chunk-bf146hz2.js";import"./chunk-t488d66k.js";import"./chunk-cqtkxwd8.js";import"./chunk-srf73nm4.js";import"./chunk-yzdty5t9.js";import"./chunk-1p34bx7c.js";import"./chunk-q3x4x2tq.js";import"./chunk-7dckfame.js";import"./chunk-j1veq3zr.js";import"./chunk-0pvbk8ks.js";import"./chunk-tk3bve0x.js";import"./chunk-0w4v0fbs.js";import"./chunk-wf09j72q.js";import"./chunk-hbnr0j7h.js";import"./chunk-ep8zn49w.js";import"./chunk-f3kjp838.js";import"./chunk-tsn1jkr7.js";import{pt as l}from"./chunk-zk8n8hnh.js";import{It as d}from"./chunk-1jh5p5qw.js";import"./chunk-kaeyhw2n.js";import"./chunk-f89gntcy.js";import{Zt as v}from"./chunk-bky5a42k.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-v2kyarwz.js";import{mI as O}from"./chunk-dkm7x8rj.js";import"./chunk-9pe4agdz.js";import"./chunk-kc3hpmr2.js";import{CP as H1}from"./chunk-hh4c02fh.js";import f from"path";import{pathToFileURL as J1}from"url";import Q1 from"os";import{access as S1,readdir as X1}from"fs/promises";var q1={en:A,zh:k,ja:c,fr:y,ru:g},B1=q1[I()]??A;function U($,B){let J=B1[$]??A[$]??$;if(!B)return J;return J.replace(/\{(\w+)\}/g,(X,H)=>(H in B)?String(B[H]):`{${H}}`)}import{text as Z1}from"stream/consumers";var D=($,B)=>M.runPromise(O.gen(function*(){yield*(yield*R.Service).set($,B)}));async function t(){let $=await p({message:"Enter your API key",validate:(B)=>B&&B.length>0?void 0:"Required"});if(w($))throw new Y.CancelledError;return $}async function h($,B){let J=$.provider??B;if("refresh"in $){let{type:X,provider:H,refresh:Z,access:j,expires:q,metadata:S,...G}=$;await D(J,{type:"oauth",refresh:Z,access:j,expires:q,...G})}if("key"in $)await D(J,{type:"api",key:$.key,...$.metadata?{metadata:$.metadata}:{}})}async function x($,B,J){let X=0;if(J){let j=$.auth.methods.findIndex((q)=>q.label.toLowerCase()===J.toLowerCase());if(j===-1)W.error(`Unknown method "${J}" for ${B}. Available: ${$.auth.methods.map((q)=>q.label).join(", ")}`),process.exit(1);X=j}else if($.auth.methods.length>1){let j=await b({message:"Login method",options:$.auth.methods.map((q,S)=>({label:q.label,value:S.toString()}))});if(w(j))throw new Y.CancelledError;X=parseInt(j)}let H=$.auth.methods[X];await new Promise((j)=>setTimeout(j,10));let Z={};if(H.prompts)for(let j of H.prompts){if(j.when){let q=Z[j.when.key];if(q===void 0)continue;if(!(j.when.op==="eq"?q===j.when.value:q!==j.when.value))continue}if(j.condition&&!j.condition(Z))continue;if(j.type==="select"){let q=await b({message:j.message,options:j.options});if(w(q))throw new Y.CancelledError;Z[j.key]=q}else{let q=await P({message:j.message,placeholder:j.placeholder,validate:j.validate?(S)=>j.validate(S??""):void 0});if(w(q))throw new Y.CancelledError;Z[j.key]=q}}if(H.type==="oauth"){let j=await H.authorize(Z);if(j.url)W.info("Go to: "+j.url);if(j.method==="auto"){if(j.instructions)W.info(j.instructions);let q=o();q.start("Waiting for authorization...");let S=await j.callback();if(S.type==="failed")q.stop("Failed to authorize",1);if(S.type==="success")await h(S,B),q.stop("Login successful")}if(j.method==="code"){let q=await P({message:"Paste the authorization code here: ",validate:(G)=>G&&G.length>0?void 0:"Required"});if(w(q))throw new Y.CancelledError;let S=await j.callback(q);if(S.type==="failed")W.error("Failed to authorize");if(S.type==="success")await h(S,B),W.success("Login successful")}return T("Done"),!0}if(H.type==="api"){if(H.authorize){let j=await t(),q=await H.authorize(Z);if(q.type==="failed")W.error("Failed to authorize");if(q.type==="success"){let S=q.provider??B;await D(S,{type:"api",key:q.key??j}),W.success("Login successful")}return T("Done"),!0}}return!1}function G1($){let B=new Set,J=[];for(let X of $.hooks){if(!X.auth)continue;let H=X.auth.provider;if(B.has(H))continue;if(B.add(H),Object.hasOwn($.existingProviders,H))continue;if($.disabled.has(H))continue;if($.enabled&&!$.enabled.has(H))continue;J.push({id:H,name:$.providerNames[H]??H})}return J}function m($){let B=$?.loginExtension;if(!B||typeof B!=="object")return;let J=B;if(typeof J.id!=="string"||typeof J.run!=="function")return;return J}async function W1(){try{let J=await import("./chunk-7v02b2ms.js");for(let X of Object.values(J.modules??{})){let H=m(X);if(H)return H}}catch{}let $=f.join(import.meta.dir,"..","..","ext");await S1($).catch(()=>{return});let B=await X1($).catch(()=>[]);for(let J of B.filter((X)=>X.endsWith(".ts")&&!X.endsWith(".d.ts")))try{let X=m(await import(J1(f.join($,J)).href));if(X)return X}catch{}return}var l1=z({command:"providers",aliases:["auth"],describe:"manage AI providers and credentials",builder:($)=>$.command(Y1).command(_1).command(F1).command(K1).demandCommand(),async handler(){}}),Y1=z({command:"list",aliases:["ls"],describe:"list providers and credentials",async handler($){Y.empty();let B=f.join(l.Path.data,"auth.json"),J=Q1.homedir(),X=B===J||B.startsWith(J+f.sep)?"~"+B.slice(J.length):B;L(`Credentials ${Y.Style.TEXT_DIM}${X}`);let H=await M.runPromise(O.gen(function*(){let q=yield*R.Service;return Object.entries(yield*q.all())})),Z=await V.get();for(let[q,S]of H){let G=Z[q]?.name||q;W.info(`${G} ${Y.Style.TEXT_DIM}${S.type}`)}T(`${H.length} credentials`);let j=[];for(let[q,S]of Object.entries(Z))for(let G of S.env)if(process.env[G])j.push({provider:S.name||q,envVar:G});if(j.length>0){Y.empty(),L("Environment");for(let{provider:q,envVar:S}of j)W.info(`${q} ${Y.Style.TEXT_DIM}${S}`);T(`${j.length} environment variable`+(j.length===1?"":"s"))}}}),_1=z({command:"login [url]",describe:"log in to a provider",builder:($)=>$.positional("url",{describe:"qitqode auth provider",type:"string"}).option("provider",{alias:["p"],describe:"provider id or name to log in to (skips provider selection)",type:"string"}).option("method",{alias:["m"],describe:"login method label (skips method selection)",type:"string"}),async handler($){await n.provide({directory:process.cwd(),async fn(){if(Y.empty(),L("Add credential"),$.url){let Q=$.url.replace(/\/+$/,""),_=await fetch(`${Q}/.well-known/opencode`).then((j1)=>j1.json());W.info(`Running \`${_.auth.command.join(" ")}\``);let F=d.spawn(_.auth.command,{stdout:"pipe"});if(!F.stdout){W.error("Failed"),T("Done");return}let[C,N]=await Promise.all([F.exited,Z1(F.stdout)]);if(C!==0){W.error("Failed"),T("Done");return}await D(Q,{type:"wellknown",key:_.auth.env,token:N.trim()}),W.success("Logged into "+Q),T("Done");return}await V.refresh(!0).catch(()=>{});let B=await M.runPromise(s.Service.use((Q)=>Q.get())),J=new Set(B.disabled_providers??[]),X=B.enabled_providers?new Set(B.enabled_providers):void 0,H=await V.get().then((Q)=>{let _={};for(let[F,C]of Object.entries(Q))if((X?X.has(F):!0)&&!J.has(F))_[F]=C;return _}),Z=await M.runPromise(O.gen(function*(){return yield*(yield*a.Service).list()})),j=i,q=G1({hooks:Z,existingProviders:H,disabled:J,enabled:X,providerNames:Object.fromEntries(Object.entries(B.provider??{}).map(([Q,_])=>[Q,_.name]))}),S=[...r(v(H),j,(Q)=>({openai:"ChatGPT Plus/Pro or API key"})[Q.id]),...q.map((Q)=>({label:Q.name,value:Q.id,hint:"plugin"}))],G=await W1(),e=G?[G.id,...G.aliases??[]]:[],K;if(G&&$.provider&&e.includes($.provider)){await G.run();return}else if($.provider){let Q=$.provider,_=S.find((N)=>N.value===Q),F=S.find((N)=>N.label.toLowerCase()===Q.toLowerCase()),C=_??F;if(!C)W.error(`Unknown provider "${Q}"`),process.exit(1);K=C.value}else{let Q=await b({message:U("cli.providers.select"),options:[...G?.menu?[{label:G.menu.label,value:G.id,hint:G.menu.hint}]:[],{label:U("cli.providers.other"),value:"__other__"}]});if(w(Q))throw new Y.CancelledError;if(G&&Q===G.id){await G.run();return}let _=await u({message:U("cli.providers.select"),maxItems:8,options:[...S,{value:"other",label:"Other"}]});if(w(_))throw new Y.CancelledError;K=_}let E=Z.findLast((Q)=>Q.auth?.provider===K);if(E&&E.auth){if(await x({auth:E.auth},K,$.method))return}if(K==="other"){let Q=await P({message:"Enter provider id",validate:(F)=>F&&F.match(/^[0-9a-z-]+$/)?void 0:"a-z, 0-9 and hyphens only"});if(w(Q))throw new Y.CancelledError;K=Q.replace(/^@ai-sdk\//,"");let _=Z.findLast((F)=>F.auth?.provider===K);if(_&&_.auth){if(await x({auth:_.auth},K,$.method))return}W.warn(`This only stores a credential for ${K} - you will need configure it in qitqode.json, check the docs for examples.`)}if(K==="amazon-bedrock")W.info(`Amazon Bedrock authentication priority:
|
|
3
|
-
1. Bearer token (AWS_BEARER_TOKEN_BEDROCK or /connect)
|
|
4
|
-
2. AWS credential chain (profile, access keys, IAM roles, EKS IRSA)
|
|
5
|
-
|
|
6
|
-
Configure via qitqode.json options (profile, region, endpoint) or
|
|
7
|
-
AWS environment variables (AWS_PROFILE, AWS_REGION, AWS_ACCESS_KEY_ID, AWS_WEB_IDENTITY_TOKEN_FILE).`);if(K==="opencode")W.info("Create an api key at https://opencode.ai/auth");if(K==="vercel")W.info("You can create an api key at https://vercel.link/ai-gateway-token");if(["cloudflare","cloudflare-ai-gateway"].includes(K))W.info("Cloudflare AI Gateway can be configured with CLOUDFLARE_GATEWAY_ID, CLOUDFLARE_ACCOUNT_ID, and CLOUDFLARE_API_TOKEN environment variables. Read more: https://opencode.ai/docs/providers/#cloudflare-ai-gateway");let $1=await t();await D(K,{type:"api",key:$1}),T("Done")}})}}),F1=z({command:"logout",describe:"log out from a configured provider",async handler($){Y.empty();let B=await M.runPromise(O.gen(function*(){let Z=yield*R.Service;return Object.entries(yield*Z.all())}));if(L("Remove credential"),B.length===0){W.error("No credentials found");return}let J=await V.get(),X=await b({message:"Select provider",options:B.map(([Z,j])=>({label:(J[Z]?.name||Z)+Y.Style.TEXT_DIM+" ("+j.type+")",value:Z}))});if(w(X))throw new Y.CancelledError;let H=X;await M.runPromise(O.gen(function*(){yield*(yield*R.Service).remove(H)})),T("Logout successful")}}),K1=z({command:"whoami",describe:"show current logged-in user info",async handler($){Y.empty(),L("Current auth"),W.info("Run `qode auth list` to see all authenticated providers."),T("")}});export{G1 as resolvePluginProviders,K1 as ProvidersWhoamiCommand,F1 as ProvidersLogoutCommand,_1 as ProvidersLoginCommand,Y1 as ProvidersListCommand,l1 as ProvidersCommand};
|
package/bundle/chunk-3v4vtah1.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-653c0mxr.js";import"./chunk-vavrczqm.js";import"./chunk-9rqrm9y8.js";import"./chunk-d56zc21w.js";import"./chunk-mjhb1q0n.js";import"./chunk-8h9r6c8g.js";import"./chunk-9jf67xb0.js";import"./chunk-9xvctnjr.js";import"./chunk-gen6f3dn.js";import"./chunk-4aykrj51.js";import"./chunk-va4davgy.js";import"./chunk-hg563h5r.js";import"./chunk-j1a64ade.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-ecwz9nhs.js";import"./chunk-5rkmhzq0.js";import"./chunk-7mhffm9f.js";import"./chunk-r012q335.js";import"./chunk-0z3z0gk1.js";import"./chunk-g7vkkmsk.js";import"./chunk-m8djypsy.js";import"./chunk-w7p2x973.js";import"./chunk-wmw2gne9.js";import"./chunk-y3n31nnx.js";import"./chunk-3z1y040p.js";import"./chunk-kkvb2c2z.js";import"./chunk-3tdqsm5c.js";import"./chunk-a5zjrwqy.js";import"./chunk-fhng5her.js";import"./chunk-dkv2mg97.js";import"./chunk-bf146hz2.js";import"./chunk-t488d66k.js";import"./chunk-cqtkxwd8.js";import"./chunk-srf73nm4.js";import"./chunk-yzdty5t9.js";import"./chunk-1p34bx7c.js";import"./chunk-q3x4x2tq.js";import"./chunk-7dckfame.js";import"./chunk-j1veq3zr.js";import"./chunk-0pvbk8ks.js";import"./chunk-tk3bve0x.js";import"./chunk-0w4v0fbs.js";import"./chunk-wf09j72q.js";import"./chunk-hbnr0j7h.js";import"./chunk-ep8zn49w.js";import"./chunk-f3kjp838.js";import"./chunk-tsn1jkr7.js";import"./chunk-zk8n8hnh.js";import"./chunk-1jh5p5qw.js";import"./chunk-kaeyhw2n.js";import"./chunk-f89gntcy.js";import"./chunk-bky5a42k.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-v2kyarwz.js";import"./chunk-dkm7x8rj.js";import"./chunk-9pe4agdz.js";import"./chunk-kc3hpmr2.js";import"./chunk-hh4c02fh.js";export{e as statusEffect,a as resolveApiKeyFlag,d as logoutEffect,c as loginEffect,b as apiKeyLoginEffect,f as AuthCommand};
|
package/bundle/chunk-3ypk0j2f.js
DELETED
package/bundle/chunk-3z1y040p.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Vt as L}from"./chunk-f89gntcy.js";import{RI as F,mI as M,rC as C}from"./chunk-dkm7x8rj.js";var g=(q)=>(H)=>Object.assign(H,q(H));function k(){return(q,H)=>{class G{static make(J){return J}}return Object.setPrototypeOf(G,H),G}}var y=Symbol.for("effect-zod/override"),A=Symbol.for("effect-zod/preprocess"),B=new WeakMap,N={};function n(q){return V(q.ast)}function V(q){let H=B.get(q);if(H)return H;let G=D(q);return B.set(q,G),G}function D(q){let H=q.annotations?.[y];if(H)return H;let X=q.encoding?.length&&q._tag!=="Declaration"&&!(F.isOptional(q)&&_(q)!==void 0)?I(q):x(q),R=q.checks?.length?E(X,q.checks,q):X,Y=q.annotations?.[A],W=Y?L.preprocess(Y,R):R,U=F.resolveDescription(q),j=F.resolveIdentifier(q),Z=U?W.describe(U):W;return j?Z.meta({ref:j}):Z}function I(q){let H=q.encoding;return H.reduce((G,J)=>G.transform((X)=>P(J.transformation,X)),V(H[0].to))}function P(q,H){let G=M.runSyncExit(q.decode.run(C.some(H),N));if(G._tag==="Failure")throw Error(`effect-zod: transform failed: ${String(G.cause)}`);return C.getOrElse(G.value,()=>H)}function E(q,H,G){let J=[],X=(W)=>{if(W._tag==="FilterGroup")W.checks.forEach(X);else J.push(W)};H.forEach(X);let R=[],Y=J.reduce((W,U)=>{let j=O(W,U);if(j)return j;return R.push(U),W},q);if(R.length===0)return Y;return Y.superRefine((W,U)=>{for(let j of R){let Z=j.run(W,G,N);if(!Z)continue;let Q=b(Z)??j.annotations?.message??"Validation failed";U.addIssue({code:"custom",message:Q})}})}function O(q,H){let G=H.annotations?.meta;if(!G||typeof G._tag!=="string")return;switch(G._tag){case"isInt":return K(q,"int");case"isFinite":return K(q,"finite");case"isGreaterThan":return K(q,"gt",G.exclusiveMinimum);case"isGreaterThanOrEqualTo":return K(q,"gte",G.minimum);case"isLessThan":return K(q,"lt",G.exclusiveMaximum);case"isLessThanOrEqualTo":return K(q,"lte",G.maximum);case"isBetween":{let J=G.exclusiveMinimum?K(q,"gt",G.minimum):K(q,"gte",G.minimum);if(!J)return;return G.exclusiveMaximum?K(J,"lt",G.maximum):K(J,"lte",G.maximum)}case"isMultipleOf":return K(q,"multipleOf",G.divisor);case"isMinLength":return K(q,"min",G.minLength);case"isMaxLength":return K(q,"max",G.maxLength);case"isLengthBetween":{let J=K(q,"min",G.minimum);if(!J)return;return K(J,"max",G.maximum)}case"isPattern":return K(q,"regex",G.regExp);case"isStartsWith":return K(q,"startsWith",G.startsWith);case"isEndsWith":return K(q,"endsWith",G.endsWith);case"isIncludes":return K(q,"includes",G.includes);case"isUUID":return K(q,"uuid");case"isULID":return K(q,"ulid");case"isBase64":return K(q,"base64");case"isBase64Url":return K(q,"base64url")}return}function K(q,H,...G){let J=q[H];return typeof J==="function"?J.apply(q,G):void 0}function b(q){if(typeof q?.annotations?.message==="string")return q.annotations.message;if(typeof q?.message==="string")return q.message;return}function x(q){if(F.isOptional(q))return T(q);switch(q._tag){case"String":return L.string();case"Number":return L.number();case"Boolean":return L.boolean();case"Null":return L.null();case"Undefined":return L.undefined();case"Any":case"Unknown":return L.unknown();case"Never":return L.never();case"Literal":return L.literal(q.literal);case"Union":return v(q);case"Objects":return w(q);case"Arrays":return S(q);case"Declaration":return z(q);default:return $(q)}}function T(q){if(q._tag!=="Union")return $(q);let H=q.types.filter((X)=>X._tag!=="Undefined"),G=H.length===1?V(H[0]):H.length>1?L.union(H.map(V)):L.undefined(),J=_(q);if(J!==void 0)return G.default(J.value);return G.optional()}function _(q){let H=q.encoding;if(!H?.length)return;for(let G of H){let J=M.runSyncExit(G.transformation.decode.run(C.none(),{}));if(J._tag!=="Success")continue;if(C.isSome(J.value))return{value:J.value.value}}return}function v(q){if(q.types.length>=2&&q.types.every((J)=>J._tag==="Literal"&&typeof J.literal==="string"))return L.enum(q.types.map((J)=>J.literal));let H=q.types.map(V);if(H.length===1)return H[0];if(H.length<2)return $(q);let G=q.annotations?.discriminator;if(typeof G==="string")return L.discriminatedUnion(G,H);return L.union(H)}function w(q){if(q.propertySignatures.length===0&&q.indexSignatures.length===1){let G=q.indexSignatures[0];if(G.parameter._tag!=="String")return $(q);return L.record(L.string(),V(G.type))}if(q.indexSignatures.length===0)return L.object(Object.fromEntries(q.propertySignatures.map((G)=>[String(G.name),V(G.type)])));if(q.indexSignatures.length!==1)return $(q);let H=q.indexSignatures[0];if(H.parameter._tag!=="String")return $(q);return L.object(Object.fromEntries(q.propertySignatures.map((G)=>[String(G.name),V(G.type)]))).catchall(V(H.type))}function S(q){if(q.elements.length===0){if(q.rest.length!==1)return $(q);return L.array(V(q.rest[0]))}if(q.rest.length>0)return $(q);let H=q.elements.map(V);return L.tuple(H)}function z(q){if(q.typeParameters.length!==1)return $(q);return V(q.typeParameters[0])}function $(q){let H=F.resolveIdentifier(q);throw Error(`unsupported effect schema: ${H??q._tag}`)}
|
|
3
|
-
export{g as gp,k as hp,y as ip,A as jp,n as kp};
|
package/bundle/chunk-4aykrj51.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ch as f}from"./chunk-j1a64ade.js";import{up as C,yp as b}from"./chunk-kkvb2c2z.js";import{qt as p,zt as i}from"./chunk-zk8n8hnh.js";class G extends Error{cause;constructor(J,V){super(J);this.name="ForgewiseError",this.cause=V}}class K extends G{constructor(J="Device flow is not supported by this issuer."){super(J);this.name="DeviceFlowUnsupportedError"}}var a="https://app.forgewise.tech",n="forgewise-cli";function A(...J){return J.find((V)=>V!==void 0&&V.trim().length>0)}function t(){return!!process.env.REPLIT_DEV_DOMAIN}async function z(){let J=process.env.ACCOUNTS_ISSUER,V=process.env.FORGEWISE_CLIENT_ID;if(J&&V)return{issuer:J.replace(/\/+$/,""),clientId:V};let Y;try{Y=await C()}catch{Y=void 0}let Z=A(J,Y?.issuer,a).replace(/\/+$/,""),x=A(V,Y?.clientId,n);return{issuer:Z,clientId:x}}function L(J,V,Y){if(J>=200&&J<300)return{kind:"success"};let Z=V?.error??"";if(Z==="authorization_pending")return{kind:"wait",intervalMs:Y};if(Z==="slow_down")return{kind:"wait",intervalMs:Y+5000};if(Z==="access_denied")return{kind:"fatal",message:"Sign-in was denied in the browser."};if(Z==="expired_token")return{kind:"fatal",message:"The sign-in code expired before it was approved. Try again."};return{kind:"fatal",message:`Device sign-in failed: ${V?.error_description||Z||`HTTP ${J}`}`}}import y from"http";var w="/callback",I=[51737,51738],j=new Set;function F(J){return J.replace(/[&<>\"']/g,(V)=>{switch(V){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return"'"}})}function S(J){return`http://127.0.0.1:${J}${w}`}async function o(J){return new Promise((V,Y)=>{let Z=y.createServer();Z.listen(J,"127.0.0.1",()=>{Z.close(()=>V(J))}),Z.on("error",Y)})}async function E(){for(let J of I){if(j.has(J))continue;j.add(J);try{return await o(J)}catch{j.delete(J)}}throw new G(`Could not bind to any loopback port (tried ${I.join(", ")}). Free one of those ports and retry.`)}function O(J,V,Y,Z){return new Promise((x,$)=>{let X=()=>j.delete(J),W=y.createServer((q,N)=>{try{let Q=new URL(q.url??"/",`http://localhost:${J}`);if(Q.pathname!==w){N.writeHead(404),N.end();return}let B=Q.searchParams.get("code"),H=Q.searchParams.get("state"),m=Q.searchParams.get("error"),M=Q.searchParams.get("error_description");if(m){let l=`${F(m)}${M?": "+F(M):""}`;N.writeHead(200,{"Content-Type":"text/html"}),N.end(`<html><body style="font-family:sans-serif;padding:2rem"><h2>Authorization failed</h2><p>${l}</p><p>You can close this tab.</p></body></html>`),W.close(),$(new G(`Authorization error: ${m}${M?" \u2014 "+M:""}`));return}if(!B||H!==V){N.writeHead(400),N.end("Invalid request");return}N.writeHead(200,{"Content-Type":"text/html"}),N.end('<html><body style="font-family:sans-serif;padding:2rem"><h2>Signed in! You can close this tab.</h2><p>Return to your terminal to continue.</p></body></html>'),W.close(),x({code:B})}catch(Q){W.close(),$(Q)}});if(Y?.aborted){X(),$(new G("Login cancelled"));return}let D=()=>{X(),W.close(()=>$(new G("Login cancelled")))};if(Y?.addEventListener("abort",D,{once:!0}),Y?.aborted){D();return}W.listen(J,"127.0.0.1",()=>{X(),Z?.()}),W.on("error",(q)=>{X(),$(q)})})}function k(J,V){return new Promise((Y,Z)=>{if(V?.aborted){Z(new G("Login cancelled"));return}let x,$=()=>{clearTimeout(x),V?.removeEventListener("abort",$),Z(new G("Login cancelled"))};if(x=setTimeout(()=>{V?.removeEventListener("abort",$),Y()},J),V?.addEventListener("abort",$,{once:!0}),V?.aborted)$()})}function s(J,V=300000){if(!J)return!1;return Date.now()>=J-V}async function r(J){let{issuer:V}=await z();return b({issuer:V,accessToken:J})}import U from"crypto";var h="openid profile email",P=(J)=>J.toString("base64url");function v(){let J=P(U.randomBytes(32)),V=P(U.createHash("sha256").update(J).digest()),Y=P(U.randomBytes(16));return{verifier:J,challenge:V,state:Y}}function g(J){let V=new URL(`${J.issuer}/api/oauth/authorize`);return V.searchParams.set("response_type","code"),V.searchParams.set("client_id",J.clientId),V.searchParams.set("redirect_uri",J.redirectUri),V.searchParams.set("scope",h),V.searchParams.set("state",J.state),V.searchParams.set("code_challenge",J.challenge),V.searchParams.set("code_challenge_method","S256"),V.toString()}async function R(J,V){let Y=await fetch(`${J}/api/oauth/userinfo`,{headers:{Authorization:`Bearer ${V.access_token}`}});if(!Y.ok)throw new G(`Failed to fetch user profile (${Y.status})`);let Z=await Y.json();if(!Z.sub)throw new G("Userinfo response is missing required 'sub' field \u2014 the server returned an invalid user profile.");return{sub:Z.sub,name:Z.name??"",email:Z.email??"",access_token:V.access_token,expires_at:Date.now()+(V.expires_in??3600)*1000,...V.refresh_token?{refresh_token:V.refresh_token}:{}}}async function T(J){let V=await fetch(`${J.issuer}/api/oauth/token`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:J.code,redirect_uri:J.redirectUri,client_id:J.clientId,code_verifier:J.verifier}).toString(),signal:J.signal??null});if(!V.ok){let Z=await V.text().catch(()=>"");throw new G(`Token exchange failed (${V.status}): ${Z}`)}let Y=await V.json();return R(J.issuer,Y)}async function e(J,V,Y=5000){let Z=new AbortController,x=setTimeout(()=>Z.abort(),Y);try{let $=await fetch(`${J}/api/oauth/userinfo`,{headers:{Authorization:`Bearer ${V}`},signal:Z.signal});if($.status===401||$.status===403)return!1;if(!$.ok)return null;return!0}catch{return null}finally{clearTimeout(x)}}async function J0(J){let{issuer:V,clientId:Y}=await z(),Z;try{Z=await fetch(`${V}/api/oauth/token`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",client_id:Y,refresh_token:J}).toString()})}catch($){throw new G(`Could not reach the sign-in server to refresh the session: ${$ instanceof Error?$.message:String($)}`,$)}if(!Z.ok){let $=await Z.json().catch(()=>{return});if($?.error==="invalid_grant")return"invalid_grant";throw new G(`Token refresh failed (${Z.status}): ${$?.error??""}`)}let x=await Z.json();return R(V,x)}async function d(J){let V;try{V=await fetch(`${J.issuer}/api/oauth/device_authorization`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:J.clientId,scope:h}).toString(),signal:J.signal??null})}catch{if(J.signal?.aborted)throw new G("Login cancelled");throw new K}if(V.status===404||V.status===405||V.status===501)throw new K;if(!V.ok){let Z=await V.text().catch(()=>"");throw new G(`Device authorization failed (${V.status}): ${Z}`)}let Y;try{Y=await V.json()}catch{throw new K}if(!Y.device_code||!Y.user_code||!Y.verification_uri)throw new K;return{deviceCode:Y.device_code,info:{userCode:Y.user_code,verificationUri:Y.verification_uri,verificationUriComplete:Y.verification_uri_complete,expiresAt:Date.now()+(Y.expires_in??900)*1000},intervalMs:Math.max(1,Y.interval??5)*1000}}async function c(J){let V;try{V=await fetch(`${J.issuer}/api/oauth/token`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:J.deviceCode,client_id:J.clientId}).toString(),signal:J.signal??null})}catch{if(J.signal?.aborted)throw new G("Login cancelled");return{kind:"wait",intervalMs:J.currentIntervalMs}}let Y;try{Y=await V.json()}catch{Y=void 0}let Z=L(V.status,Y,J.currentIntervalMs);if(Z.kind==="success"){if(!Y?.access_token)throw new G("Token endpoint returned success without an access_token.");return{kind:"success",profile:await R(J.issuer,{access_token:Y.access_token,expires_in:Y.expires_in})}}if(Z.kind==="fatal")throw new G(Z.message);return{kind:"wait",intervalMs:Z.intervalMs}}var V0=300000;async function u(){let{issuer:J,clientId:V}=await z(),{verifier:Y,challenge:Z,state:x}=v(),$=await E(),X=S($),W=g({issuer:J,clientId:V,redirectUri:X,challenge:Z,state:x});return{issuer:J,clientId:V,verifier:Y,port:$,redirectUri:X,authorizeStr:W,state:x}}async function Y0(J){let{issuer:V,clientId:Y}=await z(),{deviceCode:Z,info:x,intervalMs:$}=await d({issuer:V,clientId:Y,signal:J.signal});if(J.onCode(x),J.tryOpen){let W=x.verificationUriComplete??x.verificationUri;f(W)}let X=$;while(Date.now()<x.expiresAt){await k(X,J.signal);let W=await c({issuer:V,clientId:Y,deviceCode:Z,currentIntervalMs:X,signal:J.signal});if(W.kind==="success")return W.profile;X=W.intervalMs}throw new G("The sign-in code expired before it was approved. Try again.")}async function Z0(){let{issuer:J,clientId:V,verifier:Y,port:Z,redirectUri:x,authorizeStr:$,state:X}=await u();process.stdout.write(`
|
|
3
|
-
`),process.stdout.write(` Opening Forgewise sign-in in your browser...
|
|
4
|
-
`),process.stdout.write(" Sign-in URL: "+$+`
|
|
5
|
-
`),process.stdout.write(`
|
|
6
|
-
`),process.stdout.write(` Waiting for the browser to complete sign-in... (ctrl+c to cancel)
|
|
7
|
-
`);let{code:W}=await O(Z,X,void 0,()=>{f($)});return process.stdout.write(`
|
|
8
|
-
Exchanging authorization code...
|
|
9
|
-
`),T({issuer:J,clientId:V,code:W,redirectUri:x,verifier:Y})}async function $0(J={}){if(J.signal?.aborted)throw new G("Login cancelled");let{issuer:V,clientId:Y,verifier:Z,port:x,redirectUri:$,authorizeStr:X,state:W}=await u(),D=()=>{if(J.onUrl?.(X),J.tryOpen!==!1)f(X)},q=new AbortController,N=()=>q.abort();J.signal?.addEventListener("abort",N,{once:!0});let Q=!1,B=setTimeout(()=>{Q=!0,q.abort()},V0);try{let{code:H}=await O(x,W,q.signal,D);return await T({issuer:V,clientId:Y,code:H,redirectUri:$,verifier:Z,signal:q.signal})}catch(H){if(Q)throw new G("Sign-in timed out. Run login again to retry.");throw H}finally{clearTimeout(B),J.signal?.removeEventListener("abort",N)}}var _=i.create({service:"auth.forgewise.checkout"}),x0="qitqode",G0=5000;async function W0(J){let Y=`${new URL(p.QITQODE_BACKEND_URL).origin}/auth/keys/checkout`;try{let Z=await fetch(Y,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${J}`},body:JSON.stringify({app:x0}),signal:AbortSignal.timeout(G0)});if(!Z.ok)return _.warn("API key checkout returned non-200; falling back to Bearer credential",{status:Z.status,url:Y}),null;let x=await Z.json();if(typeof x?.key!=="string"||!x.key)return _.warn("API key checkout response missing key field; falling back to Bearer credential",{url:Y}),null;return _.info("API key checkout succeeded; credential upgraded to api-key method",{url:Y}),x.key}catch(Z){return _.warn("API key checkout failed; falling back to Bearer credential",{url:Y,error:Z instanceof Error?Z.message:String(Z)}),null}}export{G as qg,K as rg,t as sg,z as tg,L as ug,S as vg,s as wg,r as xg,e as yg,J0 as zg,Y0 as Ag,Z0 as Bg,$0 as Cg,W0 as Dg};
|