@qitqode/qitqode-android-arm64 0.1.29 → 0.1.31
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-g06rv5fq.js → chunk-01my2y0c.js} +1 -1
- package/bundle/chunk-04n2ycg5.js +800 -0
- package/bundle/{chunk-k7dcfqjs.js → chunk-05mce0j3.js} +1 -1
- package/bundle/{chunk-3q6650we.js → chunk-0bbs01f0.js} +1 -1
- package/bundle/{chunk-1rn0vmvv.js → chunk-0dt0bxz6.js} +2 -2
- package/bundle/{chunk-x6nbck7p.js → chunk-0mx2psfc.js} +1 -1
- package/bundle/chunk-0p27fvfr.js +2 -0
- package/bundle/chunk-0qs1vx97.js +2 -0
- package/bundle/{chunk-8kz3n8ye.js → chunk-0v0vqbn5.js} +1 -1
- package/bundle/chunk-0w0ctb90.js +2 -0
- package/bundle/chunk-0yt5njh7.js +8 -0
- package/bundle/{chunk-fsy279s5.js → chunk-10bjs581.js} +2 -2
- package/bundle/{chunk-z29fwg61.js → chunk-11x3t2tt.js} +1 -1
- package/bundle/{chunk-qzjpea91.js → chunk-12vef2pr.js} +1 -1
- package/bundle/{chunk-kkae8ead.js → chunk-15hw2z9t.js} +1 -1
- package/bundle/chunk-1f7ajq8s.js +2 -0
- package/bundle/chunk-1fswr17z.js +2 -0
- package/bundle/{chunk-yt2k9ga8.js → chunk-1gx18dm5.js} +1 -1
- package/bundle/chunk-1rhhhm88.js +2 -0
- package/bundle/{chunk-b4qd109w.js → chunk-1sgahe1s.js} +1 -1
- package/bundle/{chunk-74zgcxeg.js → chunk-1vb79bw1.js} +1 -1
- package/bundle/chunk-1wbjh23g.js +2 -0
- package/bundle/chunk-20f83ca0.js +2 -0
- package/bundle/{chunk-ed723mw1.js → chunk-24jg9d61.js} +1 -1
- package/bundle/{chunk-csdm3n24.js → chunk-2hc5z7b5.js} +1 -1
- package/bundle/{chunk-bzrsnv2k.js → chunk-2maqde7w.js} +2 -2
- package/bundle/{chunk-awav98j0.js → chunk-2vn41ecx.js} +1 -1
- package/bundle/{chunk-50w28xj1.js → chunk-2zq4k837.js} +1 -1
- package/bundle/chunk-31mnd3ph.js +3 -0
- package/bundle/{chunk-a2qerqgd.js → chunk-31qrzrwy.js} +1 -1
- package/bundle/{chunk-abtn6nec.js → chunk-326p5b10.js} +2 -2
- package/bundle/{chunk-2p2ch1k2.js → chunk-33e9y2aw.js} +1 -1
- package/bundle/{chunk-asmfntjm.js → chunk-35xk4g91.js} +1 -1
- package/bundle/{chunk-n86s4fw4.js → chunk-3632wgg1.js} +1 -1
- package/bundle/{chunk-tqsx2m1j.js → chunk-3bxg5bta.js} +1 -1
- package/bundle/{chunk-6bsgrr5h.js → chunk-3c6p8tm3.js} +1 -1
- package/bundle/chunk-3h9rq2wq.js +2 -0
- package/bundle/{chunk-7wthn44y.js → chunk-3ytjm3az.js} +1 -1
- package/bundle/{chunk-2mjc44ev.js → chunk-40efytmk.js} +1 -1
- package/bundle/chunk-42p59wm4.js +2 -0
- package/bundle/{chunk-09j71kp6.js → chunk-44a82dg0.js} +4 -4
- package/bundle/chunk-4512pvca.js +2 -0
- package/bundle/chunk-456bmaww.js +2 -0
- package/bundle/{chunk-s6me101a.js → chunk-48ge2ryx.js} +1 -1
- package/bundle/chunk-48pajrnt.js +2 -0
- package/bundle/{chunk-hn1f6rne.js → chunk-4cnwn1rh.js} +2 -2
- package/bundle/chunk-4d87mhwn.js +3 -0
- package/bundle/chunk-4fy9c54h.js +2 -0
- package/bundle/{chunk-43ae3chd.js → chunk-4gkk28xk.js} +2 -2
- package/bundle/{chunk-bsf6n350.js → chunk-4jtxtkj7.js} +2 -2
- package/bundle/{chunk-pq2prhb2.js → chunk-50sv6y2e.js} +1 -1
- package/bundle/chunk-50tb3g5x.js +2 -0
- package/bundle/chunk-52bam8g7.js +2 -0
- package/bundle/{chunk-zqxmr01r.js → chunk-53bqcctj.js} +1 -1
- package/bundle/chunk-53w4zqps.js +2 -0
- package/bundle/chunk-59y8q9m5.js +2 -0
- package/bundle/chunk-5eq1fft9.js +3 -0
- package/bundle/{chunk-8f0g7d7k.js → chunk-5hw6xa49.js} +2 -2
- package/bundle/{chunk-9epjgend.js → chunk-5q4harvc.js} +2 -2
- package/bundle/chunk-5tray1fw.js +3 -0
- package/bundle/{chunk-a2g69pv6.js → chunk-5v0xjs3x.js} +1 -1
- package/bundle/{chunk-ce5t444d.js → chunk-60v5jvgt.js} +1 -1
- package/bundle/chunk-64ezpbwt.js +2 -0
- package/bundle/{chunk-b9hstp7h.js → chunk-68yw2hk9.js} +1 -1
- package/bundle/{chunk-hhgjbag9.js → chunk-69nzndk7.js} +1 -1
- package/bundle/chunk-6bpe215q.js +2 -0
- package/bundle/chunk-6bphjajd.js +2 -0
- package/bundle/{chunk-qredfmch.js → chunk-6d5rrre9.js} +1 -1
- package/bundle/{chunk-mb4wvwfw.js → chunk-6hpgb8h4.js} +3 -3
- package/bundle/{chunk-88dhcv37.js → chunk-6kp07m7p.js} +1 -1
- package/bundle/{chunk-csyw14fj.js → chunk-6phh70sp.js} +1 -1
- package/bundle/chunk-6t1ehq36.js +2 -0
- package/bundle/{chunk-hgbkg85g.js → chunk-70ck4v3t.js} +1 -1
- package/bundle/{chunk-3n49y4kh.js → chunk-71sjjjr8.js} +1 -1
- package/bundle/{chunk-geccvf9d.js → chunk-71xz70r9.js} +1 -1
- package/bundle/{chunk-9kjj44cr.js → chunk-73e409hd.js} +1 -1
- package/bundle/{chunk-1xw68zak.js → chunk-78ymd20x.js} +1 -1
- package/bundle/{chunk-n4gjpgnk.js → chunk-7avcnwv8.js} +1 -1
- package/bundle/{chunk-z8v2tsz2.js → chunk-7hm0c2yg.js} +1 -1
- package/bundle/{chunk-kfgn4apg.js → chunk-7mke41x0.js} +1 -1
- package/bundle/chunk-7pfj4x1a.js +2 -0
- package/bundle/chunk-7ry9cvby.js +2 -0
- package/bundle/chunk-7wczs9mx.js +2 -0
- package/bundle/{chunk-yjj4cvqg.js → chunk-7xm75w1e.js} +1 -1
- package/bundle/{chunk-y212x7ws.js → chunk-7z5jh4ra.js} +1 -1
- package/bundle/{chunk-98vfbn0h.js → chunk-81qwdg5s.js} +1 -1
- package/bundle/{chunk-r4mnbhe1.js → chunk-83gqkmth.js} +1 -1
- package/bundle/chunk-873skv7w.js +2 -0
- package/bundle/{chunk-ndmrg80b.js → chunk-8hytwgwf.js} +1 -1
- package/bundle/{chunk-0wdtbn59.js → chunk-8n20thvd.js} +2 -2
- package/bundle/{chunk-xn61fgrh.js → chunk-8qswepp2.js} +1 -1
- package/bundle/chunk-8v96pmqn.js +2 -0
- package/bundle/chunk-8y2scz6z.js +2 -0
- package/bundle/{chunk-7mc8nxve.js → chunk-8ymffyep.js} +1 -1
- package/bundle/chunk-8zx7vnx6.js +2 -0
- package/bundle/{chunk-8k55xz7z.js → chunk-93p131d5.js} +1 -1
- package/bundle/chunk-94a76f8w.js +2 -0
- package/bundle/{chunk-3h4y7n1a.js → chunk-9emq67vc.js} +1 -1
- package/bundle/{chunk-ypthfv6d.js → chunk-9f1z9xce.js} +1 -1
- package/bundle/chunk-9mjz6e27.js +2 -0
- package/bundle/chunk-9ng7jjp7.js +2 -0
- package/bundle/chunk-9tpgnjy8.js +2 -0
- package/bundle/{chunk-f29n7826.js → chunk-9x5232dw.js} +1 -1
- package/bundle/{chunk-t3tkp1em.js → chunk-a1wdeapb.js} +1 -1
- package/bundle/{chunk-b20xjnpw.js → chunk-a7amey9s.js} +1 -1
- package/bundle/chunk-a7ym9f0v.js +2 -0
- package/bundle/chunk-a8f2xvy3.js +2 -0
- package/bundle/chunk-a99cvwta.js +2 -0
- package/bundle/chunk-abd1cfpg.js +2 -0
- package/bundle/{chunk-yn576pje.js → chunk-ag8kz1e7.js} +2 -2
- package/bundle/chunk-anwnwfjf.js +2 -0
- package/bundle/chunk-avys5mnz.js +2 -0
- package/bundle/chunk-axvjd10y.js +2 -0
- package/bundle/{chunk-4vze3djr.js → chunk-ay8emwym.js} +1 -1
- package/bundle/chunk-b4pphqab.js +2 -0
- package/bundle/chunk-b6087ak4.js +2 -0
- package/bundle/{chunk-qje3683x.js → chunk-b8gjz6bk.js} +1 -1
- package/bundle/chunk-bgw4fvg2.js +2 -0
- package/bundle/{chunk-q0xzbad1.js → chunk-bh53dz71.js} +1 -1
- package/bundle/chunk-brkqxbjy.js +2 -0
- package/bundle/{chunk-j2zay4da.js → chunk-c11d28qn.js} +2 -2
- package/bundle/{chunk-hd2kb05a.js → chunk-c14s0kxq.js} +1 -1
- package/bundle/{chunk-qsszerj7.js → chunk-c1bdzxbx.js} +2 -2
- package/bundle/{chunk-v9xnk9pz.js → chunk-c1vnp55z.js} +1 -1
- package/bundle/chunk-c26qxt5g.js +2 -0
- package/bundle/chunk-c6zscb38.js +2 -0
- package/bundle/{chunk-g0mbbysk.js → chunk-cfgvm15x.js} +1 -1
- package/bundle/{chunk-jntqzhxr.js → chunk-chpr8ekb.js} +1 -1
- package/bundle/chunk-cjww2jmv.js +3 -0
- package/bundle/{chunk-hbtd620x.js → chunk-ck2gfaba.js} +1 -1
- package/bundle/chunk-cmbh77cs.js +7 -0
- package/bundle/{chunk-eqcd9k9p.js → chunk-cnmq5xtq.js} +218 -218
- package/bundle/{chunk-azx0zxnx.js → chunk-cphrgyp6.js} +1 -1
- package/bundle/chunk-csz0dgyp.js +2 -0
- package/bundle/{chunk-fhdpp77n.js → chunk-ctaze2hn.js} +1 -1
- package/bundle/{chunk-n5sh2790.js → chunk-cxnfy6qk.js} +1 -1
- package/bundle/{chunk-yn05n0az.js → chunk-d07p6fpk.js} +2 -2
- package/bundle/{chunk-kw09hbrb.js → chunk-d65qs4d0.js} +1 -1
- package/bundle/{chunk-xk1nh1ay.js → chunk-d68fzyw7.js} +2 -2
- package/bundle/{chunk-6hdjkvr1.js → chunk-d6ry9418.js} +2 -2
- package/bundle/{chunk-zbq60sw6.js → chunk-dactgryw.js} +1 -1
- package/bundle/chunk-dafmkrhn.js +2 -0
- package/bundle/{chunk-qzcfjz9g.js → chunk-db405hjg.js} +1 -1
- package/bundle/chunk-dgprdym0.js +2 -0
- package/bundle/{chunk-v7deh7aj.js → chunk-dnwefyhv.js} +1 -1
- package/bundle/{chunk-scqxmv8k.js → chunk-drvkj3xg.js} +1 -1
- package/bundle/chunk-dryzt12j.js +2 -0
- package/bundle/chunk-dsamees2.js +2 -0
- package/bundle/{chunk-bv8pf0m1.js → chunk-dxpj0cxh.js} +2 -2
- package/bundle/{chunk-nv2r4cns.js → chunk-dynv30gm.js} +1 -1
- package/bundle/chunk-dyqpxx3b.js +2 -0
- package/bundle/{chunk-pg8dz1rq.js → chunk-e01wnqvc.js} +1 -1
- package/bundle/{chunk-z160s5p5.js → chunk-e10py6yr.js} +1 -1
- package/bundle/{chunk-xk7je9y8.js → chunk-e7ny0b3x.js} +1 -1
- package/bundle/{chunk-2w20mhch.js → chunk-eh7e49k4.js} +1 -1
- package/bundle/{chunk-6jewfaqa.js → chunk-ehhas0ew.js} +2 -2
- package/bundle/{chunk-6scqd8fh.js → chunk-ejrhvy38.js} +1 -1
- package/bundle/{chunk-sv48x9h8.js → chunk-enpzvmtc.js} +1 -1
- package/bundle/chunk-excnptfy.js +2 -0
- package/bundle/chunk-ez8vkgfz.js +2 -0
- package/bundle/chunk-f2btnww9.js +2 -0
- package/bundle/chunk-f8eter69.js +5 -0
- package/bundle/{chunk-7926bzm7.js → chunk-fgg9txzb.js} +1 -1
- package/bundle/chunk-fjq3a347.js +2 -0
- package/bundle/{chunk-6528bthc.js → chunk-fn9h4ync.js} +1 -1
- package/bundle/{chunk-m2ny1en7.js → chunk-fq0x3esz.js} +5 -5
- package/bundle/{chunk-h8chkene.js → chunk-fvzwbjh8.js} +1 -1
- package/bundle/chunk-fxdtq2ed.js +2 -0
- package/bundle/{chunk-sbx9z70j.js → chunk-fyqjm5fv.js} +1 -1
- package/bundle/{chunk-t35n89t9.js → chunk-g10d6x57.js} +1 -1
- package/bundle/{chunk-1d9f53sk.js → chunk-g5rabwre.js} +2 -2
- package/bundle/{chunk-4fk4se02.js → chunk-g7ccdh7r.js} +1 -1
- package/bundle/{chunk-0yqbyres.js → chunk-g9cjsfvg.js} +1 -1
- package/bundle/{chunk-yvqbewmc.js → chunk-gagtmjmp.js} +2 -2
- package/bundle/{chunk-4fspp5fg.js → chunk-gb00fh4z.js} +3 -3
- package/bundle/{chunk-44jpsp97.js → chunk-gbpvs0fx.js} +1 -1
- package/bundle/{chunk-v9bmpndq.js → chunk-gbrnn2dk.js} +1 -1
- package/bundle/chunk-gcw4rn10.js +2 -0
- package/bundle/{chunk-j8efst22.js → chunk-gj0wt0cy.js} +1 -1
- package/bundle/{chunk-rptvpa1v.js → chunk-gsar6xda.js} +1 -1
- package/bundle/{chunk-nxn4arcf.js → chunk-gt31468k.js} +1 -1
- package/bundle/{chunk-c19t7e8s.js → chunk-gwp17r03.js} +1 -1
- package/bundle/chunk-gwzw92jt.js +2 -0
- package/bundle/{chunk-z5yrvg40.js → chunk-h2afsbm1.js} +1 -1
- package/bundle/{chunk-d86ma6zk.js → chunk-h4j5xzc8.js} +1 -1
- package/bundle/{chunk-hevb7k95.js → chunk-hbbsbyyq.js} +1 -1
- package/bundle/chunk-hnctaq8s.js +3 -0
- package/bundle/{chunk-g3ch14a1.js → chunk-hnzegjgv.js} +1 -1
- package/bundle/chunk-hp7tssgv.js +2 -0
- package/bundle/chunk-ht0hbdmx.js +2 -0
- package/bundle/{chunk-ekndhwnn.js → chunk-ht5w06x7.js} +2 -2
- package/bundle/{chunk-a8p9aggx.js → chunk-htz93dsd.js} +1 -1
- package/bundle/{chunk-svrxk3vf.js → chunk-jbx3s7nw.js} +2 -2
- package/bundle/chunk-jcjbr3q7.js +2 -0
- package/bundle/{chunk-yyqrbv2f.js → chunk-jef04wyf.js} +1 -1
- package/bundle/{chunk-b1ntb3dh.js → chunk-jh0bw59r.js} +1 -1
- package/bundle/{chunk-b73s2h43.js → chunk-jrqb0jwy.js} +1 -1
- package/bundle/{chunk-3rt2k5sc.js → chunk-js1n8tgv.js} +1 -1
- package/bundle/chunk-jxswwvr3.js +2 -0
- package/bundle/{chunk-0626rvy2.js → chunk-kf167jw7.js} +1 -1
- package/bundle/{chunk-byc7ev8p.js → chunk-kfxv5rfg.js} +1 -1
- package/bundle/{chunk-d0qqgxs4.js → chunk-kj20f048.js} +1 -1
- package/bundle/{chunk-cd867geb.js → chunk-kq6b222y.js} +1 -1
- package/bundle/{chunk-6hmj972a.js → chunk-ktzq4ha1.js} +1 -1
- package/bundle/chunk-m5m448mg.js +3 -0
- package/bundle/{chunk-dfja6dj6.js → chunk-mcg24gkb.js} +1 -1
- package/bundle/chunk-mh0j6dzy.js +2 -0
- package/bundle/{chunk-p7h2qd7z.js → chunk-mk1bfzg5.js} +1 -1
- package/bundle/chunk-mxzceza9.js +2 -0
- package/bundle/{chunk-4vemws1t.js → chunk-mzs2pjyc.js} +2 -2
- package/bundle/chunk-n0dy98h2.js +2 -0
- package/bundle/{chunk-jwtev7b7.js → chunk-n9xns8by.js} +2 -2
- package/bundle/chunk-ngm6pqyt.js +2 -0
- package/bundle/chunk-ngtavamt.js +2 -0
- package/bundle/chunk-nkhc32s3.js +2 -0
- package/bundle/chunk-npse2xrd.js +2 -0
- package/bundle/{chunk-3vmh2ge6.js → chunk-nsk8dkwp.js} +1 -1
- package/bundle/{chunk-1fz0383p.js → chunk-nv3eyyaj.js} +1 -1
- package/bundle/{chunk-az9hsk6z.js → chunk-p18axz0m.js} +1 -1
- package/bundle/{chunk-2p9py4rw.js → chunk-p62gb4wj.js} +1 -1
- package/bundle/chunk-p6e4vqy7.js +2 -0
- package/bundle/{chunk-ktqrbbkh.js → chunk-p9qfbr02.js} +1 -1
- package/bundle/chunk-pctt1qv8.js +14 -0
- package/bundle/{chunk-gd45tjbd.js → chunk-pe29yy6s.js} +1 -1
- package/bundle/chunk-pf9g671w.js +2 -0
- package/bundle/chunk-phv9kdq6.js +3 -0
- package/bundle/{chunk-k095hd3c.js → chunk-pp2eqkse.js} +1 -1
- package/bundle/{chunk-gjvymdhp.js → chunk-pp6vhqrr.js} +1 -1
- package/bundle/chunk-ppjnqexm.js +2 -0
- package/bundle/chunk-pqkjhn8h.js +2 -0
- package/bundle/{chunk-yj73ehjd.js → chunk-pxvk3syj.js} +1 -1
- package/bundle/{chunk-tsb9g1nz.js → chunk-qbc36nbb.js} +2 -2
- package/bundle/{chunk-xhncwg5v.js → chunk-qc8rsn4v.js} +1 -1
- package/bundle/chunk-qd8w2gkd.js +2 -0
- package/bundle/{chunk-k16s2dnx.js → chunk-qrsveve6.js} +1 -1
- package/bundle/chunk-qvnb3j71.js +3 -0
- package/bundle/{chunk-q5363rr9.js → chunk-r4ndwym0.js} +1 -1
- package/bundle/chunk-r78czx4d.js +8 -0
- package/bundle/{chunk-cjfgs1x8.js → chunk-rbk8seme.js} +1 -1
- package/bundle/{chunk-n34y5gp6.js → chunk-redjxn13.js} +2 -2
- package/bundle/chunk-rf12t4n5.js +2 -0
- package/bundle/{chunk-fj7kd4gc.js → chunk-rg0mrprz.js} +1 -1
- package/bundle/{chunk-2xxefrps.js → chunk-rjd8gbs5.js} +1 -1
- package/bundle/chunk-rpgne7xh.js +2 -0
- package/bundle/chunk-rvgj1vky.js +2 -0
- package/bundle/{chunk-bx6kyvg7.js → chunk-rvkrgkeq.js} +1 -1
- package/bundle/{chunk-2hw0jzv4.js → chunk-rzhdkkpz.js} +1 -1
- package/bundle/{chunk-45jqjyk9.js → chunk-s9ntkjz3.js} +1 -1
- package/bundle/{chunk-81h5f8ev.js → chunk-skqbaadf.js} +1 -1
- package/bundle/chunk-ss2jvqrg.js +2 -0
- package/bundle/{chunk-61yatzp8.js → chunk-ss2ms1r3.js} +1 -1
- package/bundle/chunk-ssajqv72.js +2 -0
- package/bundle/{chunk-xn5v8wgh.js → chunk-t56r99hp.js} +1 -1
- package/bundle/{chunk-s1sepxdp.js → chunk-t8m74g39.js} +1 -1
- package/bundle/{chunk-s6bar2f9.js → chunk-t9mz17gb.js} +2 -2
- package/bundle/chunk-takew94z.js +9 -0
- package/bundle/{chunk-yp3dj4wh.js → chunk-tq0239xp.js} +1 -1
- package/bundle/{chunk-20d0cd1j.js → chunk-tqj69nh6.js} +2 -2
- package/bundle/{chunk-hpfqnjfz.js → chunk-tt30dybd.js} +1 -1
- package/bundle/{chunk-thk93j3e.js → chunk-tvdmnee6.js} +1 -1
- package/bundle/chunk-tvwwq4b3.js +2 -0
- package/bundle/{chunk-18vygvnc.js → chunk-v1xjc3s8.js} +1 -1
- package/bundle/chunk-v2n26eg4.js +2 -0
- package/bundle/chunk-vb286b31.js +2 -0
- package/bundle/chunk-vbeb74ny.js +11 -0
- package/bundle/chunk-vcw00k0n.js +3 -0
- package/bundle/{chunk-cfxjwfn4.js → chunk-vhe0tth1.js} +1 -1
- package/bundle/{chunk-z4nay2ef.js → chunk-vvxmwyrw.js} +1 -1
- package/bundle/{chunk-js9wdh67.js → chunk-vxyy2dp3.js} +2 -2
- package/bundle/{chunk-qk9vccja.js → chunk-vywnd5sf.js} +1 -1
- package/bundle/{chunk-gd5stg49.js → chunk-w18xs2h5.js} +1 -1
- package/bundle/{chunk-5n4hpc4f.js → chunk-wfb608qf.js} +3 -3
- package/bundle/chunk-x24y7qyd.js +2 -0
- package/bundle/{chunk-jkm54mha.js → chunk-x3y2xzhn.js} +1 -1
- package/bundle/{chunk-n3t52cz2.js → chunk-x4sp99g6.js} +1 -1
- package/bundle/{chunk-ef2b07fm.js → chunk-x562b0xk.js} +1 -1
- package/bundle/{chunk-zasd8cz8.js → chunk-x7k5yeey.js} +1 -1
- package/bundle/{chunk-v00cptj6.js → chunk-x9rbv6p6.js} +1 -1
- package/bundle/{chunk-m6wceqay.js → chunk-xcmgkc57.js} +1 -1
- package/bundle/{chunk-pycjksh4.js → chunk-xm7wascx.js} +1 -1
- package/bundle/{chunk-yaj9ywvz.js → chunk-xthkjax9.js} +1 -1
- package/bundle/{chunk-ps6jk326.js → chunk-xvwvd4kq.js} +2 -2
- package/bundle/{chunk-31wxbws4.js → chunk-xzrb857v.js} +1 -1
- package/bundle/chunk-y2d0w09y.js +2 -0
- package/bundle/{chunk-cev2qj7w.js → chunk-y3b4k38p.js} +1 -1
- package/bundle/{chunk-b9nwaaqs.js → chunk-y9q0hb7b.js} +2 -2
- package/bundle/chunk-yb79f79m.js +2 -0
- package/bundle/{chunk-8d2ddmf0.js → chunk-yek0sk2q.js} +1 -1
- package/bundle/{chunk-9atkgkaq.js → chunk-yhbcbjfk.js} +1 -1
- package/bundle/{chunk-k20nrwbg.js → chunk-yjf3kyej.js} +1 -1
- package/bundle/chunk-yjnyzpmt.js +2 -0
- package/bundle/{chunk-0a0vat1h.js → chunk-yp5bypsp.js} +2 -2
- package/bundle/{chunk-89f8v2y8.js → chunk-yp8wyzzm.js} +1 -1
- package/bundle/chunk-yqbcnsa1.js +2 -0
- package/bundle/{chunk-qtsmgjk7.js → chunk-yv0xrnn9.js} +1 -1
- package/bundle/chunk-z3mra3nm.js +2 -0
- package/bundle/{chunk-7m8fdp5p.js → chunk-z6pwkwdr.js} +1 -1
- package/bundle/{chunk-t299e2aw.js → chunk-zs8kqdsf.js} +2 -2
- package/bundle/{chunk-6saj1dhz.js → chunk-zscer8rc.js} +1 -1
- package/bundle/{chunk-4mrz9b6d.js → chunk-zw815d68.js} +2 -2
- package/bundle/chunk-zy9w1vkc.js +2 -0
- package/bundle/index.js +3 -3
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-07c1mvy1.js +0 -2
- package/bundle/chunk-0p7qcm51.js +0 -2
- package/bundle/chunk-0pmb7zzh.js +0 -2
- package/bundle/chunk-0xm85ayc.js +0 -3
- package/bundle/chunk-11d987sj.js +0 -11
- package/bundle/chunk-19sa03c1.js +0 -3
- package/bundle/chunk-1s9ctg0d.js +0 -2
- package/bundle/chunk-2f9fn9xr.js +0 -2
- package/bundle/chunk-2fhcvfyg.js +0 -2
- package/bundle/chunk-2ztdqtnk.js +0 -3
- package/bundle/chunk-3mfj0x4p.js +0 -2
- package/bundle/chunk-3shnje9k.js +0 -2
- package/bundle/chunk-3tz1qhpt.js +0 -2
- package/bundle/chunk-4dtbdycg.js +0 -2
- package/bundle/chunk-4kpvceap.js +0 -2
- package/bundle/chunk-4pz8av2y.js +0 -2
- package/bundle/chunk-4r4xh8a6.js +0 -2
- package/bundle/chunk-5hpq59t1.js +0 -2
- package/bundle/chunk-5s90ehww.js +0 -2
- package/bundle/chunk-5z7mjwwa.js +0 -14
- package/bundle/chunk-63kcg127.js +0 -2
- package/bundle/chunk-6fejrpht.js +0 -2
- package/bundle/chunk-6zzdw7q1.js +0 -2
- package/bundle/chunk-71pmrpkc.js +0 -2
- package/bundle/chunk-78m8rayq.js +0 -2
- package/bundle/chunk-7j6p5j2g.js +0 -2
- package/bundle/chunk-7tjd6ba1.js +0 -2
- package/bundle/chunk-8d8efdry.js +0 -2
- package/bundle/chunk-8jzjvmaz.js +0 -2
- package/bundle/chunk-93jxndr8.js +0 -2
- package/bundle/chunk-94qmhz2p.js +0 -3
- package/bundle/chunk-95qs7wnz.js +0 -2
- package/bundle/chunk-97h0jx8y.js +0 -5
- package/bundle/chunk-99ve54r6.js +0 -2
- package/bundle/chunk-9ksaqyb2.js +0 -2
- package/bundle/chunk-9p7t748e.js +0 -2
- package/bundle/chunk-a69jgepp.js +0 -2
- package/bundle/chunk-a94s0jks.js +0 -2
- package/bundle/chunk-ar310tc3.js +0 -2
- package/bundle/chunk-at03h9eq.js +0 -2
- package/bundle/chunk-ay9p70xx.js +0 -2
- package/bundle/chunk-b6dsv601.js +0 -3
- package/bundle/chunk-bajtytm5.js +0 -2
- package/bundle/chunk-bh8v3mfg.js +0 -2
- package/bundle/chunk-bp8sxnrm.js +0 -2
- package/bundle/chunk-bw5e8thn.js +0 -2
- package/bundle/chunk-c8ajbhv3.js +0 -2
- package/bundle/chunk-c8n72r2k.js +0 -8
- package/bundle/chunk-ccddzk10.js +0 -2
- package/bundle/chunk-ch8cx9jn.js +0 -2
- package/bundle/chunk-cm4jtnkg.js +0 -2
- package/bundle/chunk-cq7j5tv5.js +0 -2
- package/bundle/chunk-cttqh20d.js +0 -2
- package/bundle/chunk-cvvfa1jf.js +0 -2
- package/bundle/chunk-d7t0bcvk.js +0 -800
- package/bundle/chunk-dd3m74rc.js +0 -3
- package/bundle/chunk-e3qtndrt.js +0 -2
- package/bundle/chunk-e8cac405.js +0 -2
- package/bundle/chunk-ez92ah9y.js +0 -2
- package/bundle/chunk-fazvedgy.js +0 -2
- package/bundle/chunk-gf5pwww1.js +0 -2
- package/bundle/chunk-gtzcm5sb.js +0 -2
- package/bundle/chunk-j0znryc6.js +0 -9
- package/bundle/chunk-kzrw6h8t.js +0 -2
- package/bundle/chunk-ma0m6kpj.js +0 -2
- package/bundle/chunk-mjrvj2cg.js +0 -2
- package/bundle/chunk-mpebdv59.js +0 -2
- package/bundle/chunk-n20v44zr.js +0 -2
- package/bundle/chunk-nfzmvy30.js +0 -2
- package/bundle/chunk-nksathh4.js +0 -2
- package/bundle/chunk-p5360c2q.js +0 -2
- package/bundle/chunk-q14890p6.js +0 -2
- package/bundle/chunk-q4n02cwv.js +0 -2
- package/bundle/chunk-q7s17j1b.js +0 -2
- package/bundle/chunk-qm07wesh.js +0 -2
- package/bundle/chunk-qrrg9v3d.js +0 -2
- package/bundle/chunk-rdqgss38.js +0 -2
- package/bundle/chunk-rf524gez.js +0 -3
- package/bundle/chunk-rqgcz2zr.js +0 -2
- package/bundle/chunk-rs1698xs.js +0 -3
- package/bundle/chunk-rzc528ym.js +0 -2
- package/bundle/chunk-s2za1n7h.js +0 -8
- package/bundle/chunk-sbv96mj0.js +0 -3
- package/bundle/chunk-t3q7qakr.js +0 -2
- package/bundle/chunk-th78zcds.js +0 -2
- package/bundle/chunk-tj00kzk4.js +0 -2
- package/bundle/chunk-tv26mwx5.js +0 -2
- package/bundle/chunk-v69n6mef.js +0 -2
- package/bundle/chunk-vegwb3t0.js +0 -2
- package/bundle/chunk-w9seyn69.js +0 -2
- package/bundle/chunk-wanf4se3.js +0 -2
- package/bundle/chunk-wdhzmk1b.js +0 -2
- package/bundle/chunk-wnwesaap.js +0 -2
- package/bundle/chunk-wxqtda70.js +0 -2
- package/bundle/chunk-wzb6s9rk.js +0 -2
- package/bundle/chunk-x0dg9rg6.js +0 -2
- package/bundle/chunk-xmnzrzbs.js +0 -2
- package/bundle/chunk-xzf62kc6.js +0 -2
- package/bundle/chunk-yk8kk25c.js +0 -3
- package/bundle/chunk-yned6vmd.js +0 -3
- package/bundle/chunk-yra49yga.js +0 -2
- package/bundle/chunk-ytye0p7f.js +0 -2
- package/bundle/chunk-yv2mxxbq.js +0 -2
- package/bundle/chunk-z2fqqer0.js +0 -2
- package/bundle/chunk-z3qanc8m.js +0 -2
- package/bundle/chunk-z44m19vm.js +0 -2
- package/bundle/chunk-zcagdtab.js +0 -2
- package/bundle/chunk-zervk6c5.js +0 -2
- package/bundle/chunk-zqjp7jdd.js +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-7xm75w1e.js";var{create:mr,defineProperty:it,getOwnPropertyDescriptor:fr,getOwnPropertyNames:yr,getPrototypeOf:xr}=Object,Pr=Object.prototype.hasOwnProperty,Ar=(l,u)=>()=>(u||l((u={exports:{}}).exports,u),u.exports),rt=(l,u)=>{for(var m in u)it(l,m,{get:u[m],enumerable:!0})},gr=(l,u,m,f)=>{if(u&&typeof u=="object"||typeof u=="function")for(let x of yr(u))!Pr.call(l,x)&&x!==m&&it(l,x,{get:()=>u[x],enumerable:!(f=fr(u,x))||f.enumerable});return l},Gt=(l,u,m)=>(m=l!=null?mr(xr(l)):{},gr(u||!l||!l.__esModule?it(m,"default",{value:l,enumerable:!0}):m,l)),Yt=Ar((l)=>{Object.defineProperty(l,"__esModule",{value:!0});function u(t,e){if(t==null)return{};var s={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;s[i]=t[i]}return s}var m=class{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}},f=class{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}};function x(t,e){let{line:s,column:i,index:r}=t;return new m(s,i+e,r+e)}var C="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",D={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:C},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:C}},U={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},S=(t)=>t.type==="UpdateExpression"?U.UpdateExpression[`${t.prefix}`]:U[t.type],M={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
3
3
|
- Did you mean \`export { '${t}' as '${e}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:t})=>`'${t==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:t})=>`Unsyntactic ${t==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:t})=>`A string literal cannot be used as an imported binding.
|
|
4
4
|
- Did you mean \`import { "${t}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:t})=>`Expected number in radix ${t}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:t})=>`Escape sequence in keyword ${t}.`,InvalidIdentifier:({identifierName:t})=>`Invalid identifier ${t}.`,InvalidLhs:({ancestor:t})=>`Invalid left-hand side in ${S(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${S(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${S(t)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:t})=>`Unexpected character '${t}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:t})=>`Private name #${t} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:t})=>`Label '${t}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:t})=>`This experimental syntax requires enabling the parser plugin: ${t.map((e)=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:t})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${t.map((e)=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:t})=>`Duplicate key "${t}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:t})=>`An export name cannot include a lone surrogate, found '\\u${t.toString(16)}'.`,ModuleExportUndefined:({localName:t})=>`Export '${t}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:t})=>`Private names are only allowed in property accesses (\`obj.#${t}\`) or in \`in\` expressions (\`#${t} in obj\`).`,PrivateNameRedeclaration:({identifierName:t})=>`Duplicate private name #${t}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:t})=>`Unexpected keyword '${t}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:t})=>`Unexpected reserved word '${t}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:t,unexpected:e})=>`Unexpected token${e?` '${e}'.`:""}${t?`, expected "${t}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:t,onlyValidPropertyName:e})=>`The only valid meta property for ${t} is ${t}.${e}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:t})=>`Identifier '${t}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},B={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:t})=>`Assigning to '${t}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:t})=>`Binding '${t}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},X={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:t})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(t)}\`.`},ie=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),re=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:t})=>`Invalid topic token ${t}. In order to use ${t} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${t}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:t})=>`Hack-style pipe body cannot be an unparenthesized ${S({type:t})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),ms=["message"];function ot(t,e,s){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,value:s})}function fs({toMessage:t,code:e,reasonCode:s,syntaxPlugin:i}){let r=s==="MissingPlugin"||s==="MissingOneOfPlugins";{let a={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};a[s]&&(s=a[s])}return function a(n,o){let p=SyntaxError();return p.code=e,p.reasonCode=s,p.loc=n,p.pos=n.index,p.syntaxPlugin=i,r&&(p.missingPlugin=o.missingPlugin),ot(p,"clone",function(h={}){var d;let{line:y,column:A,index:T}=(d=h.loc)!=null?d:n;return a(new m(y,A,T),Object.assign({},o,h.details))}),ot(p,"details",o),Object.defineProperty(p,"message",{configurable:!0,get(){let h=`${t(o)} (${n.line}:${n.column})`;return this.message=h,h},set(h){Object.defineProperty(this,"message",{value:h,writable:!0})}}),p}}function $(t,e){if(Array.isArray(t))return(i)=>$(i,t[0]);let s={};for(let i of Object.keys(t)){let r=t[i],a=typeof r=="string"?{message:()=>r}:typeof r=="function"?{message:r}:r,{message:n}=a,o=u(a,ms),p=typeof n=="string"?()=>n:n;s[i]=fs(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:i,toMessage:p},e?{syntaxPlugin:e}:{},o))}return s}var c=Object.assign({},$(D),$(M),$(B),$(X),$`pipelineOperator`(re));function ys(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function xs(t){let e=ys();if(t==null)return e;if(t.annexB!=null&&t.annexB!==!1)throw Error("The `annexB` option can only be set to `false`.");for(let s of Object.keys(e))t[s]!=null&&(e[s]=t[s]);if(e.startLine===1)t.startIndex==null&&e.startColumn>0?e.startIndex=e.startColumn:t.startColumn==null&&e.startIndex>0&&(e.startColumn=e.startIndex);else if((t.startColumn==null||t.startIndex==null)&&t.startIndex!=null)throw Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");return e}var{defineProperty:Ps}=Object,ht=(t,e)=>{t&&Ps(t,e,{enumerable:!1,value:t[e]})};function pe(t){return ht(t.loc.start,"index"),ht(t.loc.end,"index"),t}var As=(t)=>class extends t{parse(){let e=pe(super.parse());return this.optionFlags&256&&(e.tokens=e.tokens.map(pe)),e}parseRegExpLiteral({pattern:e,flags:s}){let i=null;try{i=new RegExp(e,s)}catch{}let r=this.estreeParseLiteral(i);return r.regex={pattern:e,flags:s},r}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let i=this.estreeParseLiteral(s);return i.bigint=String(i.value||e),i}parseDecimalLiteral(e){let s=this.estreeParseLiteral(null);return s.decimal=String(s.value||e),s}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}estreeParseChainExpression(e,s){let i=this.startNodeAtNode(e);return i.expression=e,this.finishNodeAt(i,"ChainExpression",s)}directiveToStmt(e){let s=e.value;delete e.value,this.castNodeTo(s,"Literal"),s.raw=s.extra.raw,s.value=s.extra.expressionValue;let i=this.castNodeTo(e,"ExpressionStatement");return i.expression=s,i.directive=s.extra.rawValue,delete s.extra,i}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:s,end:i,loc:r,range:a,raw:n,value:o}=e,p=Object.create(e.constructor.prototype);return p.type="Literal",p.start=s,p.end=i,p.loc=r,p.range=a,p.raw=n,p.value=o,p}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,i,r,a){super.parseBlockBody(e,s,i,r,a);let n=e.directives.map((o)=>this.directiveToStmt(o));e.body=n.concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let s=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=s,this.castNodeTo(e,"PrivateIdentifier")}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,s){let i=super.parseLiteral(e,s);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(e,s,i=!1){super.parseFunctionBody(e,s,i),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,i,r,a,n,o=!1){let p=this.startNode();p.kind=e.kind,p=super.parseMethod(p,s,i,r,a,n,o),delete p.kind;let{typeParameters:h}=e;h&&(delete e.typeParameters,p.typeParameters=h,this.resetStartLocationFromNode(p,h));let d=this.castNodeTo(p,"FunctionExpression");return e.value=d,n==="ClassPrivateMethod"&&(e.computed=!1),n==="ObjectMethod"?(e.kind==="method"&&(e.kind="init"),e.shorthand=!1,this.finishNode(e,"Property")):this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&this.castNodeTo(s,"PropertyDefinition"),s}parseClassPrivateProperty(...e){let s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(s,"PropertyDefinition"),s.computed=!1),s}parseClassAccessorProperty(e){let s=super.parseClassAccessorProperty(e);return this.getPluginOption("estree","classFeatures")&&(s.abstract&&this.hasPlugin("typescript")?(delete s.abstract,this.castNodeTo(s,"TSAbstractAccessorProperty")):this.castNodeTo(s,"AccessorProperty")),s}parseObjectProperty(e,s,i,r){let a=super.parseObjectProperty(e,s,i,r);return a&&(a.kind="init",this.castNodeTo(a,"Property")),a}finishObjectProperty(e){return e.kind="init",this.finishNode(e,"Property")}isValidLVal(e,s,i){return e==="Property"?"value":super.isValidLVal(e,s,i)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){let{key:i,value:r}=e;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(r,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,i){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(c.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(c.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,i)}finishCallExpression(e,s){let i=super.finishCallExpression(e,s);if(i.callee.type==="Import"){var r,a;this.castNodeTo(i,"ImportExpression"),i.source=i.arguments[0],i.options=(r=i.arguments[1])!=null?r:null,i.attributes=(a=i.arguments[1])!=null?a:null,delete i.arguments,delete i.callee}else i.type==="OptionalCallExpression"?this.castNodeTo(i,"CallExpression"):i.optional=!1;return i}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){let i=this.state.lastTokStartLoc,r=super.parseExport(e,s);switch(r.type){case"ExportAllDeclaration":r.exported=null;break;case"ExportNamedDeclaration":r.specifiers.length===1&&r.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(r,"ExportAllDeclaration"),r.exported=r.specifiers[0].exported,delete r.specifiers);case"ExportDefaultDeclaration":{var a;let{declaration:n}=r;(n==null?void 0:n.type)==="ClassDeclaration"&&((a=n.decorators)==null?void 0:a.length)>0&&n.start===r.start&&this.resetStartLocation(r,i)}break}return r}stopParseSubscript(e,s){let i=super.stopParseSubscript(e,s);return s.optionalChainMember?this.estreeParseChainExpression(i,e.loc.end):i}parseMember(e,s,i,r,a){let n=super.parseMember(e,s,i,r,a);return n.type==="OptionalMemberExpression"?this.castNodeTo(n,"MemberExpression"):n.optional=!1,n}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}castNodeTo(e,s){let i=super.castNodeTo(e,s);return this.fillOptionalPropertiesForTSESLint(i),i}cloneIdentifier(e){let s=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(s),s}cloneStringLiteral(e){return e.type==="Literal"?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,s,i){return pe(super.finishNodeAt(e,s,i))}finishNode(e,s){let i=super.finishNode(e,s);return this.fillOptionalPropertiesForTSESLint(i),i}resetStartLocation(e,s){super.resetStartLocation(e,s),pe(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),pe(e)}},ce=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},F={brace:new ce("{"),j_oTag:new ce("<tag"),j_cTag:new ce("</tag"),j_expr:new ce("<tag>...</tag>",!0)};F.template=new ce("`",!0);var I=!0,P=!0,Me=!0,ue=!0,G=!0,gs=!0,lt=class{constructor(t,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},Be=new Map;function v(t,e={}){e.keyword=t;let s=b(t,e);return Be.set(t,s),s}function j(t,e){return b(t,{beforeExpr:I,binop:e})}var de=-1,q=[],Oe=[],Re=[],Ue=[],je=[],_e=[];function b(t,e={}){var s,i,r,a;return++de,Oe.push(t),Re.push((s=e.binop)!=null?s:-1),Ue.push((i=e.beforeExpr)!=null?i:!1),je.push((r=e.startsExpr)!=null?r:!1),_e.push((a=e.prefix)!=null?a:!1),q.push(new lt(t,e)),de}function N(t,e={}){var s,i,r,a;return++de,Be.set(t,de),Oe.push(t),Re.push((s=e.binop)!=null?s:-1),Ue.push((i=e.beforeExpr)!=null?i:!1),je.push((r=e.startsExpr)!=null?r:!1),_e.push((a=e.prefix)!=null?a:!1),q.push(new lt("name",e)),de}var Ts={bracketL:b("[",{beforeExpr:I,startsExpr:P}),bracketHashL:b("#[",{beforeExpr:I,startsExpr:P}),bracketBarL:b("[|",{beforeExpr:I,startsExpr:P}),bracketR:b("]"),bracketBarR:b("|]"),braceL:b("{",{beforeExpr:I,startsExpr:P}),braceBarL:b("{|",{beforeExpr:I,startsExpr:P}),braceHashL:b("#{",{beforeExpr:I,startsExpr:P}),braceR:b("}"),braceBarR:b("|}"),parenL:b("(",{beforeExpr:I,startsExpr:P}),parenR:b(")"),comma:b(",",{beforeExpr:I}),semi:b(";",{beforeExpr:I}),colon:b(":",{beforeExpr:I}),doubleColon:b("::",{beforeExpr:I}),dot:b("."),question:b("?",{beforeExpr:I}),questionDot:b("?."),arrow:b("=>",{beforeExpr:I}),template:b("template"),ellipsis:b("...",{beforeExpr:I}),backQuote:b("`",{startsExpr:P}),dollarBraceL:b("${",{beforeExpr:I,startsExpr:P}),templateTail:b("...`",{startsExpr:P}),templateNonTail:b("...${",{beforeExpr:I,startsExpr:P}),at:b("@"),hash:b("#",{startsExpr:P}),interpreterDirective:b("#!..."),eq:b("=",{beforeExpr:I,isAssign:ue}),assign:b("_=",{beforeExpr:I,isAssign:ue}),slashAssign:b("_=",{beforeExpr:I,isAssign:ue}),xorAssign:b("_=",{beforeExpr:I,isAssign:ue}),moduloAssign:b("_=",{beforeExpr:I,isAssign:ue}),incDec:b("++/--",{prefix:G,postfix:gs,startsExpr:P}),bang:b("!",{beforeExpr:I,prefix:G,startsExpr:P}),tilde:b("~",{beforeExpr:I,prefix:G,startsExpr:P}),doubleCaret:b("^^",{startsExpr:P}),doubleAt:b("@@",{startsExpr:P}),pipeline:j("|>",0),nullishCoalescing:j("??",1),logicalOR:j("||",1),logicalAND:j("&&",2),bitwiseOR:j("|",3),bitwiseXOR:j("^",4),bitwiseAND:j("&",5),equality:j("==/!=/===/!==",6),lt:j("</>/<=/>=",7),gt:j("</>/<=/>=",7),relational:j("</>/<=/>=",7),bitShift:j("<</>>/>>>",8),bitShiftL:j("<</>>/>>>",8),bitShiftR:j("<</>>/>>>",8),plusMin:b("+/-",{beforeExpr:I,binop:9,prefix:G,startsExpr:P}),modulo:b("%",{binop:10,startsExpr:P}),star:b("*",{binop:10}),slash:j("/",10),exponent:b("**",{beforeExpr:I,binop:11,rightAssociative:!0}),_in:v("in",{beforeExpr:I,binop:7}),_instanceof:v("instanceof",{beforeExpr:I,binop:7}),_break:v("break"),_case:v("case",{beforeExpr:I}),_catch:v("catch"),_continue:v("continue"),_debugger:v("debugger"),_default:v("default",{beforeExpr:I}),_else:v("else",{beforeExpr:I}),_finally:v("finally"),_function:v("function",{startsExpr:P}),_if:v("if"),_return:v("return",{beforeExpr:I}),_switch:v("switch"),_throw:v("throw",{beforeExpr:I,prefix:G,startsExpr:P}),_try:v("try"),_var:v("var"),_const:v("const"),_with:v("with"),_new:v("new",{beforeExpr:I,startsExpr:P}),_this:v("this",{startsExpr:P}),_super:v("super",{startsExpr:P}),_class:v("class",{startsExpr:P}),_extends:v("extends",{beforeExpr:I}),_export:v("export"),_import:v("import",{startsExpr:P}),_null:v("null",{startsExpr:P}),_true:v("true",{startsExpr:P}),_false:v("false",{startsExpr:P}),_typeof:v("typeof",{beforeExpr:I,prefix:G,startsExpr:P}),_void:v("void",{beforeExpr:I,prefix:G,startsExpr:P}),_delete:v("delete",{beforeExpr:I,prefix:G,startsExpr:P}),_do:v("do",{isLoop:Me,beforeExpr:I}),_for:v("for",{isLoop:Me}),_while:v("while",{isLoop:Me}),_as:N("as",{startsExpr:P}),_assert:N("assert",{startsExpr:P}),_async:N("async",{startsExpr:P}),_await:N("await",{startsExpr:P}),_defer:N("defer",{startsExpr:P}),_from:N("from",{startsExpr:P}),_get:N("get",{startsExpr:P}),_let:N("let",{startsExpr:P}),_meta:N("meta",{startsExpr:P}),_of:N("of",{startsExpr:P}),_sent:N("sent",{startsExpr:P}),_set:N("set",{startsExpr:P}),_source:N("source",{startsExpr:P}),_static:N("static",{startsExpr:P}),_using:N("using",{startsExpr:P}),_yield:N("yield",{startsExpr:P}),_asserts:N("asserts",{startsExpr:P}),_checks:N("checks",{startsExpr:P}),_exports:N("exports",{startsExpr:P}),_global:N("global",{startsExpr:P}),_implements:N("implements",{startsExpr:P}),_intrinsic:N("intrinsic",{startsExpr:P}),_infer:N("infer",{startsExpr:P}),_is:N("is",{startsExpr:P}),_mixins:N("mixins",{startsExpr:P}),_proto:N("proto",{startsExpr:P}),_require:N("require",{startsExpr:P}),_satisfies:N("satisfies",{startsExpr:P}),_keyof:N("keyof",{startsExpr:P}),_readonly:N("readonly",{startsExpr:P}),_unique:N("unique",{startsExpr:P}),_abstract:N("abstract",{startsExpr:P}),_declare:N("declare",{startsExpr:P}),_enum:N("enum",{startsExpr:P}),_module:N("module",{startsExpr:P}),_namespace:N("namespace",{startsExpr:P}),_interface:N("interface",{startsExpr:P}),_type:N("type",{startsExpr:P}),_opaque:N("opaque",{startsExpr:P}),name:b("name",{startsExpr:P}),placeholder:b("%%",{startsExpr:P}),string:b("string",{startsExpr:P}),num:b("num",{startsExpr:P}),bigint:b("bigint",{startsExpr:P}),decimal:b("decimal",{startsExpr:P}),regexp:b("regexp",{startsExpr:P}),privateName:b("#name",{startsExpr:P}),eof:b("eof"),jsxName:b("jsxName"),jsxText:b("jsxText",{beforeExpr:I}),jsxTagStart:b("jsxTagStart",{startsExpr:P}),jsxTagEnd:b("jsxTagEnd")};function L(t){return t>=93&&t<=133}function bs(t){return t<=92}function V(t){return t>=58&&t<=133}function pt(t){return t>=58&&t<=137}function Es(t){return Ue[t]}function me(t){return je[t]}function Cs(t){return t>=29&&t<=33}function ct(t){return t>=129&&t<=131}function Ss(t){return t>=90&&t<=92}function He(t){return t>=58&&t<=92}function ws(t){return t>=39&&t<=59}function Is(t){return t===34}function Ns(t){return _e[t]}function vs(t){return t>=121&&t<=123}function ks(t){return t>=124&&t<=130}function Y(t){return Oe[t]}function Ee(t){return Re[t]}function Ds(t){return t===57}function Ce(t){return t>=24&&t<=25}function K(t){return q[t]}q[8].updateContext=(t)=>{t.pop()},q[5].updateContext=q[7].updateContext=q[23].updateContext=(t)=>{t.push(F.brace)},q[22].updateContext=(t)=>{t[t.length-1]===F.template?t.pop():t.push(F.template)},q[143].updateContext=(t)=>{t.push(F.j_expr,F.j_oTag)};var ze="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",ut="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",Fs=new RegExp("["+ze+"]"),Ls=new RegExp("["+ze+ut+"]");ze=ut=null;var dt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Ms=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function Ve(t,e){let s=65536;for(let i=0,r=e.length;i<r;i+=2){if(s+=e[i],s>t)return!1;if(s+=e[i+1],s>=t)return!0}return!1}function J(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&Fs.test(String.fromCharCode(t)):Ve(t,dt)}function ae(t){return t<48?t===36:t<58?!0:t<65?!1:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&Ls.test(String.fromCharCode(t)):Ve(t,dt)||Ve(t,Ms)}var $e={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},Bs=new Set($e.keyword),Os=new Set($e.strict),Rs=new Set($e.strictBind);function mt(t,e){return e&&t==="await"||t==="enum"}function ft(t,e){return mt(t,e)||Os.has(t)}function yt(t){return Rs.has(t)}function xt(t,e){return ft(t,e)||yt(t)}function Us(t){return Bs.has(t)}function js(t,e,s){return t===64&&e===64&&J(s)}var _s=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Hs(t){return _s.has(t)}var qe=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},Ke=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new qe(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let i=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(i,t,e,s);let r=i.names.get(t)||0;e&16?r=r|4:(i.firstLexicalName||(i.firstLexicalName=t),r=r|2),i.names.set(t,r),e&8&&this.maybeExportDefined(i,t)}else if(e&4)for(let r=this.scopeStack.length-1;r>=0&&(i=this.scopeStack[r],this.checkRedeclarationInScope(i,t,e,s),i.names.set(t,(i.names.get(t)||0)|1),this.maybeExportDefined(i,t),!(i.flags&1667));--r);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,i){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(c.VarRedeclaration,i,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);let i=t.names.get(e);return s&16?(i&2)>0||!this.treatFunctionsAsVarInScope(t)&&(i&1)>0:(i&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(i&4)>0}checkLocalExport(t){let{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&1667)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&1731&&!(e&4))return e}}},zs=class extends qe{constructor(...t){super(...t),this.declareFunctions=new Set}},Vs=class extends Ke{createScope(t){return new zs(t)}declareName(t,e,s){let i=this.currentScope();if(e&2048){this.checkRedeclarationInScope(i,t,e,s),this.maybeExportDefined(i,t),i.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){let i=t.names.get(e);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},$s=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),E=$`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:t})=>`Cannot overwrite reserved type ${t}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:t,enumName:e})=>`Boolean enum members need to be initialized. Use either \`${t} = true,\` or \`${t} = false,\` in enum \`${e}\`.`,EnumDuplicateMemberName:({memberName:t,enumName:e})=>`Enum member names need to be unique, but the name \`${t}\` has already been used before in enum \`${e}\`.`,EnumInconsistentMemberValues:({enumName:t})=>`Enum \`${t}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:t,enumName:e})=>`Enum type \`${t}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:t})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:t,memberName:e,explicitType:s})=>`Enum \`${t}\` has type \`${s}\`, so the initializer of \`${e}\` needs to be a ${s} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:t,memberName:e})=>`Symbol enum members cannot be initialized. Use \`${e},\` in enum \`${t}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:t,memberName:e})=>`The enum member initializer for \`${e}\` needs to be a literal (either a boolean, number, or string) in enum \`${t}\`.`,EnumInvalidMemberName:({enumName:t,memberName:e,suggestion:s})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${e}\`, consider using \`${s}\`, in enum \`${t}\`.`,EnumNumberMemberNotInitialized:({enumName:t,memberName:e})=>`Number enum members need to be initialized, e.g. \`${e} = 1\` in enum \`${t}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:t})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${t}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:t})=>`Unexpected reserved type ${t}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:t,suggestion:e})=>`\`declare export ${t}\` is not supported. Use \`${e}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function qs(t){return t.type==="DeclareExportAllDeclaration"||t.type==="DeclareExportDeclaration"&&(!t.declaration||t.declaration.type!=="TypeAlias"&&t.declaration.type!=="InterfaceDeclaration")}function Pt(t){return t.importKind==="type"||t.importKind==="typeof"}var Ks={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Js(t,e){let s=[],i=[];for(let r=0;r<t.length;r++)(e(t[r],r,t)?s:i).push(t[r]);return[s,i]}var Ws=/\*?\s*@((?:no)?flow)\b/,Xs=(t)=>class extends t{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return Vs}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=Ws.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(e||14);let i=this.flowParseType();return this.state.inType=s,i}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>s.index+1&&this.raise(E.UnexpectedSpaceBetweenModuloChecks,s),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let s=null,i=null;return this.match(54)?(this.state.inType=e,i=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(i=this.flowParsePredicate())),[s,i]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),i=this.startNode(),r=this.startNode();this.match(47)?i.typeParameters=this.flowParseTypeParameterDeclaration():i.typeParameters=null,this.expect(10);let a=this.flowParseFunctionTypeParams();return i.params=a.params,i.rest=a.rest,i.this=a._this,this.expect(11),[i.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),r.typeAnnotation=this.finishNode(i,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(r,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(E.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,s);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let s=e.body=this.startNode(),i=s.body=[];for(this.expect(5);!this.match(8);){let n=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(E.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(n)):(this.expectContextual(125,E.UnsupportedStatementInDeclareModule),n=this.flowParseDeclare(n,!0)),i.push(n)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let r=null,a=!1;return i.forEach((n)=>{qs(n)?(r==="CommonJS"&&this.raise(E.AmbiguousDeclareModuleKind,n),r="ES"):n.type==="DeclareModuleExports"&&(a&&this.raise(E.DuplicateDeclareModuleExports,n),r==="ES"&&this.raise(E.AmbiguousDeclareModuleKind,n),r="CommonJS",a=!0)}),e.kind=r||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!s){let i=this.state.value;throw this.raise(E.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:i,suggestion:Ks[i]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"?(e.default=!1,delete e.exportKind,this.castNodeTo(e,"DeclareExportDeclaration")):this.castNodeTo(e,"DeclareExportAllDeclaration");this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let s=this.flowParseTypeAlias(e);return this.castNodeTo(s,"DeclareTypeAlias"),s}flowParseDeclareOpaqueType(e){this.next();let s=this.flowParseOpaqueType(e,!0);return this.castNodeTo(s,"DeclareOpaqueType"),s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(12));if(s){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(E.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,i){$s.has(e)&&this.raise(i?E.AssignReservedType:E.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifier(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let s=this.state.startLoc,i=this.startNode(),r=this.flowParseVariance(),a=this.flowParseTypeAnnotatableIdentifier();return i.name=a.name,i.variance=r,i.bound=a.typeAnnotation,this.match(29)?(this.eat(29),i.default=this.flowParseType()):e&&this.raise(E.MissingTypeParamDefault,s),this.finishNode(i,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let i=!1;do{let r=this.flowParseTypeParameter(i);s.params.push(r),r.default&&(i=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==F.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),s=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let i=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=i}),this.state.inType=s,!this.state.inType&&this.curContext()===F.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return;let e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,i){return e.static=s,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=i,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){let i=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(i),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:i,allowProto:r,allowInexact:a}){let n=this.state.inType;this.state.inType=!0;let o=this.startNode();o.callProperties=[],o.properties=[],o.indexers=[],o.internalSlots=[];let p,h,d=!1;for(s&&this.match(6)?(this.expect(6),p=9,h=!0):(this.expect(5),p=8,h=!1),o.exact=h;!this.match(p);){let A=!1,T=null,w=null,O=this.startNode();if(r&&this.isContextual(118)){let R=this.lookahead();R.type!==14&&R.type!==17&&(this.next(),T=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let R=this.lookahead();R.type!==14&&R.type!==17&&(this.next(),A=!0)}let k=this.flowParseVariance();if(this.eat(0))T!=null&&this.unexpected(T),this.eat(0)?(k&&this.unexpected(k.loc.start),o.internalSlots.push(this.flowParseObjectTypeInternalSlot(O,A))):o.indexers.push(this.flowParseObjectTypeIndexer(O,A,k));else if(this.match(10)||this.match(47))T!=null&&this.unexpected(T),k&&this.unexpected(k.loc.start),o.callProperties.push(this.flowParseObjectTypeCallProperty(O,A));else{let R="init";if(this.isContextual(99)||this.isContextual(104)){let Pe=this.lookahead();pt(Pe.type)&&(R=this.state.value,this.next())}let _=this.flowParseObjectTypeProperty(O,A,T,k,R,i,a??!h);_===null?(d=!0,w=this.state.lastTokStartLoc):o.properties.push(_)}this.flowObjectTypeSemicolon(),w&&!this.match(8)&&!this.match(9)&&this.raise(E.UnexpectedExplicitInexactInObject,w)}this.expect(p),i&&(o.inexact=d);let y=this.finishNode(o,"ObjectTypeAnnotation");return this.state.inType=n,y}flowParseObjectTypeProperty(e,s,i,r,a,n,o){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(n?o||this.raise(E.InexactInsideExact,this.state.lastTokStartLoc):this.raise(E.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(E.InexactVariance,r),null):(n||this.raise(E.UnexpectedSpreadType,this.state.lastTokStartLoc),i!=null&&this.unexpected(i),r&&this.raise(E.SpreadVariance,r),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=i!=null,e.kind=a;let p=!1;return this.match(47)||this.match(10)?(e.method=!0,i!=null&&this.unexpected(i),r&&this.unexpected(r.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(a==="get"||a==="set")&&this.flowCheckGetterSetterParams(e),!n&&e.key.name==="constructor"&&e.value.this&&this.raise(E.ThisParamBannedInConstructor,e.value.this)):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(p=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=p,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,i=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?E.GetterMayNotHaveThisParam:E.SetterMayNotHaveThisParam,e.value.this),i!==s&&this.raise(e.kind==="get"?c.BadGetterArity:c.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(c.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){e??(e=this.state.startLoc);let i=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let r=this.startNodeAt(e);r.qualification=i,r.id=this.flowParseRestrictedIdentifier(!0),i=this.finishNode(r,"QualifiedTypeIdentifier")}return i}flowParseGenericType(e,s){let i=this.startNodeAt(e);return i.typeParameters=null,i.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(i.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(i,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let s=null,i=!1,r=null,a=this.startNode(),n=this.lookahead(),o=this.state.type===78;return n.type===14||n.type===17?(o&&!e&&this.raise(E.ThisParamMustBeFirst,a),s=this.parseIdentifier(o),this.eat(17)&&(i=!0,o&&this.raise(E.ThisParamMayNotBeOptional,a)),r=this.flowParseTypeInitialiser()):r=this.flowParseType(),a.name=s,a.optional=i,a.typeAnnotation=r,this.finishNode(a,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let s=this.startNodeAt(e.loc.start);return s.name=null,s.optional=!1,s.typeAnnotation=e,this.finishNode(s,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let s=null,i=null;for(this.match(78)&&(i=this.flowParseFunctionTypeParam(!0),i.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(s=this.flowParseFunctionTypeParam(!1)),{params:e,rest:s,_this:i}}flowIdentToTypeAnnotation(e,s,i){switch(i.name){case"any":return this.finishNode(s,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(s,"BooleanTypeAnnotation");case"mixed":return this.finishNode(s,"MixedTypeAnnotation");case"empty":return this.finishNode(s,"EmptyTypeAnnotation");case"number":return this.finishNode(s,"NumberTypeAnnotation");case"string":return this.finishNode(s,"StringTypeAnnotation");case"symbol":return this.finishNode(s,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(i.name),this.flowParseGenericType(e,i)}}flowParsePrimaryType(){let e=this.state.startLoc,s=this.startNode(),i,r,a=!1,n=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,r=this.flowParseTupleType(),this.state.noAnonFunctionType=n,r;case 47:{let o=this.startNode();return o.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),i=this.flowParseFunctionTypeParams(),o.params=i.params,o.rest=i.rest,o.this=i._this,this.expect(11),this.expect(19),o.returnType=this.flowParseType(),this.finishNode(o,"FunctionTypeAnnotation")}case 10:{let o=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(L(this.state.type)||this.match(78)){let p=this.lookahead().type;a=p!==17&&p!==14}else a=!0;if(a){if(this.state.noAnonFunctionType=!1,r=this.flowParseType(),this.state.noAnonFunctionType=n,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),r;this.eat(12)}return r?i=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(r)]):i=this.flowParseFunctionTypeParams(),o.params=i.params,o.rest=i.rest,o.this=i._this,this.expect(11),this.expect(19),o.returnType=this.flowParseType(),o.typeParameters=null,this.finishNode(o,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return s.value=this.match(85),this.next(),this.finishNode(s,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",s);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",s);throw this.raise(E.UnexpectedSubtractionOperand,this.state.startLoc)}this.unexpected();return;case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(s,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(s,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(s,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(s,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(He(this.state.type)){let o=Y(this.state.type);return this.next(),super.createIdentifier(s,o)}else if(L(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,s,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,s=this.flowParsePrimaryType(),i=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let r=this.startNodeAt(e),a=this.eat(18);i=i||a,this.expect(0),!a&&this.match(3)?(r.elementType=s,this.next(),s=this.finishNode(r,"ArrayTypeAnnotation")):(r.objectType=s,r.indexType=this.flowParseType(),this.expect(3),i?(r.optional=a,s=this.finishNode(r,"OptionalIndexedAccessType")):s=this.finishNode(r,"IndexedAccessType"))}return s}flowParsePrefixType(){let e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let s=this.startNodeAt(e.loc.start);return s.params=[this.reinterpretTypeAsFunctionTypeParam(e)],s.rest=null,s.this=null,s.returnType=this.flowParseType(),s.typeParameters=null,this.finishNode(s,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let s=this.flowParseAnonFunctionWithoutParens();for(e.types=[s];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?s:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let s=this.flowParseIntersectionType();for(e.types=[s];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?s:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let s=this.flowParseUnionType();return this.state.inType=e,s}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let e=this.state.startLoc,s=this.parseIdentifier();return this.flowParseGenericType(e,s)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){let s=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(s.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(s)),s}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,s,i=!1){if(s){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,i));return}super.parseFunctionBody(e,!1,i)}parseFunctionBodyAndFinish(e,s,i=!1){if(this.match(14)){let r=this.startNode();[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=r.typeAnnotation?this.finishNode(r,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,i)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let i=this.lookahead();if(V(i.type)){let r=this.startNode();return this.next(),this.flowParseInterface(r)}}else if(this.isContextual(126)){let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,i){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||L(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(L(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,i)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===126||ct(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===126||ct(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,i){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let y=this.lookaheadCharCode();if(y===44||y===61||y===58||y===41)return this.setOptionalParametersError(i),e}this.expect(17);let r=this.state.clone(),a=this.state.noArrowAt,n=this.startNodeAt(s),{consequent:o,failed:p}=this.tryParseConditionalConsequent(),[h,d]=this.getArrowLikeExpressions(o);if(p||d.length>0){let y=[...a];if(d.length>0){this.state=r,this.state.noArrowAt=y;for(let A=0;A<d.length;A++)y.push(d[A].start);({consequent:o,failed:p}=this.tryParseConditionalConsequent()),[h,d]=this.getArrowLikeExpressions(o)}p&&h.length>1&&this.raise(E.AmbiguousConditionalArrow,r.startLoc),p&&h.length===1&&(this.state=r,y.push(h[0].start),this.state.noArrowAt=y,{consequent:o,failed:p}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(o,!0),this.state.noArrowAt=a,this.expect(14),n.test=e,n.consequent=o,n.alternate=this.forwardNoArrowParamsConversionAt(n,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(n,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){let i=[e],r=[];for(;i.length!==0;){let a=i.pop();a.type==="ArrowFunctionExpression"&&a.body.type!=="BlockStatement"?(a.typeParameters||!a.returnType?this.finishArrowValidation(a):r.push(a),i.push(a.body)):a.type==="ConditionalExpression"&&(i.push(a.consequent),i.push(a.alternate))}return s?(r.forEach((a)=>this.finishArrowValidation(a)),[r,[]]):Js(r,(a)=>a.params.every((n)=>this.isAssignable(n,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let i;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),i=s(),this.state.noArrowParamsConversionAt.pop()):i=s(),i}parseParenItem(e,s){let i=super.parseParenItem(e,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(s);return r.expression=i,r.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(r,"TypeCastExpression")}return i}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(131)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(129)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.isContextual(126)){e.exportKind="value";let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:s}=this.state,i=super.maybeParseExportNamespaceSpecifier(e);return i&&e.exportKind==="type"&&this.unexpected(s),i}parseClassId(e,s,i){super.parseClassId(e,s,i),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,i){let{startLoc:r}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,i),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(E.DeclareClassElement,r):s.value&&this.raise(E.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(c.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(132,s)}getTokenFromCode(e){let s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):js(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,i){for(let r=0;r<e.length;r++){let a=e[r];(a==null?void 0:a.type)==="TypeCastExpression"&&(e[r]=this.typeCastToParameter(a))}super.toAssignableList(e,s,i)}toReferencedList(e,s){for(let r=0;r<e.length;r++){var i;let a=e[r];a&&a.type==="TypeCastExpression"&&!((i=a.extra)!=null&&i.parenthesized)&&(e.length>1||!s)&&this.raise(E.TypeCastInPattern,a.typeAnnotation)}return e}parseArrayLike(e,s,i,r){let a=super.parseArrayLike(e,s,i,r);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(e,s,i){return e==="TypeCastExpression"||super.isValidLVal(e,s,i)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,i,r,a,n){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,i,r,a,n),s.params&&a){let o=s.params;o.length>0&&this.isThisParam(o[0])&&this.raise(E.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&a&&s.value.params){let o=s.value.params;o.length>0&&this.isThisParam(o[0])&&this.raise(E.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,i,r){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,i,r)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let s=e.implements=[];do{let i=this.startNode();i.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?i.typeParameters=this.flowParseTypeParameterInstantiation():i.typeParameters=null,s.push(this.finishNode(i,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let i=s[0];this.isThisParam(i)&&e.kind==="get"?this.raise(E.GetterMayNotHaveThisParam,i):this.isThisParam(i)&&this.raise(E.SetterMayNotHaveThisParam,i)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,i,r,a,n,o){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let p;this.match(47)&&!n&&(p=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let h=super.parseObjPropValue(e,s,i,r,a,n,o);return p&&((h.value||h).typeParameters=p),h}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(E.PatternIsOptional,e),this.isThisParam(e)&&this.raise(E.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(E.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(E.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.start<i.typeAnnotation.start&&this.raise(E.TypeBeforeInitializer,i.typeAnnotation),i}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(E.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,s,i){s.local=Pt(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(s,i))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;let s=this.lookaheadCharCode();return s===123||s===42}return!e&&this.isContextual(87)}applyImportPhase(e,s,i,r){if(super.applyImportPhase(e,s,i,r),s){if(!i&&this.match(65))return;e.exportKind=i==="type"?i:"value"}else i==="type"&&this.match(55)&&this.unexpected(),e.importKind=i==="type"||i==="typeof"?i:"value"}parseImportSpecifier(e,s,i,r,a){let n=e.imported,o=null;n.type==="Identifier"&&(n.name==="type"?o="type":n.name==="typeof"&&(o="typeof"));let p=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let d=this.parseIdentifier(!0);o!==null&&!V(this.state.type)?(e.imported=d,e.importKind=o,e.local=this.cloneIdentifier(d)):(e.imported=n,e.importKind=null,e.local=this.parseIdentifier())}else{if(o!==null&&V(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=o;else{if(s)throw this.raise(c.ImportBindingIsString,e,{importName:n.value});e.imported=n,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(p=!0,e.local=this.cloneIdentifier(e.imported))}let h=Pt(e);return i&&h&&this.raise(E.ImportTypeShorthandOnlyInPureImport,e),(i||h)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),p&&!i&&!h&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,s){let i=e.kind;i!=="get"&&i!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){if(this.match(14)){let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=i}return super.parseAsyncArrowFromCallExpression(e,s)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,s){var i;let r=null,a;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(r=this.state.clone(),a=this.tryParse(()=>super.parseMaybeAssign(e,s),r),!a.error)return a.node;let{context:p}=this.state,h=p[p.length-1];(h===F.j_oTag||h===F.j_expr)&&p.pop()}if((i=a)!=null&&i.error||this.match(47)){var n,o;r=r||this.state.clone();let p,h=this.tryParse((y)=>{var A;p=this.flowParseTypeParameterDeclaration();let T=this.forwardNoArrowParamsConversionAt(p,()=>{let O=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(O,p),O});(A=T.extra)!=null&&A.parenthesized&&y();let w=this.maybeUnwrapTypeCastExpression(T);return w.type!=="ArrowFunctionExpression"&&y(),w.typeParameters=p,this.resetStartLocationFromNode(w,p),T},r),d=null;if(h.node&&this.maybeUnwrapTypeCastExpression(h.node).type==="ArrowFunctionExpression"){if(!h.error&&!h.aborted)return h.node.async&&this.raise(E.UnexpectedTypeParameterBeforeAsyncArrowFunction,p),h.node;d=h.node}if((n=a)!=null&&n.node)return this.state=a.failState,a.node;if(d)return this.state=h.failState,d;throw(o=a)!=null&&o.thrown?a.error:h.thrown?h.error:this.raise(E.UnexpectedTokenAfterTypeParameter,p)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(()=>{let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let r=this.startNode();return[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=i,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),r});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,i,r=!0){if(!(i&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let a=0;a<e.params.length;a++)this.isThisParam(e.params[a])&&a>0&&this.raise(E.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,s,i,r)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,s,i){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();let r=this.startNodeAt(s);r.callee=e,r.arguments=super.parseCallExpressionArguments(11),e=this.finishNode(r,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let r=this.state.clone(),a=this.tryParse((o)=>this.parseAsyncArrowWithTypeParameters(s)||o(),r);if(!a.error&&!a.aborted)return a.node;let n=this.tryParse(()=>super.parseSubscripts(e,s,i),r);if(n.node&&!n.error)return n.node;if(a.node)return this.state=a.failState,a.node;if(n.node)return this.state=n.failState,n.node;throw a.error||n.error}return super.parseSubscripts(e,s,i)}parseSubscript(e,s,i,r){if(this.match(18)&&this.isLookaheadToken_lt()){if(r.optionalChainMember=!0,i)return r.stop=!0,e;this.next();let a=this.startNodeAt(s);return a.callee=e,a.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),a.arguments=this.parseCallExpressionArguments(11),a.optional=!0,this.finishCallExpression(a,!0)}else if(!i&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let a=this.startNodeAt(s);a.callee=e;let n=this.tryParse(()=>(a.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),a.arguments=super.parseCallExpressionArguments(11),r.optionalChainMember&&(a.optional=!1),this.finishCallExpression(a,r.optionalChainMember)));if(n.node)return n.error&&(this.state=n.failState),n.node}return super.parseSubscript(e,s,i,r)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){let s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){let i=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(E.UnterminatedFlowComment,this.state.curPosition()),i}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(E.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let i=this.input.charCodeAt(s+e),r=this.input.charCodeAt(s+e+1);return i===58&&r===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:i===58&&r!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(c.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:i}){this.raise(E.EnumBooleanMemberNotInitialized,e,{memberName:i,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?E.EnumInvalidMemberInitializerSymbolType:E.EnumInvalidMemberInitializerPrimaryType:E.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(E.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(E.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let i=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 134:{let i=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 85:case 86:{let i=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),i=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:i}}flowEnumCheckExplicitTypeMismatch(e,s,i){let{explicitType:r}=s;r!==null&&r!==i&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let i=new Set,r={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},a=!1;for(;!this.match(8);){if(this.eat(21)){a=!0;break}let n=this.startNode(),{id:o,init:p}=this.flowEnumMemberRaw(),h=o.name;if(h==="")continue;/^[a-z]/.test(h)&&this.raise(E.EnumInvalidMemberName,o,{memberName:h,suggestion:h[0].toUpperCase()+h.slice(1),enumName:e}),i.has(h)&&this.raise(E.EnumDuplicateMemberName,o,{memberName:h,enumName:e}),i.add(h);let d={enumName:e,explicitType:s,memberName:h};switch(n.id=o,p.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(p.loc,d,"boolean"),n.init=p.value,r.booleanMembers.push(this.finishNode(n,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(p.loc,d,"number"),n.init=p.value,r.numberMembers.push(this.finishNode(n,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(p.loc,d,"string"),n.init=p.value,r.stringMembers.push(this.finishNode(n,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(p.loc,d);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(p.loc,d);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(p.loc,d);break;default:r.defaultedMembers.push(this.finishNode(n,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:r,hasUnknownMembers:a}}flowEnumStringMembers(e,s,{enumName:i}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let r of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:i});return s}else{for(let r of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:i});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!L(this.state.type))throw this.raise(E.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(E.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let i=s.name,r=s.loc.start,a=this.flowEnumParseExplicitType({enumName:i});this.expect(5);let{members:n,hasUnknownMembers:o}=this.flowEnumMembers({enumName:i,explicitType:a});switch(e.hasUnknownMembers=o,a){case"boolean":return e.explicitType=!0,e.members=n.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=n.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(n.stringMembers,n.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=n.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let p=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let h=n.booleanMembers.length,d=n.numberMembers.length,y=n.stringMembers.length,A=n.defaultedMembers.length;if(!h&&!d&&!y&&!A)return p();if(!h&&!d)return e.members=this.flowEnumStringMembers(n.stringMembers,n.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!d&&!y&&h>=A){for(let T of n.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(T.loc.start,{enumName:i,memberName:T.id.name});return e.members=n.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!h&&!y&&d>=A){for(let T of n.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(T.loc.start,{enumName:i,memberName:T.id.name});return e.members=n.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(E.EnumInconsistentMemberValues,r,{enumName:i}),p()}}}flowParseEnumDeclaration(e){let s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},Gs=/\r\n|[\r\n\u2028\u2029]/,Se=new RegExp(Gs.source,"g");function ne(t){switch(t){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function At(t,e,s){for(let i=e;i<s;i++)if(ne(t.charCodeAt(i)))return!0;return!1}var Je=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,We=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function Ys(t){switch(t){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var se=$`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:t})=>`Expected corresponding JSX closing tag for <${t}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:t,HTMLEntity:e})=>`Unexpected token \`${t}\`. Did you mean \`${e}\` or \`{'${t}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function Q(t){return t?t.type==="JSXOpeningFragment"||t.type==="JSXClosingFragment":!1}function oe(t){if(t.type==="JSXIdentifier")return t.name;if(t.type==="JSXNamespacedName")return t.namespace.name+":"+t.name.name;if(t.type==="JSXMemberExpression")return oe(t.object)+"."+oe(t.property);throw Error("Node had unexpected type: "+t.type)}var Qs=(t)=>class extends t{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(se.UnterminatedJsxContent,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);switch(i){case 60:case 123:if(this.state.pos===this.state.start){i===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(i);return}e+=this.input.slice(s,this.state.pos),this.finishToken(142,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:default:ne(i)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let s=this.input.charCodeAt(this.state.pos),i;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,i=e?`
|
|
5
5
|
`:`\r
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ps as a,Qs as b}from"./chunk-m5m448mg.js";import"./chunk-tqj69nh6.js";import"./chunk-ag8kz1e7.js";import"./chunk-5tray1fw.js";import"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-gagtmjmp.js";import"./chunk-zs8kqdsf.js";import"./chunk-7xm75w1e.js";export{a as Path,b as Global};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{a as ZB,b as $B}from"./chunk-vbeb74ny.js";import"./chunk-5eq1fft9.js";import"./chunk-rvkrgkeq.js";import{B as XB}from"./chunk-gsez13bg.js";import{C as BB,E as JB}from"./chunk-c8k32724.js";import"./chunk-g9cjsfvg.js";import{I as VB}from"./chunk-t9mz17gb.js";import{O as YB}from"./chunk-6p7yg5sr.js";import"./chunk-p62gb4wj.js";import"./chunk-x4sp99g6.js";import{Rd as e}from"./chunk-yajd975f.js";import{Of as n,Pf as D,Qf as w,Rf as i}from"./chunk-c1vnp55z.js";import{Vf as H}from"./chunk-rbk8seme.js";import{Cg as s}from"./chunk-takew94z.js";import{gh as U}from"./chunk-fq0x3esz.js";import"./chunk-44a82dg0.js";import"./chunk-vxyy2dp3.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-5hw6xa49.js";import"./chunk-326p5b10.js";import{Xj as R,ok as o,rl as r}from"./chunk-04n2ycg5.js";import"./chunk-8ymffyep.js";import{km as O}from"./chunk-mcg24gkb.js";import"./chunk-redjxn13.js";import"./chunk-bn0h9dny.js";import"./chunk-r4ndwym0.js";import"./chunk-3ytjm3az.js";import"./chunk-htz93dsd.js";import"./chunk-vcw00k0n.js";import{no as a,qo as t}from"./chunk-r78czx4d.js";import"./chunk-2hc5z7b5.js";import"./chunk-d68fzyw7.js";import"./chunk-4jtxtkj7.js";import"./chunk-ay8emwym.js";import"./chunk-2maqde7w.js";import"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import"./chunk-g5rabwre.js";import"./chunk-jbx3s7nw.js";import"./chunk-15hw2z9t.js";import"./chunk-48ge2ryx.js";import"./chunk-n9xns8by.js";import"./chunk-y9q0hb7b.js";import"./chunk-c1bdzxbx.js";import"./chunk-ehhas0ew.js";import"./chunk-d6ry9418.js";import"./chunk-0dt0bxz6.js";import"./chunk-10bjs581.js";import"./chunk-4cnwn1rh.js";import{Tr as v}from"./chunk-gcw4rn10.js";import{Js as g,Us as x,vs as f,ws as c,xs as u,zs as l}from"./chunk-m5m448mg.js";import{bt as N,pt as p,rt as _}from"./chunk-tqj69nh6.js";import"./chunk-ag8kz1e7.js";import"./chunk-5tray1fw.js";import"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-gagtmjmp.js";import{pH as S}from"./chunk-zs8kqdsf.js";import"./chunk-dxpj0cxh.js";import"./chunk-zw815d68.js";import{FO as I}from"./chunk-7xm75w1e.js";import E from"path";import{fileURLToPath as HB}from"url";import{writeHeapSnapshot as KB}from"v8";import MB,{EOL as M}from"os";var zB={free:"free",default:"default",fast:"fast",economy:"economical",power:"power",orchestrated:"orchestrated"},T="build";function h(B){if(B.agent)return B.agent;if(B.headless||B.fullauto)return T;return}function jB(B){for(let[V,X]of Object.entries(zB))if(B[V]){let Z=v[X];if(Z)return`${Z.providerID}/${Z.modelID}`}return}function GB(B){return async(X,Z)=>{let Y=new Request(X,Z),W=Y.body?await Y.text():void 0,$=await B.call("fetch",{url:Y.url,method:Y.method,headers:Object.fromEntries(Y.headers.entries()),body:W});return new Response($.body,{status:$.status,headers:$.headers})}}function QB(B){return{subscribe:async(V)=>{return B.on("global.event",(X)=>{V(X)})}}}async function bB(){if(typeof globalThis.QITQODE_WORKER_PATH<"u")return globalThis.QITQODE_WORKER_PATH;let B=new URL("./cli/cmd/tui/worker.js",import.meta.url);if(await p(HB(B)))return B;return new URL("./worker.ts",import.meta.url)}async function PB(B){let V=process.stdin.isTTY?void 0:await Bun.stdin.text();if(!B)return V;if(!V)return B;return V+`
|
|
3
|
+
`+B}async function d(B){let V=a({baseUrl:B.url,fetch:B.fetch,directory:B.directory}),X=[{permission:"question",action:"deny",pattern:"*"},{permission:"plan_enter",action:"deny",pattern:"*"},{permission:"plan_exit",action:"deny",pattern:"*"}],Y=(await V.session.create({permission:X})).data?.id;if(!Y){H.error("headless: failed to create session");return}let W=await V.event.subscribe(),$=YB({sessionID:Y,query:async()=>{return(await V.session.status()).data?.[Y]}}),A=W.stream[Symbol.asyncIterator](),P=$.completion.then(()=>"DONE");(async()=>{try{while(!0){let z=await Promise.race([A.next(),P]);if(z==="DONE")break;let y=z;if(y.done)break;let j=y.value;$.onEvent(j);let K=j.properties;if(j.type==="message.part.updated"){let J=K?.part;if(!J||J.sessionID!==Y)continue;if(J.type==="text"&&J.time?.end){let C=String(J.text??"").trim();if(C)process.stdout.write(C+M)}}if(j.type==="permission.asked"){if(!K||K.sessionID!==Y)continue;await V.permission.reply({requestID:String(K.id),reply:"once"})}if(j.type==="session.error"){if(!K||K.sessionID!==Y||!K.error)continue;let J=K.error,C=J?.data!==null&&typeof J?.data==="object"&&"message"in J.data?String(J.data.message):String(J?.name??J);H.error(C)}}}finally{$.stop(),await A.return?.(void 0).catch(()=>{})}})().catch((z)=>{console.error(z),process.exit(1)});let q=B.model?r.parseModel(B.model):void 0;await V.session.prompt({sessionID:Y,agent:B.agent,model:q,parts:[{type:"text",text:B.prompt}]}),$.markStarted(),await $.completion}var nB=e({command:"$0 [project]",describe:"start qitqode tui",builder:(B)=>n(B).positional("project",{type:"string",describe:"path to start qitqode in"}).options(i).option("never-ask",{type:"boolean",describe:"start in never-ask mode \u2014 auto-decide without asking (permissions excluded), toggle at runtime with /never-ask",default:!1}).check((V)=>{if(V.dark&&V.light)throw Error("--dark and --light are mutually exclusive");if(V.sso&&!V.headless)throw Error("--sso requires --headless");if(V.sso&&V["api-key"]!==void 0)throw Error("--sso and --api-key are mutually exclusive");let X=Object.keys(zB).filter((Z)=>V[Z]);if(X.length>1)throw Error(`${X.map((Z)=>`--${Z}`).join(" and ")} are mutually exclusive \u2014 choose one tier flag`);if(X.length===1&&V.model)throw Error(`--${X[0]} and --model are mutually exclusive \u2014 use one or the other`);return!0}),handler:async(B)=>{if(B.monochrome)process.env.QITQODE_TUI_ACCESSIBLE="1",process.env.NO_COLOR="1";let V=JB();try{BB();let X=XB(B);if(X){H.error(X),process.exitCode=1;return}let Z=jB(B)??B.model,Y=_(process.env.PWD??process.cwd()),W=B.project?_(E.isAbsolute(B.project)?B.project:E.join(Y,B.project)):_(process.cwd()),$=O(W);if($){if(B.project){H.error("Cannot start in "+W+": "+$),process.exitCode=1;return}let J=_(MB.homedir());if(O(J)){H.error("Cannot start in "+W+": "+$),process.exitCode=1;return}x.warn("unsafe start directory, falling back to home",{requested:W,home:J}),W=J}let A=await bB();try{process.chdir(W)}catch{H.error("Failed to change directory to "+W);return}let P=_(process.cwd()),k=l({[c]:"worker",[f]:u()}),q=new Worker(A,{env:k});q.onerror=(J)=>{x.error("thread error",{message:J.message,filename:J.filename,lineno:J.lineno,colno:J.colno,error:J.error})};let z=g(q),y=()=>{z.call("reload",void 0).catch((J)=>{x.warn("worker reload failed",{error:N(J)})})};process.on("SIGUSR2",y);let j=!1,K=async()=>{if(j)return;j=!0,process.off("SIGUSR2",y),await o(z.call("shutdown",void 0),5000).catch((J)=>{x.warn("worker shutdown failed",{error:N(J)})}),q.terminate()};try{let J=import("./chunk-ppjnqexm.js"),C=import("./chunk-vb286b31.js").then(({TuiConfig:F})=>F.get()),L=await PB(B.prompt),WB=await C;if(B.headless&&D(w(B))){H.error("--headless cannot be combined with network-listener flags (--port, --hostname, --mdns)"),process.exitCode=1;return}let m=w(B),b=D(m)?{url:(await z.call("server",m)).url,fetch:void 0,events:void 0}:{url:"http://qitqode.internal",fetch:GB(z),events:QB(z)};if(setTimeout(()=>{z.call("checkUpgrade",{directory:P}).catch(()=>{})},1000).unref?.(),B.headless){if(!L){H.error("--headless requires a prompt: pass --prompt or pipe input via stdin"),process.exitCode=1;return}if(B.sso){try{let G=await s({tryOpen:!1,onCode:(Q)=>{if(process.stdout.write(M),process.stdout.write(" To sign in, open: "+Q.verificationUri+M),process.stdout.write(" and enter code: "+Q.userCode+M),Q.verificationUriComplete)process.stdout.write(M+" Or open this link directly:"+M+" "+Q.verificationUriComplete+M);process.stdout.write(M+" Waiting for approval... (ctrl+c to cancel)"+M)}});await U.runPromise(S.gen(function*(){yield*(yield*R.Service).set("forgewise",VB(G,{rotateRefreshToken:!0}))})),process.stdout.write(" Signed in as "+(G.name||G.email)+M)}catch(G){H.error("SSO sign-in failed: "+N(G)),process.exitCode=1;return}await d({url:b.url,fetch:b.fetch,prompt:L,model:Z,agent:h(B)??T,directory:P});return}let F=ZB(typeof B["api-key"]==="string"?String(B["api-key"]):"");if(F)await U.runPromise($B(F));else if(!await U.runPromise(S.gen(function*(){if(yield*S.promise(()=>t()))return!0;return!!(yield*(yield*R.Service).get("forgewise"))}))){H.error(`Not signed in. Use one of:
|
|
4
|
+
qode auth login (browser / device-code flow)
|
|
5
|
+
qode auth login --api-key (paste a Qortex API key)
|
|
6
|
+
--api-key <key> (inline for this run)
|
|
7
|
+
$QLEX_API_KEY (environment variable)
|
|
8
|
+
$QITQODE_KEY (environment variable)`),process.exitCode=1;return}await d({url:b.url,fetch:b.fetch,prompt:L,model:Z,agent:h(B)??T,directory:P})}else{let{tui:F}=await J;await F({url:b.url,async onSnapshot(){let G=KB("tui.heapsnapshot"),Q=await z.call("snapshot",void 0);return[G,Q]},config:WB,directory:P,fetch:b.fetch,events:b.events,args:{continue:B.continue,sessionID:B.session,agent:h(B),model:Z,prompt:L,fork:B.fork,neverAsk:B["never-ask"]||B.fullauto||!1,fullauto:B.fullauto||!1,themeMode:B.dark?"dark":B.light?"light":void 0,monochrome:B.monochrome||!1,headless:!1}})}}finally{await K()}}finally{V?.()}process.exit(0)}});export{h as resolveStartupAgent,nB as TuiThreadCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{zk as
|
|
2
|
+
import{CO as M,FO as T}from"./chunk-7xm75w1e.js";var F=M((H)=>{var X=(k,z)=>()=>(z||k((z={exports:{}}).exports,z),z.exports),c=X((k)=>{Object.defineProperty(k,"__esModule",{value:!0}),k.sync=k.isexe=void 0;var z=T("fs"),J=T("fs/promises"),K=async(Z,Q={})=>{let{ignoreErrors:Y=!1}=Q;try{return q(await(0,J.stat)(Z),Q)}catch($){let A=$;if(Y||A.code==="EACCES")return!1;throw A}};k.isexe=K;var V=(Z,Q={})=>{let{ignoreErrors:Y=!1}=Q;try{return q((0,z.statSync)(Z),Q)}catch($){let A=$;if(Y||A.code==="EACCES")return!1;throw A}};k.sync=V;var q=(Z,Q)=>Z.isFile()&&B(Z,Q),B=(Z,Q)=>{let Y=Q.uid??process.getuid?.(),$=Q.groups??process.getgroups?.()??[],A=Q.gid??process.getgid?.()??$[0];if(Y===void 0||A===void 0)throw Error("cannot get uid or gid");let C=new Set([A,...$]),G=Z.mode,U=Z.uid,u=Z.gid,_=parseInt("100",8),L=parseInt("010",8),w=parseInt("001",8),E=_|L;return!!(G&w||G&L&&C.has(u)||G&_&&U===Y||G&E&&Y===0)}}),m=X((k)=>{Object.defineProperty(k,"__esModule",{value:!0}),k.sync=k.isexe=void 0;var z=T("fs"),J=T("fs/promises"),K=T("path"),V=async(Q,Y={})=>{let{ignoreErrors:$=!1}=Y;try{return Z(await(0,J.stat)(Q),Q,Y)}catch(A){let C=A;if($||C.code==="EACCES")return!1;throw C}};k.isexe=V;var q=(Q,Y={})=>{let{ignoreErrors:$=!1}=Y;try{return Z((0,z.statSync)(Q),Q,Y)}catch(A){let C=A;if($||C.code==="EACCES")return!1;throw C}};k.sync=q;var B=(Q,Y)=>{let{pathExt:$=process.env.PATHEXT||""}=Y,A=$.split(K.delimiter);if(A.indexOf("")!==-1)return!0;for(let C of A){let G=C.toLowerCase(),U=Q.substring(Q.length-G.length).toLowerCase();if(G&&U===G)return!0}return!1},Z=(Q,Y,$)=>Q.isFile()&&B(Y,$)}),h=X((k)=>{Object.defineProperty(k,"__esModule",{value:!0})}),N=H&&H.__createBinding||(Object.create?function(k,z,J,K){K===void 0&&(K=J);var V=Object.getOwnPropertyDescriptor(z,J);(!V||("get"in V?!z.__esModule:V.writable||V.configurable))&&(V={enumerable:!0,get:function(){return z[J]}}),Object.defineProperty(k,K,V)}:function(k,z,J,K){K===void 0&&(K=J),k[K]=z[J]}),d=H&&H.__setModuleDefault||(Object.create?function(k,z){Object.defineProperty(k,"default",{enumerable:!0,value:z})}:function(k,z){k.default=z}),O=H&&H.__importStar||function(){var k=function(z){return k=Object.getOwnPropertyNames||function(J){var K=[];for(var V in J)Object.prototype.hasOwnProperty.call(J,V)&&(K[K.length]=V);return K},k(z)};return function(z){if(z&&z.__esModule)return z;var J={};if(z!=null)for(var K=k(z),V=0;V<K.length;V++)K[V]!=="default"&&N(J,z,K[V]);return d(J,z),J}}(),x=H&&H.__exportStar||function(k,z){for(var J in k)J!=="default"&&!Object.prototype.hasOwnProperty.call(z,J)&&N(z,k,J)};Object.defineProperty(H,"__esModule",{value:!0});H.sync=H.isexe=H.posix=H.win32=void 0;var R=O(c());H.posix=R;var W=O(m());H.win32=W;x(h(),H);var a=process.env._ISEXE_TEST_PLATFORM_||process.platform,b=a==="win32"?W:R;H.isexe=b.isexe;H.sync=b.sync});var zk=M((Zk,P)=>{var{isexe:p,sync:o}=F(),{join:r,delimiter:e,sep:I,posix:y}=T("path"),S=process.platform==="win32",D=new RegExp(`[${y.sep}${I===y.sep?"":I}]`.replace(/(\\)/g,"\\$1")),t=new RegExp(`^\\.${D.source}`),g=(k)=>Object.assign(Error(`not found: ${k}`),{code:"ENOENT"}),v=(k,{path:z=process.env.PATH,pathExt:J=process.env.PATHEXT,delimiter:K=e})=>{let V=k.match(D)?[""]:[...S?[process.cwd()]:[],...(z||"").split(K)];if(S){let q=J||[".EXE",".CMD",".BAT",".COM"].join(K),B=q.split(K).flatMap((Z)=>[Z,Z.toLowerCase()]);if(k.includes(".")&&B[0]!=="")B.unshift("");return{pathEnv:V,pathExt:B,pathExtExe:q}}return{pathEnv:V,pathExt:[""]}},f=(k,z)=>{let J=/^".*"$/.test(k)?k.slice(1,-1):k;return(!J&&t.test(z)?z.slice(0,2):"")+r(J,z)},l=async(k,z={})=>{let{pathEnv:J,pathExt:K,pathExtExe:V}=v(k,z),q=[];for(let B of J){let Z=f(B,k);for(let Q of K){let Y=Z+Q;if(await p(Y,{pathExt:V,ignoreErrors:!0})){if(!z.all)return Y;q.push(Y)}}}if(z.all&&q.length)return q;if(z.nothrow)return null;throw g(k)},kk=(k,z={})=>{let{pathEnv:J,pathExt:K,pathExtExe:V}=v(k,z),q=[];for(let B of J){let Z=f(B,k);for(let Q of K){let Y=Z+Q;if(o(Y,{pathExt:V,ignoreErrors:!0})){if(!z.all)return Y;q.push(Y)}}}if(z.all&&q.length)return q;if(z.nothrow)return null;throw g(k)};P.exports=l;l.sync=kk});
|
|
3
|
+
export{zk as Qr};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fk as s,kk as e,lk as j,mk as v,yk as u,zk as f}from"./chunk-
|
|
2
|
+
import{fk as s,kk as e,lk as j,mk as v,yk as u,zk as f}from"./chunk-04n2ycg5.js";import{Ul as r,Vl as C,Wl as k,Xl as m,bm as D,fm as b,gm as a,hm as t}from"./chunk-mcg24gkb.js";import{Um as x,Vm as q,Xm as n,Ym as o,_m as K,an as c,hn as i}from"./chunk-bn0h9dny.js";import{Qs as O_,_s as Q_}from"./chunk-m5m448mg.js";import{nt as d,st as g}from"./chunk-tqj69nh6.js";import{DO as S_}from"./chunk-7xm75w1e.js";var l={};S_(l,{run:()=>h_,encodeDir:()=>k_,ClaudeImport:()=>l});import E_ from"path";import W_ from"path";import{access as X_,readFile as Y_}from"fs/promises";var G=n("external_import",{source:q().$type().notNull(),source_key:q().notNull(),session_id:q().$type().notNull(),source_path:q().notNull(),source_mtime:x().notNull(),time_imported:x().notNull(),message_ids:q({mode:"json"}).$type()},(N)=>[o({columns:[N.source,N.source_key]})]);function Z_(){return{scanned:0,imported:0,resynced:0,skipped:0,errors:[]}}async function L_(N){if(!N||!await g.exists(N))return{id:b.global,worktree:N||"/",vcs:null};if(!await a(N))return{id:b.global,worktree:N,vcs:null};return{id:await t(N),worktree:N,vcs:"git"}}function __(N){return N.split(`
|
|
3
3
|
`).map((_)=>_.trim()).filter(Boolean).flatMap((_)=>{try{return[JSON.parse(_)]}catch{return[]}})}function N_(N){let _=N.find((H)=>H.trim()&&!H.trim().startsWith("<"));if(!_)return;return _.trim().replace(/\s+/g," ").slice(0,100)}function R_(N,_){return D.use((H)=>H.select().from(G).where(c(K(G.source,N),K(G.source_key,_))).get())}function G_(N,_){if(!_)return{existing:void 0,existingUpdated:void 0};let H=_,O=D.use((Z)=>Z.select({updated:C.time_updated}).from(C).where(K(C.id,H.session_id)).get());if(!O)return D.use((Z)=>Z.delete(G).where(c(K(G.source,N),K(G.source_key,H.source_key))).run()),{existing:void 0,existingUpdated:void 0};return{existing:_,existingUpdated:O.updated}}function J_(N,_,H,O){N.insert(r).values({id:_.id,worktree:_.worktree,vcs:_.vcs,sandboxes:[],time_created:H,time_updated:O}).onConflictDoNothing().run()}function K_(N,_,H){if(_.message_ids?.length)for(let O=0;O<_.message_ids.length;O+=500)N.delete(k).where(i(k.id,_.message_ids.slice(O,O+500))).run();else N.delete(k).where(K(k.session_id,H)).run()}function A_(N,_,H){N.update(C).set({project_id:H.projectId,directory:H.directory,version:H.version,time_updated:Math.max(H.existingUpdated??0,H.timeUpdated)}).where(K(C.id,_)).run()}function $_(N){return async(_)=>F_({...N,force:_?.force})}async function F_(N){let _=Z_();if(!await X_(N.root).then(()=>!0).catch(()=>!1))return _;let H=await d.scan(N.pattern,{cwd:N.root,absolute:!0});for(let O of H){_.scanned++;try{let Z=W_.basename(O,".jsonl"),A=await g.statAsync(O);if(!A){_.skipped++;continue}let F=Math.floor(Number(A.mtimeMs)),Y=R_(N.source,Z);if(Y&&Y.source_mtime===F&&!N.force){_.skipped++;continue}let S=G_(N.source,Y);Y=S.existing;let T=S.existingUpdated,Q=Y?Y.session_id:e.descending(),V=N.parse(await Y_(O,"utf-8"),Q);if(!V||V.messages.length===0){_.skipped++;continue}let E=await L_(V.cwd),U=Date.now(),X=V.messages.map(($)=>$.info.id);if(D.transaction(($)=>{if(J_($,E,V.timeCreated,V.timeUpdated),Y)K_($,Y,Q),A_($,Q,{projectId:E.id,directory:V.cwd,version:V.version,existingUpdated:T,timeUpdated:V.timeUpdated});else $.insert(C).values({id:Q,project_id:E.id,slug:s.create(),directory:V.cwd,title:V.title,version:V.version,time_created:V.timeCreated,time_updated:V.timeUpdated}).run();for(let L of V.messages){let{id:B,sessionID:I,agentID:w,...z}=L.info;$.insert(k).values({id:B,session_id:Q,agent_id:"main",time_created:L.info.time.created,data:z}).onConflictDoUpdate({target:k.id,set:{data:z}}).run();for(let J of L.parts){let{id:y,sessionID:p,messageID:P,...h}=J.part;$.insert(m).values({id:y,message_id:L.info.id,session_id:Q,time_created:J.time,data:h}).onConflictDoUpdate({target:m.id,set:{data:h}}).run()}}$.insert(G).values({source:N.source,source_key:Z,session_id:Q,source_path:O,source_mtime:F,time_imported:U,message_ids:X}).onConflictDoUpdate({target:[G.source,G.source_key],set:{session_id:Q,source_path:O,source_mtime:F,time_imported:U,message_ids:X}}).run()}),Y)_.resynced++;else _.imported++}catch(Z){_.errors.push(`${O}: ${Z}`)}}if(_.imported+_.resynced>0||_.errors.length>0)N.log.info(N.logMessage,{..._,errors:_.errors.length});return _}var B_=Q_.create({service:"claude-import"});function k_(N){return N.replace(/[^a-zA-Z0-9]/g,"-")}function z_(N){if(!N)return{providerID:u.anthropic,modelID:f.make("unknown")};let _=N.indexOf("/");if(_===-1)return{providerID:u.anthropic,modelID:f.make(N)};return{providerID:u.make(N.slice(0,_)),modelID:f.make(N.slice(_+1))}}function H_(N){let _=N??{};return{input:_.input_tokens??0,output:_.output_tokens??0,reasoning:0,cache:{read:_.cache_read_input_tokens??0,write:_.cache_creation_input_tokens??0}}}function C_(N){if(typeof N==="string")return N;if(Array.isArray(N))return N.map((_)=>_&&typeof _==="object"&&("type"in _)&&_.type==="text"?_.text:JSON.stringify(_)).join(`
|
|
4
4
|
`);return N==null?"":JSON.stringify(N)}function U_(N,_){let H=__(N);if(H.length===0)return;let O,Z,A,F=0,Y,S=[],T=new Map,Q=null,V=null,E=z_(void 0),U=()=>{if(Q)S.push(Q);Q=null};for(let X of H){if(X.type!=="user"&&X.type!=="assistant")continue;let $=X.timestamp?Date.parse(X.timestamp):Date.now();if(!O&&X.cwd)O=X.cwd;if(!Z&&X.version)Z=X.version;if(A===void 0)A=$;F=Math.max(F,$);let L=X.message;if(!L)continue;if(X.type==="user"){let z=L.content,J=typeof z==="string"?[]:Array.isArray(z)?z:[];for(let W of J.filter((R)=>R?.type==="tool_result")){let R=T.get(W.tool_use_id);if(!R)continue;let M=C_(W.content);R.part.state=W.is_error?{status:"error",input:R.part.state.input??{},error:M,time:{start:R.start,end:$}}:{status:"completed",input:R.part.state.input??{},output:M,title:R.part.tool,metadata:{},time:{start:R.start,end:$}}}let y=typeof z==="string"?z.trim()?[z]:[]:J.filter((W)=>W?.type==="text"&&typeof W.text==="string"&&W.text.trim()).map((W)=>W.text),p=J.filter((W)=>W?.type==="image"&&W.source);if(y.length===0&&p.length===0)continue;U();let P=j.ascending(),h=[];for(let W of y)h.push({part:{id:v.ascending(),sessionID:_,messageID:P,type:"text",text:W},time:$});for(let W of p){let R=W.source.media_type??"image/png",M=W.source.type==="base64"?`data:${R};base64,${W.source.data}`:W.source.url??"";if(M)h.push({part:{id:v.ascending(),sessionID:_,messageID:P,type:"file",mime:R,url:M},time:$})}let V_={id:P,sessionID:_,role:"user",agent:"main",time:{created:$},model:{providerID:E.providerID,modelID:E.modelID}};if(S.push({info:V_,parts:h}),V=P,!Y)Y=N_(y);continue}let B=z_(L.model);if(E=B,!V){let z=j.ascending();S.push({info:{id:z,sessionID:_,role:"user",agent:"main",time:{created:$},model:{providerID:B.providerID,modelID:B.modelID}},parts:[]}),V=z}if(!Q||Q.info.role!=="assistant"||Q.info.parentID!==V)U(),Q={info:{id:j.ascending(),sessionID:_,role:"assistant",time:{created:$,completed:$},parentID:V,modelID:B.modelID,providerID:B.providerID,mode:"build",agent:"main",path:{cwd:O??X.cwd??"",root:O??X.cwd??""},cost:0,tokens:H_(L.usage)},parts:[]};let I=Q.info;I.time.completed=$,I.tokens=H_(L.usage);let w=Q.info.id;for(let z of Array.isArray(L.content)?L.content:[])if(z?.type==="thinking"||z?.type==="reasoning")Q.parts.push({part:{id:v.ascending(),sessionID:_,messageID:w,type:"reasoning",text:z.thinking??z.text??"",time:{start:$,end:$}},time:$});else if(z?.type==="text"&&typeof z.text==="string")Q.parts.push({part:{id:v.ascending(),sessionID:_,messageID:w,type:"text",text:z.text},time:$});else if(z?.type==="tool_use"){let J={id:v.ascending(),sessionID:_,messageID:w,type:"tool",callID:z.id,tool:z.name,state:{status:"pending",input:z.input??{},raw:JSON.stringify(z.input??{})}};Q.parts.push({part:J,time:$}),T.set(z.id,{part:J,start:$})}}return U(),{cwd:O??"",version:Z??"claude-code",title:Y??"Claude Code session",timeCreated:A??Date.now(),timeUpdated:F||A||Date.now(),messages:S}}var h_=$_({source:"cc",root:E_.join(O_.Path.home,".claude","projects"),pattern:"*/*.jsonl",log:B_,logMessage:"claude import",parse:U_});
|
|
5
5
|
export{G as bg,Z_ as cg,L_ as dg,__ as eg,N_ as fg,R_ as gg,G_ as hg,J_ as ig,K_ as jg,A_ as kg,$_ as lg,k_ as mg,h_ as ng,l as og};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{De as u,Ee as f,Fe as _}from"./chunk-
|
|
2
|
+
import{De as u,Ee as f,Fe as _}from"./chunk-1sgahe1s.js";import{$e as R,Ge as z,Ie as C,Me as U,Ne as I,Pe as v,Se as b,af as T,df as S,ff as h,hf as k}from"./chunk-e7ny0b3x.js";import"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import{St as V}from"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-7xm75w1e.js";var m=class{constructor(j,G){this.modelId=j,this.config=G,this.specificationVersion="v3",this.maxImagesPerCall=1}get provider(){return this.config.provider}async doGenerate({prompt:j,n:G,size:P,aspectRatio:W,seed:N,providerOptions:K,headers:Y,abortSignal:X,files:Q,mask:q}){var F,Z,J,A,D;let $=[],B=(J=(Z=(F=this.config._internal)==null?void 0:F.currentDate)==null?void 0:Z.call(F))!=null?J:new Date;if(Q!=null&&Q.length>0){let{value:y,responseHeaders:c}=await T({url:this.getEditUrl(),headers:z(this.config.headers(),Y),formData:U({model:this.modelId,prompt:j,image:await Promise.all(Q.map((H)=>w(H))),mask:q!=null?await w(q):void 0,n:G,size:P,...(A=K.deepinfra)!=null?A:{}},{useArrayBrackets:!1}),failedResponseHandler:S({errorSchema:t,errorToMessage:(H)=>{var x,M;return(M=(x=H.error)==null?void 0:x.message)!=null?M:"Unknown error"}}),successfulResponseHandler:h(d),abortSignal:X,fetch:this.config.fetch});return{images:y.data.map((H)=>H.b64_json),warnings:$,response:{timestamp:B,modelId:this.modelId,headers:c}}}let E=P==null?void 0:P.split("x"),{value:L,responseHeaders:O}=await R({url:`${this.config.baseURL}/${this.modelId}`,headers:z(this.config.headers(),Y),body:{prompt:j,num_images:G,...W&&{aspect_ratio:W},...E&&{width:E[0],height:E[1]},...N!=null&&{seed:N},...(D=K.deepinfra)!=null?D:{}},failedResponseHandler:S({errorSchema:g,errorToMessage:(y)=>y.detail.error}),successfulResponseHandler:h(p),abortSignal:X,fetch:this.config.fetch});return{images:L.images.map((y)=>y.replace(/^data:image\/\w+;base64,/,"")),warnings:$,response:{timestamp:B,modelId:this.modelId,headers:O}}}getEditUrl(){return`${this.config.baseURL.replace("/inference","/openai")}/images/edits`}},g=V.object({detail:V.object({error:V.string()})}),p=V.object({images:V.array(V.string())}),t=V.object({error:V.object({message:V.string()}).optional()}),d=V.object({data:V.array(V.object({b64_json:V.string()}))});async function w(j){if(j.type==="url")return I(j.url);let G=j.data instanceof Uint8Array?j.data:C(j.data);return new Blob([G],{type:j.mediaType})}var l=class extends u{constructor(j,G){super(j,G)}fixUsageForGeminiModels(j){var G,P;if(!j||!((G=j.completion_tokens_details)==null?void 0:G.reasoning_tokens))return j;let W=(P=j.completion_tokens)!=null?P:0,N=j.completion_tokens_details.reasoning_tokens;if(N>W){let K=W+N;return{...j,completion_tokens:K,total_tokens:j.total_tokens!=null?j.total_tokens+N:void 0}}return j}async doGenerate(j){var G,P,W,N,K,Y,X;let Q=await super.doGenerate(j);if((G=Q.usage)==null?void 0:G.raw){let q=this.fixUsageForGeminiModels(Q.usage.raw);if(q!==Q.usage.raw){let F=(P=q.prompt_tokens)!=null?P:0,Z=(W=q.completion_tokens)!=null?W:0,J=(K=(N=q.prompt_tokens_details)==null?void 0:N.cached_tokens)!=null?K:0,A=(X=(Y=q.completion_tokens_details)==null?void 0:Y.reasoning_tokens)!=null?X:0;return{...Q,usage:{inputTokens:{total:F,noCache:F-J,cacheRead:J,cacheWrite:void 0},outputTokens:{total:Z,text:Z-A,reasoning:A},raw:q}}}}return Q}async doStream(j){let G=await super.doStream(j),P=G.stream,W=this.fixUsageForGeminiModels.bind(this),N=new ReadableStream({async start(K){var Y,X,Q,q,F,Z,J;let A=P.getReader();try{while(!0){let{done:D,value:$}=await A.read();if(D)break;if($.type==="finish"&&((Y=$.usage)==null?void 0:Y.raw)){let B=W($.usage.raw);if(B!==$.usage.raw){let E=(X=B.prompt_tokens)!=null?X:0,L=(Q=B.completion_tokens)!=null?Q:0,O=(F=(q=B.prompt_tokens_details)==null?void 0:q.cached_tokens)!=null?F:0,y=(J=(Z=B.completion_tokens_details)==null?void 0:Z.reasoning_tokens)!=null?J:0;K.enqueue({...$,usage:{inputTokens:{total:E,noCache:E-O,cacheRead:O,cacheWrite:void 0},outputTokens:{total:L,text:L-y,reasoning:y},raw:B}})}else K.enqueue($)}else K.enqueue($)}K.close()}catch(D){K.error(D)}}});return{...G,stream:N}}},n="2.0.41";function i(j={}){var G;let P=k((G=j.baseURL)!=null?G:"https://api.deepinfra.com/v1"),W=()=>v({Authorization:`Bearer ${b({apiKey:j.apiKey,environmentVariableName:"DEEPINFRA_API_KEY",description:"DeepInfra's API key"})}`,...j.headers},`ai-sdk/deepinfra/${n}`),N=(F)=>({provider:`deepinfra.${F}`,url:({path:Z})=>`${P}/openai${Z}`,headers:W,fetch:j.fetch}),K=(F)=>{return new l(F,N("chat"))},Y=(F)=>new f(F,N("completion")),X=(F)=>new _(F,N("embedding")),Q=(F)=>new m(F,{...N("image"),baseURL:P?`${P}/inference`:"https://api.deepinfra.com/v1/inference"}),q=(F)=>K(F);return q.specificationVersion="v3",q.completionModel=Y,q.chatModel=K,q.image=Q,q.imageModel=Q,q.languageModel=K,q.embeddingModel=X,q.textEmbeddingModel=X,q}var jj=i();export{jj as deepinfra,i as createDeepInfra,n as VERSION};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import P from"fs";import B from"fs";var x;function K(){try{return B.statSync("/.dockerenv"),!0}catch{return!1}}function M(){try{return B.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function y(){if(x===void 0)x=K()||M();return x}var z,Q=()=>{try{return P.statSync("/run/.containerenv"),!0}catch{return!1}};function q(){if(z===void 0)z=Q()||y();return z}import J from"process";import V from"os";import A from"fs";var H=()=>{if(J.platform!=="linux")return!1;if(V.release().toLowerCase().includes("microsoft")){if(q())return!1;return!0}try{if(A.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!q()}catch{}if(A.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||A.existsSync("/run/WSL"))return!q();return!1},L=J.env.__IS_WSL_TEST__?H:H();
|
|
3
|
-
export{q as
|
|
3
|
+
export{q as pq,L as qq};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ag as i,Bg as j,Cg as k,Dg as l,Eg as m,Fg as n,sg as a,tg as b,ug as c,vg as d,wg as e,xg as f,yg as g,zg as h}from"./chunk-takew94z.js";import"./chunk-vxyy2dp3.js";import"./chunk-r78czx4d.js";import"./chunk-ay8emwym.js";import"./chunk-jbx3s7nw.js";import"./chunk-15hw2z9t.js";import"./chunk-gcw4rn10.js";import"./chunk-m5m448mg.js";import"./chunk-tqj69nh6.js";import"./chunk-ag8kz1e7.js";import"./chunk-5tray1fw.js";import"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-gagtmjmp.js";import"./chunk-zs8kqdsf.js";import"./chunk-7xm75w1e.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{i as P,j as g,k as b,l as h,m as O}from"./chunk-rvkrgkeq.js";import"./chunk-p62gb4wj.js";import"./chunk-x4sp99g6.js";import{Rd as u}from"./chunk-yajd975f.js";import{Vf as s}from"./chunk-rbk8seme.js";import{gh as f}from"./chunk-fq0x3esz.js";import"./chunk-44a82dg0.js";import{ai as E}from"./chunk-vxyy2dp3.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-5hw6xa49.js";import"./chunk-326p5b10.js";import{$j as p,_j as S}from"./chunk-04n2ycg5.js";import"./chunk-8ymffyep.js";import"./chunk-mcg24gkb.js";import"./chunk-redjxn13.js";import"./chunk-bn0h9dny.js";import"./chunk-r4ndwym0.js";import"./chunk-3ytjm3az.js";import"./chunk-htz93dsd.js";import"./chunk-vcw00k0n.js";import"./chunk-r78czx4d.js";import"./chunk-2hc5z7b5.js";import"./chunk-d68fzyw7.js";import"./chunk-4jtxtkj7.js";import"./chunk-ay8emwym.js";import"./chunk-2maqde7w.js";import"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import"./chunk-g5rabwre.js";import"./chunk-jbx3s7nw.js";import"./chunk-15hw2z9t.js";import"./chunk-48ge2ryx.js";import"./chunk-n9xns8by.js";import"./chunk-y9q0hb7b.js";import"./chunk-c1bdzxbx.js";import"./chunk-ehhas0ew.js";import"./chunk-d6ry9418.js";import"./chunk-0dt0bxz6.js";import"./chunk-10bjs581.js";import"./chunk-4cnwn1rh.js";import"./chunk-gcw4rn10.js";import"./chunk-m5m448mg.js";import"./chunk-tqj69nh6.js";import"./chunk-ag8kz1e7.js";import"./chunk-5tray1fw.js";import"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import{Zy as I}from"./chunk-gagtmjmp.js";import{LC as D,pH as l,uB as d}from"./chunk-zs8kqdsf.js";import"./chunk-dxpj0cxh.js";import"./chunk-zw815d68.js";import"./chunk-7xm75w1e.js";var A=(o)=>l.promise(()=>E(o)),m=(o)=>l.sync(()=>s.println(o)),v=(o)=>s.Style.TEXT_DIM+o+s.Style.TEXT_NORMAL,L=(o)=>o?v(" (active)"):"",w=(o,e)=>`${o.email} ${v(o.url)}${L(e)}`,x=(o,e,t)=>`${e.name} (${o.email})${L(t)}`,C=(o,e,t)=>{let n=t?s.Style.TEXT_SUCCESS+"\u25CF"+s.Style.TEXT_NORMAL:" ",c=t?s.Style.TEXT_HIGHLIGHT_BOLD+e.name+s.Style.TEXT_NORMAL:e.name;return` ${n} ${c} ${v(o.email)} ${v(o.url)} ${v(e.id)}`},T=(o,e)=>d.isSome(o)&&o.value.id===e.accountID&&o.value.active_org_id===e.orgID,_=l.fn("login")(function*(o){let e=yield*p.Service;yield*P("Log in");let t=yield*e.login(o);yield*b.info("Go to: "+t.url),yield*b.info("Enter code: "+t.user),yield*A(t.url);let n=O();yield*n.start("Waiting for authorization...");let c=(r)=>l.gen(function*(){yield*l.sleep(r);let i=yield*e.poll(t);if(i._tag==="PollPending")return yield*c(r);if(i._tag==="PollSlow")return yield*c(D.sum(r,D.seconds(5)));return i}),a=yield*c(t.interval).pipe(l.timeout(t.expiry),l.catchTag("TimeoutError",()=>l.succeed(new S)));yield*I.valueTags(a,{PollSuccess:(r)=>l.gen(function*(){yield*n.stop("Logged in as "+r.email),yield*g("Done")}),PollExpired:()=>n.stop("Device code expired",1),PollDenied:()=>n.stop("Authorization denied",1),PollError:(r)=>n.stop("Error: "+String(r.cause),1),PollPending:()=>n.stop("Unexpected state",1),PollSlow:()=>n.stop("Unexpected state",1)})}),N=l.fn("logout")(function*(o){let e=yield*p.Service,t=yield*e.list();if(t.length===0)return yield*m("Not logged in");if(o){let i=t.find((y)=>y.email===o);if(!i)return yield*m("Account not found: "+o);yield*e.remove(i.id),yield*g("Logged out from "+o);return}let n=yield*e.active(),c=d.map(n,(i)=>i.id);yield*P("Log out");let a=t.map((i)=>{let y=d.isSome(c)&&c.value===i.id;return{value:i,label:w(i,y)}}),r=yield*h({message:"Select account to log out",options:a});if(d.isNone(r))return;yield*e.remove(r.value.id),yield*g("Logged out from "+r.value.email)}),$=l.fn("switch")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("Not logged in");let t=yield*o.active(),n=e.flatMap((r)=>r.orgs.map((i)=>{let y=T(t,{accountID:r.account.id,orgID:i.id});return{value:{orgID:i.id,accountID:r.account.id,label:i.name},label:x(r.account,i,y)}}));if(n.length===0)return yield*m("No orgs found");yield*P("Switch org");let c=yield*h({message:"Select org",options:n});if(d.isNone(c))return;let a=c.value;yield*o.use(a.accountID,d.some(a.orgID)),yield*g("Switched to "+a.label)}),R=l.fn("orgs")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("No accounts found");if(!e.some((n)=>n.orgs.length>0))return yield*m("No orgs found");let t=yield*o.active();for(let n of e)for(let c of n.orgs){let a=T(t,{accountID:n.account.id,orgID:c.id});yield*m(C(n.account,c,a))}}),M=l.fn("open")(function*(){let e=yield*(yield*p.Service).active();if(d.isNone(e))return yield*m("No active account");let t=e.value.url;yield*A(t),yield*g("Opened "+t)}),X=u({command:"login <url>",describe:!1,builder:(o)=>o.positional("url",{describe:"server URL",type:"string",demandOption:!0}),async handler(o){s.empty(),await f.runPromise(_(o.url))}}),B=u({command:"logout [email]",describe:!1,builder:(o)=>o.positional("email",{describe:"account email to log out from",type:"string"}),async handler(o){s.empty(),await f.runPromise(N(o.email))}}),U=u({command:"switch",describe:!1,async handler(){s.empty(),await f.runPromise($())}}),G=u({command:"orgs",describe:!1,async handler(){s.empty(),await f.runPromise(R())}}),H=u({command:"open",describe:!1,async handler(){s.empty(),await f.runPromise(M())}}),Y=u({command:"console",describe:!1,builder:(o)=>o.command({...X,describe:"log in to console"}).command({...B,describe:"log out from console"}).command({...U,describe:"switch active org"}).command({...G,describe:"list orgs"}).command({...H,describe:"open active console account"}).demandCommand(),async handler(){}});export{C as formatOrgLine,w as formatAccountLabel,U as SwitchCommand,G as OrgsCommand,H as OpenCommand,B as LogoutCommand,X as LoginCommand,Y as ConsoleCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{AO as T}from"./chunk-zw815d68.js";import{CO as G,FO as J}from"./chunk-7xm75w1e.js";var K=G((Q)=>{Object.defineProperty(Q,"__esModule",{value:!0});Q.AbstractAsyncHooksContextManager=void 0;var b=J("events"),f=["addListener","on","once","prependListener","prependOnceListener"];class P{bind(q,j){if(j instanceof b.EventEmitter)return this._bindEventEmitter(q,j);if(typeof j==="function")return this._bindFunction(q,j);return j}_bindFunction(q,j){let z=this,w=function(...B){return z.with(q,()=>j.apply(this,B))};return Object.defineProperty(w,"length",{enumerable:!1,configurable:!0,writable:!1,value:j.length}),w}_bindEventEmitter(q,j){if(this._getPatchMap(j)!==void 0)return j;if(this._createPatchMap(j),f.forEach((w)=>{if(j[w]===void 0)return;j[w]=this._patchAddListener(j,j[w],q)}),typeof j.removeListener==="function")j.removeListener=this._patchRemoveListener(j,j.removeListener);if(typeof j.off==="function")j.off=this._patchRemoveListener(j,j.off);if(typeof j.removeAllListeners==="function")j.removeAllListeners=this._patchRemoveAllListeners(j,j.removeAllListeners);return j}_patchRemoveListener(q,j){let z=this;return function(w,B){let D=z._getPatchMap(q)?.[w];if(D===void 0)return j.call(this,w,B);let E=D.get(B);return j.call(this,w,E||B)}}_patchRemoveAllListeners(q,j){let z=this;return function(w){let B=z._getPatchMap(q);if(B!==void 0){if(arguments.length===0)z._createPatchMap(q);else if(B[w]!==void 0)delete B[w]}return j.apply(this,arguments)}}_patchAddListener(q,j,z){let w=this;return function(B,D){if(w._wrapped)return j.call(this,B,D);let E=w._getPatchMap(q);if(E===void 0)E=w._createPatchMap(q);let F=E[B];if(F===void 0)F=new WeakMap,E[B]=F;let O=w.bind(z,D);F.set(D,O),w._wrapped=!0;try{return j.call(this,B,O)}finally{w._wrapped=!1}}}_createPatchMap(q){let j=Object.create(null);return q[this._kOtListeners]=j,j}_getPatchMap(q){return q[this._kOtListeners]}_kOtListeners=Symbol("OtListeners");_wrapped=!1}Q.AbstractAsyncHooksContextManager=P});var Y=G((V)=>{Object.defineProperty(V,"__esModule",{value:!0});V.AsyncHooksContextManager=void 0;var u=T(),L=J("async_hooks"),N=K();class U extends N.AbstractAsyncHooksContextManager{_asyncHook;_contexts=new Map;_stack=[];constructor(){super();this._asyncHook=L.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){return this._stack[this._stack.length-1]??u.ROOT_CONTEXT}with(q,j,z,...w){this._enterContext(q);try{return j.call(z,...w)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(q,j){if(j==="TIMERWRAP")return;let z=this._stack[this._stack.length-1];if(z!==void 0)this._contexts.set(q,z)}_destroy(q){this._contexts.delete(q)}_before(q){let j=this._contexts.get(q);if(j!==void 0)this._enterContext(j)}_after(){this._exitContext()}_enterContext(q){this._stack.push(q)}_exitContext(){this._stack.pop()}}V.AsyncHooksContextManager=U});var S=G(($)=>{Object.defineProperty($,"__esModule",{value:!0});$.AsyncLocalStorageContextManager=void 0;var H=T(),k=J("async_hooks"),_=K();class Z extends _.AbstractAsyncHooksContextManager{_asyncLocalStorage;constructor(){super();this._asyncLocalStorage=new k.AsyncLocalStorage}active(){return this._asyncLocalStorage.getStore()??H.ROOT_CONTEXT}with(q,j,z,...w){let B=z==null?j:j.bind(z);return this._asyncLocalStorage.run(q,B,...w)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}}$.AsyncLocalStorageContextManager=Z});var h=G((I)=>{Object.defineProperty(I,"__esModule",{value:!0});I.AsyncLocalStorageContextManager=I.AsyncHooksContextManager=void 0;var C=Y();Object.defineProperty(I,"AsyncHooksContextManager",{enumerable:!0,get:function(){return C.AsyncHooksContextManager}});var y=S();Object.defineProperty(I,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return y.AsyncLocalStorageContextManager}})});export default h();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$e as b,Ge as T,Ie as VG,Ke as c,Oe as h,Ze as l,_e as R,df as f,ef as i,ff as v}from"./chunk-xk7je9y8.js";import{Yp as KG,Zp as s,cq as BG,eq as S}from"./chunk-d0qqgxs4.js";import{Tt as G}from"./chunk-j2zay4da.js";var EG=G.object({error:G.object({message:G.string(),type:G.string().nullish(),param:G.any().nullish(),code:G.union([G.string(),G.number()]).nullish()})}),n={errorSchema:EG,errorToMessage:(Q)=>Q.error.message};function $G(Q){var Y,Z,$,U,z,j;if(Q==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let K=(Y=Q.prompt_tokens)!=null?Y:0,W=(Z=Q.completion_tokens)!=null?Z:0,X=(U=($=Q.prompt_tokens_details)==null?void 0:$.cached_tokens)!=null?U:0,J=(j=(z=Q.completion_tokens_details)==null?void 0:z.reasoning_tokens)!=null?j:0;return{inputTokens:{total:K,noCache:K-X,cacheRead:X,cacheWrite:void 0},outputTokens:{total:W,text:W-J,reasoning:J},raw:Q}}function C(Q){var Y,Z;return(Z=(Y=Q==null?void 0:Q.providerOptions)==null?void 0:Y.openaiCompatible)!=null?Z:{}}function HG(Q){switch(Q){case"audio/wav":return"wav";case"audio/mp3":case"audio/mpeg":return"mp3";default:return null}}function AG(Q){var Y,Z,$;let U=[];for(let{role:z,content:j,...K}of Q){let W=C({...K});switch(z){case"system":{U.push({role:"system",content:j,...W});break}case"user":{if(j.length===1&&j[0].type==="text"){U.push({role:"user",content:j[0].text,...C(j[0])});break}U.push({role:"user",content:j.map((X)=>{var J;let B=C(X);switch(X.type){case"text":return{type:"text",text:X.text,...B};case"file":{if(X.mediaType.startsWith("image/")){let L=X.mediaType==="image/*"?"image/jpeg":X.mediaType;return{type:"image_url",image_url:{url:X.data instanceof URL?X.data.toString():`data:${L};base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("audio/")){if(X.data instanceof URL)throw new S({functionality:"audio file parts with URLs"});let L=HG(X.mediaType);if(L===null)throw new S({functionality:`audio media type ${X.mediaType}`});return{type:"input_audio",input_audio:{data:c(X.data),format:L},...B}}if(X.mediaType==="application/pdf"){if(X.data instanceof URL)throw new S({functionality:"PDF file parts with URLs"});return{type:"file",file:{filename:(J=X.filename)!=null?J:"document.pdf",file_data:`data:application/pdf;base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("text/"))return{type:"text",text:X.data instanceof URL?X.data.toString():typeof X.data==="string"?new TextDecoder().decode(VG(X.data)):new TextDecoder().decode(X.data),...B};throw new S({functionality:`file part media type ${X.mediaType}`})}}}),...W});break}case"assistant":{let X="",J="",B=[];for(let L of j){let N=C(L);switch(L.type){case"text":{X+=L.text;break}case"reasoning":{J+=L.text;break}case"tool-call":{let H=(Z=(Y=L.providerOptions)==null?void 0:Y.google)==null?void 0:Z.thoughtSignature;B.push({id:L.toolCallId,type:"function",function:{name:L.toolName,arguments:JSON.stringify(L.input)},...N,...H?{extra_content:{google:{thought_signature:String(H)}}}:{}});break}}}U.push({role:"assistant",content:X,...J.length>0?{reasoning_content:J}:{},tool_calls:B.length>0?B:void 0,...W});break}case"tool":{for(let X of j){if(X.type==="tool-approval-response")continue;let J=X.output,B;switch(J.type){case"text":case"error-text":B=J.value;break;case"execution-denied":B=($=J.reason)!=null?$:"Tool execution denied.";break;case"content":case"json":case"error-json":B=JSON.stringify(J.value);break}let L=C(X);U.push({role:"tool",tool_call_id:X.toolCallId,content:B,...L})}break}default:throw Error(`Unsupported role: ${z}`)}}return U}function JG({id:Q,model:Y,created:Z}){return{id:Q!=null?Q:void 0,modelId:Y!=null?Y:void 0,timestamp:Z!=null?new Date(Z*1000):void 0}}function UG(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var d=G.object({user:G.string().optional(),reasoningEffort:G.string().optional(),textVerbosity:G.string().optional(),strictJsonSchema:G.boolean().optional()});function PG({tools:Q,toolChoice:Y}){Q=(Q==null?void 0:Q.length)?Q:void 0;let Z=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:Z};let $=[];for(let z of Q)if(z.type==="provider")Z.push({type:"unsupported",feature:`provider-defined tool ${z.id}`});else $.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(Y==null)return{tools:$,toolChoice:void 0,toolWarnings:Z};let U=Y.type;switch(U){case"auto":case"none":case"required":return{tools:$,toolChoice:U,toolWarnings:Z};case"tool":return{tools:$,toolChoice:{type:"function",function:{name:Y.toolName}},toolWarnings:Z};default:throw new S({functionality:`tool choice type: ${U}`})}}var CG=class{constructor(Q,Y){this.specificationVersion="v3";var Z,$;this.modelId=Q,this.config=Y;let U=(Z=Y.errorStructure)!=null?Z:n;this.chunkSchema=DG(U.errorSchema),this.failedResponseHandler=f(U),this.supportsStructuredOutputs=($=Y.supportsStructuredOutputs)!=null?$:!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var Q,Y,Z;return(Z=(Y=(Q=this.config).supportedUrls)==null?void 0:Y.call(Q))!=null?Z:{}}transformRequestBody(Q){var Y,Z,$;return($=(Z=(Y=this.config).transformRequestBody)==null?void 0:Z.call(Y,Q))!=null?$:Q}async getArgs({prompt:Q,maxOutputTokens:Y,temperature:Z,topP:$,topK:U,frequencyPenalty:z,presencePenalty:j,providerOptions:K,stopSequences:W,responseFormat:X,seed:J,toolChoice:B,tools:L}){var N,H,E,V,q;let A=[],I=await R({provider:"openai-compatible",providerOptions:K,schema:d});if(I!=null)A.push({type:"other",message:"The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead."});let D=Object.assign(I!=null?I:{},(N=await R({provider:"openaiCompatible",providerOptions:K,schema:d}))!=null?N:{},(H=await R({provider:this.providerOptionsName,providerOptions:K,schema:d}))!=null?H:{}),P=(E=D==null?void 0:D.strictJsonSchema)!=null?E:!0;if(U!=null)A.push({type:"unsupported",feature:"topK"});if((X==null?void 0:X.type)==="json"&&X.schema!=null&&!this.supportsStructuredOutputs)A.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:w,toolChoice:y,toolWarnings:u}=PG({tools:L,toolChoice:B});return{args:{model:this.modelId,user:D.user,max_tokens:Y,temperature:Z,top_p:$,frequency_penalty:z,presence_penalty:j,response_format:(X==null?void 0:X.type)==="json"?this.supportsStructuredOutputs===!0&&X.schema!=null?{type:"json_schema",json_schema:{schema:X.schema,strict:P,name:(V=X.name)!=null?V:"response",description:X.description}}:{type:"json_object"}:void 0,stop:W,seed:J,...Object.fromEntries(Object.entries((q=K==null?void 0:K[this.providerOptionsName])!=null?q:{}).filter(([g])=>!Object.keys(d.shape).includes(g))),reasoning_effort:D.reasoningEffort,verbosity:D.textVerbosity,messages:AG(Q),tools:w,tool_choice:y},warnings:[...A,...u]}}async doGenerate(Q){var Y,Z,$,U,z,j,K,W;let{args:X,warnings:J}=await this.getArgs({...Q}),B=this.transformRequestBody(X),L=JSON.stringify(B),{responseHeaders:N,value:H,rawValue:E}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:B,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:v(qG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),V=H.choices[0],q=[],A=V.message.content;if(A!=null&&A.length>0)q.push({type:"text",text:A});let I=(Y=V.message.reasoning_content)!=null?Y:V.message.reasoning;if(I!=null&&I.length>0)q.push({type:"reasoning",text:I});if(V.message.tool_calls!=null)for(let w of V.message.tool_calls){let y=($=(Z=w.extra_content)==null?void 0:Z.google)==null?void 0:$.thought_signature;q.push({type:"tool-call",toolCallId:(U=w.id)!=null?U:h(),toolName:w.function.name,input:w.function.arguments,...y?{providerMetadata:{[this.providerOptionsName]:{thoughtSignature:y}}}:{}})}let D={[this.providerOptionsName]:{},...await((j=(z=this.config.metadataExtractor)==null?void 0:z.extractMetadata)==null?void 0:j.call(z,{parsedBody:E}))},P=(K=H.usage)==null?void 0:K.completion_tokens_details;if((P==null?void 0:P.accepted_prediction_tokens)!=null)D[this.providerOptionsName].acceptedPredictionTokens=P==null?void 0:P.accepted_prediction_tokens;if((P==null?void 0:P.rejected_prediction_tokens)!=null)D[this.providerOptionsName].rejectedPredictionTokens=P==null?void 0:P.rejected_prediction_tokens;return{content:q,finishReason:{unified:UG(V.finish_reason),raw:(W=V.finish_reason)!=null?W:void 0},usage:$G(H.usage),providerMetadata:D,request:{body:L},response:{...JG(H),headers:N,body:E},warnings:J}}async doStream(Q){var Y;let{args:Z,warnings:$}=await this.getArgs({...Q}),U=this.transformRequestBody({...Z,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0}),z=(Y=this.config.metadataExtractor)==null?void 0:Y.createStreamExtractor(),{responseHeaders:j,value:K}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:U,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:i(this.chunkSchema),abortSignal:Q.abortSignal,fetch:this.config.fetch}),W=[],X={unified:"other",raw:void 0},J=void 0,B=!0,L=this.providerOptionsName,N=!1,H=!1;return{stream:K.pipeThrough(new TransformStream({start(E){E.enqueue({type:"stream-start",warnings:$})},transform(E,V){var q,A,I,D,P,w,y,u,g,a,r,t,e,o,GG,QG,XG,YG;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:E.rawValue});if(!E.success){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.error});return}if(z==null||z.processChunk(E.rawValue),"error"in E.value){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.value.error.message});return}let _=E.value;if(B)B=!1,V.enqueue({type:"response-metadata",...JG(_)});if(_.usage!=null)J=_.usage;let O=_.choices[0];if((O==null?void 0:O.finish_reason)!=null)X={unified:UG(O.finish_reason),raw:(q=O.finish_reason)!=null?q:void 0};if((O==null?void 0:O.delta)==null)return;let k=O.delta,ZG=(A=k.reasoning_content)!=null?A:k.reasoning;if(ZG){if(!N)V.enqueue({type:"reasoning-start",id:"reasoning-0"}),N=!0;V.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:ZG})}if(k.content){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;if(!H)V.enqueue({type:"text-start",id:"txt-0"}),H=!0;V.enqueue({type:"text-delta",id:"txt-0",delta:k.content})}if(k.tool_calls!=null){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;for(let x of k.tool_calls){let m=(I=x.index)!=null?I:W.length;if(W[m]==null){if(x.id==null)throw new s({data:x,message:"Expected 'id' to be a string."});if(((D=x.function)==null?void 0:D.name)==null)throw new s({data:x,message:"Expected 'function.name' to be a string."});V.enqueue({type:"tool-input-start",id:x.id,toolName:x.function.name}),W[m]={id:x.id,type:"function",function:{name:x.function.name,arguments:(P=x.function.arguments)!=null?P:""},hasFinished:!1,thoughtSignature:(u=(y=(w=x.extra_content)==null?void 0:w.google)==null?void 0:y.thought_signature)!=null?u:void 0};let M=W[m];if(((g=M.function)==null?void 0:g.name)!=null&&((a=M.function)==null?void 0:a.arguments)!=null){if(M.function.arguments.length>0)V.enqueue({type:"tool-input-delta",id:M.id,delta:M.function.arguments});if(l(M.function.arguments))V.enqueue({type:"tool-input-end",id:M.id}),V.enqueue({type:"tool-call",toolCallId:(r=M.id)!=null?r:h(),toolName:M.function.name,input:M.function.arguments,...M.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:M.thoughtSignature}}}:{}}),M.hasFinished=!0}continue}let F=W[m];if(F.hasFinished)continue;if(((t=x.function)==null?void 0:t.arguments)!=null)F.function.arguments+=(o=(e=x.function)==null?void 0:e.arguments)!=null?o:"";if(V.enqueue({type:"tool-input-delta",id:F.id,delta:(GG=x.function.arguments)!=null?GG:""}),((QG=F.function)==null?void 0:QG.name)!=null&&((XG=F.function)==null?void 0:XG.arguments)!=null&&l(F.function.arguments))V.enqueue({type:"tool-input-end",id:F.id}),V.enqueue({type:"tool-call",toolCallId:(YG=F.id)!=null?YG:h(),toolName:F.function.name,input:F.function.arguments,...F.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:F.thoughtSignature}}}:{}}),F.hasFinished=!0}}},flush(E){var V,q,A,I,D;if(N)E.enqueue({type:"reasoning-end",id:"reasoning-0"});if(H)E.enqueue({type:"text-end",id:"txt-0"});for(let w of W.filter((y)=>!y.hasFinished))E.enqueue({type:"tool-input-end",id:w.id}),E.enqueue({type:"tool-call",toolCallId:(V=w.id)!=null?V:h(),toolName:w.function.name,input:w.function.arguments,...w.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:w.thoughtSignature}}}:{}});let P={[L]:{},...z==null?void 0:z.buildMetadata()};if(((q=J==null?void 0:J.completion_tokens_details)==null?void 0:q.accepted_prediction_tokens)!=null)P[L].acceptedPredictionTokens=(A=J==null?void 0:J.completion_tokens_details)==null?void 0:A.accepted_prediction_tokens;if(((I=J==null?void 0:J.completion_tokens_details)==null?void 0:I.rejected_prediction_tokens)!=null)P[L].rejectedPredictionTokens=(D=J==null?void 0:J.completion_tokens_details)==null?void 0:D.rejected_prediction_tokens;E.enqueue({type:"finish",finishReason:X,usage:$G(J),providerMetadata:P})}})),request:{body:U},response:{headers:j}}}},WG=G.looseObject({prompt_tokens:G.number().nullish(),completion_tokens:G.number().nullish(),total_tokens:G.number().nullish(),prompt_tokens_details:G.object({cached_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish(),accepted_prediction_tokens:G.number().nullish(),rejected_prediction_tokens:G.number().nullish()}).nullish()}).nullish(),qG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({message:G.object({role:G.literal("assistant").nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({id:G.string().nullish(),function:G.object({name:G.string(),arguments:G.string()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}),finish_reason:G.string().nullish()})),usage:WG}),wG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({delta:G.object({role:G.enum(["assistant"]).nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({index:G.number().nullish(),id:G.string().nullish(),function:G.object({name:G.string().nullish(),arguments:G.string().nullish()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}).nullish(),finish_reason:G.string().nullish()})),usage:WG}),DG=(Q)=>G.union([wG,Q]);function jG(Q){var Y,Z;if(Q==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let $=(Y=Q.prompt_tokens)!=null?Y:0,U=(Z=Q.completion_tokens)!=null?Z:0;return{inputTokens:{total:$,noCache:$,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:U,text:U,reasoning:void 0},raw:Q}}function xG({prompt:Q,user:Y="user",assistant:Z="assistant"}){let $="";if(Q[0].role==="system")$+=`${Q[0].content}
|
|
2
|
+
import{$e as b,Ge as T,Ie as VG,Ke as c,Oe as h,Ze as l,_e as R,df as f,ef as i,ff as v}from"./chunk-e7ny0b3x.js";import{Xp as KG,Yp as s,bq as BG,dq as S}from"./chunk-kj20f048.js";import{St as G}from"./chunk-c11d28qn.js";var EG=G.object({error:G.object({message:G.string(),type:G.string().nullish(),param:G.any().nullish(),code:G.union([G.string(),G.number()]).nullish()})}),n={errorSchema:EG,errorToMessage:(Q)=>Q.error.message};function $G(Q){var Y,Z,$,U,z,j;if(Q==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let K=(Y=Q.prompt_tokens)!=null?Y:0,W=(Z=Q.completion_tokens)!=null?Z:0,X=(U=($=Q.prompt_tokens_details)==null?void 0:$.cached_tokens)!=null?U:0,J=(j=(z=Q.completion_tokens_details)==null?void 0:z.reasoning_tokens)!=null?j:0;return{inputTokens:{total:K,noCache:K-X,cacheRead:X,cacheWrite:void 0},outputTokens:{total:W,text:W-J,reasoning:J},raw:Q}}function C(Q){var Y,Z;return(Z=(Y=Q==null?void 0:Q.providerOptions)==null?void 0:Y.openaiCompatible)!=null?Z:{}}function HG(Q){switch(Q){case"audio/wav":return"wav";case"audio/mp3":case"audio/mpeg":return"mp3";default:return null}}function AG(Q){var Y,Z,$;let U=[];for(let{role:z,content:j,...K}of Q){let W=C({...K});switch(z){case"system":{U.push({role:"system",content:j,...W});break}case"user":{if(j.length===1&&j[0].type==="text"){U.push({role:"user",content:j[0].text,...C(j[0])});break}U.push({role:"user",content:j.map((X)=>{var J;let B=C(X);switch(X.type){case"text":return{type:"text",text:X.text,...B};case"file":{if(X.mediaType.startsWith("image/")){let L=X.mediaType==="image/*"?"image/jpeg":X.mediaType;return{type:"image_url",image_url:{url:X.data instanceof URL?X.data.toString():`data:${L};base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("audio/")){if(X.data instanceof URL)throw new S({functionality:"audio file parts with URLs"});let L=HG(X.mediaType);if(L===null)throw new S({functionality:`audio media type ${X.mediaType}`});return{type:"input_audio",input_audio:{data:c(X.data),format:L},...B}}if(X.mediaType==="application/pdf"){if(X.data instanceof URL)throw new S({functionality:"PDF file parts with URLs"});return{type:"file",file:{filename:(J=X.filename)!=null?J:"document.pdf",file_data:`data:application/pdf;base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("text/"))return{type:"text",text:X.data instanceof URL?X.data.toString():typeof X.data==="string"?new TextDecoder().decode(VG(X.data)):new TextDecoder().decode(X.data),...B};throw new S({functionality:`file part media type ${X.mediaType}`})}}}),...W});break}case"assistant":{let X="",J="",B=[];for(let L of j){let N=C(L);switch(L.type){case"text":{X+=L.text;break}case"reasoning":{J+=L.text;break}case"tool-call":{let H=(Z=(Y=L.providerOptions)==null?void 0:Y.google)==null?void 0:Z.thoughtSignature;B.push({id:L.toolCallId,type:"function",function:{name:L.toolName,arguments:JSON.stringify(L.input)},...N,...H?{extra_content:{google:{thought_signature:String(H)}}}:{}});break}}}U.push({role:"assistant",content:X,...J.length>0?{reasoning_content:J}:{},tool_calls:B.length>0?B:void 0,...W});break}case"tool":{for(let X of j){if(X.type==="tool-approval-response")continue;let J=X.output,B;switch(J.type){case"text":case"error-text":B=J.value;break;case"execution-denied":B=($=J.reason)!=null?$:"Tool execution denied.";break;case"content":case"json":case"error-json":B=JSON.stringify(J.value);break}let L=C(X);U.push({role:"tool",tool_call_id:X.toolCallId,content:B,...L})}break}default:throw Error(`Unsupported role: ${z}`)}}return U}function JG({id:Q,model:Y,created:Z}){return{id:Q!=null?Q:void 0,modelId:Y!=null?Y:void 0,timestamp:Z!=null?new Date(Z*1000):void 0}}function UG(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var d=G.object({user:G.string().optional(),reasoningEffort:G.string().optional(),textVerbosity:G.string().optional(),strictJsonSchema:G.boolean().optional()});function PG({tools:Q,toolChoice:Y}){Q=(Q==null?void 0:Q.length)?Q:void 0;let Z=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:Z};let $=[];for(let z of Q)if(z.type==="provider")Z.push({type:"unsupported",feature:`provider-defined tool ${z.id}`});else $.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(Y==null)return{tools:$,toolChoice:void 0,toolWarnings:Z};let U=Y.type;switch(U){case"auto":case"none":case"required":return{tools:$,toolChoice:U,toolWarnings:Z};case"tool":return{tools:$,toolChoice:{type:"function",function:{name:Y.toolName}},toolWarnings:Z};default:throw new S({functionality:`tool choice type: ${U}`})}}var CG=class{constructor(Q,Y){this.specificationVersion="v3";var Z,$;this.modelId=Q,this.config=Y;let U=(Z=Y.errorStructure)!=null?Z:n;this.chunkSchema=DG(U.errorSchema),this.failedResponseHandler=f(U),this.supportsStructuredOutputs=($=Y.supportsStructuredOutputs)!=null?$:!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var Q,Y,Z;return(Z=(Y=(Q=this.config).supportedUrls)==null?void 0:Y.call(Q))!=null?Z:{}}transformRequestBody(Q){var Y,Z,$;return($=(Z=(Y=this.config).transformRequestBody)==null?void 0:Z.call(Y,Q))!=null?$:Q}async getArgs({prompt:Q,maxOutputTokens:Y,temperature:Z,topP:$,topK:U,frequencyPenalty:z,presencePenalty:j,providerOptions:K,stopSequences:W,responseFormat:X,seed:J,toolChoice:B,tools:L}){var N,H,E,V,q;let A=[],I=await R({provider:"openai-compatible",providerOptions:K,schema:d});if(I!=null)A.push({type:"other",message:"The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead."});let D=Object.assign(I!=null?I:{},(N=await R({provider:"openaiCompatible",providerOptions:K,schema:d}))!=null?N:{},(H=await R({provider:this.providerOptionsName,providerOptions:K,schema:d}))!=null?H:{}),P=(E=D==null?void 0:D.strictJsonSchema)!=null?E:!0;if(U!=null)A.push({type:"unsupported",feature:"topK"});if((X==null?void 0:X.type)==="json"&&X.schema!=null&&!this.supportsStructuredOutputs)A.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:w,toolChoice:y,toolWarnings:u}=PG({tools:L,toolChoice:B});return{args:{model:this.modelId,user:D.user,max_tokens:Y,temperature:Z,top_p:$,frequency_penalty:z,presence_penalty:j,response_format:(X==null?void 0:X.type)==="json"?this.supportsStructuredOutputs===!0&&X.schema!=null?{type:"json_schema",json_schema:{schema:X.schema,strict:P,name:(V=X.name)!=null?V:"response",description:X.description}}:{type:"json_object"}:void 0,stop:W,seed:J,...Object.fromEntries(Object.entries((q=K==null?void 0:K[this.providerOptionsName])!=null?q:{}).filter(([g])=>!Object.keys(d.shape).includes(g))),reasoning_effort:D.reasoningEffort,verbosity:D.textVerbosity,messages:AG(Q),tools:w,tool_choice:y},warnings:[...A,...u]}}async doGenerate(Q){var Y,Z,$,U,z,j,K,W;let{args:X,warnings:J}=await this.getArgs({...Q}),B=this.transformRequestBody(X),L=JSON.stringify(B),{responseHeaders:N,value:H,rawValue:E}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:B,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:v(qG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),V=H.choices[0],q=[],A=V.message.content;if(A!=null&&A.length>0)q.push({type:"text",text:A});let I=(Y=V.message.reasoning_content)!=null?Y:V.message.reasoning;if(I!=null&&I.length>0)q.push({type:"reasoning",text:I});if(V.message.tool_calls!=null)for(let w of V.message.tool_calls){let y=($=(Z=w.extra_content)==null?void 0:Z.google)==null?void 0:$.thought_signature;q.push({type:"tool-call",toolCallId:(U=w.id)!=null?U:h(),toolName:w.function.name,input:w.function.arguments,...y?{providerMetadata:{[this.providerOptionsName]:{thoughtSignature:y}}}:{}})}let D={[this.providerOptionsName]:{},...await((j=(z=this.config.metadataExtractor)==null?void 0:z.extractMetadata)==null?void 0:j.call(z,{parsedBody:E}))},P=(K=H.usage)==null?void 0:K.completion_tokens_details;if((P==null?void 0:P.accepted_prediction_tokens)!=null)D[this.providerOptionsName].acceptedPredictionTokens=P==null?void 0:P.accepted_prediction_tokens;if((P==null?void 0:P.rejected_prediction_tokens)!=null)D[this.providerOptionsName].rejectedPredictionTokens=P==null?void 0:P.rejected_prediction_tokens;return{content:q,finishReason:{unified:UG(V.finish_reason),raw:(W=V.finish_reason)!=null?W:void 0},usage:$G(H.usage),providerMetadata:D,request:{body:L},response:{...JG(H),headers:N,body:E},warnings:J}}async doStream(Q){var Y;let{args:Z,warnings:$}=await this.getArgs({...Q}),U=this.transformRequestBody({...Z,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0}),z=(Y=this.config.metadataExtractor)==null?void 0:Y.createStreamExtractor(),{responseHeaders:j,value:K}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:U,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:i(this.chunkSchema),abortSignal:Q.abortSignal,fetch:this.config.fetch}),W=[],X={unified:"other",raw:void 0},J=void 0,B=!0,L=this.providerOptionsName,N=!1,H=!1;return{stream:K.pipeThrough(new TransformStream({start(E){E.enqueue({type:"stream-start",warnings:$})},transform(E,V){var q,A,I,D,P,w,y,u,g,a,r,t,e,o,GG,QG,XG,YG;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:E.rawValue});if(!E.success){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.error});return}if(z==null||z.processChunk(E.rawValue),"error"in E.value){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.value.error.message});return}let _=E.value;if(B)B=!1,V.enqueue({type:"response-metadata",...JG(_)});if(_.usage!=null)J=_.usage;let O=_.choices[0];if((O==null?void 0:O.finish_reason)!=null)X={unified:UG(O.finish_reason),raw:(q=O.finish_reason)!=null?q:void 0};if((O==null?void 0:O.delta)==null)return;let k=O.delta,ZG=(A=k.reasoning_content)!=null?A:k.reasoning;if(ZG){if(!N)V.enqueue({type:"reasoning-start",id:"reasoning-0"}),N=!0;V.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:ZG})}if(k.content){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;if(!H)V.enqueue({type:"text-start",id:"txt-0"}),H=!0;V.enqueue({type:"text-delta",id:"txt-0",delta:k.content})}if(k.tool_calls!=null){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;for(let x of k.tool_calls){let m=(I=x.index)!=null?I:W.length;if(W[m]==null){if(x.id==null)throw new s({data:x,message:"Expected 'id' to be a string."});if(((D=x.function)==null?void 0:D.name)==null)throw new s({data:x,message:"Expected 'function.name' to be a string."});V.enqueue({type:"tool-input-start",id:x.id,toolName:x.function.name}),W[m]={id:x.id,type:"function",function:{name:x.function.name,arguments:(P=x.function.arguments)!=null?P:""},hasFinished:!1,thoughtSignature:(u=(y=(w=x.extra_content)==null?void 0:w.google)==null?void 0:y.thought_signature)!=null?u:void 0};let M=W[m];if(((g=M.function)==null?void 0:g.name)!=null&&((a=M.function)==null?void 0:a.arguments)!=null){if(M.function.arguments.length>0)V.enqueue({type:"tool-input-delta",id:M.id,delta:M.function.arguments});if(l(M.function.arguments))V.enqueue({type:"tool-input-end",id:M.id}),V.enqueue({type:"tool-call",toolCallId:(r=M.id)!=null?r:h(),toolName:M.function.name,input:M.function.arguments,...M.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:M.thoughtSignature}}}:{}}),M.hasFinished=!0}continue}let F=W[m];if(F.hasFinished)continue;if(((t=x.function)==null?void 0:t.arguments)!=null)F.function.arguments+=(o=(e=x.function)==null?void 0:e.arguments)!=null?o:"";if(V.enqueue({type:"tool-input-delta",id:F.id,delta:(GG=x.function.arguments)!=null?GG:""}),((QG=F.function)==null?void 0:QG.name)!=null&&((XG=F.function)==null?void 0:XG.arguments)!=null&&l(F.function.arguments))V.enqueue({type:"tool-input-end",id:F.id}),V.enqueue({type:"tool-call",toolCallId:(YG=F.id)!=null?YG:h(),toolName:F.function.name,input:F.function.arguments,...F.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:F.thoughtSignature}}}:{}}),F.hasFinished=!0}}},flush(E){var V,q,A,I,D;if(N)E.enqueue({type:"reasoning-end",id:"reasoning-0"});if(H)E.enqueue({type:"text-end",id:"txt-0"});for(let w of W.filter((y)=>!y.hasFinished))E.enqueue({type:"tool-input-end",id:w.id}),E.enqueue({type:"tool-call",toolCallId:(V=w.id)!=null?V:h(),toolName:w.function.name,input:w.function.arguments,...w.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:w.thoughtSignature}}}:{}});let P={[L]:{},...z==null?void 0:z.buildMetadata()};if(((q=J==null?void 0:J.completion_tokens_details)==null?void 0:q.accepted_prediction_tokens)!=null)P[L].acceptedPredictionTokens=(A=J==null?void 0:J.completion_tokens_details)==null?void 0:A.accepted_prediction_tokens;if(((I=J==null?void 0:J.completion_tokens_details)==null?void 0:I.rejected_prediction_tokens)!=null)P[L].rejectedPredictionTokens=(D=J==null?void 0:J.completion_tokens_details)==null?void 0:D.rejected_prediction_tokens;E.enqueue({type:"finish",finishReason:X,usage:$G(J),providerMetadata:P})}})),request:{body:U},response:{headers:j}}}},WG=G.looseObject({prompt_tokens:G.number().nullish(),completion_tokens:G.number().nullish(),total_tokens:G.number().nullish(),prompt_tokens_details:G.object({cached_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish(),accepted_prediction_tokens:G.number().nullish(),rejected_prediction_tokens:G.number().nullish()}).nullish()}).nullish(),qG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({message:G.object({role:G.literal("assistant").nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({id:G.string().nullish(),function:G.object({name:G.string(),arguments:G.string()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}),finish_reason:G.string().nullish()})),usage:WG}),wG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({delta:G.object({role:G.enum(["assistant"]).nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({index:G.number().nullish(),id:G.string().nullish(),function:G.object({name:G.string().nullish(),arguments:G.string().nullish()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}).nullish(),finish_reason:G.string().nullish()})),usage:WG}),DG=(Q)=>G.union([wG,Q]);function jG(Q){var Y,Z;if(Q==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let $=(Y=Q.prompt_tokens)!=null?Y:0,U=(Z=Q.completion_tokens)!=null?Z:0;return{inputTokens:{total:$,noCache:$,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:U,text:U,reasoning:void 0},raw:Q}}function xG({prompt:Q,user:Y="user",assistant:Z="assistant"}){let $="";if(Q[0].role==="system")$+=`${Q[0].content}
|
|
3
3
|
|
|
4
4
|
`,Q=Q.slice(1);for(let{role:U,content:z}of Q)switch(U){case"system":throw new KG({message:"Unexpected system message in prompt: ${content}",prompt:Q});case"user":{let j=z.map((K)=>{switch(K.type){case"text":return K.text}}).filter(Boolean).join("");$+=`${Y}:
|
|
5
5
|
${j}
|